InvokeAI/invokeai/frontend/web/dist/assets/index-f820e2e3.js
2023-11-20 18:48:17 +11:00

158 lines
1.4 MiB
Raw Blame History

This file contains invisible Unicode characters

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

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

var fq=Object.defineProperty;var hq=(e,t,n)=>t in e?fq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Q2=(e,t,n)=>(hq(e,typeof t!="symbol"?t+"":t,n),n),Y2=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var te=(e,t,n)=>(Y2(e,t,"read from private field"),n?n.call(e):t.get(e)),Gt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},$i=(e,t,n,r)=>(Y2(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var eh=(e,t,n,r)=>({set _(i){$i(e,t,i,n)},get _(){return te(e,t,r)}}),Go=(e,t,n)=>(Y2(e,t,"access private method"),n);function gO(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pq(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var mO={exports:{}},Sb={},yO={exports:{}},Ke={};/**
* @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 rm=Symbol.for("react.element"),gq=Symbol.for("react.portal"),mq=Symbol.for("react.fragment"),yq=Symbol.for("react.strict_mode"),vq=Symbol.for("react.profiler"),bq=Symbol.for("react.provider"),_q=Symbol.for("react.context"),Sq=Symbol.for("react.forward_ref"),xq=Symbol.for("react.suspense"),wq=Symbol.for("react.memo"),Cq=Symbol.for("react.lazy"),JA=Symbol.iterator;function Eq(e){return e===null||typeof e!="object"?null:(e=JA&&e[JA]||e["@@iterator"],typeof e=="function"?e:null)}var vO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bO=Object.assign,_O={};function Pf(e,t,n){this.props=e,this.context=t,this.refs=_O,this.updater=n||vO}Pf.prototype.isReactComponent={};Pf.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")};Pf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SO(){}SO.prototype=Pf.prototype;function t4(e,t,n){this.props=e,this.context=t,this.refs=_O,this.updater=n||vO}var n4=t4.prototype=new SO;n4.constructor=t4;bO(n4,Pf.prototype);n4.isPureReactComponent=!0;var eP=Array.isArray,xO=Object.prototype.hasOwnProperty,r4={current:null},wO={key:!0,ref:!0,__self:!0,__source:!0};function CO(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)xO.call(t,r)&&!wO.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:rm,type:e,key:o,ref:a,props:i,_owner:r4.current}}function Tq(e,t){return{$$typeof:rm,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function i4(e){return typeof e=="object"&&e!==null&&e.$$typeof===rm}function Aq(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var tP=/\/+/g;function Z2(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Aq(""+e.key):t.toString(36)}function Ay(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case rm:case gq:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Z2(a,0):r,eP(i)?(n="",e!=null&&(n=e.replace(tP,"$&/")+"/"),Ay(i,t,n,"",function(u){return u})):i!=null&&(i4(i)&&(i=Tq(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(tP,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",eP(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+Z2(o,s);a+=Ay(o,t,n,l,i)}else if(l=Eq(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+Z2(o,s++),a+=Ay(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 a}function t0(e,t,n){if(e==null)return e;var r=[],i=0;return Ay(e,r,"","",function(o){return t.call(n,o,i++)}),r}function Pq(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 Fr={current:null},Py={transition:null},kq={ReactCurrentDispatcher:Fr,ReactCurrentBatchConfig:Py,ReactCurrentOwner:r4};Ke.Children={map:t0,forEach:function(e,t,n){t0(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return t0(e,function(){t++}),t},toArray:function(e){return t0(e,function(t){return t})||[]},only:function(e){if(!i4(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=Pf;Ke.Fragment=mq;Ke.Profiler=vq;Ke.PureComponent=t4;Ke.StrictMode=yq;Ke.Suspense=xq;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kq;Ke.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=bO({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=r4.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)xO.call(t,l)&&!wO.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:rm,type:e.type,key:i,ref:o,props:r,_owner:a}};Ke.createContext=function(e){return e={$$typeof:_q,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:bq,_context:e},e.Consumer=e};Ke.createElement=CO;Ke.createFactory=function(e){var t=CO.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:Sq,render:e}};Ke.isValidElement=i4;Ke.lazy=function(e){return{$$typeof:Cq,_payload:{_status:-1,_result:e},_init:Pq}};Ke.memo=function(e,t){return{$$typeof:wq,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Py.transition;Py.transition={};try{e()}finally{Py.transition=t}};Ke.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ke.useCallback=function(e,t){return Fr.current.useCallback(e,t)};Ke.useContext=function(e){return Fr.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return Fr.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return Fr.current.useEffect(e,t)};Ke.useId=function(){return Fr.current.useId()};Ke.useImperativeHandle=function(e,t,n){return Fr.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return Fr.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return Fr.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return Fr.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return Fr.current.useReducer(e,t,n)};Ke.useRef=function(e){return Fr.current.useRef(e)};Ke.useState=function(e){return Fr.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return Fr.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return Fr.current.useTransition()};Ke.version="18.2.0";yO.exports=Ke;var k=yO.exports;const J=Bl(k),nP=gO({__proto__:null,default:J},[k]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Iq=k,Mq=Symbol.for("react.element"),Rq=Symbol.for("react.fragment"),Oq=Object.prototype.hasOwnProperty,$q=Iq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nq={key:!0,ref:!0,__self:!0,__source:!0};function EO(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Oq.call(t,r)&&!Nq.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:Mq,type:e,key:o,ref:a,props:i,_owner:$q.current}}Sb.Fragment=Rq;Sb.jsx=EO;Sb.jsxs=EO;mO.exports=Sb;var oe=mO.exports,aC={},TO={exports:{}},Ai={},AO={exports:{}},PO={};/**
* @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($,L){var O=$.length;$.push(L);e:for(;0<O;){var B=O-1>>>1,U=$[B];if(0<i(U,L))$[B]=L,$[O]=U,O=B;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var L=$[0],O=$.pop();if(O!==L){$[0]=O;e:for(var B=0,U=$.length,j=U>>>1;B<j;){var q=2*(B+1)-1,Y=$[q],Z=q+1,V=$[Z];if(0>i(Y,O))Z<U&&0>i(V,Y)?($[B]=V,$[Z]=O,B=Z):($[B]=Y,$[q]=O,B=q);else if(Z<U&&0>i(V,O))$[B]=V,$[Z]=O,B=Z;else break e}}return L}function i($,L){var O=$.sortIndex-L.sortIndex;return O!==0?O:$.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,g=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m($){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=$)r(u),L.sortIndex=L.expirationTime,t(l,L);else break;L=n(u)}}function v($){if(g=!1,m($),!p)if(n(l)!==null)p=!0,R(S);else{var L=n(u);L!==null&&D(v,L.startTime-$)}}function S($,L){p=!1,g&&(g=!1,b(x),x=-1),h=!0;var O=f;try{for(m(L),d=n(l);d!==null&&(!(d.expirationTime>L)||$&&!I());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var U=B(d.expirationTime<=L);L=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),m(L)}else r(l);d=n(l)}if(d!==null)var j=!0;else{var q=n(u);q!==null&&D(v,q.startTime-L),j=!1}return j}finally{d=null,f=O,h=!1}}var w=!1,C=null,x=-1,P=5,E=-1;function I(){return!(e.unstable_now()-E<P)}function N(){if(C!==null){var $=e.unstable_now();E=$;var L=!0;try{L=C(!0,$)}finally{L?M():(w=!1,C=null)}}else w=!1}var M;if(typeof y=="function")M=function(){y(N)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,A=T.port2;T.port1.onmessage=N,M=function(){A.postMessage(null)}}else M=function(){_(N,0)};function R($){C=$,w||(w=!0,M())}function D($,L){x=_(function(){$(e.unstable_now())},L)}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(){p||h||(p=!0,R(S))},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"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function($){switch(f){case 1:case 2:case 3:var L=3;break;default:L=f}var O=f;f=L;try{return $()}finally{f=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,L){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var O=f;f=$;try{return L()}finally{f=O}},e.unstable_scheduleCallback=function($,L,O){var B=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?B+O:B):O=B,$){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=O+U,$={id:c++,callback:L,priorityLevel:$,startTime:O,expirationTime:U,sortIndex:-1},O>B?($.sortIndex=O,t(u,$),n(l)===null&&$===n(u)&&(g?(b(x),x=-1):g=!0,D(v,O-B))):($.sortIndex=U,t(l,$),p||h||(p=!0,R(S))),$},e.unstable_shouldYield=I,e.unstable_wrapCallback=function($){var L=f;return function(){var O=f;f=L;try{return $.apply(this,arguments)}finally{f=O}}}})(PO);AO.exports=PO;var Dq=AO.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 kO=k,wi=Dq;function ne(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 IO=new Set,Pp={};function uc(e,t){Jd(e,t),Jd(e+"Capture",t)}function Jd(e,t){for(Pp[e]=t,e=0;e<t.length;e++)IO.add(t[e])}var us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sC=Object.prototype.hasOwnProperty,Lq=/^[: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]*$/,rP={},iP={};function Fq(e){return sC.call(iP,e)?!0:sC.call(rP,e)?!1:Lq.test(e)?iP[e]=!0:(rP[e]=!0,!1)}function Bq(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 zq(e,t,n,r){if(t===null||typeof t>"u"||Bq(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 Br(e,t,n,r,i,o,a){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=a}var sr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){sr[e]=new Br(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];sr[t]=new Br(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){sr[e]=new Br(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){sr[e]=new Br(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){sr[e]=new Br(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){sr[e]=new Br(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){sr[e]=new Br(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){sr[e]=new Br(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){sr[e]=new Br(e,5,!1,e.toLowerCase(),null,!1,!1)});var o4=/[\-:]([a-z])/g;function a4(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(o4,a4);sr[t]=new Br(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(o4,a4);sr[t]=new Br(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(o4,a4);sr[t]=new Br(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){sr[e]=new Br(e,1,!1,e.toLowerCase(),null,!1,!1)});sr.xlinkHref=new Br("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){sr[e]=new Br(e,1,!1,e.toLowerCase(),null,!0,!0)});function s4(e,t,n,r){var i=sr.hasOwnProperty(t)?sr[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zq(t,n,i,r)&&(n=null),r||i===null?Fq(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 Ss=kO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,n0=Symbol.for("react.element"),Qc=Symbol.for("react.portal"),Yc=Symbol.for("react.fragment"),l4=Symbol.for("react.strict_mode"),lC=Symbol.for("react.profiler"),MO=Symbol.for("react.provider"),RO=Symbol.for("react.context"),u4=Symbol.for("react.forward_ref"),uC=Symbol.for("react.suspense"),cC=Symbol.for("react.suspense_list"),c4=Symbol.for("react.memo"),Gs=Symbol.for("react.lazy"),OO=Symbol.for("react.offscreen"),oP=Symbol.iterator;function th(e){return e===null||typeof e!="object"?null:(e=oP&&e[oP]||e["@@iterator"],typeof e=="function"?e:null)}var en=Object.assign,J2;function Nh(e){if(J2===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);J2=t&&t[1]||""}return`
`+J2+e}var ex=!1;function tx(e,t){if(!e||ex)return"";ex=!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(`
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{ex=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Nh(e):""}function Vq(e){switch(e.tag){case 5:return Nh(e.type);case 16:return Nh("Lazy");case 13:return Nh("Suspense");case 19:return Nh("SuspenseList");case 0:case 2:case 15:return e=tx(e.type,!1),e;case 11:return e=tx(e.type.render,!1),e;case 1:return e=tx(e.type,!0),e;default:return""}}function dC(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 Yc:return"Fragment";case Qc:return"Portal";case lC:return"Profiler";case l4:return"StrictMode";case uC:return"Suspense";case cC:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case RO:return(e.displayName||"Context")+".Consumer";case MO:return(e._context.displayName||"Context")+".Provider";case u4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case c4:return t=e.displayName||null,t!==null?t:dC(e.type)||"Memo";case Gs:t=e._payload,e=e._init;try{return dC(e(t))}catch{}}return null}function jq(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 dC(t);case 8:return t===l4?"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 wl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $O(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Uq(e){var t=$O(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(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function r0(e){e._valueTracker||(e._valueTracker=Uq(e))}function NO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$O(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _v(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 fC(e,t){var n=t.checked;return en({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function aP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wl(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 DO(e,t){t=t.checked,t!=null&&s4(e,"checked",t,!1)}function hC(e,t){DO(e,t);var n=wl(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")?pC(e,t.type,n):t.hasOwnProperty("defaultValue")&&pC(e,t.type,wl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function sP(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 pC(e,t,n){(t!=="number"||_v(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dh=Array.isArray;function _d(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=""+wl(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 gC(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return en({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function lP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ne(92));if(Dh(n)){if(1<n.length)throw Error(ne(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:wl(n)}}function LO(e,t){var n=wl(t.value),r=wl(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 uP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function FO(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 mC(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?FO(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var i0,BO=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(i0=i0||document.createElement("div"),i0.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=i0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function kp(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tp={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},Gq=["Webkit","ms","Moz","O"];Object.keys(tp).forEach(function(e){Gq.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tp[t]=tp[e]})});function zO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tp.hasOwnProperty(e)&&tp[e]?(""+t).trim():t+"px"}function VO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=zO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Hq=en({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 yC(e,t){if(t){if(Hq[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function vC(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 bC=null;function d4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _C=null,Sd=null,xd=null;function cP(e){if(e=am(e)){if(typeof _C!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=Tb(t),_C(e.stateNode,e.type,t))}}function jO(e){Sd?xd?xd.push(e):xd=[e]:Sd=e}function UO(){if(Sd){var e=Sd,t=xd;if(xd=Sd=null,cP(e),t)for(e=0;e<t.length;e++)cP(t[e])}}function GO(e,t){return e(t)}function HO(){}var nx=!1;function qO(e,t,n){if(nx)return e(t,n);nx=!0;try{return GO(e,t,n)}finally{nx=!1,(Sd!==null||xd!==null)&&(HO(),UO())}}function Ip(e,t){var n=e.stateNode;if(n===null)return null;var r=Tb(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(ne(231,t,typeof n));return n}var SC=!1;if(us)try{var nh={};Object.defineProperty(nh,"passive",{get:function(){SC=!0}}),window.addEventListener("test",nh,nh),window.removeEventListener("test",nh,nh)}catch{SC=!1}function qq(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var np=!1,Sv=null,xv=!1,xC=null,Wq={onError:function(e){np=!0,Sv=e}};function Kq(e,t,n,r,i,o,a,s,l){np=!1,Sv=null,qq.apply(Wq,arguments)}function Xq(e,t,n,r,i,o,a,s,l){if(Kq.apply(this,arguments),np){if(np){var u=Sv;np=!1,Sv=null}else throw Error(ne(198));xv||(xv=!0,xC=u)}}function cc(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 WO(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 dP(e){if(cc(e)!==e)throw Error(ne(188))}function Qq(e){var t=e.alternate;if(!t){if(t=cc(e),t===null)throw Error(ne(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 dP(i),e;if(o===r)return dP(i),t;o=o.sibling}throw Error(ne(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(ne(189))}}if(n.alternate!==r)throw Error(ne(190))}if(n.tag!==3)throw Error(ne(188));return n.stateNode.current===n?e:t}function KO(e){return e=Qq(e),e!==null?XO(e):null}function XO(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=XO(e);if(t!==null)return t;e=e.sibling}return null}var QO=wi.unstable_scheduleCallback,fP=wi.unstable_cancelCallback,Yq=wi.unstable_shouldYield,Zq=wi.unstable_requestPaint,mn=wi.unstable_now,Jq=wi.unstable_getCurrentPriorityLevel,f4=wi.unstable_ImmediatePriority,YO=wi.unstable_UserBlockingPriority,wv=wi.unstable_NormalPriority,eW=wi.unstable_LowPriority,ZO=wi.unstable_IdlePriority,xb=null,da=null;function tW(e){if(da&&typeof da.onCommitFiberRoot=="function")try{da.onCommitFiberRoot(xb,e,void 0,(e.current.flags&128)===128)}catch{}}var To=Math.clz32?Math.clz32:iW,nW=Math.log,rW=Math.LN2;function iW(e){return e>>>=0,e===0?32:31-(nW(e)/rW|0)|0}var o0=64,a0=4194304;function Lh(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 Cv(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Lh(s):(o&=a,o!==0&&(r=Lh(o)))}else a=n&~i,a!==0?r=Lh(a):o!==0&&(r=Lh(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-To(t),i=1<<n,r|=e[n],t&=~i;return r}function oW(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 aW(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-To(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=oW(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function wC(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function JO(){var e=o0;return o0<<=1,!(o0&4194240)&&(o0=64),e}function rx(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function im(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-To(t),e[t]=n}function sW(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-To(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function h4(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-To(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function e7(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var t7,p4,n7,r7,i7,CC=!1,s0=[],ll=null,ul=null,cl=null,Mp=new Map,Rp=new Map,Qs=[],lW="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 hP(e,t){switch(e){case"focusin":case"focusout":ll=null;break;case"dragenter":case"dragleave":ul=null;break;case"mouseover":case"mouseout":cl=null;break;case"pointerover":case"pointerout":Mp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rp.delete(t.pointerId)}}function rh(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=am(t),t!==null&&p4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function uW(e,t,n,r,i){switch(t){case"focusin":return ll=rh(ll,e,t,n,r,i),!0;case"dragenter":return ul=rh(ul,e,t,n,r,i),!0;case"mouseover":return cl=rh(cl,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Mp.set(o,rh(Mp.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Rp.set(o,rh(Rp.get(o)||null,e,t,n,r,i)),!0}return!1}function o7(e){var t=Tu(e.target);if(t!==null){var n=cc(t);if(n!==null){if(t=n.tag,t===13){if(t=WO(n),t!==null){e.blockedOn=t,i7(e.priority,function(){n7(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 ky(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=EC(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bC=r,n.target.dispatchEvent(r),bC=null}else return t=am(n),t!==null&&p4(t),e.blockedOn=n,!1;t.shift()}return!0}function pP(e,t,n){ky(e)&&n.delete(t)}function cW(){CC=!1,ll!==null&&ky(ll)&&(ll=null),ul!==null&&ky(ul)&&(ul=null),cl!==null&&ky(cl)&&(cl=null),Mp.forEach(pP),Rp.forEach(pP)}function ih(e,t){e.blockedOn===t&&(e.blockedOn=null,CC||(CC=!0,wi.unstable_scheduleCallback(wi.unstable_NormalPriority,cW)))}function Op(e){function t(i){return ih(i,e)}if(0<s0.length){ih(s0[0],e);for(var n=1;n<s0.length;n++){var r=s0[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ll!==null&&ih(ll,e),ul!==null&&ih(ul,e),cl!==null&&ih(cl,e),Mp.forEach(t),Rp.forEach(t),n=0;n<Qs.length;n++)r=Qs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Qs.length&&(n=Qs[0],n.blockedOn===null);)o7(n),n.blockedOn===null&&Qs.shift()}var wd=Ss.ReactCurrentBatchConfig,Ev=!0;function dW(e,t,n,r){var i=vt,o=wd.transition;wd.transition=null;try{vt=1,g4(e,t,n,r)}finally{vt=i,wd.transition=o}}function fW(e,t,n,r){var i=vt,o=wd.transition;wd.transition=null;try{vt=4,g4(e,t,n,r)}finally{vt=i,wd.transition=o}}function g4(e,t,n,r){if(Ev){var i=EC(e,t,n,r);if(i===null)hx(e,t,r,Tv,n),hP(e,r);else if(uW(i,e,t,n,r))r.stopPropagation();else if(hP(e,r),t&4&&-1<lW.indexOf(e)){for(;i!==null;){var o=am(i);if(o!==null&&t7(o),o=EC(e,t,n,r),o===null&&hx(e,t,r,Tv,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else hx(e,t,r,null,n)}}var Tv=null;function EC(e,t,n,r){if(Tv=null,e=d4(r),e=Tu(e),e!==null)if(t=cc(e),t===null)e=null;else if(n=t.tag,n===13){if(e=WO(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 Tv=e,null}function a7(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(Jq()){case f4:return 1;case YO:return 4;case wv:case eW:return 16;case ZO:return 536870912;default:return 16}default:return 16}}var il=null,m4=null,Iy=null;function s7(){if(Iy)return Iy;var e,t=m4,n=t.length,r,i="value"in il?il.value:il.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return Iy=i.slice(e,1<r?1-r:void 0)}function My(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 l0(){return!0}function gP(){return!1}function Pi(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?l0:gP,this.isPropagationStopped=gP,this}return en(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=l0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=l0)},persist:function(){},isPersistent:l0}),t}var kf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y4=Pi(kf),om=en({},kf,{view:0,detail:0}),hW=Pi(om),ix,ox,oh,wb=en({},om,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v4,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!==oh&&(oh&&e.type==="mousemove"?(ix=e.screenX-oh.screenX,ox=e.screenY-oh.screenY):ox=ix=0,oh=e),ix)},movementY:function(e){return"movementY"in e?e.movementY:ox}}),mP=Pi(wb),pW=en({},wb,{dataTransfer:0}),gW=Pi(pW),mW=en({},om,{relatedTarget:0}),ax=Pi(mW),yW=en({},kf,{animationName:0,elapsedTime:0,pseudoElement:0}),vW=Pi(yW),bW=en({},kf,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_W=Pi(bW),SW=en({},kf,{data:0}),yP=Pi(SW),xW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wW={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"},CW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function EW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CW[e])?!!t[e]:!1}function v4(){return EW}var TW=en({},om,{key:function(e){if(e.key){var t=xW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=My(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v4,charCode:function(e){return e.type==="keypress"?My(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?My(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),AW=Pi(TW),PW=en({},wb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vP=Pi(PW),kW=en({},om,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v4}),IW=Pi(kW),MW=en({},kf,{propertyName:0,elapsedTime:0,pseudoElement:0}),RW=Pi(MW),OW=en({},wb,{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}),$W=Pi(OW),NW=[9,13,27,32],b4=us&&"CompositionEvent"in window,rp=null;us&&"documentMode"in document&&(rp=document.documentMode);var DW=us&&"TextEvent"in window&&!rp,l7=us&&(!b4||rp&&8<rp&&11>=rp),bP=String.fromCharCode(32),_P=!1;function u7(e,t){switch(e){case"keyup":return NW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zc=!1;function LW(e,t){switch(e){case"compositionend":return c7(t);case"keypress":return t.which!==32?null:(_P=!0,bP);case"textInput":return e=t.data,e===bP&&_P?null:e;default:return null}}function FW(e,t){if(Zc)return e==="compositionend"||!b4&&u7(e,t)?(e=s7(),Iy=m4=il=null,Zc=!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 l7&&t.locale!=="ko"?null:t.data;default:return null}}var BW={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 SP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BW[e.type]:t==="textarea"}function d7(e,t,n,r){jO(r),t=Av(t,"onChange"),0<t.length&&(n=new y4("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ip=null,$p=null;function zW(e){x7(e,0)}function Cb(e){var t=td(e);if(NO(t))return e}function VW(e,t){if(e==="change")return t}var f7=!1;if(us){var sx;if(us){var lx="oninput"in document;if(!lx){var xP=document.createElement("div");xP.setAttribute("oninput","return;"),lx=typeof xP.oninput=="function"}sx=lx}else sx=!1;f7=sx&&(!document.documentMode||9<document.documentMode)}function wP(){ip&&(ip.detachEvent("onpropertychange",h7),$p=ip=null)}function h7(e){if(e.propertyName==="value"&&Cb($p)){var t=[];d7(t,$p,e,d4(e)),qO(zW,t)}}function jW(e,t,n){e==="focusin"?(wP(),ip=t,$p=n,ip.attachEvent("onpropertychange",h7)):e==="focusout"&&wP()}function UW(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cb($p)}function GW(e,t){if(e==="click")return Cb(t)}function HW(e,t){if(e==="input"||e==="change")return Cb(t)}function qW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oo=typeof Object.is=="function"?Object.is:qW;function Np(e,t){if(Oo(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(!sC.call(t,i)||!Oo(e[i],t[i]))return!1}return!0}function CP(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function EP(e,t){var n=CP(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=CP(n)}}function p7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function g7(){for(var e=window,t=_v();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_v(e.document)}return t}function _4(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 WW(e){var t=g7(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&p7(n.ownerDocument.documentElement,n)){if(r!==null&&_4(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=EP(n,o);var a=EP(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)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 KW=us&&"documentMode"in document&&11>=document.documentMode,Jc=null,TC=null,op=null,AC=!1;function TP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;AC||Jc==null||Jc!==_v(r)||(r=Jc,"selectionStart"in r&&_4(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}),op&&Np(op,r)||(op=r,r=Av(TC,"onSelect"),0<r.length&&(t=new y4("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jc)))}function u0(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ed={animationend:u0("Animation","AnimationEnd"),animationiteration:u0("Animation","AnimationIteration"),animationstart:u0("Animation","AnimationStart"),transitionend:u0("Transition","TransitionEnd")},ux={},m7={};us&&(m7=document.createElement("div").style,"AnimationEvent"in window||(delete ed.animationend.animation,delete ed.animationiteration.animation,delete ed.animationstart.animation),"TransitionEvent"in window||delete ed.transitionend.transition);function Eb(e){if(ux[e])return ux[e];if(!ed[e])return e;var t=ed[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in m7)return ux[e]=t[n];return e}var y7=Eb("animationend"),v7=Eb("animationiteration"),b7=Eb("animationstart"),_7=Eb("transitionend"),S7=new Map,AP="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 zl(e,t){S7.set(e,t),uc(t,[e])}for(var cx=0;cx<AP.length;cx++){var dx=AP[cx],XW=dx.toLowerCase(),QW=dx[0].toUpperCase()+dx.slice(1);zl(XW,"on"+QW)}zl(y7,"onAnimationEnd");zl(v7,"onAnimationIteration");zl(b7,"onAnimationStart");zl("dblclick","onDoubleClick");zl("focusin","onFocus");zl("focusout","onBlur");zl(_7,"onTransitionEnd");Jd("onMouseEnter",["mouseout","mouseover"]);Jd("onMouseLeave",["mouseout","mouseover"]);Jd("onPointerEnter",["pointerout","pointerover"]);Jd("onPointerLeave",["pointerout","pointerover"]);uc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));uc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));uc("onBeforeInput",["compositionend","keypress","textInput","paste"]);uc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));uc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));uc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fh="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(" "),YW=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fh));function PP(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Xq(r,t,void 0,e),e.currentTarget=null}function x7(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 a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;PP(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;PP(i,s,u),o=l}}}if(xv)throw e=xC,xv=!1,xC=null,e}function Nt(e,t){var n=t[RC];n===void 0&&(n=t[RC]=new Set);var r=e+"__bubble";n.has(r)||(w7(t,e,2,!1),n.add(r))}function fx(e,t,n){var r=0;t&&(r|=4),w7(n,e,r,t)}var c0="_reactListening"+Math.random().toString(36).slice(2);function Dp(e){if(!e[c0]){e[c0]=!0,IO.forEach(function(n){n!=="selectionchange"&&(YW.has(n)||fx(n,!1,e),fx(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[c0]||(t[c0]=!0,fx("selectionchange",!1,t))}}function w7(e,t,n,r){switch(a7(t)){case 1:var i=dW;break;case 4:i=fW;break;default:i=g4}n=i.bind(null,t,n,e),i=void 0,!SC||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 hx(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Tu(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}qO(function(){var u=o,c=d4(n),d=[];e:{var f=S7.get(e);if(f!==void 0){var h=y4,p=e;switch(e){case"keypress":if(My(n)===0)break e;case"keydown":case"keyup":h=AW;break;case"focusin":p="focus",h=ax;break;case"focusout":p="blur",h=ax;break;case"beforeblur":case"afterblur":h=ax;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=mP;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=gW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=IW;break;case y7:case v7:case b7:h=vW;break;case _7:h=RW;break;case"scroll":h=hW;break;case"wheel":h=$W;break;case"copy":case"cut":case"paste":h=_W;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=vP}var g=(t&4)!==0,_=!g&&e==="scroll",b=g?f!==null?f+"Capture":null:f;g=[];for(var y=u,m;y!==null;){m=y;var v=m.stateNode;if(m.tag===5&&v!==null&&(m=v,b!==null&&(v=Ip(y,b),v!=null&&g.push(Lp(y,v,m)))),_)break;y=y.return}0<g.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==bC&&(p=n.relatedTarget||n.fromElement)&&(Tu(p)||p[cs]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?Tu(p):null,p!==null&&(_=cc(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(g=mP,v="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=vP,v="onPointerLeave",b="onPointerEnter",y="pointer"),_=h==null?f:td(h),m=p==null?f:td(p),f=new g(v,y+"leave",h,n,c),f.target=_,f.relatedTarget=m,v=null,Tu(c)===u&&(g=new g(b,y+"enter",p,n,c),g.target=m,g.relatedTarget=_,v=g),_=v,h&&p)t:{for(g=h,b=p,y=0,m=g;m;m=Pc(m))y++;for(m=0,v=b;v;v=Pc(v))m++;for(;0<y-m;)g=Pc(g),y--;for(;0<m-y;)b=Pc(b),m--;for(;y--;){if(g===b||b!==null&&g===b.alternate)break t;g=Pc(g),b=Pc(b)}g=null}else g=null;h!==null&&kP(d,f,h,g,!1),p!==null&&_!==null&&kP(d,_,p,g,!0)}}e:{if(f=u?td(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=VW;else if(SP(f))if(f7)S=HW;else{S=UW;var w=jW}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=GW);if(S&&(S=S(e,u))){d7(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&pC(f,"number",f.value)}switch(w=u?td(u):window,e){case"focusin":(SP(w)||w.contentEditable==="true")&&(Jc=w,TC=u,op=null);break;case"focusout":op=TC=Jc=null;break;case"mousedown":AC=!0;break;case"contextmenu":case"mouseup":case"dragend":AC=!1,TP(d,n,c);break;case"selectionchange":if(KW)break;case"keydown":case"keyup":TP(d,n,c)}var C;if(b4)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Zc?u7(e,n)&&(x="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(x="onCompositionStart");x&&(l7&&n.locale!=="ko"&&(Zc||x!=="onCompositionStart"?x==="onCompositionEnd"&&Zc&&(C=s7()):(il=c,m4="value"in il?il.value:il.textContent,Zc=!0)),w=Av(u,x),0<w.length&&(x=new yP(x,e,null,n,c),d.push({event:x,listeners:w}),C?x.data=C:(C=c7(n),C!==null&&(x.data=C)))),(C=DW?LW(e,n):FW(e,n))&&(u=Av(u,"onBeforeInput"),0<u.length&&(c=new yP("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}x7(d,t)})}function Lp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Av(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Ip(e,n),o!=null&&r.unshift(Lp(e,o,i)),o=Ip(e,t),o!=null&&r.push(Lp(e,o,i))),e=e.return}return r}function Pc(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kP(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=Ip(n,o),l!=null&&a.unshift(Lp(n,l,s))):i||(l=Ip(n,o),l!=null&&a.push(Lp(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var ZW=/\r\n?/g,JW=/\u0000|\uFFFD/g;function IP(e){return(typeof e=="string"?e:""+e).replace(ZW,`
`).replace(JW,"")}function d0(e,t,n){if(t=IP(t),IP(e)!==t&&n)throw Error(ne(425))}function Pv(){}var PC=null,kC=null;function IC(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 MC=typeof setTimeout=="function"?setTimeout:void 0,eK=typeof clearTimeout=="function"?clearTimeout:void 0,MP=typeof Promise=="function"?Promise:void 0,tK=typeof queueMicrotask=="function"?queueMicrotask:typeof MP<"u"?function(e){return MP.resolve(null).then(e).catch(nK)}:MC;function nK(e){setTimeout(function(){throw e})}function px(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),Op(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Op(t)}function dl(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 RP(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 If=Math.random().toString(36).slice(2),ra="__reactFiber$"+If,Fp="__reactProps$"+If,cs="__reactContainer$"+If,RC="__reactEvents$"+If,rK="__reactListeners$"+If,iK="__reactHandles$"+If;function Tu(e){var t=e[ra];if(t)return t;for(var n=e.parentNode;n;){if(t=n[cs]||n[ra]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=RP(e);e!==null;){if(n=e[ra])return n;e=RP(e)}return t}e=n,n=e.parentNode}return null}function am(e){return e=e[ra]||e[cs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function td(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function Tb(e){return e[Fp]||null}var OC=[],nd=-1;function Vl(e){return{current:e}}function zt(e){0>nd||(e.current=OC[nd],OC[nd]=null,nd--)}function Mt(e,t){nd++,OC[nd]=e.current,e.current=t}var Cl={},br=Vl(Cl),Zr=Vl(!1),Xu=Cl;function ef(e,t){var n=e.type.contextTypes;if(!n)return Cl;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 Jr(e){return e=e.childContextTypes,e!=null}function kv(){zt(Zr),zt(br)}function OP(e,t,n){if(br.current!==Cl)throw Error(ne(168));Mt(br,t),Mt(Zr,n)}function C7(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(ne(108,jq(e)||"Unknown",i));return en({},n,r)}function Iv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cl,Xu=br.current,Mt(br,e),Mt(Zr,Zr.current),!0}function $P(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=C7(e,t,Xu),r.__reactInternalMemoizedMergedChildContext=e,zt(Zr),zt(br),Mt(br,e)):zt(Zr),Mt(Zr,n)}var ja=null,Ab=!1,gx=!1;function E7(e){ja===null?ja=[e]:ja.push(e)}function oK(e){Ab=!0,E7(e)}function jl(){if(!gx&&ja!==null){gx=!0;var e=0,t=vt;try{var n=ja;for(vt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ja=null,Ab=!1}catch(i){throw ja!==null&&(ja=ja.slice(e+1)),QO(f4,jl),i}finally{vt=t,gx=!1}}return null}var rd=[],id=0,Mv=null,Rv=0,Gi=[],Hi=0,Qu=null,Qa=1,Ya="";function hu(e,t){rd[id++]=Rv,rd[id++]=Mv,Mv=e,Rv=t}function T7(e,t,n){Gi[Hi++]=Qa,Gi[Hi++]=Ya,Gi[Hi++]=Qu,Qu=e;var r=Qa;e=Ya;var i=32-To(r)-1;r&=~(1<<i),n+=1;var o=32-To(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Qa=1<<32-To(t)+i|n<<i|r,Ya=o+e}else Qa=1<<o|n<<i|r,Ya=e}function S4(e){e.return!==null&&(hu(e,1),T7(e,1,0))}function x4(e){for(;e===Mv;)Mv=rd[--id],rd[id]=null,Rv=rd[--id],rd[id]=null;for(;e===Qu;)Qu=Gi[--Hi],Gi[Hi]=null,Ya=Gi[--Hi],Gi[Hi]=null,Qa=Gi[--Hi],Gi[Hi]=null}var _i=null,bi=null,qt=!1,_o=null;function A7(e,t){var n=Wi(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 NP(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,_i=e,bi=dl(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_i=e,bi=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qu!==null?{id:Qa,overflow:Ya}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Wi(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_i=e,bi=null,!0):!1;default:return!1}}function $C(e){return(e.mode&1)!==0&&(e.flags&128)===0}function NC(e){if(qt){var t=bi;if(t){var n=t;if(!NP(e,t)){if($C(e))throw Error(ne(418));t=dl(n.nextSibling);var r=_i;t&&NP(e,t)?A7(r,n):(e.flags=e.flags&-4097|2,qt=!1,_i=e)}}else{if($C(e))throw Error(ne(418));e.flags=e.flags&-4097|2,qt=!1,_i=e}}}function DP(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_i=e}function f0(e){if(e!==_i)return!1;if(!qt)return DP(e),qt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!IC(e.type,e.memoizedProps)),t&&(t=bi)){if($C(e))throw P7(),Error(ne(418));for(;t;)A7(e,t),t=dl(t.nextSibling)}if(DP(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){bi=dl(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}bi=null}}else bi=_i?dl(e.stateNode.nextSibling):null;return!0}function P7(){for(var e=bi;e;)e=dl(e.nextSibling)}function tf(){bi=_i=null,qt=!1}function w4(e){_o===null?_o=[e]:_o.push(e)}var aK=Ss.ReactCurrentBatchConfig;function mo(e,t){if(e&&e.defaultProps){t=en({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Ov=Vl(null),$v=null,od=null,C4=null;function E4(){C4=od=$v=null}function T4(e){var t=Ov.current;zt(Ov),e._currentValue=t}function DC(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 Cd(e,t){$v=e,C4=od=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xr=!0),e.firstContext=null)}function Qi(e){var t=e._currentValue;if(C4!==e)if(e={context:e,memoizedValue:t,next:null},od===null){if($v===null)throw Error(ne(308));od=e,$v.dependencies={lanes:0,firstContext:e}}else od=od.next=e;return t}var Au=null;function A4(e){Au===null?Au=[e]:Au.push(e)}function k7(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,A4(t)):(n.next=i.next,i.next=n),t.interleaved=n,ds(e,r)}function ds(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 Hs=!1;function P4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I7(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 ns(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,st&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ds(e,n)}return i=r.interleaved,i===null?(t.next=t,A4(r)):(t.next=i.next,i.next=t),r.interleaved=t,ds(e,n)}function Ry(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,h4(e,n)}}function LP(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 a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,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 Nv(e,t,n,r){var i=e.updateQueue;Hs=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,g=s;switch(f=t,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=en({},d,f);break e;case 2:Hs=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Zu|=a,e.lanes=a,e.memoizedState=d}}function FP(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(ne(191,i));i.call(r)}}}var M7=new kO.Component().refs;function LC(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:en({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Pb={isMounted:function(e){return(e=e._reactInternals)?cc(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$r(),i=pl(e),o=ns(r,i);o.payload=t,n!=null&&(o.callback=n),t=fl(e,o,i),t!==null&&(Ao(t,e,i,r),Ry(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$r(),i=pl(e),o=ns(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=fl(e,o,i),t!==null&&(Ao(t,e,i,r),Ry(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$r(),r=pl(e),i=ns(n,r);i.tag=2,t!=null&&(i.callback=t),t=fl(e,i,r),t!==null&&(Ao(t,e,r,n),Ry(t,e,r))}};function BP(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Np(n,r)||!Np(i,o):!0}function R7(e,t,n){var r=!1,i=Cl,o=t.contextType;return typeof o=="object"&&o!==null?o=Qi(o):(i=Jr(t)?Xu:br.current,r=t.contextTypes,o=(r=r!=null)?ef(e,i):Cl),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Pb,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function zP(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&&Pb.enqueueReplaceState(t,t.state,null)}function FC(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=M7,P4(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Qi(o):(o=Jr(t)?Xu:br.current,i.context=ef(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(LC(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&&Pb.enqueueReplaceState(i,i.state,null),Nv(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ah(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(ne(309));var r=n.stateNode}if(!r)throw Error(ne(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(a){var s=i.refs;s===M7&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,e))}return e}function h0(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function VP(e){var t=e._init;return t(e._payload)}function O7(e){function t(b,y){if(e){var m=b.deletions;m===null?(b.deletions=[y],b.flags|=16):m.push(y)}}function n(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function r(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function i(b,y){return b=gl(b,y),b.index=0,b.sibling=null,b}function o(b,y,m){return b.index=m,e?(m=b.alternate,m!==null?(m=m.index,m<y?(b.flags|=2,y):m):(b.flags|=2,y)):(b.flags|=1048576,y)}function a(b){return e&&b.alternate===null&&(b.flags|=2),b}function s(b,y,m,v){return y===null||y.tag!==6?(y=xx(m,b.mode,v),y.return=b,y):(y=i(y,m),y.return=b,y)}function l(b,y,m,v){var S=m.type;return S===Yc?c(b,y,m.props.children,v,m.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gs&&VP(S)===y.type)?(v=i(y,m.props),v.ref=ah(b,y,m),v.return=b,v):(v=Fy(m.type,m.key,m.props,null,b.mode,v),v.ref=ah(b,y,m),v.return=b,v)}function u(b,y,m,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==m.containerInfo||y.stateNode.implementation!==m.implementation?(y=wx(m,b.mode,v),y.return=b,y):(y=i(y,m.children||[]),y.return=b,y)}function c(b,y,m,v,S){return y===null||y.tag!==7?(y=Fu(m,b.mode,v,S),y.return=b,y):(y=i(y,m),y.return=b,y)}function d(b,y,m){if(typeof y=="string"&&y!==""||typeof y=="number")return y=xx(""+y,b.mode,m),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case n0:return m=Fy(y.type,y.key,y.props,null,b.mode,m),m.ref=ah(b,null,y),m.return=b,m;case Qc:return y=wx(y,b.mode,m),y.return=b,y;case Gs:var v=y._init;return d(b,v(y._payload),m)}if(Dh(y)||th(y))return y=Fu(y,b.mode,m,null),y.return=b,y;h0(b,y)}return null}function f(b,y,m,v){var S=y!==null?y.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return S!==null?null:s(b,y,""+m,v);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case n0:return m.key===S?l(b,y,m,v):null;case Qc:return m.key===S?u(b,y,m,v):null;case Gs:return S=m._init,f(b,y,S(m._payload),v)}if(Dh(m)||th(m))return S!==null?null:c(b,y,m,v,null);h0(b,m)}return null}function h(b,y,m,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return b=b.get(m)||null,s(y,b,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case n0:return b=b.get(v.key===null?m:v.key)||null,l(y,b,v,S);case Qc:return b=b.get(v.key===null?m:v.key)||null,u(y,b,v,S);case Gs:var w=v._init;return h(b,y,m,w(v._payload),S)}if(Dh(v)||th(v))return b=b.get(m)||null,c(y,b,v,S,null);h0(y,v)}return null}function p(b,y,m,v){for(var S=null,w=null,C=y,x=y=0,P=null;C!==null&&x<m.length;x++){C.index>x?(P=C,C=null):P=C.sibling;var E=f(b,C,m[x],v);if(E===null){C===null&&(C=P);break}e&&C&&E.alternate===null&&t(b,C),y=o(E,y,x),w===null?S=E:w.sibling=E,w=E,C=P}if(x===m.length)return n(b,C),qt&&hu(b,x),S;if(C===null){for(;x<m.length;x++)C=d(b,m[x],v),C!==null&&(y=o(C,y,x),w===null?S=C:w.sibling=C,w=C);return qt&&hu(b,x),S}for(C=r(b,C);x<m.length;x++)P=h(C,b,x,m[x],v),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?x:P.key),y=o(P,y,x),w===null?S=P:w.sibling=P,w=P);return e&&C.forEach(function(I){return t(b,I)}),qt&&hu(b,x),S}function g(b,y,m,v){var S=th(m);if(typeof S!="function")throw Error(ne(150));if(m=S.call(m),m==null)throw Error(ne(151));for(var w=S=null,C=y,x=y=0,P=null,E=m.next();C!==null&&!E.done;x++,E=m.next()){C.index>x?(P=C,C=null):P=C.sibling;var I=f(b,C,E.value,v);if(I===null){C===null&&(C=P);break}e&&C&&I.alternate===null&&t(b,C),y=o(I,y,x),w===null?S=I:w.sibling=I,w=I,C=P}if(E.done)return n(b,C),qt&&hu(b,x),S;if(C===null){for(;!E.done;x++,E=m.next())E=d(b,E.value,v),E!==null&&(y=o(E,y,x),w===null?S=E:w.sibling=E,w=E);return qt&&hu(b,x),S}for(C=r(b,C);!E.done;x++,E=m.next())E=h(C,b,x,E.value,v),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?x:E.key),y=o(E,y,x),w===null?S=E:w.sibling=E,w=E);return e&&C.forEach(function(N){return t(b,N)}),qt&&hu(b,x),S}function _(b,y,m,v){if(typeof m=="object"&&m!==null&&m.type===Yc&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case n0:e:{for(var S=m.key,w=y;w!==null;){if(w.key===S){if(S=m.type,S===Yc){if(w.tag===7){n(b,w.sibling),y=i(w,m.props.children),y.return=b,b=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gs&&VP(S)===w.type){n(b,w.sibling),y=i(w,m.props),y.ref=ah(b,w,m),y.return=b,b=y;break e}n(b,w);break}else t(b,w);w=w.sibling}m.type===Yc?(y=Fu(m.props.children,b.mode,v,m.key),y.return=b,b=y):(v=Fy(m.type,m.key,m.props,null,b.mode,v),v.ref=ah(b,y,m),v.return=b,b=v)}return a(b);case Qc:e:{for(w=m.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===m.containerInfo&&y.stateNode.implementation===m.implementation){n(b,y.sibling),y=i(y,m.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=wx(m,b.mode,v),y.return=b,b=y}return a(b);case Gs:return w=m._init,_(b,y,w(m._payload),v)}if(Dh(m))return p(b,y,m,v);if(th(m))return g(b,y,m,v);h0(b,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,y!==null&&y.tag===6?(n(b,y.sibling),y=i(y,m),y.return=b,b=y):(n(b,y),y=xx(m,b.mode,v),y.return=b,b=y),a(b)):n(b,y)}return _}var nf=O7(!0),$7=O7(!1),sm={},fa=Vl(sm),Bp=Vl(sm),zp=Vl(sm);function Pu(e){if(e===sm)throw Error(ne(174));return e}function k4(e,t){switch(Mt(zp,t),Mt(Bp,e),Mt(fa,sm),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mC(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mC(t,e)}zt(fa),Mt(fa,t)}function rf(){zt(fa),zt(Bp),zt(zp)}function N7(e){Pu(zp.current);var t=Pu(fa.current),n=mC(t,e.type);t!==n&&(Mt(Bp,e),Mt(fa,n))}function I4(e){Bp.current===e&&(zt(fa),zt(Bp))}var Yt=Vl(0);function Dv(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 mx=[];function M4(){for(var e=0;e<mx.length;e++)mx[e]._workInProgressVersionPrimary=null;mx.length=0}var Oy=Ss.ReactCurrentDispatcher,yx=Ss.ReactCurrentBatchConfig,Yu=0,Jt=null,Pn=null,Vn=null,Lv=!1,ap=!1,Vp=0,sK=0;function dr(){throw Error(ne(321))}function R4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Oo(e[n],t[n]))return!1;return!0}function O4(e,t,n,r,i,o){if(Yu=o,Jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oy.current=e===null||e.memoizedState===null?dK:fK,e=n(r,i),ap){o=0;do{if(ap=!1,Vp=0,25<=o)throw Error(ne(301));o+=1,Vn=Pn=null,t.updateQueue=null,Oy.current=hK,e=n(r,i)}while(ap)}if(Oy.current=Fv,t=Pn!==null&&Pn.next!==null,Yu=0,Vn=Pn=Jt=null,Lv=!1,t)throw Error(ne(300));return e}function $4(){var e=Vp!==0;return Vp=0,e}function Ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?Jt.memoizedState=Vn=e:Vn=Vn.next=e,Vn}function Yi(){if(Pn===null){var e=Jt.alternate;e=e!==null?e.memoizedState:null}else e=Pn.next;var t=Vn===null?Jt.memoizedState:Vn.next;if(t!==null)Vn=t,Pn=e;else{if(e===null)throw Error(ne(310));Pn=e,e={memoizedState:Pn.memoizedState,baseState:Pn.baseState,baseQueue:Pn.baseQueue,queue:Pn.queue,next:null},Vn===null?Jt.memoizedState=Vn=e:Vn=Vn.next=e}return Vn}function jp(e,t){return typeof t=="function"?t(e):t}function vx(e){var t=Yi(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=Pn,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((Yu&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,a=r):l=l.next=d,Jt.lanes|=c,Zu|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,Oo(r,t.memoizedState)||(Xr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Jt.lanes|=o,Zu|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bx(e){var t=Yi(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);Oo(o,t.memoizedState)||(Xr=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function D7(){}function L7(e,t){var n=Jt,r=Yi(),i=t(),o=!Oo(r.memoizedState,i);if(o&&(r.memoizedState=i,Xr=!0),r=r.queue,N4(z7.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Vn!==null&&Vn.memoizedState.tag&1){if(n.flags|=2048,Up(9,B7.bind(null,n,r,i,t),void 0,null),Hn===null)throw Error(ne(349));Yu&30||F7(n,t,i)}return i}function F7(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Jt.updateQueue,t===null?(t={lastEffect:null,stores:null},Jt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function B7(e,t,n,r){t.value=n,t.getSnapshot=r,V7(t)&&j7(e)}function z7(e,t,n){return n(function(){V7(t)&&j7(e)})}function V7(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Oo(e,n)}catch{return!0}}function j7(e){var t=ds(e,1);t!==null&&Ao(t,e,1,-1)}function jP(e){var t=Ko();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jp,lastRenderedState:e},t.queue=e,e=e.dispatch=cK.bind(null,Jt,e),[t.memoizedState,e]}function Up(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Jt.updateQueue,t===null?(t={lastEffect:null,stores:null},Jt.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 U7(){return Yi().memoizedState}function $y(e,t,n,r){var i=Ko();Jt.flags|=e,i.memoizedState=Up(1|t,n,void 0,r===void 0?null:r)}function kb(e,t,n,r){var i=Yi();r=r===void 0?null:r;var o=void 0;if(Pn!==null){var a=Pn.memoizedState;if(o=a.destroy,r!==null&&R4(r,a.deps)){i.memoizedState=Up(t,n,o,r);return}}Jt.flags|=e,i.memoizedState=Up(1|t,n,o,r)}function UP(e,t){return $y(8390656,8,e,t)}function N4(e,t){return kb(2048,8,e,t)}function G7(e,t){return kb(4,2,e,t)}function H7(e,t){return kb(4,4,e,t)}function q7(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 W7(e,t,n){return n=n!=null?n.concat([e]):null,kb(4,4,q7.bind(null,t,e),n)}function D4(){}function K7(e,t){var n=Yi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&R4(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function X7(e,t){var n=Yi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&R4(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Q7(e,t,n){return Yu&21?(Oo(n,t)||(n=JO(),Jt.lanes|=n,Zu|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xr=!0),e.memoizedState=n)}function lK(e,t){var n=vt;vt=n!==0&&4>n?n:4,e(!0);var r=yx.transition;yx.transition={};try{e(!1),t()}finally{vt=n,yx.transition=r}}function Y7(){return Yi().memoizedState}function uK(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Z7(e))J7(t,n);else if(n=k7(e,t,n,r),n!==null){var i=$r();Ao(n,e,r,i),e$(n,t,r)}}function cK(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Z7(e))J7(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Oo(s,a)){var l=t.interleaved;l===null?(i.next=i,A4(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=k7(e,t,i,r),n!==null&&(i=$r(),Ao(n,e,r,i),e$(n,t,r))}}function Z7(e){var t=e.alternate;return e===Jt||t!==null&&t===Jt}function J7(e,t){ap=Lv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function e$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,h4(e,n)}}var Fv={readContext:Qi,useCallback:dr,useContext:dr,useEffect:dr,useImperativeHandle:dr,useInsertionEffect:dr,useLayoutEffect:dr,useMemo:dr,useReducer:dr,useRef:dr,useState:dr,useDebugValue:dr,useDeferredValue:dr,useTransition:dr,useMutableSource:dr,useSyncExternalStore:dr,useId:dr,unstable_isNewReconciler:!1},dK={readContext:Qi,useCallback:function(e,t){return Ko().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:UP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$y(4194308,4,q7.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $y(4194308,4,e,t)},useInsertionEffect:function(e,t){return $y(4,2,e,t)},useMemo:function(e,t){var n=Ko();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ko();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=uK.bind(null,Jt,e),[r.memoizedState,e]},useRef:function(e){var t=Ko();return e={current:e},t.memoizedState=e},useState:jP,useDebugValue:D4,useDeferredValue:function(e){return Ko().memoizedState=e},useTransition:function(){var e=jP(!1),t=e[0];return e=lK.bind(null,e[1]),Ko().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Jt,i=Ko();if(qt){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),Hn===null)throw Error(ne(349));Yu&30||F7(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,UP(z7.bind(null,r,o,e),[e]),r.flags|=2048,Up(9,B7.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ko(),t=Hn.identifierPrefix;if(qt){var n=Ya,r=Qa;n=(r&~(1<<32-To(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vp++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sK++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},fK={readContext:Qi,useCallback:K7,useContext:Qi,useEffect:N4,useImperativeHandle:W7,useInsertionEffect:G7,useLayoutEffect:H7,useMemo:X7,useReducer:vx,useRef:U7,useState:function(){return vx(jp)},useDebugValue:D4,useDeferredValue:function(e){var t=Yi();return Q7(t,Pn.memoizedState,e)},useTransition:function(){var e=vx(jp)[0],t=Yi().memoizedState;return[e,t]},useMutableSource:D7,useSyncExternalStore:L7,useId:Y7,unstable_isNewReconciler:!1},hK={readContext:Qi,useCallback:K7,useContext:Qi,useEffect:N4,useImperativeHandle:W7,useInsertionEffect:G7,useLayoutEffect:H7,useMemo:X7,useReducer:bx,useRef:U7,useState:function(){return bx(jp)},useDebugValue:D4,useDeferredValue:function(e){var t=Yi();return Pn===null?t.memoizedState=e:Q7(t,Pn.memoizedState,e)},useTransition:function(){var e=bx(jp)[0],t=Yi().memoizedState;return[e,t]},useMutableSource:D7,useSyncExternalStore:L7,useId:Y7,unstable_isNewReconciler:!1};function of(e,t){try{var n="",r=t;do n+=Vq(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 _x(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function BC(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var pK=typeof WeakMap=="function"?WeakMap:Map;function t$(e,t,n){n=ns(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zv||(zv=!0,XC=r),BC(e,t)},n}function n$(e,t,n){n=ns(-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(){BC(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){BC(e,t),typeof r!="function"&&(hl===null?hl=new Set([this]):hl.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function GP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new pK;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=PK.bind(null,e,t,n),t.then(e,e))}function HP(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 qP(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=ns(-1,1),t.tag=2,fl(n,t,1))),n.lanes|=1),e)}var gK=Ss.ReactCurrentOwner,Xr=!1;function Mr(e,t,n,r){t.child=e===null?$7(t,null,n,r):nf(t,e.child,n,r)}function WP(e,t,n,r,i){n=n.render;var o=t.ref;return Cd(t,i),r=O4(e,t,n,r,o,i),n=$4(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fs(e,t,i)):(qt&&n&&S4(t),t.flags|=1,Mr(e,t,r,i),t.child)}function KP(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!G4(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,r$(e,t,o,r,i)):(e=Fy(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 a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Np,n(a,r)&&e.ref===t.ref)return fs(e,t,i)}return t.flags|=1,e=gl(o,r),e.ref=t.ref,e.return=t,t.child=e}function r$(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Np(o,r)&&e.ref===t.ref)if(Xr=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Xr=!0);else return t.lanes=e.lanes,fs(e,t,i)}return zC(e,t,n,r,i)}function i$(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},Mt(sd,pi),pi|=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,Mt(sd,pi),pi|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Mt(sd,pi),pi|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Mt(sd,pi),pi|=r;return Mr(e,t,i,n),t.child}function o$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zC(e,t,n,r,i){var o=Jr(n)?Xu:br.current;return o=ef(t,o),Cd(t,i),n=O4(e,t,n,r,o,i),r=$4(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fs(e,t,i)):(qt&&r&&S4(t),t.flags|=1,Mr(e,t,n,i),t.child)}function XP(e,t,n,r,i){if(Jr(n)){var o=!0;Iv(t)}else o=!1;if(Cd(t,i),t.stateNode===null)Ny(e,t),R7(t,n,r),FC(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qi(u):(u=Jr(n)?Xu:br.current,u=ef(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&zP(t,a,r,u),Hs=!1;var f=t.memoizedState;a.state=f,Nv(t,r,a,i),l=t.memoizedState,s!==r||f!==l||Zr.current||Hs?(typeof c=="function"&&(LC(t,n,c,r),l=t.memoizedState),(s=Hs||BP(t,n,s,r,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,I7(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:mo(t.type,s),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Qi(l):(l=Jr(n)?Xu:br.current,l=ef(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&zP(t,a,r,l),Hs=!1,f=t.memoizedState,a.state=f,Nv(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||Zr.current||Hs?(typeof h=="function"&&(LC(t,n,h,r),p=t.memoizedState),(u=Hs||BP(t,n,u,r,f,p,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return VC(e,t,n,r,o,i)}function VC(e,t,n,r,i,o){o$(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&$P(t,n,!1),fs(e,t,o);r=t.stateNode,gK.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=nf(t,e.child,null,o),t.child=nf(t,null,s,o)):Mr(e,t,s,o),t.memoizedState=r.state,i&&$P(t,n,!0),t.child}function a$(e){var t=e.stateNode;t.pendingContext?OP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&OP(e,t.context,!1),k4(e,t.containerInfo)}function QP(e,t,n,r,i){return tf(),w4(i),t.flags|=256,Mr(e,t,n,r),t.child}var jC={dehydrated:null,treeContext:null,retryLane:0};function UC(e){return{baseLanes:e,cachePool:null,transitions:null}}function s$(e,t,n){var r=t.pendingProps,i=Yt.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Mt(Yt,i&1),e===null)return NC(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):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=Rb(a,r,0,null),e=Fu(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=UC(n),t.memoizedState=jC,e):L4(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return mK(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=gl(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=gl(s,o):(o=Fu(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?UC(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=jC,r}return o=e.child,e=o.sibling,r=gl(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 L4(e,t){return t=Rb({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function p0(e,t,n,r){return r!==null&&w4(r),nf(t,e.child,null,n),e=L4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mK(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=_x(Error(ne(422))),p0(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Rb({mode:"visible",children:r.children},i,0,null),o=Fu(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&nf(t,e.child,null,a),t.child.memoizedState=UC(a),t.memoizedState=jC,o);if(!(t.mode&1))return p0(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(ne(419)),r=_x(o,r,void 0),p0(e,t,a,r)}if(s=(a&e.childLanes)!==0,Xr||s){if(r=Hn,r!==null){switch(a&-a){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|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,ds(e,i),Ao(r,e,i,-1))}return U4(),r=_x(Error(ne(421))),p0(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=kK.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,bi=dl(i.nextSibling),_i=t,qt=!0,_o=null,e!==null&&(Gi[Hi++]=Qa,Gi[Hi++]=Ya,Gi[Hi++]=Qu,Qa=e.id,Ya=e.overflow,Qu=t),t=L4(t,r.children),t.flags|=4096,t)}function YP(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),DC(e.return,t,n)}function Sx(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 l$(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Mr(e,t,r.children,n),r=Yt.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&&YP(e,n,t);else if(e.tag===19)YP(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(Mt(Yt,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&&Dv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sx(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&&Dv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sx(t,!0,n,null,o);break;case"together":Sx(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ny(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zu|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,n=gl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yK(e,t,n){switch(t.tag){case 3:a$(t),tf();break;case 5:N7(t);break;case 1:Jr(t.type)&&Iv(t);break;case 4:k4(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Mt(Ov,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Mt(Yt,Yt.current&1),t.flags|=128,null):n&t.child.childLanes?s$(e,t,n):(Mt(Yt,Yt.current&1),e=fs(e,t,n),e!==null?e.sibling:null);Mt(Yt,Yt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return l$(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mt(Yt,Yt.current),r)break;return null;case 22:case 23:return t.lanes=0,i$(e,t,n)}return fs(e,t,n)}var u$,GC,c$,d$;u$=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}};GC=function(){};c$=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Pu(fa.current);var o=null;switch(n){case"input":i=fC(e,i),r=fC(e,r),o=[];break;case"select":i=en({},i,{value:void 0}),r=en({},r,{value:void 0}),o=[];break;case"textarea":i=gC(e,i),r=gC(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pv)}yC(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Pp.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Pp.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Nt("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};d$=function(e,t,n,r){n!==r&&(t.flags|=4)};function sh(e,t){if(!qt)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 fr(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 vK(e,t,n){var r=t.pendingProps;switch(x4(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fr(t),null;case 1:return Jr(t.type)&&kv(),fr(t),null;case 3:return r=t.stateNode,rf(),zt(Zr),zt(br),M4(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(f0(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_o!==null&&(ZC(_o),_o=null))),GC(e,t),fr(t),null;case 5:I4(t);var i=Pu(zp.current);if(n=t.type,e!==null&&t.stateNode!=null)c$(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ne(166));return fr(t),null}if(e=Pu(fa.current),f0(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[ra]=t,r[Fp]=o,e=(t.mode&1)!==0,n){case"dialog":Nt("cancel",r),Nt("close",r);break;case"iframe":case"object":case"embed":Nt("load",r);break;case"video":case"audio":for(i=0;i<Fh.length;i++)Nt(Fh[i],r);break;case"source":Nt("error",r);break;case"img":case"image":case"link":Nt("error",r),Nt("load",r);break;case"details":Nt("toggle",r);break;case"input":aP(r,o),Nt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Nt("invalid",r);break;case"textarea":lP(r,o),Nt("invalid",r)}yC(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&d0(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&d0(r.textContent,s,e),i=["children",""+s]):Pp.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&Nt("scroll",r)}switch(n){case"input":r0(r),sP(r,o,!0);break;case"textarea":r0(r),uP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Pv)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=FO(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ra]=t,e[Fp]=r,u$(e,t,!1,!1),t.stateNode=e;e:{switch(a=vC(n,r),n){case"dialog":Nt("cancel",e),Nt("close",e),i=r;break;case"iframe":case"object":case"embed":Nt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Fh.length;i++)Nt(Fh[i],e);i=r;break;case"source":Nt("error",e),i=r;break;case"img":case"image":case"link":Nt("error",e),Nt("load",e),i=r;break;case"details":Nt("toggle",e),i=r;break;case"input":aP(e,r),i=fC(e,r),Nt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=en({},r,{value:void 0}),Nt("invalid",e);break;case"textarea":lP(e,r),i=gC(e,r),Nt("invalid",e);break;default:i=r}yC(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?VO(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&BO(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&kp(e,l):typeof l=="number"&&kp(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Pp.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Nt("scroll",e):l!=null&&s4(e,o,l,a))}switch(n){case"input":r0(e),sP(e,r,!1);break;case"textarea":r0(e),uP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wl(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?_d(e,!!r.multiple,o,!1):r.defaultValue!=null&&_d(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pv)}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 fr(t),null;case 6:if(e&&t.stateNode!=null)d$(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ne(166));if(n=Pu(zp.current),Pu(fa.current),f0(t)){if(r=t.stateNode,n=t.memoizedProps,r[ra]=t,(o=r.nodeValue!==n)&&(e=_i,e!==null))switch(e.tag){case 3:d0(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&d0(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ra]=t,t.stateNode=r}return fr(t),null;case 13:if(zt(Yt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qt&&bi!==null&&t.mode&1&&!(t.flags&128))P7(),tf(),t.flags|=98560,o=!1;else if(o=f0(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ne(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ne(317));o[ra]=t}else tf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fr(t),o=!1}else _o!==null&&(ZC(_o),_o=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||Yt.current&1?Mn===0&&(Mn=3):U4())),t.updateQueue!==null&&(t.flags|=4),fr(t),null);case 4:return rf(),GC(e,t),e===null&&Dp(t.stateNode.containerInfo),fr(t),null;case 10:return T4(t.type._context),fr(t),null;case 17:return Jr(t.type)&&kv(),fr(t),null;case 19:if(zt(Yt),o=t.memoizedState,o===null)return fr(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)sh(o,!1);else{if(Mn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Dv(e),a!==null){for(t.flags|=128,sh(o,!1),r=a.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,a=o.alternate,a===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=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Mt(Yt,Yt.current&1|2),t.child}e=e.sibling}o.tail!==null&&mn()>af&&(t.flags|=128,r=!0,sh(o,!1),t.lanes=4194304)}else{if(!r)if(e=Dv(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!qt)return fr(t),null}else 2*mn()-o.renderingStartTime>af&&n!==1073741824&&(t.flags|=128,r=!0,sh(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=mn(),t.sibling=null,n=Yt.current,Mt(Yt,r?n&1|2:n&1),t):(fr(t),null);case 22:case 23:return j4(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pi&1073741824&&(fr(t),t.subtreeFlags&6&&(t.flags|=8192)):fr(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function bK(e,t){switch(x4(t),t.tag){case 1:return Jr(t.type)&&kv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rf(),zt(Zr),zt(br),M4(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return I4(t),null;case 13:if(zt(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));tf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(Yt),null;case 4:return rf(),null;case 10:return T4(t.type._context),null;case 22:case 23:return j4(),null;case 24:return null;default:return null}}var g0=!1,yr=!1,_K=typeof WeakSet=="function"?WeakSet:Set,be=null;function ad(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){an(e,t,r)}else n.current=null}function HC(e,t,n){try{n()}catch(r){an(e,t,r)}}var ZP=!1;function SK(e,t){if(PC=Ev,e=g7(),_4(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 a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(kC={focusedElem:e,selectionRange:n},Ev=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){t=be;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,_=p.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:mo(t.type,g),_);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(v){an(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}return p=ZP,ZP=!1,p}function sp(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&&HC(t,n,o)}i=i.next}while(i!==r)}}function Ib(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 qC(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 f$(e){var t=e.alternate;t!==null&&(e.alternate=null,f$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ra],delete t[Fp],delete t[RC],delete t[rK],delete t[iK])),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 h$(e){return e.tag===5||e.tag===3||e.tag===4}function JP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||h$(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 WC(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=Pv));else if(r!==4&&(e=e.child,e!==null))for(WC(e,t,n),e=e.sibling;e!==null;)WC(e,t,n),e=e.sibling}function KC(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(KC(e,t,n),e=e.sibling;e!==null;)KC(e,t,n),e=e.sibling}var tr=null,vo=!1;function Os(e,t,n){for(n=n.child;n!==null;)p$(e,t,n),n=n.sibling}function p$(e,t,n){if(da&&typeof da.onCommitFiberUnmount=="function")try{da.onCommitFiberUnmount(xb,n)}catch{}switch(n.tag){case 5:yr||ad(n,t);case 6:var r=tr,i=vo;tr=null,Os(e,t,n),tr=r,vo=i,tr!==null&&(vo?(e=tr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tr.removeChild(n.stateNode));break;case 18:tr!==null&&(vo?(e=tr,n=n.stateNode,e.nodeType===8?px(e.parentNode,n):e.nodeType===1&&px(e,n),Op(e)):px(tr,n.stateNode));break;case 4:r=tr,i=vo,tr=n.stateNode.containerInfo,vo=!0,Os(e,t,n),tr=r,vo=i;break;case 0:case 11:case 14:case 15:if(!yr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&HC(n,t,a),i=i.next}while(i!==r)}Os(e,t,n);break;case 1:if(!yr&&(ad(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){an(n,t,s)}Os(e,t,n);break;case 21:Os(e,t,n);break;case 22:n.mode&1?(yr=(r=yr)||n.memoizedState!==null,Os(e,t,n),yr=r):Os(e,t,n);break;default:Os(e,t,n)}}function ek(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _K),t.forEach(function(r){var i=IK.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ho(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,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:tr=s.stateNode,vo=!1;break e;case 3:tr=s.stateNode.containerInfo,vo=!0;break e;case 4:tr=s.stateNode.containerInfo,vo=!0;break e}s=s.return}if(tr===null)throw Error(ne(160));p$(o,a,i),tr=null,vo=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){an(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)g$(t,e),t=t.sibling}function g$(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ho(t,e),Ho(e),r&4){try{sp(3,e,e.return),Ib(3,e)}catch(g){an(e,e.return,g)}try{sp(5,e,e.return)}catch(g){an(e,e.return,g)}}break;case 1:ho(t,e),Ho(e),r&512&&n!==null&&ad(n,n.return);break;case 5:if(ho(t,e),Ho(e),r&512&&n!==null&&ad(n,n.return),e.flags&32){var i=e.stateNode;try{kp(i,"")}catch(g){an(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&DO(i,o),vC(s,a);var u=vC(s,o);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?VO(i,d):c==="dangerouslySetInnerHTML"?BO(i,d):c==="children"?kp(i,d):s4(i,c,d,u)}switch(s){case"input":hC(i,o);break;case"textarea":LO(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?_d(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?_d(i,!!o.multiple,o.defaultValue,!0):_d(i,!!o.multiple,o.multiple?[]:"",!1))}i[Fp]=o}catch(g){an(e,e.return,g)}}break;case 6:if(ho(t,e),Ho(e),r&4){if(e.stateNode===null)throw Error(ne(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(g){an(e,e.return,g)}}break;case 3:if(ho(t,e),Ho(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Op(t.containerInfo)}catch(g){an(e,e.return,g)}break;case 4:ho(t,e),Ho(e);break;case 13:ho(t,e),Ho(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(z4=mn())),r&4&&ek(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(yr=(u=yr)||c,ho(t,e),yr=u):ho(t,e),Ho(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(be=e,c=e.child;c!==null;){for(d=be=c;be!==null;){switch(f=be,h=f.child,f.tag){case 0:case 11:case 14:case 15:sp(4,f,f.return);break;case 1:ad(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){an(r,n,g)}}break;case 5:ad(f,f.return);break;case 22:if(f.memoizedState!==null){nk(d);continue}}h!==null?(h.return=f,be=h):nk(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=zO("display",a))}catch(g){an(e,e.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){an(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ho(t,e),Ho(e),r&4&&ek(e);break;case 21:break;default:ho(t,e),Ho(e)}}function Ho(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(h$(n)){var r=n;break e}n=n.return}throw Error(ne(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(kp(i,""),r.flags&=-33);var o=JP(e);KC(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=JP(e);WC(e,s,a);break;default:throw Error(ne(161))}}catch(l){an(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xK(e,t,n){be=e,m$(e)}function m$(e,t,n){for(var r=(e.mode&1)!==0;be!==null;){var i=be,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||g0;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||yr;s=g0;var u=yr;if(g0=a,(yr=l)&&!u)for(be=i;be!==null;)a=be,l=a.child,a.tag===22&&a.memoizedState!==null?rk(i):l!==null?(l.return=a,be=l):rk(i);for(;o!==null;)be=o,m$(o),o=o.sibling;be=i,g0=s,yr=u}tk(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,be=o):tk(e)}}function tk(e){for(;be!==null;){var t=be;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yr||Ib(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yr)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:mo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&FP(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}FP(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Op(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}yr||t.flags&512&&qC(t)}catch(f){an(t,t.return,f)}}if(t===e){be=null;break}if(n=t.sibling,n!==null){n.return=t.return,be=n;break}be=t.return}}function nk(e){for(;be!==null;){var t=be;if(t===e){be=null;break}var n=t.sibling;if(n!==null){n.return=t.return,be=n;break}be=t.return}}function rk(e){for(;be!==null;){var t=be;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ib(4,t)}catch(l){an(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){an(t,i,l)}}var o=t.return;try{qC(t)}catch(l){an(t,o,l)}break;case 5:var a=t.return;try{qC(t)}catch(l){an(t,a,l)}}}catch(l){an(t,t.return,l)}if(t===e){be=null;break}var s=t.sibling;if(s!==null){s.return=t.return,be=s;break}be=t.return}}var wK=Math.ceil,Bv=Ss.ReactCurrentDispatcher,F4=Ss.ReactCurrentOwner,Xi=Ss.ReactCurrentBatchConfig,st=0,Hn=null,Cn=null,ar=0,pi=0,sd=Vl(0),Mn=0,Gp=null,Zu=0,Mb=0,B4=0,lp=null,qr=null,z4=0,af=1/0,Va=null,zv=!1,XC=null,hl=null,m0=!1,ol=null,Vv=0,up=0,QC=null,Dy=-1,Ly=0;function $r(){return st&6?mn():Dy!==-1?Dy:Dy=mn()}function pl(e){return e.mode&1?st&2&&ar!==0?ar&-ar:aK.transition!==null?(Ly===0&&(Ly=JO()),Ly):(e=vt,e!==0||(e=window.event,e=e===void 0?16:a7(e.type)),e):1}function Ao(e,t,n,r){if(50<up)throw up=0,QC=null,Error(ne(185));im(e,n,r),(!(st&2)||e!==Hn)&&(e===Hn&&(!(st&2)&&(Mb|=n),Mn===4&&Ys(e,ar)),ei(e,r),n===1&&st===0&&!(t.mode&1)&&(af=mn()+500,Ab&&jl()))}function ei(e,t){var n=e.callbackNode;aW(e,t);var r=Cv(e,e===Hn?ar:0);if(r===0)n!==null&&fP(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&fP(n),t===1)e.tag===0?oK(ik.bind(null,e)):E7(ik.bind(null,e)),tK(function(){!(st&6)&&jl()}),n=null;else{switch(e7(r)){case 1:n=f4;break;case 4:n=YO;break;case 16:n=wv;break;case 536870912:n=ZO;break;default:n=wv}n=C$(n,y$.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function y$(e,t){if(Dy=-1,Ly=0,st&6)throw Error(ne(327));var n=e.callbackNode;if(Ed()&&e.callbackNode!==n)return null;var r=Cv(e,e===Hn?ar:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=jv(e,r);else{t=r;var i=st;st|=2;var o=b$();(Hn!==e||ar!==t)&&(Va=null,af=mn()+500,Lu(e,t));do try{TK();break}catch(s){v$(e,s)}while(1);E4(),Bv.current=o,st=i,Cn!==null?t=0:(Hn=null,ar=0,t=Mn)}if(t!==0){if(t===2&&(i=wC(e),i!==0&&(r=i,t=YC(e,i))),t===1)throw n=Gp,Lu(e,0),Ys(e,r),ei(e,mn()),n;if(t===6)Ys(e,r);else{if(i=e.current.alternate,!(r&30)&&!CK(i)&&(t=jv(e,r),t===2&&(o=wC(e),o!==0&&(r=o,t=YC(e,o))),t===1))throw n=Gp,Lu(e,0),Ys(e,r),ei(e,mn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ne(345));case 2:pu(e,qr,Va);break;case 3:if(Ys(e,r),(r&130023424)===r&&(t=z4+500-mn(),10<t)){if(Cv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){$r(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=MC(pu.bind(null,e,qr,Va),t);break}pu(e,qr,Va);break;case 4:if(Ys(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-To(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=mn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wK(r/1960))-r,10<r){e.timeoutHandle=MC(pu.bind(null,e,qr,Va),r);break}pu(e,qr,Va);break;case 5:pu(e,qr,Va);break;default:throw Error(ne(329))}}}return ei(e,mn()),e.callbackNode===n?y$.bind(null,e):null}function YC(e,t){var n=lp;return e.current.memoizedState.isDehydrated&&(Lu(e,t).flags|=256),e=jv(e,t),e!==2&&(t=qr,qr=n,t!==null&&ZC(t)),e}function ZC(e){qr===null?qr=e:qr.push.apply(qr,e)}function CK(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(!Oo(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 Ys(e,t){for(t&=~B4,t&=~Mb,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-To(t),r=1<<n;e[n]=-1,t&=~r}}function ik(e){if(st&6)throw Error(ne(327));Ed();var t=Cv(e,0);if(!(t&1))return ei(e,mn()),null;var n=jv(e,t);if(e.tag!==0&&n===2){var r=wC(e);r!==0&&(t=r,n=YC(e,r))}if(n===1)throw n=Gp,Lu(e,0),Ys(e,t),ei(e,mn()),n;if(n===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pu(e,qr,Va),ei(e,mn()),null}function V4(e,t){var n=st;st|=1;try{return e(t)}finally{st=n,st===0&&(af=mn()+500,Ab&&jl())}}function Ju(e){ol!==null&&ol.tag===0&&!(st&6)&&Ed();var t=st;st|=1;var n=Xi.transition,r=vt;try{if(Xi.transition=null,vt=1,e)return e()}finally{vt=r,Xi.transition=n,st=t,!(st&6)&&jl()}}function j4(){pi=sd.current,zt(sd)}function Lu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,eK(n)),Cn!==null)for(n=Cn.return;n!==null;){var r=n;switch(x4(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&kv();break;case 3:rf(),zt(Zr),zt(br),M4();break;case 5:I4(r);break;case 4:rf();break;case 13:zt(Yt);break;case 19:zt(Yt);break;case 10:T4(r.type._context);break;case 22:case 23:j4()}n=n.return}if(Hn=e,Cn=e=gl(e.current,null),ar=pi=t,Mn=0,Gp=null,B4=Mb=Zu=0,qr=lp=null,Au!==null){for(t=0;t<Au.length;t++)if(n=Au[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Au=null}return e}function v$(e,t){do{var n=Cn;try{if(E4(),Oy.current=Fv,Lv){for(var r=Jt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Lv=!1}if(Yu=0,Vn=Pn=Jt=null,ap=!1,Vp=0,F4.current=null,n===null||n.return===null){Mn=1,Gp=t,Cn=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=ar,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=HP(a);if(h!==null){h.flags&=-257,qP(h,a,s,o,t),h.mode&1&&GP(o,u,t),t=h,l=u;var p=t.updateQueue;if(p===null){var g=new Set;g.add(l),t.updateQueue=g}else p.add(l);break e}else{if(!(t&1)){GP(o,u,t),U4();break e}l=Error(ne(426))}}else if(qt&&s.mode&1){var _=HP(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),qP(_,a,s,o,t),w4(of(l,s));break e}}o=l=of(l,s),Mn!==4&&(Mn=2),lp===null?lp=[o]:lp.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=t$(o,l,t);LP(o,b);break e;case 1:s=l;var y=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(hl===null||!hl.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=n$(o,s,t);LP(o,v);break e}}o=o.return}while(o!==null)}S$(n)}catch(S){t=S,Cn===n&&n!==null&&(Cn=n=n.return);continue}break}while(1)}function b$(){var e=Bv.current;return Bv.current=Fv,e===null?Fv:e}function U4(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),Hn===null||!(Zu&268435455)&&!(Mb&268435455)||Ys(Hn,ar)}function jv(e,t){var n=st;st|=2;var r=b$();(Hn!==e||ar!==t)&&(Va=null,Lu(e,t));do try{EK();break}catch(i){v$(e,i)}while(1);if(E4(),st=n,Bv.current=r,Cn!==null)throw Error(ne(261));return Hn=null,ar=0,Mn}function EK(){for(;Cn!==null;)_$(Cn)}function TK(){for(;Cn!==null&&!Yq();)_$(Cn)}function _$(e){var t=w$(e.alternate,e,pi);e.memoizedProps=e.pendingProps,t===null?S$(e):Cn=t,F4.current=null}function S$(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=bK(n,t),n!==null){n.flags&=32767,Cn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Mn=6,Cn=null;return}}else if(n=vK(n,t,pi),n!==null){Cn=n;return}if(t=t.sibling,t!==null){Cn=t;return}Cn=t=e}while(t!==null);Mn===0&&(Mn=5)}function pu(e,t,n){var r=vt,i=Xi.transition;try{Xi.transition=null,vt=1,AK(e,t,n,r)}finally{Xi.transition=i,vt=r}return null}function AK(e,t,n,r){do Ed();while(ol!==null);if(st&6)throw Error(ne(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(ne(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(sW(e,o),e===Hn&&(Cn=Hn=null,ar=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||m0||(m0=!0,C$(wv,function(){return Ed(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Xi.transition,Xi.transition=null;var a=vt;vt=1;var s=st;st|=4,F4.current=null,SK(e,n),g$(n,e),WW(kC),Ev=!!PC,kC=PC=null,e.current=n,xK(n),Zq(),st=s,vt=a,Xi.transition=o}else e.current=n;if(m0&&(m0=!1,ol=e,Vv=i),o=e.pendingLanes,o===0&&(hl=null),tW(n.stateNode),ei(e,mn()),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(zv)throw zv=!1,e=XC,XC=null,e;return Vv&1&&e.tag!==0&&Ed(),o=e.pendingLanes,o&1?e===QC?up++:(up=0,QC=e):up=0,jl(),null}function Ed(){if(ol!==null){var e=e7(Vv),t=Xi.transition,n=vt;try{if(Xi.transition=null,vt=16>e?16:e,ol===null)var r=!1;else{if(e=ol,ol=null,Vv=0,st&6)throw Error(ne(331));var i=st;for(st|=4,be=e.current;be!==null;){var o=be,a=o.child;if(be.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(be=u;be!==null;){var c=be;switch(c.tag){case 0:case 11:case 15:sp(8,c,o)}var d=c.child;if(d!==null)d.return=c,be=d;else for(;be!==null;){c=be;var f=c.sibling,h=c.return;if(f$(c),c===u){be=null;break}if(f!==null){f.return=h,be=f;break}be=h}}}var p=o.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}be=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,be=a;else e:for(;be!==null;){if(o=be,o.flags&2048)switch(o.tag){case 0:case 11:case 15:sp(9,o,o.return)}var b=o.sibling;if(b!==null){b.return=o.return,be=b;break e}be=o.return}}var y=e.current;for(be=y;be!==null;){a=be;var m=a.child;if(a.subtreeFlags&2064&&m!==null)m.return=a,be=m;else e:for(a=y;be!==null;){if(s=be,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Ib(9,s)}}catch(S){an(s,s.return,S)}if(s===a){be=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,be=v;break e}be=s.return}}if(st=i,jl(),da&&typeof da.onPostCommitFiberRoot=="function")try{da.onPostCommitFiberRoot(xb,e)}catch{}r=!0}return r}finally{vt=n,Xi.transition=t}}return!1}function ok(e,t,n){t=of(n,t),t=t$(e,t,1),e=fl(e,t,1),t=$r(),e!==null&&(im(e,1,t),ei(e,t))}function an(e,t,n){if(e.tag===3)ok(e,e,n);else for(;t!==null;){if(t.tag===3){ok(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hl===null||!hl.has(r))){e=of(n,e),e=n$(t,e,1),t=fl(t,e,1),e=$r(),t!==null&&(im(t,1,e),ei(t,e));break}}t=t.return}}function PK(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$r(),e.pingedLanes|=e.suspendedLanes&n,Hn===e&&(ar&n)===n&&(Mn===4||Mn===3&&(ar&130023424)===ar&&500>mn()-z4?Lu(e,0):B4|=n),ei(e,t)}function x$(e,t){t===0&&(e.mode&1?(t=a0,a0<<=1,!(a0&130023424)&&(a0=4194304)):t=1);var n=$r();e=ds(e,t),e!==null&&(im(e,t,n),ei(e,n))}function kK(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),x$(e,n)}function IK(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(ne(314))}r!==null&&r.delete(t),x$(e,n)}var w$;w$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zr.current)Xr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xr=!1,yK(e,t,n);Xr=!!(e.flags&131072)}else Xr=!1,qt&&t.flags&1048576&&T7(t,Rv,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ny(e,t),e=t.pendingProps;var i=ef(t,br.current);Cd(t,n),i=O4(null,t,r,e,i,n);var o=$4();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,Jr(r)?(o=!0,Iv(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,P4(t),i.updater=Pb,t.stateNode=i,i._reactInternals=t,FC(t,r,e,n),t=VC(null,t,r,!0,o,n)):(t.tag=0,qt&&o&&S4(t),Mr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ny(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=RK(r),e=mo(r,e),i){case 0:t=zC(null,t,r,e,n);break e;case 1:t=XP(null,t,r,e,n);break e;case 11:t=WP(null,t,r,e,n);break e;case 14:t=KP(null,t,r,mo(r.type,e),n);break e}throw Error(ne(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mo(r,i),zC(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mo(r,i),XP(e,t,r,i,n);case 3:e:{if(a$(t),e===null)throw Error(ne(387));r=t.pendingProps,o=t.memoizedState,i=o.element,I7(e,t),Nv(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=of(Error(ne(423)),t),t=QP(e,t,r,n,i);break e}else if(r!==i){i=of(Error(ne(424)),t),t=QP(e,t,r,n,i);break e}else for(bi=dl(t.stateNode.containerInfo.firstChild),_i=t,qt=!0,_o=null,n=$7(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tf(),r===i){t=fs(e,t,n);break e}Mr(e,t,r,n)}t=t.child}return t;case 5:return N7(t),e===null&&NC(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,IC(r,i)?a=null:o!==null&&IC(r,o)&&(t.flags|=32),o$(e,t),Mr(e,t,a,n),t.child;case 6:return e===null&&NC(t),null;case 13:return s$(e,t,n);case 4:return k4(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=nf(t,null,r,n):Mr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mo(r,i),WP(e,t,r,i,n);case 7:return Mr(e,t,t.pendingProps,n),t.child;case 8:return Mr(e,t,t.pendingProps.children,n),t.child;case 12:return Mr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Mt(Ov,r._currentValue),r._currentValue=a,o!==null)if(Oo(o.value,a)){if(o.children===i.children&&!Zr.current){t=fs(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ns(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),DC(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ne(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),DC(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Mr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Cd(t,n),i=Qi(i),r=r(i),t.flags|=1,Mr(e,t,r,n),t.child;case 14:return r=t.type,i=mo(r,t.pendingProps),i=mo(r.type,i),KP(e,t,r,i,n);case 15:return r$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mo(r,i),Ny(e,t),t.tag=1,Jr(r)?(e=!0,Iv(t)):e=!1,Cd(t,n),R7(t,r,i),FC(t,r,i,n),VC(null,t,r,!0,e,n);case 19:return l$(e,t,n);case 22:return i$(e,t,n)}throw Error(ne(156,t.tag))};function C$(e,t){return QO(e,t)}function MK(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 Wi(e,t,n,r){return new MK(e,t,n,r)}function G4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RK(e){if(typeof e=="function")return G4(e)?1:0;if(e!=null){if(e=e.$$typeof,e===u4)return 11;if(e===c4)return 14}return 2}function gl(e,t){var n=e.alternate;return n===null?(n=Wi(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 Fy(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")G4(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Yc:return Fu(n.children,i,o,t);case l4:a=8,i|=8;break;case lC:return e=Wi(12,n,t,i|2),e.elementType=lC,e.lanes=o,e;case uC:return e=Wi(13,n,t,i),e.elementType=uC,e.lanes=o,e;case cC:return e=Wi(19,n,t,i),e.elementType=cC,e.lanes=o,e;case OO:return Rb(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case MO:a=10;break e;case RO:a=9;break e;case u4:a=11;break e;case c4:a=14;break e;case Gs:a=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Wi(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Fu(e,t,n,r){return e=Wi(7,e,r,t),e.lanes=n,e}function Rb(e,t,n,r){return e=Wi(22,e,r,t),e.elementType=OO,e.lanes=n,e.stateNode={isHidden:!1},e}function xx(e,t,n){return e=Wi(6,e,null,t),e.lanes=n,e}function wx(e,t,n){return t=Wi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function OK(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=rx(0),this.expirationTimes=rx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rx(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function H4(e,t,n,r,i,o,a,s,l){return e=new OK(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Wi(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},P4(o),e}function $K(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qc,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function E$(e){if(!e)return Cl;e=e._reactInternals;e:{if(cc(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var n=e.type;if(Jr(n))return C7(e,n,t)}return t}function T$(e,t,n,r,i,o,a,s,l){return e=H4(n,r,!0,e,i,o,a,s,l),e.context=E$(null),n=e.current,r=$r(),i=pl(n),o=ns(r,i),o.callback=t??null,fl(n,o,i),e.current.lanes=i,im(e,i,r),ei(e,r),e}function Ob(e,t,n,r){var i=t.current,o=$r(),a=pl(i);return n=E$(n),t.context===null?t.context=n:t.pendingContext=n,t=ns(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fl(i,t,a),e!==null&&(Ao(e,i,a,o),Ry(e,i,a)),a}function Uv(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 ak(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function q4(e,t){ak(e,t),(e=e.alternate)&&ak(e,t)}function NK(){return null}var A$=typeof reportError=="function"?reportError:function(e){console.error(e)};function W4(e){this._internalRoot=e}$b.prototype.render=W4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));Ob(e,t,null,null)};$b.prototype.unmount=W4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ju(function(){Ob(null,e,null,null)}),t[cs]=null}};function $b(e){this._internalRoot=e}$b.prototype.unstable_scheduleHydration=function(e){if(e){var t=r7();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qs.length&&t!==0&&t<Qs[n].priority;n++);Qs.splice(n,0,e),n===0&&o7(e)}};function K4(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sk(){}function DK(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=Uv(a);o.call(u)}}var a=T$(t,r,e,0,null,!1,!1,"",sk);return e._reactRootContainer=a,e[cs]=a.current,Dp(e.nodeType===8?e.parentNode:e),Ju(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=Uv(l);s.call(u)}}var l=H4(e,0,!1,null,null,!1,!1,"",sk);return e._reactRootContainer=l,e[cs]=l.current,Dp(e.nodeType===8?e.parentNode:e),Ju(function(){Ob(t,l,n,r)}),l}function Db(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=Uv(a);s.call(l)}}Ob(t,a,e,i)}else a=DK(n,t,e,i,r);return Uv(a)}t7=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lh(t.pendingLanes);n!==0&&(h4(t,n|1),ei(t,mn()),!(st&6)&&(af=mn()+500,jl()))}break;case 13:Ju(function(){var r=ds(e,1);if(r!==null){var i=$r();Ao(r,e,1,i)}}),q4(e,1)}};p4=function(e){if(e.tag===13){var t=ds(e,134217728);if(t!==null){var n=$r();Ao(t,e,134217728,n)}q4(e,134217728)}};n7=function(e){if(e.tag===13){var t=pl(e),n=ds(e,t);if(n!==null){var r=$r();Ao(n,e,t,r)}q4(e,t)}};r7=function(){return vt};i7=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}};_C=function(e,t,n){switch(t){case"input":if(hC(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=Tb(r);if(!i)throw Error(ne(90));NO(r),hC(r,i)}}}break;case"textarea":LO(e,n);break;case"select":t=n.value,t!=null&&_d(e,!!n.multiple,t,!1)}};GO=V4;HO=Ju;var LK={usingClientEntryPoint:!1,Events:[am,td,Tb,jO,UO,V4]},lh={findFiberByHostInstance:Tu,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},FK={bundleType:lh.bundleType,version:lh.version,rendererPackageName:lh.rendererPackageName,rendererConfig:lh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ss.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=KO(e),e===null?null:e.stateNode},findFiberByHostInstance:lh.findFiberByHostInstance||NK,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 y0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!y0.isDisabled&&y0.supportsFiber)try{xb=y0.inject(FK),da=y0}catch{}}Ai.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LK;Ai.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K4(t))throw Error(ne(200));return $K(e,t,null,n)};Ai.createRoot=function(e,t){if(!K4(e))throw Error(ne(299));var n=!1,r="",i=A$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=H4(e,1,!1,null,null,n,!1,r,i),e[cs]=t.current,Dp(e.nodeType===8?e.parentNode:e),new W4(t)};Ai.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(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=KO(t),e=e===null?null:e.stateNode,e};Ai.flushSync=function(e){return Ju(e)};Ai.hydrate=function(e,t,n){if(!Nb(t))throw Error(ne(200));return Db(null,e,t,!0,n)};Ai.hydrateRoot=function(e,t,n){if(!K4(e))throw Error(ne(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=A$;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=T$(t,null,e,1,n??null,i,!1,o,a),e[cs]=t.current,Dp(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 $b(t)};Ai.render=function(e,t,n){if(!Nb(t))throw Error(ne(200));return Db(null,e,t,!1,n)};Ai.unmountComponentAtNode=function(e){if(!Nb(e))throw Error(ne(40));return e._reactRootContainer?(Ju(function(){Db(null,null,e,!1,function(){e._reactRootContainer=null,e[cs]=null})}),!0):!1};Ai.unstable_batchedUpdates=V4;Ai.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nb(n))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return Db(e,t,n,!1,r)};Ai.version="18.2.0-next-9e3b772b8-20220608";function P$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P$)}catch(e){console.error(e)}}P$(),TO.exports=Ai;var mi=TO.exports;const vLe=Bl(mi);var lk=mi;aC.createRoot=lk.createRoot,aC.hydrateRoot=lk.hydrateRoot;const BK="modulepreload",zK=function(e,t){return new URL(e,t).href},uk={},k$=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=zK(o,r),o in uk)return;uk[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const d=i[c];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":BK,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})};function Un(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 Dr(e){return!!e&&!!e[Fe]}function ti(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)===KK}(e)||Array.isArray(e)||!!e[Td]||!!(!((t=e.constructor)===null||t===void 0)&&t[Td])||Lb(e)||Fb(e))}function X4(e){return Dr(e)||Un(23,e),e[Fe].t}function hs(e,t,n){n===void 0&&(n=!1),El(e)===0?(n?Object.keys:Ad)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function El(e){var t=e[Fe];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Lb(e)?2:Fb(e)?3:0}function ml(e,t){return El(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function By(e,t){return El(e)===2?e.get(t):e[t]}function I$(e,t,n){var r=El(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function M$(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Lb(e){return qK&&e instanceof Map}function Fb(e){return WK&&e instanceof Set}function Ln(e){return e.o||e.t}function Q4(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=O$(e);delete t[Fe];for(var n=Ad(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 lm(e,t){return t===void 0&&(t=!1),Y4(e)||Dr(e)||!ti(e)||(El(e)>1&&(e.set=e.add=e.clear=e.delete=VK),Object.freeze(e),t&&hs(e,function(n,r){return lm(r,!0)},!0)),e}function VK(){Un(2)}function Y4(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ha(e){var t=e5[e];return t||Un(18,e),t}function Z4(e,t){e5[e]||(e5[e]=t)}function Hp(){return Wp}function Cx(e,t){t&&(ha("Patches"),e.u=[],e.s=[],e.v=t)}function Gv(e){JC(e),e.p.forEach(jK),e.p=null}function JC(e){e===Wp&&(Wp=e.l)}function ck(e){return Wp={p:[],l:Wp,h:e,m:!0,_:0}}function jK(e){var t=e[Fe];t.i===0||t.i===1?t.j():t.g=!0}function Ex(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||ha("ES5").S(t,e,r),r?(n[Fe].P&&(Gv(t),Un(4)),ti(e)&&(e=Hv(t,e),t.l||qv(t,e)),t.u&&ha("Patches").M(n[Fe].t,e,t.u,t.s)):e=Hv(t,n,[]),Gv(t),t.u&&t.v(t.u,t.s),e!==zb?e:void 0}function Hv(e,t,n){if(Y4(t))return t;var r=t[Fe];if(!r)return hs(t,function(s,l){return dk(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return qv(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=Q4(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),hs(o,function(s,l){return dk(e,r,i,s,l,n,a)}),qv(e,i,!1),n&&e.u&&ha("Patches").N(r,n,e.u,e.s)}return r.o}function dk(e,t,n,r,i,o,a){if(Dr(i)){var s=Hv(e,i,o&&t&&t.i!==3&&!ml(t.R,r)?o.concat(r):void 0);if(I$(n,r,s),!Dr(s))return;e.m=!1}else a&&n.add(i);if(ti(i)&&!Y4(i)){if(!e.h.D&&e._<1)return;Hv(e,i),t&&t.A.l||qv(e,i)}}function qv(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&lm(t,n)}function Tx(e,t){var n=e[Fe];return(n?Ln(n):e)[t]}function fk(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 Wr(e){e.P||(e.P=!0,e.l&&Wr(e.l))}function Ax(e){e.o||(e.o=Q4(e.t))}function qp(e,t,n){var r=Lb(t)?ha("MapSet").F(t,n):Fb(t)?ha("MapSet").T(t,n):e.O?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Hp(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Kp;a&&(l=[s],u=Bh);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return s.k=f,s.j=d,f}(t,n):ha("ES5").J(t,n);return(n?n.A:Hp()).p.push(r),r}function Bb(e){return Dr(e)||Un(22,e),function t(n){if(!ti(n))return n;var r,i=n[Fe],o=El(n);if(i){if(!i.P&&(i.i<4||!ha("ES5").K(i)))return i.t;i.I=!0,r=hk(n,o),i.I=!1}else r=hk(n,o);return hs(r,function(a,s){i&&By(i.t,a)===s||I$(r,a,t(s))}),o===3?new Set(r):r}(e)}function hk(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Q4(e)}function J4(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[Fe];return Kp.get(l,o)},set:function(l){var u=this[Fe];Kp.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][Fe];if(!s.P)switch(s.i){case 5:r(s)&&Wr(s);break;case 4:n(s)&&Wr(s)}}}function n(o){for(var a=o.t,s=o.k,l=Ad(s),u=l.length-1;u>=0;u--){var c=l[u];if(c!==Fe){var d=a[c];if(d===void 0&&!ml(a,c))return!0;var f=s[c],h=f&&f[Fe];if(h?h.t!==d:!M$(f,d))return!0}}var p=!!a[Fe];return l.length!==Ad(a).length+(p?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l<a.length;l++)if(!a.hasOwnProperty(l))return!0;return!1}var i={};Z4("ES5",{J:function(o,a){var s=Array.isArray(o),l=function(c,d){if(c){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var p=O$(d);delete p[Fe];for(var g=Ad(p),_=0;_<g.length;_++){var b=g[_];p[b]=e(b,c||!!p[b].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(s,o),u={i:s?5:4,A:a?a.A:Hp(),P:!1,I:!1,R:{},l:a,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,Fe,{value:u,writable:!0}),l},S:function(o,a,s){s?Dr(a)&&a[Fe].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[Fe];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)hs(f,function(m){m!==Fe&&(d[m]!==void 0||ml(d,m)?h[m]||l(f[m]):(h[m]=!0,Wr(c)))}),hs(d,function(m){f[m]!==void 0||ml(f,m)||(h[m]=!1,Wr(c))});else if(p===5){if(r(c)&&(Wr(c),h.length=!0),f.length<d.length)for(var g=f.length;g<d.length;g++)h[g]=!1;else for(var _=d.length;_<f.length;_++)h[_]=!0;for(var b=Math.min(f.length,d.length),y=0;y<b;y++)f.hasOwnProperty(y)||(h[y]=!0),h[y]===void 0&&l(f[y])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function eE(){function e(r){if(!ti(r))return r;if(Array.isArray(r))return r.map(e);if(Lb(r))return new Map(Array.from(r.entries()).map(function(a){return[a[0],e(a[1])]}));if(Fb(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 ml(r,Td)&&(i[Td]=r[Td]),i}function t(r){return Dr(r)?e(r):r}var n="add";Z4("Patches",{$:function(r,i){return i.forEach(function(o){for(var a=o.path,s=o.op,l=r,u=0;u<a.length-1;u++){var c=El(l),d=a[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||Un(24),typeof l=="function"&&d==="prototype"&&Un(24),typeof(l=By(l,d))!="object"&&Un(15,a.join("/"))}var f=El(l),h=e(o.value),p=a[a.length-1];switch(s){case"replace":switch(f){case 2:return l.set(p,h);case 3:Un(16);default:return l[p]=h}case n:switch(f){case 1:return p==="-"?l.push(h):l.splice(p,0,h);case 2:return l.set(p,h);case 3:return l.add(h);default:return l[p]=h}case"remove":switch(f){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:Un(17,s)}}),r},N:function(r,i,o,a){switch(r.i){case 0:case 4:case 2:return function(s,l,u,c){var d=s.t,f=s.o;hs(s.R,function(h,p){var g=By(d,h),_=By(f,h),b=p?ml(d,h)?"replace":n:"remove";if(g!==_||b!=="replace"){var y=l.concat(h);u.push(b==="remove"?{op:b,path:y}:{op:b,path:y,value:_}),c.push(b===n?{op:"remove",path:y}:b==="remove"?{op:n,path:y,value:t(g)}:{op:"replace",path:y,value:t(g)})}})}(r,i,o,a);case 5:case 1:return function(s,l,u,c){var d=s.t,f=s.R,h=s.o;if(h.length<d.length){var p=[h,d];d=p[0],h=p[1];var g=[c,u];u=g[0],c=g[1]}for(var _=0;_<d.length;_++)if(f[_]&&h[_]!==d[_]){var b=l.concat([_]);u.push({op:"replace",path:b,value:t(h[_])}),c.push({op:"replace",path:b,value:t(d[_])})}for(var y=d.length;y<h.length;y++){var m=l.concat([y]);u.push({op:n,path:m,value:t(h[y])})}d.length<h.length&&c.push({op:"replace",path:l.concat(["length"]),value:d.length})}(r,i,o,a);case 3:return function(s,l,u,c){var d=s.t,f=s.o,h=0;d.forEach(function(p){if(!f.has(p)){var g=l.concat([h]);u.push({op:"remove",path:g,value:p}),c.unshift({op:n,path:g,value:p})}h++}),h=0,f.forEach(function(p){if(!d.has(p)){var g=l.concat([h]);u.push({op:n,path:g,value:p}),c.unshift({op:"remove",path:g,value:p})}h++})}(r,i,o,a)}},M:function(r,i,o,a){o.push({op:"replace",path:[],value:i===zb?void 0:i}),a.push({op:"replace",path:[],value:r})}})}function R$(){function e(s,l){function u(){this.constructor=s}i(s,l),s.prototype=(u.prototype=l.prototype,new u)}function t(s){s.o||(s.R=new Map,s.o=new Map(s.t))}function n(s){s.o||(s.o=new Set,s.t.forEach(function(l){if(ti(l)){var u=qp(s.A.h,l,s);s.p.set(l,u),s.o.add(u)}else s.o.add(l)}))}function r(s){s.g&&Un(3,JSON.stringify(Ln(s)))}var i=function(s,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)c.hasOwnProperty(d)&&(u[d]=c[d])})(s,l)},o=function(){function s(u,c){return this[Fe]={i:2,l:c,A:c?c.A:Hp(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(s,Map);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return Ln(this[Fe]).size}}),l.has=function(u){return Ln(this[Fe]).has(u)},l.set=function(u,c){var d=this[Fe];return r(d),Ln(d).has(u)&&Ln(d).get(u)===c||(t(d),Wr(d),d.R.set(u,!0),d.o.set(u,c),d.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[Fe];return r(c),t(c),Wr(c),c.t.has(u)?c.R.set(u,!1):c.R.delete(u),c.o.delete(u),!0},l.clear=function(){var u=this[Fe];r(u),Ln(u).size&&(t(u),Wr(u),u.R=new Map,hs(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;Ln(this[Fe]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[Fe];r(c);var d=Ln(c).get(u);if(c.I||!ti(d)||d!==c.t.get(u))return d;var f=qp(c.A.h,d,c);return t(c),c.o.set(u,f),f},l.keys=function(){return Ln(this[Fe]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[v0]=function(){return c.values()},u.next=function(){var f=d.next();return f.done?f:{done:!1,value:c.get(f.value)}},u},l.entries=function(){var u,c=this,d=this.keys();return(u={})[v0]=function(){return c.entries()},u.next=function(){var f=d.next();if(f.done)return f;var h=c.get(f.value);return{done:!1,value:[f.value,h]}},u},l[v0]=function(){return this.entries()},s}(),a=function(){function s(u,c){return this[Fe]={i:3,l:c,A:c?c.A:Hp(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(s,Set);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return Ln(this[Fe]).size}}),l.has=function(u){var c=this[Fe];return r(c),c.o?!!c.o.has(u)||!(!c.p.has(u)||!c.o.has(c.p.get(u))):c.t.has(u)},l.add=function(u){var c=this[Fe];return r(c),this.has(u)||(n(c),Wr(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[Fe];return r(c),n(c),Wr(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[Fe];r(u),Ln(u).size&&(n(u),Wr(u),u.o.clear())},l.values=function(){var u=this[Fe];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[Fe];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[v0]=function(){return this.values()},l.forEach=function(u,c){for(var d=this.values(),f=d.next();!f.done;)u.call(c,f.value,f.value,this),f=d.next()},s}();Z4("MapSet",{F:function(s,l){return new o(s,l)},T:function(s,l){return new a(s,l)}})}function UK(){J4(),R$(),eE()}function GK(e){return e}function HK(e){return e}var pk,Wp,tE=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",qK=typeof Map<"u",WK=typeof Set<"u",gk=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",zb=tE?Symbol.for("immer-nothing"):((pk={})["immer-nothing"]=!0,pk),Td=tE?Symbol.for("immer-draftable"):"__$immer_draftable",Fe=tE?Symbol.for("immer-state"):"__$immer_state",v0=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",KK=""+Object.prototype.constructor,Ad=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,O$=Object.getOwnPropertyDescriptors||function(e){var t={};return Ad(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},e5={},Kp={get:function(e,t){if(t===Fe)return e;var n=Ln(e);if(!ml(n,t))return function(i,o,a){var s,l=fk(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!ti(r)?r:r===Tx(e.t,t)?(Ax(e),e.o[t]=qp(e.A.h,r,e)):r},has:function(e,t){return t in Ln(e)},ownKeys:function(e){return Reflect.ownKeys(Ln(e))},set:function(e,t,n){var r=fk(Ln(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=Tx(Ln(e),t),o=i==null?void 0:i[Fe];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(M$(n,i)&&(n!==void 0||ml(e.t,t)))return!0;Ax(e),Wr(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 Tx(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Ax(e),Wr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ln(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Un(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Un(12)}},Bh={};hs(Kp,function(e,t){Bh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Bh.deleteProperty=function(e,t){return Bh.set.call(this,e,t,void 0)},Bh.set=function(e,t,n){return Kp.set.call(this,e[0],t,n,e[0])};var $$=function(){function e(n){var r=this;this.O=gk,this.D=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=r;return function(g){var _=this;g===void 0&&(g=s);for(var b=arguments.length,y=Array(b>1?b-1:0),m=1;m<b;m++)y[m-1]=arguments[m];return l.produce(g,function(v){var S;return(S=o).call.apply(S,[_,v].concat(y))})}}var u;if(typeof o!="function"&&Un(6),a!==void 0&&typeof a!="function"&&Un(7),ti(i)){var c=ck(r),d=qp(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?Gv(c):JC(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(g){return Cx(c,a),Ex(g,c)},function(g){throw Gv(c),g}):(Cx(c,a),Ex(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===zb&&(u=void 0),r.D&&lm(u,!0),a){var h=[],p=[];ha("Patches").M(i,u,h,p),a(h,p)}return u}Un(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return r.produceWithPatches(u,function(h){return i.apply(void 0,[h].concat(d))})};var a,s,l=r.produce(i,o,function(u,c){a=u,s=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,a,s]}):[l,a,s]},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){ti(n)||Un(8),Dr(n)&&(n=Bb(n));var r=ck(this),i=qp(this,n,void 0);return i[Fe].C=!0,JC(r),i},t.finishDraft=function(n,r){var i=n&&n[Fe],o=i.A;return Cx(o,r),Ex(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!gk&&Un(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 a=ha("Patches").$;return Dr(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ci=new $$,N$=Ci.produce,nE=Ci.produceWithPatches.bind(Ci),XK=Ci.setAutoFreeze.bind(Ci),QK=Ci.setUseProxies.bind(Ci),t5=Ci.applyPatches.bind(Ci),YK=Ci.createDraft.bind(Ci),ZK=Ci.finishDraft.bind(Ci);const Ul=N$,bLe=Object.freeze(Object.defineProperty({__proto__:null,Immer:$$,applyPatches:t5,castDraft:GK,castImmutable:HK,createDraft:YK,current:Bb,default:Ul,enableAllPlugins:UK,enableES5:J4,enableMapSet:R$,enablePatches:eE,finishDraft:ZK,freeze:lm,immerable:Td,isDraft:Dr,isDraftable:ti,nothing:zb,original:X4,produce:N$,produceWithPatches:nE,setAutoFreeze:XK,setUseProxies:QK},Symbol.toStringTag,{value:"Module"}));function Xp(e){"@babel/helpers - typeof";return Xp=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},Xp(e)}function JK(e,t){if(Xp(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eX(e){var t=JK(e,"string");return Xp(t)==="symbol"?t:String(t)}function tX(e,t,n){return t=eX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mk(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 yk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mk(Object(n),!0).forEach(function(r){tX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nr(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 vk=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Px=function(){return Math.random().toString(36).substring(7).split("").join(".")},sf={INIT:"@@redux/INIT"+Px(),REPLACE:"@@redux/REPLACE"+Px(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Px()}};function nX(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 um(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(nr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(nr(1));return n(um)(e,t)}if(typeof e!="function")throw new Error(nr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(nr(3));return o}function d(g){if(typeof g!="function")throw new Error(nr(4));if(l)throw new Error(nr(5));var _=!0;return u(),s.push(g),function(){if(_){if(l)throw new Error(nr(6));_=!1,u();var y=s.indexOf(g);s.splice(y,1),a=null}}}function f(g){if(!nX(g))throw new Error(nr(7));if(typeof g.type>"u")throw new Error(nr(8));if(l)throw new Error(nr(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var _=a=s,b=0;b<_.length;b++){var y=_[b];y()}return g}function h(g){if(typeof g!="function")throw new Error(nr(10));i=g,f({type:sf.REPLACE})}function p(){var g,_=d;return g={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(nr(11));function m(){y.next&&y.next(c())}m();var v=_(m);return{unsubscribe:v}}},g[vk]=function(){return this},g}return f({type:sf.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[vk]=p,r}var D$=um;function rX(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:sf.INIT});if(typeof r>"u")throw new Error(nr(12));if(typeof n(void 0,{type:sf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(nr(13))})}function Mf(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),a;try{rX(n)}catch(s){a=s}return function(l,u){if(l===void 0&&(l={}),a)throw a;for(var c=!1,d={},f=0;f<o.length;f++){var h=o[f],p=n[h],g=l[h],_=p(g,u);if(typeof _>"u")throw u&&u.type,new Error(nr(14));d[h]=_,c=c||_!==g}return c=c||o.length!==Object.keys(l).length,c?d:l}}function bk(e,t){return function(){return t(e.apply(this,arguments))}}function L$(e,t){if(typeof e=="function")return bk(e,t);if(typeof e!="object"||e===null)throw new Error(nr(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=bk(i,t))}return n}function lf(){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 rE(){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(nr(15))},a={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},s=t.map(function(l){return l(a)});return o=lf.apply(void 0,s)(i.dispatch),yk(yk({},i),{},{dispatch:o})}}}const iX=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:sf,applyMiddleware:rE,bindActionCreators:L$,combineReducers:Mf,compose:lf,createStore:um,legacy_createStore:D$},Symbol.toStringTag,{value:"Module"}));var Wv="NOT_FOUND";function oX(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Wv},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function aX(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Wv}function i(s,l){r(s)===Wv&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var F$=function(t,n){return t===n};function sX(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 Kv(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?F$:r,o=n.maxSize,a=o===void 0?1:o,s=n.resultEqualityCheck,l=sX(i),u=a===1?oX(l):aX(a,l);function c(){var d=u.get(arguments);if(d===Wv){if(d=e.apply(null,arguments),s){var f=u.getEntries(),h=f.find(function(p){return s(p.value,d)});h&&(d=h.value)}u.put(arguments,d)}return d}return c.clearCache=function(){return u.clear()},c}function lX(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 B$(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 a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=0,c,d={memoizeOptions:void 0},f=s.pop();if(typeof f=="object"&&(d=f,f=s.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,p=h.memoizeOptions,g=p===void 0?n:p,_=Array.isArray(g)?g:[g],b=lX(s),y=e.apply(void 0,[function(){return u++,f.apply(null,arguments)}].concat(_)),m=e(function(){for(var S=[],w=b.length,C=0;C<w;C++)S.push(b[C].apply(null,arguments));return c=y.apply(null,S),c});return Object.assign(m,{resultFunc:f,memoizedResultFunc:y,dependencies:b,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),m};return i}var qn=B$(Kv),uX=function(t,n){if(n===void 0&&(n=qn),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,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return a.reduce(function(l,u,c){return l[r[c]]=u,l},{})});return i};const _Le=Object.freeze(Object.defineProperty({__proto__:null,createSelector:qn,createSelectorCreator:B$,createStructuredSelector:uX,defaultEqualityCheck:F$,defaultMemoize:Kv},Symbol.toStringTag,{value:"Module"}));function z$(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,e):a(s)}}};return t}var V$=z$();V$.withExtraArgument=z$;const _k=V$;var j$=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)}}(),cm=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,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}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(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Tl=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},cX=Object.defineProperty,dX=Object.defineProperties,fX=Object.getOwnPropertyDescriptors,Sk=Object.getOwnPropertySymbols,hX=Object.prototype.hasOwnProperty,pX=Object.prototype.propertyIsEnumerable,xk=function(e,t,n){return t in e?cX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Qr=function(e,t){for(var n in t||(t={}))hX.call(t,n)&&xk(e,n,t[n]);if(Sk)for(var r=0,i=Sk(t);r<i.length;r++){var n=i[r];pX.call(t,n)&&xk(e,n,t[n])}return e},kx=function(e,t){return dX(e,fX(t))},dm=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},Fa=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=qn.apply(void 0,e),r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return n.apply(void 0,Tl([Dr(i)?Bb(i):i],o))};return r},gX=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?lf:lf.apply(null,arguments)};function $o(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 U$=function(e){return e&&typeof e.match=="function"};function ge(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 Qr(Qr({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 iE(e){return $o(e)&&"type"in e}function mX(e){return typeof e=="function"&&"type"in e&&U$(e)}function G$(e){return iE(e)&&typeof e.type=="string"&&Object.keys(e).every(yX)}function yX(e){return["type","payload","error","meta"].indexOf(e)>-1}function vX(e){return""+e}function bX(e){return function(){return function(t){return function(n){return t(n)}}}}var H$=function(e){j$(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,Tl([void 0],n[0].concat(this)))):new(t.bind.apply(t,Tl([void 0],n.concat(this))))},t}(Array),q$=function(e){j$(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,Tl([void 0],n[0].concat(this)))):new(t.bind.apply(t,Tl([void 0],n.concat(this))))},t}(Array);function n5(e){return ti(e)?Ul(e,function(){}):e}function _X(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function SX(e){return function(){return function(t){return function(n){return t(n)}}}}function W$(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||$o(e)}function K$(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=W$),i===void 0&&(i=[]);var a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var s=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(_,b){var y=t?t+"."+_:_;if(l){var m=i.some(function(v){return v instanceof RegExp?v.test(y):y===v});if(m)return"continue"}if(!n(b))return{value:{keyPath:y,value:b}};if(typeof b=="object"&&(a=K$(b,y,n,r,i,o),a))return{value:a}},c=0,d=s;c<d.length;c++){var f=d[c],h=f[0],p=f[1],g=u(h,p);if(typeof g=="object")return g.value}return o&&X$(e)&&o.add(e),!1}function X$(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)&&!X$(r))return!1}return!0}function xX(e){return function(){return function(t){return function(n){return t(n)}}}}function wX(e){return typeof e=="boolean"}function CX(){return function(t){return Q$(t)}}function Q$(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck,e.actionCreatorCheck;var r=new H$;return n&&(wX(n)?r.push(_k):r.push(_k.withExtraArgument(n.extraArgument))),r}var EX=!0;function Y$(e){var t=CX(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,a=o===void 0?t():o,s=n.devTools,l=s===void 0?!0:s,u=n.preloadedState,c=u===void 0?void 0:u,d=n.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if($o(i))h=Mf(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 p=a;typeof p=="function"&&(p=p(t));var g=rE.apply(void 0,p),_=lf;l&&(_=gX(Qr({trace:!EX},typeof l=="object"&&l)));var b=new q$(g),y=b;Array.isArray(f)?y=Tl([g],f):typeof f=="function"&&(y=f(b));var m=_.apply(void 0,y);return um(h,c,m)}function Z$(e){var t={},n=[],r,i={addCase:function(o,a){var s=typeof o=="string"?o:o.type;if(!s)throw new Error("`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[s]=a,i},addMatcher:function(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function TX(e){return typeof e=="function"}function J$(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?Z$(t):[t,n,r],o=i[0],a=i[1],s=i[2],l;if(TX(e))l=function(){return n5(e())};else{var u=n5(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=Tl([o[f.type]],a.filter(function(p){var g=p.matcher;return g(f)}).map(function(p){var g=p.reducer;return g}));return h.filter(function(p){return!!p}).length===0&&(h=[s]),h.reduce(function(p,g){if(g)if(Dr(p)){var _=p,b=g(_,f);return b===void 0?p:b}else{if(ti(p))return Ul(p,function(y){return g(y,f)});var b=g(p,f);if(b===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}return p},d)}return c.getInitialState=l,c}function AX(e,t){return e+"/"+t}function Wt(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:n5(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},a={},s={};i.forEach(function(c){var d=r[c],f=AX(t,c),h,p;"reducer"in d?(h=d.reducer,p=d.prepare):h=d,o[c]=h,a[f]=h,s[c]=p?ge(f,p):ge(f)});function l(){var c=typeof e.extraReducers=="function"?Z$(e.extraReducers):[e.extraReducers],d=c[0],f=d===void 0?{}:d,h=c[1],p=h===void 0?[]:h,g=c[2],_=g===void 0?void 0:g,b=Qr(Qr({},f),a);return J$(n,function(y){for(var m in b)y.addCase(m,b[m]);for(var v=0,S=p;v<S.length;v++){var w=S[v];y.addMatcher(w.matcher,w.reducer)}_&&y.addDefaultCase(_)})}var u;return{name:t,reducer:function(c,d){return u||(u=l()),u(c,d)},actions:s,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function PX(){return{ids:[],entities:{}}}function kX(){function e(t){return t===void 0&&(t={}),Object.assign(PX(),t)}return{getInitialState:e}}function IX(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=Fa(n,r,function(u,c){return u.map(function(d){return c[d]})}),o=function(u,c){return c},a=function(u,c){return u[c]},s=Fa(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:s,selectById:Fa(r,o,a)};var l=Fa(t,r);return{selectIds:Fa(t,n),selectEntities:l,selectAll:Fa(t,i),selectTotal:Fa(t,s),selectById:Fa(l,o,a)}}return{getSelectors:e}}function MX(e){var t=gn(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function gn(e){return function(n,r){function i(a){return G$(a)}var o=function(a){i(r)?e(r.payload,a):e(r,a)};return Dr(n)?(o(n),n):Ul(n,o)}}function cp(e,t){var n=t(e);return n}function Bu(e){return Array.isArray(e)||(e=Object.values(e)),e}function eN(e,t,n){e=Bu(e);for(var r=[],i=[],o=0,a=e;o<a.length;o++){var s=a[o],l=cp(s,t);l in n.entities?i.push({id:l,changes:s}):r.push(s)}return[r,i]}function tN(e){function t(p,g){var _=cp(p,e);_ in g.entities||(g.ids.push(_),g.entities[_]=p)}function n(p,g){p=Bu(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];t(y,g)}}function r(p,g){var _=cp(p,e);_ in g.entities||g.ids.push(_),g.entities[_]=p}function i(p,g){p=Bu(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];r(y,g)}}function o(p,g){p=Bu(p),g.ids=[],g.entities={},n(p,g)}function a(p,g){return s([p],g)}function s(p,g){var _=!1;p.forEach(function(b){b in g.entities&&(delete g.entities[b],_=!0)}),_&&(g.ids=g.ids.filter(function(b){return b in g.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function u(p,g,_){var b=_.entities[g.id],y=Object.assign({},b,g.changes),m=cp(y,e),v=m!==g.id;return v&&(p[g.id]=m,delete _.entities[g.id]),_.entities[m]=y,v}function c(p,g){return d([p],g)}function d(p,g){var _={},b={};p.forEach(function(v){v.id in g.entities&&(b[v.id]={id:v.id,changes:Qr(Qr({},b[v.id]?b[v.id].changes:null),v.changes)})}),p=Object.values(b);var y=p.length>0;if(y){var m=p.filter(function(v){return u(_,v,g)}).length>0;m&&(g.ids=Object.keys(g.entities))}}function f(p,g){return h([p],g)}function h(p,g){var _=eN(p,e,g),b=_[0],y=_[1];d(y,g),n(b,g)}return{removeAll:MX(l),addOne:gn(t),addMany:gn(n),setOne:gn(r),setMany:gn(i),setAll:gn(o),updateOne:gn(c),updateMany:gn(d),upsertOne:gn(f),upsertMany:gn(h),removeOne:gn(a),removeMany:gn(s)}}function RX(e,t){var n=tN(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function a(y,m){return s([y],m)}function s(y,m){y=Bu(y);var v=y.filter(function(S){return!(cp(S,e)in m.entities)});v.length!==0&&_(v,m)}function l(y,m){return u([y],m)}function u(y,m){y=Bu(y),y.length!==0&&_(y,m)}function c(y,m){y=Bu(y),m.entities={},m.ids=[],s(y,m)}function d(y,m){return f([y],m)}function f(y,m){for(var v=!1,S=0,w=y;S<w.length;S++){var C=w[S],x=m.entities[C.id];if(x){v=!0,Object.assign(x,C.changes);var P=e(x);C.id!==P&&(delete m.entities[C.id],m.entities[P]=x)}}v&&b(m)}function h(y,m){return p([y],m)}function p(y,m){var v=eN(y,e,m),S=v[0],w=v[1];f(w,m),s(S,m)}function g(y,m){if(y.length!==m.length)return!1;for(var v=0;v<y.length&&v<m.length;v++)if(y[v]!==m[v])return!1;return!0}function _(y,m){y.forEach(function(v){m.entities[e(v)]=v}),b(m)}function b(y){var m=Object.values(y.entities);m.sort(t);var v=m.map(e),S=y.ids;g(S,v)||(y.ids=v)}return{removeOne:r,removeMany:i,removeAll:o,addOne:gn(a),updateOne:gn(d),upsertOne:gn(h),setOne:gn(l),setMany:gn(u),setAll:gn(c),addMany:gn(s),updateMany:gn(f),upsertMany:gn(p)}}function Ji(e){e===void 0&&(e={});var t=Qr({sortComparer:!1,selectId:function(s){return s.id}},e),n=t.selectId,r=t.sortComparer,i=kX(),o=IX(),a=r?RX(n,r):tN(n);return Qr(Qr(Qr({selectId:n,sortComparer:r},i),o),a)}var OX="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Vb=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=OX[Math.random()*64|0];return t},$X=["name","message","stack","code"],Ix=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),wk=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),nN=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=$X;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},Xv=function(){function e(t,n,r){var i=ge(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:kx(Qr({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=ge(t+"/pending",function(u,c,d){return{payload:void 0,meta:kx(Qr({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),a=ge(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||nN)(u||"Rejected"),meta:kx(Qr({},h||{}),{arg:d,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),s=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(c,d,f){var h=r!=null&&r.idGenerator?r.idGenerator(u):Vb(),p=new s,g;function _(y){g=y,p.abort()}var b=function(){return dm(this,null,function(){var y,m,v,S,w,C,x;return cm(this,function(P){switch(P.label){case 0:return P.trys.push([0,4,,5]),S=(y=r==null?void 0:r.condition)==null?void 0:y.call(r,u,{getState:d,extra:f}),NX(S)?[4,S]:[3,2];case 1:S=P.sent(),P.label=2;case 2:if(S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=new Promise(function(E,I){return p.signal.addEventListener("abort",function(){return I({name:"AbortError",message:g||"Aborted"})})}),c(o(h,u,(m=r==null?void 0:r.getPendingMeta)==null?void 0:m.call(r,{requestId:h,arg:u},{getState:d,extra:f}))),[4,Promise.race([w,Promise.resolve(n(u,{dispatch:c,getState:d,extra:f,requestId:h,signal:p.signal,abort:_,rejectWithValue:function(E,I){return new Ix(E,I)},fulfillWithValue:function(E,I){return new wk(E,I)}})).then(function(E){if(E instanceof Ix)throw E;return E instanceof wk?i(E.payload,h,u,E.meta):i(E,h,u)})])];case 3:return v=P.sent(),[3,5];case 4:return C=P.sent(),v=C instanceof Ix?a(null,h,u,C.payload,C.meta):a(C,h,u),[3,5];case 5:return x=r&&!r.dispatchConditionRejection&&a.match(v)&&v.meta.condition,x||c(v),[2,v]}})})}();return Object.assign(b,{abort:_,requestId:h,arg:u,unwrap:function(){return b.then(rN)}})}}return Object.assign(l,{pending:o,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function rN(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function NX(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var iN=function(e,t){return U$(e)?e.match(t):e(t)};function si(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return iN(r,n)})}}function Pd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return iN(r,n)})}}function jb(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 fm(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ub(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return jb(n,["pending"])}:fm(e)?function(n){var r=e.map(function(o){return o.pending}),i=si.apply(void 0,r);return i(n)}:Ub()(e[0])}function uf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return jb(n,["rejected"])}:fm(e)?function(n){var r=e.map(function(o){return o.rejected}),i=si.apply(void 0,r);return i(n)}:uf()(e[0])}function hm(){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=Pd(uf.apply(void 0,e),n);return i(r)}:fm(e)?function(r){var i=Pd(uf.apply(void 0,e),n);return i(r)}:hm()(e[0])}function Gl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return jb(n,["fulfilled"])}:fm(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=si.apply(void 0,r);return i(n)}:Gl()(e[0])}function Qv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return jb(n,["pending","fulfilled","rejected"])}:fm(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var a=o[i];r.push(a.pending,a.rejected,a.fulfilled)}var s=si.apply(void 0,r);return s(n)}:Qv()(e[0])}var oE=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},r5=function(){},oN=function(e,t){return t===void 0&&(t=r5),e.catch(t),e},aN=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},kd=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))},DX="task",sN="listener",lN="completed",aE="cancelled",LX="task-"+aE,FX="task-"+lN,uN=sN+"-"+aE,BX=sN+"-"+lN,pm=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=DX+" "+aE+" (reason: "+t+")"}return e}(),Id=function(e){if(e.aborted)throw new pm(e.reason)};function cN(e,t){var n=r5;return new Promise(function(r,i){var o=function(){return i(new pm(e.reason))};if(e.aborted){o();return}n=aN(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=r5})}var zX=function(e,t){return dm(void 0,null,function(){var n,r;return cm(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 pm?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},Yv=function(e){return function(t){return oN(cN(e,t).then(function(n){return Id(e),n}))}},dN=function(e){var t=Yv(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},VX=Object.assign,Ck={},gm="listenerMiddleware",jX=function(e,t){var n=function(r){return aN(e,function(){return kd(r,e.reason)})};return function(r,i){oE(r,"taskExecutor");var o=new AbortController;n(o);var a=zX(function(){return dm(void 0,null,function(){var s;return cm(this,function(l){switch(l.label){case 0:return Id(e),Id(o.signal),[4,r({pause:Yv(o.signal),delay:dN(o.signal),signal:o.signal})];case 1:return s=l.sent(),Id(o.signal),[2,s]}})})},function(){return kd(o,FX)});return i!=null&&i.autoJoin&&t.push(a),{result:Yv(e)(a),cancel:function(){kd(o,LX)}}}},UX=function(e,t){var n=function(r,i){return dm(void 0,null,function(){var o,a,s,l;return cm(this,function(u){switch(u.label){case 0:Id(t),o=function(){},a=new Promise(function(c,d){var f=e({predicate:r,effect:function(h,p){p.unsubscribe(),c([h,p.getState(),p.getOriginalState()])}});o=function(){f(),d()}}),s=[a],i!=null&&s.push(new Promise(function(c){return setTimeout(c,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,cN(t,Promise.race(s))];case 2:return l=u.sent(),Id(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return oN(n(r,i))}},fN=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=ge(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 oE(o,"options.listener"),{predicate:i,type:t,effect:o}},GX=function(e){var t=fN(e),n=t.type,r=t.predicate,i=t.effect,o=Vb(),a={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return a},i5=function(e){e.pending.forEach(function(t){kd(t,uN)})},HX=function(e){return function(){e.forEach(i5),e.clear()}},Ek=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},hN=ge(gm+"/add"),pN=ge(gm+"/removeAll"),gN=ge(gm+"/remove"),qX=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,Tl([gm+"/error"],e))};function mN(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?qX:i;oE(o,"onError");var a=function(h){return h.unsubscribe=function(){return n.delete(h.id)},n.set(h.id,h),function(p){h.unsubscribe(),p!=null&&p.cancelActive&&i5(h)}},s=function(h){for(var p=0,g=Array.from(n.values());p<g.length;p++){var _=g[p];if(h(_))return _}},l=function(h){var p=s(function(g){return g.effect===h.effect});return p||(p=GX(h)),a(p)},u=function(h){var p=fN(h),g=p.type,_=p.effect,b=p.predicate,y=s(function(m){var v=typeof g=="string"?m.type===g:m.predicate===b;return v&&m.effect===_});return y&&(y.unsubscribe(),h.cancelActive&&i5(y)),!!y},c=function(h,p,g,_){return dm(t,null,function(){var b,y,m,v;return cm(this,function(S){switch(S.label){case 0:b=new AbortController,y=UX(l,b.signal),m=[],S.label=1;case 1:return S.trys.push([1,3,4,6]),h.pending.add(b),[4,Promise.resolve(h.effect(p,VX({},g,{getOriginalState:_,condition:function(w,C){return y(w,C).then(Boolean)},take:y,delay:dN(b.signal),pause:Yv(b.signal),extra:r,signal:b.signal,fork:jX(b.signal,m),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(w,C,x){w!==b&&(kd(w,uN),x.delete(w))})}})))];case 2:return S.sent(),[3,6];case 3:return v=S.sent(),v instanceof pm||Ek(o,v,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(m)];case 5:return S.sent(),kd(b,BX),h.pending.delete(b),[7];case 6:return[2]}})})},d=HX(n),f=function(h){return function(p){return function(g){if(!iE(g))return p(g);if(hN.match(g))return l(g.payload);if(pN.match(g)){d();return}if(gN.match(g))return u(g.payload);var _=h.getState(),b=function(){if(_===Ck)throw new Error(gm+": getOriginalState can only be called synchronously");return _},y;try{if(y=p(g),n.size>0)for(var m=h.getState(),v=Array.from(n.values()),S=0,w=v;S<w.length;S++){var C=w[S],x=!1;try{x=C.predicate(g,m,_)}catch(P){x=!1,Ek(o,P,{raisedBy:"predicate"})}x&&c(C,g,h,b)}}finally{_=Ck}return y}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var ku="RTK_autoBatch",jc=function(){return function(e){var t;return{payload:e,meta:(t={},t[ku]=!0,t)}}},Tk,WX=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Tk||(Tk=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},yN=function(e){return function(t){setTimeout(t,e)}},KX=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:yN(10),vN=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,a=!1,s=!1,l=new Set,u=e.type==="tick"?WX:e.type==="raf"?KX:e.type==="callback"?e.queueNotification:yN(e.timeout),c=function(){s=!1,a&&(a=!1,l.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return o&&d()},h=i.subscribe(f);return l.add(d),function(){h(),l.delete(d)}},dispatch:function(d){var f;try{return o=!((f=d==null?void 0:d.meta)!=null&&f[ku]),a=!o,a&&(s||(s=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};J4();const SLe=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:q$,MiddlewareArray:H$,SHOULD_AUTOBATCH:ku,TaskAbortError:pm,__DO_NOT_USE__ActionTypes:sf,addListener:hN,applyMiddleware:rE,autoBatchEnhancer:vN,bindActionCreators:L$,clearAllListeners:pN,combineReducers:Mf,compose:lf,configureStore:Y$,createAction:ge,createActionCreatorInvariantMiddleware:bX,createAsyncThunk:Xv,createDraftSafeSelector:Fa,createEntityAdapter:Ji,createImmutableStateInvariantMiddleware:SX,createListenerMiddleware:mN,createNextState:Ul,createReducer:J$,createSelector:qn,createSerializableStateInvariantMiddleware:xX,createSlice:Wt,createStore:um,current:Bb,findNonSerializableValue:K$,freeze:lm,getDefaultMiddleware:Q$,getType:vX,isAction:iE,isActionCreator:mX,isAllOf:Pd,isAnyOf:si,isAsyncThunkAction:Qv,isDraft:Dr,isFluxStandardAction:G$,isFulfilled:Gl,isImmutableDefault:_X,isPending:Ub,isPlain:W$,isPlainObject:$o,isRejected:uf,isRejectedWithValue:hm,legacy_createStore:D$,miniSerializeError:nN,nanoid:Vb,original:X4,prepareAutoBatched:jc,removeListener:gN,unwrapResult:rN},Symbol.toStringTag,{value:"Module"})),b0=(e,t)=>Math.floor(e/t)*t,Rr=(e,t)=>Math.round(e/t)*t;var XX=typeof global=="object"&&global&&global.Object===Object&&global;const bN=XX;var QX=typeof self=="object"&&self&&self.Object===Object&&self,YX=bN||QX||Function("return this")();const Ta=YX;var ZX=Ta.Symbol;const Zi=ZX;var _N=Object.prototype,JX=_N.hasOwnProperty,eQ=_N.toString,uh=Zi?Zi.toStringTag:void 0;function tQ(e){var t=JX.call(e,uh),n=e[uh];try{e[uh]=void 0;var r=!0}catch{}var i=eQ.call(e);return r&&(t?e[uh]=n:delete e[uh]),i}var nQ=Object.prototype,rQ=nQ.toString;function iQ(e){return rQ.call(e)}var oQ="[object Null]",aQ="[object Undefined]",Ak=Zi?Zi.toStringTag:void 0;function Bo(e){return e==null?e===void 0?aQ:oQ:Ak&&Ak in Object(e)?tQ(e):iQ(e)}function ni(e){return e!=null&&typeof e=="object"}var sQ="[object Symbol]";function Gb(e){return typeof e=="symbol"||ni(e)&&Bo(e)==sQ}function SN(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 lQ=Array.isArray;const Tn=lQ;var uQ=1/0,Pk=Zi?Zi.prototype:void 0,kk=Pk?Pk.toString:void 0;function Zv(e){if(typeof e=="string")return e;if(Tn(e))return SN(e,Zv)+"";if(Gb(e))return kk?kk.call(e):"";var t=e+"";return t=="0"&&1/e==-uQ?"-0":t}var cQ=/\s/;function dQ(e){for(var t=e.length;t--&&cQ.test(e.charAt(t)););return t}var fQ=/^\s+/;function hQ(e){return e&&e.slice(0,dQ(e)+1).replace(fQ,"")}function ri(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ik=0/0,pQ=/^[-+]0x[0-9a-f]+$/i,gQ=/^0b[01]+$/i,mQ=/^0o[0-7]+$/i,yQ=parseInt;function zy(e){if(typeof e=="number")return e;if(Gb(e))return Ik;if(ri(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ri(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=hQ(e);var n=gQ.test(e);return n||mQ.test(e)?yQ(e.slice(2),n?2:8):pQ.test(e)?Ik:+e}var Mk=1/0,vQ=17976931348623157e292;function Md(e){if(!e)return e===0?e:0;if(e=zy(e),e===Mk||e===-Mk){var t=e<0?-1:1;return t*vQ}return e===e?e:0}function xN(e){var t=Md(e),n=t%1;return t===t?n?t-n:t:0}function Hb(e){return e}var bQ="[object AsyncFunction]",_Q="[object Function]",SQ="[object GeneratorFunction]",xQ="[object Proxy]";function sE(e){if(!ri(e))return!1;var t=Bo(e);return t==_Q||t==SQ||t==bQ||t==xQ}var wQ=Ta["__core-js_shared__"];const Mx=wQ;var Rk=function(){var e=/[^.]+$/.exec(Mx&&Mx.keys&&Mx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function CQ(e){return!!Rk&&Rk in e}var EQ=Function.prototype,TQ=EQ.toString;function dc(e){if(e!=null){try{return TQ.call(e)}catch{}try{return e+""}catch{}}return""}var AQ=/[\\^$.*+?()[\]{}|]/g,PQ=/^\[object .+?Constructor\]$/,kQ=Function.prototype,IQ=Object.prototype,MQ=kQ.toString,RQ=IQ.hasOwnProperty,OQ=RegExp("^"+MQ.call(RQ).replace(AQ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $Q(e){if(!ri(e)||CQ(e))return!1;var t=sE(e)?OQ:PQ;return t.test(dc(e))}function NQ(e,t){return e==null?void 0:e[t]}function fc(e,t){var n=NQ(e,t);return $Q(n)?n:void 0}var DQ=fc(Ta,"WeakMap");const o5=DQ;var Ok=Object.create,LQ=function(){function e(){}return function(t){if(!ri(t))return{};if(Ok)return Ok(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const FQ=LQ;function wN(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 BQ(){}function CN(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var zQ=800,VQ=16,jQ=Date.now;function UQ(e){var t=0,n=0;return function(){var r=jQ(),i=VQ-(r-n);if(n=r,i>0){if(++t>=zQ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function GQ(e){return function(){return e}}var HQ=function(){try{var e=fc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Jv=HQ;var qQ=Jv?function(e,t){return Jv(e,"toString",{configurable:!0,enumerable:!1,value:GQ(t),writable:!0})}:Hb;const WQ=qQ;var KQ=UQ(WQ);const EN=KQ;function TN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function XQ(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 QQ(e){return e!==e}function YQ(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function ZQ(e,t,n){return t===t?YQ(e,t,n):XQ(e,QQ,n)}function JQ(e,t){var n=e==null?0:e.length;return!!n&&ZQ(e,t,0)>-1}var eY=9007199254740991,tY=/^(?:0|[1-9]\d*)$/;function lE(e,t){var n=typeof e;return t=t??eY,!!t&&(n=="number"||n!="symbol"&&tY.test(e))&&e>-1&&e%1==0&&e<t}function qb(e,t,n){t=="__proto__"&&Jv?Jv(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function mm(e,t){return e===t||e!==e&&t!==t}var nY=Object.prototype,rY=nY.hasOwnProperty;function AN(e,t,n){var r=e[t];(!(rY.call(e,t)&&mm(r,n))||n===void 0&&!(t in e))&&qb(e,t,n)}function Rf(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?qb(n,s,l):AN(n,s,l)}return n}var $k=Math.max;function PN(e,t,n){return t=$k(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=$k(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),wN(e,this,s)}}function kN(e,t){return EN(PN(e,t,Hb),e+"")}var iY=9007199254740991;function uE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=iY}function Of(e){return e!=null&&uE(e.length)&&!sE(e)}function Wb(e,t,n){if(!ri(n))return!1;var r=typeof t;return(r=="number"?Of(n)&&lE(t,n.length):r=="string"&&t in n)?mm(n[t],e):!1}function IN(e){return kN(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&Wb(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var oY=Object.prototype;function cE(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oY;return e===n}function aY(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var sY="[object Arguments]";function Nk(e){return ni(e)&&Bo(e)==sY}var MN=Object.prototype,lY=MN.hasOwnProperty,uY=MN.propertyIsEnumerable,cY=Nk(function(){return arguments}())?Nk:function(e){return ni(e)&&lY.call(e,"callee")&&!uY.call(e,"callee")};const Qp=cY;function dY(){return!1}var RN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dk=RN&&typeof module=="object"&&module&&!module.nodeType&&module,fY=Dk&&Dk.exports===RN,Lk=fY?Ta.Buffer:void 0,hY=Lk?Lk.isBuffer:void 0,pY=hY||dY;const Yp=pY;var gY="[object Arguments]",mY="[object Array]",yY="[object Boolean]",vY="[object Date]",bY="[object Error]",_Y="[object Function]",SY="[object Map]",xY="[object Number]",wY="[object Object]",CY="[object RegExp]",EY="[object Set]",TY="[object String]",AY="[object WeakMap]",PY="[object ArrayBuffer]",kY="[object DataView]",IY="[object Float32Array]",MY="[object Float64Array]",RY="[object Int8Array]",OY="[object Int16Array]",$Y="[object Int32Array]",NY="[object Uint8Array]",DY="[object Uint8ClampedArray]",LY="[object Uint16Array]",FY="[object Uint32Array]",Ft={};Ft[IY]=Ft[MY]=Ft[RY]=Ft[OY]=Ft[$Y]=Ft[NY]=Ft[DY]=Ft[LY]=Ft[FY]=!0;Ft[gY]=Ft[mY]=Ft[PY]=Ft[yY]=Ft[kY]=Ft[vY]=Ft[bY]=Ft[_Y]=Ft[SY]=Ft[xY]=Ft[wY]=Ft[CY]=Ft[EY]=Ft[TY]=Ft[AY]=!1;function BY(e){return ni(e)&&uE(e.length)&&!!Ft[Bo(e)]}function Kb(e){return function(t){return e(t)}}var ON=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dp=ON&&typeof module=="object"&&module&&!module.nodeType&&module,zY=dp&&dp.exports===ON,Rx=zY&&bN.process,VY=function(){try{var e=dp&&dp.require&&dp.require("util").types;return e||Rx&&Rx.binding&&Rx.binding("util")}catch{}}();const Al=VY;var Fk=Al&&Al.isTypedArray,jY=Fk?Kb(Fk):BY;const dE=jY;var UY=Object.prototype,GY=UY.hasOwnProperty;function $N(e,t){var n=Tn(e),r=!n&&Qp(e),i=!n&&!r&&Yp(e),o=!n&&!r&&!i&&dE(e),a=n||r||i||o,s=a?aY(e.length,String):[],l=s.length;for(var u in e)(t||GY.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lE(u,l)))&&s.push(u);return s}function NN(e,t){return function(n){return e(t(n))}}var HY=NN(Object.keys,Object);const qY=HY;var WY=Object.prototype,KY=WY.hasOwnProperty;function DN(e){if(!cE(e))return qY(e);var t=[];for(var n in Object(e))KY.call(e,n)&&n!="constructor"&&t.push(n);return t}function ym(e){return Of(e)?$N(e):DN(e)}function XY(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var QY=Object.prototype,YY=QY.hasOwnProperty;function ZY(e){if(!ri(e))return XY(e);var t=cE(e),n=[];for(var r in e)r=="constructor"&&(t||!YY.call(e,r))||n.push(r);return n}function vm(e){return Of(e)?$N(e,!0):ZY(e)}var JY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eZ=/^\w*$/;function fE(e,t){if(Tn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Gb(e)?!0:eZ.test(e)||!JY.test(e)||t!=null&&e in Object(t)}var tZ=fc(Object,"create");const Zp=tZ;function nZ(){this.__data__=Zp?Zp(null):{},this.size=0}function rZ(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var iZ="__lodash_hash_undefined__",oZ=Object.prototype,aZ=oZ.hasOwnProperty;function sZ(e){var t=this.__data__;if(Zp){var n=t[e];return n===iZ?void 0:n}return aZ.call(t,e)?t[e]:void 0}var lZ=Object.prototype,uZ=lZ.hasOwnProperty;function cZ(e){var t=this.__data__;return Zp?t[e]!==void 0:uZ.call(t,e)}var dZ="__lodash_hash_undefined__";function fZ(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zp&&t===void 0?dZ:t,this}function ec(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])}}ec.prototype.clear=nZ;ec.prototype.delete=rZ;ec.prototype.get=sZ;ec.prototype.has=cZ;ec.prototype.set=fZ;function hZ(){this.__data__=[],this.size=0}function Xb(e,t){for(var n=e.length;n--;)if(mm(e[n][0],t))return n;return-1}var pZ=Array.prototype,gZ=pZ.splice;function mZ(e){var t=this.__data__,n=Xb(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():gZ.call(t,n,1),--this.size,!0}function yZ(e){var t=this.__data__,n=Xb(t,e);return n<0?void 0:t[n][1]}function vZ(e){return Xb(this.__data__,e)>-1}function bZ(e,t){var n=this.__data__,r=Xb(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function xs(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])}}xs.prototype.clear=hZ;xs.prototype.delete=mZ;xs.prototype.get=yZ;xs.prototype.has=vZ;xs.prototype.set=bZ;var _Z=fc(Ta,"Map");const Jp=_Z;function SZ(){this.size=0,this.__data__={hash:new ec,map:new(Jp||xs),string:new ec}}function xZ(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Qb(e,t){var n=e.__data__;return xZ(t)?n[typeof t=="string"?"string":"hash"]:n.map}function wZ(e){var t=Qb(this,e).delete(e);return this.size-=t?1:0,t}function CZ(e){return Qb(this,e).get(e)}function EZ(e){return Qb(this,e).has(e)}function TZ(e,t){var n=Qb(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ws(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])}}ws.prototype.clear=SZ;ws.prototype.delete=wZ;ws.prototype.get=CZ;ws.prototype.has=EZ;ws.prototype.set=TZ;var AZ="Expected a function";function hE(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(AZ);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 a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(hE.Cache||ws),n}hE.Cache=ws;var PZ=500;function kZ(e){var t=hE(e,function(r){return n.size===PZ&&n.clear(),r}),n=t.cache;return t}var IZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,MZ=/\\(\\)?/g,RZ=kZ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(IZ,function(n,r,i,o){t.push(i?o.replace(MZ,"$1"):r||n)}),t});const OZ=RZ;function cf(e){return e==null?"":Zv(e)}function Yb(e,t){return Tn(e)?e:fE(e,t)?[e]:OZ(cf(e))}var $Z=1/0;function bm(e){if(typeof e=="string"||Gb(e))return e;var t=e+"";return t=="0"&&1/e==-$Z?"-0":t}function pE(e,t){t=Yb(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[bm(t[n++])];return n&&n==r?e:void 0}function Vy(e,t,n){var r=e==null?void 0:pE(e,t);return r===void 0?n:r}function gE(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Bk=Zi?Zi.isConcatSpreadable:void 0;function NZ(e){return Tn(e)||Qp(e)||!!(Bk&&e&&e[Bk])}function LN(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=NZ),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?LN(s,t-1,n,r,i):gE(i,s):r||(i[i.length]=s)}return i}function DZ(e){var t=e==null?0:e.length;return t?LN(e,1):[]}function LZ(e){return EN(PN(e,void 0,DZ),e+"")}var FZ=NN(Object.getPrototypeOf,Object);const mE=FZ;var BZ="[object Object]",zZ=Function.prototype,VZ=Object.prototype,FN=zZ.toString,jZ=VZ.hasOwnProperty,UZ=FN.call(Object);function BN(e){if(!ni(e)||Bo(e)!=BZ)return!1;var t=mE(e);if(t===null)return!0;var n=jZ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&FN.call(n)==UZ}function zN(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 VN(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:zN(e,t,n)}var GZ="\\ud800-\\udfff",HZ="\\u0300-\\u036f",qZ="\\ufe20-\\ufe2f",WZ="\\u20d0-\\u20ff",KZ=HZ+qZ+WZ,XZ="\\ufe0e\\ufe0f",QZ="\\u200d",YZ=RegExp("["+QZ+GZ+KZ+XZ+"]");function Zb(e){return YZ.test(e)}function ZZ(e){return e.split("")}var jN="\\ud800-\\udfff",JZ="\\u0300-\\u036f",eJ="\\ufe20-\\ufe2f",tJ="\\u20d0-\\u20ff",nJ=JZ+eJ+tJ,rJ="\\ufe0e\\ufe0f",iJ="["+jN+"]",a5="["+nJ+"]",s5="\\ud83c[\\udffb-\\udfff]",oJ="(?:"+a5+"|"+s5+")",UN="[^"+jN+"]",GN="(?:\\ud83c[\\udde6-\\uddff]){2}",HN="[\\ud800-\\udbff][\\udc00-\\udfff]",aJ="\\u200d",qN=oJ+"?",WN="["+rJ+"]?",sJ="(?:"+aJ+"(?:"+[UN,GN,HN].join("|")+")"+WN+qN+")*",lJ=WN+qN+sJ,uJ="(?:"+[UN+a5+"?",a5,GN,HN,iJ].join("|")+")",cJ=RegExp(s5+"(?="+s5+")|"+uJ+lJ,"g");function dJ(e){return e.match(cJ)||[]}function KN(e){return Zb(e)?dJ(e):ZZ(e)}function fJ(e){return function(t){t=cf(t);var n=Zb(t)?KN(t):void 0,r=n?n[0]:t.charAt(0),i=n?VN(n,1).join(""):t.slice(1);return r[e]()+i}}var hJ=fJ("toUpperCase");const XN=hJ;function QN(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 pJ(e){return function(t){return e==null?void 0:e[t]}}var gJ={À:"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"},mJ=pJ(gJ);const yJ=mJ;var vJ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bJ="\\u0300-\\u036f",_J="\\ufe20-\\ufe2f",SJ="\\u20d0-\\u20ff",xJ=bJ+_J+SJ,wJ="["+xJ+"]",CJ=RegExp(wJ,"g");function EJ(e){return e=cf(e),e&&e.replace(vJ,yJ).replace(CJ,"")}var TJ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function AJ(e){return e.match(TJ)||[]}var PJ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function kJ(e){return PJ.test(e)}var YN="\\ud800-\\udfff",IJ="\\u0300-\\u036f",MJ="\\ufe20-\\ufe2f",RJ="\\u20d0-\\u20ff",OJ=IJ+MJ+RJ,ZN="\\u2700-\\u27bf",JN="a-z\\xdf-\\xf6\\xf8-\\xff",$J="\\xac\\xb1\\xd7\\xf7",NJ="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",DJ="\\u2000-\\u206f",LJ=" \\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",eD="A-Z\\xc0-\\xd6\\xd8-\\xde",FJ="\\ufe0e\\ufe0f",tD=$J+NJ+DJ+LJ,nD="[']",zk="["+tD+"]",BJ="["+OJ+"]",rD="\\d+",zJ="["+ZN+"]",iD="["+JN+"]",oD="[^"+YN+tD+rD+ZN+JN+eD+"]",VJ="\\ud83c[\\udffb-\\udfff]",jJ="(?:"+BJ+"|"+VJ+")",UJ="[^"+YN+"]",aD="(?:\\ud83c[\\udde6-\\uddff]){2}",sD="[\\ud800-\\udbff][\\udc00-\\udfff]",Uc="["+eD+"]",GJ="\\u200d",Vk="(?:"+iD+"|"+oD+")",HJ="(?:"+Uc+"|"+oD+")",jk="(?:"+nD+"(?:d|ll|m|re|s|t|ve))?",Uk="(?:"+nD+"(?:D|LL|M|RE|S|T|VE))?",lD=jJ+"?",uD="["+FJ+"]?",qJ="(?:"+GJ+"(?:"+[UJ,aD,sD].join("|")+")"+uD+lD+")*",WJ="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KJ="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",XJ=uD+lD+qJ,QJ="(?:"+[zJ,aD,sD].join("|")+")"+XJ,YJ=RegExp([Uc+"?"+iD+"+"+jk+"(?="+[zk,Uc,"$"].join("|")+")",HJ+"+"+Uk+"(?="+[zk,Uc+Vk,"$"].join("|")+")",Uc+"?"+Vk+"+"+jk,Uc+"+"+Uk,KJ,WJ,rD,QJ].join("|"),"g");function ZJ(e){return e.match(YJ)||[]}function JJ(e,t,n){return e=cf(e),t=n?void 0:t,t===void 0?kJ(e)?ZJ(e):AJ(e):e.match(t)||[]}var eee="[']",tee=RegExp(eee,"g");function nee(e){return function(t){return QN(JJ(EJ(t).replace(tee,"")),e,"")}}function ree(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function al(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=zy(n),n=n===n?n:0),t!==void 0&&(t=zy(t),t=t===t?t:0),ree(zy(e),t,n)}function iee(){this.__data__=new xs,this.size=0}function oee(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function aee(e){return this.__data__.get(e)}function see(e){return this.__data__.has(e)}var lee=200;function uee(e,t){var n=this.__data__;if(n instanceof xs){var r=n.__data__;if(!Jp||r.length<lee-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ws(r)}return n.set(e,t),this.size=n.size,this}function Po(e){var t=this.__data__=new xs(e);this.size=t.size}Po.prototype.clear=iee;Po.prototype.delete=oee;Po.prototype.get=aee;Po.prototype.has=see;Po.prototype.set=uee;function cee(e,t){return e&&Rf(t,ym(t),e)}function dee(e,t){return e&&Rf(t,vm(t),e)}var cD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gk=cD&&typeof module=="object"&&module&&!module.nodeType&&module,fee=Gk&&Gk.exports===cD,Hk=fee?Ta.Buffer:void 0,qk=Hk?Hk.allocUnsafe:void 0;function dD(e,t){if(t)return e.slice();var n=e.length,r=qk?qk(n):new e.constructor(n);return e.copy(r),r}function hee(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function fD(){return[]}var pee=Object.prototype,gee=pee.propertyIsEnumerable,Wk=Object.getOwnPropertySymbols,mee=Wk?function(e){return e==null?[]:(e=Object(e),hee(Wk(e),function(t){return gee.call(e,t)}))}:fD;const yE=mee;function yee(e,t){return Rf(e,yE(e),t)}var vee=Object.getOwnPropertySymbols,bee=vee?function(e){for(var t=[];e;)gE(t,yE(e)),e=mE(e);return t}:fD;const hD=bee;function _ee(e,t){return Rf(e,hD(e),t)}function pD(e,t,n){var r=t(e);return Tn(e)?r:gE(r,n(e))}function l5(e){return pD(e,ym,yE)}function gD(e){return pD(e,vm,hD)}var See=fc(Ta,"DataView");const u5=See;var xee=fc(Ta,"Promise");const c5=xee;var wee=fc(Ta,"Set");const Rd=wee;var Kk="[object Map]",Cee="[object Object]",Xk="[object Promise]",Qk="[object Set]",Yk="[object WeakMap]",Zk="[object DataView]",Eee=dc(u5),Tee=dc(Jp),Aee=dc(c5),Pee=dc(Rd),kee=dc(o5),gu=Bo;(u5&&gu(new u5(new ArrayBuffer(1)))!=Zk||Jp&&gu(new Jp)!=Kk||c5&&gu(c5.resolve())!=Xk||Rd&&gu(new Rd)!=Qk||o5&&gu(new o5)!=Yk)&&(gu=function(e){var t=Bo(e),n=t==Cee?e.constructor:void 0,r=n?dc(n):"";if(r)switch(r){case Eee:return Zk;case Tee:return Kk;case Aee:return Xk;case Pee:return Qk;case kee:return Yk}return t});const df=gu;var Iee=Object.prototype,Mee=Iee.hasOwnProperty;function Ree(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Mee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Oee=Ta.Uint8Array;const e1=Oee;function vE(e){var t=new e.constructor(e.byteLength);return new e1(t).set(new e1(e)),t}function $ee(e,t){var n=t?vE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Nee=/\w*$/;function Dee(e){var t=new e.constructor(e.source,Nee.exec(e));return t.lastIndex=e.lastIndex,t}var Jk=Zi?Zi.prototype:void 0,e6=Jk?Jk.valueOf:void 0;function Lee(e){return e6?Object(e6.call(e)):{}}function mD(e,t){var n=t?vE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Fee="[object Boolean]",Bee="[object Date]",zee="[object Map]",Vee="[object Number]",jee="[object RegExp]",Uee="[object Set]",Gee="[object String]",Hee="[object Symbol]",qee="[object ArrayBuffer]",Wee="[object DataView]",Kee="[object Float32Array]",Xee="[object Float64Array]",Qee="[object Int8Array]",Yee="[object Int16Array]",Zee="[object Int32Array]",Jee="[object Uint8Array]",ete="[object Uint8ClampedArray]",tte="[object Uint16Array]",nte="[object Uint32Array]";function rte(e,t,n){var r=e.constructor;switch(t){case qee:return vE(e);case Fee:case Bee:return new r(+e);case Wee:return $ee(e,n);case Kee:case Xee:case Qee:case Yee:case Zee:case Jee:case ete:case tte:case nte:return mD(e,n);case zee:return new r;case Vee:case Gee:return new r(e);case jee:return Dee(e);case Uee:return new r;case Hee:return Lee(e)}}function yD(e){return typeof e.constructor=="function"&&!cE(e)?FQ(mE(e)):{}}var ite="[object Map]";function ote(e){return ni(e)&&df(e)==ite}var t6=Al&&Al.isMap,ate=t6?Kb(t6):ote;const ste=ate;var lte="[object Set]";function ute(e){return ni(e)&&df(e)==lte}var n6=Al&&Al.isSet,cte=n6?Kb(n6):ute;const dte=cte;var fte=1,hte=2,pte=4,vD="[object Arguments]",gte="[object Array]",mte="[object Boolean]",yte="[object Date]",vte="[object Error]",bD="[object Function]",bte="[object GeneratorFunction]",_te="[object Map]",Ste="[object Number]",_D="[object Object]",xte="[object RegExp]",wte="[object Set]",Cte="[object String]",Ete="[object Symbol]",Tte="[object WeakMap]",Ate="[object ArrayBuffer]",Pte="[object DataView]",kte="[object Float32Array]",Ite="[object Float64Array]",Mte="[object Int8Array]",Rte="[object Int16Array]",Ote="[object Int32Array]",$te="[object Uint8Array]",Nte="[object Uint8ClampedArray]",Dte="[object Uint16Array]",Lte="[object Uint32Array]",Tt={};Tt[vD]=Tt[gte]=Tt[Ate]=Tt[Pte]=Tt[mte]=Tt[yte]=Tt[kte]=Tt[Ite]=Tt[Mte]=Tt[Rte]=Tt[Ote]=Tt[_te]=Tt[Ste]=Tt[_D]=Tt[xte]=Tt[wte]=Tt[Cte]=Tt[Ete]=Tt[$te]=Tt[Nte]=Tt[Dte]=Tt[Lte]=!0;Tt[vte]=Tt[bD]=Tt[Tte]=!1;function fp(e,t,n,r,i,o){var a,s=t&fte,l=t&hte,u=t&pte;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!ri(e))return e;var c=Tn(e);if(c){if(a=Ree(e),!s)return CN(e,a)}else{var d=df(e),f=d==bD||d==bte;if(Yp(e))return dD(e,s);if(d==_D||d==vD||f&&!i){if(a=l||f?{}:yD(e),!s)return l?_ee(e,dee(a,e)):yee(e,cee(a,e))}else{if(!Tt[d])return i?e:{};a=rte(e,d,s)}}o||(o=new Po);var h=o.get(e);if(h)return h;o.set(e,a),dte(e)?e.forEach(function(_){a.add(fp(_,t,n,_,e,o))}):ste(e)&&e.forEach(function(_,b){a.set(b,fp(_,t,n,b,e,o))});var p=u?l?gD:l5:l?vm:ym,g=c?void 0:p(e);return TN(g||e,function(_,b){g&&(b=_,_=e[b]),AN(a,b,fp(_,t,n,b,e,o))}),a}var Fte=1,Bte=4;function Ye(e){return fp(e,Fte|Bte)}var zte="__lodash_hash_undefined__";function Vte(e){return this.__data__.set(e,zte),this}function jte(e){return this.__data__.has(e)}function eg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ws;++t<n;)this.add(e[t])}eg.prototype.add=eg.prototype.push=Vte;eg.prototype.has=jte;function SD(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 xD(e,t){return e.has(t)}var Ute=1,Gte=2;function wD(e,t,n,r,i,o){var a=n&Ute,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&Gte?new eg:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var p=e[d],g=t[d];if(r)var _=a?r(g,p,d,t,e,o):r(p,g,d,e,t,o);if(_!==void 0){if(_)continue;f=!1;break}if(h){if(!SD(t,function(b,y){if(!xD(h,y)&&(p===b||i(p,b,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(p===g||i(p,g,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Hte(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function bE(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var qte=1,Wte=2,Kte="[object Boolean]",Xte="[object Date]",Qte="[object Error]",Yte="[object Map]",Zte="[object Number]",Jte="[object RegExp]",ene="[object Set]",tne="[object String]",nne="[object Symbol]",rne="[object ArrayBuffer]",ine="[object DataView]",r6=Zi?Zi.prototype:void 0,Ox=r6?r6.valueOf:void 0;function one(e,t,n,r,i,o,a){switch(n){case ine:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rne:return!(e.byteLength!=t.byteLength||!o(new e1(e),new e1(t)));case Kte:case Xte:case Zte:return mm(+e,+t);case Qte:return e.name==t.name&&e.message==t.message;case Jte:case tne:return e==t+"";case Yte:var s=Hte;case ene:var l=r&qte;if(s||(s=bE),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=Wte,a.set(e,t);var c=wD(s(e),s(t),r,i,o,a);return a.delete(e),c;case nne:if(Ox)return Ox.call(e)==Ox.call(t)}return!1}var ane=1,sne=Object.prototype,lne=sne.hasOwnProperty;function une(e,t,n,r,i,o){var a=n&ane,s=l5(e),l=s.length,u=l5(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:lne.call(t,f)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var g=!0;o.set(e,t),o.set(t,e);for(var _=a;++d<l;){f=s[d];var b=e[f],y=t[f];if(r)var m=a?r(y,b,f,t,e,o):r(b,y,f,e,t,o);if(!(m===void 0?b===y||i(b,y,n,r,o):m)){g=!1;break}_||(_=f=="constructor")}if(g&&!_){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(e),o.delete(t),g}var cne=1,i6="[object Arguments]",o6="[object Array]",_0="[object Object]",dne=Object.prototype,a6=dne.hasOwnProperty;function fne(e,t,n,r,i,o){var a=Tn(e),s=Tn(t),l=a?o6:df(e),u=s?o6:df(t);l=l==i6?_0:l,u=u==i6?_0:u;var c=l==_0,d=u==_0,f=l==u;if(f&&Yp(e)){if(!Yp(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new Po),a||dE(e)?wD(e,t,n,r,i,o):one(e,t,l,n,r,i,o);if(!(n&cne)){var h=c&&a6.call(e,"__wrapped__"),p=d&&a6.call(t,"__wrapped__");if(h||p){var g=h?e.value():e,_=p?t.value():t;return o||(o=new Po),i(g,_,n,r,o)}}return f?(o||(o=new Po),une(e,t,n,r,i,o)):!1}function Jb(e,t,n,r,i){return e===t?!0:e==null||t==null||!ni(e)&&!ni(t)?e!==e&&t!==t:fne(e,t,n,r,Jb,i)}var hne=1,pne=2;function gne(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new Po;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?Jb(c,u,hne|pne,r,d):f))return!1}}return!0}function CD(e){return e===e&&!ri(e)}function mne(e){for(var t=ym(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,CD(i)]}return t}function ED(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function yne(e){var t=mne(e);return t.length==1&&t[0][2]?ED(t[0][0],t[0][1]):function(n){return n===e||gne(n,e,t)}}function vne(e,t){return e!=null&&t in Object(e)}function TD(e,t,n){t=Yb(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=bm(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&uE(i)&&lE(a,i)&&(Tn(e)||Qp(e)))}function bne(e,t){return e!=null&&TD(e,t,vne)}var _ne=1,Sne=2;function xne(e,t){return fE(e)&&CD(t)?ED(bm(e),t):function(n){var r=Vy(n,e);return r===void 0&&r===t?bne(n,e):Jb(t,r,_ne|Sne)}}function AD(e){return function(t){return t==null?void 0:t[e]}}function wne(e){return function(t){return pE(t,e)}}function Cne(e){return fE(e)?AD(bm(e)):wne(e)}function e_(e){return typeof e=="function"?e:e==null?Hb:typeof e=="object"?Tn(e)?xne(e[0],e[1]):yne(e):Cne(e)}function Ene(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Tne(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var Ane=Tne();const PD=Ane;function Pne(e,t){return e&&PD(e,t,ym)}function kne(e,t){return function(n,r){if(n==null)return n;if(!Of(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var Ine=kne(Pne);const t_=Ine;function Mne(e,t,n,r){return t_(e,function(i,o,a){t(r,i,n(i),a)}),r}function Rne(e,t){return function(n,r){var i=Tn(n)?Ene:Mne,o=t?t():{};return i(n,e,e_(r),o)}}function d5(e,t,n){(n!==void 0&&!mm(e[t],n)||n===void 0&&!(t in e))&&qb(e,t,n)}function One(e){return ni(e)&&Of(e)}function f5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function $ne(e){return Rf(e,vm(e))}function Nne(e,t,n,r,i,o,a){var s=f5(e,n),l=f5(t,n),u=a.get(l);if(u){d5(e,n,u);return}var c=o?o(s,l,n+"",e,t,a):void 0,d=c===void 0;if(d){var f=Tn(l),h=!f&&Yp(l),p=!f&&!h&&dE(l);c=l,f||h||p?Tn(s)?c=s:One(s)?c=CN(s):h?(d=!1,c=dD(l,!0)):p?(d=!1,c=mD(l,!0)):c=[]:BN(l)||Qp(l)?(c=s,Qp(s)?c=$ne(s):(!ri(s)||sE(s))&&(c=yD(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),d5(e,n,c)}function n_(e,t,n,r,i){e!==t&&PD(t,function(o,a){if(i||(i=new Po),ri(o))Nne(e,t,a,n,n_,r,i);else{var s=r?r(f5(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),d5(e,a,s)}},vm)}function kD(e,t,n,r,i,o){return ri(e)&&ri(t)&&(o.set(t,e),n_(e,t,void 0,kD,o),o.delete(t)),e}var Dne=IN(function(e,t,n,r){n_(e,t,n,r)});const Lne=Dne;var Fne=kN(function(e){return e.push(void 0,kD),wN(Lne,void 0,e)});const ID=Fne;function Bne(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 zne(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Vne(e){return typeof e=="function"?e:Hb}function ps(e,t){var n=Tn(e)?TN:t_;return n(e,Vne(t))}var jne=Object.prototype,Une=jne.hasOwnProperty;function Gne(e,t){return e!=null&&Une.call(e,t)}function Hne(e,t){return e!=null&&TD(e,t,Gne)}var qne="[object String]";function _E(e){return typeof e=="string"||!Tn(e)&&ni(e)&&Bo(e)==qne}function Wne(e,t){return t.length<2?e:pE(e,zN(t,0,-1))}var Kne="[object Boolean]";function Xne(e){return e===!0||e===!1||ni(e)&&Bo(e)==Kne}function SE(e,t){return Jb(e,t)}function Qne(e){return typeof e=="number"&&e==xN(e)}var Yne="[object Number]";function _a(e){return typeof e=="number"||ni(e)&&Bo(e)==Yne}var Zne="[object RegExp]";function Jne(e){return ni(e)&&Bo(e)==Zne}var s6=Al&&Al.isRegExp,ere=s6?Kb(s6):Jne;const tre=ere;var nre=Rne(function(e,t,n){qb(e,n,t)});const xE=nre;var rre=IN(function(e,t,n){n_(e,t,n)});const Od=rre;function ire(e,t){return t=Yb(t,e),e=Wne(e,t),e==null||delete e[bm(zne(t))]}function ore(e){return BN(e)?void 0:e}var are=1,sre=2,lre=4,ure=LZ(function(e,t){var n={};if(e==null)return n;var r=!1;t=SN(t,function(o){return o=Yb(o,e),r||(r=o.length>1),o}),Rf(e,gD(e),n),r&&(n=fp(n,are|sre|lre,ore));for(var i=t.length;i--;)ire(n,t[i]);return n});const $f=ure;var cre=AD("length");const dre=cre;var MD="\\ud800-\\udfff",fre="\\u0300-\\u036f",hre="\\ufe20-\\ufe2f",pre="\\u20d0-\\u20ff",gre=fre+hre+pre,mre="\\ufe0e\\ufe0f",yre="["+MD+"]",h5="["+gre+"]",p5="\\ud83c[\\udffb-\\udfff]",vre="(?:"+h5+"|"+p5+")",RD="[^"+MD+"]",OD="(?:\\ud83c[\\udde6-\\uddff]){2}",$D="[\\ud800-\\udbff][\\udc00-\\udfff]",bre="\\u200d",ND=vre+"?",DD="["+mre+"]?",_re="(?:"+bre+"(?:"+[RD,OD,$D].join("|")+")"+DD+ND+")*",Sre=DD+ND+_re,xre="(?:"+[RD+h5+"?",h5,OD,$D,yre].join("|")+")",l6=RegExp(p5+"(?="+p5+")|"+xre+Sre,"g");function wre(e){for(var t=l6.lastIndex=0;l6.test(e);)++t;return t}function LD(e){return Zb(e)?wre(e):dre(e)}var Cre=Math.floor,Ere=Math.random;function Tre(e,t){return e+Cre(Ere()*(t-e+1))}var Are=parseFloat,Pre=Math.min,kre=Math.random;function Ire(e,t,n){if(n&&typeof n!="boolean"&&Wb(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=Md(e),t===void 0?(t=e,e=0):t=Md(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=kre();return Pre(e+i*(t-e+Are("1e-"+((i+"").length-1))),t)}return Tre(e,t)}var Mre=Math.ceil,Rre=Math.max;function Ore(e,t,n,r){for(var i=-1,o=Rre(Mre((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}function $re(e){return function(t,n,r){return r&&typeof r!="number"&&Wb(t,n,r)&&(n=r=void 0),t=Md(t),n===void 0?(n=t,t=0):n=Md(n),r=r===void 0?t<n?1:-1:Md(r),Ore(t,n,r,e)}}var Nre=$re();const Dre=Nre;function Lre(e,t,n,r,i){return i(e,function(o,a,s){n=r?(r=!1,o):t(n,o,a,s)}),n}function tg(e,t,n){var r=Tn(e)?QN:Lre,i=arguments.length<3;return r(e,e_(t),n,i,t_)}var Fre="[object Map]",Bre="[object Set]";function r_(e){if(e==null)return 0;if(Of(e))return _E(e)?LD(e):e.length;var t=df(e);return t==Fre||t==Bre?e.size:DN(e).length}function zre(e,t){var n;return t_(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function Gc(e,t,n){var r=Tn(e)?SD:zre;return n&&Wb(e,t,n)&&(t=void 0),r(e,e_(t))}var Vre=nee(function(e,t,n){return e+(n?" ":"")+XN(t)});const wE=Vre;var jre=30,Ure="...",Gre=/\w*$/;function u6(e,t){var n=jre,r=Ure;if(ri(t)){var i="separator"in t?t.separator:i;n="length"in t?xN(t.length):n,r="omission"in t?Zv(t.omission):r}e=cf(e);var o=e.length;if(Zb(e)){var a=KN(e);o=a.length}if(n>=o)return e;var s=n-LD(r);if(s<1)return r;var l=a?VN(a,0,s).join(""):e.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),tre(i)){if(e.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,cf(Gre.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(e.indexOf(Zv(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Hre=1/0,qre=Rd&&1/bE(new Rd([,-0]))[1]==Hre?function(e){return new Rd(e)}:BQ;const Wre=qre;var Kre=200;function FD(e,t,n){var r=-1,i=JQ,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Bne;else if(o>=Kre){var u=t?null:Wre(e);if(u)return bE(u);a=!1,i=xD,l=new eg}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}function Xre(e){return e&&e.length?FD(e):[]}function g5(e,t){return e&&e.length?FD(e,e_(t)):[]}const BD={shouldUpdateImagesOnConnect:!1,shouldFetchMetadataFromApi:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches","bulkDownload"],disabledSDFeatures:["variation","symmetry","hires","perlinNoise","noiseThreshold"],nodesAllowlist:void 0,nodesDenylist:void 0,canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:1e3,inputMax:1e4,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},hrfStrength:{initial:.45,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},zD=Wt({name:"config",initialState:BD,reducers:{configChanged:(e,t)=>{Od(e,t.payload)}}}),{configChanged:Qre}=zD.actions,Yre=zD.reducer,VD=ge("socket/socketConnected"),CE=ge("socket/appSocketConnected"),jD=ge("socket/socketDisconnected"),UD=ge("socket/appSocketDisconnected"),Zre=ge("socket/socketSubscribedSession"),Jre=ge("socket/appSocketSubscribedSession"),eie=ge("socket/socketUnsubscribedSession"),tie=ge("socket/appSocketUnsubscribedSession"),GD=ge("socket/socketInvocationStarted"),EE=ge("socket/appSocketInvocationStarted"),TE=ge("socket/socketInvocationComplete"),AE=ge("socket/appSocketInvocationComplete"),HD=ge("socket/socketInvocationError"),i_=ge("socket/appSocketInvocationError"),qD=ge("socket/socketGraphExecutionStateComplete"),WD=ge("socket/appSocketGraphExecutionStateComplete"),KD=ge("socket/socketGeneratorProgress"),PE=ge("socket/appSocketGeneratorProgress"),XD=ge("socket/socketModelLoadStarted"),QD=ge("socket/appSocketModelLoadStarted"),YD=ge("socket/socketModelLoadCompleted"),ZD=ge("socket/appSocketModelLoadCompleted"),JD=ge("socket/socketSessionRetrievalError"),eL=ge("socket/appSocketSessionRetrievalError"),tL=ge("socket/socketInvocationRetrievalError"),nL=ge("socket/appSocketInvocationRetrievalError"),rL=ge("socket/socketQueueItemStatusChanged"),o_=ge("socket/appSocketQueueItemStatusChanged");let S0;const nie=new Uint8Array(16);function rie(){if(!S0&&(S0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!S0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S0(nie)}const er=[];for(let e=0;e<256;++e)er.push((e+256).toString(16).slice(1));function iie(e,t=0){return er[e[t+0]]+er[e[t+1]]+er[e[t+2]]+er[e[t+3]]+"-"+er[e[t+4]]+er[e[t+5]]+"-"+er[e[t+6]]+er[e[t+7]]+"-"+er[e[t+8]]+er[e[t+9]]+"-"+er[e[t+10]]+er[e[t+11]]+er[e[t+12]]+er[e[t+13]]+er[e[t+14]]+er[e[t+15]]}const oie=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),c6={randomUUID:oie};function yl(e,t,n){if(c6.randomUUID&&!t&&!e)return c6.randomUUID();e=e||{};const r=e.random||(e.rng||rie)();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 iie(r)}const aie={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 t1{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||aie,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 t1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new t1(this.logger,t)}}var sa=new t1;class a_{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(a=>{a(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...r])})}}function ch(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function d6(e){return e==null?"":""+e}function sie(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function kE(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function f6(e,t,n){const{obj:r,k:i}=kE(e,t,Object);r[i]=n}function lie(e,t,n,r){const{obj:i,k:o}=kE(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function n1(e,t){const{obj:n,k:r}=kE(e,t);if(n)return n[r]}function uie(e,t,n){const r=n1(e,n);return r!==void 0?r:n1(t,n)}function iL(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]):iL(e[r],t[r],n):e[r]=t[r]);return e}function kc(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function die(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>cie[t]):e}const fie=[" ",",","?","!",";"];function hie(e,t,n){t=t||"",n=n||"";const r=fie.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function r1(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 a=2,s=r.slice(o,o+a).join(n),l=i[s];for(;l===void 0&&r.length>o+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const u=r.slice(o+a).join(n);return u?r1(l,u,n):void 0}i=i[r[o]]}return i}function i1(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class h6 extends a_{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,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=n1(this.data,s);return l||!a||typeof r!="string"?l:r1(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 a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),f6(this.data,s,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 a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=n1(this.data,s)||{};i?iL(l,r,o):l={...l,...r},f6(this.data,s,l),a.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 oL={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 p6={};class o1 extends a_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),sie(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sa.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 a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!hie(t,r,i);if(a&&!s){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:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const v=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${v}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||a,p=d&&d.exactUsedKey||a,g=Object.prototype.toString.apply(f),_=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&_.indexOf(g)<0&&!(typeof b=="string"&&g==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=v,d.usedParams=this.getUsedParamsDetails(n),d):v}if(o){const v=g==="[object Array]",S=v?[]:{},w=v?p:h;for(const C in f)if(Object.prototype.hasOwnProperty.call(f,C)){const x=`${w}${o}${C}`;S[C]=this.translate(x,{...n,joinArrays:!1,ns:s}),S[C]===x&&(S[C]=f[C])}f=S}}else if(y&&typeof b=="string"&&g==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let v=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",C=o1.hasDefaultValue(n),x=w?this.pluralResolver.getSuffix(u,n.count,n):"",P=n.ordinal&&w?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",E=n[`defaultValue${x}`]||n[`defaultValue${P}`]||n.defaultValue;!this.isValidLookup(f)&&C&&(v=!0,f=E),this.isValidLookup(f)||(S=!0,f=a);const N=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,M=C&&E!==f&&this.options.updateMissing;if(S||v||M){if(this.logger.log(M?"updateKey":"missingKey",u,l,a,M?E:f),o){const D=this.resolve(a,{...n,keySeparator:!1});D&&D.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 T=[];const A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&A&&A[0])for(let D=0;D<A.length;D++)T.push(A[D]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(n.lng||this.language):T.push(n.lng||this.language);const R=(D,$,L)=>{const O=C&&L!==f?L:N;this.options.missingKeyHandler?this.options.missingKeyHandler(D,l,$,O,M,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(D,l,$,O,M,n),this.emit("missingKey",D,l,$,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?T.forEach(D=>{this.pluralResolver.getSuffixes(D,n).forEach($=>{R([D],a+$,n[`defaultValue${$}`]||E)})}):R(T,a,E))}f=this.extendTranslation(f,t,n,d,r),S&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${a}`),(S||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||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 c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;c<h&&(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 f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return o&&o[0]===h[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):a.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=oL.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,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(_=>{this.isValidLookup(r)||(s=_,!p6[`${g[0]}-${_}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(p6[`${g[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),g.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,b,_,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(c+v),n.ordinal&&v.indexOf(w)===0&&y.push(c+v.replace(w,this.options.pluralSeparator)),h&&y.push(c+S)),p){const C=`${c}${this.options.contextSeparator}${n.context}`;y.push(C),f&&(y.push(C+v),n.ordinal&&v.indexOf(w)===0&&y.push(C+v.replace(w,this.options.pluralSeparator)),h&&y.push(C+S))}}let m;for(;m=y.pop();)this.isValidLookup(r)||(o=m,r=this.getResource(b,_,m,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}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)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return 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 $x(e){return e.charAt(0).toUpperCase()+e.slice(1)}class g6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sa.create("languageUtils")}getScriptPartFromCode(t){if(t=i1(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=i1(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]=$x(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]=$x(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=$x(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=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};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(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let pie=[{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}],gie={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 mie=["v1","v2","v3"],yie=["v4"],m6={zero:0,one:1,two:2,few:3,many:4,other:5};function vie(){const e={};return pie.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:gie[t.fc]}})}),e}class bie{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=sa.create("pluralResolver"),(!this.options.compatibilityJSON||yie.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=vie()}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(i1(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)=>m6[i]-m6[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!mie.includes(this.options.compatibilityJSON)}}function y6(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=uie(e,t,n);return!o&&i&&typeof n=="string"&&(o=r1(e,n,r),o===void 0&&(o=r1(t,n,r))),o}class _ie{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=sa.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:die,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?kc(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?kc(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?kc(n.nestingPrefix):n.nestingPrefixEscaped||kc("$t("),this.nestingSuffix=n.nestingSuffix?kc(n.nestingSuffix):n.nestingSuffixEscaped||kc(")"),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,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=y6(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const g=p.split(this.formatSeparator),_=g.shift().trim(),b=g.join(this.formatSeparator).trim();return this.format(y6(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:_})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const g=o[1].trim();if(a=c(g),a===void 0)if(typeof d=="function"){const b=d(t,o,i);a=typeof b=="string"?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=d6(a));const _=p.safeValue(a);if(t=t.replace(o[0],_),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,a);const h=f.match(/'/g),p=f.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),u&&(a={...u,...a})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${c}${f}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=d6(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function Sie(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(a=>{if(!a)return;const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=u),u==="false"&&(n[s.trim()]=!1),u==="true"&&(n[s.trim()]=!0),isNaN(u)||(n[s.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function Ic(e){const t={};return function(r,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(i1(i),o),t[a]=s),s(r)}}class xie{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=sa.create("formatter"),this.options=t,this.formats={number:Ic((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:Ic((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:Ic((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:Ic((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:Ic((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()]=Ic(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:u,formatOptions:c}=Sie(l);if(this.formats[u]){let d=s;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](s,h,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}function wie(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Cie extends a_{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=sa.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={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,c=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),r&&this.store.addResourceBundle(o,a,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{lie(l.loaded,[o],a),wie(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),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,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}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(a=>{this.loadOne(a)})}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,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=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={...a,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function v6(){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 b6(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 x0(){}function Eie(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class ng extends a_{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=b6(t),this.services={},this.logger=sa,this.modules={external:[]},Eie(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=v6();this.options={...i,...this.options,...b6(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(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?sa.init(o(this.modules.logger),this.options):sa.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=xie);const d=new g6(this.options);this.store=new h6(this.options.resources,this.options);const f=this.services;f.logger=sa,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bie(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new _ie(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Cie(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),_=1;_<p;_++)g[_-1]=arguments[_];t.emit(h,...g)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new o1(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),_=1;_<p;_++)g[_-1]=arguments[_];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=x0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=ch(),u=()=>{const c=(d,f)=>{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(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};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]:x0;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"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=ch();return t||(t=this.languages),n||(n=this.options.ns),r||(r=x0),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"&&oL.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=ch();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(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)})},s=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,c=>{a(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(c))}else l={...s};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 f=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(a)?h=a.map(p=>`${l.keyPrefix}${f}${p}`):h=l.keyPrefix?`${l.keyPrefix}${f}${a}`:a,i.t(h,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 a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=ch();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=ch();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),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 g6(v6());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 ng(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x0;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new ng(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new h6(this.store.data,i),o.services.resourceStore=o.store),o.translator=new o1(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];o.emit(s,...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 de=ng.createInstance();de.createInstance=ng.createInstance;de.createInstance;de.dir;de.init;de.loadResources;de.reloadResources;de.use;de.changeLanguage;de.getFixedT;const X=de.t;de.exists;de.setDefaultNamespace;de.hasLoadedNamespace;de.loadNamespaces;de.loadLanguages;const Su={none:{type:"none",get label(){return de.t("controlnet.none")},get description(){return de.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return de.t("controlnet.canny")},get description(){return de.t("controlnet.cannyDescription")},default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},color_map_image_processor:{type:"color_map_image_processor",get label(){return de.t("controlnet.colorMap")},get description(){return de.t("controlnet.colorMapDescription")},default:{id:"color_map_image_processor",type:"color_map_image_processor",color_map_tile_size:64}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",get label(){return de.t("controlnet.contentShuffle")},get description(){return de.t("controlnet.contentShuffleDescription")},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",get label(){return de.t("controlnet.hed")},get description(){return de.t("controlnet.hedDescription")},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",get label(){return de.t("controlnet.lineartAnime")},get description(){return de.t("controlnet.lineartAnimeDescription")},default:{id:"lineart_anime_image_processor",type:"lineart_anime_image_processor",detect_resolution:512,image_resolution:512}},lineart_image_processor:{type:"lineart_image_processor",get label(){return de.t("controlnet.lineart")},get description(){return de.t("controlnet.lineartDescription")},default:{id:"lineart_image_processor",type:"lineart_image_processor",detect_resolution:512,image_resolution:512,coarse:!1}},mediapipe_face_processor:{type:"mediapipe_face_processor",get label(){return de.t("controlnet.mediapipeFace")},get description(){return de.t("controlnet.mediapipeFaceDescription")},default:{id:"mediapipe_face_processor",type:"mediapipe_face_processor",max_faces:1,min_confidence:.5}},midas_depth_image_processor:{type:"midas_depth_image_processor",get label(){return de.t("controlnet.depthMidas")},get description(){return de.t("controlnet.depthMidasDescription")},default:{id:"midas_depth_image_processor",type:"midas_depth_image_processor",a_mult:2,bg_th:.1}},mlsd_image_processor:{type:"mlsd_image_processor",get label(){return de.t("controlnet.mlsd")},get description(){return de.t("controlnet.mlsdDescription")},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",get label(){return de.t("controlnet.normalBae")},get description(){return de.t("controlnet.normalBaeDescription")},default:{id:"normalbae_image_processor",type:"normalbae_image_processor",detect_resolution:512,image_resolution:512}},openpose_image_processor:{type:"openpose_image_processor",get label(){return de.t("controlnet.openPose")},get description(){return de.t("controlnet.openPoseDescription")},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",get label(){return de.t("controlnet.pidi")},get description(){return de.t("controlnet.pidiDescription")},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",get label(){return de.t("controlnet.depthZoe")},get description(){return de.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},w0={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",sketch:"pidi_image_processor",scribble:"lineart_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",pidi:"pidi_image_processor",zoe:"zoe_depth_image_processor",color:"color_map_image_processor"},Tie={type:"controlnet",isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Su.canny_image_processor.default,shouldAutoConfig:!0},Aie={type:"t2i_adapter",isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Su.canny_image_processor.default,shouldAutoConfig:!0},Pie={type:"ip_adapter",isEnabled:!0,controlImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},_6=(e,t,n={})=>{switch(t){case"controlnet":return Od(Ye(Tie),{id:e,...n});case"t2i_adapter":return Od(Ye(Aie),{id:e,...n});case"ip_adapter":return Od(Ye(Pie),{id:e,...n});default:throw new Error(`Unknown control adapter type: ${t}`)}},IE=ge("controlAdapters/imageProcessed"),s_=e=>e.type==="controlnet",aL=e=>e.type==="ip_adapter",ME=e=>e.type==="t2i_adapter",gi=e=>s_(e)||ME(e),pn=Ji(),{selectById:di,selectAll:Aa,selectEntities:xLe,selectIds:wLe,selectTotal:CLe}=pn.getSelectors(),m5=pn.getInitialState({pendingControlImages:[]}),kie=e=>Aa(e).filter(s_),Iie=e=>Aa(e).filter(s_).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),Mie=e=>Aa(e).filter(aL),Rie=e=>Aa(e).filter(aL).filter(t=>t.isEnabled&&t.model&&!!t.controlImage),Oie=e=>Aa(e).filter(ME),$ie=e=>Aa(e).filter(ME).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),sL=Wt({name:"controlAdapters",initialState:m5,reducers:{controlAdapterAdded:{reducer:(e,t)=>{const{id:n,type:r,overrides:i}=t.payload;pn.addOne(e,_6(n,r,i))},prepare:({type:e,overrides:t})=>({payload:{id:yl(),type:e,overrides:t}})},controlAdapterRecalled:(e,t)=>{pn.addOne(e,t.payload)},controlAdapterDuplicated:{reducer:(e,t)=>{const{id:n,newId:r}=t.payload,i=di(e,n);if(!i)return;const o=Od(Ye(i),{id:r,isEnabled:!0});pn.addOne(e,o)},prepare:e=>({payload:{id:e,newId:yl()}})},controlAdapterAddedFromImage:{reducer:(e,t)=>{const{id:n,type:r,controlImage:i}=t.payload;pn.addOne(e,_6(n,r,{controlImage:i}))},prepare:e=>({payload:{...e,id:yl()}})},controlAdapterRemoved:(e,t)=>{pn.removeOne(e,t.payload.id)},controlAdapterIsEnabledChanged:(e,t)=>{const{id:n,isEnabled:r}=t.payload;pn.updateOne(e,{id:n,changes:{isEnabled:r}})},controlAdapterImageChanged:(e,t)=>{const{id:n,controlImage:r}=t.payload,i=di(e,n);i&&(pn.updateOne(e,{id:n,changes:{controlImage:r,processedControlImage:null}}),r!==null&&gi(i)&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlAdapterProcessedImageChanged:(e,t)=>{const{id:n,processedControlImage:r}=t.payload,i=di(e,n);i&&gi(i)&&(pn.updateOne(e,{id:n,changes:{processedControlImage:r}}),e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlAdapterModelCleared:(e,t)=>{pn.updateOne(e,{id:t.payload.id,changes:{model:null}})},controlAdapterModelChanged:(e,t)=>{const{id:n,model:r}=t.payload,i=di(e,n);if(!i)return;if(!gi(i)){pn.updateOne(e,{id:n,changes:{model:r}});return}const o={id:n,changes:{model:r}};if(o.changes.processedControlImage=null,i.shouldAutoConfig){let a;for(const s in w0)if(r.model_name.includes(s)){a=w0[s];break}a?(o.changes.processorType=a,o.changes.processorNode=Su[a].default):(o.changes.processorType="none",o.changes.processorNode=Su.none.default)}pn.updateOne(e,o)},controlAdapterWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload;pn.updateOne(e,{id:n,changes:{weight:r}})},controlAdapterBeginStepPctChanged:(e,t)=>{const{id:n,beginStepPct:r}=t.payload;pn.updateOne(e,{id:n,changes:{beginStepPct:r}})},controlAdapterEndStepPctChanged:(e,t)=>{const{id:n,endStepPct:r}=t.payload;pn.updateOne(e,{id:n,changes:{endStepPct:r}})},controlAdapterControlModeChanged:(e,t)=>{const{id:n,controlMode:r}=t.payload,i=di(e,n);!i||!s_(i)||pn.updateOne(e,{id:n,changes:{controlMode:r}})},controlAdapterResizeModeChanged:(e,t)=>{const{id:n,resizeMode:r}=t.payload,i=di(e,n);!i||!gi(i)||pn.updateOne(e,{id:n,changes:{resizeMode:r}})},controlAdapterProcessorParamsChanged:(e,t)=>{const{id:n,params:r}=t.payload,i=di(e,n);if(!i||!gi(i)||!i.processorNode)return;const o=Od(Ye(i.processorNode),r);pn.updateOne(e,{id:n,changes:{shouldAutoConfig:!1,processorNode:o}})},controlAdapterProcessortTypeChanged:(e,t)=>{const{id:n,processorType:r}=t.payload,i=di(e,n);if(!i||!gi(i))return;const o=Ye(Su[r].default);pn.updateOne(e,{id:n,changes:{processorType:r,processedControlImage:null,processorNode:o,shouldAutoConfig:!1}})},controlAdapterAutoConfigToggled:(e,t)=>{var o;const{id:n}=t.payload,r=di(e,n);if(!r||!gi(r))return;const i={id:n,changes:{shouldAutoConfig:!r.shouldAutoConfig}};if(i.changes.shouldAutoConfig){let a;for(const s in w0)if((o=r.model)!=null&&o.model_name.includes(s)){a=w0[s];break}a?(i.changes.processorType=a,i.changes.processorNode=Su[a].default):(i.changes.processorType="none",i.changes.processorNode=Su.none.default)}pn.updateOne(e,i)},controlAdaptersReset:()=>Ye(m5),pendingControlImagesCleared:e=>{e.pendingControlImages=[]}},extraReducers:e=>{e.addCase(IE,(t,n)=>{const r=di(t,n.payload.id);r&&r.controlImage!==null&&(t.pendingControlImages=Xre(t.pendingControlImages.concat(n.payload.id)))}),e.addCase(i_,t=>{t.pendingControlImages=[]})}}),{controlAdapterAdded:Nie,controlAdapterRecalled:Die,controlAdapterDuplicated:ELe,controlAdapterAddedFromImage:Lie,controlAdapterRemoved:TLe,controlAdapterImageChanged:Hl,controlAdapterProcessedImageChanged:RE,controlAdapterIsEnabledChanged:OE,controlAdapterModelChanged:S6,controlAdapterWeightChanged:ALe,controlAdapterBeginStepPctChanged:PLe,controlAdapterEndStepPctChanged:kLe,controlAdapterControlModeChanged:ILe,controlAdapterResizeModeChanged:MLe,controlAdapterProcessorParamsChanged:Fie,controlAdapterProcessortTypeChanged:Bie,controlAdaptersReset:zie,controlAdapterAutoConfigToggled:x6,pendingControlImagesCleared:Vie,controlAdapterModelCleared:Nx}=sL.actions,jie=sL.reducer,Uie=si(Nie,Lie,Die),RLe={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},OLe={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Gie={any:{maxClip:0,markers:[]},"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]}},$Le={lycoris:"LyCORIS",diffusers:"Diffusers"},Hie=0,hp=4294967295;var ut;(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 a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},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 a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},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(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(ut||(ut={}));var y5;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(y5||(y5={}));const he=ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zs=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}},ie=ut.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"]),qie=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ko 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 a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ut.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()}}ko.create=e=>new ko(e);const rg=(e,t)=>{let n;switch(e.code){case ie.invalid_type:e.received===he.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ut.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${ut.joinValues(e.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ut.joinValues(e.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${ut.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.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}"`:ut.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ie.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 ie.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 ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=t.defaultError,ut.assertNever(e)}return{message:n}};let lL=rg;function Wie(e){lL=e}function a1(){return lL}const s1=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},Kie=[];function ye(e,t){const n=s1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a1(),rg].filter(r=>!!r)});e.common.issues.push(n)}class _r{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 Le;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 _r.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Le;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Le=Object.freeze({status:"aborted"}),uL=e=>({status:"dirty",value:e}),Lr=e=>({status:"valid",value:e}),v5=e=>e.status==="aborted",b5=e=>e.status==="dirty",ig=e=>e.status==="valid",l1=e=>typeof Promise<"u"&&e instanceof Promise;var Ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ie||(Ie={}));class Sa{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 w6=(e,t)=>{if(ig(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 ko(e.common.issues);return this._error=n,this._error}}};function Be(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:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class ze{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.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Zs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _r,ctx:{common:t.parent.common,data:t.data,parsedType:Zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(l1(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:Zs(t)},o=this._parseSync({data:t,path:i.path,parent:i});return w6(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:Zs(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(l1(i)?i:Promise.resolve(i));return w6(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 a=t(i),s=()=>o.addIssue({code:ie.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!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 No({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return rs.create(this,this._def)}nullable(){return rc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Io.create(this,this._def)}promise(){return hf.create(this,this._def)}or(t){return lg.create([this,t],this._def)}and(t){return ug.create(this,t,this._def)}transform(t){return new No({...Be(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new pg({...Be(this._def),innerType:this,defaultValue:n,typeName:Oe.ZodDefault})}brand(){return new dL({typeName:Oe.ZodBranded,type:this,...Be(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new f1({...Be(this._def),innerType:this,catchValue:n,typeName:Oe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return _m.create(this,t)}readonly(){return p1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xie=/^c[^\s-]{8,}$/i,Qie=/^[a-z][a-z0-9]*$/,Yie=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zie=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jie=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eoe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dx;const toe=/^(((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}))$/,noe=/^(([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})))$/,roe=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 ioe(e,t){return!!((t==="v4"||!t)&&toe.test(e)||(t==="v6"||!t)&&noe.test(e))}class Eo extends ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){const o=this._getOrReturnCtx(t);return ye(o,{code:ie.invalid_type,expected:he.string,received:o.parsedType}),Le}const r=new _r;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:ie.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),ye(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?ye(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ye(i,{code:ie.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Jie.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"email",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Dx||(Dx=new RegExp(eoe,"u")),Dx.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"emoji",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Zie.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"uuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Xie.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"cuid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Qie.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"cuid2",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Yie.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"ulid",code:ie.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ye(i,{validation:"url",code:ie.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),ye(i,{validation:"regex",code:ie.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),ye(i,{code:ie.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),ye(i,{code:ie.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ye(i,{code:ie.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?roe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:ie.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?ioe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"ip",code:ie.invalid_string,message:o.message}),r.dirty()):ut.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ie.invalid_string,...Ie.errToObj(r)})}_addCheck(t){return new Eo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ie.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,...Ie.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ie.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ie.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ie.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ie.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ie.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ie.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ie.errToObj(n)})}nonempty(t){return this.min(1,Ie.errToObj(t))}trim(){return new Eo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Eo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Eo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}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}}Eo.create=e=>{var t;return new Eo({checks:[],typeName:Oe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Be(e)})};function ooe(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(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Pl extends ze{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)!==he.number){const o=this._getOrReturnCtx(t);return ye(o,{code:ie.invalid_type,expected:he.number,received:o.parsedType}),Le}let r;const i=new _r;for(const o of this._def.checks)o.kind==="int"?ut.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:ie.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),ye(r,{code:ie.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),ye(r,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ooe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ye(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:ie.not_finite,message:o.message}),i.dirty()):ut.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ie.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ie.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ie.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ie.toString(n))}setLimit(t,n,r,i){return new Pl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ie.toString(i)}]})}_addCheck(t){return new Pl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ie.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ie.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ie.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"&&ut.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)}}Pl.create=e=>new Pl({checks:[],typeName:Oe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class kl extends ze{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)!==he.bigint){const o=this._getOrReturnCtx(t);return ye(o,{code:ie.invalid_type,expected:he.bigint,received:o.parsedType}),Le}let r;const i=new _r;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),ye(r,{code:ie.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),ye(r,{code:ie.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),ye(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):ut.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ie.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ie.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ie.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ie.toString(n))}setLimit(t,n,r,i){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ie.toString(i)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ie.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}}kl.create=e=>{var t;return new kl({checks:[],typeName:Oe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Be(e)})};class og extends ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.boolean,received:r.parsedType}),Le}return Lr(t.data)}}og.create=e=>new og({typeName:Oe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class tc extends ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){const o=this._getOrReturnCtx(t);return ye(o,{code:ie.invalid_type,expected:he.date,received:o.parsedType}),Le}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ye(o,{code:ie.invalid_date}),Le}const r=new _r;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:ie.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),ye(i,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):ut.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new tc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ie.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ie.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}}tc.create=e=>new tc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Oe.ZodDate,...Be(e)});class u1 extends ze{_parse(t){if(this._getType(t)!==he.symbol){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.symbol,received:r.parsedType}),Le}return Lr(t.data)}}u1.create=e=>new u1({typeName:Oe.ZodSymbol,...Be(e)});class ag extends ze{_parse(t){if(this._getType(t)!==he.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.undefined,received:r.parsedType}),Le}return Lr(t.data)}}ag.create=e=>new ag({typeName:Oe.ZodUndefined,...Be(e)});class sg extends ze{_parse(t){if(this._getType(t)!==he.null){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.null,received:r.parsedType}),Le}return Lr(t.data)}}sg.create=e=>new sg({typeName:Oe.ZodNull,...Be(e)});class ff extends ze{constructor(){super(...arguments),this._any=!0}_parse(t){return Lr(t.data)}}ff.create=e=>new ff({typeName:Oe.ZodAny,...Be(e)});class zu extends ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Lr(t.data)}}zu.create=e=>new zu({typeName:Oe.ZodUnknown,...Be(e)});class gs extends ze{_parse(t){const n=this._getOrReturnCtx(t);return ye(n,{code:ie.invalid_type,expected:he.never,received:n.parsedType}),Le}}gs.create=e=>new gs({typeName:Oe.ZodNever,...Be(e)});class c1 extends ze{_parse(t){if(this._getType(t)!==he.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.void,received:r.parsedType}),Le}return Lr(t.data)}}c1.create=e=>new c1({typeName:Oe.ZodVoid,...Be(e)});class Io extends ze{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==he.array)return ye(n,{code:ie.invalid_type,expected:he.array,received:n.parsedType}),Le;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ye(n,{code:a?ie.too_big:ie.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?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&&(ye(n,{code:ie.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&&(ye(n,{code:ie.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((a,s)=>i.type._parseAsync(new Sa(n,a,n.path,s)))).then(a=>_r.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Sa(n,a,n.path,s)));return _r.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Io({...this._def,minLength:{value:t,message:Ie.toString(n)}})}max(t,n){return new Io({...this._def,maxLength:{value:t,message:Ie.toString(n)}})}length(t,n){return new Io({...this._def,exactLength:{value:t,message:Ie.toString(n)}})}nonempty(t){return this.min(1,t)}}Io.create=(e,t)=>new Io({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...Be(t)});function Hc(e){if(e instanceof Qt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=rs.create(Hc(r))}return new Qt({...e._def,shape:()=>t})}else return e instanceof Io?new Io({...e._def,type:Hc(e.element)}):e instanceof rs?rs.create(Hc(e.unwrap())):e instanceof rc?rc.create(Hc(e.unwrap())):e instanceof xa?xa.create(e.items.map(t=>Hc(t))):e}class Qt extends ze{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=ut.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==he.object){const u=this._getOrReturnCtx(t);return ye(u,{code:ie.invalid_type,expected:he.object,received:u.parsedType}),Le}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof gs&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Sa(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof gs){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(ye(i,{code:ie.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Sa(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>_r.mergeObjectSync(r,u)):_r.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ie.errToObj,new Qt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ie.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new Qt({...this._def,unknownKeys:"strip"})}passthrough(){return new Qt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Oe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qt({...this._def,catchall:t})}pick(t){const n={};return ut.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Qt({...this._def,shape:()=>n})}omit(t){const n={};return ut.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Qt({...this._def,shape:()=>n})}deepPartial(){return Hc(this)}partial(t){const n={};return ut.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Qt({...this._def,shape:()=>n})}required(t){const n={};return ut.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof rs;)o=o._def.innerType;n[r]=o}}),new Qt({...this._def,shape:()=>n})}keyof(){return cL(ut.objectKeys(this.shape))}}Qt.create=(e,t)=>new Qt({shape:()=>e,unknownKeys:"strip",catchall:gs.create(),typeName:Oe.ZodObject,...Be(t)});Qt.strictCreate=(e,t)=>new Qt({shape:()=>e,unknownKeys:"strict",catchall:gs.create(),typeName:Oe.ZodObject,...Be(t)});Qt.lazycreate=(e,t)=>new Qt({shape:e,unknownKeys:"strip",catchall:gs.create(),typeName:Oe.ZodObject,...Be(t)});class lg extends ze{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new ko(s.ctx.common.issues));return ye(n,{code:ie.invalid_union,unionErrors:a}),Le}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new ko(l));return ye(n,{code:ie.invalid_union,unionErrors:s}),Le}}get options(){return this._def.options}}lg.create=(e,t)=>new lg({options:e,typeName:Oe.ZodUnion,...Be(t)});const jy=e=>e instanceof dg?jy(e.schema):e instanceof No?jy(e.innerType()):e instanceof fg?[e.value]:e instanceof Il?e.options:e instanceof hg?Object.keys(e.enum):e instanceof pg?jy(e._def.innerType):e instanceof ag?[void 0]:e instanceof sg?[null]:null;class l_ extends ze{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.object)return ye(n,{code:ie.invalid_type,expected:he.object,received:n.parsedType}),Le;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}):(ye(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Le)}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 a=jy(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new l_({typeName:Oe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Be(r)})}}function _5(e,t){const n=Zs(e),r=Zs(t);if(e===t)return{valid:!0,data:e};if(n===he.object&&r===he.object){const i=ut.objectKeys(t),o=ut.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=_5(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===he.array&&r===he.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=_5(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===he.date&&r===he.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ug extends ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(v5(o)||v5(a))return Le;const s=_5(o.value,a.value);return s.valid?((b5(o)||b5(a))&&n.dirty(),{status:n.value,value:s.data}):(ye(r,{code:ie.invalid_intersection_types}),Le)};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,a])=>i(o,a)):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}))}}ug.create=(e,t,n)=>new ug({left:e,right:t,typeName:Oe.ZodIntersection,...Be(n)});class xa extends ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==he.array)return ye(r,{code:ie.invalid_type,expected:he.array,received:r.parsedType}),Le;if(r.data.length<this._def.items.length)return ye(r,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Le;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Sa(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>_r.mergeArray(n,a)):_r.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new xa({...this._def,rest:t})}}xa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xa({items:e,typeName:Oe.ZodTuple,rest:null,...Be(t)})};class cg extends ze{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!==he.object)return ye(r,{code:ie.invalid_type,expected:he.object,received:r.parsedType}),Le;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Sa(r,s,r.path,s)),value:a._parse(new Sa(r,r.data[s],r.path,s))});return r.common.async?_r.mergeObjectAsync(n,i):_r.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ze?new cg({keyType:t,valueType:n,typeName:Oe.ZodRecord,...Be(r)}):new cg({keyType:Eo.create(),valueType:t,typeName:Oe.ZodRecord,...Be(n)})}}class d1 extends ze{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!==he.map)return ye(r,{code:ie.invalid_type,expected:he.map,received:r.parsedType}),Le;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new Sa(r,s,r.path,[u,"key"])),value:o._parse(new Sa(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Le;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Le;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}d1.create=(e,t,n)=>new d1({valueType:t,keyType:e,typeName:Oe.ZodMap,...Be(n)});class nc extends ze{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==he.set)return ye(r,{code:ie.invalid_type,expected:he.set,received:r.parsedType}),Le;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ye(r,{code:ie.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&&(ye(r,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Le;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new Sa(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new nc({...this._def,minSize:{value:t,message:Ie.toString(n)}})}max(t,n){return new nc({...this._def,maxSize:{value:t,message:Ie.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}nc.create=(e,t)=>new nc({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...Be(t)});class $d extends ze{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.function)return ye(n,{code:ie.invalid_type,expected:he.function,received:n.parsedType}),Le;function r(s,l){return s1({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,a1(),rg].filter(u=>!!u),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function i(s,l){return s1({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,a1(),rg].filter(u=>!!u),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof hf){const s=this;return Lr(async function(...l){const u=new ko([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return Lr(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new ko([r(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ko([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new $d({...this._def,args:xa.create(t).rest(zu.create())})}returns(t){return new $d({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new $d({args:t||xa.create([]).rest(zu.create()),returns:n||zu.create(),typeName:Oe.ZodFunction,...Be(r)})}}class dg extends ze{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})}}dg.create=(e,t)=>new dg({getter:e,typeName:Oe.ZodLazy,...Be(t)});class fg extends ze{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ye(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),Le}return{status:"valid",value:t.data}}get value(){return this._def.value}}fg.create=(e,t)=>new fg({value:e,typeName:Oe.ZodLiteral,...Be(t)});function cL(e,t){return new Il({values:e,typeName:Oe.ZodEnum,...Be(t)})}class Il extends ze{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{expected:ut.joinValues(r),received:n.parsedType,code:ie.invalid_type}),Le}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{received:n.data,code:ie.invalid_enum_value,options:r}),Le}return Lr(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 Il.create(t)}exclude(t){return Il.create(this.options.filter(n=>!t.includes(n)))}}Il.create=cL;class hg extends ze{_parse(t){const n=ut.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==he.string&&r.parsedType!==he.number){const i=ut.objectValues(n);return ye(r,{expected:ut.joinValues(i),received:r.parsedType,code:ie.invalid_type}),Le}if(n.indexOf(t.data)===-1){const i=ut.objectValues(n);return ye(r,{received:r.data,code:ie.invalid_enum_value,options:i}),Le}return Lr(t.data)}get enum(){return this._def.values}}hg.create=(e,t)=>new hg({values:e,typeName:Oe.ZodNativeEnum,...Be(t)});class hf extends ze{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==he.promise&&n.common.async===!1)return ye(n,{code:ie.invalid_type,expected:he.promise,received:n.parsedType}),Le;const r=n.parsedType===he.promise?n.data:Promise.resolve(n.data);return Lr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}hf.create=(e,t)=>new hf({type:e,typeName:Oe.ZodPromise,...Be(t)});class No extends ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,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 s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Le:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Le:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ig(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>ig(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);ut.assertNever(i)}}No.create=(e,t,n)=>new No({schema:e,typeName:Oe.ZodEffects,effect:t,...Be(n)});No.createWithPreprocess=(e,t,n)=>new No({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...Be(n)});class rs extends ze{_parse(t){return this._getType(t)===he.undefined?Lr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rs.create=(e,t)=>new rs({innerType:e,typeName:Oe.ZodOptional,...Be(t)});class rc extends ze{_parse(t){return this._getType(t)===he.null?Lr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rc.create=(e,t)=>new rc({innerType:e,typeName:Oe.ZodNullable,...Be(t)});class pg extends ze{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===he.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pg.create=(e,t)=>new pg({innerType:e,typeName:Oe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});class f1 extends ze{_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 l1(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ko(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ko(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}f1.create=(e,t)=>new f1({innerType:e,typeName:Oe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});class h1 extends ze{_parse(t){if(this._getType(t)!==he.nan){const r=this._getOrReturnCtx(t);return ye(r,{code:ie.invalid_type,expected:he.nan,received:r.parsedType}),Le}return{status:"valid",value:t.data}}}h1.create=e=>new h1({typeName:Oe.ZodNaN,...Be(e)});const aoe=Symbol("zod_brand");class dL extends ze{_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 _m extends ze{_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"?Le:o.status==="dirty"?(n.dirty(),uL(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"?Le: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 _m({in:t,out:n,typeName:Oe.ZodPipeline})}}class p1 extends ze{_parse(t){const n=this._def.innerType._parse(t);return ig(n)&&(n.value=Object.freeze(n.value)),n}}p1.create=(e,t)=>new p1({innerType:e,typeName:Oe.ZodReadonly,...Be(t)});const fL=(e,t={},n)=>e?ff.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):ff.create(),soe={object:Qt.lazycreate};var Oe;(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",e.ZodReadonly="ZodReadonly"})(Oe||(Oe={}));const loe=(e,t={message:`Input not instance of ${e.name}`})=>fL(n=>n instanceof e,t),hL=Eo.create,pL=Pl.create,uoe=h1.create,coe=kl.create,gL=og.create,doe=tc.create,foe=u1.create,hoe=ag.create,poe=sg.create,goe=ff.create,moe=zu.create,yoe=gs.create,voe=c1.create,boe=Io.create,_oe=Qt.create,Soe=Qt.strictCreate,xoe=lg.create,woe=l_.create,Coe=ug.create,Eoe=xa.create,Toe=cg.create,Aoe=d1.create,Poe=nc.create,koe=$d.create,Ioe=dg.create,Moe=fg.create,Roe=Il.create,Ooe=hg.create,$oe=hf.create,C6=No.create,Noe=rs.create,Doe=rc.create,Loe=No.createWithPreprocess,Foe=_m.create,Boe=()=>hL().optional(),zoe=()=>pL().optional(),Voe=()=>gL().optional(),joe={string:e=>Eo.create({...e,coerce:!0}),number:e=>Pl.create({...e,coerce:!0}),boolean:e=>og.create({...e,coerce:!0}),bigint:e=>kl.create({...e,coerce:!0}),date:e=>tc.create({...e,coerce:!0})},Uoe=Le;var F=Object.freeze({__proto__:null,defaultErrorMap:rg,setErrorMap:Wie,getErrorMap:a1,makeIssue:s1,EMPTY_PATH:Kie,addIssueToContext:ye,ParseStatus:_r,INVALID:Le,DIRTY:uL,OK:Lr,isAborted:v5,isDirty:b5,isValid:ig,isAsync:l1,get util(){return ut},get objectUtil(){return y5},ZodParsedType:he,getParsedType:Zs,ZodType:ze,ZodString:Eo,ZodNumber:Pl,ZodBigInt:kl,ZodBoolean:og,ZodDate:tc,ZodSymbol:u1,ZodUndefined:ag,ZodNull:sg,ZodAny:ff,ZodUnknown:zu,ZodNever:gs,ZodVoid:c1,ZodArray:Io,ZodObject:Qt,ZodUnion:lg,ZodDiscriminatedUnion:l_,ZodIntersection:ug,ZodTuple:xa,ZodRecord:cg,ZodMap:d1,ZodSet:nc,ZodFunction:$d,ZodLazy:dg,ZodLiteral:fg,ZodEnum:Il,ZodNativeEnum:hg,ZodPromise:hf,ZodEffects:No,ZodTransformer:No,ZodOptional:rs,ZodNullable:rc,ZodDefault:pg,ZodCatch:f1,ZodNaN:h1,BRAND:aoe,ZodBranded:dL,ZodPipeline:_m,ZodReadonly:p1,custom:fL,Schema:ze,ZodSchema:ze,late:soe,get ZodFirstPartyTypeKind(){return Oe},coerce:joe,any:goe,array:boe,bigint:coe,boolean:gL,date:doe,discriminatedUnion:woe,effect:C6,enum:Roe,function:koe,instanceof:loe,intersection:Coe,lazy:Ioe,literal:Moe,map:Aoe,nan:uoe,nativeEnum:Ooe,never:yoe,null:poe,nullable:Doe,number:pL,object:_oe,oboolean:Voe,onumber:zoe,optional:Noe,ostring:Boe,pipeline:Foe,preprocess:Loe,promise:$oe,record:Toe,set:Poe,strictObject:Soe,string:hL,symbol:foe,transformer:C6,tuple:Eoe,undefined:hoe,union:xoe,unknown:moe,void:voe,NEVER:Uoe,ZodIssueCode:ie,quotelessJson:qie,ZodError:ko});const Goe=F.string(),NLe=e=>Goe.safeParse(e).success,Hoe=F.string(),DLe=e=>Hoe.safeParse(e).success,qoe=F.string(),LLe=e=>qoe.safeParse(e).success,Woe=F.string(),FLe=e=>Woe.safeParse(e).success,Koe=F.number().int().min(1),BLe=e=>Koe.safeParse(e).success,Xoe=F.number().min(1),zLe=e=>Xoe.safeParse(e).success,mL=F.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","lcm"]),VLe=e=>mL.safeParse(e).success,jLe={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",lcm:"LCM"},Qoe=F.number().int().min(0).max(hp),ULe=e=>Qoe.safeParse(e).success,yL=F.number().multipleOf(8).min(64),GLe=e=>yL.safeParse(e).success,vL=F.number().multipleOf(8).min(64),HLe=e=>vL.safeParse(e).success;F.tuple([yL,vL]);const ql=F.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),u_=F.object({model_name:F.string().min(1),base_model:ql,model_type:F.literal("main")}),qLe=e=>u_.safeParse(e).success,$E=F.object({model_name:F.string().min(1),base_model:F.literal("sdxl-refiner"),model_type:F.literal("main")}),WLe=e=>$E.safeParse(e).success,bL=F.object({model_name:F.string().min(1),base_model:ql,model_type:F.literal("onnx")}),Sm=F.union([u_,bL]),_L=F.object({model_name:F.string().min(1),base_model:ql}),KLe=e=>_L.safeParse(e).success,Yoe=F.object({model_name:F.string().min(1),base_model:ql}),XLe=e=>Yoe.safeParse(e).success,Zoe=F.object({model_name:F.string().min(1),base_model:ql}),QLe=e=>Zoe.safeParse(e).success,Joe=F.object({model_name:F.string().min(1),base_model:ql}),eae=F.object({model_name:F.string().min(1),base_model:ql}),YLe=e=>eae.safeParse(e).success,ZLe=e=>Joe.safeParse(e).success,tae=F.number().min(0).max(1),JLe=e=>tae.safeParse(e).success;F.enum(["fp16","fp32"]);const nae=F.enum(["ESRGAN","bilinear"]),eFe=e=>nae.safeParse(e).success,rae=F.number().min(1).max(10),tFe=e=>rae.safeParse(e).success,iae=F.number().min(1).max(10),nFe=e=>iae.safeParse(e).success,oae=F.number().min(0).max(1),rFe=e=>oae.safeParse(e).success;F.enum(["box","gaussian"]);F.enum(["unmasked","mask","edge"]);const aae=F.boolean(),iFe=e=>aae.safeParse(e).success&&e!==null&&e!==void 0,NE={hrfStrength:.45,hrfEnabled:!1,hrfMethod:"ESRGAN",cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"unmasked",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,infillTileSize:32,infillPatchmatchDownscaleSize:1,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,shouldLockAspectRatio:!1},sae=NE,SL=Wt({name:"generation",initialState:sae,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=al(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=al(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,...NE}),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},setCanvasCoherenceMode:(e,t)=>{e.canvasCoherenceMode=t.payload},setCanvasCoherenceSteps:(e,t)=>{e.canvasCoherenceSteps=t.payload},setCanvasCoherenceStrength:(e,t)=>{e.canvasCoherenceStrength=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setInfillTileSize:(e,t)=>{e.infillTileSize=t.payload},setInfillPatchmatchDownscaleSize:(e,t)=>{e.infillPatchmatchDownscaleSize=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=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}=Gie[e.model.base_model];e.clipSkip=al(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},setHrfStrength:(e,t)=>{e.hrfStrength=t.payload},setHrfEnabled:(e,t)=>{e.hrfEnabled=t.payload},setHrfMethod:(e,t)=>{e.hrfMethod=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Rr(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(Qre,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,a,s]=r.split("/"),l=u_.safeParse({model_name:s,base_model:o,model_type:a});l.success&&(t.model=l.data)}}),e.addMatcher(Uie,(t,n)=>{n.payload.type==="t2i_adapter"&&(t.width=Rr(t.width,64),t.height=Rr(t.height,64))})}}),{clampSymmetrySteps:oFe,clearInitialImage:DE,resetParametersState:aFe,resetSeed:sFe,setCfgScale:lFe,setWidth:E6,setHeight:T6,toggleSize:uFe,setImg2imgStrength:cFe,setInfillMethod:lae,setIterations:dFe,setPerlin:fFe,setPositivePrompt:uae,setNegativePrompt:hFe,setScheduler:pFe,setMaskBlur:gFe,setMaskBlurMethod:mFe,setCanvasCoherenceMode:yFe,setCanvasCoherenceSteps:vFe,setCanvasCoherenceStrength:bFe,setSeed:_Fe,setSeedWeights:SFe,setShouldFitToWidthHeight:xFe,setShouldGenerateVariations:wFe,setShouldRandomizeSeed:CFe,setSteps:EFe,setThreshold:TFe,setInfillTileSize:AFe,setInfillPatchmatchDownscaleSize:PFe,setVariationAmount:kFe,setShouldUseSymmetry:IFe,setHorizontalSymmetrySteps:MFe,setVerticalSymmetrySteps:RFe,initialImageChanged:c_,modelChanged:sl,vaeSelected:xL,setSeamlessXAxis:OFe,setSeamlessYAxis:$Fe,setClipSkip:NFe,setHrfEnabled:DFe,setHrfStrength:LFe,setHrfMethod:FFe,shouldUseCpuNoiseChanged:BFe,setAspectRatio:cae,setShouldLockAspectRatio:zFe,vaePrecisionChanged:VFe}=SL.actions,dae=SL.reducer,C0=(e,t,n,r,i,o,a)=>{const s=Math.floor(e/2-(n+i/2)*a),l=Math.floor(t/2-(r+o/2)*a);return{x:s,y:l}},E0=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r,s=Math.min(1,Math.min(o,a));return s||1},jFe=.999,UFe=.1,GFe=20,T0=.95,HFe=30,qFe=10,fae=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Mc=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a<i;)if(s+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=s,r.height=Rr(s/o,64)):o<1&&(r.height=s,r.width=Rr(s*o,64)),a=r.width*r.height;return r},hae=e=>({width:Rr(e.width,64),height:Rr(e.height,64)}),WFe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],KFe=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],wL=e=>e.kind==="line"&&e.layer==="mask",XFe=e=>e.kind==="line"&&e.layer==="base",pae=e=>e.kind==="image"&&e.layer==="base",QFe=e=>e.kind==="fillRect"&&e.layer==="base",YFe=e=>e.kind==="eraseRect"&&e.layer==="base",gae=e=>e.kind==="line";let Tr=[],Pa=(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 a=n.indexOf(i);~a&&(n.splice(a,2),--r.lc||r.off())}},notify(i){let o=!Tr.length;for(let a=0;a<n.length;a+=2)Tr.push(n[a],n[a+1],r.value,i);if(o){for(let a=0;a<Tr.length;a+=4){let s;for(let l=a+1;!s&&(l+=4)<Tr.length;)Tr[l]<Tr[a+1]&&(s=Tr.push(Tr[a],Tr[a+1],Tr[a+2],Tr[a+3]));s||Tr[a](Tr[a+2],Tr[a+3])}Tr.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let a=r.listen(i,o);return i(r.value),a},value:e};return r};const mae=5,A0=6,P0=10;let yae=(e,t,n,r)=>(e.events=e.events||{},e.events[n+P0]||(e.events[n+P0]=r(i=>{e.events[n].reduceRight((o,a)=>(a(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])}),vae=1e3,bae=(e,t)=>yae(e,r=>{let i=t(r);i&&e.events[A0].push(i)},mae,r=>{let i=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...a));let o=e.off;return e.events[A0]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[A0])a();e.events[A0]=[]}},vae)},()=>{e.listen=i,e.off=o}}),_ae=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(a=>a.get());(n===void 0||o.some((a,s)=>a!==n[s]))&&(n=o,i.set(t(...o)))},i=Pa(void 0,Math.max(...e.map(o=>o.l))+1);return bae(i,()=>{let o=e.map(a=>a.listen(r,i.l));return r(),()=>{for(let a of o)a()}}),i};const CL="default",Dn=Pa(CL),Sae={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},xae=Sae,EL=Wt({name:"queue",initialState:xae,reducers:{listCursorChanged:(e,t)=>{e.listCursor=t.payload},listPriorityChanged:(e,t)=>{e.listPriority=t.payload},listParamsReset:e=>{e.listCursor=void 0,e.listPriority=void 0},queueItemSelectionToggled:(e,t)=>{e.selectedQueueItem===t.payload?e.selectedQueueItem=void 0:e.selectedQueueItem=t.payload},resumeProcessorOnEnqueueChanged:(e,t)=>{e.resumeProcessorOnEnqueue=t.payload}}}),{listCursorChanged:ZFe,listPriorityChanged:JFe,listParamsReset:wae,queueItemSelectionToggled:eBe,resumeProcessorOnEnqueueChanged:tBe}=EL.actions,Cae=EL.reducer,TL="%[a-f0-9]{2}",A6=new RegExp("("+TL+")|([^%]+?)","gi"),P6=new RegExp("("+TL+")+","gi");function S5(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([],S5(n),S5(r))}function Eae(e){try{return decodeURIComponent(e)}catch{let t=e.match(A6)||[];for(let n=1;n<t.length;n++)e=S5(t,n).join(""),t=e.match(A6)||[];return e}}function Tae(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=P6.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=Eae(n[0]);i!==n[0]&&(t[n[0]]=i)}n=P6.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 Aae(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Tae(e)}}function AL(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 Pae(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 kae=e=>e==null,Iae=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),x5=Symbol("encodeFragmentIdentifier");function Mae(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,[Sn(t,e),"[",i,"]"].join("")]:[...n,[Sn(t,e),"[",Sn(i,e),"]=",Sn(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Sn(t,e),"[]"].join("")]:[...n,[Sn(t,e),"[]=",Sn(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,[Sn(t,e),":list="].join("")]:[...n,[Sn(t,e),":list=",Sn(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?[[Sn(n,e),t,Sn(i,e)].join("")]:[[r,Sn(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Sn(t,e)]:[...n,[Sn(t,e),"=",Sn(r,e)].join("")]}}function Rae(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),a=typeof r=="string"&&!o&&Ua(r,e).includes(e.arrayFormatSeparator);r=a?Ua(r,e):r;const s=o||a?r.split(e.arrayFormatSeparator).map(l=>Ua(l,e)):r===null?r:Ua(r,e);i[n]=s};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Ua(r,e);return}const a=r===null?[]:r.split(e.arrayFormatSeparator).map(s=>Ua(s,e));if(i[n]===void 0){i[n]=a;return}i[n]=[...i[n],...a]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function PL(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Sn(e,t){return t.encode?t.strict?Iae(e):encodeURIComponent(e):e}function Ua(e,t){return t.decode?Aae(e):e}function kL(e){return Array.isArray(e)?e.sort():typeof e=="object"?kL(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function IL(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function Oae(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function k6(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 LE(e){e=IL(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function FE(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},PL(t.arrayFormatSeparator);const n=Rae(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[a,s]=AL(o,"=");a===void 0&&(a=o),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:Ua(s,t),n(Ua(a,t),s,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[a,s]of Object.entries(o))o[a]=k6(s,t);else r[i]=k6(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const a=r[o];return a&&typeof a=="object"&&!Array.isArray(a)?i[o]=kL(a):i[o]=a,i},Object.create(null))}function ML(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},PL(t.arrayFormatSeparator);const n=a=>t.skipNull&&kae(e[a])||t.skipEmptyString&&e[a]==="",r=Mae(t),i={};for(const[a,s]of Object.entries(e))n(a)||(i[a]=s);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{const s=e[a];return s===void 0?"":s===null?Sn(a,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Sn(a,t)+"[]":s.reduce(r(a),[]).join("&"):Sn(a,t)+"="+Sn(s,t)}).filter(a=>a.length>0).join("&")}function RL(e,t){var i;t={decode:!0,...t};let[n,r]=AL(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:FE(LE(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Ua(r,t)}:{}}}function OL(e,t){t={encode:!0,strict:!0,[x5]:!0,...t};const n=IL(e.url).split("?")[0]||"",r=LE(e.url),i={...FE(r,{sort:!1}),...e.query};let o=ML(i,t);o&&(o=`?${o}`);let a=Oae(e.url);if(e.fragmentIdentifier){const s=new URL(n);s.hash=e.fragmentIdentifier,a=t[x5]?s.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${a}`}function $L(e,t,n){n={parseFragmentIdentifier:!0,[x5]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=RL(e,n);return OL({url:r,query:Pae(i,t),fragmentIdentifier:o},n)}function $ae(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return $L(e,r,n)}const pp=Object.freeze(Object.defineProperty({__proto__:null,exclude:$ae,extract:LE,parse:FE,parseUrl:RL,pick:$L,stringify:ML,stringifyUrl:OL},Symbol.toStringTag,{value:"Module"}));var g1=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,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}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(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},m1=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},Nae=Object.defineProperty,Dae=Object.defineProperties,Lae=Object.getOwnPropertyDescriptors,y1=Object.getOwnPropertySymbols,NL=Object.prototype.hasOwnProperty,DL=Object.prototype.propertyIsEnumerable,I6=function(e,t,n){return t in e?Nae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},sn=function(e,t){for(var n in t||(t={}))NL.call(t,n)&&I6(e,n,t[n]);if(y1)for(var r=0,i=y1(t);r<i.length;r++){var n=i[r];DL.call(t,n)&&I6(e,n,t[n])}return e},la=function(e,t){return Dae(e,Lae(t))},M6=function(e,t){var n={};for(var r in e)NL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&y1)for(var i=0,o=y1(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&DL.call(e,r)&&(n[r]=e[r])}return n},v1=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},Ht;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(Ht||(Ht={}));function Fae(e){return{status:e,isUninitialized:e===Ht.uninitialized,isLoading:e===Ht.pending,isSuccess:e===Ht.fulfilled,isError:e===Ht.rejected}}function Bae(e){return new RegExp("(^|:)//").test(e)}var zae=function(e){return e.replace(/\/$/,"")},Vae=function(e){return e.replace(/^\//,"")};function jae(e,t){if(!e)return t;if(!t)return e;if(Bae(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=zae(e),t=Vae(t),""+e+n+t}var R6=function(e){return[].concat.apply([],e)};function Uae(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Gae(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var O6=$o;function LL(e,t){if(e===t||!(O6(e)&&O6(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)?[]:{},a=0,s=n;a<s.length;a++){var l=s[a];o[l]=LL(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var $6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Hae=function(e){return e.status>=200&&e.status<=299},qae=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function N6(e){if(!$o(e))return e;for(var t=sn({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],a=i[1];a===void 0&&delete t[o]}return t}function Wae(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(m){return m}:i,a=n.fetchFn,s=a===void 0?$6:a,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?qae:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,g=n.responseHandler,_=n.validateStatus,b=M6(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&s===$6&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(m,v){return v1(t,null,function(){var S,w,C,x,P,E,I,N,M,T,A,R,D,$,L,O,B,U,j,q,Y,Z,V,K,ee,re,fe,Se,Me,De,Ee,tt,ot,we,Xn,Vt;return g1(this,function(Ot){switch(Ot.label){case 0:return S=v.signal,w=v.getState,C=v.extra,x=v.endpoint,P=v.forced,E=v.type,N=typeof m=="string"?{url:m}:m,M=N.url,T=N.headers,A=T===void 0?new Headers(b.headers):T,R=N.params,D=R===void 0?void 0:R,$=N.responseHandler,L=$===void 0?g??"json":$,O=N.validateStatus,B=O===void 0?_??Hae:O,U=N.timeout,j=U===void 0?p:U,q=M6(N,["url","headers","params","responseHandler","validateStatus","timeout"]),Y=sn(la(sn({},b),{signal:S}),q),A=new Headers(N6(A)),Z=Y,[4,o(A,{getState:w,extra:C,endpoint:x,forced:P,type:E})];case 1:Z.headers=Ot.sent()||A,V=function(xt){return typeof xt=="object"&&($o(xt)||Array.isArray(xt)||typeof xt.toJSON=="function")},!Y.headers.has("content-type")&&V(Y.body)&&Y.headers.set("content-type",f),V(Y.body)&&c(Y.headers)&&(Y.body=JSON.stringify(Y.body,h)),D&&(K=~M.indexOf("?")?"&":"?",ee=l?l(D):new URLSearchParams(N6(D)),M+=K+ee),M=jae(r,M),re=new Request(M,Y),fe=new Request(M,Y),I={request:fe},Me=!1,De=j&&setTimeout(function(){Me=!0,v.abort()},j),Ot.label=2;case 2:return Ot.trys.push([2,4,5,6]),[4,s(re)];case 3:return Se=Ot.sent(),[3,6];case 4:return Ee=Ot.sent(),[2,{error:{status:Me?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ee)},meta:I}];case 5:return De&&clearTimeout(De),[7];case 6:tt=Se.clone(),I.response=tt,we="",Ot.label=7;case 7:return Ot.trys.push([7,9,,10]),[4,Promise.all([y(Se,L).then(function(xt){return ot=xt},function(xt){return Xn=xt}),tt.text().then(function(xt){return we=xt},function(){})])];case 8:if(Ot.sent(),Xn)throw Xn;return[3,10];case 9:return Vt=Ot.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Se.status,data:we,error:String(Vt)},meta:I}];case 10:return[2,B(Se,ot)?{data:ot,meta:I}:{error:{status:Se.status,data:ot},meta:I}]}})})};function y(m,v){return v1(this,null,function(){var S;return g1(this,function(w){switch(w.label){case 0:return typeof v=="function"?[2,v(m)]:(v==="content-type"&&(v=c(m.headers)?"json":"text"),v!=="json"?[3,2]:[4,m.text()]);case 1:return S=w.sent(),[2,S.length?JSON.parse(S):null];case 2:return[2,m.text()]}})})}}var D6=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),BE=ge("__rtkq/focused"),FL=ge("__rtkq/unfocused"),zE=ge("__rtkq/online"),BL=ge("__rtkq/offline"),wa;(function(e){e.query="query",e.mutation="mutation"})(wa||(wa={}));function zL(e){return e.type===wa.query}function Kae(e){return e.type===wa.mutation}function VE(e,t,n,r,i,o){return Xae(e)?e(t,n,r,i).map(w5).map(o):Array.isArray(e)?e.map(w5).map(o):[]}function Xae(e){return typeof e=="function"}function w5(e){return typeof e=="string"?{type:e}:e}function Lx(e){return e!=null}var gg=Symbol("forceQueryFn"),C5=function(e){return typeof e[gg]=="function"};function Qae(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,a=new Map,s=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,c=l.removeMutationResult,d=l.updateSubscriptionOptions;return{buildInitiateQuery:y,buildInitiateMutation:m,getRunningQueryThunk:p,getRunningMutationThunk:g,getRunningQueriesThunk:_,getRunningMutationsThunk:b,getRunningOperationPromises:h,removalWarning:f};function f(){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 h(){typeof process<"u";var v=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return m1(m1([],v(a)),v(s)).filter(Lx)}function p(v,S){return function(w){var C,x=o.endpointDefinitions[v],P=t({queryArgs:S,endpointDefinition:x,endpointName:v});return(C=a.get(w))==null?void 0:C[P]}}function g(v,S){return function(w){var C;return(C=s.get(w))==null?void 0:C[S]}}function _(){return function(v){return Object.values(a.get(v)||{}).filter(Lx)}}function b(){return function(v){return Object.values(s.get(v)||{}).filter(Lx)}}function y(v,S){var w=function(C,x){var P=x===void 0?{}:x,E=P.subscribe,I=E===void 0?!0:E,N=P.forceRefetch,M=P.subscriptionOptions,T=gg,A=P[T];return function(R,D){var $,L,O=t({queryArgs:C,endpointDefinition:S,endpointName:v}),B=n(($={type:"query",subscribe:I,forceRefetch:N,subscriptionOptions:M,endpointName:v,originalArgs:C,queryCacheKey:O},$[gg]=A,$)),U=i.endpoints[v].select(C),j=R(B),q=U(D()),Y=j.requestId,Z=j.abort,V=q.requestId!==Y,K=(L=a.get(R))==null?void 0:L[O],ee=function(){return U(D())},re=Object.assign(A?j.then(ee):V&&!K?Promise.resolve(q):Promise.all([K,j]).then(ee),{arg:C,requestId:Y,subscriptionOptions:M,queryCacheKey:O,abort:Z,unwrap:function(){return v1(this,null,function(){var Se;return g1(this,function(Me){switch(Me.label){case 0:return[4,re];case 1:if(Se=Me.sent(),Se.isError)throw Se.error;return[2,Se.data]}})})},refetch:function(){return R(w(C,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){I&&R(u({queryCacheKey:O,requestId:Y}))},updateSubscriptionOptions:function(Se){re.subscriptionOptions=Se,R(d({endpointName:v,requestId:Y,queryCacheKey:O,options:Se}))}});if(!K&&!V&&!A){var fe=a.get(R)||{};fe[O]=re,a.set(R,fe),re.then(function(){delete fe[O],Object.keys(fe).length||a.delete(R)})}return re}};return w}function m(v){return function(S,w){var C=w===void 0?{}:w,x=C.track,P=x===void 0?!0:x,E=C.fixedCacheKey;return function(I,N){var M=r({type:"mutation",endpointName:v,originalArgs:S,track:P,fixedCacheKey:E}),T=I(M),A=T.requestId,R=T.abort,D=T.unwrap,$=T.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),L=function(){I(c({requestId:A,fixedCacheKey:E}))},O=Object.assign($,{arg:T.arg,requestId:A,abort:R,unwrap:D,unsubscribe:L,reset:L}),B=s.get(I)||{};return s.set(I,B),B[A]=O,O.then(function(){delete B[A],Object.keys(B).length||s.delete(I)}),E&&(B[E]=O,O.then(function(){B[E]===O&&(delete B[E],Object.keys(B).length||s.delete(I))})),O}}}}function L6(e){return e}function Yae(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,a=e.api,s=e.assertTagType,l=function(v,S,w,C){return function(x,P){var E=i[v],I=o({queryArgs:S,endpointDefinition:E,endpointName:v});if(x(a.internalActions.queryResultPatched({queryCacheKey:I,patches:w})),!!C){var N=a.endpoints[v].select(S)(P()),M=VE(E.providesTags,N.data,void 0,S,{},s);x(a.internalActions.updateProvidedBy({queryCacheKey:I,providedTags:M}))}}},u=function(v,S,w,C){return C===void 0&&(C=!0),function(x,P){var E,I,N=a.endpoints[v],M=N.select(S)(P()),T={patches:[],inversePatches:[],undo:function(){return x(a.util.patchQueryData(v,S,T.inversePatches,C))}};if(M.status===Ht.uninitialized)return T;var A;if("data"in M)if(ti(M.data)){var R=nE(M.data,w),D=R[0],$=R[1],L=R[2];(E=T.patches).push.apply(E,$),(I=T.inversePatches).push.apply(I,L),A=D}else A=w(M.data),T.patches.push({op:"replace",path:[],value:A}),T.inversePatches.push({op:"replace",path:[],value:M.data});return x(a.util.patchQueryData(v,S,T.patches,C)),T}},c=function(v,S,w){return function(C){var x;return C(a.endpoints[v].initiate(S,(x={subscribe:!1,forceRefetch:!0},x[gg]=function(){return{data:w}},x)))}},d=function(v,S){return v1(t,[v,S],function(w,C){var x,P,E,I,N,M,T,A,R,D,$,L,O,B,U,j,q,Y,Z=C.signal,V=C.abort,K=C.rejectWithValue,ee=C.fulfillWithValue,re=C.dispatch,fe=C.getState,Se=C.extra;return g1(this,function(Me){switch(Me.label){case 0:x=i[w.endpointName],Me.label=1;case 1:return Me.trys.push([1,8,,13]),P=L6,E=void 0,I={signal:Z,abort:V,dispatch:re,getState:fe,extra:Se,endpoint:w.endpointName,type:w.type,forced:w.type==="query"?f(w,fe()):void 0},N=w.type==="query"?w[gg]:void 0,N?(E=N(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(w.originalArgs),I,x.extraOptions)]:[3,4];case 3:return E=Me.sent(),x.transformResponse&&(P=x.transformResponse),[3,6];case 4:return[4,x.queryFn(w.originalArgs,I,x.extraOptions,function(De){return r(De,I,x.extraOptions)})];case 5:E=Me.sent(),Me.label=6;case 6:if(typeof process<"u",E.error)throw new D6(E.error,E.meta);return $=ee,[4,P(E.data,E.meta,w.originalArgs)];case 7:return[2,$.apply(void 0,[Me.sent(),(q={fulfilledTimeStamp:Date.now(),baseQueryMeta:E.meta},q[ku]=!0,q)])];case 8:if(L=Me.sent(),O=L,!(O instanceof D6))return[3,12];B=L6,x.query&&x.transformErrorResponse&&(B=x.transformErrorResponse),Me.label=9;case 9:return Me.trys.push([9,11,,12]),U=K,[4,B(O.value,O.meta,w.originalArgs)];case 10:return[2,U.apply(void 0,[Me.sent(),(Y={baseQueryMeta:O.meta},Y[ku]=!0,Y)])];case 11:return j=Me.sent(),O=j,[3,12];case 12:throw typeof process<"u",console.error(O),O;case 13:return[2]}})})};function f(v,S){var w,C,x,P,E=(C=(w=S[n])==null?void 0:w.queries)==null?void 0:C[v.queryCacheKey],I=(x=S[n])==null?void 0:x.config.refetchOnMountOrArgChange,N=E==null?void 0:E.fulfilledTimeStamp,M=(P=v.forceRefetch)!=null?P:v.subscribe&&I;return M?M===!0||(Number(new Date)-Number(N))/1e3>=M:!1}var h=Xv(n+"/executeQuery",d,{getPendingMeta:function(){var v;return v={startedTimeStamp:Date.now()},v[ku]=!0,v},condition:function(v,S){var w=S.getState,C,x,P,E=w(),I=(x=(C=E[n])==null?void 0:C.queries)==null?void 0:x[v.queryCacheKey],N=I==null?void 0:I.fulfilledTimeStamp,M=v.originalArgs,T=I==null?void 0:I.originalArgs,A=i[v.endpointName];return C5(v)?!0:(I==null?void 0:I.status)==="pending"?!1:f(v,E)||zL(A)&&((P=A==null?void 0:A.forceRefetch)!=null&&P.call(A,{currentArg:M,previousArg:T,endpointState:I,state:E}))?!0:!N},dispatchConditionRejection:!0}),p=Xv(n+"/executeMutation",d,{getPendingMeta:function(){var v;return v={startedTimeStamp:Date.now()},v[ku]=!0,v}}),g=function(v){return"force"in v},_=function(v){return"ifOlderThan"in v},b=function(v,S,w){return function(C,x){var P=g(w)&&w.force,E=_(w)&&w.ifOlderThan,I=function(A){return A===void 0&&(A=!0),a.endpoints[v].initiate(S,{forceRefetch:A})},N=a.endpoints[v].select(S)(x());if(P)C(I());else if(E){var M=N==null?void 0:N.fulfilledTimeStamp;if(!M){C(I());return}var T=(Number(new Date)-Number(new Date(M)))/1e3>=E;T&&C(I())}else C(I(!1))}};function y(v){return function(S){var w,C;return((C=(w=S==null?void 0:S.meta)==null?void 0:w.arg)==null?void 0:C.endpointName)===v}}function m(v,S){return{matchPending:Pd(Ub(v),y(S)),matchFulfilled:Pd(Gl(v),y(S)),matchRejected:Pd(uf(v),y(S))}}return{queryThunk:h,mutationThunk:p,prefetch:b,updateQueryData:u,upsertQueryData:c,patchQueryData:l,buildMatchThunkActions:m}}function VL(e,t,n,r){return VE(n[e.meta.arg.endpointName][t],Gl(e)?e.payload:void 0,hm(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function k0(e,t,n){var r=e[t];r&&n(r)}function mg(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function F6(e,t,n){var r=e[mg(t)];r&&n(r)}var dh={};function Zae(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,a=i.apiUid,s=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,c=e.config,d=ge(t+"/resetApiState"),f=Wt({name:t+"/queries",initialState:dh,reducers:{removeQueryResult:{reducer:function(S,w){var C=w.payload.queryCacheKey;delete S[C]},prepare:jc()},queryResultPatched:{reducer:function(S,w){var C=w.payload,x=C.queryCacheKey,P=C.patches;k0(S,x,function(E){E.data=t5(E.data,P.concat())})},prepare:jc()}},extraReducers:function(S){S.addCase(n.pending,function(w,C){var x=C.meta,P=C.meta.arg,E,I,N=C5(P);(P.subscribe||N)&&((I=w[E=P.queryCacheKey])!=null||(w[E]={status:Ht.uninitialized,endpointName:P.endpointName})),k0(w,P.queryCacheKey,function(M){M.status=Ht.pending,M.requestId=N&&M.requestId?M.requestId:x.requestId,P.originalArgs!==void 0&&(M.originalArgs=P.originalArgs),M.startedTimeStamp=x.startedTimeStamp})}).addCase(n.fulfilled,function(w,C){var x=C.meta,P=C.payload;k0(w,x.arg.queryCacheKey,function(E){var I;if(!(E.requestId!==x.requestId&&!C5(x.arg))){var N=o[x.arg.endpointName].merge;if(E.status=Ht.fulfilled,N)if(E.data!==void 0){var M=x.fulfilledTimeStamp,T=x.arg,A=x.baseQueryMeta,R=x.requestId,D=Ul(E.data,function($){return N($,P,{arg:T.originalArgs,baseQueryMeta:A,fulfilledTimeStamp:M,requestId:R})});E.data=D}else E.data=P;else E.data=(I=o[x.arg.endpointName].structuralSharing)==null||I?LL(Dr(E.data)?X4(E.data):E.data,P):P;delete E.error,E.fulfilledTimeStamp=x.fulfilledTimeStamp}})}).addCase(n.rejected,function(w,C){var x=C.meta,P=x.condition,E=x.arg,I=x.requestId,N=C.error,M=C.payload;k0(w,E.queryCacheKey,function(T){if(!P){if(T.requestId!==I)return;T.status=Ht.rejected,T.error=M??N}})}).addMatcher(l,function(w,C){for(var x=s(C).queries,P=0,E=Object.entries(x);P<E.length;P++){var I=E[P],N=I[0],M=I[1];((M==null?void 0:M.status)===Ht.fulfilled||(M==null?void 0:M.status)===Ht.rejected)&&(w[N]=M)}})}}),h=Wt({name:t+"/mutations",initialState:dh,reducers:{removeMutationResult:{reducer:function(S,w){var C=w.payload,x=mg(C);x in S&&delete S[x]},prepare:jc()}},extraReducers:function(S){S.addCase(r.pending,function(w,C){var x=C.meta,P=C.meta,E=P.requestId,I=P.arg,N=P.startedTimeStamp;I.track&&(w[mg(x)]={requestId:E,status:Ht.pending,endpointName:I.endpointName,startedTimeStamp:N})}).addCase(r.fulfilled,function(w,C){var x=C.payload,P=C.meta;P.arg.track&&F6(w,P,function(E){E.requestId===P.requestId&&(E.status=Ht.fulfilled,E.data=x,E.fulfilledTimeStamp=P.fulfilledTimeStamp)})}).addCase(r.rejected,function(w,C){var x=C.payload,P=C.error,E=C.meta;E.arg.track&&F6(w,E,function(I){I.requestId===E.requestId&&(I.status=Ht.rejected,I.error=x??P)})}).addMatcher(l,function(w,C){for(var x=s(C).mutations,P=0,E=Object.entries(x);P<E.length;P++){var I=E[P],N=I[0],M=I[1];((M==null?void 0:M.status)===Ht.fulfilled||(M==null?void 0:M.status)===Ht.rejected)&&N!==(M==null?void 0:M.requestId)&&(w[N]=M)}})}}),p=Wt({name:t+"/invalidation",initialState:dh,reducers:{updateProvidedBy:{reducer:function(S,w){for(var C,x,P,E,I=w.payload,N=I.queryCacheKey,M=I.providedTags,T=0,A=Object.values(S);T<A.length;T++)for(var R=A[T],D=0,$=Object.values(R);D<$.length;D++){var L=$[D],O=L.indexOf(N);O!==-1&&L.splice(O,1)}for(var B=0,U=M;B<U.length;B++){var j=U[B],q=j.type,Y=j.id,Z=(E=(x=(C=S[q])!=null?C:S[q]={})[P=Y||"__internal_without_id"])!=null?E:x[P]=[],V=Z.includes(N);V||Z.push(N)}},prepare:jc()}},extraReducers:function(S){S.addCase(f.actions.removeQueryResult,function(w,C){for(var x=C.payload.queryCacheKey,P=0,E=Object.values(w);P<E.length;P++)for(var I=E[P],N=0,M=Object.values(I);N<M.length;N++){var T=M[N],A=T.indexOf(x);A!==-1&&T.splice(A,1)}}).addMatcher(l,function(w,C){for(var x,P,E,I,N=s(C).provided,M=0,T=Object.entries(N);M<T.length;M++)for(var A=T[M],R=A[0],D=A[1],$=0,L=Object.entries(D);$<L.length;$++)for(var O=L[$],B=O[0],U=O[1],j=(I=(P=(x=w[R])!=null?x:w[R]={})[E=B||"__internal_without_id"])!=null?I:P[E]=[],q=0,Y=U;q<Y.length;q++){var Z=Y[q],V=j.includes(Z);V||j.push(Z)}}).addMatcher(si(Gl(n),hm(n)),function(w,C){var x=VL(C,"providesTags",o,u),P=C.meta.arg.queryCacheKey;p.caseReducers.updateProvidedBy(w,p.actions.updateProvidedBy({queryCacheKey:P,providedTags:x}))})}}),g=Wt({name:t+"/subscriptions",initialState:dh,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),_=Wt({name:t+"/internalSubscriptions",initialState:dh,reducers:{subscriptionsUpdated:{reducer:function(S,w){return t5(S,w.payload)},prepare:jc()}}}),b=Wt({name:t+"/config",initialState:sn({online:Uae(),focused:Gae(),middlewareRegistered:!1},c),reducers:{middlewareRegistered:function(S,w){var C=w.payload;S.middlewareRegistered=S.middlewareRegistered==="conflict"||a!==C?"conflict":!0}},extraReducers:function(S){S.addCase(zE,function(w){w.online=!0}).addCase(BL,function(w){w.online=!1}).addCase(BE,function(w){w.focused=!0}).addCase(FL,function(w){w.focused=!1}).addMatcher(l,function(w){return sn({},w)})}}),y=Mf({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:_.reducer,config:b.reducer}),m=function(S,w){return y(d.match(w)?void 0:S,w)},v=la(sn(sn(sn(sn(sn(sn({},b.actions),f.actions),g.actions),_.actions),h.actions),p.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:m,actions:v}}var Iu=Symbol.for("RTKQ/skipToken"),jL={status:Ht.uninitialized},B6=Ul(jL,function(){}),z6=Ul(jL,function(){});function Jae(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return B6},i=function(c){return z6};return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return sn(sn({},c),Fae(c.status))}function a(c){var d=c[n];return d}function s(c,d){return function(f){var h=t({queryArgs:f,endpointDefinition:d,endpointName:c}),p=function(_){var b,y,m;return(m=(y=(b=a(_))==null?void 0:b.queries)==null?void 0:y[h])!=null?m:B6},g=f===Iu?r:p;return qn(g,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=mg(c))!=null?d:Iu:f=c;var h=function(g){var _,b,y;return(y=(b=(_=a(g))==null?void 0:_.mutations)==null?void 0:b[f])!=null?y:z6},p=f===Iu?i:h;return qn(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,g=0,_=d.map(w5);g<_.length;g++){var b=_[g],y=h.provided[b.type];if(y)for(var m=(f=b.id!==void 0?y[b.id]:R6(Object.values(y)))!=null?f:[],v=0,S=m;v<S.length;v++){var w=S[v];p.add(w)}}return R6(Array.from(p.values()).map(function(C){var x=h.queries[C];return x?[{queryCacheKey:C,endpointName:x.endpointName,originalArgs:x.originalArgs}]:[]}))}}var I0=WeakMap?new WeakMap:void 0,V6=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=I0==null?void 0:I0.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return $o(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});$o(n)&&(I0==null||I0.set(n,o)),r=o}return t+"("+r+")"};function ese(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=Kv(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=la(sn({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=V6;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:V6(la(sn({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:m1([],r.tagTypes||[])}),a={endpointDefinitions:{},batch:function(c){c()},apiUid:Vb(),extractRehydrationInfo:i,hasRehydrationInfo:Kv(function(c){return i(c)!=null})},s={injectEndpoints:u,enhanceEndpoints:function(c){var d=c.addTagTypes,f=c.endpoints;if(d)for(var h=0,p=d;h<p.length;h++){var g=p[h];o.tagTypes.includes(g)||o.tagTypes.push(g)}if(f)for(var _=0,b=Object.entries(f);_<b.length;_++){var y=b[_],m=y[0],v=y[1];typeof v=="function"?v(a.endpointDefinitions[m]):Object.assign(a.endpointDefinitions[m]||{},v)}return s}},l=e.map(function(c){return c.init(s,o,a)});function u(c){for(var d=c.endpoints({query:function(v){return la(sn({},v),{type:wa.query})},mutation:function(v){return la(sn({},v),{type:wa.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var p=h[f],g=p[0],_=p[1];if(!c.overrideExisting&&g in a.endpointDefinitions){typeof process<"u";continue}a.endpointDefinitions[g]=_;for(var b=0,y=l;b<y.length;b++){var m=y[b];m.injectEndpoint(g,_)}}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function tse(e){for(var t in e)return!1;return!0}var nse=2147483647/1e3-1,rse=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,a=o.removeQueryResult,s=o.unsubscribeQueryResult;function l(f){var h=i.currentSubscriptions[f];return!!h&&!tse(h)}var u={},c=function(f,h,p){var g;if(s.match(f)){var _=h.getState()[t],b=f.payload.queryCacheKey;d(b,(g=_.queries[b])==null?void 0:g.endpointName,h,_.config)}if(n.util.resetApiState.match(f))for(var y=0,m=Object.entries(u);y<m.length;y++){var v=m[y],S=v[0],w=v[1];w&&clearTimeout(w),delete u[S]}if(r.hasRehydrationInfo(f))for(var _=h.getState()[t],C=r.extractRehydrationInfo(f).queries,x=0,P=Object.entries(C);x<P.length;x++){var E=P[x],b=E[0],I=E[1];d(b,I==null?void 0:I.endpointName,h,_.config)}};function d(f,h,p,g){var _,b=r.endpointDefinitions[h],y=(_=b==null?void 0:b.keepUnusedDataFor)!=null?_:g.keepUnusedDataFor;if(y!==1/0){var m=Math.max(0,Math.min(y,nse));if(!l(f)){var v=u[f];v&&clearTimeout(v),u[f]=setTimeout(function(){l(f)||p.dispatch(a({queryCacheKey:f})),delete u[f]},m*1e3)}}}return c},ise=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,a=e.assertTagType,s=e.refetchQuery,l=o.internalActions.removeQueryResult,u=si(Gl(i),hm(i)),c=function(f,h){u(f)&&d(VL(f,"invalidatesTags",r,a),h),o.util.invalidateTags.match(f)&&d(VE(f.payload,void 0,void 0,void 0,void 0,a),h)};function d(f,h){var p=h.getState(),g=p[t],_=o.util.selectInvalidatedBy(p,f);n.batch(function(){for(var b,y=Array.from(_.values()),m=0,v=y;m<v.length;m++){var S=v[m].queryCacheKey,w=g.queries[S],C=(b=g.subscriptions[S])!=null?b:{};w&&(Object.keys(C).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==Ht.uninitialized&&h.dispatch(s(w,S)))}})}return c},ose=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,a={},s=function(h,p){(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&u(h.payload,p),(n.pending.match(h)||n.rejected.match(h)&&h.meta.condition)&&u(h.meta.arg,p),(n.fulfilled.match(h)||n.rejected.match(h)&&!h.meta.condition)&&l(h.meta.arg,p),r.util.resetApiState.match(h)&&d()};function l(h,p){var g=h.queryCacheKey,_=p.getState()[t],b=_.queries[g],y=o.currentSubscriptions[g];if(!(!b||b.status===Ht.uninitialized)){var m=f(y);if(Number.isFinite(m)){var v=a[g];v!=null&&v.timeout&&(clearTimeout(v.timeout),v.timeout=void 0);var S=Date.now()+m,w=a[g]={nextPollTimestamp:S,pollingInterval:m,timeout:setTimeout(function(){w.timeout=void 0,p.dispatch(i(b,g))},m)}}}}function u(h,p){var g=h.queryCacheKey,_=p.getState()[t],b=_.queries[g],y=o.currentSubscriptions[g];if(!(!b||b.status===Ht.uninitialized)){var m=f(y);if(!Number.isFinite(m)){c(g);return}var v=a[g],S=Date.now()+m;(!v||S<v.nextPollTimestamp)&&l({queryCacheKey:g},p)}}function c(h){var p=a[h];p!=null&&p.timeout&&clearTimeout(p.timeout),delete a[h]}function d(){for(var h=0,p=Object.keys(a);h<p.length;h++){var g=p[h];c(g)}}function f(h){h===void 0&&(h={});var p=Number.POSITIVE_INFINITY;for(var g in h)h[g].pollingInterval&&(p=Math.min(h[g].pollingInterval,p));return p}return s},ase=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,a=r.internalActions.removeQueryResult,s=function(u,c){BE.match(u)&&l(c,"refetchOnFocus"),zE.match(u)&&l(c,"refetchOnReconnect")};function l(u,c){var d=u.getState()[t],f=d.queries,h=o.currentSubscriptions;n.batch(function(){for(var p=0,g=Object.keys(h);p<g.length;p++){var _=g[p],b=f[_],y=h[_];if(!(!y||!b)){var m=Object.values(y).some(function(v){return v[c]===!0})||Object.values(y).every(function(v){return v[c]===void 0})&&d.config[c];m&&(Object.keys(y).length===0?u.dispatch(a({queryCacheKey:_})):b.status!==Ht.uninitialized&&u.dispatch(i(b,_)))}}})}return s},j6=new Error("Promise never resolved before cacheEntryRemoved."),sse=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var a=Qv(i),s=Qv(o),l=Gl(i,o),u={},c=function(h,p,g){var _=d(h);if(i.pending.match(h)){var b=g[n].queries[_],y=p.getState()[n].queries[_];!b&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(o.pending.match(h)){var y=p.getState()[n].mutations[_];y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(l(h)){var m=u[_];m!=null&&m.valueResolved&&(m.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete m.valueResolved)}else if(t.internalActions.removeQueryResult.match(h)||t.internalActions.removeMutationResult.match(h)){var m=u[_];m&&(delete u[_],m.cacheEntryRemoved())}else if(t.util.resetApiState.match(h))for(var v=0,S=Object.entries(u);v<S.length;v++){var w=S[v],C=w[0],m=w[1];delete u[C],m.cacheEntryRemoved()}};function d(h){return a(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.requestId:t.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:t.internalActions.removeMutationResult.match(h)?mg(h.payload):""}function f(h,p,g,_,b){var y=r.endpointDefinitions[h],m=y==null?void 0:y.onCacheEntryAdded;if(m){var v={},S=new Promise(function(I){v.cacheEntryRemoved=I}),w=Promise.race([new Promise(function(I){v.valueResolved=I}),S.then(function(){throw j6})]);w.catch(function(){}),u[g]=v;var C=t.endpoints[h].select(y.type===wa.query?p:g),x=_.dispatch(function(I,N,M){return M}),P=la(sn({},_),{getCacheEntry:function(){return C(_.getState())},requestId:b,extra:x,updateCachedData:y.type===wa.query?function(I){return _.dispatch(t.util.updateQueryData(h,p,I))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),E=m(p,P);Promise.resolve(E).catch(function(I){if(I!==j6)throw I})}}return c},lse=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=Ub(r,i),a=uf(r,i),s=Gl(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var g=c.meta,_=g.requestId,b=g.arg,y=b.endpointName,m=b.originalArgs,v=n.endpointDefinitions[y],S=v==null?void 0:v.onQueryStarted;if(S){var w={},C=new Promise(function(A,R){w.resolve=A,w.reject=R});C.catch(function(){}),l[_]=w;var x=t.endpoints[y].select(v.type===wa.query?m:_),P=d.dispatch(function(A,R,D){return D}),E=la(sn({},d),{getCacheEntry:function(){return x(d.getState())},requestId:_,extra:P,updateCachedData:v.type===wa.query?function(A){return d.dispatch(t.util.updateQueryData(y,m,A))}:void 0,queryFulfilled:C});S(m,E)}}else if(s(c)){var I=c.meta,_=I.requestId,N=I.baseQueryMeta;(f=l[_])==null||f.resolve({data:c.payload,meta:N}),delete l[_]}else if(a(c)){var M=c.meta,_=M.requestId,T=M.rejectedWithValue,N=M.baseQueryMeta;(p=l[_])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!T,meta:N}),delete l[_]}};return u},use=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var a,s;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},U6,cse=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(U6||(U6=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},dse=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,a=!1,s=t.internalActions,l=s.updateSubscriptionOptions,u=s.unsubscribeQueryResult,c=function(d,f){var h,p,g,_,b,y,m,v,S;if(l.match(f)){var w=f.payload,C=w.queryCacheKey,x=w.requestId,P=w.options;return(h=d==null?void 0:d[C])!=null&&h[x]&&(d[C][x]=P),!0}if(u.match(f)){var E=f.payload,C=E.queryCacheKey,x=E.requestId;return d[C]&&delete d[C][x],!0}if(t.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(n.pending.match(f)){var I=f.meta,N=I.arg,x=I.requestId;if(N.subscribe){var M=(g=d[p=N.queryCacheKey])!=null?g:d[p]={};return M[x]=(b=(_=N.subscriptionOptions)!=null?_:M[x])!=null?b:{},!0}}if(n.rejected.match(f)){var T=f.meta,A=T.condition,N=T.arg,x=T.requestId;if(A&&N.subscribe){var M=(m=d[y=N.queryCacheKey])!=null?m:d[y]={};return M[x]=(S=(v=N.subscriptionOptions)!=null?v:M[x])!=null?S:{},!0}}return!1};return function(d,f){var h,p;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(d))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(d)){var g=d.payload,_=g.queryCacheKey,b=g.requestId,y=!!((h=r.currentSubscriptions[_])!=null&&h[b]);return[!1,y]}var m=c(r.currentSubscriptions,d);if(m){a||(cse(function(){var C=JSON.parse(JSON.stringify(r.currentSubscriptions)),x=nE(o,function(){return C}),P=x[1];f.next(t.internalActions.subscriptionsUpdated(P)),o=C,a=!1}),a=!0);var v=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!v&&!S;return[w,!1]}return[!0,!1]}};function fse(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,a={invalidateTags:ge(t+"/invalidateTags")},s=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(t+"/")},l=[use,rse,ise,ose,sse,lse],u=function(d){var f=!1,h={currentSubscriptions:{}},p=la(sn({},e),{internalState:h,refetchQuery:c}),g=l.map(function(y){return y(p)}),_=dse(p),b=ase(p);return function(y){return function(m){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var v=la(sn({},d),{next:y}),S=d.getState(),w=_(m,v,S),C=w[0],x=w[1],P;if(C?P=y(m):P=x,d.getState()[t]&&(b(m,v,S),s(m)||i.hasRehydrationInfo(m)))for(var E=0,I=g;E<I.length;E++){var N=I[E];N(m,v,S)}return P}}};return{middleware:u,actions:a};function c(d,f,h){return h===void 0&&(h={}),n(sn({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function $s(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,m1([e],t))}var G6=Symbol(),hse=function(){return{name:G6,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,a=t.serializeQueryArgs,s=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,c=t.refetchOnReconnect;eE();var d=function(j){return typeof process<"u",j};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:zE,onOffline:BL,onFocus:BE,onFocusLost:FL},util:{}});var f=Yae({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:a,assertTagType:d}),h=f.queryThunk,p=f.mutationThunk,g=f.patchQueryData,_=f.updateQueryData,b=f.upsertQueryData,y=f.prefetch,m=f.buildMatchThunkActions,v=Zae({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:s,reducerPath:o}}),S=v.reducer,w=v.actions;$s(e.util,{patchQueryData:g,updateQueryData:_,upsertQueryData:b,prefetch:y,resetApiState:w.resetApiState}),$s(e.internalActions,w);var C=fse({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),x=C.middleware,P=C.actions;$s(e.util,P),$s(e,{reducer:S,middleware:x});var E=Jae({serializeQueryArgs:a,reducerPath:o}),I=E.buildQuerySelector,N=E.buildMutationSelector,M=E.selectInvalidatedBy;$s(e.util,{selectInvalidatedBy:M});var T=Qae({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:a,context:n}),A=T.buildInitiateQuery,R=T.buildInitiateMutation,D=T.getRunningMutationThunk,$=T.getRunningMutationsThunk,L=T.getRunningQueriesThunk,O=T.getRunningQueryThunk,B=T.getRunningOperationPromises,U=T.removalWarning;return $s(e.util,{getRunningOperationPromises:B,getRunningOperationPromise:U,getRunningMutationThunk:D,getRunningMutationsThunk:$,getRunningQueryThunk:O,getRunningQueriesThunk:L}),{name:G6,injectEndpoint:function(j,q){var Y,Z,V=e;(Z=(Y=V.endpoints)[j])!=null||(Y[j]={}),zL(q)?$s(V.endpoints[j],{name:j,select:I(j,q),initiate:A(j,q)},m(h,j)):Kae(q)&&$s(V.endpoints[j],{name:j,select:N(),initiate:R(j)},m(p,j))}}}}},UL={exports:{}},GL={};/**
* @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 pf=k;function pse(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gse=typeof Object.is=="function"?Object.is:pse,mse=pf.useState,yse=pf.useEffect,vse=pf.useLayoutEffect,bse=pf.useDebugValue;function _se(e,t){var n=t(),r=mse({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return vse(function(){i.value=n,i.getSnapshot=t,Fx(i)&&o({inst:i})},[e,n,t]),yse(function(){return Fx(i)&&o({inst:i}),e(function(){Fx(i)&&o({inst:i})})},[e]),bse(n),n}function Fx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gse(e,n)}catch{return!0}}function Sse(e,t){return t()}var xse=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Sse:_se;GL.useSyncExternalStore=pf.useSyncExternalStore!==void 0?pf.useSyncExternalStore:xse;UL.exports=GL;var wse=UL.exports,HL={exports:{}},qL={};/**
* @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 d_=k,Cse=wse;function Ese(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tse=typeof Object.is=="function"?Object.is:Ese,Ase=Cse.useSyncExternalStore,Pse=d_.useRef,kse=d_.useEffect,Ise=d_.useMemo,Mse=d_.useDebugValue;qL.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Pse(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Ise(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var p=a.value;if(i(p,h))return d=p}return d=h}if(p=d,Tse(c,h))return p;var g=r(h);return i!==void 0&&i(p,g)?p:(c=h,d=g)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var s=Ase(e,o[0],o[1]);return kse(function(){a.hasValue=!0,a.value=s},[s]),Mse(s),s};HL.exports=qL;var WL=HL.exports;const Rse=Bl(WL);function Ose(e){e()}let KL=Ose;const $se=e=>KL=e,Nse=()=>KL,H6=Symbol.for("react-redux-context"),q6=typeof globalThis<"u"?globalThis:{};function Dse(){var e;if(!k.createContext)return{};const t=(e=q6[H6])!=null?e:q6[H6]=new Map;let n=t.get(k.createContext);return n||(n=k.createContext(null),t.set(k.createContext,n)),n}const Ml=Dse();function jE(e=Ml){return function(){return k.useContext(e)}}const XL=jE(),Lse=()=>{throw new Error("uSES not initialized!")};let QL=Lse;const Fse=e=>{QL=e},Bse=(e,t)=>e===t;function zse(e=Ml){const t=e===Ml?XL:jE(e);return function(r,i={}){const{equalityFn:o=Bse,stabilityCheck:a=void 0,noopCheck:s=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:c,stabilityCheck:d,noopCheck:f}=t();k.useRef(!0);const h=k.useCallback({[r.name](g){return r(g)}}[r.name],[r,d,a]),p=QL(u.addNestedSub,l.getState,c||l.getState,h,o);return k.useDebugValue(p),p}}const YL=zse();function b1(){return b1=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},b1.apply(this,arguments)}var ZL={exports:{}},bt={};/** @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 Wn=typeof Symbol=="function"&&Symbol.for,UE=Wn?Symbol.for("react.element"):60103,GE=Wn?Symbol.for("react.portal"):60106,f_=Wn?Symbol.for("react.fragment"):60107,h_=Wn?Symbol.for("react.strict_mode"):60108,p_=Wn?Symbol.for("react.profiler"):60114,g_=Wn?Symbol.for("react.provider"):60109,m_=Wn?Symbol.for("react.context"):60110,HE=Wn?Symbol.for("react.async_mode"):60111,y_=Wn?Symbol.for("react.concurrent_mode"):60111,v_=Wn?Symbol.for("react.forward_ref"):60112,b_=Wn?Symbol.for("react.suspense"):60113,Vse=Wn?Symbol.for("react.suspense_list"):60120,__=Wn?Symbol.for("react.memo"):60115,S_=Wn?Symbol.for("react.lazy"):60116,jse=Wn?Symbol.for("react.block"):60121,Use=Wn?Symbol.for("react.fundamental"):60117,Gse=Wn?Symbol.for("react.responder"):60118,Hse=Wn?Symbol.for("react.scope"):60119;function ki(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case UE:switch(e=e.type,e){case HE:case y_:case f_:case p_:case h_:case b_:return e;default:switch(e=e&&e.$$typeof,e){case m_:case v_:case S_:case __:case g_:return e;default:return t}}case GE:return t}}}function JL(e){return ki(e)===y_}bt.AsyncMode=HE;bt.ConcurrentMode=y_;bt.ContextConsumer=m_;bt.ContextProvider=g_;bt.Element=UE;bt.ForwardRef=v_;bt.Fragment=f_;bt.Lazy=S_;bt.Memo=__;bt.Portal=GE;bt.Profiler=p_;bt.StrictMode=h_;bt.Suspense=b_;bt.isAsyncMode=function(e){return JL(e)||ki(e)===HE};bt.isConcurrentMode=JL;bt.isContextConsumer=function(e){return ki(e)===m_};bt.isContextProvider=function(e){return ki(e)===g_};bt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===UE};bt.isForwardRef=function(e){return ki(e)===v_};bt.isFragment=function(e){return ki(e)===f_};bt.isLazy=function(e){return ki(e)===S_};bt.isMemo=function(e){return ki(e)===__};bt.isPortal=function(e){return ki(e)===GE};bt.isProfiler=function(e){return ki(e)===p_};bt.isStrictMode=function(e){return ki(e)===h_};bt.isSuspense=function(e){return ki(e)===b_};bt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===f_||e===y_||e===p_||e===h_||e===b_||e===Vse||typeof e=="object"&&e!==null&&(e.$$typeof===S_||e.$$typeof===__||e.$$typeof===g_||e.$$typeof===m_||e.$$typeof===v_||e.$$typeof===Use||e.$$typeof===Gse||e.$$typeof===Hse||e.$$typeof===jse)};bt.typeOf=ki;ZL.exports=bt;var qse=ZL.exports,eF=qse,Wse={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Kse={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tF={};tF[eF.ForwardRef]=Wse;tF[eF.Memo]=Kse;var St={};/**
* @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 qE=Symbol.for("react.element"),WE=Symbol.for("react.portal"),x_=Symbol.for("react.fragment"),w_=Symbol.for("react.strict_mode"),C_=Symbol.for("react.profiler"),E_=Symbol.for("react.provider"),T_=Symbol.for("react.context"),Xse=Symbol.for("react.server_context"),A_=Symbol.for("react.forward_ref"),P_=Symbol.for("react.suspense"),k_=Symbol.for("react.suspense_list"),I_=Symbol.for("react.memo"),M_=Symbol.for("react.lazy"),Qse=Symbol.for("react.offscreen"),nF;nF=Symbol.for("react.module.reference");function eo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case qE:switch(e=e.type,e){case x_:case C_:case w_:case P_:case k_:return e;default:switch(e=e&&e.$$typeof,e){case Xse:case T_:case A_:case M_:case I_:case E_:return e;default:return t}}case WE:return t}}}St.ContextConsumer=T_;St.ContextProvider=E_;St.Element=qE;St.ForwardRef=A_;St.Fragment=x_;St.Lazy=M_;St.Memo=I_;St.Portal=WE;St.Profiler=C_;St.StrictMode=w_;St.Suspense=P_;St.SuspenseList=k_;St.isAsyncMode=function(){return!1};St.isConcurrentMode=function(){return!1};St.isContextConsumer=function(e){return eo(e)===T_};St.isContextProvider=function(e){return eo(e)===E_};St.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===qE};St.isForwardRef=function(e){return eo(e)===A_};St.isFragment=function(e){return eo(e)===x_};St.isLazy=function(e){return eo(e)===M_};St.isMemo=function(e){return eo(e)===I_};St.isPortal=function(e){return eo(e)===WE};St.isProfiler=function(e){return eo(e)===C_};St.isStrictMode=function(e){return eo(e)===w_};St.isSuspense=function(e){return eo(e)===P_};St.isSuspenseList=function(e){return eo(e)===k_};St.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===x_||e===C_||e===w_||e===P_||e===k_||e===Qse||typeof e=="object"&&e!==null&&(e.$$typeof===M_||e.$$typeof===I_||e.$$typeof===E_||e.$$typeof===T_||e.$$typeof===A_||e.$$typeof===nF||e.getModuleId!==void 0)};St.typeOf=eo;function Yse(){const e=Nse();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 W6={notify(){},get:()=>[]};function Zse(e,t){let n,r=W6,i=0,o=!1;function a(g){c();const _=r.subscribe(g);let b=!1;return()=>{b||(b=!0,_(),d())}}function s(){r.notify()}function l(){p.onStateChange&&p.onStateChange()}function u(){return o}function c(){i++,n||(n=t?t.addNestedSub(l):e.subscribe(l),r=Yse())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=W6)}function f(){o||(o=!0,c())}function h(){o&&(o=!1,d())}const p={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:u,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return p}const Jse=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ele=Jse?k.useLayoutEffect:k.useEffect;function K6(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function _1(e,t){if(K6(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])||!K6(e[n[i]],t[n[i]]))return!1;return!0}function tle({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const a=k.useMemo(()=>{const u=Zse(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),s=k.useMemo(()=>e.getState(),[e]);ele(()=>{const{subscription:u}=a;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),s!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[a,s]);const l=t||Ml;return k.createElement(l.Provider,{value:a},n)}function rF(e=Ml){const t=e===Ml?XL:jE(e);return function(){const{store:r}=t();return r}}const iF=rF();function nle(e=Ml){const t=e===Ml?iF:rF(e);return function(){return t().dispatch}}const oF=nle();Fse(WL.useSyncExternalStoreWithSelector);$se(mi.unstable_batchedUpdates);var rle=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},ile=Object.defineProperty,ole=Object.defineProperties,ale=Object.getOwnPropertyDescriptors,X6=Object.getOwnPropertySymbols,sle=Object.prototype.hasOwnProperty,lle=Object.prototype.propertyIsEnumerable,Q6=function(e,t,n){return t in e?ile(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ba=function(e,t){for(var n in t||(t={}))sle.call(t,n)&&Q6(e,n,t[n]);if(X6)for(var r=0,i=X6(t);r<i.length;r++){var n=i[r];lle.call(t,n)&&Q6(e,n,t[n])}return e},Uy=function(e,t){return ole(e,ale(t))};function Y6(e,t,n,r){var i=k.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=k.useRef(i);return k.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var Bx=Symbol();function zx(e){var t=k.useRef(e);return k.useEffect(function(){_1(t.current,e)||(t.current=e)},[e]),_1(t.current,e)?t.current:e}var M0=WeakMap?new WeakMap:void 0,ule=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=M0==null?void 0:M0.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return $o(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});$o(n)&&(M0==null||M0.set(n,o)),r=o}return t+"("+r+")"},cle=typeof window<"u"&&window.document&&window.document.createElement?k.useLayoutEffect:k.useEffect,dle=function(e){return e},fle=function(e){return e.isUninitialized?Uy(Ba({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Ht.pending}):e};function hle(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,a=n.useStore,s=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,c=s?function(g){return g()}:k.useEffect;return{buildQueryHooks:h,buildMutationHook:p,usePrefetch:f};function d(g,_,b){if(_!=null&&_.endpointName&&g.isUninitialized){var y=_.endpointName,m=u.endpointDefinitions[y];l({queryArgs:_.originalArgs,endpointDefinition:m,endpointName:y})===l({queryArgs:b,endpointDefinition:m,endpointName:y})&&(_=void 0)}var v=g.isSuccess?g.data:_==null?void 0:_.data;v===void 0&&(v=g.data);var S=v!==void 0,w=g.isLoading,C=!S&&w,x=g.isSuccess||w&&S;return Uy(Ba({},g),{data:v,currentData:g.data,isFetching:w,isLoading:C,isSuccess:x})}function f(g,_){var b=i(),y=zx(_);return k.useCallback(function(m,v){return b(t.util.prefetch(g,m,Ba(Ba({},y),v)))},[g,b,y])}function h(g){var _=function(m,v){var S=v===void 0?{}:v,w=S.refetchOnReconnect,C=S.refetchOnFocus,x=S.refetchOnMountOrArgChange,P=S.skip,E=P===void 0?!1:P,I=S.pollingInterval,N=I===void 0?0:I,M=t.endpoints[g].initiate,T=i(),A=Y6(E?Iu:m,ule,u.endpointDefinitions[g],g),R=zx({refetchOnReconnect:w,refetchOnFocus:C,pollingInterval:N}),D=k.useRef(!1),$=k.useRef(),L=$.current||{},O=L.queryCacheKey,B=L.requestId,U=!1;if(O&&B){var j=T(t.internalActions.internal_probeSubscription({queryCacheKey:O,requestId:B}));U=!!j}var q=!U&&D.current;return c(function(){D.current=U}),c(function(){q&&($.current=void 0)},[q]),c(function(){var Y,Z=$.current;if(typeof process<"u",A===Iu){Z==null||Z.unsubscribe(),$.current=void 0;return}var V=(Y=$.current)==null?void 0:Y.subscriptionOptions;if(!Z||Z.arg!==A){Z==null||Z.unsubscribe();var K=T(M(A,{subscriptionOptions:R,forceRefetch:x}));$.current=K}else R!==V&&Z.updateSubscriptionOptions(R)},[T,M,x,A,R,q]),k.useEffect(function(){return function(){var Y;(Y=$.current)==null||Y.unsubscribe(),$.current=void 0}},[]),k.useMemo(function(){return{refetch:function(){var Y;if(!$.current)throw new Error("Cannot refetch a query that has not been started yet.");return(Y=$.current)==null?void 0:Y.refetch()}}},[])},b=function(m){var v=m===void 0?{}:m,S=v.refetchOnReconnect,w=v.refetchOnFocus,C=v.pollingInterval,x=C===void 0?0:C,P=t.endpoints[g].initiate,E=i(),I=k.useState(Bx),N=I[0],M=I[1],T=k.useRef(),A=zx({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:x});c(function(){var $,L,O=($=T.current)==null?void 0:$.subscriptionOptions;A!==O&&((L=T.current)==null||L.updateSubscriptionOptions(A))},[A]);var R=k.useRef(A);c(function(){R.current=A},[A]);var D=k.useCallback(function($,L){L===void 0&&(L=!1);var O;return r(function(){var B;(B=T.current)==null||B.unsubscribe(),T.current=O=E(P($,{subscriptionOptions:R.current,forceRefetch:!L})),M($)}),O},[E,P]);return k.useEffect(function(){return function(){var $;($=T==null?void 0:T.current)==null||$.unsubscribe()}},[]),k.useEffect(function(){N!==Bx&&!T.current&&D(N,!0)},[N,D]),k.useMemo(function(){return[D,N]},[D,N])},y=function(m,v){var S=v===void 0?{}:v,w=S.skip,C=w===void 0?!1:w,x=S.selectFromResult,P=t.endpoints[g].select,E=Y6(C?Iu:m,l,u.endpointDefinitions[g],g),I=k.useRef(),N=k.useMemo(function(){return qn([P(E),function(D,$){return $},function(D){return E}],d)},[P,E]),M=k.useMemo(function(){return x?qn([N],x):N},[N,x]),T=o(function(D){return M(D,I.current)},_1),A=a(),R=N(A.getState(),I.current);return cle(function(){I.current=R},[R]),T};return{useQueryState:y,useQuerySubscription:_,useLazyQuerySubscription:b,useLazyQuery:function(m){var v=b(m),S=v[0],w=v[1],C=y(w,Uy(Ba({},m),{skip:w===Bx})),x=k.useMemo(function(){return{lastArg:w}},[w]);return k.useMemo(function(){return[S,C,x]},[S,C,x])},useQuery:function(m,v){var S=_(m,v),w=y(m,Ba({selectFromResult:m===Iu||v!=null&&v.skip?void 0:fle},v)),C=w.data,x=w.status,P=w.isLoading,E=w.isSuccess,I=w.isError,N=w.error;return k.useDebugValue({data:C,status:x,isLoading:P,isSuccess:E,isError:I,error:N}),k.useMemo(function(){return Ba(Ba({},w),S)},[w,S])}}}function p(g){return function(_){var b=_===void 0?{}:_,y=b.selectFromResult,m=y===void 0?dle:y,v=b.fixedCacheKey,S=t.endpoints[g],w=S.select,C=S.initiate,x=i(),P=k.useState(),E=P[0],I=P[1];k.useEffect(function(){return function(){E!=null&&E.arg.fixedCacheKey||E==null||E.reset()}},[E]);var N=k.useCallback(function(Z){var V=x(C(Z,{fixedCacheKey:v}));return I(V),V},[x,C,v]),M=(E||{}).requestId,T=k.useMemo(function(){return qn([w({fixedCacheKey:v,requestId:E==null?void 0:E.requestId})],m)},[w,E,m,v]),A=o(T,_1),R=v==null?E==null?void 0:E.arg.originalArgs:void 0,D=k.useCallback(function(){r(function(){E&&I(void 0),v&&x(t.internalActions.removeMutationResult({requestId:M,fixedCacheKey:v}))})},[x,v,E,M]),$=A.endpointName,L=A.data,O=A.status,B=A.isLoading,U=A.isSuccess,j=A.isError,q=A.error;k.useDebugValue({endpointName:$,data:L,status:O,isLoading:B,isSuccess:U,isError:j,error:q});var Y=k.useMemo(function(){return Uy(Ba({},A),{originalArgs:R,reset:D})},[A,R,D]);return k.useMemo(function(){return[N,Y]},[N,Y])}}}var S1;(function(e){e.query="query",e.mutation="mutation"})(S1||(S1={}));function ple(e){return e.type===S1.query}function gle(e){return e.type===S1.mutation}function Vx(e){return e.replace(e[0],e[0].toUpperCase())}function R0(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,rle([e],t))}var mle=Symbol(),yle=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?mi.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?oF:i,a=t.useSelector,s=a===void 0?YL:a,l=t.useStore,u=l===void 0?iF:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:mle,init:function(f,h,p){var g=h.serializeQueryArgs,_=f,b=hle({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:s,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:g,context:p}),y=b.buildQueryHooks,m=b.buildMutationHook,v=b.usePrefetch;return R0(_,{usePrefetch:v}),R0(p,{batch:r}),{injectEndpoint:function(S,w){if(ple(w)){var C=y(S),x=C.useQuery,P=C.useLazyQuery,E=C.useLazyQuerySubscription,I=C.useQueryState,N=C.useQuerySubscription;R0(_.endpoints[S],{useQuery:x,useLazyQuery:P,useLazyQuerySubscription:E,useQueryState:I,useQuerySubscription:N}),f["use"+Vx(S)+"Query"]=x,f["useLazy"+Vx(S)+"Query"]=P}else if(gle(w)){var M=m(S);R0(_.endpoints[S],{useMutation:M}),f["use"+Vx(S)+"Mutation"]=M}}}}}},vle=ese(hse(),yle());const ble={"Content-Type":"application/json"};function _le(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e;let o=i.baseUrl??"";o.endsWith("/")&&(o=o.slice(0,-1));async function a(s,l){const{fetch:u=t,headers:c,body:d,params:f={},parseAs:h="json",querySerializer:p=n??Sle,bodySerializer:g=r??xle,..._}=l||{},b=wle(s,{baseUrl:o,params:f,querySerializer:p}),y=Cle(ble,e==null?void 0:e.headers,c,f.header),m={redirect:"follow",...i,..._,headers:y};d&&(m.body=g(d)),m.body instanceof FormData&&y.delete("Content-Type");const v=await u(b,m);if(v.status===204||v.headers.get("Content-Length")==="0")return v.ok?{data:{},response:v}:{error:{},response:v};if(v.ok){let w;if(h!=="stream"){const C=v.clone();w=typeof C[h]=="function"?await C[h]():await C.text()}else w=v.clone().body;return{data:w,response:v}}let S={};try{S=await v.clone().json()}catch{S=await v.clone().text()}return{error:S,response:v}}return{async GET(s,...l){return a(s,{...l[0],method:"GET"})},async PUT(s,...l){return a(s,{...l[0],method:"PUT"})},async POST(s,...l){return a(s,{...l[0],method:"POST"})},async DELETE(s,...l){return a(s,{...l[0],method:"DELETE"})},async OPTIONS(s,...l){return a(s,{...l[0],method:"OPTIONS"})},async HEAD(s,...l){return a(s,{...l[0],method:"HEAD"})},async PATCH(s,...l){return a(s,{...l[0],method:"PATCH"})},async TRACE(s,...l){return a(s,{...l[0],method:"TRACE"})}}}function Sle(e){const t=[];if(e&&typeof e=="object")for(const[n,r]of Object.entries(e)){const i=E5([n],r);i&&t.push(i)}return t.join("&")}function E5(e,t){if(t!=null){if(typeof t=="string")return`${jx(e)}=${encodeURIComponent(t)}`;if(typeof t=="number"||typeof t=="boolean")return`${jx(e)}=${String(t)}`;if(Array.isArray(t)){if(!t.length)return;const n=[];for(const r of t){const i=E5(e,r);i!==void 0&&n.push(i)}return n.join("&")}if(typeof t=="object"){if(!Object.keys(t).length)return;const n=[];for(const[r,i]of Object.entries(t))if(i!=null){const o=E5([...e,r],i);o!==void 0&&n.push(o)}return n.join("&")}return encodeURIComponent(`${jx(e)}=${String(t)}`)}}function jx(e){let t=e[0];for(const n of e.slice(1))t+=`[${n}]`;return t}function xle(e){return JSON.stringify(e)}function wle(e,t){let n=`${t.baseUrl}${e}`;if(t.params.path)for(const[i,o]of Object.entries(t.params.path))n=n.replace(`{${i}}`,encodeURIComponent(String(o)));const r=t.querySerializer(t.params.query??{});return r&&(n+=`?${r}`),n}function Cle(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)o===null?t.delete(i):o!==void 0&&t.set(i,o)}return t}const yg=Pa(),vg=Pa(),x1=Pa();_ae([yg,vg,x1],(e,t,n)=>_le({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`}));const Ele=["AppVersion","AppConfig","Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","IntermediatesCount","SessionQueueItem","SessionQueueStatus","SessionProcessorStatus","CurrentSessionQueueItem","NextSessionQueueItem","BatchStatus","InvocationCacheStatus","Model","T2IAdapterModel","MainModel","OnnxModel","VaeModel","IPAdapterModel","TextualInversionModel","ControlNetModel","LoRAModel","SDXLRefinerModel","Workflow"],kr="LIST",Tle=async(e,t,n)=>{const r=vg.get(),i=yg.get(),o=x1.get();return Wae({baseUrl:`${r??""}/api/v1`,prepareHeaders:s=>(i&&s.set("Authorization",`Bearer ${i}`),o&&s.set("project-id",o),s)})(e,t,n)},Do=vle({baseQuery:Tle,reducerPath:"api",tagTypes:Ele,endpoints:()=>({})}),Ale=e=>{const t=e?pp.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${Dn.get()}/list?${t}`:`queue/${Dn.get()}/list`},xu=Ji({selectId:e=>e.item_id,sortComparer:(e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.item_id<t.item_id?-1:e.item_id>t.item_id?1:0}),un=Do.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${Dn.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,O0(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${Dn.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${Dn.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${Dn.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,O0(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${Dn.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,O0(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${Dn.get()}/current`,method:"GET"}),providesTags:t=>{const n=["CurrentSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getNextQueueItem:e.query({query:()=>({url:`queue/${Dn.get()}/next`,method:"GET"}),providesTags:t=>{const n=["NextSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getQueueStatus:e.query({query:()=>({url:`queue/${Dn.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${Dn.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${Dn.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${Dn.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(un.util.updateQueryData("listQueueItems",void 0,o=>{xu.updateOne(o,{id:t,changes:{status:i.status,completed_at:i.completed_at,updated_at:i.updated_at}})}))}catch{}},invalidatesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id},{type:"BatchStatus",id:t.batch_id}]:[]}),cancelByBatchIds:e.mutation({query:t=>({url:`queue/${Dn.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,O0(r)}catch{}},invalidatesTags:["SessionQueueStatus","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:Ale(t),method:"GET"}),serializeQueryArgs:()=>`queue/${Dn.get()}/list`,transformResponse:t=>xu.addMany(xu.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{xu.addMany(t,xu.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:nBe,useEnqueueBatchMutation:rBe,usePauseProcessorMutation:iBe,useResumeProcessorMutation:oBe,useClearQueueMutation:aBe,usePruneQueueMutation:sBe,useGetCurrentQueueItemQuery:lBe,useGetQueueStatusQuery:uBe,useGetQueueItemQuery:cBe,useGetNextQueueItemQuery:dBe,useListQueueItemsQuery:fBe,useCancelQueueItemMutation:hBe,useGetBatchStatusQuery:pBe}=un,O0=e=>{e(un.util.updateQueryData("listQueueItems",void 0,t=>{xu.removeAll(t),t.has_more=!1})),e(wae()),e(un.endpoints.listQueueItems.initiate(void 0))},zh={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},aF={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,colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,futureLayerStates:[],isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:zh,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",batchIds:[]},sF=Wt({name:"canvas",initialState:aF,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(Ye(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!wL(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,a={width:b0(al(r,64,512),64),height:b0(al(i,64,512),64)},s={x:Rr(r/2-a.width/2,64),y:Rr(i/2-a.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const c=Mc(a);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=a,e.boundingBoxCoordinates=s,e.pastLayerStates.push(Ye(e.layerState)),e.layerState={...Ye(zh),objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.batchIds=[];const l=E0(o.width,o.height,r,i,T0),u=C0(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=hae(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Mc(n);e.scaledBoundingBoxDimensions=r}},flipBoundingBoxAxes:e=>{const[t,n]=[e.boundingBoxDimensions.width,e.boundingBoxDimensions.height],[r,i]=[e.scaledBoundingBoxDimensions.width,e.scaledBoundingBoxDimensions.height];e.boundingBoxDimensions={width:n,height:t},e.scaledBoundingBoxDimensions={width:i,height:r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=fae(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=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},canvasBatchIdAdded:(e,t)=>{e.batchIds.push(t.payload)},canvasBatchIdsReset:e=>{e.batchIds=[]},stagingAreaInitialized:(e,t)=>{const{boundingBox:n}=t.payload;e.layerState.stagingArea={boundingBox:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Ye(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(Ye(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=Ye(Ye(zh)).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Ye(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(Ye(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:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Ye(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(gae);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Ye(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Ye(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(Ye(e.layerState)),e.layerState=Ye(zh),e.futureLayerStates=[],e.batchIds=[]},canvasResized:(e,t)=>{const{width:n,height:r}=t.payload,i={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=i,!e.layerState.objects.find(pae)){const o=E0(i.width,i.height,512,512,T0),a=C0(i.width,i.height,0,0,512,512,o),s={width:512,height:512};if(e.stageScale=o,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,e.boundingBoxScaleMethod==="auto"){const l=Mc(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const c=r?1:E0(i,o,l,u,T0),d=C0(i,o,a,s,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=E0(i,o,512,512,T0),d=C0(i,o,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=Mc(f);e.scaledBoundingBoxDimensions=h}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex+1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t>n?0:t},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex-1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t<0?n:t},commitStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Ye(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea=Ye(zh).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:b0(al(o,64,512),64),height:b0(al(a,64,512),64)},l={x:Rr(o/2-s.width/2,64),y:Rr(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Mc(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Mc(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(Ye(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(o_,(t,n)=>{const r=n.payload.data.batch_status;t.batchIds.includes(r.batch_id)&&r.in_progress===0&&r.pending===0&&(t.batchIds=t.batchIds.filter(i=>i!==r.batch_id))}),e.addCase(cae,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Rr(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Rr(t.scaledBoundingBoxDimensions.width/r,64))}),e.addMatcher(un.endpoints.clearQueue.matchFulfilled,t=>{t.batchIds=[]}),e.addMatcher(un.endpoints.cancelByBatchIds.matchFulfilled,(t,n)=>{t.batchIds=t.batchIds.filter(r=>!n.meta.arg.originalArgs.batch_ids.includes(r))})}}),{addEraseRect:gBe,addFillRect:mBe,addImageToStagingArea:Ple,addLine:yBe,addPointToCurrentLine:vBe,clearCanvasHistory:bBe,clearMask:_Be,commitColorPickerColor:SBe,commitStagingAreaImage:kle,discardStagedImages:Ile,fitBoundingBoxToStage:xBe,mouseLeftCanvas:wBe,nextStagingAreaImage:CBe,prevStagingAreaImage:EBe,redo:TBe,resetCanvas:KE,resetCanvasInteractionState:ABe,resetCanvasView:PBe,setBoundingBoxCoordinates:kBe,setBoundingBoxDimensions:Z6,setBoundingBoxPreviewFill:IBe,setBoundingBoxScaleMethod:MBe,flipBoundingBoxAxes:RBe,setBrushColor:OBe,setBrushSize:$Be,setColorPickerColor:NBe,setCursorPosition:DBe,setInitialCanvasImage:lF,setIsDrawing:LBe,setIsMaskEnabled:FBe,setIsMouseOverBoundingBox:BBe,setIsMoveBoundingBoxKeyHeld:zBe,setIsMoveStageKeyHeld:VBe,setIsMovingBoundingBox:jBe,setIsMovingStage:UBe,setIsTransformingBoundingBox:GBe,setLayer:HBe,setMaskColor:qBe,setMergedCanvas:Mle,setShouldAutoSave:WBe,setShouldCropToBoundingBoxOnSave:KBe,setShouldDarkenOutsideBoundingBox:XBe,setShouldLockBoundingBox:QBe,setShouldPreserveMaskedArea:YBe,setShouldShowBoundingBox:ZBe,setShouldShowBrush:JBe,setShouldShowBrushPreview:eze,setShouldShowCanvasDebugInfo:tze,setShouldShowCheckboardTransparency:nze,setShouldShowGrid:rze,setShouldShowIntermediates:ize,setShouldShowStagingImage:oze,setShouldShowStagingOutline:aze,setShouldSnapToGrid:sze,setStageCoordinates:lze,setStageScale:uze,setTool:cze,toggleShouldLockBoundingBox:dze,toggleTool:fze,undo:hze,setScaledBoundingBoxDimensions:pze,setShouldRestrictStrokesToBox:gze,stagingAreaInitialized:Rle,setShouldAntialias:mze,canvasResized:yze,canvasBatchIdAdded:Ole,canvasBatchIdsReset:$le}=sF.actions,Nle=sF.reducer,Dle={isModalOpen:!1,imagesToChange:[]},uF=Wt({name:"changeBoardModal",initialState:Dle,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:vze,imagesToChangeSelected:bze,changeBoardReset:_ze}=uF.actions,Lle=uF.reducer,Fle={imagesToDelete:[],isModalOpen:!1},cF=Wt({name:"deleteImageModal",initialState:Fle,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:XE,imagesToDeleteSelected:Ble,imageDeletionCanceled:Sze}=cF.actions,zle=cF.reducer,QE={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},Vle=QE,dF=Wt({name:"dynamicPrompts",initialState:Vle,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=QE.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},promptsChanged:(e,t)=>{e.prompts=t.payload},parsingErrorChanged:(e,t)=>{e.parsingError=t.payload},isErrorChanged:(e,t)=>{e.isError=t.payload},isLoadingChanged:(e,t)=>{e.isLoading=t.payload},seedBehaviourChanged:(e,t)=>{e.seedBehaviour=t.payload}}}),{maxPromptsChanged:jle,maxPromptsReset:Ule,combinatorialToggled:Gle,promptsChanged:Hle,parsingErrorChanged:qle,isErrorChanged:J6,isLoadingChanged:Ux,seedBehaviourChanged:xze}=dF.actions,Wle=dF.reducer,Fn=["general"],Pr=["control","mask","user","other"],Kle=100,$0=20,Xle=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},ou=(e,t)=>{if(!e)return!1;const n=bg.selectAll(e);if(n.length<=1)return!0;const r=[],i=[];for(let o=0;o<n.length;o++){const a=n[o];a!=null&&a.starred&&r.push(a),a!=null&&a.starred||i.push(a)}if(t.starred){const o=r[r.length-1];if(!o)return!0;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}else{const o=i[i.length-1];if(!o)return!1;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}},Ni=e=>Fn.includes(e.image_category)?Fn:Pr,Lt=Ji({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:Xle(t.created_at,e.created_at)}),bg=Lt.getSelectors(),Vi=e=>`images/?${pp.stringify(e,{arrayFormat:"none"})}`,Qe=Do.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:kr}];return t&&n.push(...t.items.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllBoards:e.query({query:()=>({url:"boards/",params:{all:!0}}),providesTags:t=>{const n=[{type:"Board",id:kr}];return t&&n.push(...t.map(({board_id:r})=>({type:"Board",id:r}))),n}}),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:Vi({board_id:t??"none",categories:Fn,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),getBoardAssetsTotal:e.query({query:t=>({url:Vi({board_id:t??"none",categories:Pr,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:kr}]}),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:wze,useListAllBoardsQuery:Cze,useGetBoardImagesTotalQuery:Eze,useGetBoardAssetsTotalQuery:Tze,useCreateBoardMutation:Aze,useUpdateBoardMutation:Pze,useListAllImageNamesForBoardQuery:kze}=Qe;var fF={},R_={},O_={};Object.defineProperty(O_,"__esModule",{value:!0});O_.createLogMethods=void 0;var Qle=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)}};O_.createLogMethods=Qle;var YE={},$_={};Object.defineProperty($_,"__esModule",{value:!0});$_.boolean=void 0;const Yle=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}};$_.boolean=Yle;var N_={};Object.defineProperty(N_,"__esModule",{value:!0});N_.isBooleanable=void 0;const Zle=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}};N_.isBooleanable=Zle;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=$_;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=N_;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(YE);var eI=Object.prototype.toString,hF=function(t){var n=eI.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&eI.call(t.callee)==="[object Function]"),r},Gx,tI;function Jle(){if(tI)return Gx;tI=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=hF,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var h=f.constructor;return h&&h.prototype===f},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},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&t.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),d=function(f){if(typeof window>"u"||!c)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",g=n.call(h)==="[object Function]",_=r(h),b=p&&n.call(h)==="[object String]",y=[];if(!p&&!g&&!_)throw new TypeError("Object.keys called on a non-object");var m=a&&g;if(b&&h.length>0&&!t.call(h,0))for(var v=0;v<h.length;++v)y.push(String(v));if(_&&h.length>0)for(var S=0;S<h.length;++S)y.push(String(S));else for(var w in h)!(m&&w==="prototype")&&t.call(h,w)&&y.push(String(w));if(o)for(var C=d(h),x=0;x<s.length;++x)!(C&&s[x]==="constructor")&&t.call(h,s[x])&&y.push(s[x]);return y}}return Gx=e,Gx}var eue=Array.prototype.slice,tue=hF,nI=Object.keys,Gy=nI?function(t){return nI(t)}:Jle(),rI=Object.keys;Gy.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 tue(r)?rI(eue.call(r)):rI(r)})}else Object.keys=Gy;return Object.keys||Gy};var nue=Gy,rue=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 a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0},iI=typeof Symbol<"u"&&Symbol,iue=rue,oue=function(){return typeof iI!="function"||typeof Symbol!="function"||typeof iI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:iue()},oI={foo:{}},aue=Object,sue=function(){return{__proto__:oI}.foo===oI.foo&&!({__proto__:null}instanceof aue)},lue="Function.prototype.bind called on incompatible ",Hx=Array.prototype.slice,uue=Object.prototype.toString,cue="[object Function]",due=function(t){var n=this;if(typeof n!="function"||uue.call(n)!==cue)throw new TypeError(lue+n);for(var r=Hx.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(Hx.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(Hx.call(arguments)))},a=Math.max(0,n.length-r.length),s=[],l=0;l<a;l++)s.push("$"+l);if(i=Function("binder","return function ("+s.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},fue=due,pF=Function.prototype.bind||fue,hue=pF,pue=hue.call(Function.call,Object.prototype.hasOwnProperty),We,gf=SyntaxError,gF=Function,Nd=TypeError,qx=function(e){try{return gF('"use strict"; return ('+e+").constructor;")()}catch{}},Vu=Object.getOwnPropertyDescriptor;if(Vu)try{Vu({},"")}catch{Vu=null}var Wx=function(){throw new Nd},gue=Vu?function(){try{return arguments.callee,Wx}catch{try{return Vu(arguments,"callee").get}catch{return Wx}}}():Wx,Rc=oue(),mue=sue(),Bn=Object.getPrototypeOf||(mue?function(e){return e.__proto__}:null),qc={},yue=typeof Uint8Array>"u"||!Bn?We:Bn(Uint8Array),ju={"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Rc&&Bn?Bn([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":qc,"%AsyncGenerator%":qc,"%AsyncGeneratorFunction%":qc,"%AsyncIteratorPrototype%":qc,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":gF,"%GeneratorFunction%":qc,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Rc&&Bn?Bn(Bn([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Rc||!Bn?We:Bn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Rc||!Bn?We:Bn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Rc&&Bn?Bn(""[Symbol.iterator]()):We,"%Symbol%":Rc?Symbol:We,"%SyntaxError%":gf,"%ThrowTypeError%":gue,"%TypedArray%":yue,"%TypeError%":Nd,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet};if(Bn)try{null.error}catch(e){var vue=Bn(Bn(e));ju["%Error.prototype%"]=vue}var bue=function e(t){var n;if(t==="%AsyncFunction%")n=qx("async function () {}");else if(t==="%GeneratorFunction%")n=qx("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=qx("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Bn&&(n=Bn(i.prototype))}return ju[t]=n,n},aI={"%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"]},xm=pF,w1=pue,_ue=xm.call(Function.call,Array.prototype.concat),Sue=xm.call(Function.apply,Array.prototype.splice),sI=xm.call(Function.call,String.prototype.replace),C1=xm.call(Function.call,String.prototype.slice),xue=xm.call(Function.call,RegExp.prototype.exec),wue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cue=/\\(\\)?/g,Eue=function(t){var n=C1(t,0,1),r=C1(t,-1);if(n==="%"&&r!=="%")throw new gf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new gf("invalid intrinsic syntax, expected opening `%`");var i=[];return sI(t,wue,function(o,a,s,l){i[i.length]=s?sI(l,Cue,"$1"):a||o}),i},Tue=function(t,n){var r=t,i;if(w1(aI,r)&&(i=aI[r],r="%"+i[0]+"%"),w1(ju,r)){var o=ju[r];if(o===qc&&(o=bue(r)),typeof o>"u"&&!n)throw new Nd("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new gf("intrinsic "+t+" does not exist!")},Aue=function(t,n){if(typeof t!="string"||t.length===0)throw new Nd("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Nd('"allowMissing" argument must be a boolean');if(xue(/^%?[^%]*%?$/,t)===null)throw new gf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Eue(t),i=r.length>0?r[0]:"",o=Tue("%"+i+"%",n),a=o.name,s=o.value,l=!1,u=o.alias;u&&(i=u[0],Sue(r,_ue([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=C1(f,0,1),p=C1(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new gf("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,a="%"+i+"%",w1(ju,a))s=ju[a];else if(s!=null){if(!(f in s)){if(!n)throw new Nd("base intrinsic for "+t+" exists, but the property is not available.");return}if(Vu&&c+1>=r.length){var g=Vu(s,f);d=!!g,d&&"get"in g&&!("originalValue"in g.get)?s=g.get:s=s[f]}else d=w1(s,f),s=s[f];d&&!l&&(ju[a]=s)}}return s},Pue=Aue,T5=Pue("%Object.defineProperty%",!0),A5=function(){if(T5)try{return T5({},"a",{value:1}),!0}catch{return!1}return!1};A5.hasArrayLengthDefineBug=function(){if(!A5())return null;try{return T5([],"length",{value:1}).length!==1}catch{return!0}};var kue=A5,Iue=nue,Mue=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Rue=Object.prototype.toString,Oue=Array.prototype.concat,mF=Object.defineProperty,$ue=function(e){return typeof e=="function"&&Rue.call(e)==="[object Function]"},Nue=kue(),yF=mF&&Nue,Due=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!$ue(r)||!r())return}yF?mF(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},vF=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Iue(t);Mue&&(r=Oue.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)Due(e,r[i],t[r[i]],n[r[i]])};vF.supportsDescriptors=!!yF;var bF=vF,Hy={exports:{}};typeof self<"u"?Hy.exports=self:typeof window<"u"?Hy.exports=window:Hy.exports=Function("return this")();var _F=Hy.exports,Lue=_F,SF=function(){return typeof He!="object"||!He||He.Math!==Math||He.Array!==Array?Lue:He},Fue=bF,Bue=SF,zue=function(){var t=Bue();if(Fue.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},Vue=bF,jue=_F,xF=SF,Uue=zue,Gue=xF(),wF=function(){return Gue};Vue(wF,{getPolyfill:xF,implementation:jue,shim:Uue});var Hue=wF,CF={},wm={},ZE={},D_={},L_={};Object.defineProperty(L_,"__esModule",{value:!0});L_.convertWildcardToRegex=void 0;var que=/\*+/g,Wue=function(e){return new RegExp(e.replace(que,"(.+?)"))};L_.convertWildcardToRegex=Wue;var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0});Cm.escapeRegexString=void 0;var Kue=/[$()*+.?[\\\]^{|}]/g,Xue=/-/g,Que=function(e){return e.replace(Kue,"\\$&").replace(Xue,"\\x2d")};Cm.escapeRegexString=Que;var F_={};Object.defineProperty(F_,"__esModule",{value:!0});F_.parseRegex=void 0;var Yue=/(\/?)(.+)\1([a-z]*)/,Zue=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,Jue=function(e){var t=Yue.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!Zue.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};F_.parseRegex=Jue;Object.defineProperty(D_,"__esModule",{value:!0});D_.createStringTest=void 0;var ece=L_,tce=Cm,nce=F_,Kx=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,nce.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}},rce=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 Kx(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?Kx(e,String((0,ece.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):Kx(e,"/("+(0,tce.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};D_.createStringTest=rce;var B_={};Object.defineProperty(B_,"__esModule",{value:!0});B_.testComparisonRange=void 0;var ice=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))}};B_.testComparisonRange=ice;var z_={};Object.defineProperty(z_,"__esModule",{value:!0});z_.testRange=void 0;var oce=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};z_.testRange=oce;(function(e){var t=He&&He.__assign||function(){return t=Object.assign||function(c){for(var d,f=1,h=arguments.length;f<h;f++){d=arguments[f];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},t.apply(this,arguments)},n=He&&He.__spreadArray||function(c,d,f){if(f||arguments.length===2)for(var h=0,p=d.length,g;h<p;h++)(g||!(h in d))&&(g||(g=Array.prototype.slice.call(d,0,h)),g[h]=d[h]);return c.concat(g||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=D_,i=B_,o=z_,a=function(c){if(c.type!=="Tag")throw new Error("Expected a tag expression.");var d=c.expression;if(d.type==="RangeExpression")return function(g){return(0,o.testRange)(g,d.range)};if(d.type==="EmptyExpression")return function(){return!1};var f=d.value;if(c.operator&&c.operator.operator!==":"){var h=c.operator;if(typeof f!="number")throw new TypeError("Expected a number.");return function(g){return typeof g!="number"?!1:(0,i.testComparisonRange)(f,g,h.operator)}}else{if(typeof f=="boolean")return function(g){return g===f};if(f===null)return function(g){return g===null};var p=(0,r.createStringTest)({},c);return function(g){return p(String(g))}}},s=function(c,d,f,h,p){if(Array.isArray(d)){for(var g=!1,_=0,b=0,y=d;b<y.length;b++){var m=y[b];if(s(c,m,f,n(n([],h,!0),[String(_++)],!1),p)){if(f)return!0;g=!0}}return g}else if(typeof d=="object"&&d!==null){var g=!1;for(var v in d)if(s(c,d[v],f,n(n([],h,!0),[v],!1),p)){if(f)return!0;g=!0}return g}if(c.type!=="Tag")throw new Error("Expected a tag expression.");if(!c.test)throw new Error("Expected test to be defined.");var S=c.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(c,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=a(d)),d.field.type==="ImplicitField"){var g=!1;for(var _ in c)if(s(t(t({},d),{field:{location:{end:-1,start:-1},name:_,quoted:!0,quotes:"double",type:"Field"}}),c[_],f,n(n([],h,!0),[_],!1),p)){if(f)return!0;g=!0}return g}if(d.field.name in c)return s(d,c[d.field.name],f,h,p);if(d.getValue&&d.field.path)return s(d,d.getValue(c),f,d.field.path,p);if(d.field.path){for(var b=c,y=0,m=d.field.path;y<m.length;y++){var v=m[y];if(typeof b!="object"||b===null)return!1;if(v in b)b=b[v];else return!1}return s(d,b,f,d.field.path,p)}else return!1},u=function(c,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),c.type==="Tag")return d.filter(function(y){return l(y,c,f,c.field.type==="ImplicitField"?h:n(n([],h,!0),[c.field.name],!1),p)});if(c.type==="UnaryOperator"){var g=(0,e.internalFilter)(c.operand,d,f,h,[]);return d.filter(function(y){return!g.includes(y)})}if(!c.left)throw new Error("Expected left to be defined.");var _=(0,e.internalFilter)(c.left,d,f,h,p);if(!c.right)throw new Error("Expected right to be defined.");if(c.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(c.operator.operator==="OR"){var b=(0,e.internalFilter)(c.right,d,f,h,p);return Array.from(new Set(n(n([],_,!0),b,!0)))}else if(c.operator.operator==="AND")return(0,e.internalFilter)(c.right,_,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=u})(ZE);Object.defineProperty(wm,"__esModule",{value:!0});wm.filter=void 0;var ace=ZE,sce=function(e,t){return(0,ace.internalFilter)(e,t)};wm.filter=sce;var V_={};Object.defineProperty(V_,"__esModule",{value:!0});V_.highlight=void 0;var lce=Cm,uce=ZE,cce=function(e,t){var n=[];(0,uce.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(c){return c.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,a=n;o<a.length;o++){var s=a[o];i(s)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,lce.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};V_.highlight=cce;var j_={},EF={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(He,function(){function t(u,c,d){return this.id=++t.highestId,this.name=u,this.symbols=c,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(u){var c=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+" → "+c};function n(u,c,d,f){this.rule=u,this.dot=c,this.reference=d,this.data=[],this.wantedBy=f,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 c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,a.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,d=this.wants,f=this.completed,h=0;h<c.length;h++){var p=c[h];if(p.isComplete){if(p.finish(),p.data!==a.fail){for(var g=p.wantedBy,_=g.length;_--;){var b=g[_];this.complete(b,p)}if(p.reference===this.index){var y=p.rule.name;(this.completed[y]=this.completed[y]||[]).push(p)}}}else{var y=p.rule.symbols[p.dot];if(typeof y!="string"){this.scannable.push(p);continue}if(d[y]){if(d[y].push(p),f.hasOwnProperty(y))for(var m=f[y],_=0;_<m.length;_++){var v=m[_];this.complete(p,v)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(u){for(var c=this.grammar.byName[u]||[],d=0;d<c.length;d++){var f=c[d],h=this.wants[u],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(u,c){var d=u.nextState(c);this.states.push(d)};function i(u,c){this.rules=u,this.start=c||this.rules[0].name;var d=this.byName={};this.rules.forEach(function(f){d.hasOwnProperty(f.name)||(d[f.name]=[]),d[f.name].push(f)})}i.fromCompiled=function(f,c){var d=f.Lexer;f.ParserStart&&(c=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,c);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(u,c){this.buffer=u,this.index=0,this.line=c?c.line:1,this.lastLineBreak=c?-c.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,c){var d=this.buffer;if(typeof d=="string"){var f=d.split(`
`).slice(Math.max(0,this.line-5),this.line),h=d.indexOf(`
`,this.index);h===-1&&(h=d.length);var p=this.index-this.lastLineBreak,g=String(this.line).length;return c+=" at line "+this.line+" col "+p+`:
`,c+=f.map(function(b,y){return _(this.line-f.length+y+1,g)+" "+b},this).join(`
`),c+=`
`+_("",g+p)+`^
`,c}else return c+" at index "+(this.index-1);function _(b,y){var m=String(b);return Array(y-m.length+1).join(" ")+m}};function a(u,c,d){if(u instanceof i)var f=u,d=c;else var f=i.fromCompiled(u,c);this.grammar=f,this.options={keepHistory:!1,lexer:f.lexer||new o};for(var h in d||{})this.options[h]=d[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new r(f,0);this.table=[p],p.wants[f.start]=[],p.predict(f.start),p.process(),this.current=0}a.fail={},a.prototype.feed=function(u){var c=this.lexer;c.reset(u,this.lexerState);for(var d;;){try{if(d=c.next(),!d)break}catch(C){var g=new r(this.grammar,this.current+1);this.table.push(g);var f=new Error(this.reportLexerError(C));throw f.offset=this.current,f.token=C.token,f}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,g=new r(this.grammar,p);this.table.push(g);for(var _=d.text!==void 0?d.text:d.value,b=c.constructor===o?d.value:d,y=h.scannable,m=y.length;m--;){var v=y[m],S=v.rule.symbols[v.dot];if(S.test?S.test(b):S.type?S.type===d.type:S.literal===_){var w=v.nextState({data:b,token:d,isToken:!0,reference:p-1});g.states.push(w)}}if(g.process(),g.states.length===0){var f=new Error(this.reportError(d));throw f.offset=this.current,f.token=d,f}this.options.keepHistory&&(h.lexerState=c.save()),this.current++}return h&&(this.lexerState=c.save()),this.results=this.finish(),this},a.prototype.reportLexerError=function(u){var c,d,f=u.token;return f?(c="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(c="input (lexer error)",d=u.message),this.reportErrorCommon(d,c)},a.prototype.reportError=function(u){var c=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),d=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(d,c)},a.prototype.reportErrorCommon=function(u,c){var d=[];d.push(u);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(_){var b=_.rule.symbols[_.dot];return b&&typeof b!="string"});if(p.length===0)d.push("Unexpected "+c+`. I did not expect any more input. Here is the state of my parse table:
`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+c+`. Instead, I was expecting to see one of the following:
`);var g=p.map(function(_){return this.buildFirstStateStack(_,[])||[_]},this);g.forEach(function(_){var b=_[0],y=b.rule.symbols[b.dot],m=this.getSymbolDisplay(y);d.push("A "+m+" based on:"),this.displayStateStack(_,d)},this)}return d.push(""),d.join(`
`)},a.prototype.displayStateStack=function(u,c){for(var d,f=0,h=0;h<u.length;h++){var p=u[h],g=p.rule.toString(p.dot);g===d?f++:(f>0&&c.push(" ^ "+f+" more lines identical to this"),f=0,c.push(" "+g)),d=g}},a.prototype.getSymbolDisplay=function(u){return s(u)},a.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var d=u.wantedBy[0],f=[u].concat(c),h=this.buildFirstStateStack(d,f);return h===null?null:[u].concat(h)},a.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},a.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},a.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},a.prototype.finish=function(){var u=[],c=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===c&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==a.fail&&u.push(f)}),u.map(function(f){return f.data})};function s(u){var c=typeof u;if(c==="string")return u;if(c==="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 c=typeof u;if(c==="string")return u;if(c==="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:a,Grammar:i,Rule:t}})})(EF);var dce=EF.exports,ic={},TF={},Wl={};Wl.__esModule=void 0;Wl.__esModule=!0;var fce=typeof Object.setPrototypeOf=="function",hce=typeof Object.getPrototypeOf=="function",pce=typeof Object.defineProperty=="function",gce=typeof Object.create=="function",mce=typeof Object.prototype.hasOwnProperty=="function",yce=function(t,n){fce?Object.setPrototypeOf(t,n):t.__proto__=n};Wl.setPrototypeOf=yce;var vce=function(t){return hce?Object.getPrototypeOf(t):t.__proto__||t.prototype};Wl.getPrototypeOf=vce;var lI=!1,bce=function e(t,n,r){if(pce&&!lI)try{Object.defineProperty(t,n,r)}catch{lI=!0,e(t,n,r)}else t[n]=r.value};Wl.defineProperty=bce;var AF=function(t,n){return mce?t.hasOwnProperty(t,n):t[n]===void 0};Wl.hasOwnProperty=AF;var _ce=function(t,n){if(gce)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)AF(n,o)&&(i[o]=n[o].value);return i};Wl.objectCreate=_ce;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=Wl,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,a=new Error().toString()==="[object Error]",s="";function l(u){var c=this.constructor,d=c.name||function(){var _=c.toString().match(/^function\s*([^\s(]+)/);return _===null?s||"Error":_[1]}(),f=d==="Error",h=f?s:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof c)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:c),p.stack===void 0){var g=new Error(u);g.name=p.name,p.stack=g.stack}return a&&i(p,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),p}s=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(TF);var PF=He&&He.__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(ic,"__esModule",{value:!0});ic.SyntaxError=ic.LiqeError=void 0;var Sce=TF,kF=function(e){PF(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Sce.ExtendableError);ic.LiqeError=kF;var xce=function(e){PF(t,e);function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.offset=r,a.line=i,a.column=o,a}return t}(kF);ic.SyntaxError=xce;var JE={},E1=He&&He.__assign||function(){return E1=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},E1.apply(this,arguments)};Object.defineProperty(JE,"__esModule",{value:!0});function $a(e){return e[0]}var wce={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:$a},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:$a},{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:$a},{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:$a},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:$a},{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:$a},{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:$a},{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:$a},{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,E1({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 E1({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:$a},{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"};JE.default=wce;var IF={},U_={},Em={};Object.defineProperty(Em,"__esModule",{value:!0});Em.isSafePath=void 0;var Cce=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Ece=function(e){return Cce.test(e)};Em.isSafePath=Ece;Object.defineProperty(U_,"__esModule",{value:!0});U_.createGetValueFunctionBody=void 0;var Tce=Em,Ace=function(e){if(!(0,Tce.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};U_.createGetValueFunctionBody=Ace;(function(e){var t=He&&He.__assign||function(){return t=Object.assign||function(o){for(var a,s=1,l=arguments.length;s<l;s++){a=arguments[s];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=U_,r=Em,i=function(o){var a=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(a.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(a.left=(0,e.hydrateAst)(o.left)),"right"in o&&(a.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(a.operand=(0,e.hydrateAst)(o.operand)),a};e.hydrateAst=i})(IF);var MF=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j_,"__esModule",{value:!0});j_.parse=void 0;var RF=MF(dce),Pce=ic,kce=MF(JE),Ice=IF,Mce=RF.default.Grammar.fromCompiled(kce.default),Rce=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,Oce=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new RF.default.Parser(Mce),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(Rce);throw r?new Pce.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,Ice.hydrateAst)(n[0]);return i};j_.parse=Oce;var G_={};Object.defineProperty(G_,"__esModule",{value:!0});G_.test=void 0;var $ce=wm,Nce=function(e,t){return(0,$ce.filter)(e,[t]).length===1};G_.test=Nce;var OF={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,a){return a==="double"?'"'.concat(o,'"'):a==="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 a=o.range,s=a.min,l=a.max,u=a.minInclusive,c=a.maxInclusive;return"".concat(u?"[":"{").concat(s," TO ").concat(l).concat(c?"]":"}")}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 a=o.field,s=o.expression,l=o.operator;if(a.type==="ImplicitField")return n(s);var u=a.quoted?t(a.name,a.quotes):a.name,c=" ".repeat(s.location.start-l.location.end);return u+l.operator+c+n(s)},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 a=" ".repeat(o.expression.location.start-(o.location.start+1)),s=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(a).concat((0,e.serialize)(o.expression)).concat(s,")")}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})(OF);var H_={};Object.defineProperty(H_,"__esModule",{value:!0});H_.isSafeUnquotedExpression=void 0;var Dce=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};H_.isSafeUnquotedExpression=Dce;(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=wm;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=V_;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=j_;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=G_;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=ic;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var a=OF;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return a.serialize}});var s=H_;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return s.isSafeUnquotedExpression}})})(CF);var Tm={},$F={},oc={};Object.defineProperty(oc,"__esModule",{value:!0});oc.ROARR_LOG_FORMAT_VERSION=oc.ROARR_VERSION=void 0;oc.ROARR_VERSION="5.0.0";oc.ROARR_LOG_FORMAT_VERSION="2.0.0";var Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});Nf.logLevels=void 0;Nf.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var NF={},q_={};Object.defineProperty(q_,"__esModule",{value:!0});q_.hasOwnProperty=void 0;const Lce=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);q_.hasOwnProperty=Lce;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=q_;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(NF);var W_={};Object.defineProperty(W_,"__esModule",{value:!0});W_.isBrowser=void 0;const Fce=()=>typeof window<"u";W_.isBrowser=Fce;var K_={};Object.defineProperty(K_,"__esModule",{value:!0});K_.isTruthy=void 0;const Bce=e=>["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());K_.isTruthy=Bce;var DF={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMockLogger=void 0;const t=Nf,n=(i,o)=>(a,s,l,u,c,d,f,h,p,g)=>{i.child({logLevel:o})(a,s,l,u,c,d,f,h,p,g)},r=(i,o)=>{const a=()=>{};return a.adopt=async s=>s(),a.child=()=>(0,e.createMockLogger)(i,o),a.getContext=()=>({}),a.debug=n(a,t.logLevels.debug),a.debugOnce=n(a,t.logLevels.debug),a.error=n(a,t.logLevels.error),a.errorOnce=n(a,t.logLevels.error),a.fatal=n(a,t.logLevels.fatal),a.fatalOnce=n(a,t.logLevels.fatal),a.info=n(a,t.logLevels.info),a.infoOnce=n(a,t.logLevels.info),a.trace=n(a,t.logLevels.trace),a.traceOnce=n(a,t.logLevels.trace),a.warn=n(a,t.logLevels.warn),a.warnOnce=n(a,t.logLevels.warn),a};e.createMockLogger=r})(DF);var LF={},X_={},Q_={};Object.defineProperty(Q_,"__esModule",{value:!0});Q_.tokenize=void 0;const zce=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Vce=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=zce.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const a=t[0];i=t.index+a.length,a==="\\%"||a==="%%"?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:a,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};Q_.tokenize=Vce;Object.defineProperty(X_,"__esModule",{value:!0});X_.createPrintf=void 0;const uI=YE,jce=Q_,Uce=(e,t)=>t.placeholder,Gce=e=>{var t;const n=(o,a,s)=>s==="-"?o.padEnd(a," "):s==="-+"?((Number(o)>=0?"+":"")+o).padEnd(a," "):s==="+"?((Number(o)>=0?"+":"")+o).padStart(a," "):s==="0"?o.padStart(a,"0"):o.padStart(a," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:Uce,i={};return(o,...a)=>{let s=i[o];s||(s=i[o]=jce.tokenize(o));let l="";for(const u of s)if(u.type==="literal")l+=u.literal;else{let c=a[u.position];if(c===void 0)l+=r(o,u,a);else if(u.conversion==="b")l+=uI.boolean(c)?"true":"false";else if(u.conversion==="B")l+=uI.boolean(c)?"TRUE":"FALSE";else if(u.conversion==="c")l+=c;else if(u.conversion==="C")l+=String(c).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")c=String(Math.trunc(c)),u.width!==null&&(c=n(c,u.width,u.flag)),l+=c;else if(u.conversion==="e")l+=Number(c).toExponential();else if(u.conversion==="E")l+=Number(c).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(c=Number(c).toFixed(u.precision)),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="o")l+=(Number.parseInt(String(c),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="S")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=String(c).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(c),10)>>>0;else if(u.conversion==="x")c=(Number.parseInt(String(c),10)>>>0).toString(16),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else throw new Error("Unknown format specifier.")}return l}};X_.createPrintf=Gce;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=X_;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(LF);var P5={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,t.stringify=r,t.configure=_,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(b){return b.length<5e3&&!i.test(b)?`"${b}"`:JSON.stringify(b)}function a(b){if(b.length>200)return b.sort();for(let y=1;y<b.length;y++){const m=b[y];let v=y;for(;v!==0&&b[v-1]>m;)b[v]=b[v-1],v--;b[v]=m}return b}const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(b){return s.call(b)!==void 0&&b.length!==0}function u(b,y,m){b.length<m&&(m=b.length);const v=y===","?"":" ";let S=`"0":${v}${b[0]}`;for(let w=1;w<m;w++)S+=`${y}"${w}":${v}${b[w]}`;return S}function c(b){if(n.call(b,"circularValue")){const y=b.circularValue;if(typeof y=="string")return`"${y}"`;if(y==null)return y;if(y===Error||y===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 d(b,y){let m;if(n.call(b,y)&&(m=b[y],typeof m!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return m===void 0?!0:m}function f(b,y){let m;if(n.call(b,y)){if(m=b[y],typeof m!="number")throw new TypeError(`The "${y}" argument must be of type number`);if(!Number.isInteger(m))throw new TypeError(`The "${y}" argument must be an integer`);if(m<1)throw new RangeError(`The "${y}" argument must be >= 1`)}return m===void 0?1/0:m}function h(b){return b===1?"1 item":`${b} items`}function p(b){const y=new Set;for(const m of b)(typeof m=="string"||typeof m=="number")&&y.add(String(m));return y}function g(b){if(n.call(b,"strict")){const y=b.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return m=>{let v=`Object can not safely be stringified. Received type ${typeof m}`;throw typeof m!="function"&&(v+=` (${m.toString()})`),new Error(v)}}}function _(b){b={...b};const y=g(b);y&&(b.bigint===void 0&&(b.bigint=!1),"circularValue"in b||(b.circularValue=Error));const m=c(b),v=d(b,"bigint"),S=d(b,"deterministic"),w=f(b,"maximumDepth"),C=f(b,"maximumBreadth");function x(M,T,A,R,D,$){let L=T[M];switch(typeof L=="object"&&L!==null&&typeof L.toJSON=="function"&&(L=L.toJSON(M)),L=R.call(T,M,L),typeof L){case"string":return o(L);case"object":{if(L===null)return"null";if(A.indexOf(L)!==-1)return m;let O="",B=",";const U=$;if(Array.isArray(L)){if(L.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(L),D!==""&&($+=D,O+=`
${$}`,B=`,
${$}`);const K=Math.min(L.length,C);let ee=0;for(;ee<K-1;ee++){const fe=x(String(ee),L,A,R,D,$);O+=fe!==void 0?fe:"null",O+=B}const re=x(String(ee),L,A,R,D,$);if(O+=re!==void 0?re:"null",L.length-1>C){const fe=L.length-C-1;O+=`${B}"... ${h(fe)} not stringified"`}return D!==""&&(O+=`
${U}`),A.pop(),`[${O}]`}let j=Object.keys(L);const q=j.length;if(q===0)return"{}";if(w<A.length+1)return'"[Object]"';let Y="",Z="";D!==""&&($+=D,B=`,
${$}`,Y=" ");const V=Math.min(q,C);S&&!l(L)&&(j=a(j)),A.push(L);for(let K=0;K<V;K++){const ee=j[K],re=x(ee,L,A,R,D,$);re!==void 0&&(O+=`${Z}${o(ee)}:${Y}${re}`,Z=B)}if(q>C){const K=q-C;O+=`${Z}"...":${Y}"${h(K)} not stringified"`,Z=B}return D!==""&&Z.length>1&&(O=`
${$}${O}
${U}`),A.pop(),`{${O}}`}case"number":return isFinite(L)?String(L):y?y(L):"null";case"boolean":return L===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(L);default:return y?y(L):void 0}}function P(M,T,A,R,D,$){switch(typeof T=="object"&&T!==null&&typeof T.toJSON=="function"&&(T=T.toJSON(M)),typeof T){case"string":return o(T);case"object":{if(T===null)return"null";if(A.indexOf(T)!==-1)return m;const L=$;let O="",B=",";if(Array.isArray(T)){if(T.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(T),D!==""&&($+=D,O+=`
${$}`,B=`,
${$}`);const q=Math.min(T.length,C);let Y=0;for(;Y<q-1;Y++){const V=P(String(Y),T[Y],A,R,D,$);O+=V!==void 0?V:"null",O+=B}const Z=P(String(Y),T[Y],A,R,D,$);if(O+=Z!==void 0?Z:"null",T.length-1>C){const V=T.length-C-1;O+=`${B}"... ${h(V)} not stringified"`}return D!==""&&(O+=`
${L}`),A.pop(),`[${O}]`}A.push(T);let U="";D!==""&&($+=D,B=`,
${$}`,U=" ");let j="";for(const q of R){const Y=P(q,T[q],A,R,D,$);Y!==void 0&&(O+=`${j}${o(q)}:${U}${Y}`,j=B)}return D!==""&&j.length>1&&(O=`
${$}${O}
${L}`),A.pop(),`{${O}}`}case"number":return isFinite(T)?String(T):y?y(T):"null";case"boolean":return T===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(T);default:return y?y(T):void 0}}function E(M,T,A,R,D){switch(typeof T){case"string":return o(T);case"object":{if(T===null)return"null";if(typeof T.toJSON=="function"){if(T=T.toJSON(M),typeof T!="object")return E(M,T,A,R,D);if(T===null)return"null"}if(A.indexOf(T)!==-1)return m;const $=D;if(Array.isArray(T)){if(T.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(T),D+=R;let Y=`
${D}`;const Z=`,
${D}`,V=Math.min(T.length,C);let K=0;for(;K<V-1;K++){const re=E(String(K),T[K],A,R,D);Y+=re!==void 0?re:"null",Y+=Z}const ee=E(String(K),T[K],A,R,D);if(Y+=ee!==void 0?ee:"null",T.length-1>C){const re=T.length-C-1;Y+=`${Z}"... ${h(re)} not stringified"`}return Y+=`
${$}`,A.pop(),`[${Y}]`}let L=Object.keys(T);const O=L.length;if(O===0)return"{}";if(w<A.length+1)return'"[Object]"';D+=R;const B=`,
${D}`;let U="",j="",q=Math.min(O,C);l(T)&&(U+=u(T,B,C),L=L.slice(T.length),q-=T.length,j=B),S&&(L=a(L)),A.push(T);for(let Y=0;Y<q;Y++){const Z=L[Y],V=E(Z,T[Z],A,R,D);V!==void 0&&(U+=`${j}${o(Z)}: ${V}`,j=B)}if(O>C){const Y=O-C;U+=`${j}"...": "${h(Y)} not stringified"`,j=B}return j!==""&&(U=`
${D}${U}
${$}`),A.pop(),`{${U}}`}case"number":return isFinite(T)?String(T):y?y(T):"null";case"boolean":return T===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(T);default:return y?y(T):void 0}}function I(M,T,A){switch(typeof T){case"string":return o(T);case"object":{if(T===null)return"null";if(typeof T.toJSON=="function"){if(T=T.toJSON(M),typeof T!="object")return I(M,T,A);if(T===null)return"null"}if(A.indexOf(T)!==-1)return m;let R="";if(Array.isArray(T)){if(T.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(T);const B=Math.min(T.length,C);let U=0;for(;U<B-1;U++){const q=I(String(U),T[U],A);R+=q!==void 0?q:"null",R+=","}const j=I(String(U),T[U],A);if(R+=j!==void 0?j:"null",T.length-1>C){const q=T.length-C-1;R+=`,"... ${h(q)} not stringified"`}return A.pop(),`[${R}]`}let D=Object.keys(T);const $=D.length;if($===0)return"{}";if(w<A.length+1)return'"[Object]"';let L="",O=Math.min($,C);l(T)&&(R+=u(T,",",C),D=D.slice(T.length),O-=T.length,L=","),S&&(D=a(D)),A.push(T);for(let B=0;B<O;B++){const U=D[B],j=I(U,T[U],A);j!==void 0&&(R+=`${L}${o(U)}:${j}`,L=",")}if($>C){const B=$-C;R+=`${L}"...":"${h(B)} not stringified"`}return A.pop(),`{${R}}`}case"number":return isFinite(T)?String(T):y?y(T):"null";case"boolean":return T===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(T);default:return y?y(T):void 0}}function N(M,T,A){if(arguments.length>1){let R="";if(typeof A=="number"?R=" ".repeat(Math.min(A,10)):typeof A=="string"&&(R=A.slice(0,10)),T!=null){if(typeof T=="function")return x("",{"":M},[],T,R,"");if(Array.isArray(T))return P("",M,[],p(T),R,"")}if(R.length!==0)return E("",M,[],R,"")}return I("",M,[])}return N}})(P5,P5.exports);var Hce=P5.exports;(function(e){var t=He&&He.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=oc,r=Nf,i=NF,o=W_,a=K_,s=DF,l=LF,u=t(Hce);let c=!1;const d=()=>globalThis.ROARR,f=()=>({messageContext:{},transforms:[]}),h=()=>{const v=d().asyncLocalStorage;if(!v)throw new Error("AsyncLocalContext is unavailable.");const S=v.getStore();return S||f()},p=()=>!!d().asyncLocalStorage,g=()=>{if(p()){const v=h();return(0,i.hasOwnProperty)(v,"sequenceRoot")&&(0,i.hasOwnProperty)(v,"sequence")&&typeof v.sequence=="number"?String(v.sequenceRoot)+"."+String(v.sequence++):String(d().sequence++)}return String(d().sequence++)},_=(v,S)=>(w,C,x,P,E,I,N,M,T,A)=>{v.child({logLevel:S})(w,C,x,P,E,I,N,M,T,A)},b=1e3,y=(v,S)=>(w,C,x,P,E,I,N,M,T,A)=>{const R=(0,u.default)({a:w,b:C,c:x,d:P,e:E,f:I,g:N,h:M,i:T,j:A,logLevel:S});if(!R)throw new Error("Expected key to be a string");const D=d().onceLog;D.has(R)||(D.add(R),D.size>b&&D.clear(),v.child({logLevel:S})(w,C,x,P,E,I,N,M,T,A))},m=(v,S={},w=[])=>{var C;if(!(0,o.isBrowser)()&&typeof process<"u"&&!(0,a.isTruthy)((C={}.ROARR_LOG)!==null&&C!==void 0?C:""))return(0,s.createMockLogger)(v,S);const x=(P,E,I,N,M,T,A,R,D,$)=>{const L=Date.now(),O=g();let B;p()?B=h():B=f();let U,j;if(typeof P=="string"?U={...B.messageContext,...S}:U={...B.messageContext,...S,...P},typeof P=="string"&&E===void 0)j=P;else if(typeof P=="string"){if(!P.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.");j=(0,l.printf)(P,E,I,N,M,T,A,R,D,$)}else{let Y=E;if(typeof E!="string")if(E===void 0)Y="";else throw new TypeError("Message must be a string. Received "+typeof E+".");j=(0,l.printf)(Y,I,N,M,T,A,R,D,$)}let q={context:U,message:j,sequence:O,time:L,version:n.ROARR_LOG_FORMAT_VERSION};for(const Y of[...B.transforms,...w])if(q=Y(q),typeof q!="object"||q===null)throw new Error("Message transform function must return a message object.");v(q)};return x.child=P=>{let E;return p()?E=h():E=f(),typeof P=="function"?(0,e.createLogger)(v,{...E.messageContext,...S,...P},[P,...w]):(0,e.createLogger)(v,{...E.messageContext,...S,...P},w)},x.getContext=()=>{let P;return p()?P=h():P=f(),{...P.messageContext,...S}},x.adopt=async(P,E)=>{if(!p())return c===!1&&(c=!0,v({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:g(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),P();const I=h();let N;(0,i.hasOwnProperty)(I,"sequenceRoot")&&(0,i.hasOwnProperty)(I,"sequence")&&typeof I.sequence=="number"?N=I.sequenceRoot+"."+String(I.sequence++):N=String(d().sequence++);let M={...I.messageContext};const T=[...I.transforms];typeof E=="function"?T.push(E):M={...M,...E};const A=d().asyncLocalStorage;if(!A)throw new Error("Async local context unavailable.");return A.run({messageContext:M,sequence:0,sequenceRoot:N,transforms:T},()=>P())},x.debug=_(x,r.logLevels.debug),x.debugOnce=y(x,r.logLevels.debug),x.error=_(x,r.logLevels.error),x.errorOnce=y(x,r.logLevels.error),x.fatal=_(x,r.logLevels.fatal),x.fatalOnce=y(x,r.logLevels.fatal),x.info=_(x,r.logLevels.info),x.infoOnce=y(x,r.logLevels.info),x.trace=_(x,r.logLevels.trace),x.traceOnce=y(x,r.logLevels.trace),x.warn=_(x,r.logLevels.warn),x.warnOnce=y(x,r.logLevels.warn),x};e.createLogger=m})($F);var Y_={},qce=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var a=Number(r[o]),s=Number(i[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0},Wce=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y_,"__esModule",{value:!0});Y_.createRoarrInitialGlobalStateBrowser=void 0;const cI=oc,dI=Wce(qce),Kce=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(dI.default),t.includes(cI.ROARR_VERSION)||t.push(cI.ROARR_VERSION),t.sort(dI.default),{sequence:0,...e,versions:t}};Y_.createRoarrInitialGlobalStateBrowser=Kce;var Z_={};Object.defineProperty(Z_,"__esModule",{value:!0});Z_.getLogLevelName=void 0;const Xce=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";Z_.getLogLevelName=Xce;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const t=$F,r=(0,Y_.createRoarrInitialGlobalStateBrowser)(globalThis.ROARR||{});e.ROARR=r,globalThis.ROARR=r;const i=l=>JSON.stringify(l),o=(0,t.createLogger)(l=>{var u;r.write&&r.write(((u=r.serializeMessage)!==null&&u!==void 0?u:i)(l))});e.Roarr=o;var a=Nf;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return a.logLevels}});var s=Z_;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return s.getLogLevelName}})})(Tm);var fI=He&&He.__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},Qce=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(R_,"__esModule",{value:!0});R_.createLogWriter=void 0;var Yce=O_,Zce=YE,Jce=Qce(Hue),k5=CF,hI=Tm,pI=(0,Jce.default)(),ede={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"}},tde={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},nde=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,k5.parse)(t):null},rde=function(e){var t,n,r;e===void 0&&(e={});var i=(t=e==null?void 0:e.styleOutput)!==null&&t!==void 0?t:!0,o=(n=e==null?void 0:e.storage)!==null&&n!==void 0?n:pI.localStorage,a=(r=e==null?void 0:e.logMethods)!==null&&r!==void 0?r:(0,Yce.createLogMethods)();if(!o&&!pI.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,Zce.boolean)(o.getItem("ROARR_LOG")))return function(){};var s=nde(o);return i?function(l){var u=JSON.parse(l),c=u.context,d=c.logLevel,f=c.namespace,h=fI(c,["logLevel","namespace"]);if(!(s&&!(0,k5.test)(s,u))){var p=(0,hI.getLogLevelName)(Number(d)),g=a[p],_=ede[p],b=`
background-color: `.concat(_.backgroundColor,`;
color: `).concat(_.color,`;
font-weight: bold;
`),y=`
color: `.concat(tde[p].color,`;
`),m=`
color: inherit;
`;Object.keys(h).length>0?g("%c ".concat(p," %c").concat(f?" [".concat(String(f),"]:"):"","%c ").concat(u.message," %O"),b,y,m,h):g("%c ".concat(p," %c").concat(f?" [".concat(String(f),"]:"):"","%c ").concat(u.message),b,y,m)}}:function(l){var u=JSON.parse(l),c=u.context,d=c.logLevel,f=c.namespace,h=fI(c,["logLevel","namespace"]);if(!(s&&!(0,k5.test)(s,u))){var p=(0,hI.getLogLevelName)(Number(d)),g=a[p];Object.keys(h).length>0?g("".concat(p," ").concat(f?" [".concat(String(f),"]:"):""," ").concat(u.message),h):g("".concat(p," ").concat(f?" [".concat(String(f),"]:"):""," ").concat(u.message))}}};R_.createLogWriter=rde;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=R_;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(fF);Tm.ROARR.write=fF.createLogWriter();const FF={};Tm.Roarr.child(FF);const J_=Pa(Tm.Roarr.child(FF)),se=e=>J_.get().child({namespace:e}),Ize=["trace","debug","info","warn","error","fatal"],Mze={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},BF=Pa(),zF=F.enum(["Any","BoardField","boolean","BooleanCollection","BooleanPolymorphic","ClipField","Collection","CollectionItem","ColorCollection","ColorField","ColorPolymorphic","ConditioningCollection","ConditioningField","ConditioningPolymorphic","ControlCollection","ControlField","ControlNetModelField","ControlPolymorphic","DenoiseMaskField","enum","float","FloatCollection","FloatPolymorphic","ImageCollection","ImageField","ImagePolymorphic","integer","IntegerCollection","IntegerPolymorphic","IPAdapterCollection","IPAdapterField","IPAdapterModelField","IPAdapterPolymorphic","LatentsCollection","LatentsField","LatentsPolymorphic","LoRAModelField","MainModelField","MetadataField","MetadataCollection","MetadataItemField","MetadataItemCollection","MetadataItemPolymorphic","ONNXModelField","Scheduler","SDXLMainModelField","SDXLRefinerModelField","string","StringCollection","StringPolymorphic","T2IAdapterCollection","T2IAdapterField","T2IAdapterModelField","T2IAdapterPolymorphic","UNetField","VaeField","VaeModelField"]),ide=F.enum(["WorkflowField","IsIntermediate","MetadataField"]),gI=e=>zF.safeParse(e).success||ide.safeParse(e).success;F.enum(["connection","direct","any"]);const VF=F.object({id:F.string().trim().min(1),name:F.string().trim().min(1),type:zF}),ode=VF.extend({fieldKind:F.literal("output")}),Ae=VF.extend({fieldKind:F.literal("input"),label:F.string()}),Cs=F.object({model_name:F.string().trim().min(1),base_model:ql}),Df=F.object({image_name:F.string().trim().min(1)}),ade=F.object({board_id:F.string().trim().min(1)}),T1=F.object({latents_name:F.string().trim().min(1),seed:F.number().int().optional()}),A1=F.object({conditioning_name:F.string().trim().min(1)}),sde=F.object({mask_name:F.string().trim().min(1),masked_latents_name:F.string().trim().min(1).optional()}),lde=Ae.extend({type:F.literal("integer"),value:F.number().int().optional()}),ude=Ae.extend({type:F.literal("IntegerCollection"),value:F.array(F.number().int()).optional()}),cde=Ae.extend({type:F.literal("IntegerPolymorphic"),value:F.number().int().optional()}),dde=Ae.extend({type:F.literal("float"),value:F.number().optional()}),fde=Ae.extend({type:F.literal("FloatCollection"),value:F.array(F.number()).optional()}),hde=Ae.extend({type:F.literal("FloatPolymorphic"),value:F.number().optional()}),pde=Ae.extend({type:F.literal("string"),value:F.string().optional()}),gde=Ae.extend({type:F.literal("StringCollection"),value:F.array(F.string()).optional()}),mde=Ae.extend({type:F.literal("StringPolymorphic"),value:F.string().optional()}),yde=Ae.extend({type:F.literal("boolean"),value:F.boolean().optional()}),vde=Ae.extend({type:F.literal("BooleanCollection"),value:F.array(F.boolean()).optional()}),bde=Ae.extend({type:F.literal("BooleanPolymorphic"),value:F.boolean().optional()}),_de=Ae.extend({type:F.literal("enum"),value:F.string().optional()}),Sde=Ae.extend({type:F.literal("LatentsField"),value:T1.optional()}),xde=Ae.extend({type:F.literal("LatentsCollection"),value:F.array(T1).optional()}),wde=Ae.extend({type:F.literal("LatentsPolymorphic"),value:F.union([T1,F.array(T1)]).optional()}),Cde=Ae.extend({type:F.literal("DenoiseMaskField"),value:sde.optional()}),Ede=Ae.extend({type:F.literal("ConditioningField"),value:A1.optional()}),Tde=Ae.extend({type:F.literal("ConditioningCollection"),value:F.array(A1).optional()}),Ade=Ae.extend({type:F.literal("ConditioningPolymorphic"),value:F.union([A1,F.array(A1)]).optional()}),Pde=Cs,_g=F.object({image:Df,control_model:Pde,control_weight:F.union([F.number(),F.array(F.number())]).optional(),begin_step_percent:F.number().optional(),end_step_percent:F.number().optional(),control_mode:F.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:F.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),kde=Ae.extend({type:F.literal("ControlField"),value:_g.optional()}),Ide=Ae.extend({type:F.literal("ControlPolymorphic"),value:F.union([_g,F.array(_g)]).optional()}),Mde=Ae.extend({type:F.literal("ControlCollection"),value:F.array(_g).optional()}),Rde=Cs,Sg=F.object({image:Df,ip_adapter_model:Rde,weight:F.number(),begin_step_percent:F.number().optional(),end_step_percent:F.number().optional()}),Ode=Ae.extend({type:F.literal("IPAdapterField"),value:Sg.optional()}),$de=Ae.extend({type:F.literal("IPAdapterPolymorphic"),value:F.union([Sg,F.array(Sg)]).optional()}),Nde=Ae.extend({type:F.literal("IPAdapterCollection"),value:F.array(Sg).optional()}),Dde=Cs,xg=F.object({image:Df,t2i_adapter_model:Dde,weight:F.union([F.number(),F.array(F.number())]).optional(),begin_step_percent:F.number().optional(),end_step_percent:F.number().optional(),resize_mode:F.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),Lde=Ae.extend({type:F.literal("T2IAdapterField"),value:xg.optional()}),Fde=Ae.extend({type:F.literal("T2IAdapterPolymorphic"),value:F.union([xg,F.array(xg)]).optional()}),Bde=Ae.extend({type:F.literal("T2IAdapterCollection"),value:F.array(xg).optional()}),zde=F.enum(["onnx","main","vae","lora","controlnet","embedding"]),Vde=F.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),mf=Cs.extend({model_type:zde,submodel:Vde.optional()}),jF=mf.extend({weight:F.number().optional()}),jde=F.object({unet:mf,scheduler:mf,loras:F.array(jF)}),Ude=Ae.extend({type:F.literal("UNetField"),value:jde.optional()}),Gde=F.object({tokenizer:mf,text_encoder:mf,skipped_layers:F.number(),loras:F.array(jF)}),Hde=Ae.extend({type:F.literal("ClipField"),value:Gde.optional()}),qde=F.object({vae:mf}),Wde=Ae.extend({type:F.literal("VaeField"),value:qde.optional()}),Kde=Ae.extend({type:F.literal("ImageField"),value:Df.optional()}),Xde=Ae.extend({type:F.literal("BoardField"),value:ade.optional()}),Qde=Ae.extend({type:F.literal("ImagePolymorphic"),value:Df.optional()}),Yde=Ae.extend({type:F.literal("ImageCollection"),value:F.array(Df).optional()}),Zde=Ae.extend({type:F.literal("MainModelField"),value:Sm.optional()}),Jde=Ae.extend({type:F.literal("SDXLMainModelField"),value:Sm.optional()}),efe=Ae.extend({type:F.literal("SDXLRefinerModelField"),value:Sm.optional()}),UF=Cs,tfe=Ae.extend({type:F.literal("VaeModelField"),value:UF.optional()}),GF=Cs,nfe=Ae.extend({type:F.literal("LoRAModelField"),value:GF.optional()}),rfe=Cs,ife=Ae.extend({type:F.literal("ControlNetModelField"),value:rfe.optional()}),ofe=Cs,afe=Ae.extend({type:F.literal("IPAdapterModelField"),value:ofe.optional()}),sfe=Cs,lfe=Ae.extend({type:F.literal("T2IAdapterModelField"),value:sfe.optional()}),ufe=Ae.extend({type:F.literal("Collection"),value:F.array(F.any()).optional()}),cfe=Ae.extend({type:F.literal("CollectionItem"),value:F.any().optional()}),P1=F.object({label:F.string(),value:F.any()}),dfe=Ae.extend({type:F.literal("MetadataItemField"),value:P1.optional()}),ffe=Ae.extend({type:F.literal("MetadataItemCollection"),value:F.array(P1).optional()}),hfe=Ae.extend({type:F.literal("MetadataItemPolymorphic"),value:F.union([P1,F.array(P1)]).optional()}),HF=F.record(F.any()),pfe=Ae.extend({type:F.literal("MetadataField"),value:HF.optional()}),gfe=Ae.extend({type:F.literal("MetadataCollection"),value:F.array(HF).optional()}),k1=F.object({r:F.number().int().min(0).max(255),g:F.number().int().min(0).max(255),b:F.number().int().min(0).max(255),a:F.number().int().min(0).max(255)}),mfe=Ae.extend({type:F.literal("ColorField"),value:k1.optional()}),yfe=Ae.extend({type:F.literal("ColorCollection"),value:F.array(k1).optional()}),vfe=Ae.extend({type:F.literal("ColorPolymorphic"),value:F.union([k1,F.array(k1)]).optional()}),bfe=Ae.extend({type:F.literal("Scheduler"),value:mL.optional()}),_fe=Ae.extend({type:F.literal("Any"),value:F.any().optional()}),Sfe=F.discriminatedUnion("type",[_fe,Xde,vde,yde,bde,Hde,ufe,cfe,mfe,yfe,vfe,Ede,Tde,Ade,kde,ife,Mde,Ide,Cde,_de,fde,dde,hde,Yde,Qde,Kde,ude,cde,lde,Ode,afe,Nde,$de,Sde,xde,wde,nfe,Zde,bfe,Jde,efe,gde,mde,pde,Lde,lfe,Bde,Fde,Ude,Wde,tfe,dfe,ffe,hfe,pfe,gfe]),Rze=e=>!!(e&&e.fieldKind==="input"),Oze=e=>!!(e&&e.fieldKind==="input"),N0=e=>!!(e&&!("$ref"in e)),mI=e=>!!(e&&!("$ref"in e)&&e.type==="array"),D0=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),au=e=>!!(e&&"$ref"in e),xfe=e=>"class"in e&&e.class==="invocation",wfe=e=>"class"in e&&e.class==="output",yI=e=>!("$ref"in e),qF=F.object({lora:GF.deepPartial(),weight:F.number()}),Cfe=_g.deepPartial(),Efe=Sg.deepPartial(),Tfe=xg.deepPartial(),Afe=F.object({app_version:F.string().nullish().catch(null),generation_mode:F.string().nullish().catch(null),created_by:F.string().nullish().catch(null),positive_prompt:F.string().nullish().catch(null),negative_prompt:F.string().nullish().catch(null),width:F.number().int().nullish().catch(null),height:F.number().int().nullish().catch(null),seed:F.number().int().nullish().catch(null),rand_device:F.string().nullish().catch(null),cfg_scale:F.number().nullish().catch(null),steps:F.number().int().nullish().catch(null),scheduler:F.string().nullish().catch(null),clip_skip:F.number().int().nullish().catch(null),model:F.union([u_.deepPartial(),bL.deepPartial()]).nullish().catch(null),controlnets:F.array(Cfe).nullish().catch(null),ipAdapters:F.array(Efe).nullish().catch(null),t2iAdapters:F.array(Tfe).nullish().catch(null),loras:F.array(qF).nullish().catch(null),vae:UF.nullish().catch(null),strength:F.number().nullish().catch(null),hrf_enabled:F.boolean().nullish().catch(null),hrf_strength:F.number().nullish().catch(null),hrf_method:F.string().nullish().catch(null),init_image:F.string().nullish().catch(null),positive_style_prompt:F.string().nullish().catch(null),negative_style_prompt:F.string().nullish().catch(null),refiner_model:$E.deepPartial().nullish().catch(null),refiner_cfg_scale:F.number().nullish().catch(null),refiner_steps:F.number().int().nullish().catch(null),refiner_scheduler:F.string().nullish().catch(null),refiner_positive_aesthetic_score:F.number().nullish().catch(null),refiner_negative_aesthetic_score:F.number().nullish().catch(null),refiner_start:F.number().nullish().catch(null)}).passthrough(),eT=F.string().refine(e=>{const[t,n,r]=e.split(".");return t!==void 0&&Number.isInteger(Number(t))&&n!==void 0&&Number.isInteger(Number(n))&&r!==void 0&&Number.isInteger(Number(r))}),Pfe=eT.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}}),vI=F.object({id:F.string().trim().min(1),type:F.string().trim().min(1),inputs:F.record(Sfe),outputs:F.record(ode),label:F.string(),isOpen:F.boolean(),notes:F.string(),embedWorkflow:F.boolean(),isIntermediate:F.boolean(),useCache:F.boolean().optional(),version:eT.optional()}),kfe=F.preprocess(e=>{var t;try{const n=vI.parse(e);if(!Hne(n,"useCache")){const r=(t=BF.get())==null?void 0:t.getState().nodes.nodeTemplates,i=r==null?void 0:r[n.type];let o=!0;i&&(o=i.useCache),Object.assign(n,{useCache:o})}return n}catch{return e}},vI.extend({useCache:F.boolean()})),Ife=F.object({id:F.string().trim().min(1),type:F.literal("notes"),label:F.string(),isOpen:F.boolean(),notes:F.string()}),WF=F.object({x:F.number(),y:F.number()}).default({x:0,y:0}),I1=F.number().gt(0).nullish(),KF=F.object({id:F.string().trim().min(1),type:F.literal("invocation"),data:kfe,width:I1,height:I1,position:WF}),I5=e=>KF.safeParse(e).success,Mfe=F.object({id:F.string().trim().min(1),type:F.literal("notes"),data:Ife,width:I1,height:I1,position:WF}),XF=F.discriminatedUnion("type",[KF,Mfe]),Rfe=F.object({source:F.string().trim().min(1),sourceHandle:F.string().trim().min(1),target:F.string().trim().min(1),targetHandle:F.string().trim().min(1),id:F.string().trim().min(1),type:F.literal("default")}),Ofe=F.object({source:F.string().trim().min(1),target:F.string().trim().min(1),id:F.string().trim().min(1),type:F.literal("collapsed")}),QF=F.union([Rfe,Ofe]),$fe=F.object({nodeId:F.string().trim().min(1),fieldName:F.string().trim().min(1)}),Nfe="1.0.0",Dfe=F.object({name:F.string().default(""),author:F.string().default(""),description:F.string().default(""),version:F.string().default(""),contact:F.string().default(""),tags:F.string().default(""),notes:F.string().default(""),nodes:F.array(XF).default([]),edges:F.array(QF).default([]),exposedFields:F.array($fe).default([]),meta:F.object({version:eT}).default({version:Nfe})});Dfe.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(I5),o=xE(i,"id");return n.forEach((a,s)=>{const l=o[a.source],u=o[a.target],c=[];if(l?a.type==="default"&&!(a.sourceHandle in l.data.outputs)&&c.push(`${de.t("nodes.outputField")}"${a.source}.${a.sourceHandle}" ${de.t("nodes.doesNotExist")}`):c.push(`${de.t("nodes.outputNode")} ${a.source} ${de.t("nodes.doesNotExist")}`),u?a.type==="default"&&!(a.targetHandle in u.data.inputs)&&c.push(`${de.t("nodes.inputField")} "${a.target}.${a.targetHandle}" ${de.t("nodes.doesNotExist")}`):c.push(`${de.t("nodes.inputNode")} ${a.target} ${de.t("nodes.doesNotExist")}`),c.length){delete n[s];const d=a.type==="default"?a.sourceHandle:a.source,f=a.type==="default"?a.targetHandle:a.target;r.push({message:`${de.t("nodes.edge")} "${d} -> ${f}" ${de.t("nodes.skipped")}`,issues:c,data:a})}}),{workflow:e,warnings:r}});const on=e=>!!(e&&e.type==="invocation"),$ze=e=>!!(e&&!["notes","current_image"].includes(e.type)),bI=e=>!!(e&&e.type==="notes");var wu=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(wu||{});const ce=Do.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:Vi(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:Vi({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return Vi({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Lt.addMany(Lt.getInitialState(),n)},merge:(t,n)=>{Lt.addMany(t,bg.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;bg.selectAll(i).forEach(o=>{n(ce.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:"images/intermediates"}),providesTags:["IntermediatesCount"]}),clearIntermediates:e.mutation({query:()=>({url:"images/intermediates",method:"DELETE"}),invalidatesTags:["IntermediatesCount"]}),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}],transformResponse:t=>{if(t){const n=Afe.safeParse(t);if(n.success)return n.data;se("images").warn("Problem parsing metadata")}},keepUnusedDataFor:86400}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,a=Pr.includes(t.image_category),s={board_id:o??"none",categories:Ni(t)},l=[];l.push(n(ce.util.updateQueryData("listImages",s,u=>{Lt.removeOne(u,i)}))),l.push(n(Qe.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));try{await r}catch{l.forEach(u=>{u.undo()})}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=xE(t,"image_name");i.deleted_images.forEach(a=>{const s=o[a];if(s){const l={board_id:s.board_id??"none",categories:Ni(s)};n(ce.util.updateQueryData("listImages",l,c=>{Lt.removeOne(c,a)}));const u=Pr.includes(s.image_category);n(Qe.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal",s.board_id??"none",c=>{c.total=Math.max(c.total-1,0)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[];a.push(r(ce.util.updateQueryData("getImageDTO",t.image_name,u=>{Object.assign(u,{is_intermediate:n})})));const s=Ni(t),l=Pr.includes(t.image_category);if(n)a.push(r(ce.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:s},u=>{Lt.removeOne(u,t.image_name)}))),a.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));else{a.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",p=>{p.total+=1})));const u={board_id:t.board_id??"none",categories:s},c=ce.endpoints.listImages.select(u)(o()),{data:d}=Fn.includes(t.image_category)?Qe.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=ou(c.data,t);(f||h)&&a.push(r(ce.util.updateQueryData("listImages",u,p=>{Lt.upsertOne(p,t)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i}){const o=[];o.push(r(ce.util.updateQueryData("getImageDTO",t.image_name,a=>{Object.assign(a,{session_id:n})})));try{await i}catch{o.forEach(a=>a.undo())}}}),starImages:e.mutation({query:({imageDTOs:t})=>({url:"images/star",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=Ni(r[0]),o=r[0].board_id??void 0;return[{type:"ImageList",id:Vi({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=Ni(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ce.util.updateQueryData("getImageDTO",c,_=>{_.starred=!0}));const d={board_id:l??"none",categories:s},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Fn.includes(u.image_category)?Qe.endpoints.getBoardImagesTotal.select(l??"none")(i()):Qe.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),g=((h==null?void 0:h.total)??0)>=$0?ou(f.data,u):!0;(p||g)&&n(ce.util.updateQueryData("listImages",d,_=>{Lt.upsertOne(_,{...u,starred:!0})}))})}catch{}}}),unstarImages:e.mutation({query:({imageDTOs:t})=>({url:"images/unstar",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=Ni(r[0]),o=r[0].board_id??void 0;return[{type:"ImageList",id:Vi({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=Ni(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ce.util.updateQueryData("getImageDTO",c,_=>{_.starred=!1}));const d={board_id:l??"none",categories:s},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Fn.includes(u.image_category)?Qe.endpoints.getBoardImagesTotal.select(l??"none")(i()):Qe.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),g=((h==null?void 0:h.total)??0)>=$0?ou(f.data,u):!0;(p||g)&&n(ce.util.updateQueryData("listImages",d,_=>{Lt.upsertOne(_,{...u,starred:!1})}))})}catch{}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:a})=>{const s=new FormData;return s.append("file",t),{url:"images/upload",method:"POST",body:s,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:a}}},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;if(i.is_intermediate)return;n(ce.util.upsertQueryData("getImageDTO",i.image_name,i));const o=Ni(i);n(ce.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},a=>{Lt.addOne(a,i)})),n(Qe.util.updateQueryData("getBoardAssetsTotal",i.board_id??"none",a=>{a.total+=1}))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:kr},{type:"ImageList",id:Vi({board_id:"none",categories:Fn})},{type:"ImageList",id:Vi({board_id:"none",categories:Pr})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_board_images:o}=i;o.forEach(l=>{n(ce.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))}),n(Qe.util.updateQueryData("getBoardAssetsTotal",t,l=>{l.total=0})),n(Qe.util.updateQueryData("getBoardImagesTotal",t,l=>{l.total=0}));const a=[{categories:Fn},{categories:Pr}],s=o.map(l=>({id:l,changes:{board_id:void 0}}));a.forEach(l=>{n(ce.util.updateQueryData("listImages",l,u=>{Lt.updateMany(u,s)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:kr},{type:"ImageList",id:Vi({board_id:"none",categories:Fn})},{type:"ImageList",id:Vi({board_id:"none",categories:Pr})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_images:o}=i;[{categories:Fn},{categories:Pr}].forEach(s=>{n(ce.util.updateQueryData("listImages",s,l=>{Lt.removeMany(l,o)}))}),n(Qe.util.updateQueryData("getBoardAssetsTotal",t,s=>{s.total=0})),n(Qe.util.updateQueryData("getBoardImagesTotal",t,s=>{s.total=0}))}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})=>[{type:"Board",id:r}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[],s=Ni(n),l=Pr.includes(n.image_category);if(a.push(r(ce.util.updateQueryData("getImageDTO",n.image_name,u=>{u.board_id=t}))),!n.is_intermediate){a.push(r(ce.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:s},p=>{Lt.removeOne(p,n.image_name)}))),a.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",n.board_id??"none",p=>{p.total=Math.max(p.total-1,0)}))),a.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",p=>{p.total+=1})));const u={board_id:t??"none",categories:s},c=ce.endpoints.listImages.select(u)(o()),{data:d}=Fn.includes(n.image_category)?Qe.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=ou(c.data,n);(f||h)&&a.push(r(ce.util.updateQueryData("listImages",u,p=>{Lt.addOne(p,n)})))}try{await i}catch{a.forEach(u=>u.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"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=Ni(t),a=[],s=Pr.includes(t.image_category);a.push(n(ce.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),a.push(n(ce.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Lt.removeOne(h,t.image_name)}))),a.push(n(Qe.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",h=>{h.total=Math.max(h.total-1,0)}))),a.push(n(Qe.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal","none",h=>{h.total+=1})));const l={board_id:"none",categories:o},u=ce.endpoints.listImages.select(l)(i()),{data:c}=Fn.includes(t.image_category)?Qe.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Qe.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=u.data&&u.data.ids.length>=((c==null?void 0:c.total)??0),f=ou(u.data,t);(d||f)&&a.push(n(ce.util.updateQueryData("listImages",l,h=>{Lt.upsertOne(h,t)})));try{await r}catch{a.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,{board_id:r})=>[{type:"Board",id:r??"none"}],async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:a}=await i,{added_image_names:s}=a;s.forEach(l=>{r(ce.util.updateQueryData("getImageDTO",l,y=>{y.board_id=t==="none"?void 0:t}));const u=n.find(y=>y.image_name===l);if(!u)return;const c=Ni(u),d=u.board_id,f=Pr.includes(u.image_category);r(ce.util.updateQueryData("listImages",{board_id:d??"none",categories:c},y=>{Lt.removeOne(y,u.image_name)})),r(Qe.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",d??"none",y=>{y.total=Math.max(y.total-1,0)})),r(Qe.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",y=>{y.total+=1}));const h={board_id:t,categories:c},p=ce.endpoints.listImages.select(h)(o()),{data:g}=Fn.includes(u.image_category)?Qe.endpoints.getBoardImagesTotal.select(t??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(t??"none")(o()),_=p.data&&p.data.ids.length>=((g==null?void 0:g.total)??0),b=((g==null?void 0:g.total)??0)>=$0?ou(p.data,u):!0;(_||b)&&r(ce.util.updateQueryData("listImages",h,y=>{Lt.upsertOne(y,{...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=[];return t==null||t.removed_image_names.forEach(a=>{var l;const s=(l=r.find(u=>u.image_name===a))==null?void 0:l.board_id;!s||i.includes(s)||o.push({type:"Board",id:s})}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:a}=o;a.forEach(s=>{n(ce.util.updateQueryData("getImageDTO",s,_=>{_.board_id=void 0}));const l=t.find(_=>_.image_name===s);if(!l)return;const u=Ni(l),c=Pr.includes(l.image_category);n(ce.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},_=>{Lt.removeOne(_,l.image_name)})),n(Qe.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal",l.board_id??"none",_=>{_.total=Math.max(_.total-1,0)})),n(Qe.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal","none",_=>{_.total+=1}));const d={board_id:"none",categories:u},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Fn.includes(l.image_category)?Qe.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):Qe.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),g=((h==null?void 0:h.total)??0)>=$0?ou(f.data,l):!0;(p||g)&&n(ce.util.updateQueryData("listImages",d,_=>{Lt.upsertOne(_,{...l,board_id:"none"})}))})}catch{}}}),bulkDownloadImages:e.mutation({query:({image_names:t,board_id:n})=>({url:"images/download",method:"POST",body:{image_names:t,board_id:n}})})})}),{useGetIntermediatesCountQuery:Nze,useListImagesQuery:Dze,useLazyListImagesQuery:Lze,useGetImageDTOQuery:Fze,useGetImageMetadataQuery:Bze,useDeleteImageMutation:zze,useDeleteImagesMutation:Vze,useUploadImageMutation:jze,useClearIntermediatesMutation:Uze,useAddImagesToBoardMutation:Gze,useRemoveImagesFromBoardMutation:Hze,useAddImageToBoardMutation:qze,useRemoveImageFromBoardMutation:Wze,useChangeImageIsIntermediateMutation:Kze,useChangeImageSessionIdMutation:Xze,useDeleteBoardAndImagesMutation:Qze,useDeleteBoardMutation:Yze,useStarImagesMutation:Zze,useUnstarImagesMutation:Jze,useBulkDownloadImagesMutation:eVe}=ce,YF={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},ZF=Wt({name:"gallery",initialState:YF,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=g5(t.payload,n=>n.image_name)},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.boardId,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(Ffe,(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(Qe.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:pa,shouldAutoSwitchChanged:tVe,autoAssignBoardOnClickChanged:nVe,setGalleryImageMinimumWidth:rVe,boardIdSelected:M1,autoAddBoardIdChanged:iVe,galleryViewChanged:M5,selectionChanged:JF,boardSearchTextChanged:oVe}=ZF.actions,Lfe=ZF.reducer,Ffe=si(ce.endpoints.deleteBoard.matchFulfilled,ce.endpoints.deleteBoardAndImages.matchFulfilled),_I={weight:.75},Bfe={loras:{}},eB=Wt({name:"lora",initialState:Bfe,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,..._I}},loraRecalled:(e,t)=>{const{model_name:n,id:r,base_model:i,weight:o}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,weight:o}},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=_I.weight)}}}),{loraAdded:aVe,loraRemoved:tB,loraWeightChanged:sVe,loraWeightReset:lVe,lorasCleared:uVe,loraRecalled:cVe}=eB.actions,zfe=eB.reducer;function to(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=to(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const SI=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,s),s},Vfe=e=>e?SI(e):SI,{useSyncExternalStoreWithSelector:jfe}=Rse;function nB(e,t=e.getState,n){const r=jfe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return k.useDebugValue(r),r}const xI=(e,t)=>{const n=Vfe(e),r=(i,o=t)=>nB(n,i,o);return Object.assign(r,n),r},Ufe=(e,t)=>e?xI(e,t):xI;function ii(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 Gfe={value:()=>{}};function eS(){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 qy(n)}function qy(e){this._=e}function Hfe(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}})}qy.prototype=eS.prototype={constructor:qy,on:function(e,t){var n=this._,r=Hfe(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=qfe(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=wI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=wI(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 qy(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 qfe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function wI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Gfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var R5="http://www.w3.org/1999/xhtml";const CI={svg:"http://www.w3.org/2000/svg",xhtml:R5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tS(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),CI.hasOwnProperty(t)?{space:CI[t],local:e}:e}function Wfe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===R5&&t.documentElement.namespaceURI===R5?t.createElement(e):t.createElementNS(n,e)}}function Kfe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rB(e){var t=tS(e);return(t.local?Kfe:Wfe)(t)}function Xfe(){}function tT(e){return e==null?Xfe:function(){return this.querySelector(e)}}function Qfe(e){typeof e!="function"&&(e=tT(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Ei(r,this._parents)}function Yfe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Zfe(){return[]}function iB(e){return e==null?Zfe:function(){return this.querySelectorAll(e)}}function Jfe(e){return function(){return Yfe(e.apply(this,arguments))}}function ehe(e){typeof e=="function"?e=Jfe(e):e=iB(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Ei(r,i)}function oB(e){return function(){return this.matches(e)}}function aB(e){return function(t){return t.matches(e)}}var the=Array.prototype.find;function nhe(e){return function(){return the.call(this.children,e)}}function rhe(){return this.firstElementChild}function ihe(e){return this.select(e==null?rhe:nhe(typeof e=="function"?e:aB(e)))}var ohe=Array.prototype.filter;function ahe(){return Array.from(this.children)}function she(e){return function(){return ohe.call(this.children,e)}}function lhe(e){return this.selectAll(e==null?ahe:she(typeof e=="function"?e:aB(e)))}function uhe(e){typeof e!="function"&&(e=oB(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Ei(r,this._parents)}function sB(e){return new Array(e.length)}function che(){return new Ei(this._enter||this._groups.map(sB),this._parents)}function R1(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}R1.prototype={constructor:R1,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 dhe(e){return function(){return e}}function fhe(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new R1(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function hhe(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,d=o.length,f=new Array(c),h;for(s=0;s<c;++s)(l=t[s])&&(f[s]=h=a.call(l,l.__data__,s,t)+"",u.has(h)?i[s]=l:u.set(h,l));for(s=0;s<d;++s)h=a.call(e,o[s],s,o)+"",(l=u.get(h))?(r[s]=l,l.__data__=o[s],u.delete(h)):n[s]=new R1(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function phe(e){return e.__data__}function ghe(e,t){if(!arguments.length)return Array.from(this,phe);var n=t?hhe:fhe,r=this._parents,i=this._groups;typeof e!="function"&&(e=dhe(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],f=d.length,h=mhe(e.call(c,c&&c.__data__,u,r)),p=h.length,g=s[u]=new Array(p),_=a[u]=new Array(p),b=l[u]=new Array(f);n(c,d,g,_,b,h,t);for(var y=0,m=0,v,S;y<p;++y)if(v=g[y]){for(y>=m&&(m=y+1);!(S=_[m])&&++m<p;);v._next=S||null}}return a=new Ei(a,r),a._enter=s,a._exit=l,a}function mhe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yhe(){return new Ei(this._exit||this._groups.map(sB),this._parents)}function vhe(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 bhe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],d=u.length,f=s[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<i;++l)s[l]=n[l];return new Ei(s,this._parents)}function _he(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function She(e){e||(e=xhe);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Ei(i,this._parents).order()}function xhe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function whe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Che(){return Array.from(this)}function Ehe(){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 a=r[i];if(a)return a}return null}function The(){let e=0;for(const t of this)++e;return e}function Ahe(){return!this.node()}function Phe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function khe(e){return function(){this.removeAttribute(e)}}function Ihe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Mhe(e,t){return function(){this.setAttribute(e,t)}}function Rhe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ohe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $he(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 Nhe(e,t){var n=tS(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?Ihe:khe:typeof t=="function"?n.local?$he:Ohe:n.local?Rhe:Mhe)(n,t))}function lB(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Dhe(e){return function(){this.style.removeProperty(e)}}function Lhe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Fhe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bhe(e,t,n){return arguments.length>1?this.each((t==null?Dhe:typeof t=="function"?Fhe:Lhe)(e,t,n??"")):yf(this.node(),e)}function yf(e,t){return e.style.getPropertyValue(t)||lB(e).getComputedStyle(e,null).getPropertyValue(t)}function zhe(e){return function(){delete this[e]}}function Vhe(e,t){return function(){this[e]=t}}function jhe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Uhe(e,t){return arguments.length>1?this.each((t==null?zhe:typeof t=="function"?jhe:Vhe)(e,t)):this.node()[e]}function uB(e){return e.trim().split(/^|\s+/)}function nT(e){return e.classList||new cB(e)}function cB(e){this._node=e,this._names=uB(e.getAttribute("class")||"")}cB.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 dB(e,t){for(var n=nT(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function fB(e,t){for(var n=nT(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ghe(e){return function(){dB(this,e)}}function Hhe(e){return function(){fB(this,e)}}function qhe(e,t){return function(){(t.apply(this,arguments)?dB:fB)(this,e)}}function Whe(e,t){var n=uB(e+"");if(arguments.length<2){for(var r=nT(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?qhe:t?Ghe:Hhe)(n,t))}function Khe(){this.textContent=""}function Xhe(e){return function(){this.textContent=e}}function Qhe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Yhe(e){return arguments.length?this.each(e==null?Khe:(typeof e=="function"?Qhe:Xhe)(e)):this.node().textContent}function Zhe(){this.innerHTML=""}function Jhe(e){return function(){this.innerHTML=e}}function epe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function tpe(e){return arguments.length?this.each(e==null?Zhe:(typeof e=="function"?epe:Jhe)(e)):this.node().innerHTML}function npe(){this.nextSibling&&this.parentNode.appendChild(this)}function rpe(){return this.each(npe)}function ipe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ope(){return this.each(ipe)}function ape(e){var t=typeof e=="function"?e:rB(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function spe(){return null}function lpe(e,t){var n=typeof e=="function"?e:rB(e),r=t==null?spe:typeof t=="function"?t:tT(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function upe(){var e=this.parentNode;e&&e.removeChild(this)}function cpe(){return this.each(upe)}function dpe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fpe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hpe(e){return this.select(e?fpe:dpe)}function ppe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function gpe(e){return function(t){e.call(this,t,this.__data__)}}function mpe(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 ype(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 vpe(e,t,n){return function(){var r=this.__on,i,o=gpe(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).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 bpe(e,t,n){var r=mpe(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?vpe:ype,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function hB(e,t,n){var r=lB(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 _pe(e,t){return function(){return hB(this,e,t)}}function Spe(e,t){return function(){return hB(this,e,t.apply(this,arguments))}}function xpe(e,t){return this.each((typeof t=="function"?Spe:_pe)(e,t))}function*wpe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var pB=[null];function Ei(e,t){this._groups=e,this._parents=t}function Am(){return new Ei([[document.documentElement]],pB)}function Cpe(){return this}Ei.prototype=Am.prototype={constructor:Ei,select:Qfe,selectAll:ehe,selectChild:ihe,selectChildren:lhe,filter:uhe,data:ghe,enter:che,exit:yhe,join:vhe,merge:bhe,selection:Cpe,order:_he,sort:She,call:whe,nodes:Che,node:Ehe,size:The,empty:Ahe,each:Phe,attr:Nhe,style:Bhe,property:Uhe,classed:Whe,text:Yhe,html:tpe,raise:rpe,lower:ope,append:ape,insert:lpe,remove:cpe,clone:hpe,datum:ppe,on:bpe,dispatch:xpe,[Symbol.iterator]:wpe};function So(e){return typeof e=="string"?new Ei([[document.querySelector(e)]],[document.documentElement]):new Ei([[e]],pB)}function Epe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yo(e,t){if(e=Epe(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 Tpe={passive:!1},wg={capture:!0,passive:!1};function Xx(e){e.stopImmediatePropagation()}function Dd(e){e.preventDefault(),e.stopImmediatePropagation()}function gB(e){var t=e.document.documentElement,n=So(e).on("dragstart.drag",Dd,wg);"onselectstart"in t?n.on("selectstart.drag",Dd,wg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mB(e,t){var n=e.document.documentElement,r=So(e).on("dragstart.drag",null);t&&(r.on("click.drag",Dd,wg),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 L0=e=>()=>e;function O5(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}O5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ape(e){return!e.ctrlKey&&!e.button}function Ppe(){return this.parentNode}function kpe(e,t){return t??{x:e.x,y:e.y}}function Ipe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mpe(){var e=Ape,t=Ppe,n=kpe,r=Ipe,i={},o=eS("start","drag","end"),a=0,s,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",b,Tpe).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(c||!e.call(this,v,S))){var w=m(this,t.call(this,v,S),v,S,"mouse");w&&(So(v.view).on("mousemove.drag",p,wg).on("mouseup.drag",g,wg),gB(v.view),Xx(v),u=!1,s=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(Dd(v),!u){var S=v.clientX-s,w=v.clientY-l;u=S*S+w*w>d}i.mouse("drag",v)}function g(v){So(v.view).on("mousemove.drag mouseup.drag",null),mB(v.view,u),Dd(v),i.mouse("end",v)}function _(v,S){if(e.call(this,v,S)){var w=v.changedTouches,C=t.call(this,v,S),x=w.length,P,E;for(P=0;P<x;++P)(E=m(this,C,v,S,w[P].identifier,w[P]))&&(Xx(v),E("start",v,w[P]))}}function b(v){var S=v.changedTouches,w=S.length,C,x;for(C=0;C<w;++C)(x=i[S[C].identifier])&&(Dd(v),x("drag",v,S[C]))}function y(v){var S=v.changedTouches,w=S.length,C,x;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<w;++C)(x=i[S[C].identifier])&&(Xx(v),x("end",v,S[C]))}function m(v,S,w,C,x,P){var E=o.copy(),I=Yo(P||w,S),N,M,T;if((T=n.call(v,new O5("beforestart",{sourceEvent:w,target:f,identifier:x,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:E}),C))!=null)return N=T.x-I[0]||0,M=T.y-I[1]||0,function A(R,D,$){var L=I,O;switch(R){case"start":i[x]=A,O=a++;break;case"end":delete i[x],--a;case"drag":I=Yo($||D,S),O=a;break}E.call(R,v,new O5(R,{sourceEvent:D,subject:T,target:f,identifier:x,active:O,x:I[0]+N,y:I[1]+M,dx:I[0]-L[0],dy:I[1]-L[1],dispatch:E}),C)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:L0(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:L0(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:L0(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:L0(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function rT(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yB(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Pm(){}var Cg=.7,O1=1/Cg,Ld="\\s*([+-]?\\d+)\\s*",Eg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rpe=/^#([0-9a-f]{3,8})$/,Ope=new RegExp(`^rgb\\(${Ld},${Ld},${Ld}\\)$`),$pe=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),Npe=new RegExp(`^rgba\\(${Ld},${Ld},${Ld},${Eg}\\)$`),Dpe=new RegExp(`^rgba\\(${ga},${ga},${ga},${Eg}\\)$`),Lpe=new RegExp(`^hsl\\(${Eg},${ga},${ga}\\)$`),Fpe=new RegExp(`^hsla\\(${Eg},${ga},${ga},${Eg}\\)$`),EI={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};rT(Pm,Tg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:TI,formatHex:TI,formatHex8:Bpe,formatHsl:zpe,formatRgb:AI,toString:AI});function TI(){return this.rgb().formatHex()}function Bpe(){return this.rgb().formatHex8()}function zpe(){return vB(this).formatHsl()}function AI(){return this.rgb().formatRgb()}function Tg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rpe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?PI(t):n===3?new Yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?F0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?F0(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=Ope.exec(e))?new Yr(t[1],t[2],t[3],1):(t=$pe.exec(e))?new Yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Npe.exec(e))?F0(t[1],t[2],t[3],t[4]):(t=Dpe.exec(e))?F0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lpe.exec(e))?MI(t[1],t[2]/100,t[3]/100,1):(t=Fpe.exec(e))?MI(t[1],t[2]/100,t[3]/100,t[4]):EI.hasOwnProperty(e)?PI(EI[e]):e==="transparent"?new Yr(NaN,NaN,NaN,0):null}function PI(e){return new Yr(e>>16&255,e>>8&255,e&255,1)}function F0(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yr(e,t,n,r)}function Vpe(e){return e instanceof Pm||(e=Tg(e)),e?(e=e.rgb(),new Yr(e.r,e.g,e.b,e.opacity)):new Yr}function $5(e,t,n,r){return arguments.length===1?Vpe(e):new Yr(e,t,n,r??1)}function Yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}rT(Yr,$5,yB(Pm,{brighter(e){return e=e==null?O1:Math.pow(O1,e),new Yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cg:Math.pow(Cg,e),new Yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yr(Uu(this.r),Uu(this.g),Uu(this.b),$1(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:kI,formatHex:kI,formatHex8:jpe,formatRgb:II,toString:II}));function kI(){return`#${Mu(this.r)}${Mu(this.g)}${Mu(this.b)}`}function jpe(){return`#${Mu(this.r)}${Mu(this.g)}${Mu(this.b)}${Mu((isNaN(this.opacity)?1:this.opacity)*255)}`}function II(){const e=$1(this.opacity);return`${e===1?"rgb(":"rgba("}${Uu(this.r)}, ${Uu(this.g)}, ${Uu(this.b)}${e===1?")":`, ${e})`}`}function $1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mu(e){return e=Uu(e),(e<16?"0":"")+e.toString(16)}function MI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xo(e,t,n,r)}function vB(e){if(e instanceof xo)return new xo(e.h,e.s,e.l,e.opacity);if(e instanceof Pm||(e=Tg(e)),!e)return new xo;if(e instanceof xo)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),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new xo(a,s,l,e.opacity)}function Upe(e,t,n,r){return arguments.length===1?vB(e):new xo(e,t,n,r??1)}function xo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}rT(xo,Upe,yB(Pm,{brighter(e){return e=e==null?O1:Math.pow(O1,e),new xo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cg:Math.pow(Cg,e),new xo(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 Yr(Qx(e>=240?e-240:e+120,i,r),Qx(e,i,r),Qx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new xo(RI(this.h),B0(this.s),B0(this.l),$1(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=$1(this.opacity);return`${e===1?"hsl(":"hsla("}${RI(this.h)}, ${B0(this.s)*100}%, ${B0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RI(e){return e=(e||0)%360,e<0?e+360:e}function B0(e){return Math.max(0,Math.min(1,e||0))}function Qx(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 bB=e=>()=>e;function Gpe(e,t){return function(n){return e+n*t}}function Hpe(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 qpe(e){return(e=+e)==1?_B:function(t,n){return n-t?Hpe(t,n,e):bB(isNaN(t)?n:t)}}function _B(e,t){var n=t-e;return n?Gpe(e,n):bB(isNaN(e)?t:e)}const OI=function e(t){var n=qpe(t);function r(i,o){var a=n((i=$5(i)).r,(o=$5(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=_B(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function qs(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var N5=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yx=new RegExp(N5.source,"g");function Wpe(e){return function(){return e}}function Kpe(e){return function(t){return e(t)+""}}function Xpe(e,t){var n=N5.lastIndex=Yx.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=N5.exec(e))&&(i=Yx.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:qs(r,i)})),n=Yx.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Kpe(l[0].x):Wpe(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var $I=180/Math.PI,D5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function SB(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*$I,skewX:Math.atan(l)*$I,scaleX:a,scaleY:s}}var z0;function Qpe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?D5:SB(t.a,t.b,t.c,t.d,t.e,t.f)}function Ype(e){return e==null||(z0||(z0=document.createElementNS("http://www.w3.org/2000/svg","g")),z0.setAttribute("transform",e),!(e=z0.transform.baseVal.consolidate()))?D5:(e=e.matrix,SB(e.a,e.b,e.c,e.d,e.e,e.f))}function xB(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,d,f,h,p){if(u!==d||c!==f){var g=h.push("translate(",null,t,null,n);p.push({i:g-4,x:qs(u,d)},{i:g-2,x:qs(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:qs(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:qs(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:qs(u,d)},{i:g-2,x:qs(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,g=f.length,_;++p<g;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var Zpe=xB(Qpe,"px, ","px)","deg)"),Jpe=xB(Ype,", ",")",")"),ege=1e-12;function NI(e){return((e=Math.exp(e))+1/e)/2}function tge(e){return((e=Math.exp(e))-1/e)/2}function nge(e){return((e=Math.exp(2*e))-1)/(e+1)}const rge=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],d=a[1],f=a[2],h=c-s,p=d-l,g=h*h+p*p,_,b;if(g<ege)b=Math.log(f/u)/t,_=function(C){return[s+C*h,l+C*p,u*Math.exp(t*C*b)]};else{var y=Math.sqrt(g),m=(f*f-u*u+r*g)/(2*u*n*y),v=(f*f-u*u-r*g)/(2*f*n*y),S=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(v*v+1)-v);b=(w-S)/t,_=function(C){var x=C*b,P=NI(S),E=u/(n*y)*(P*nge(t*x+S)-tge(S));return[s+E*h,l+E*p,u*P/NI(t*x+S)]}}return _.duration=b*1e3*t/Math.SQRT2,_}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var vf=0,Vh=0,fh=0,wB=1e3,N1,jh,D1=0,ac=0,nS=0,Ag=typeof performance=="object"&&performance.now?performance:Date,CB=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function iT(){return ac||(CB(ige),ac=Ag.now()+nS)}function ige(){ac=0}function L1(){this._call=this._time=this._next=null}L1.prototype=EB.prototype={constructor:L1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?iT():+n)+(t==null?0:+t),!this._next&&jh!==this&&(jh?jh._next=this:N1=this,jh=this),this._call=e,this._time=n,L5()},stop:function(){this._call&&(this._call=null,this._time=1/0,L5())}};function EB(e,t,n){var r=new L1;return r.restart(e,t,n),r}function oge(){iT(),++vf;for(var e=N1,t;e;)(t=ac-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vf}function DI(){ac=(D1=Ag.now())+nS,vf=Vh=0;try{oge()}finally{vf=0,sge(),ac=0}}function age(){var e=Ag.now(),t=e-D1;t>wB&&(nS-=t,D1=e)}function sge(){for(var e,t=N1,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:N1=n);jh=e,L5(r)}function L5(e){if(!vf){Vh&&(Vh=clearTimeout(Vh));var t=e-ac;t>24?(e<1/0&&(Vh=setTimeout(DI,e-Ag.now()-nS)),fh&&(fh=clearInterval(fh))):(fh||(D1=Ag.now(),fh=setInterval(age,wB)),vf=1,CB(DI))}}function LI(e,t,n){var r=new L1;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var lge=eS("start","end","cancel","interrupt"),uge=[],TB=0,FI=1,F5=2,Wy=3,BI=4,B5=5,Ky=6;function rS(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;cge(e,n,{name:t,index:r,group:i,on:lge,tween:uge,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:TB})}function oT(e,t){var n=zo(e,t);if(n.state>TB)throw new Error("too late; already scheduled");return n}function ka(e,t){var n=zo(e,t);if(n.state>Wy)throw new Error("too late; already running");return n}function zo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function cge(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=EB(o,0,n.time);function o(u){n.state=FI,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,h;if(n.state!==FI)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Wy)return LI(a);h.state===BI?(h.state=Ky,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Ky,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(LI(function(){n.state===Wy&&(n.state=BI,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=F5,n.on.call("start",e,e.__data__,n.index,n.group),n.state===F5){for(n.state=Wy,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=B5,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===B5&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ky,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Xy(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>F5&&r.state<B5,r.state=Ky,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function dge(e){return this.each(function(){Xy(this,e)})}function fge(e,t){var n,r;return function(){var i=ka(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function hge(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ka(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function pge(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=zo(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?fge:hge)(n,e,t))}function aT(e,t,n){var r=e._id;return e.each(function(){var i=ka(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return zo(i,r).value[t]}}function AB(e,t){var n;return(typeof t=="number"?qs:t instanceof Tg?OI:(n=Tg(t))?(t=n,OI):Xpe)(e,t)}function gge(e){return function(){this.removeAttribute(e)}}function mge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yge(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function vge(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function bge(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function _ge(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function Sge(e,t){var n=tS(e),r=n==="transform"?Jpe:AB;return this.attrTween(e,typeof t=="function"?(n.local?_ge:bge)(n,r,aT(this,"attr."+e,t)):t==null?(n.local?mge:gge)(n):(n.local?vge:yge)(n,r,t))}function xge(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function wge(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Cge(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&wge(e,o)),n}return i._value=t,i}function Ege(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&xge(e,o)),n}return i._value=t,i}function Tge(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=tS(e);return this.tween(n,(r.local?Cge:Ege)(r,t))}function Age(e,t){return function(){oT(this,e).delay=+t.apply(this,arguments)}}function Pge(e,t){return t=+t,function(){oT(this,e).delay=t}}function kge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Age:Pge)(t,e)):zo(this.node(),t).delay}function Ige(e,t){return function(){ka(this,e).duration=+t.apply(this,arguments)}}function Mge(e,t){return t=+t,function(){ka(this,e).duration=t}}function Rge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ige:Mge)(t,e)):zo(this.node(),t).duration}function Oge(e,t){if(typeof t!="function")throw new Error;return function(){ka(this,e).ease=t}}function $ge(e){var t=this._id;return arguments.length?this.each(Oge(t,e)):zo(this.node(),t).ease}function Nge(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ka(this,e).ease=n}}function Dge(e){if(typeof e!="function")throw new Error;return this.each(Nge(this._id,e))}function Lge(e){typeof e!="function"&&(e=oB(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new ms(r,this._parents,this._name,this._id)}function Fge(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),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;s<r;++s)a[s]=t[s];return new ms(a,this._parents,this._name,this._id)}function Bge(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 zge(e,t,n){var r,i,o=Bge(t)?oT:ka;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function Vge(e,t){var n=this._id;return arguments.length<2?zo(this.node(),n).on.on(e):this.each(zge(n,e,t))}function jge(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Uge(){return this.on("end.remove",jge(this._id))}function Gge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tT(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,rS(u[f],t,n,f,u,zo(c,n)));return new ms(o,this._parents,t,n)}function Hge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=iB(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=zo(c,n),g=0,_=f.length;g<_;++g)(h=f[g])&&rS(h,t,n,g,f,p);o.push(f),a.push(c)}return new ms(o,a,t,n)}var qge=Am.prototype.constructor;function Wge(){return new qge(this._groups,this._parents)}function Kge(e,t){var n,r,i;return function(){var o=yf(this,e),a=(this.style.removeProperty(e),yf(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function PB(e){return function(){this.style.removeProperty(e)}}function Xge(e,t,n){var r,i=n+"",o;return function(){var a=yf(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function Qge(e,t,n){var r,i,o;return function(){var a=yf(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),yf(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Yge(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=ka(this,e),u=l.on,c=l.value[o]==null?s||(s=PB(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function Zge(e,t,n){var r=(e+="")=="transform"?Zpe:AB;return t==null?this.styleTween(e,Kge(e,r)).on("end.style."+e,PB(e)):typeof t=="function"?this.styleTween(e,Qge(e,r,aT(this,"style."+e,t))).each(Yge(this._id,e)):this.styleTween(e,Xge(e,r,t),n).on("end.style."+e,null)}function Jge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function eme(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Jge(e,a,n)),r}return o._value=t,o}function tme(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,eme(e,t,n??""))}function nme(e){return function(){this.textContent=e}}function rme(e){return function(){var t=e(this);this.textContent=t??""}}function ime(e){return this.tween("text",typeof e=="function"?rme(aT(this,"text",e)):nme(e==null?"":e+""))}function ome(e){return function(t){this.textContent=e.call(this,t)}}function ame(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ome(i)),t}return r._value=e,r}function sme(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,ame(e))}function lme(){for(var e=this._name,t=this._id,n=kB(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=zo(l,t);rS(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ms(r,this._parents,e,n)}function ume(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=ka(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var cme=0;function ms(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function kB(){return++cme}var Na=Am.prototype;ms.prototype={constructor:ms,select:Gge,selectAll:Hge,selectChild:Na.selectChild,selectChildren:Na.selectChildren,filter:Lge,merge:Fge,selection:Wge,transition:lme,call:Na.call,nodes:Na.nodes,node:Na.node,size:Na.size,empty:Na.empty,each:Na.each,on:Vge,attr:Sge,attrTween:Tge,style:Zge,styleTween:tme,text:ime,textTween:sme,remove:Uge,tween:pge,delay:kge,duration:Rge,ease:$ge,easeVarying:Dge,end:ume,[Symbol.iterator]:Na[Symbol.iterator]};function dme(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var fme={time:null,delay:0,duration:250,ease:dme};function hme(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 pme(e){var t,n;e instanceof ms?(t=e._id,e=e._name):(t=kB(),(n=fme).time=iT(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&rS(l,e,t,u,a,n||hme(l,t));return new ms(r,this._parents,e,t)}Am.prototype.interrupt=dge;Am.prototype.transition=pme;const V0=e=>()=>e;function gme(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 Za(e,t,n){this.k=e,this.x=t,this.y=n}Za.prototype={constructor:Za,scale:function(e){return e===1?this:new Za(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Za(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 vl=new Za(1,0,0);Za.prototype;function Zx(e){e.stopImmediatePropagation()}function hh(e){e.preventDefault(),e.stopImmediatePropagation()}function mme(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function yme(){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 zI(){return this.__zoom||vl}function vme(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function bme(){return navigator.maxTouchPoints||"ontouchstart"in this}function _me(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],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Sme(){var e=mme,t=yme,n=_me,r=vme,i=bme,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=rge,u=eS("start","zoom","end"),c,d,f,h=500,p=150,g=0,_=10;function b(T){T.property("__zoom",zI).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",I).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(T,A,R,D){var $=T.selection?T.selection():T;$.property("__zoom",zI),T!==$?S(T,A,R,D):$.interrupt().each(function(){w(this,arguments).event(D).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},b.scaleBy=function(T,A,R,D){b.scaleTo(T,function(){var $=this.__zoom.k,L=typeof A=="function"?A.apply(this,arguments):A;return $*L},R,D)},b.scaleTo=function(T,A,R,D){b.transform(T,function(){var $=t.apply(this,arguments),L=this.__zoom,O=R==null?v($):typeof R=="function"?R.apply(this,arguments):R,B=L.invert(O),U=typeof A=="function"?A.apply(this,arguments):A;return n(m(y(L,U),O,B),$,a)},R,D)},b.translateBy=function(T,A,R,D){b.transform(T,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,D)},b.translateTo=function(T,A,R,D,$){b.transform(T,function(){var L=t.apply(this,arguments),O=this.__zoom,B=D==null?v(L):typeof D=="function"?D.apply(this,arguments):D;return n(vl.translate(B[0],B[1]).scale(O.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof R=="function"?-R.apply(this,arguments):-R),L,a)},D,$)};function y(T,A){return A=Math.max(o[0],Math.min(o[1],A)),A===T.k?T:new Za(A,T.x,T.y)}function m(T,A,R){var D=A[0]-R[0]*T.k,$=A[1]-R[1]*T.k;return D===T.x&&$===T.y?T:new Za(T.k,D,$)}function v(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function S(T,A,R,D){T.on("start.zoom",function(){w(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(D).end()}).tween("zoom",function(){var $=this,L=arguments,O=w($,L).event(D),B=t.apply($,L),U=R==null?v(B):typeof R=="function"?R.apply($,L):R,j=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),q=$.__zoom,Y=typeof A=="function"?A.apply($,L):A,Z=l(q.invert(U).concat(j/q.k),Y.invert(U).concat(j/Y.k));return function(V){if(V===1)V=Y;else{var K=Z(V),ee=j/K[2];V=new Za(ee,U[0]-K[0]*ee,U[1]-K[1]*ee)}O.zoom(null,V)}})}function w(T,A,R){return!R&&T.__zooming||new C(T,A)}function C(T,A){this.that=T,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,A),this.taps=0}C.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,A){return this.mouse&&T!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var A=So(this.that).datum();u.call(T,this.that,new gme(T,{sourceEvent:this.sourceEvent,target:b,type:T,transform:this.that.__zoom,dispatch:u}),A)}};function x(T,...A){if(!e.apply(this,arguments))return;var R=w(this,A).event(T),D=this.__zoom,$=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),L=Yo(T);if(R.wheel)(R.mouse[0][0]!==L[0]||R.mouse[0][1]!==L[1])&&(R.mouse[1]=D.invert(R.mouse[0]=L)),clearTimeout(R.wheel);else{if(D.k===$)return;R.mouse=[L,D.invert(L)],Xy(this),R.start()}hh(T),R.wheel=setTimeout(O,p),R.zoom("mouse",n(m(y(D,$),R.mouse[0],R.mouse[1]),R.extent,a));function O(){R.wheel=null,R.end()}}function P(T,...A){if(f||!e.apply(this,arguments))return;var R=T.currentTarget,D=w(this,A,!0).event(T),$=So(T.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",j,!0),L=Yo(T,R),O=T.clientX,B=T.clientY;gB(T.view),Zx(T),D.mouse=[L,this.__zoom.invert(L)],Xy(this),D.start();function U(q){if(hh(q),!D.moved){var Y=q.clientX-O,Z=q.clientY-B;D.moved=Y*Y+Z*Z>g}D.event(q).zoom("mouse",n(m(D.that.__zoom,D.mouse[0]=Yo(q,R),D.mouse[1]),D.extent,a))}function j(q){$.on("mousemove.zoom mouseup.zoom",null),mB(q.view,D.moved),hh(q),D.event(q).end()}}function E(T,...A){if(e.apply(this,arguments)){var R=this.__zoom,D=Yo(T.changedTouches?T.changedTouches[0]:T,this),$=R.invert(D),L=R.k*(T.shiftKey?.5:2),O=n(m(y(R,L),D,$),t.apply(this,A),a);hh(T),s>0?So(this).transition().duration(s).call(S,O,D,T):So(this).call(b.transform,O,D,T)}}function I(T,...A){if(e.apply(this,arguments)){var R=T.touches,D=R.length,$=w(this,A,T.changedTouches.length===D).event(T),L,O,B,U;for(Zx(T),O=0;O<D;++O)B=R[O],U=Yo(B,this),U=[U,this.__zoom.invert(U),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==U[2]&&($.touch1=U,$.taps=0):($.touch0=U,L=!0,$.taps=1+!!c);c&&(c=clearTimeout(c)),L&&($.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),Xy(this),$.start())}}function N(T,...A){if(this.__zooming){var R=w(this,A).event(T),D=T.changedTouches,$=D.length,L,O,B,U;for(hh(T),L=0;L<$;++L)O=D[L],B=Yo(O,this),R.touch0&&R.touch0[2]===O.identifier?R.touch0[0]=B:R.touch1&&R.touch1[2]===O.identifier&&(R.touch1[0]=B);if(O=R.that.__zoom,R.touch1){var j=R.touch0[0],q=R.touch0[1],Y=R.touch1[0],Z=R.touch1[1],V=(V=Y[0]-j[0])*V+(V=Y[1]-j[1])*V,K=(K=Z[0]-q[0])*K+(K=Z[1]-q[1])*K;O=y(O,Math.sqrt(V/K)),B=[(j[0]+Y[0])/2,(j[1]+Y[1])/2],U=[(q[0]+Z[0])/2,(q[1]+Z[1])/2]}else if(R.touch0)B=R.touch0[0],U=R.touch0[1];else return;R.zoom("touch",n(m(O,B,U),R.extent,a))}}function M(T,...A){if(this.__zooming){var R=w(this,A).event(T),D=T.changedTouches,$=D.length,L,O;for(Zx(T),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),L=0;L<$;++L)O=D[L],R.touch0&&R.touch0[2]===O.identifier?delete R.touch0:R.touch1&&R.touch1[2]===O.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(O=Yo(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<_)){var B=So(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(T){return arguments.length?(r=typeof T=="function"?T:V0(+T),b):r},b.filter=function(T){return arguments.length?(e=typeof T=="function"?T:V0(!!T),b):e},b.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:V0(!!T),b):i},b.extent=function(T){return arguments.length?(t=typeof T=="function"?T:V0([[+T[0][0],+T[0][1]],[+T[1][0],+T[1][1]]]),b):t},b.scaleExtent=function(T){return arguments.length?(o[0]=+T[0],o[1]=+T[1],b):[o[0],o[1]]},b.translateExtent=function(T){return arguments.length?(a[0][0]=+T[0][0],a[1][0]=+T[1][0],a[0][1]=+T[0][1],a[1][1]=+T[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(T){return arguments.length?(n=T,b):n},b.duration=function(T){return arguments.length?(s=+T,b):s},b.interpolate=function(T){return arguments.length?(l=T,b):l},b.on=function(){var T=u.on.apply(u,arguments);return T===u?b:T},b.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,b):Math.sqrt(g)},b.tapDistance=function(T){return arguments.length?(_=+T,b):_},b}const iS=k.createContext(null),xme=iS.Provider,ys={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".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},IB=ys.error001();function fn(e,t){const n=k.useContext(iS);if(n===null)throw new Error(IB);return nB(n,e,t)}const Kn=()=>{const e=k.useContext(iS);if(e===null)throw new Error(IB);return k.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},wme=e=>e.userSelectionActive?"none":"all";function Cme({position:e,children:t,className:n,style:r,...i}){const o=fn(wme),a=`${e}`.split("-");return J.createElement("div",{className:to(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i},t)}function Eme({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:J.createElement(Cme,{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"},J.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Tme=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:s=2,children:l,className:u,...c})=>{const d=k.useRef(null),[f,h]=k.useState({x:0,y:0,width:0,height:0}),p=to(["react-flow__edge-textwrapper",u]);return k.useEffect(()=>{if(d.current){const g=d.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:J.createElement("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c},i&&J.createElement("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:s,ry:s}),J.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r},n),l)};var Ame=k.memo(Tme);const sT=e=>({width:e.offsetWidth,height:e.offsetHeight}),bf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),lT=(e={x:0,y:0},t)=>({x:bf(e.x,t[0][0],t[1][0]),y:bf(e.y,t[0][1],t[1][1])}),VI=(e,t,n)=>e<t?bf(Math.abs(e-t),1,50)/50:e>n?-bf(Math.abs(e-n),1,50)/50:0,MB=(e,t)=>{const n=VI(e.x,35,t.width-35)*20,r=VI(e.y,35,t.height-35)*20;return[n,r]},RB=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},OB=(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)}),Pg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),$B=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),jI=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),dVe=(e,t)=>$B(OB(Pg(e),Pg(t))),z5=(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)},Pme=e=>Ki(e.width)&&Ki(e.height)&&Ki(e.x)&&Ki(e.y),Ki=e=>!isNaN(e)&&isFinite(e),Rn=Symbol.for("internals"),NB=["Enter"," ","Escape"],kme=(e,t)=>{},Ime=e=>"nativeEvent"in e;function V5(e){var i,o;const t=Ime(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 DB=e=>"clientX"in e,bl=(e,t)=>{var o,a;const n=DB(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},F1=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},km=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>J.createElement(J.Fragment,null,J.createElement("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&J.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Ki(n)&&Ki(r)?J.createElement(Ame,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null);km.displayName="BaseEdge";function ph(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function LB({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,a=Math.abs(r-t)/2,s=r<t?r+a:r-a;return[o,s,i,a]}function FB({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+o*.375+s*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var sc;(function(e){e.Strict="strict",e.Loose="loose"})(sc||(sc={}));var Ru;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ru||(Ru={}));var Rl;(function(e){e.Partial="partial",e.Full="full"})(Rl||(Rl={}));var Js;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Js||(Js={}));var B1;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(B1||(B1={}));var Pe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Pe||(Pe={}));function UI({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Pe.Left||e===Pe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function BB({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:o=Pe.Top}){const[a,s]=UI({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=UI({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=FB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${s} ${l},${u} ${r},${i}`,c,d,f,h]}const uT=k.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Pe.Bottom,targetPosition:o=Pe.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:g})=>{const[_,b,y]=BB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return J.createElement(km,{path:_,labelX:b,labelY:y,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:g})});uT.displayName="SimpleBezierEdge";const GI={[Pe.Left]:{x:-1,y:0},[Pe.Right]:{x:1,y:0},[Pe.Top]:{x:0,y:-1},[Pe.Bottom]:{x:0,y:1}},Mme=({source:e,sourcePosition:t=Pe.Bottom,target:n})=>t===Pe.Left||t===Pe.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},HI=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Rme({source:e,sourcePosition:t=Pe.Bottom,target:n,targetPosition:r=Pe.Top,center:i,offset:o}){const a=GI[t],s=GI[r],l={x:e.x+a.x*o,y:e.y+a.y*o},u={x:n.x+s.x*o,y:n.y+s.y*o},c=Mme({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],p,g;const _={x:0,y:0},b={x:0,y:0},[y,m,v,S]=LB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=i.x||y,g=i.y||m;const C=[{x:p,y:l.y},{x:p,y:u.y}],x=[{x:l.x,y:g},{x:u.x,y:g}];a[d]===f?h=d==="x"?C:x:h=d==="x"?x:C}else{const C=[{x:l.x,y:u.y}],x=[{x:u.x,y:l.y}];if(d==="x"?h=a.x===f?x:C:h=a.y===f?C:x,t===r){const M=Math.abs(e[d]-n[d]);if(M<=o){const T=Math.min(o-1,o-M);a[d]===f?_[d]=(l[d]>e[d]?-1:1)*T:b[d]=(u[d]>n[d]?-1:1)*T}}if(t!==r){const M=d==="x"?"y":"x",T=a[d]===s[M],A=l[M]>u[M],R=l[M]<u[M];(a[d]===1&&(!T&&A||T&&R)||a[d]!==1&&(!T&&R||T&&A))&&(h=d==="x"?C:x)}const P={x:l.x+_.x,y:l.y+_.y},E={x:u.x+b.x,y:u.y+b.y},I=Math.max(Math.abs(P.x-h[0].x),Math.abs(E.x-h[0].x)),N=Math.max(Math.abs(P.y-h[0].y),Math.abs(E.y-h[0].y));I>=N?(p=(P.x+E.x)/2,g=h[0].y):(p=h[0].x,g=(P.y+E.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:u.x+b.x,y:u.y+b.y},n],p,g,v,S]}function Ome(e,t,n,r){const i=Math.min(HI(e,t)/2,HI(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${a}Q ${o},${a} ${o},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*s},${a}`}function j5({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:o=Pe.Top,borderRadius:a=5,centerX:s,centerY:l,offset:u=20}){const[c,d,f,h,p]=Rme({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:s,y:l},offset:u});return[c.reduce((_,b,y)=>{let m="";return y>0&&y<c.length-1?m=Ome(c[y-1],b,c[y+1],a):m=`${y===0?"M":"L"}${b.x} ${b.y}`,_+=m,_},""),d,f,h,p]}const oS=k.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=Pe.Bottom,targetPosition:f=Pe.Top,markerEnd:h,markerStart:p,pathOptions:g,interactionWidth:_})=>{const[b,y,m]=j5({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return J.createElement(km,{path:b,labelX:y,labelY:m,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:_})});oS.displayName="SmoothStepEdge";const cT=k.memo(e=>{var t;return J.createElement(oS,{...e,pathOptions:k.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});cT.displayName="StepEdge";function $me({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,s]=LB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,s]}const dT=k.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,g,_]=$me({sourceX:e,sourceY:t,targetX:n,targetY:r});return J.createElement(km,{path:p,labelX:g,labelY:_,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});dT.displayName="StraightEdge";function j0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function qI({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case Pe.Left:return[t-j0(t-r,o),n];case Pe.Right:return[t+j0(r-t,o),n];case Pe.Top:return[t,n-j0(n-i,o)];case Pe.Bottom:return[t,n+j0(i-n,o)]}}function zB({sourceX:e,sourceY:t,sourcePosition:n=Pe.Bottom,targetX:r,targetY:i,targetPosition:o=Pe.Top,curvature:a=.25}){const[s,l]=qI({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,c]=qI({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[d,f,h,p]=FB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${l} ${u},${c} ${r},${i}`,d,f,h,p]}const z1=k.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Pe.Bottom,targetPosition:o=Pe.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:g,interactionWidth:_})=>{const[b,y,m]=zB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:g==null?void 0:g.curvature});return J.createElement(km,{path:b,labelX:y,labelY:m,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:_})});z1.displayName="BezierEdge";const fT=k.createContext(null),Nme=fT.Provider;fT.Consumer;const Dme=()=>k.useContext(fT),Lme=e=>"id"in e&&"source"in e&&"target"in e,VB=e=>"id"in e&&!("source"in e)&&!("target"in e),Fme=(e,t,n)=>{if(!VB(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},Bme=(e,t,n)=>{if(!VB(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},jB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,U5=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,zme=(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)),Uh=(e,t)=>{if(!e.source||!e.target)return t;let n;return Lme(e)?n={...e}:n={...e,id:jB(e)},zme(n,t)?t:t.concat(n)},Vme=(e,t,n,r={shouldReplaceId:!0})=>{const{id:i,...o}=e;if(!t.source||!t.target||!n.find(l=>l.id===i))return n;const s={...o,id:r.shouldReplaceId?jB(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==i).concat(s)},UB=({x:e,y:t},[n,r,i],o,[a,s])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},jme=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Fd=(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}},hT=(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:a}=Fd(i,t).positionAbsolute;return OB(r,Pg({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $B(n)},GB=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,s=[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(c=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=c;if(a&&!h||p)return!1;const{positionAbsolute:g}=Fd(c,s),_={x:g.x,y:g.y,width:d||0,height:f||0},b=z5(l,_),y=typeof d>"u"||typeof f>"u"||d===null||f===null,m=o&&b>0,v=(d||0)*(f||0);(y||m||b>=v||c.dragging)&&u.push(c)}),u},pT=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},HB=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),s=n/(e.height*(1+o)),l=Math.min(a,s),u=bf(l,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},mu=(e,t=0)=>e.transition().duration(t);function WI(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,s;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((s=e.positionAbsolute)==null?void 0:s.y)??0)+o.y+o.height/2}),i},[])}function Ume(e,t,n,r,i,o){const{x:a,y:s}=bl(e),u=t.elementsFromPoint(a,s).find(p=>p.classList.contains("react-flow__handle"));if(u){const p=u.getAttribute("data-nodeid");if(p){const g=gT(void 0,u),_=u.getAttribute("data-handleid"),b=o({nodeId:p,id:_,type:g});if(b)return{handle:{id:_,type:g,nodeId:p,x:n.x,y:n.y},validHandleResult:b}}}let c=[],d=1/0;if(i.forEach(p=>{const g=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(g<=r){const _=o(p);g<=d&&(g<d?c=[{handle:p,validHandleResult:_}]:g===d&&c.push({handle:p,validHandleResult:_}),d=g)}}),!c.length)return{handle:null,validHandleResult:qB()};if(c.length===1)return c[0];const f=c.some(({validHandleResult:p})=>p.isValid),h=c.some(({handle:p})=>p.type==="target");return c.find(({handle:p,validHandleResult:g})=>h?p.type==="target":f?g.isValid:!0)||c[0]}const Gme={source:null,target:null,sourceHandle:null,targetHandle:null},qB=()=>({handleDomNode:null,isValid:!1,connection:Gme,endHandle:null});function WB(e,t,n,r,i,o,a){const s=i==="target",l=a.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={...qB(),handleDomNode:l};if(l){const c=gT(void 0,l),d=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),g={source:s?d:n,sourceHandle:s?f:r,target:s?n:d,targetHandle:s?r:f};u.connection=g,h&&p&&(t===sc.Strict?s&&c==="source"||!s&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=o(g))}return u}function Hme({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[Rn]){const{handleBounds:a}=o[Rn];let s=[],l=[];a&&(s=WI(o,a,"source",`${t}-${n}-${r}`),l=WI(o,a,"target",`${t}-${n}-${r}`)),i.push(...s,...l)}return i},[])}function gT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Jx(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function qme(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function KB({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:s,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=RB(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:g,panBy:_,getNodes:b,cancelConnection:y}=o();let m=0,v;const{x:S,y:w}=bl(e),C=c==null?void 0:c.elementFromPoint(S,w),x=gT(l,C),P=f==null?void 0:f.getBoundingClientRect();if(!P||!x)return;let E,I=bl(e,P),N=!1,M=null,T=!1,A=null;const R=Hme({nodes:b(),nodeId:n,handleId:t,handleType:x}),D=()=>{if(!h)return;const[O,B]=MB(I,P);_({x:O,y:B}),m=requestAnimationFrame(D)};a({connectionPosition:I,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:x,connectionStartHandle:{nodeId:n,handleId:t,type:x},connectionEndHandle:null}),g==null||g(e,{nodeId:n,handleId:t,handleType:x});function $(O){const{transform:B}=o();I=bl(O,P);const{handle:U,validHandleResult:j}=Ume(O,c,UB(I,B,!1,[1,1]),p,R,q=>WB(q,d,n,t,i?"target":"source",s,c));if(v=U,N||(D(),N=!0),A=j.handleDomNode,M=j.connection,T=j.isValid,a({connectionPosition:v&&T?jme({x:v.x,y:v.y},B):I,connectionStatus:qme(!!v,T),connectionEndHandle:j.endHandle}),!v&&!T&&!A)return Jx(E);M.source!==M.target&&A&&(Jx(E),E=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",T),A.classList.toggle("react-flow__handle-valid",T))}function L(O){var B,U;(v||A)&&M&&T&&(r==null||r(M)),(U=(B=o()).onConnectEnd)==null||U.call(B,O),l&&(u==null||u(O)),Jx(E),y(),cancelAnimationFrame(m),N=!1,T=!1,M=null,A=null,c.removeEventListener("mousemove",$),c.removeEventListener("mouseup",L),c.removeEventListener("touchmove",$),c.removeEventListener("touchend",L)}c.addEventListener("mousemove",$),c.addEventListener("mouseup",L),c.addEventListener("touchmove",$),c.addEventListener("touchend",L)}const KI=()=>!0,Wme=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Kme=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},XB=k.forwardRef(({type:e="source",position:t=Pe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:s,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var P,E;const p=a||null,g=e==="target",_=Kn(),b=Dme(),{connectOnClick:y,noPanClassName:m}=fn(Wme,ii),{connecting:v,clickConnecting:S}=fn(Kme(b,p,e),ii);b||(E=(P=_.getState()).onError)==null||E.call(P,"010",ys.error010());const w=I=>{const{defaultEdgeOptions:N,onConnect:M,hasDefaultEdges:T}=_.getState(),A={...N,...I};if(T){const{edges:R,setEdges:D}=_.getState();D(Uh(A,R))}M==null||M(A),s==null||s(A)},C=I=>{if(!b)return;const N=DB(I);i&&(N&&I.button===0||!N)&&KB({event:I,handleId:p,nodeId:b,onConnect:w,isTarget:g,getState:_.getState,setState:_.setState,isValidConnection:n||_.getState().isValidConnection||KI}),N?c==null||c(I):d==null||d(I)},x=I=>{const{onClickConnectStart:N,onClickConnectEnd:M,connectionClickStartHandle:T,connectionMode:A,isValidConnection:R}=_.getState();if(!b||!T&&!i)return;if(!T){N==null||N(I,{nodeId:b,handleId:p,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:p}});return}const D=RB(I.target),$=n||R||KI,{connection:L,isValid:O}=WB({nodeId:b,id:p,type:e},A,T.nodeId,T.handleId||null,T.type,$,D);O&&w(L),M==null||M(I),_.setState({connectionClickStartHandle:null})};return J.createElement("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${p}-${e}`,className:to(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!v||o&&v)}]),onMouseDown:C,onTouchStart:C,onClick:y?x:void 0,ref:h,...f},l)});XB.displayName="Handle";var V1=k.memo(XB);const QB=({data:e,isConnectable:t,targetPosition:n=Pe.Top,sourcePosition:r=Pe.Bottom})=>J.createElement(J.Fragment,null,J.createElement(V1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,J.createElement(V1,{type:"source",position:r,isConnectable:t}));QB.displayName="DefaultNode";var G5=k.memo(QB);const YB=({data:e,isConnectable:t,sourcePosition:n=Pe.Bottom})=>J.createElement(J.Fragment,null,e==null?void 0:e.label,J.createElement(V1,{type:"source",position:n,isConnectable:t}));YB.displayName="InputNode";var ZB=k.memo(YB);const JB=({data:e,isConnectable:t,targetPosition:n=Pe.Top})=>J.createElement(J.Fragment,null,J.createElement(V1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);JB.displayName="OutputNode";var ez=k.memo(JB);const mT=()=>null;mT.displayName="GroupNode";const Xme=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),U0=e=>e.id;function Qme(e,t){return ii(e.selectedNodes.map(U0),t.selectedNodes.map(U0))&&ii(e.selectedEdges.map(U0),t.selectedEdges.map(U0))}const tz=k.memo(({onSelectionChange:e})=>{const t=Kn(),{selectedNodes:n,selectedEdges:r}=fn(Xme,Qme);return k.useEffect(()=>{var o,a;const i={nodes:n,edges:r};e==null||e(i),(a=(o=t.getState()).onSelectionChange)==null||a.call(o,i)},[n,r,e]),null});tz.displayName="SelectionListener";const Yme=e=>!!e.onSelectionChange;function Zme({onSelectionChange:e}){const t=fn(Yme);return e||t?J.createElement(tz,{onSelectionChange:e}):null}const Jme=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 Oc(e,t){k.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ue(e,t,n){k.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const e0e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:s,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:g,maxZoom:_,nodeExtent:b,onNodesChange:y,onEdgesChange:m,elementsSelectable:v,connectionMode:S,snapGrid:w,snapToGrid:C,translateExtent:x,connectOnClick:P,defaultEdgeOptions:E,fitView:I,fitViewOptions:N,onNodesDelete:M,onEdgesDelete:T,onNodeDrag:A,onNodeDragStart:R,onNodeDragStop:D,onSelectionDrag:$,onSelectionDragStart:L,onSelectionDragStop:O,noPanClassName:B,nodeOrigin:U,rfId:j,autoPanOnConnect:q,autoPanOnNodeDrag:Y,onError:Z,connectionRadius:V,isValidConnection:K,nodeDragThreshold:ee})=>{const{setNodes:re,setEdges:fe,setDefaultNodesAndEdges:Se,setMinZoom:Me,setMaxZoom:De,setTranslateExtent:Ee,setNodeExtent:tt,reset:ot}=fn(Jme,ii),we=Kn();return k.useEffect(()=>{const Xn=r==null?void 0:r.map(Vt=>({...Vt,...E}));return Se(n,Xn),()=>{ot()}},[]),Ue("defaultEdgeOptions",E,we.setState),Ue("connectionMode",S,we.setState),Ue("onConnect",i,we.setState),Ue("onConnectStart",o,we.setState),Ue("onConnectEnd",a,we.setState),Ue("onClickConnectStart",s,we.setState),Ue("onClickConnectEnd",l,we.setState),Ue("nodesDraggable",u,we.setState),Ue("nodesConnectable",c,we.setState),Ue("nodesFocusable",d,we.setState),Ue("edgesFocusable",f,we.setState),Ue("edgesUpdatable",h,we.setState),Ue("elementsSelectable",v,we.setState),Ue("elevateNodesOnSelect",p,we.setState),Ue("snapToGrid",C,we.setState),Ue("snapGrid",w,we.setState),Ue("onNodesChange",y,we.setState),Ue("onEdgesChange",m,we.setState),Ue("connectOnClick",P,we.setState),Ue("fitViewOnInit",I,we.setState),Ue("fitViewOnInitOptions",N,we.setState),Ue("onNodesDelete",M,we.setState),Ue("onEdgesDelete",T,we.setState),Ue("onNodeDrag",A,we.setState),Ue("onNodeDragStart",R,we.setState),Ue("onNodeDragStop",D,we.setState),Ue("onSelectionDrag",$,we.setState),Ue("onSelectionDragStart",L,we.setState),Ue("onSelectionDragStop",O,we.setState),Ue("noPanClassName",B,we.setState),Ue("nodeOrigin",U,we.setState),Ue("rfId",j,we.setState),Ue("autoPanOnConnect",q,we.setState),Ue("autoPanOnNodeDrag",Y,we.setState),Ue("onError",Z,we.setState),Ue("connectionRadius",V,we.setState),Ue("isValidConnection",K,we.setState),Ue("nodeDragThreshold",ee,we.setState),Oc(e,re),Oc(t,fe),Oc(g,Me),Oc(_,De),Oc(x,Ee),Oc(b,tt),null},XI={display:"none"},t0e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nz="react-flow__node-desc",rz="react-flow__edge-desc",n0e="react-flow__aria-live",r0e=e=>e.ariaLiveMessage;function i0e({rfId:e}){const t=fn(r0e);return J.createElement("div",{id:`${n0e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:t0e},t)}function o0e({rfId:e,disableKeyboardA11y:t}){return J.createElement(J.Fragment,null,J.createElement("div",{id:`${nz}-${e}`,style:XI},"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."," "),J.createElement("div",{id:`${rz}-${e}`,style:XI},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&J.createElement(i0e,{rfId:e}))}var kg=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=k.useState(!1),i=k.useRef(!1),o=k.useRef(new Set([])),[a,s]=k.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return k.useEffect(()=>{const l=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||l;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&V5(h))return!1;const g=YI(h.code,s);o.current.add(h[g]),QI(a,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&V5(h))return!1;const g=YI(h.code,s);QI(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[g]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",c),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{u==null||u.removeEventListener("keydown",c),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function QI(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function YI(e,t){return t.includes(e)?"code":"key"}function iz(e,t,n,r){var a,s;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=Fd(i,r);return iz(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[Rn])==null?void 0:a.z)??0)>(n.z??0)?((s=i[Rn])==null?void 0:s.z)??0:n.z??0},r)}function oz(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:a,z:s}=iz(r,e,{...r.position,z:((i=r[Rn])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[Rn].z=s,n!=null&&n[r.id]&&(r[Rn].isParent=!0)}})}function ew(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(s=>{var d;const l=(Ki(s.zIndex)?s.zIndex:0)+(s.selected?a:0),u=t.get(s.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...s,positionAbsolute:{x:s.position.x,y:s.position.y}};s.parentNode&&(c.parentNode=s.parentNode,o[s.parentNode]=!0),Object.defineProperty(c,Rn,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[Rn])==null?void 0:d.handleBounds,z:l}}),i.set(s.id,c)}),oz(i,n,o),i}function az(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(s&&l&&(f||!t.initial)){const p=n().filter(_=>{var y;const b=t.includeHiddenNodes?_.width&&_.height:!_.hidden;return(y=t.nodes)!=null&&y.length?b&&t.nodes.some(m=>m.id===_.id):b}),g=p.every(_=>_.width&&_.height);if(p.length>0&&g){const _=hT(p,d),[b,y,m]=HB(_,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),v=vl.translate(b,y).scale(m);return typeof t.duration=="number"&&t.duration>0?s.transform(mu(l,t.duration),v):s.transform(l,v),!0}}return!1}function a0e(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Rn]:r[Rn],selected:n.selected})}),new Map(t)}function s0e(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function G0({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:a0e(e,i)}),a==null||a(e)),t!=null&&t.length&&(u&&r({edges:s0e(t,o)}),s==null||s(t))}const $c=()=>{},l0e={zoomIn:$c,zoomOut:$c,zoomTo:$c,getZoom:()=>1,setViewport:$c,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:$c,fitBounds:$c,project:e=>e,viewportInitialized:!1},u0e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),c0e=()=>{const e=Kn(),{d3Zoom:t,d3Selection:n}=fn(u0e,ii);return k.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(mu(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(mu(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(mu(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,s,l]=e.getState().transform,u=vl.translate(i.x??a,i.y??s).scale(i.zoom??l);t.transform(mu(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>az(e.getState,i),setCenter:(i,o,a)=>{const{width:s,height:l,maxZoom:u}=e.getState(),c=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:u,d=s/2-i*c,f=l/2-o*c,h=vl.translate(d,f).scale(c);t.transform(mu(n,a==null?void 0:a.duration),h)},fitBounds:(i,o)=>{const{width:a,height:s,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=HB(i,a,s,l,u,(o==null?void 0:o.padding)??.1),h=vl.translate(c,d).scale(f);t.transform(mu(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:s}=e.getState();return UB(i,o,a,s)},viewportInitialized:!0}:l0e,[t,n])};function sz(){const e=c0e(),t=Kn(),n=k.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),r=k.useCallback(g=>t.getState().nodeInternals.get(g),[]),i=k.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(_=>({..._}))},[]),o=k.useCallback(g=>{const{edges:_=[]}=t.getState();return _.find(b=>b.id===g)},[]),a=k.useCallback(g=>{const{getNodes:_,setNodes:b,hasDefaultNodes:y,onNodesChange:m}=t.getState(),v=_(),S=typeof g=="function"?g(v):g;if(y)b(S);else if(m){const w=S.length===0?v.map(C=>({type:"remove",id:C.id})):S.map(C=>({item:C,type:"reset"}));m(w)}},[]),s=k.useCallback(g=>{const{edges:_=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:m}=t.getState(),v=typeof g=="function"?g(_):g;if(y)b(v);else if(m){const S=v.length===0?_.map(w=>({type:"remove",id:w.id})):v.map(w=>({item:w,type:"reset"}));m(S)}},[]),l=k.useCallback(g=>{const _=Array.isArray(g)?g:[g],{getNodes:b,setNodes:y,hasDefaultNodes:m,onNodesChange:v}=t.getState();if(m){const w=[...b(),..._];y(w)}else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),u=k.useCallback(g=>{const _=Array.isArray(g)?g:[g],{edges:b=[],setEdges:y,hasDefaultEdges:m,onEdgesChange:v}=t.getState();if(m)y([...b,..._]);else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),c=k.useCallback(()=>{const{getNodes:g,edges:_=[],transform:b}=t.getState(),[y,m,v]=b;return{nodes:g().map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:y,y:m,zoom:v}}},[]),d=k.useCallback(({nodes:g,edges:_})=>{const{nodeInternals:b,getNodes:y,edges:m,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:C,onNodesChange:x,onEdgesChange:P}=t.getState(),E=(g||[]).map(A=>A.id),I=(_||[]).map(A=>A.id),N=y().reduce((A,R)=>{const D=!E.includes(R.id)&&R.parentNode&&A.find(L=>L.id===R.parentNode);return(typeof R.deletable=="boolean"?R.deletable:!0)&&(E.includes(R.id)||D)&&A.push(R),A},[]),M=m.filter(A=>typeof A.deletable=="boolean"?A.deletable:!0),T=M.filter(A=>I.includes(A.id));if(N||T){const A=pT(N,M),R=[...T,...A],D=R.reduce(($,L)=>($.includes(L.id)||$.push(L.id),$),[]);if((S||v)&&(S&&t.setState({edges:m.filter($=>!D.includes($.id))}),v&&(N.forEach($=>{b.delete($.id)}),t.setState({nodeInternals:new Map(b)}))),D.length>0&&(C==null||C(R),P&&P(D.map($=>({id:$,type:"remove"})))),N.length>0&&(w==null||w(N),x)){const $=N.map(L=>({id:L.id,type:"remove"}));x($)}}},[]),f=k.useCallback(g=>{const _=Pme(g),b=_?null:t.getState().nodeInternals.get(g.id);return[_?g:jI(b),b,_]},[]),h=k.useCallback((g,_=!0,b)=>{const[y,m,v]=f(g);return y?(b||t.getState().getNodes()).filter(S=>{if(!v&&(S.id===m.id||!S.positionAbsolute))return!1;const w=jI(S),C=z5(w,y);return _&&C>0||C>=g.width*g.height}):[]},[]),p=k.useCallback((g,_,b=!0)=>{const[y]=f(g);if(!y)return!1;const m=z5(y,_);return b&&m>0||m>=g.width*g.height},[]);return k.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:s,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,a,s,l,u,c,d,h,p])}const d0e={actInsideInputWithModifier:!1};var f0e=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Kn(),{deleteElements:r}=sz(),i=kg(e,d0e),o=kg(t);k.useEffect(()=>{if(i){const{edges:a,getNodes:s}=n.getState(),l=s().filter(c=>c.selected),u=a.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),k.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function h0e(e){const t=Kn();k.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=sT(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",ys.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 yT={position:"absolute",width:"100%",height:"100%",top:0,left:0},p0e=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,H0=e=>({x:e.x,y:e.y,zoom:e.k}),Nc=(e,t)=>e.target.closest(`.${t}`),ZI=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),JI=e=>{const t=e.ctrlKey&&F1()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},g0e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),m0e=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=Ru.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:g,zoomActivationKeyCode:_,preventScrolling:b=!0,children:y,noWheelClassName:m,noPanClassName:v})=>{const S=k.useRef(),w=Kn(),C=k.useRef(!1),x=k.useRef(!1),P=k.useRef(null),E=k.useRef({x:0,y:0,zoom:0}),{d3Zoom:I,d3Selection:N,d3ZoomHandler:M,userSelectionActive:T}=fn(g0e,ii),A=kg(_),R=k.useRef(0),D=k.useRef(!1),$=k.useRef();return h0e(P),k.useEffect(()=>{if(P.current){const L=P.current.getBoundingClientRect(),O=Sme().scaleExtent([p,g]).translateExtent(h),B=So(P.current).call(O),U=vl.translate(f.x,f.y).scale(bf(f.zoom,p,g)),j=[[0,0],[L.width,L.height]],q=O.constrain()(U,j,h);O.transform(B,q),O.wheelDelta(JI),w.setState({d3Zoom:O,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[q.x,q.y,q.k],domNode:P.current.closest(".react-flow")})}},[]),k.useEffect(()=>{N&&I&&(a&&!A&&!T?N.on("wheel.zoom",L=>{if(Nc(L,m))return!1;L.preventDefault(),L.stopImmediatePropagation();const O=N.property("__zoom").k||1,B=F1();if(L.ctrlKey&&o&&B){const ee=Yo(L),re=JI(L),fe=O*Math.pow(2,re);I.scaleTo(N,fe,ee,L);return}const U=L.deltaMode===1?20:1;let j=l===Ru.Vertical?0:L.deltaX*U,q=l===Ru.Horizontal?0:L.deltaY*U;!B&&L.shiftKey&&l!==Ru.Vertical&&(j=L.deltaY*U,q=0),I.translateBy(N,-(j/O)*s,-(q/O)*s,{internal:!0});const Y=H0(N.property("__zoom")),{onViewportChangeStart:Z,onViewportChange:V,onViewportChangeEnd:K}=w.getState();clearTimeout($.current),D.current||(D.current=!0,t==null||t(L,Y),Z==null||Z(Y)),D.current&&(e==null||e(L,Y),V==null||V(Y),$.current=setTimeout(()=>{n==null||n(L,Y),K==null||K(Y),D.current=!1},150))},{passive:!1}):typeof M<"u"&&N.on("wheel.zoom",function(L,O){if(!b||Nc(L,m))return null;L.preventDefault(),M.call(this,L,O)},{passive:!1}))},[T,a,l,N,I,M,A,o,b,m,t,e,n]),k.useEffect(()=>{I&&I.on("start",L=>{var U,j;if(!L.sourceEvent||L.sourceEvent.internal)return null;R.current=(U=L.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:O}=w.getState(),B=H0(L.transform);C.current=!0,E.current=B,((j=L.sourceEvent)==null?void 0:j.type)==="mousedown"&&w.setState({paneDragging:!0}),O==null||O(B),t==null||t(L.sourceEvent,B)})},[I,t]),k.useEffect(()=>{I&&(T&&!C.current?I.on("zoom",null):T||I.on("zoom",L=>{var B;const{onViewportChange:O}=w.getState();if(w.setState({transform:[L.transform.x,L.transform.y,L.transform.k]}),x.current=!!(r&&ZI(d,R.current??0)),(e||O)&&!((B=L.sourceEvent)!=null&&B.internal)){const U=H0(L.transform);O==null||O(U),e==null||e(L.sourceEvent,U)}}))},[T,I,e,d,r]),k.useEffect(()=>{I&&I.on("end",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;const{onViewportChangeEnd:O}=w.getState();if(C.current=!1,w.setState({paneDragging:!1}),r&&ZI(d,R.current??0)&&!x.current&&r(L.sourceEvent),x.current=!1,(n||O)&&p0e(E.current,L.transform)){const B=H0(L.transform);E.current=B,clearTimeout(S.current),S.current=setTimeout(()=>{O==null||O(B),n==null||n(L.sourceEvent,B)},a?150:0)}})},[I,a,d,n,r]),k.useEffect(()=>{I&&I.filter(L=>{const O=A||i,B=o&&L.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&L.button===1&&L.type==="mousedown"&&(Nc(L,"react-flow__node")||Nc(L,"react-flow__edge")))return!0;if(!d&&!O&&!a&&!u&&!o||T||!u&&L.type==="dblclick"||Nc(L,m)&&L.type==="wheel"||Nc(L,v)&&(L.type!=="wheel"||a&&L.type==="wheel")||!o&&L.ctrlKey&&L.type==="wheel"||!O&&!a&&!B&&L.type==="wheel"||!d&&(L.type==="mousedown"||L.type==="touchstart")||Array.isArray(d)&&!d.includes(L.button)&&(L.type==="mousedown"||L.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||L.type==="wheel")&&U})},[T,I,i,o,a,u,d,c,A]),J.createElement("div",{className:"react-flow__renderer",ref:P,style:yT},y)},y0e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function v0e(){const{userSelectionActive:e,userSelectionRect:t}=fn(y0e,ii);return e&&t?J.createElement("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 e8(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 lz(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(s=>s.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const s of o)if(s)switch(s.type){case"select":{a.selected=s.selected;break}case"position":{typeof s.position<"u"&&(a.position=s.position),typeof s.positionAbsolute<"u"&&(a.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&e8(r,a);break}case"dimensions":{typeof s.dimensions<"u"&&(a.width=s.dimensions.width,a.height=s.dimensions.height),typeof s.updateStyle<"u"&&(a.style={...a.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(a.resizing=s.resizing),a.expandParent&&e8(r,a);break}case"remove":return r}return r.push(a),r},n)}function yu(e,t){return lz(e,t)}function su(e,t){return lz(e,t)}const Ws=(e,t)=>({id:e,type:"select",selected:t});function ld(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Ws(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Ws(r.id,!1))),n},[])}const tw=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},b0e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),uz=k.memo(({isSelecting:e,selectionMode:t=Rl.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:s,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=k.useRef(null),h=Kn(),p=k.useRef(0),g=k.useRef(0),_=k.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:m}=fn(b0e,ii),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,g.current=0},S=M=>{o==null||o(M),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=M=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){M.preventDefault();return}a==null||a(M)},C=s?M=>s(M):void 0,x=M=>{const{resetSelectedElements:T,domNode:A}=h.getState();if(_.current=A==null?void 0:A.getBoundingClientRect(),!y||!e||M.button!==0||M.target!==f.current||!_.current)return;const{x:R,y:D}=bl(M,_.current);T(),h.setState({userSelectionRect:{width:0,height:0,startX:R,startY:D,x:R,y:D}}),r==null||r(M)},P=M=>{const{userSelectionRect:T,nodeInternals:A,edges:R,transform:D,onNodesChange:$,onEdgesChange:L,nodeOrigin:O,getNodes:B}=h.getState();if(!e||!_.current||!T)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=bl(M,_.current),j=T.startX??0,q=T.startY??0,Y={...T,x:U.x<j?U.x:j,y:U.y<q?U.y:q,width:Math.abs(U.x-j),height:Math.abs(U.y-q)},Z=B(),V=GB(A,Y,D,t===Rl.Partial,!0,O),K=pT(V,R).map(re=>re.id),ee=V.map(re=>re.id);if(p.current!==ee.length){p.current=ee.length;const re=ld(Z,ee);re.length&&($==null||$(re))}if(g.current!==K.length){g.current=K.length;const re=ld(R,K);re.length&&(L==null||L(re))}h.setState({userSelectionRect:Y})},E=M=>{if(M.button!==0)return;const{userSelectionRect:T}=h.getState();!b&&T&&M.target===f.current&&(S==null||S(M)),h.setState({nodesSelectionActive:p.current>0}),v(),i==null||i(M)},I=M=>{b&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(M)),v()},N=y&&(e||b);return J.createElement("div",{className:to(["react-flow__pane",{dragging:m,selection:e}]),onClick:N?void 0:tw(S,f),onContextMenu:tw(w,f),onWheel:tw(C,f),onMouseEnter:N?void 0:l,onMouseDown:N?x:void 0,onMouseMove:N?P:u,onMouseUp:N?E:void 0,onMouseLeave:N?I:c,ref:f,style:yT},d,J.createElement(v0e,null))});uz.displayName="Pane";function cz(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:cz(n,t):!1}function t8(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 _0e(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!cz(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;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-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height,expandParent:i.expandParent}})}function S0e(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function dz(e,t,n,r,i=[0,0],o){const a=S0e(e,e.extent||r);let s=a;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const c=n.get(e.parentNode),{x:d,y:f}=Fd(c,i).positionAbsolute;s=c&&Ki(d)&&Ki(f)&&Ki(c.width)&&Ki(c.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+c.width-e.width+e.width*i[0],f+c.height-e.height+e.height*i[1]]]:s}else o==null||o("005",ys.error005()),s=a;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const c=n.get(e.parentNode),{x:d,y:f}=Fd(c,i).positionAbsolute;s=[[e.extent[0][0]+d,e.extent[0][1]+f],[e.extent[1][0]+d,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const c=n.get(e.parentNode);l=Fd(c,i).positionAbsolute}const u=s&&s!=="parent"?lT(t,s):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function nw({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 n8=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),s={x:a.width*r[0],y:a.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-a.left-s.x)/n,y:(u.top-a.top-s.y)/n,...sT(l)}})};function gh(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function H5({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),u=s.get(e);if(!u){l==null||l("012",ys.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function x0e(){const e=Kn();return k.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,l={x:(a-r[0])/r[2],y:(s-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 rw(e){return(t,n,r)=>e==null?void 0:e(t,r)}function fz({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const s=Kn(),[l,u]=k.useState(!1),c=k.useRef([]),d=k.useRef({x:null,y:null}),f=k.useRef(0),h=k.useRef(null),p=k.useRef({x:0,y:0}),g=k.useRef(null),_=k.useRef(!1),b=k.useRef(!1),y=x0e();return k.useEffect(()=>{if(e!=null&&e.current){const m=So(e.current),v=({x:C,y:x})=>{const{nodeInternals:P,onNodeDrag:E,onSelectionDrag:I,updateNodePositions:N,nodeExtent:M,snapGrid:T,snapToGrid:A,nodeOrigin:R,onError:D}=s.getState();d.current={x:C,y:x};let $=!1,L={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&M){const B=hT(c.current,R);L=Pg(B)}if(c.current=c.current.map(B=>{const U={x:C-B.distance.x,y:x-B.distance.y};A&&(U.x=T[0]*Math.round(U.x/T[0]),U.y=T[1]*Math.round(U.y/T[1]));const j=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];c.current.length>1&&M&&!B.extent&&(j[0][0]=B.positionAbsolute.x-L.x+M[0][0],j[1][0]=B.positionAbsolute.x+(B.width??0)-L.x2+M[1][0],j[0][1]=B.positionAbsolute.y-L.y+M[0][1],j[1][1]=B.positionAbsolute.y+(B.height??0)-L.y2+M[1][1]);const q=dz(B,U,P,j,R,D);return $=$||B.position.x!==q.position.x||B.position.y!==q.position.y,B.position=q.position,B.positionAbsolute=q.positionAbsolute,B}),!$)return;N(c.current,!0,!0),u(!0);const O=i?E:rw(I);if(O&&g.current){const[B,U]=nw({nodeId:i,dragItems:c.current,nodeInternals:P});O(g.current,B,U)}},S=()=>{if(!h.current)return;const[C,x]=MB(p.current,h.current);if(C!==0||x!==0){const{transform:P,panBy:E}=s.getState();d.current.x=(d.current.x??0)-C/P[2],d.current.y=(d.current.y??0)-x/P[2],E({x:C,y:x})&&v(d.current)}f.current=requestAnimationFrame(S)},w=C=>{var R;const{nodeInternals:x,multiSelectionActive:P,nodesDraggable:E,unselectNodesAndEdges:I,onNodeDragStart:N,onSelectionDragStart:M}=s.getState();b.current=!0;const T=i?N:rw(M);(!a||!o)&&!P&&i&&((R=x.get(i))!=null&&R.selected||I()),i&&o&&a&&H5({id:i,store:s,nodeRef:e});const A=y(C);if(d.current=A,c.current=_0e(x,E,A,i),T&&c.current){const[D,$]=nw({nodeId:i,dragItems:c.current,nodeInternals:x});T(C.sourceEvent,D,$)}};if(t)m.on(".drag",null);else{const C=Mpe().on("start",x=>{const{domNode:P,nodeDragThreshold:E}=s.getState();E===0&&w(x);const I=y(x);d.current=I,h.current=(P==null?void 0:P.getBoundingClientRect())||null,p.current=bl(x.sourceEvent,h.current)}).on("drag",x=>{var N,M;const P=y(x),{autoPanOnNodeDrag:E,nodeDragThreshold:I}=s.getState();if(!_.current&&b.current&&E&&(_.current=!0,S()),!b.current){const T=P.xSnapped-(((N=d==null?void 0:d.current)==null?void 0:N.x)??0),A=P.ySnapped-(((M=d==null?void 0:d.current)==null?void 0:M.y)??0);Math.sqrt(T*T+A*A)>I&&w(x)}(d.current.x!==P.xSnapped||d.current.y!==P.ySnapped)&&c.current&&b.current&&(g.current=x.sourceEvent,p.current=bl(x.sourceEvent,h.current),v(P))}).on("end",x=>{if(b.current&&(u(!1),_.current=!1,b.current=!1,cancelAnimationFrame(f.current),c.current)){const{updateNodePositions:P,nodeInternals:E,onNodeDragStop:I,onSelectionDragStop:N}=s.getState(),M=i?I:rw(N);if(P(c.current,!1,!1),M){const[T,A]=nw({nodeId:i,dragItems:c.current,nodeInternals:E});M(x.sourceEvent,T,A)}}}).filter(x=>{const P=x.target;return!x.button&&(!n||!t8(P,`.${n}`,e))&&(!r||t8(P,r,e))});return m.call(C),()=>{m.on(".drag",null)}}}},[e,t,n,r,o,s,i,a,y]),l}function hz(){const e=Kn();return k.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:s,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=a().filter(y=>y.selected&&(y.draggable||c&&typeof y.draggable>"u")),f=s?l[0]:5,h=s?l[1]:5,p=n.isShiftPressed?4:1,g=n.x*f*p,_=n.y*h*p,b=d.map(y=>{if(y.positionAbsolute){const m={x:y.positionAbsolute.x+g,y:y.positionAbsolute.y+_};s&&(m.x=l[0]*Math.round(m.x/l[0]),m.y=l[1]*Math.round(m.y/l[1]));const{positionAbsolute:v,position:S}=dz(y,m,r,i,void 0,u);y.position=S,y.positionAbsolute=v}return y});o(b,!0,!1)},[])}const Bd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var mh=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:g,style:_,className:b,isDraggable:y,isSelectable:m,isConnectable:v,isFocusable:S,selectNodesOnDrag:w,sourcePosition:C,targetPosition:x,hidden:P,resizeObserver:E,dragHandle:I,zIndex:N,isParent:M,noDragClassName:T,noPanClassName:A,initialized:R,disableKeyboardA11y:D,ariaLabel:$,rfId:L})=>{const O=Kn(),B=k.useRef(null),U=k.useRef(C),j=k.useRef(x),q=k.useRef(r),Y=m||y||c||d||f||h,Z=hz(),V=gh(n,O.getState,d),K=gh(n,O.getState,f),ee=gh(n,O.getState,h),re=gh(n,O.getState,p),fe=gh(n,O.getState,g),Se=Ee=>{const{nodeDragThreshold:tt}=O.getState();if(m&&(!w||!y||tt>0)&&H5({id:n,store:O,nodeRef:B}),c){const ot=O.getState().nodeInternals.get(n);ot&&c(Ee,{...ot})}},Me=Ee=>{if(!V5(Ee))if(NB.includes(Ee.key)&&m){const tt=Ee.key==="Escape";H5({id:n,store:O,unselect:tt,nodeRef:B})}else!D&&y&&u&&Object.prototype.hasOwnProperty.call(Bd,Ee.key)&&(O.setState({ariaLiveMessage:`Moved selected node ${Ee.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),Z({x:Bd[Ee.key].x,y:Bd[Ee.key].y,isShiftPressed:Ee.shiftKey}))};k.useEffect(()=>{if(B.current&&!P){const Ee=B.current;return E==null||E.observe(Ee),()=>E==null?void 0:E.unobserve(Ee)}},[P]),k.useEffect(()=>{const Ee=q.current!==r,tt=U.current!==C,ot=j.current!==x;B.current&&(Ee||tt||ot)&&(Ee&&(q.current=r),tt&&(U.current=C),ot&&(j.current=x),O.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,C,x]);const De=fz({nodeRef:B,disabled:P||!y,noDragClassName:T,handleSelector:I,nodeId:n,isSelectable:m,selectNodesOnDrag:w});return P?null:J.createElement("div",{className:to(["react-flow__node",`react-flow__node-${r}`,{[A]:y},b,{selected:u,selectable:m,parent:M,dragging:De}]),ref:B,style:{zIndex:N,transform:`translate(${s}px,${l}px)`,pointerEvents:Y?"all":"none",visibility:R?"visible":"hidden",..._},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:V,onMouseMove:K,onMouseLeave:ee,onContextMenu:re,onClick:Se,onDoubleClick:fe,onKeyDown:S?Me:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":D?void 0:`${nz}-${L}`,"aria-label":$},J.createElement(Nme,{value:n},J.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:u,isConnectable:v,sourcePosition:C,targetPosition:x,dragging:De,dragHandle:I,zIndex:N})))};return t.displayName="NodeWrapper",k.memo(t)};const w0e=e=>{const t=e.getNodes().filter(n=>n.selected);return{...hT(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function C0e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Kn(),{width:i,height:o,x:a,y:s,transformString:l,userSelectionActive:u}=fn(w0e,ii),c=hz(),d=k.useRef(null);if(k.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),fz({nodeRef:d}),u||!i||!o)return null;const f=e?p=>{const g=r.getState().getNodes().filter(_=>_.selected);e(p,g)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Bd,p.key)&&c({x:Bd[p.key].x,y:Bd[p.key].y,isShiftPressed:p.shiftKey})};return J.createElement("div",{className:to(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},J.createElement("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o,top:s,left:a}}))}var E0e=k.memo(C0e);const T0e=e=>e.nodesSelectionActive,pz=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:s,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:_,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:x,zoomOnDoubleClick:P,panOnDrag:E,defaultViewport:I,translateExtent:N,minZoom:M,maxZoom:T,preventScrolling:A,onSelectionContextMenu:R,noWheelClassName:D,noPanClassName:$,disableKeyboardA11y:L})=>{const O=fn(T0e),B=kg(d),j=kg(b)||E,q=B||f&&j!==!0;return f0e({deleteKeyCode:s,multiSelectionKeyCode:_}),J.createElement(m0e,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:x,zoomOnDoubleClick:P,panOnDrag:!B&&j,defaultViewport:I,translateExtent:N,minZoom:M,maxZoom:T,zoomActivationKeyCode:y,preventScrolling:A,noWheelClassName:D,noPanClassName:$},J.createElement(uz,{onSelectionStart:p,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:j,isSelecting:!!q,selectionMode:h},e,O&&J.createElement(E0e,{onSelectionContextMenu:R,noPanClassName:$,disableKeyboardA11y:L})))};pz.displayName="FlowRenderer";var A0e=k.memo(pz);function P0e(e){return fn(k.useCallback(n=>e?GB(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function k0e(e){const t={input:mh(e.input||ZB),default:mh(e.default||G5),output:mh(e.output||ez),group:mh(e.group||mT)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=mh(e[o]||G5),i),n);return{...t,...r}}const I0e=({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]},M0e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),gz=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=fn(M0e,ii),s=P0e(e.onlyRenderVisibleElements),l=k.useRef(),u=k.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=c,c},[]);return k.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),J.createElement("div",{className:"react-flow__nodes",style:yT},s.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(a==null||a("003",ys.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),p=!!(c.selectable||i&&typeof c.selectable>"u"),g=!!(c.connectable||n&&typeof c.connectable>"u"),_=!!(c.focusable||r&&typeof c.focusable>"u"),b=e.nodeExtent?lT(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,y=(b==null?void 0:b.x)??0,m=(b==null?void 0:b.y)??0,v=I0e({x:y,y:m,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return J.createElement(f,{key:c.id,id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Pe.Bottom,targetPosition:c.targetPosition||Pe.Top,hidden:c.hidden,xPos:y,yPos:m,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:p,isConnectable:g,isFocusable:_,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((S=c[Rn])==null?void 0:S.z)??0,isParent:!!((w=c[Rn])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel})}))};gz.displayName="NodeRenderer";var R0e=k.memo(gz);const O0e=(e,t,n)=>n===Pe.Left?e-t:n===Pe.Right?e+t:e,$0e=(e,t,n)=>n===Pe.Top?e-t:n===Pe.Bottom?e+t:e,r8="react-flow__edgeupdater",i8=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:s})=>J.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:to([r8,`${r8}-${s}`]),cx:O0e(t,r,e),cy:$0e(n,r,e),r,stroke:"transparent",fill:"transparent"}),N0e=()=>!0;var Dc=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:s,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,style:_,source:b,target:y,sourceX:m,sourceY:v,targetX:S,targetY:w,sourcePosition:C,targetPosition:x,elementsSelectable:P,hidden:E,sourceHandleId:I,targetHandleId:N,onContextMenu:M,onMouseEnter:T,onMouseMove:A,onMouseLeave:R,edgeUpdaterRadius:D,onEdgeUpdate:$,onEdgeUpdateStart:L,onEdgeUpdateEnd:O,markerEnd:B,markerStart:U,rfId:j,ariaLabel:q,isFocusable:Y,isUpdatable:Z,pathOptions:V,interactionWidth:K})=>{const ee=k.useRef(null),[re,fe]=k.useState(!1),[Se,Me]=k.useState(!1),De=Kn(),Ee=k.useMemo(()=>`url(#${U5(U,j)})`,[U,j]),tt=k.useMemo(()=>`url(#${U5(B,j)})`,[B,j]);if(E)return null;const ot=rn=>{var _n;const{edges:$t,addSelectedEdges:li,unselectNodesAndEdges:Ri,multiSelectionActive:fo}=De.getState(),jr=$t.find(ui=>ui.id===n);jr&&(P&&(De.setState({nodesSelectionActive:!1}),jr.selected&&fo?(Ri({nodes:[],edges:[jr]}),(_n=ee.current)==null||_n.blur()):li([n])),a&&a(rn,jr))},we=ph(n,De.getState,s),Xn=ph(n,De.getState,M),Vt=ph(n,De.getState,T),Ot=ph(n,De.getState,A),xt=ph(n,De.getState,R),bn=(rn,$t)=>{if(rn.button!==0)return;const{edges:li,isValidConnection:Ri}=De.getState(),fo=$t?y:b,jr=($t?N:I)||null,_n=$t?"target":"source",ui=Ri||N0e,tu=$t,jo=li.find(wt=>wt.id===n);Me(!0),L==null||L(rn,jo,_n);const nu=wt=>{Me(!1),O==null||O(wt,jo,_n)};KB({event:rn,handleId:jr,nodeId:fo,onConnect:wt=>$==null?void 0:$(jo,wt),isTarget:tu,getState:De.getState,setState:De.setState,isValidConnection:ui,edgeUpdaterType:_n,onEdgeUpdateEnd:nu})},Vr=rn=>bn(rn,!0),co=rn=>bn(rn,!1),Mi=()=>fe(!0),ur=()=>fe(!1),Qn=!P&&!a,xr=rn=>{var $t;if(NB.includes(rn.key)&&P){const{unselectNodesAndEdges:li,addSelectedEdges:Ri,edges:fo}=De.getState();rn.key==="Escape"?(($t=ee.current)==null||$t.blur(),li({edges:[fo.find(_n=>_n.id===n)]})):Ri([n])}};return J.createElement("g",{className:to(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:Qn,updating:re}]),onClick:ot,onDoubleClick:we,onContextMenu:Xn,onMouseEnter:Vt,onMouseMove:Ot,onMouseLeave:xt,onKeyDown:Y?xr:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":q===null?void 0:q||`Edge from ${b} to ${y}`,"aria-describedby":Y?`${rz}-${j}`:void 0,ref:ee},!Se&&J.createElement(e,{id:n,source:b,target:y,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,data:o,style:_,sourceX:m,sourceY:v,targetX:S,targetY:w,sourcePosition:C,targetPosition:x,sourceHandleId:I,targetHandleId:N,markerStart:Ee,markerEnd:tt,pathOptions:V,interactionWidth:K}),Z&&J.createElement(J.Fragment,null,(Z==="source"||Z===!0)&&J.createElement(i8,{position:C,centerX:m,centerY:v,radius:D,onMouseDown:Vr,onMouseEnter:Mi,onMouseOut:ur,type:"source"}),(Z==="target"||Z===!0)&&J.createElement(i8,{position:x,centerX:S,centerY:w,radius:D,onMouseDown:co,onMouseEnter:Mi,onMouseOut:ur,type:"target"})))};return t.displayName="EdgeWrapper",k.memo(t)};function D0e(e){const t={default:Dc(e.default||z1),straight:Dc(e.bezier||dT),step:Dc(e.step||cT),smoothstep:Dc(e.step||oS),simplebezier:Dc(e.simplebezier||uT)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=Dc(e[o]||z1),i),n);return{...t,...r}}function o8(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,a=(n==null?void 0:n.height)||t.height;switch(e){case Pe.Top:return{x:r+o/2,y:i};case Pe.Right:return{x:r+o,y:i+a/2};case Pe.Bottom:return{x:r+o/2,y:i+a};case Pe.Left:return{x:r,y:i+a/2}}}function a8(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const L0e=(e,t,n,r,i,o)=>{const a=o8(n,e,t),s=o8(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}};function F0e({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:s,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 c=Pg({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function s8(e){var r,i,o,a,s;const t=((r=e==null?void 0:e[Rn])==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:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const B0e=[{level:0,isMaxLevel:!0,edges:[]}];function z0e(e,t,n=!1){let r=-1;const i=e.reduce((a,s)=>{var c,d;const l=Ki(s.zIndex);let u=l?s.zIndex:0;if(n){const f=t.get(s.target),h=t.get(s.source),p=s.selected||(f==null?void 0:f.selected)||(h==null?void 0:h.selected),g=Math.max(((c=h==null?void 0:h[Rn])==null?void 0:c.z)||0,((d=f==null?void 0:f[Rn])==null?void 0:d.z)||0,1e3);u=(l?s.zIndex:0)+(p?g:0)}return a[u]?a[u].push(s):a[u]=[s],r=u>r?u:r,a},{}),o=Object.entries(i).map(([a,s])=>{const l=+a;return{edges:s,level:l,isMaxLevel:l===r}});return o.length===0?B0e:o}function V0e(e,t,n){const r=fn(k.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),s=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&F0e({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return z0e(r,t,n)}const j0e=({color:e="none",strokeWidth:t=1})=>J.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),U0e=({color:e="none",strokeWidth:t=1})=>J.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),l8={[B1.Arrow]:j0e,[B1.ArrowClosed]:U0e};function G0e(e){const t=Kn();return k.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(l8,e)?l8[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ys.error009(e)),null)},[e])}const H0e=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:s="auto-start-reverse"})=>{const l=G0e(t);return l?J.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:s,refX:"0",refY:"0"},J.createElement(l,{color:n,strokeWidth:a})):null},q0e=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const s=U5(a,t);r.includes(s)||(i.push({id:s,color:a.color||e,...a}),r.push(s))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},mz=({defaultColor:e,rfId:t})=>{const n=fn(k.useCallback(q0e({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return J.createElement("defs",null,n.map(r=>J.createElement(H0e,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};mz.displayName="MarkerDefinitions";var W0e=k.memo(mz);const K0e=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}),yz=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,children:_})=>{const{edgesFocusable:b,edgesUpdatable:y,elementsSelectable:m,width:v,height:S,connectionMode:w,nodeInternals:C,onError:x}=fn(K0e,ii),P=V0e(t,C,n);return v?J.createElement(J.Fragment,null,P.map(({level:E,edges:I,isMaxLevel:N})=>J.createElement("svg",{key:E,style:{zIndex:E},width:v,height:S,className:"react-flow__edges react-flow__container"},N&&J.createElement(W0e,{defaultColor:e,rfId:r}),J.createElement("g",null,I.map(M=>{const[T,A,R]=s8(C.get(M.source)),[D,$,L]=s8(C.get(M.target));if(!R||!L)return null;let O=M.type||"default";i[O]||(x==null||x("011",ys.error011(O)),O="default");const B=i[O]||i.default,U=w===sc.Strict?$.target:($.target??[]).concat($.source??[]),j=a8(A.source,M.sourceHandle),q=a8(U,M.targetHandle),Y=(j==null?void 0:j.position)||Pe.Bottom,Z=(q==null?void 0:q.position)||Pe.Top,V=!!(M.focusable||b&&typeof M.focusable>"u"),K=typeof a<"u"&&(M.updatable||y&&typeof M.updatable>"u");if(!j||!q)return x==null||x("008",ys.error008(j,M)),null;const{sourceX:ee,sourceY:re,targetX:fe,targetY:Se}=L0e(T,j,Y,D,q,Z);return J.createElement(B,{key:M.id,id:M.id,className:to([M.className,o]),type:O,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:ee,sourceY:re,targetX:fe,targetY:Se,sourcePosition:Y,targetPosition:Z,elementsSelectable:m,onEdgeUpdate:a,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,rfId:r,ariaLabel:M.ariaLabel,isFocusable:V,isUpdatable:K,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth})})))),_):null};yz.displayName="EdgeRenderer";var X0e=k.memo(yz);const Q0e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Y0e({children:e}){const t=fn(Q0e);return J.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function Z0e(e){const t=sz(),n=k.useRef(!1);k.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const J0e={[Pe.Left]:Pe.Right,[Pe.Right]:Pe.Left,[Pe.Top]:Pe.Bottom,[Pe.Bottom]:Pe.Top},vz=({nodeId:e,handleType:t,style:n,type:r=Js.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,C,x;const{fromNode:a,handleId:s,toX:l,toY:u,connectionMode:c}=fn(k.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),ii),d=(w=a==null?void 0:a[Rn])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===sc.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!a||!f)return null;const h=s?f.find(P=>P.id===s):f[0],p=h?h.x+h.width/2:(a.width??0)/2,g=h?h.y+h.height/2:a.height??0,_=(((C=a.positionAbsolute)==null?void 0:C.x)??0)+p,b=(((x=a.positionAbsolute)==null?void 0:x.y)??0)+g,y=h==null?void 0:h.position,m=y?J0e[y]:null;if(!y||!m)return null;if(i)return J.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:h,fromX:_,fromY:b,toX:l,toY:u,fromPosition:y,toPosition:m,connectionStatus:o});let v="";const S={sourceX:_,sourceY:b,sourcePosition:y,targetX:l,targetY:u,targetPosition:m};return r===Js.Bezier?[v]=zB(S):r===Js.Step?[v]=j5({...S,borderRadius:0}):r===Js.SmoothStep?[v]=j5(S):r===Js.SimpleBezier?[v]=BB(S):v=`M${_},${b} ${l},${u}`,J.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};vz.displayName="ConnectionLine";const eye=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function tye({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:s,height:l,connectionStatus:u}=fn(eye,ii);return!(i&&o&&s&&a)?null:J.createElement("svg",{style:e,width:s,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},J.createElement("g",{className:to(["react-flow__connection",u])},J.createElement(vz,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function u8(e,t){return k.useRef(null),Kn(),k.useMemo(()=>t(e),[e])}const bz=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:_,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:m,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:x,panActivationKeyCode:P,zoomActivationKeyCode:E,deleteKeyCode:I,onlyRenderVisibleElements:N,elementsSelectable:M,selectNodesOnDrag:T,defaultViewport:A,translateExtent:R,minZoom:D,maxZoom:$,preventScrolling:L,defaultMarkerColor:O,zoomOnScroll:B,zoomOnPinch:U,panOnScroll:j,panOnScrollSpeed:q,panOnScrollMode:Y,zoomOnDoubleClick:Z,panOnDrag:V,onPaneClick:K,onPaneMouseEnter:ee,onPaneMouseMove:re,onPaneMouseLeave:fe,onPaneScroll:Se,onPaneContextMenu:Me,onEdgeUpdate:De,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:ot,onEdgeMouseLeave:we,edgeUpdaterRadius:Xn,onEdgeUpdateStart:Vt,onEdgeUpdateEnd:Ot,noDragClassName:xt,noWheelClassName:bn,noPanClassName:Vr,elevateEdgesOnSelect:co,disableKeyboardA11y:Mi,nodeOrigin:ur,nodeExtent:Qn,rfId:xr})=>{const rn=u8(e,k0e),$t=u8(t,D0e);return Z0e(o),J.createElement(A0e,{onPaneClick:K,onPaneMouseEnter:ee,onPaneMouseMove:re,onPaneMouseLeave:fe,onPaneContextMenu:Me,onPaneScroll:Se,deleteKeyCode:I,selectionKeyCode:S,selectionOnDrag:w,selectionMode:C,onSelectionStart:g,onSelectionEnd:_,multiSelectionKeyCode:x,panActivationKeyCode:P,zoomActivationKeyCode:E,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:B,zoomOnPinch:U,zoomOnDoubleClick:Z,panOnScroll:j,panOnScrollSpeed:q,panOnScrollMode:Y,panOnDrag:V,defaultViewport:A,translateExtent:R,minZoom:D,maxZoom:$,onSelectionContextMenu:p,preventScrolling:L,noDragClassName:xt,noWheelClassName:bn,noPanClassName:Vr,disableKeyboardA11y:Mi},J.createElement(Y0e,null,J.createElement(X0e,{edgeTypes:$t,onEdgeClick:s,onEdgeDoubleClick:u,onEdgeUpdate:De,onlyRenderVisibleElements:N,onEdgeContextMenu:Ee,onEdgeMouseEnter:tt,onEdgeMouseMove:ot,onEdgeMouseLeave:we,onEdgeUpdateStart:Vt,onEdgeUpdateEnd:Ot,edgeUpdaterRadius:Xn,defaultMarkerColor:O,noPanClassName:Vr,elevateEdgesOnSelect:!!co,disableKeyboardA11y:Mi,rfId:xr},J.createElement(tye,{style:y,type:b,component:m,containerStyle:v})),J.createElement("div",{className:"react-flow__edgelabel-renderer"}),J.createElement(R0e,{nodeTypes:rn,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:T,onlyRenderVisibleElements:N,noPanClassName:Vr,noDragClassName:xt,disableKeyboardA11y:Mi,nodeOrigin:ur,nodeExtent:Qn,rfId:xr})))};bz.displayName="GraphView";var nye=k.memo(bz);const q5=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ns={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:q5,nodeExtent:q5,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:sc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold: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:kme,isValidConnection:void 0},rye=()=>Ufe((e,t)=>({...Ns,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:ew(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",a=i?ew(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((g,_)=>{const b=i.get(_.id);if(b){const y=sT(_.nodeElement);!!(y.width&&y.height&&(b.width!==y.width||b.height!==y.height||_.forceUpdate))&&(i.set(b.id,{...b,[Rn]:{...b[Rn],handleBounds:{source:n8(".source",_.nodeElement,f,u),target:n8(".target",_.nodeElement,f,u)}},...y}),g.push({id:b.id,type:"dimensions",dimensions:y}))}return g},[]);oz(i,u);const p=a||o&&!a&&az(t,{initial:!0,...s});e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(s=>{const l={id:s.id,type:"position",dragging:i};return r&&(l.positionAbsolute=s.positionAbsolute,l.position=s.position),l});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const u=yu(n,s()),c=ew(u,i,a,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Ws(l,!0)):(a=ld(o(),n),s=ld(i,[])),G0({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Ws(l,!0)):(a=ld(i,n),s=ld(o(),[])),G0({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),s=r||i,l=a.map(c=>(c.selected=!1,Ws(c.id,!1))),u=s.map(c=>Ws(c.id,!1));G0({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(s=>s.selected).map(s=>Ws(s.id,!1)),a=n.filter(s=>s.selected).map(s=>Ws(s.id,!1));G0({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=lT(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:s,translateExtent:l}=t();if(!a||!s||!n.x&&!n.y)return!1;const u=vl.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,o]],d=a==null?void 0:a.constrain()(u,c,l);return a.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:Ns.connectionNodeId,connectionHandleId:Ns.connectionHandleId,connectionHandleType:Ns.connectionHandleType,connectionStatus:Ns.connectionStatus,connectionStartHandle:Ns.connectionStartHandle,connectionEndHandle:Ns.connectionEndHandle}),reset:()=>e({...Ns})}),Object.is),_z=({children:e})=>{const t=k.useRef(null);return t.current||(t.current=rye()),J.createElement(xme,{value:t.current},e)};_z.displayName="ReactFlowProvider";const Sz=({children:e})=>k.useContext(iS)?J.createElement(J.Fragment,null,e):J.createElement(_z,null,e);Sz.displayName="ReactFlowWrapper";const iye={input:ZB,default:G5,output:ez,group:mT},oye={default:z1,straight:dT,step:cT,smoothstep:oS,simplebezier:uT},aye=[0,0],sye=[15,15],lye={x:0,y:0,zoom:1},uye={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},cye=k.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=iye,edgeTypes:a=oye,onNodeClick:s,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:C,onNodeDrag:x,onNodeDragStop:P,onNodesDelete:E,onEdgesDelete:I,onSelectionChange:N,onSelectionDragStart:M,onSelectionDrag:T,onSelectionDragStop:A,onSelectionContextMenu:R,onSelectionStart:D,onSelectionEnd:$,connectionMode:L=sc.Strict,connectionLineType:O=Js.Bezier,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:j,deleteKeyCode:q="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:Z=!1,selectionMode:V=Rl.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:ee=F1()?"Meta":"Control",zoomActivationKeyCode:re=F1()?"Meta":"Control",snapToGrid:fe=!1,snapGrid:Se=sye,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:De=!0,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:ot,nodeOrigin:we=aye,edgesFocusable:Xn,edgesUpdatable:Vt,elementsSelectable:Ot,defaultViewport:xt=lye,minZoom:bn=.5,maxZoom:Vr=2,translateExtent:co=q5,preventScrolling:Mi=!0,nodeExtent:ur,defaultMarkerColor:Qn="#b1b1b7",zoomOnScroll:xr=!0,zoomOnPinch:rn=!0,panOnScroll:$t=!1,panOnScrollSpeed:li=.5,panOnScrollMode:Ri=Ru.Free,zoomOnDoubleClick:fo=!0,panOnDrag:jr=!0,onPaneClick:_n,onPaneMouseEnter:ui,onPaneMouseMove:tu,onPaneMouseLeave:jo,onPaneScroll:nu,onPaneContextMenu:Xt,children:wt,onEdgeUpdate:Yn,onEdgeContextMenu:Nn,onEdgeDoubleClick:cr,onEdgeMouseEnter:wr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Uo,onEdgeUpdateStart:Cr,onEdgeUpdateEnd:Zn,edgeUpdaterRadius:Ra=10,onNodesChange:Is,onEdgesChange:Ms,noDragClassName:Cc="nodrag",noWheelClassName:Oa="nowheel",noPanClassName:Er="nopan",fitView:ru=!1,fitViewOptions:M2,connectOnClick:R2=!0,attributionPosition:O2,proOptions:$2,defaultEdgeOptions:Rs,elevateNodesOnSelect:N2=!0,elevateEdgesOnSelect:D2=!1,disableKeyboardA11y:Ym=!1,autoPanOnConnect:L2=!0,autoPanOnNodeDrag:F2=!0,connectionRadius:B2=20,isValidConnection:Qf,onError:z2,style:Ec,id:Tc,nodeDragThreshold:V2,...Ac},Zm)=>{const Yf=Tc||"1";return J.createElement("div",{...Ac,style:{...Ec,...uye},ref:Zm,className:to(["react-flow",i]),"data-testid":"rf__wrapper",id:Tc},J.createElement(Sz,null,J.createElement(nye,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:a,connectionLineType:O,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:j,selectionKeyCode:Y,selectionOnDrag:Z,selectionMode:V,deleteKeyCode:q,multiSelectionKeyCode:ee,panActivationKeyCode:K,zoomActivationKeyCode:re,onlyRenderVisibleElements:Me,selectNodesOnDrag:De,defaultViewport:xt,translateExtent:co,minZoom:bn,maxZoom:Vr,preventScrolling:Mi,zoomOnScroll:xr,zoomOnPinch:rn,zoomOnDoubleClick:fo,panOnScroll:$t,panOnScrollSpeed:li,panOnScrollMode:Ri,panOnDrag:jr,onPaneClick:_n,onPaneMouseEnter:ui,onPaneMouseMove:tu,onPaneMouseLeave:jo,onPaneScroll:nu,onPaneContextMenu:Xt,onSelectionContextMenu:R,onSelectionStart:D,onSelectionEnd:$,onEdgeUpdate:Yn,onEdgeContextMenu:Nn,onEdgeDoubleClick:cr,onEdgeMouseEnter:wr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Uo,onEdgeUpdateStart:Cr,onEdgeUpdateEnd:Zn,edgeUpdaterRadius:Ra,defaultMarkerColor:Qn,noDragClassName:Cc,noWheelClassName:Oa,noPanClassName:Er,elevateEdgesOnSelect:D2,rfId:Yf,disableKeyboardA11y:Ym,nodeOrigin:we,nodeExtent:ur}),J.createElement(e0e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:b,nodesDraggable:Ee,nodesConnectable:tt,nodesFocusable:ot,edgesFocusable:Xn,edgesUpdatable:Vt,elementsSelectable:Ot,elevateNodesOnSelect:N2,minZoom:bn,maxZoom:Vr,nodeExtent:ur,onNodesChange:Is,onEdgesChange:Ms,snapToGrid:fe,snapGrid:Se,connectionMode:L,translateExtent:co,connectOnClick:R2,defaultEdgeOptions:Rs,fitView:ru,fitViewOptions:M2,onNodesDelete:E,onEdgesDelete:I,onNodeDragStart:C,onNodeDrag:x,onNodeDragStop:P,onSelectionDrag:T,onSelectionDragStart:M,onSelectionDragStop:A,noPanClassName:Er,nodeOrigin:we,rfId:Yf,autoPanOnConnect:L2,autoPanOnNodeDrag:F2,onError:z2,connectionRadius:B2,isValidConnection:Qf,nodeDragThreshold:V2}),J.createElement(Zme,{onSelectionChange:N}),wt,J.createElement(Eme,{proOptions:$2,position:O2}),J.createElement(o0e,{rfId:Yf,disableKeyboardA11y:Ym})))});cye.displayName="ReactFlow";const dye=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function fVe({children:e}){const t=fn(dye);return t?mi.createPortal(e,t):null}function hVe(){const e=Kn();return k.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((a,s)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${s}"]`);return l&&a.push({id:s,nodeElement:l,forceUpdate:!0}),a},[]);requestAnimationFrame(()=>r(o))},[])}function fye(){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 Ig=Xv("nodes/receivedOpenAPISchema",async(e,{rejectWithValue:t})=>{try{const n=[window.location.origin,"openapi.json"].join("/"),i=await(await fetch(n)).json();return JSON.parse(JSON.stringify(i,fye()))}catch(n){return t({error:n})}}),pVe=500,gVe=320,xz="node-drag-handle",mVe=["ImageField","ImageCollection"],yVe={input:"inputs",output:"outputs"},q0=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection","T2IAdapterCollection","IPAdapterCollection","MetadataItemCollection","MetadataCollection"],Gh=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic","T2IAdapterPolymorphic","IPAdapterPolymorphic","MetadataItemPolymorphic"],vVe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField","T2IAdapterModelField","IPAdapterModelField"],vT={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection",T2IAdapterField:"T2IAdapterCollection",IPAdapterField:"IPAdapterCollection",MetadataItemField:"MetadataItemCollection",MetadataField:"MetadataCollection"},hye=e=>!!(e&&e in vT),wz={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic",T2IAdapterField:"T2IAdapterPolymorphic",IPAdapterField:"IPAdapterPolymorphic",MetadataItemField:"MetadataItemPolymorphic"},pye={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField",T2IAdapterPolymorphic:"T2IAdapterField",IPAdapterPolymorphic:"IPAdapterField",MetadataItemPolymorphic:"MetadataItemField"},bVe=["string","StringPolymorphic","boolean","BooleanPolymorphic","integer","float","FloatPolymorphic","IntegerPolymorphic","enum","ImageField","ImagePolymorphic","MainModelField","SDXLRefinerModelField","VaeModelField","LoRAModelField","ControlNetModelField","ColorField","SDXLMainModelField","Scheduler","IPAdapterModelField","BoardField","T2IAdapterModelField"],gye=e=>!!(e&&e in wz),_Ve={Any:{color:"gray.500",description:"Any field type is accepted.",title:"Any"},MetadataField:{color:"gray.500",description:"A metadata dict.",title:"Metadata Dict"},MetadataCollection:{color:"gray.500",description:"A collection of metadata dicts.",title:"Metadata Dict Collection"},MetadataItemField:{color:"gray.500",description:"A metadata item.",title:"Metadata Item"},MetadataItemCollection:{color:"gray.500",description:"Any field type is accepted.",title:"Metadata Item Collection"},MetadataItemPolymorphic:{color:"gray.500",description:"MetadataItem or MetadataItemCollection field types are accepted.",title:"Metadata Item Polymorphic"},boolean:{color:"green.500",description:X("nodes.booleanDescription"),title:X("nodes.boolean")},BooleanCollection:{color:"green.500",description:X("nodes.booleanCollectionDescription"),title:X("nodes.booleanCollection")},BooleanPolymorphic:{color:"green.500",description:X("nodes.booleanPolymorphicDescription"),title:X("nodes.booleanPolymorphic")},ClipField:{color:"green.500",description:X("nodes.clipFieldDescription"),title:X("nodes.clipField")},Collection:{color:"base.500",description:X("nodes.collectionDescription"),title:X("nodes.collection")},CollectionItem:{color:"base.500",description:X("nodes.collectionItemDescription"),title:X("nodes.collectionItem")},ColorCollection:{color:"pink.300",description:X("nodes.colorCollectionDescription"),title:X("nodes.colorCollection")},ColorField:{color:"pink.300",description:X("nodes.colorFieldDescription"),title:X("nodes.colorField")},ColorPolymorphic:{color:"pink.300",description:X("nodes.colorPolymorphicDescription"),title:X("nodes.colorPolymorphic")},ConditioningCollection:{color:"cyan.500",description:X("nodes.conditioningCollectionDescription"),title:X("nodes.conditioningCollection")},ConditioningField:{color:"cyan.500",description:X("nodes.conditioningFieldDescription"),title:X("nodes.conditioningField")},ConditioningPolymorphic:{color:"cyan.500",description:X("nodes.conditioningPolymorphicDescription"),title:X("nodes.conditioningPolymorphic")},ControlCollection:{color:"teal.500",description:X("nodes.controlCollectionDescription"),title:X("nodes.controlCollection")},ControlField:{color:"teal.500",description:X("nodes.controlFieldDescription"),title:X("nodes.controlField")},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:X("nodes.denoiseMaskFieldDescription"),title:X("nodes.denoiseMaskField")},enum:{color:"blue.500",description:X("nodes.enumDescription"),title:X("nodes.enum")},float:{color:"orange.500",description:X("nodes.floatDescription"),title:X("nodes.float")},FloatCollection:{color:"orange.500",description:X("nodes.floatCollectionDescription"),title:X("nodes.floatCollection")},FloatPolymorphic:{color:"orange.500",description:X("nodes.floatPolymorphicDescription"),title:X("nodes.floatPolymorphic")},ImageCollection:{color:"purple.500",description:X("nodes.imageCollectionDescription"),title:X("nodes.imageCollection")},ImageField:{color:"purple.500",description:X("nodes.imageFieldDescription"),title:X("nodes.imageField")},BoardField:{color:"purple.500",description:X("nodes.imageFieldDescription"),title:X("nodes.imageField")},ImagePolymorphic:{color:"purple.500",description:X("nodes.imagePolymorphicDescription"),title:X("nodes.imagePolymorphic")},integer:{color:"red.500",description:X("nodes.integerDescription"),title:X("nodes.integer")},IntegerCollection:{color:"red.500",description:X("nodes.integerCollectionDescription"),title:X("nodes.integerCollection")},IntegerPolymorphic:{color:"red.500",description:X("nodes.integerPolymorphicDescription"),title:X("nodes.integerPolymorphic")},IPAdapterCollection:{color:"teal.500",description:X("nodes.ipAdapterCollectionDescription"),title:X("nodes.ipAdapterCollection")},IPAdapterField:{color:"teal.500",description:X("nodes.ipAdapterDescription"),title:X("nodes.ipAdapter")},IPAdapterModelField:{color:"teal.500",description:X("nodes.ipAdapterModelDescription"),title:X("nodes.ipAdapterModel")},IPAdapterPolymorphic:{color:"teal.500",description:X("nodes.ipAdapterPolymorphicDescription"),title:X("nodes.ipAdapterPolymorphic")},LatentsCollection:{color:"pink.500",description:X("nodes.latentsCollectionDescription"),title:X("nodes.latentsCollection")},LatentsField:{color:"pink.500",description:X("nodes.latentsFieldDescription"),title:X("nodes.latentsField")},LatentsPolymorphic:{color:"pink.500",description:X("nodes.latentsPolymorphicDescription"),title:X("nodes.latentsPolymorphic")},LoRAModelField:{color:"teal.500",description:X("nodes.loRAModelFieldDescription"),title:X("nodes.loRAModelField")},MainModelField:{color:"teal.500",description:X("nodes.mainModelFieldDescription"),title:X("nodes.mainModelField")},ONNXModelField:{color:"teal.500",description:X("nodes.oNNXModelFieldDescription"),title:X("nodes.oNNXModelField")},Scheduler:{color:"base.500",description:X("nodes.schedulerDescription"),title:X("nodes.scheduler")},SDXLMainModelField:{color:"teal.500",description:X("nodes.sDXLMainModelFieldDescription"),title:X("nodes.sDXLMainModelField")},SDXLRefinerModelField:{color:"teal.500",description:X("nodes.sDXLRefinerModelFieldDescription"),title:X("nodes.sDXLRefinerModelField")},string:{color:"yellow.500",description:X("nodes.stringDescription"),title:X("nodes.string")},StringCollection:{color:"yellow.500",description:X("nodes.stringCollectionDescription"),title:X("nodes.stringCollection")},StringPolymorphic:{color:"yellow.500",description:X("nodes.stringPolymorphicDescription"),title:X("nodes.stringPolymorphic")},T2IAdapterCollection:{color:"teal.500",description:X("nodes.t2iAdapterCollectionDescription"),title:X("nodes.t2iAdapterCollection")},T2IAdapterField:{color:"teal.500",description:X("nodes.t2iAdapterFieldDescription"),title:X("nodes.t2iAdapterField")},T2IAdapterModelField:{color:"teal.500",description:"TODO",title:"T2I-Adapter"},T2IAdapterPolymorphic:{color:"teal.500",description:"T2I-Adapter info passed between nodes.",title:"T2I-Adapter Polymorphic"},UNetField:{color:"red.500",description:X("nodes.uNetFieldDescription"),title:X("nodes.uNetField")},VaeField:{color:"blue.500",description:X("nodes.vaeFieldDescription"),title:X("nodes.vaeField")},VaeModelField:{color:"teal.500",description:X("nodes.vaeModelFieldDescription"),title:X("nodes.vaeModelField")}},c8=(e,t,n)=>{let r=t,i=n;for(;e.find(o=>o.position.x===r&&o.position.y===i);)r=r+50,i=i+50;return{x:r,y:i}},mye=(e,t)=>{if(e==="Collection"&&t==="Collection")return!1;if(e===t)return!0;const n=e==="CollectionItem"&&!q0.includes(t),r=t==="CollectionItem"&&!q0.includes(e)&&!Gh.includes(e),i=Gh.includes(t)&&(()=>{if(!Gh.includes(t))return!1;const c=pye[t],d=vT[c];return e===c||e===d})(),o=e==="Collection"&&(q0.includes(t)||Gh.includes(t)),a=t==="Collection"&&q0.includes(e);return n||r||i||o||a||e==="integer"&&t==="float"||(e==="integer"||e==="float")&&t==="string"||t==="Any"};var yye="\0",lu="\0",d8="",Hr,Du,hi,Jg,Kd,Xd,ji,Jo,nl,ea,rl,Ga,Ha,Qd,Yd,qa,yo,em,W5,hO;let vye=(hO=class{constructor(t){Gt(this,em);Gt(this,Hr,!0);Gt(this,Du,!1);Gt(this,hi,!1);Gt(this,Jg,void 0);Gt(this,Kd,()=>{});Gt(this,Xd,()=>{});Gt(this,ji,{});Gt(this,Jo,{});Gt(this,nl,{});Gt(this,ea,{});Gt(this,rl,{});Gt(this,Ga,{});Gt(this,Ha,{});Gt(this,Qd,0);Gt(this,Yd,0);Gt(this,qa,void 0);Gt(this,yo,void 0);t&&($i(this,Hr,t.hasOwnProperty("directed")?t.directed:!0),$i(this,Du,t.hasOwnProperty("multigraph")?t.multigraph:!1),$i(this,hi,t.hasOwnProperty("compound")?t.compound:!1)),te(this,hi)&&($i(this,qa,{}),$i(this,yo,{}),te(this,yo)[lu]={})}isDirected(){return te(this,Hr)}isMultigraph(){return te(this,Du)}isCompound(){return te(this,hi)}setGraph(t){return $i(this,Jg,t),this}graph(){return te(this,Jg)}setDefaultNodeLabel(t){return $i(this,Kd,t),typeof t!="function"&&$i(this,Kd,()=>t),this}nodeCount(){return te(this,Qd)}nodes(){return Object.keys(te(this,ji))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(te(t,Jo)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(te(t,ea)[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return te(this,ji).hasOwnProperty(t)?(arguments.length>1&&(te(this,ji)[t]=n),this):(te(this,ji)[t]=arguments.length>1?n:te(this,Kd).call(this,t),te(this,hi)&&(te(this,qa)[t]=lu,te(this,yo)[t]={},te(this,yo)[lu][t]=!0),te(this,Jo)[t]={},te(this,nl)[t]={},te(this,ea)[t]={},te(this,rl)[t]={},++eh(this,Qd)._,this)}node(t){return te(this,ji)[t]}hasNode(t){return te(this,ji).hasOwnProperty(t)}removeNode(t){var n=this;if(te(this,ji).hasOwnProperty(t)){var r=i=>n.removeEdge(te(n,Ga)[i]);delete te(this,ji)[t],te(this,hi)&&(Go(this,em,W5).call(this,t),delete te(this,qa)[t],this.children(t).forEach(function(i){n.setParent(i)}),delete te(this,yo)[t]),Object.keys(te(this,Jo)[t]).forEach(r),delete te(this,Jo)[t],delete te(this,nl)[t],Object.keys(te(this,ea)[t]).forEach(r),delete te(this,ea)[t],delete te(this,rl)[t],--eh(this,Qd)._}return this}setParent(t,n){if(!te(this,hi))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=lu;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),Go(this,em,W5).call(this,t),te(this,qa)[t]=n,te(this,yo)[n][t]=!0,this}parent(t){if(te(this,hi)){var n=te(this,qa)[t];if(n!==lu)return n}}children(t=lu){if(te(this,hi)){var n=te(this,yo)[t];if(n)return Object.keys(n)}else{if(t===lu)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=te(this,nl)[t];if(n)return Object.keys(n)}successors(t){var n=te(this,rl)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:te(this,Hr),multigraph:te(this,Du),compound:te(this,hi)});n.setGraph(this.graph());var r=this;Object.entries(te(this,ji)).forEach(function([a,s]){t(a)&&n.setNode(a,s)}),Object.values(te(this,Ga)).forEach(function(a){n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,r.edge(a))});var i={};function o(a){var s=r.parent(a);return s===void 0||n.hasNode(s)?(i[a]=s,s):s in i?i[s]:o(s)}return te(this,hi)&&n.nodes().forEach(a=>n.setParent(a,o(a))),n}setDefaultEdgeLabel(t){return $i(this,Xd,t),typeof t!="function"&&$i(this,Xd,()=>t),this}edgeCount(){return te(this,Yd)}edges(){return Object.values(te(this,Ga))}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,a){return i.length>1?r.setEdge(o,a,n):r.setEdge(o,a),a}),this}setEdge(){var t,n,r,i,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,n=a.w,r=a.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=a,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var s=Hh(te(this,Hr),t,n,r);if(te(this,Ha).hasOwnProperty(s))return o&&(te(this,Ha)[s]=i),this;if(r!==void 0&&!te(this,Du))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),te(this,Ha)[s]=o?i:te(this,Xd).call(this,t,n,r);var l=bye(te(this,Hr),t,n,r);return t=l.v,n=l.w,Object.freeze(l),te(this,Ga)[s]=l,f8(te(this,nl)[n],t),f8(te(this,rl)[t],n),te(this,Jo)[n][s]=l,te(this,ea)[t][s]=l,eh(this,Yd)._++,this}edge(t,n,r){var i=arguments.length===1?iw(te(this,Hr),arguments[0]):Hh(te(this,Hr),t,n,r);return te(this,Ha)[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?iw(te(this,Hr),arguments[0]):Hh(te(this,Hr),t,n,r);return te(this,Ha).hasOwnProperty(i)}removeEdge(t,n,r){var i=arguments.length===1?iw(te(this,Hr),arguments[0]):Hh(te(this,Hr),t,n,r),o=te(this,Ga)[i];return o&&(t=o.v,n=o.w,delete te(this,Ha)[i],delete te(this,Ga)[i],h8(te(this,nl)[n],t),h8(te(this,rl)[t],n),delete te(this,Jo)[n][i],delete te(this,ea)[t][i],eh(this,Yd)._--),this}inEdges(t,n){var r=te(this,Jo)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=te(this,ea)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},Hr=new WeakMap,Du=new WeakMap,hi=new WeakMap,Jg=new WeakMap,Kd=new WeakMap,Xd=new WeakMap,ji=new WeakMap,Jo=new WeakMap,nl=new WeakMap,ea=new WeakMap,rl=new WeakMap,Ga=new WeakMap,Ha=new WeakMap,Qd=new WeakMap,Yd=new WeakMap,qa=new WeakMap,yo=new WeakMap,em=new WeakSet,W5=function(t){delete te(this,yo)[te(this,qa)[t]][t]},hO);function f8(e,t){e[t]?e[t]++:e[t]=1}function h8(e,t){--e[t]||delete e[t]}function Hh(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}return i+d8+o+d8+(r===void 0?yye:r)}function bye(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function iw(e,t){return Hh(e,t.v,t.w,t.name)}var bT=vye,_ye="2.1.13",Sye={Graph:bT,version:_ye},xye=bT,wye={write:Cye,read:Aye};function Cye(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Eye(e),edges:Tye(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function Eye(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Tye(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Aye(e){var t=new xye(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var Pye=kye;function kye(e){var t={},n=[],r;function i(o){t.hasOwnProperty(o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}var pr,Wa,tm,K5,nm,X5,Zd,Qy,pO;let Iye=(pO=class{constructor(){Gt(this,tm);Gt(this,nm);Gt(this,Zd);Gt(this,pr,[]);Gt(this,Wa,{})}size(){return te(this,pr).length}keys(){return te(this,pr).map(function(t){return t.key})}has(t){return te(this,Wa).hasOwnProperty(t)}priority(t){var n=te(this,Wa)[t];if(n!==void 0)return te(this,pr)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return te(this,pr)[0].key}add(t,n){var r=te(this,Wa);if(t=String(t),!r.hasOwnProperty(t)){var i=te(this,pr),o=i.length;return r[t]=o,i.push({key:t,priority:n}),Go(this,nm,X5).call(this,o),!0}return!1}removeMin(){Go(this,Zd,Qy).call(this,0,te(this,pr).length-1);var t=te(this,pr).pop();return delete te(this,Wa)[t.key],Go(this,tm,K5).call(this,0),t.key}decrease(t,n){var r=te(this,Wa)[t];if(n>te(this,pr)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+te(this,pr)[r].priority+" New: "+n);te(this,pr)[r].priority=n,Go(this,nm,X5).call(this,r)}},pr=new WeakMap,Wa=new WeakMap,tm=new WeakSet,K5=function(t){var n=te(this,pr),r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(Go(this,Zd,Qy).call(this,t,o),Go(this,tm,K5).call(this,o)))},nm=new WeakSet,X5=function(t){for(var n=te(this,pr),r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)Go(this,Zd,Qy).call(this,t,i),t=i},Zd=new WeakSet,Qy=function(t,n){var r=te(this,pr),i=te(this,Wa),o=r[t],a=r[n];r[t]=a,r[n]=o,i[a.key]=t,i[o.key]=n},pO);var Cz=Iye,Mye=Cz,Ez=Oye,Rye=()=>1;function Oye(e,t,n,r){return $ye(e,String(t),n||Rye,r||function(i){return e.outEdges(i)})}function $ye(e,t,n,r){var i={},o=new Mye,a,s,l=function(u){var c=u.v!==a?u.v:u.w,d=i[c],f=n(u),h=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=a,o.decrease(c,h))};for(e.nodes().forEach(function(u){var c=u===t?0:Number.POSITIVE_INFINITY;i[u]={distance:c},o.add(u,c)});o.size()>0&&(a=o.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(l);return i}var Nye=Ez,Dye=Lye;function Lye(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=Nye(e,i,t,n),r},{})}var Tz=Fye;function Fye(e){var t=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){r.hasOwnProperty(c)?r[c].onStack&&(s.lowlink=Math.min(s.lowlink,r[c].index)):(o(c),s.lowlink=Math.min(s.lowlink,r[c].lowlink))}),s.lowlink===s.index){var l=[],u;do u=n.pop(),r[u].onStack=!1,l.push(u);while(a!==u);i.push(l)}}return e.nodes().forEach(function(a){r.hasOwnProperty(a)||o(a)}),i}var Bye=Tz,zye=Vye;function Vye(e){return Bye(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var jye=Gye,Uye=()=>1;function Gye(e,t,n){return Hye(e,t||Uye,n||function(r){return e.outEdges(r)})}function Hye(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(a){o!==a&&(r[o][a]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(a){var s=a.v===o?a.w:a.v,l=t(a);r[o][s]={distance:l,predecessor:o}})}),i.forEach(function(o){var a=r[o];i.forEach(function(s){var l=r[s];i.forEach(function(u){var c=l[o],d=a[u],f=l[u],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function Az(e){var t={},n={},r=[];function i(o){if(n.hasOwnProperty(o))throw new Q5;t.hasOwnProperty(o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new Q5;return r}class Q5 extends Error{constructor(){super(...arguments)}}var Pz=Az;Az.CycleException=Q5;var p8=Pz,qye=Wye;function Wye(e){try{p8(e)}catch(t){if(t instanceof p8.CycleException)return!1;throw t}return!0}var kz=Kye;function Kye(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?s=>e.successors(s):s=>e.neighbors(s),i=n==="post"?Xye:Qye,o=[],a={};return t.forEach(s=>{if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);i(s,r,a,o)}),o}function Xye(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):n.hasOwnProperty(o[0])||(n[o[0]]=!0,i.push([o[0],!0]),Iz(t(o[0]),a=>i.push([a,!1])))}}function Qye(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();n.hasOwnProperty(o)||(n[o]=!0,r.push(o),Iz(t(o),a=>i.push(a)))}}function Iz(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var Yye=kz,Zye=Jye;function Jye(e,t){return Yye(e,t,"post")}var eve=kz,tve=nve;function nve(e,t){return eve(e,t,"pre")}var rve=bT,ive=Cz,ove=ave;function ave(e,t){var n=new rve,r={},i=new ive,o;function a(l){var u=l.v===o?l.w:l.v,c=i.priority(u);if(c!==void 0){var d=t(l);d<c&&(r[u]=o,i.decrease(u,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(l){i.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(o=i.removeMin(),r.hasOwnProperty(o))n.setEdge(o,r[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(a)}return n}var sve={components:Pye,dijkstra:Ez,dijkstraAll:Dye,findCycles:zye,floydWarshall:jye,isAcyclic:qye,postorder:Zye,preorder:tve,prim:ove,tarjan:Tz,topsort:Pz},g8=Sye,lve={Graph:g8.Graph,json:wye,alg:sve,version:g8.version};const m8=Bl(lve),y8=(e,t,n,r)=>{const i=new m8.Graph;return n.forEach(o=>{i.setNode(o.id)}),r.forEach(o=>{i.setEdge(o.source,o.target)}),i.setEdge(e,t),m8.alg.isAcyclic(i)},v8=(e,t,n,r,i)=>{let o=!0;return t==="source"?e.find(a=>a.target===r.id&&a.targetHandle===i.name)&&(o=!1):e.find(a=>a.source===r.id&&a.sourceHandle===i.name)&&(o=!1),mye(n,i.type)||(o=!1),o},b8=(e,t,n,r,i,o,a)=>{if(e.id===r)return null;const s=o=="source"?e.data.inputs:e.data.outputs;if(s[i]){const l=s[i],u=o=="source"?r:e.id,c=o=="source"?e.id:r,d=o=="source"?i:l.name,f=o=="source"?l.name:i,h=y8(u,c,t,n),p=v8(n,o,a,e,l);if(h&&p)return{source:u,sourceHandle:d,target:c,targetHandle:f}}for(const l in s){const u=s[l],c=o=="source"?r:e.id,d=o=="source"?e.id:r,f=o=="source"?i:u.name,h=o=="source"?u.name:i,p=y8(c,d,t,n),g=v8(n,o,a,e,u);if(p&&g)return{source:c,sourceHandle:f,target:d,targetHandle:h}}return null},uve="1.0.0",ow={status:wu.PENDING,error:null,progress:null,progressImage:null,outputs:[]},Y5={meta:{version:uve},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},Mz={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,currentConnectionFieldType:null,connectionMade:!1,modifyingEdge:!1,addNewNodePosition:null,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],workflow:Y5,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:Rl.Partial},Ar=(e,t)=>{var l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(c=>c.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!on(a))return;const s=(u=a.data)==null?void 0:u.inputs[r];s&&o>-1&&(s.value=i)},Rz=Wt({name:"nodes",initialState:Mz,reducers:{nodesChanged:(e,t)=>{e.nodes=yu(t.payload,e.nodes)},nodeReplaced:(e,t)=>{const n=e.nodes.findIndex(r=>r.id===t.payload.nodeId);n<0||(e.nodes[n]=t.payload.node)},nodeAdded:(e,t)=>{var i,o;const n=t.payload,r=c8(e.nodes,((i=e.addNewNodePosition)==null?void 0:i.x)??n.position.x,((o=e.addNewNodePosition)==null?void 0:o.y)??n.position.y);if(n.position=r,n.selected=!0,e.nodes=yu(e.nodes.map(a=>({id:a.id,type:"select",selected:!1})),e.nodes),e.edges=su(e.edges.map(a=>({id:a.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),!!on(n)){if(e.nodeExecutionStates[n.id]={nodeId:n.id,...ow},e.connectionStartParams){const{nodeId:a,handleId:s,handleType:l}=e.connectionStartParams;if(a&&s&&l&&e.currentConnectionFieldType){const u=b8(n,e.nodes,e.edges,a,s,l,e.currentConnectionFieldType);u&&(e.edges=Uh({...u,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}},edgeChangeStarted:e=>{e.modifyingEdge=!0},edgesChanged:(e,t)=>{e.edges=su(t.payload,e.edges)},edgeAdded:(e,t)=>{e.edges=Uh(t.payload,e.edges)},edgeUpdated:(e,t)=>{const{oldEdge:n,newConnection:r}=t.payload;e.edges=Vme(n,r,e.edges)},connectionStarted:(e,t)=>{var l;e.connectionStartParams=t.payload,e.connectionMade=e.modifyingEdge;const{nodeId:n,handleId:r,handleType:i}=t.payload;if(!n||!r)return;const o=e.nodes.findIndex(u=>u.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!on(a))return;const s=i==="source"?a.data.outputs[r]:a.data.inputs[r];e.currentConnectionFieldType=(s==null?void 0:s.type)??null},connectionMade:(e,t)=>{e.currentConnectionFieldType&&(e.edges=Uh({...t.payload,type:"default"},e.edges),e.connectionMade=!0)},connectionEnded:(e,t)=>{var n;if(e.connectionMade)e.connectionStartParams=null,e.currentConnectionFieldType=null;else if(e.mouseOverNode){const r=e.nodes.findIndex(o=>o.id===e.mouseOverNode),i=(n=e.nodes)==null?void 0:n[r];if(i&&e.connectionStartParams){const{nodeId:o,handleId:a,handleType:s}=e.connectionStartParams;if(o&&a&&s&&e.currentConnectionFieldType){const l=b8(i,e.nodes,e.edges,o,a,s,e.currentConnectionFieldType);l&&(e.edges=Uh({...l,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}else e.addNewNodePosition=t.payload.cursorPosition,e.isAddNodePopoverOpen=!0;e.modifyingEdge=!1},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=g5(e.workflow.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`)},workflowExposedFieldRemoved:(e,t)=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(n=>!SE(n,t.payload))},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(s=>s.id===n);if(!on(o))return;const a=o.data.inputs[r];a&&(a.label=i)},nodeEmbedWorkflowChanged:(e,t)=>{var a;const{nodeId:n,embedWorkflow:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];on(o)&&(o.data.embedWorkflow=r)},nodeUseCacheChanged:(e,t)=>{var a;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];on(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var a;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];on(o)&&(o.data.isIntermediate=r)},nodeIsOpenChanged:(e,t)=>{var s;const{nodeId:n,isOpen:r}=t.payload,i=e.nodes.findIndex(l=>l.id===n),o=(s=e.nodes)==null?void 0:s[i];if(!on(o)&&!bI(o)||(o.data.isOpen=r,!on(o)))return;const a=pT([o],e.edges);if(r)a.forEach(l=>{delete l.hidden}),a.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(u=>u.id!==l.id))});else{const l=Bme(o,e.nodes,e.edges).filter(d=>on(d)&&d.data.isOpen===!1),u=Fme(o,e.nodes,e.edges).filter(d=>on(d)&&d.data.isOpen===!1),c=[];a.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=c.find(g=>g.source===d.source&&g.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}if(d.source===n&&u.find(p=>p.id===d.target)){const p=c.find(g=>g.source===d.source&&g.target===d.target);d.hidden=!0,p?p.data={count:(((h=p.data)==null?void 0:h.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}}),c.length&&(e.edges=su(c.map(d=>({type:"add",item:d})),e.edges))}},edgeDeleted:(e,t)=>{e.edges=e.edges.filter(n=>n.id!==t.payload)},edgesDeleted:(e,t)=>{const r=t.payload.filter(i=>i.type==="collapsed");if(r.length){const i=[];r.forEach(o=>{e.edges.forEach(a=>{a.source===o.source&&a.target===o.target&&i.push({id:a.id,type:"remove"})})}),e.edges=su(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),on(n)&&delete e.nodeExecutionStates[n.id]})},nodeLabelChanged:(e,t)=>{var a;const{nodeId:n,label:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];on(o)&&(o.data.label=r)},nodeNotesChanged:(e,t)=>{var a;const{nodeId:n,notes:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];on(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=yu(e.nodes.map(r=>({id:r.id,type:"select",selected:r.id===n})),e.nodes)},selectedNodesChanged:(e,t)=>{e.selectedNodes=t.payload},selectedEdgesChanged:(e,t)=>{e.selectedEdges=t.payload},fieldStringValueChanged:(e,t)=>{Ar(e,t)},fieldNumberValueChanged:(e,t)=>{Ar(e,t)},fieldBooleanValueChanged:(e,t)=>{Ar(e,t)},fieldBoardValueChanged:(e,t)=>{Ar(e,t)},fieldImageValueChanged:(e,t)=>{Ar(e,t)},fieldColorValueChanged:(e,t)=>{Ar(e,t)},fieldMainModelValueChanged:(e,t)=>{Ar(e,t)},fieldRefinerModelValueChanged:(e,t)=>{Ar(e,t)},fieldVaeModelValueChanged:(e,t)=>{Ar(e,t)},fieldLoRAModelValueChanged:(e,t)=>{Ar(e,t)},fieldControlNetModelValueChanged:(e,t)=>{Ar(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{Ar(e,t)},fieldT2IAdapterModelValueChanged:(e,t)=>{Ar(e,t)},fieldEnumModelValueChanged:(e,t)=>{Ar(e,t)},fieldSchedulerValueChanged:(e,t)=>{Ar(e,t)},imageCollectionFieldValueChanged:(e,t)=>{var u,c;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n);if(o===-1)return;const a=(u=e.nodes)==null?void 0:u[o];if(!on(a))return;const s=(c=a.data)==null?void 0:c.inputs[r];if(!s)return;const l=Ye(s.value);if(!l){s.value=i;return}s.value=g5(l.concat(i),"image_name")},notesNodeValueChanged:(e,t)=>{var a;const{nodeId:n,value:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];bI(o)&&(o.data.notes=r)},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[],e.workflow=Ye(Y5)},shouldValidateGraphChanged:(e,t)=>{e.shouldValidateGraph=t.payload},shouldAnimateEdgesChanged:(e,t)=>{e.shouldAnimateEdges=t.payload},shouldSnapToGridChanged:(e,t)=>{e.shouldSnapToGrid=t.payload},shouldColorEdgesChanged:(e,t)=>{e.shouldColorEdges=t.payload},nodeOpacityChanged:(e,t)=>{e.nodeOpacity=t.payload},workflowNameChanged:(e,t)=>{e.workflow.name=t.payload},workflowDescriptionChanged:(e,t)=>{e.workflow.description=t.payload},workflowTagsChanged:(e,t)=>{e.workflow.tags=t.payload},workflowAuthorChanged:(e,t)=>{e.workflow.author=t.payload},workflowNotesChanged:(e,t)=>{e.workflow.notes=t.payload},workflowVersionChanged:(e,t)=>{e.workflow.version=t.payload},workflowContactChanged:(e,t)=>{e.workflow.contact=t.payload},workflowLoaded:(e,t)=>{const{nodes:n,edges:r,...i}=t.payload;e.workflow=i,e.nodes=yu(n.map(o=>({item:{...o,dragHandle:`.${xz}`},type:"add"})),[]),e.edges=su(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,a)=>(o[a.id]={nodeId:a.id,...ow},o),{})},workflowReset:e=>{e.workflow=Ye(Y5)},viewportChanged:(e,t)=>{e.viewport=t.payload},mouseOverFieldChanged:(e,t)=>{e.mouseOverField=t.payload},mouseOverNodeChanged:(e,t)=>{e.mouseOverNode=t.payload},selectedAll:e=>{e.nodes=yu(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=su(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{if(e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Ye),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Ye),e.nodesToCopy.length>0){const t={x:0,y:0};e.nodesToCopy.forEach(n=>{const r=.15*(n.width??0),i=.5*(n.height??0);t.x+=n.position.x+r,t.y+=n.position.y+i}),t.x/=e.nodesToCopy.length,t.y/=e.nodesToCopy.length,e.nodesToCopy.forEach(n=>{n.position.x-=t.x,n.position.y-=t.y})}},selectionPasted:(e,t)=>{const{cursorPosition:n}=t.payload,r=e.nodesToCopy.map(Ye),i=r.map(c=>c.data.id),o=e.edgesToCopy.filter(c=>i.includes(c.source)&&i.includes(c.target)).map(Ye);o.forEach(c=>c.selected=!0),r.forEach(c=>{const d=yl();o.forEach(h=>{h.source===c.data.id&&(h.source=d,h.id=h.id.replace(c.data.id,d)),h.target===c.data.id&&(h.target=d,h.id=h.id.replace(c.data.id,d))}),c.selected=!0,c.id=d,c.data.id=d;const f=c8(e.nodes,c.position.x+((n==null?void 0:n.x)??0),c.position.y+((n==null?void 0:n.y)??0));c.position=f});const a=r.map(c=>({item:c,type:"add"})),s=e.nodes.map(c=>({id:c.data.id,type:"select",selected:!1})),l=o.map(c=>({item:c,type:"add"})),u=e.edges.map(c=>({id:c.id,type:"select",selected:!1}));e.nodes=yu(a.concat(s),e.nodes),e.edges=su(l.concat(u),e.edges),r.forEach(c=>{e.nodeExecutionStates[c.id]={nodeId:c.id,...ow}})},addNodePopoverOpened:e=>{e.addNewNodePosition=null,e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1,e.connectionStartParams=null,e.currentConnectionFieldType=null},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?Rl.Full:Rl.Partial}},extraReducers:e=>{e.addCase(Ig.pending,t=>{t.isReady=!1}),e.addCase(EE,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=wu.IN_PROGRESS)}),e.addCase(AE,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=wu.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(i_,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=wu.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(PE,(t,n)=>{const{source_node_id:r,step:i,total_steps:o,progress_image:a}=n.payload.data,s=t.nodeExecutionStates[r];s&&(s.status=wu.IN_PROGRESS,s.progress=(i+1)/o,s.progressImage=a??null)}),e.addCase(o_,(t,n)=>{["in_progress"].includes(n.payload.data.queue_item.status)&&ps(t.nodeExecutionStates,r=>{r.status=wu.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{addNodePopoverClosed:wVe,addNodePopoverOpened:CVe,addNodePopoverToggled:EVe,connectionEnded:TVe,connectionMade:AVe,connectionStarted:PVe,edgeDeleted:kVe,edgeChangeStarted:IVe,edgesChanged:MVe,edgesDeleted:RVe,edgeUpdated:OVe,fieldBoardValueChanged:$Ve,fieldBooleanValueChanged:NVe,fieldColorValueChanged:DVe,fieldControlNetModelValueChanged:LVe,fieldEnumModelValueChanged:FVe,fieldImageValueChanged:aS,fieldIPAdapterModelValueChanged:BVe,fieldT2IAdapterModelValueChanged:zVe,fieldLabelChanged:VVe,fieldLoRAModelValueChanged:jVe,fieldMainModelValueChanged:UVe,fieldNumberValueChanged:GVe,fieldRefinerModelValueChanged:HVe,fieldSchedulerValueChanged:qVe,fieldStringValueChanged:WVe,fieldVaeModelValueChanged:KVe,imageCollectionFieldValueChanged:XVe,mouseOverFieldChanged:QVe,mouseOverNodeChanged:YVe,nodeAdded:ZVe,nodeReplaced:Oz,nodeEditorReset:cve,nodeEmbedWorkflowChanged:JVe,nodeExclusivelySelected:eje,nodeIsIntermediateChanged:tje,nodeIsOpenChanged:nje,nodeLabelChanged:rje,nodeNotesChanged:ije,nodeOpacityChanged:oje,nodesChanged:aje,nodesDeleted:sje,nodeTemplatesBuilt:$z,nodeUseCacheChanged:lje,notesNodeValueChanged:uje,selectedAll:cje,selectedEdgesChanged:dje,selectedNodesChanged:fje,selectionCopied:hje,selectionModeChanged:pje,selectionPasted:gje,shouldAnimateEdgesChanged:mje,shouldColorEdgesChanged:yje,shouldShowFieldTypeLegendChanged:vje,shouldShowMinimapPanelChanged:bje,shouldSnapToGridChanged:_je,shouldValidateGraphChanged:Sje,viewportChanged:xje,workflowAuthorChanged:wje,workflowContactChanged:Cje,workflowDescriptionChanged:Eje,workflowExposedFieldAdded:dve,workflowExposedFieldRemoved:Tje,workflowLoaded:fve,workflowNameChanged:Aje,workflowNotesChanged:Pje,workflowTagsChanged:kje,workflowVersionChanged:Ije,edgeAdded:Mje}=Rz.actions,hve=Rz.reducer,Nz={esrganModelName:"RealESRGAN_x4plus.pth"},Dz=Wt({name:"postprocessing",initialState:Nz,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:Rje}=Dz.actions,pve=Dz.reducer,Lz={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},Fz=Wt({name:"sdxl",initialState:Lz,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:Oje,setNegativeStylePromptSDXL:$je,setShouldConcatSDXLStylePrompt:Nje,setShouldUseSDXLRefiner:gve,setSDXLImg2ImgDenoisingStrength:Dje,refinerModelChanged:_8,setRefinerSteps:Lje,setRefinerCFGScale:Fje,setRefinerScheduler:Bje,setRefinerPositiveAestheticScore:zje,setRefinerNegativeAestheticScore:Vje,setRefinerStart:jje}=Fz.actions,mve=Fz.reducer,yve=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),vs=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},Bz={isInitialized:!1,isConnected:!1,shouldConfirmOnDelete:!0,enableImageDebugging:!1,toastQueue:[],denoiseProgress:null,shouldAntialiasProgressImage:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,language:"en",shouldUseNSFWChecker:!1,shouldUseWatermarker:!1,shouldEnableInformationalPopovers:!1,status:"DISCONNECTED"},zz=Wt({name:"system",initialState:Bz,reducers:{setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},languageChanged:(e,t)=>{e.language=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload},setShouldEnableInformationalPopovers(e,t){e.shouldEnableInformationalPopovers=t.payload},isInitializedChanged(e,t){e.isInitialized=t.payload}},extraReducers(e){e.addCase(CE,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(UD,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(EE,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(PE,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:a,graph_execution_state_id:s,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:yve(r,i,o),progress_image:a,session_id:s,batch_id:l},t.status="PROCESSING"}),e.addCase(AE,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(WD,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(QD,t=>{t.status="LOADING_MODEL"}),e.addCase(ZD,t=>{t.status="CONNECTED"}),e.addCase(o_,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.queue_item.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(wve,(t,n)=>{t.toastQueue.push(vs({title:X("toast.serverError"),status:"error",description:wE(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:Uje,setEnableImageDebugging:Gje,addToast:it,clearToastQueue:vve,consoleLogLevelChanged:Hje,shouldLogToConsoleChanged:qje,shouldAntialiasProgressImageChanged:Wje,languageChanged:Kje,shouldUseNSFWCheckerChanged:bve,shouldUseWatermarkerChanged:_ve,setShouldEnableInformationalPopovers:Xje,isInitializedChanged:Sve}=zz.actions,xve=zz.reducer,wve=si(i_,eL,nL),Cve={searchFolder:null,advancedAddScanModel:null},Vz=Wt({name:"modelmanager",initialState:Cve,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:Qje,setAdvancedAddScanModel:Yje}=Vz.actions,Eve=Vz.reducer,jz={shift:!1,ctrl:!1,meta:!1},Uz=Wt({name:"hotkeys",initialState:jz,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:Zje,ctrlKeyPressed:Jje,metaKeyPressed:eUe}=Uz.actions,Tve=Uz.reducer,Gz={activeTab:"txt2img",shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},Hz=Wt({name:"ui",initialState:Gz,reducers:{setActiveTab:(e,t)=>{e.activeTab=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},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker},setShouldAutoChangeDimensions:(e,t)=>{e.shouldAutoChangeDimensions=t.payload},contextMenusClosed:e=>{e.globalContextMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(c_,t=>{t.activeTab="img2img"})}}),{setActiveTab:qz,setShouldShowImageDetails:tUe,setShouldUseCanvasBetaLayout:nUe,setShouldShowExistingModelsInSearch:rUe,setShouldUseSliders:iUe,setShouldHidePreview:oUe,setShouldShowProgressInViewer:aUe,favoriteSchedulersChanged:sUe,toggleEmbeddingPicker:lUe,setShouldAutoChangeDimensions:uUe,contextMenusClosed:cUe,panelsChanged:dUe}=Hz.actions,Ave=Hz.reducer,Pve=pq(iX);Wz=Z5=void 0;var kve=Pve,Ive=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return kve.compose.apply(void 0,n)(c)(d)}}},o=function(){for(var u,c,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(u=n).push.apply(u,f.map(function(p){return p(r)})),(c=t).push.apply(c,f)},a=function(u){var c=t.findIndex(function(d){return d===u});if(c===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(d,f){return f!==c}),n=n.filter(function(d,f){return f!==c})},s=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:a,resetMiddlewares:s}},sS=Ive(),Mve=sS.enhancer,Rve=sS.addMiddleware;sS.removeMiddleware;var Ove=sS.resetMiddlewares,Z5=Rve,Wz=Ove,J5="@@REMEMBER_REHYDRATED",$ve="@@REMEMBER_PERSISTED";function e3(e){"@babel/helpers - typeof";return e3=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},e3(e)}var Kz=function(t,n){if(t===null||e3(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},Nve=function(t,n){var r=0,i;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,a);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,a),clearTimeout(i),i=null},u)}},Dve=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function S8(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function _T(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){S8(o,r,i,a,s,"next",l)}function s(l){S8(o,r,i,a,s,"throw",l)}a(void 0)})}}var Lve=function(){var e=_T(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield r.getItem("".concat(i,"rootState"));return a==null?{}:Kz(o(a,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),Fve=function(){var e=_T(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield Promise.all(n.map(function(s){return r.getItem("".concat(i).concat(s))}));return n.reduce(function(s,l,u){return a[u]!==null&&a[u]!==void 0&&(s[l]=o(a[u],l)),s},{})});return function(n){return e.apply(this,arguments)}}(),Bve=function(){var e=_T(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.unserialize,l={};try{var u=a?Lve:Fve;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:s})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:J5,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function aw(e,t){return jve(e)||Vve(e,t)||Xz(e,t)||zve()}function zve(){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 Vve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],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)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jve(e){if(Array.isArray(e))return e}function sw(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Xz(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,a=!1,s;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function Xz(e,t){if(e){if(typeof e=="string")return x8(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 x8(e,t)}}function x8(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 j1(e){"@babel/helpers - typeof";return j1=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},j1(e)}var w8=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},C8=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},Uve=function e(t,n){if(t===n)return!0;if(j1(t)!=="object"||j1(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(C8(t)&&C8(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=w8(t),a=w8(n);if(o==="DataView"&&a==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&a==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&a==="Map"){if(t.size!==n.size)return!1;var s=sw(t.entries()),l;try{for(s.s();!(l=s.n()).done;){var u=aw(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(x){s.e(x)}finally{s.f()}var d=sw(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=aw(f.value,2),p=h[0],g=h[1];if(!e(g,n.get(p)))return!1}}catch(x){d.e(x)}finally{d.f()}return!0}if(o==="Set"&&a==="Set"){if(t.size!==n.size)return!1;var _=sw(t.entries()),b;try{for(_.s();!(b=_.n()).done;){var y=aw(b.value,1),m=y[0];if(!n.has(m))return!1}}catch(x){_.e(x)}finally{_.f()}return!0}if(o==="Date"&&a==="Date")return+t==+n;var v=Object.keys(t);if(v.length!==Object.keys(n).length)return!1;for(var S=v.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,v[S]))return!1;for(var w=v.length;w--!==0;){var C=v[w];if(!e(t[C],n[C]))return!1}return o!=="Object"&&a!=="Object"?t===n:!0};const ST=Uve;function E8(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function Qz(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){E8(o,r,i,a,s,"next",l)}function s(l){E8(o,r,i,a,s,"throw",l)}a(void 0)})}}var Gve=function(){var e=Qz(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;if(!ST(t,n))return o.setItem("".concat(i,"rootState"),a(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),Hve=function(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;return Promise.all(Object.keys(t).map(function(s){return ST(t[s],n[s])?Promise.resolve():o.setItem("".concat(i).concat(s),a(t[s],s))}))},qve=function(){var e=Qz(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,a=r.persistWholeStore,s=r.serialize;try{var l=a?Gve:Hve;yield l(t,n,{prefix:i,driver:o,serialize:s})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function T8(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function A8(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){T8(o,r,i,a,s,"next",l)}function s(l){T8(o,r,i,a,s,"throw",l)}a(void 0)})}}var Wve=function(){var e=A8(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize,s=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,c=r.persistWholeStore;yield Bve(t,n,{prefix:i,driver:o,unserialize:s,persistWholeStore:c});var d={},f=function(){var h=A8(function*(){var p=Kz(t.getState(),n);yield qve(p,d,{prefix:i,driver:o,serialize:a,persistWholeStore:c}),ST(p,d)||t.dispatch({type:$ve,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(Dve(f,u)):t.subscribe(Nve(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const Kve=Wve;function Mg(e){"@babel/helpers - typeof";return Mg=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},Mg(e)}function P8(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 lw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P8(Object(n),!0).forEach(function(r){Xve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xve(e,t,n){return t=Qve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qve(e){var t=Yve(e,"string");return Mg(t)==="symbol"?t:String(t)}function Yve(e,t){if(Mg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zve=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=lw({},r));var o=typeof t=="function"?t:Mf(t);switch(i.type){case J5:{var a=lw(lw({},n.state),i.payload||{});return n.state=o(a,{type:J5,payload:a}),n.state}default:return o(r,i)}}},Jve=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,a=r.serialize,s=a===void 0?function(_,b){return JSON.stringify(_)}:a,l=r.unserialize,u=l===void 0?function(_,b){return JSON.parse(_)}:l,c=r.persistThrottle,d=c===void 0?100:c,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h;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 g=function(b){return function(y,m,v){var S=b(y,m,v);return Kve(S,n,{driver:t,prefix:o,serialize:s,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return g};const fUe=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],e1e="@@invokeai-",t1e=["cursorPosition"],n1e=["pendingControlImages"],r1e=["prompts"],i1e=["selection","selectedBoardId","galleryView"],o1e=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy","connectionMade","modifyingEdge","addNewNodePosition"],a1e=[],s1e=[],l1e=["isInitialized","isConnected","denoiseProgress","status"],u1e=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],c1e={canvas:t1e,gallery:i1e,generation:a1e,nodes:o1e,postprocessing:s1e,system:l1e,ui:u1e,controlNet:n1e,dynamicPrompts:r1e},d1e=(e,t)=>{const n=$f(e,c1e[t]??[]);return JSON.stringify(n)},f1e={canvas:aF,gallery:YF,generation:NE,nodes:Mz,postprocessing:Nz,system:Bz,config:BD,ui:Gz,hotkeys:jz,controlAdapters:m5,dynamicPrompts:QE,sdxl:Lz},h1e=(e,t)=>ID(JSON.parse(e),f1e[t]),p1e=ge("nodes/textToImageGraphBuilt"),g1e=ge("nodes/imageToImageGraphBuilt"),Yz=ge("nodes/canvasGraphBuilt"),m1e=ge("nodes/nodesGraphBuilt"),y1e=si(p1e,g1e,Yz,m1e),v1e=ge("nodes/workflowLoadRequested"),b1e=ge("nodes/updateAllNodesRequested"),_1e=e=>{if(y1e(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return Ig.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:$z.match(e)?{...e,payload:"<Node templates omitted>"}:e},S1e=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],x1e=e=>e,w1e=si(kle,Ile),C1e=()=>{pe({matcher:w1e,effect:async(e,{dispatch:t,getState:n})=>{const r=se("canvas"),i=n(),{batchIds:o}=i.canvas;try{const a=t(un.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:s}=await a.unwrap();a.reset(),s>0&&(r.debug(`Canceled ${s} canvas batches`),t(it({title:X("queue.cancelBatchSucceeded"),status:"success"}))),t($le())}catch{r.error("Failed to cancel canvas batches"),t(it({title:X("queue.cancelBatchFailed"),status:"error"}))}}})};ge("app/appStarted");const E1e=()=>{pe({matcher:ce.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==Vi({board_id:"none",categories:Fn}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Lt.getSelectors().selectAll(i)[0];t(pa(o??null))}}})},T1e=()=>{pe({matcher:un.endpoints.enqueueBatch.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=un.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(un.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},Zz=Do.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}),getInvocationCacheStatus:e.query({query:()=>({url:"app/invocation_cache/status",method:"GET"}),providesTags:["InvocationCacheStatus"]}),clearInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache",method:"DELETE"}),invalidatesTags:["InvocationCacheStatus"]}),enableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/enable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]}),disableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/disable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]})})}),{useGetAppVersionQuery:hUe,useGetAppConfigQuery:pUe,useClearInvocationCacheMutation:gUe,useDisableInvocationCacheMutation:mUe,useEnableInvocationCacheMutation:yUe,useGetInvocationCacheStatusQuery:vUe}=Zz,A1e=()=>{pe({matcher:Zz.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,a=t().generation.infillMethod;r.includes(a)||n(lae(r[0])),i.includes("nsfw_checker")||n(bve(!1)),o.includes("invisible_watermark")||n(_ve(!1))}})},P1e=ge("app/appStarted"),k1e=()=>{pe({actionCreator:P1e,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})};function I1e(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 M1e(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 R1e=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(M1e(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=I1e(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}(),hr="-ms-",U1="-moz-",ft="-webkit-",Jz="comm",xT="rule",wT="decl",O1e="@import",eV="@keyframes",$1e="@layer",N1e=Math.abs,lS=String.fromCharCode,D1e=Object.assign;function L1e(e,t){return ir(e,0)^45?(((t<<2^ir(e,0))<<2^ir(e,1))<<2^ir(e,2))<<2^ir(e,3):0}function tV(e){return e.trim()}function F1e(e,t){return(e=t.exec(e))?e[0]:e}function ht(e,t,n){return e.replace(t,n)}function t3(e,t){return e.indexOf(t)}function ir(e,t){return e.charCodeAt(t)|0}function Rg(e,t,n){return e.slice(t,n)}function ta(e){return e.length}function CT(e){return e.length}function W0(e,t){return t.push(e),e}function B1e(e,t){return e.map(t).join("")}var uS=1,_f=1,nV=0,oi=0,wn=0,Lf="";function cS(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:uS,column:_f,length:a,return:""}}function yh(e,t){return D1e(cS("",null,null,"",null,null,0),e,{length:-e.length},t)}function z1e(){return wn}function V1e(){return wn=oi>0?ir(Lf,--oi):0,_f--,wn===10&&(_f=1,uS--),wn}function Si(){return wn=oi<nV?ir(Lf,oi++):0,_f++,wn===10&&(_f=1,uS++),wn}function ma(){return ir(Lf,oi)}function Yy(){return oi}function Im(e,t){return Rg(Lf,e,t)}function Og(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 rV(e){return uS=_f=1,nV=ta(Lf=e),oi=0,[]}function iV(e){return Lf="",e}function Zy(e){return tV(Im(oi-1,n3(e===91?e+2:e===40?e+1:e)))}function j1e(e){for(;(wn=ma())&&wn<33;)Si();return Og(e)>2||Og(wn)>3?"":" "}function U1e(e,t){for(;--t&&Si()&&!(wn<48||wn>102||wn>57&&wn<65||wn>70&&wn<97););return Im(e,Yy()+(t<6&&ma()==32&&Si()==32))}function n3(e){for(;Si();)switch(wn){case e:return oi;case 34:case 39:e!==34&&e!==39&&n3(wn);break;case 40:e===41&&n3(e);break;case 92:Si();break}return oi}function G1e(e,t){for(;Si()&&e+wn!==47+10;)if(e+wn===42+42&&ma()===47)break;return"/*"+Im(t,oi-1)+"*"+lS(e===47?e:Si())}function H1e(e){for(;!Og(ma());)Si();return Im(e,oi)}function q1e(e){return iV(Jy("",null,null,null,[""],e=rV(e),0,[0],e))}function Jy(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,g=1,_=1,b=1,y=0,m="",v=i,S=o,w=r,C=m;_;)switch(p=y,y=Si()){case 40:if(p!=108&&ir(C,d-1)==58){t3(C+=ht(Zy(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:C+=Zy(y);break;case 9:case 10:case 13:case 32:C+=j1e(p);break;case 92:C+=U1e(Yy()-1,7);continue;case 47:switch(ma()){case 42:case 47:W0(W1e(G1e(Si(),Yy()),t,n),l);break;default:C+="/"}break;case 123*g:s[u++]=ta(C)*b;case 125*g:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+c:b==-1&&(C=ht(C,/\f/g,"")),h>0&&ta(C)-d&&W0(h>32?I8(C+";",r,n,d-1):I8(ht(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(W0(w=k8(C,t,n,u,c,i,s,m,v=[],S=[],d),o),y===123)if(c===0)Jy(C,t,w,w,v,o,d,s,S);else switch(f===99&&ir(C,3)===110?100:f){case 100:case 108:case 109:case 115:Jy(e,w,w,r&&W0(k8(e,w,w,0,0,i,s,m,i,v=[],d),S),i,S,d,s,r?v:S);break;default:Jy(C,w,w,w,[""],S,0,s,S)}}u=c=h=0,g=b=1,m=C="",d=a;break;case 58:d=1+ta(C),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&V1e()==125)continue}switch(C+=lS(y),y*g){case 38:b=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(ta(C)-1)*b,b=1;break;case 64:ma()===45&&(C+=Zy(Si())),f=ma(),c=d=ta(m=C+=H1e(Yy())),y++;break;case 45:p===45&&ta(C)==2&&(g=0)}}return o}function k8(e,t,n,r,i,o,a,s,l,u,c){for(var d=i-1,f=i===0?o:[""],h=CT(f),p=0,g=0,_=0;p<r;++p)for(var b=0,y=Rg(e,d+1,d=N1e(g=a[p])),m=e;b<h;++b)(m=tV(g>0?f[b]+" "+y:ht(y,/&\f/g,f[b])))&&(l[_++]=m);return cS(e,t,n,i===0?xT:s,l,u,c)}function W1e(e,t,n){return cS(e,t,n,Jz,lS(z1e()),Rg(e,2,-2),0)}function I8(e,t,n,r){return cS(e,t,n,wT,Rg(e,0,r),Rg(e,r+1,-1),r)}function zd(e,t){for(var n="",r=CT(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function K1e(e,t,n,r){switch(e.type){case $1e:if(e.children.length)break;case O1e:case wT:return e.return=e.return||e.value;case Jz:return"";case eV:return e.return=e.value+"{"+zd(e.children,r)+"}";case xT:e.value=e.props.join(",")}return ta(n=zd(e.children,r))?e.return=e.value+"{"+n+"}":""}function X1e(e){var t=CT(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function Q1e(e){return function(t){t.root||(t=t.return)&&e(t)}}var M8=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 oV(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Y1e=function(t,n,r){for(var i=0,o=0;i=o,o=ma(),i===38&&o===12&&(n[r]=1),!Og(o);)Si();return Im(t,oi)},Z1e=function(t,n){var r=-1,i=44;do switch(Og(i)){case 0:i===38&&ma()===12&&(n[r]=1),t[r]+=Y1e(oi-1,n,r);break;case 2:t[r]+=Zy(i);break;case 4:if(i===44){t[++r]=ma()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=lS(i)}while(i=Si());return t},J1e=function(t,n){return iV(Z1e(rV(t),n))},R8=new WeakMap,ebe=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&&!R8.get(r))&&!i){R8.set(t,!0);for(var o=[],a=J1e(n,o),s=r.props,l=0,u=0;l<a.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,s[c]):s[c]+" "+a[l]}}},tbe=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function aV(e,t){switch(L1e(e,t)){case 5103:return ft+"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 ft+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ft+e+U1+e+hr+e+e;case 6828:case 4268:return ft+e+hr+e+e;case 6165:return ft+e+hr+"flex-"+e+e;case 5187:return ft+e+ht(e,/(\w+).+(:[^]+)/,ft+"box-$1$2"+hr+"flex-$1$2")+e;case 5443:return ft+e+hr+"flex-item-"+ht(e,/flex-|-self/,"")+e;case 4675:return ft+e+hr+"flex-line-pack"+ht(e,/align-content|flex-|-self/,"")+e;case 5548:return ft+e+hr+ht(e,"shrink","negative")+e;case 5292:return ft+e+hr+ht(e,"basis","preferred-size")+e;case 6060:return ft+"box-"+ht(e,"-grow","")+ft+e+hr+ht(e,"grow","positive")+e;case 4554:return ft+ht(e,/([^-])(transform)/g,"$1"+ft+"$2")+e;case 6187:return ht(ht(ht(e,/(zoom-|grab)/,ft+"$1"),/(image-set)/,ft+"$1"),e,"")+e;case 5495:case 3959:return ht(e,/(image-set\([^]*)/,ft+"$1$`$1");case 4968:return ht(ht(e,/(.+:)(flex-)?(.*)/,ft+"box-pack:$3"+hr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ft+e+e;case 4095:case 3583:case 4068:case 2532:return ht(e,/(.+)-inline(.+)/,ft+"$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(ta(e)-1-t>6)switch(ir(e,t+1)){case 109:if(ir(e,t+4)!==45)break;case 102:return ht(e,/(.+:)(.+)-([^]+)/,"$1"+ft+"$2-$3$1"+U1+(ir(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~t3(e,"stretch")?aV(ht(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ir(e,t+1)!==115)break;case 6444:switch(ir(e,ta(e)-3-(~t3(e,"!important")&&10))){case 107:return ht(e,":",":"+ft)+e;case 101:return ht(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ft+(ir(e,14)===45?"inline-":"")+"box$3$1"+ft+"$2$3$1"+hr+"$2box$3")+e}break;case 5936:switch(ir(e,t+11)){case 114:return ft+e+hr+ht(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ft+e+hr+ht(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ft+e+hr+ht(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ft+e+hr+e+e}return e}var nbe=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case wT:t.return=aV(t.value,t.length);break;case eV:return zd([yh(t,{value:ht(t.value,"@","@"+ft)})],i);case xT:if(t.length)return B1e(t.props,function(o){switch(F1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return zd([yh(t,{props:[ht(o,/:(read-\w+)/,":"+U1+"$1")]})],i);case"::placeholder":return zd([yh(t,{props:[ht(o,/:(plac\w+)/,":"+ft+"input-$1")]}),yh(t,{props:[ht(o,/:(plac\w+)/,":"+U1+"$1")]}),yh(t,{props:[ht(o,/:(plac\w+)/,hr+"input-$1")]})],i)}return""})}},rbe=[nbe],ibe=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(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=t.stylisPlugins||rbe,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)o[_[b]]=!0;s.push(g)});var l,u=[ebe,tbe];{var c,d=[K1e,Q1e(function(g){c.insert(g)})],f=X1e(u.concat(i,d)),h=function(_){return zd(q1e(_),f)};l=function(_,b,y,m){c=y,h(_?_+"{"+b.styles+"}":b.styles),m&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new R1e({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(s),p},obe=!0;function abe(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var sV=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||obe===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},lV=function(t,n,r){sV(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 sbe(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 lbe={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},ube=/[A-Z]|^ms/g,cbe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,uV=function(t){return t.charCodeAt(1)===45},O8=function(t){return t!=null&&typeof t!="boolean"},uw=oV(function(e){return uV(e)?e:e.replace(ube,"-$&").toLowerCase()}),$8=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(cbe,function(r,i,o){return na={name:i,styles:o,next:na},i})}return lbe[t]!==1&&!uV(t)&&typeof n=="number"&&n!==0?n+"px":n};function $g(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 na={name:n.name,styles:n.styles,next:na},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)na={name:r.name,styles:r.styles,next:na},r=r.next;var i=n.styles+";";return i}return dbe(e,t,n)}case"function":{if(e!==void 0){var o=na,a=n(e);return na=o,$g(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function dbe(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=$g(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object")t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":O8(a)&&(r+=uw(o)+":"+$8(o,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var s=0;s<a.length;s++)O8(a[s])&&(r+=uw(o)+":"+$8(o,a[s])+";");else{var l=$g(e,t,a);switch(o){case"animation":case"animationName":{r+=uw(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var N8=/label:\s*([^\s;\n{]+)\s*(;|$)/g,na,ET=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="";na=void 0;var a=t[0];a==null||a.raw===void 0?(i=!1,o+=$g(r,n,a)):o+=a[0];for(var s=1;s<t.length;s++)o+=$g(r,n,t[s]),i&&(o+=a[s]);N8.lastIndex=0;for(var l="",u;(u=N8.exec(o))!==null;)l+="-"+u[1];var c=sbe(o)+l;return{name:c,styles:o,next:na}},fbe=function(t){return t()},cV=nP["useInsertionEffect"]?nP["useInsertionEffect"]:!1,hbe=cV||fbe,D8=cV||k.useLayoutEffect,dV=k.createContext(typeof HTMLElement<"u"?ibe({key:"css"}):null);dV.Provider;var fV=function(t){return k.forwardRef(function(n,r){var i=k.useContext(dV);return t(n,i,r)})},Ng=k.createContext({}),pbe=function(t,n){if(typeof n=="function"){var r=n(t);return r}return b1({},t,n)},gbe=M8(function(e){return M8(function(t){return pbe(e,t)})}),mbe=function(t){var n=k.useContext(Ng);return t.theme!==n&&(n=gbe(n)(t.theme)),k.createElement(Ng.Provider,{value:n},t.children)},hV=fV(function(e,t){var n=e.styles,r=ET([n],void 0,k.useContext(Ng)),i=k.useRef();return D8(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),D8(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&lV(t,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",r,a,!1)},[t,r.name]),null});function ybe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ET(t)}var vbe=function(){var t=ybe.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_"}}};function bbe(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Mm(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:a}=e,s=k.createContext(a);s.displayName=t;function l(){var u;const c=k.useContext(s);if(!c&&n){const d=new Error(o??bbe(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[s.Provider,l,s]}var[_be,Sbe]=Mm({strict:!1,name:"PortalManagerContext"});function xbe(e){const{children:t,zIndex:n}=e;return oe.jsx(_be,{value:{zIndex:n},children:t})}xbe.displayName="PortalManager";var G1=globalThis!=null&&globalThis.document?k.useLayoutEffect:k.useEffect,[pV,wbe]=Mm({strict:!1,name:"PortalContext"}),TT="chakra-portal",Cbe=".chakra-portal",Ebe=e=>oe.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),Tbe=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=k.useState(null),o=k.useRef(null),[,a]=k.useState({});k.useEffect(()=>a({}),[]);const s=wbe(),l=Sbe();G1(()=>{if(!r)return;const c=r.ownerDocument,d=t?s??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=TT,d.appendChild(o.current),a({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?oe.jsx(Ebe,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?mi.createPortal(oe.jsx(pV,{value:o.current,children:u}),o.current):oe.jsx("span",{ref:c=>{c&&i(c)}})},Abe=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=k.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=TT),l},[i]),[,s]=k.useState({});return G1(()=>s({}),[]),G1(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?mi.createPortal(oe.jsx(pV,{value:r?a:null,children:t}),a):null};function dS(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?oe.jsx(Abe,{containerRef:n,...r}):oe.jsx(Tbe,{...r})}dS.className=TT;dS.selector=Cbe;dS.displayName="Portal";function gV(){const e=k.useContext(Ng);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var AT=k.createContext({});AT.displayName="ColorModeContext";function fS(){const e=k.useContext(AT);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function bUe(e,t){const{colorMode:n}=fS();return n==="dark"?t:e}function mV(){const e=fS(),t=gV();return{...e,theme:t}}function Pbe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function kbe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function _Ue(e,t,n){const r=gV();return Ibe(e,t,n)(r)}function Ibe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var c,d;if(e==="breakpoints")return Pbe(o,l,(c=a[u])!=null?c:l);const f=`${e}.${l}`;return kbe(o,f,(d=a[u])!=null?d:l)});return Array.isArray(t)?s:s[0]}}var Kl=(...e)=>e.filter(Boolean).join(" ");function Mbe(){return!1}function ya(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var SUe=e=>{const{condition:t,message:n}=e;t&&Mbe()&&console.warn(n)};function ua(e,...t){return Rbe(e)?e(...t):e}var Rbe=e=>typeof e=="function",xUe=e=>e?"":void 0,wUe=e=>e?!0:void 0;function CUe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function EUe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var H1={exports:{}};H1.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",g="[object Map]",_="[object Number]",b="[object Null]",y="[object Object]",m="[object Proxy]",v="[object RegExp]",S="[object Set]",w="[object String]",C="[object Undefined]",x="[object WeakMap]",P="[object ArrayBuffer]",E="[object DataView]",I="[object Float32Array]",N="[object Float64Array]",M="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",R="[object Uint8Array]",D="[object Uint8ClampedArray]",$="[object Uint16Array]",L="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,j={};j[I]=j[N]=j[M]=j[T]=j[A]=j[R]=j[D]=j[$]=j[L]=!0,j[s]=j[l]=j[P]=j[c]=j[E]=j[d]=j[f]=j[h]=j[g]=j[_]=j[y]=j[v]=j[S]=j[w]=j[x]=!1;var q=typeof He=="object"&&He&&He.Object===Object&&He,Y=typeof self=="object"&&self&&self.Object===Object&&self,Z=q||Y||Function("return this")(),V=t&&!t.nodeType&&t,K=V&&!0&&e&&!e.nodeType&&e,ee=K&&K.exports===V,re=ee&&q.process,fe=function(){try{var z=K&&K.require&&K.require("util").types;return z||re&&re.binding&&re.binding("util")}catch{}}(),Se=fe&&fe.isTypedArray;function Me(z,G,Q){switch(Q.length){case 0:return z.call(G);case 1:return z.call(G,Q[0]);case 2:return z.call(G,Q[0],Q[1]);case 3:return z.call(G,Q[0],Q[1],Q[2])}return z.apply(G,Q)}function De(z,G){for(var Q=-1,me=Array(z);++Q<z;)me[Q]=G(Q);return me}function Ee(z){return function(G){return z(G)}}function tt(z,G){return z==null?void 0:z[G]}function ot(z,G){return function(Q){return z(G(Q))}}var we=Array.prototype,Xn=Function.prototype,Vt=Object.prototype,Ot=Z["__core-js_shared__"],xt=Xn.toString,bn=Vt.hasOwnProperty,Vr=function(){var z=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||"");return z?"Symbol(src)_1."+z:""}(),co=Vt.toString,Mi=xt.call(Object),ur=RegExp("^"+xt.call(bn).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qn=ee?Z.Buffer:void 0,xr=Z.Symbol,rn=Z.Uint8Array,$t=Qn?Qn.allocUnsafe:void 0,li=ot(Object.getPrototypeOf,Object),Ri=Object.create,fo=Vt.propertyIsEnumerable,jr=we.splice,_n=xr?xr.toStringTag:void 0,ui=function(){try{var z=j2(Object,"defineProperty");return z({},"",{}),z}catch{}}(),tu=Qn?Qn.isBuffer:void 0,jo=Math.max,nu=Date.now,Xt=j2(Z,"Map"),wt=j2(Object,"create"),Yn=function(){function z(){}return function(G){if(!iu(G))return{};if(Ri)return Ri(G);z.prototype=G;var Q=new z;return z.prototype=void 0,Q}}();function Nn(z){var G=-1,Q=z==null?0:z.length;for(this.clear();++G<Q;){var me=z[G];this.set(me[0],me[1])}}function cr(){this.__data__=wt?wt(null):{},this.size=0}function wr(z){var G=this.has(z)&&delete this.__data__[z];return this.size-=G?1:0,G}function Ur(z){var G=this.__data__;if(wt){var Q=G[z];return Q===r?void 0:Q}return bn.call(G,z)?G[z]:void 0}function Uo(z){var G=this.__data__;return wt?G[z]!==void 0:bn.call(G,z)}function Cr(z,G){var Q=this.__data__;return this.size+=this.has(z)?0:1,Q[z]=wt&&G===void 0?r:G,this}Nn.prototype.clear=cr,Nn.prototype.delete=wr,Nn.prototype.get=Ur,Nn.prototype.has=Uo,Nn.prototype.set=Cr;function Zn(z){var G=-1,Q=z==null?0:z.length;for(this.clear();++G<Q;){var me=z[G];this.set(me[0],me[1])}}function Ra(){this.__data__=[],this.size=0}function Is(z){var G=this.__data__,Q=Ec(G,z);if(Q<0)return!1;var me=G.length-1;return Q==me?G.pop():jr.call(G,Q,1),--this.size,!0}function Ms(z){var G=this.__data__,Q=Ec(G,z);return Q<0?void 0:G[Q][1]}function Cc(z){return Ec(this.__data__,z)>-1}function Oa(z,G){var Q=this.__data__,me=Ec(Q,z);return me<0?(++this.size,Q.push([z,G])):Q[me][1]=G,this}Zn.prototype.clear=Ra,Zn.prototype.delete=Is,Zn.prototype.get=Ms,Zn.prototype.has=Cc,Zn.prototype.set=Oa;function Er(z){var G=-1,Q=z==null?0:z.length;for(this.clear();++G<Q;){var me=z[G];this.set(me[0],me[1])}}function ru(){this.size=0,this.__data__={hash:new Nn,map:new(Xt||Zn),string:new Nn}}function M2(z){var G=Jm(this,z).delete(z);return this.size-=G?1:0,G}function R2(z){return Jm(this,z).get(z)}function O2(z){return Jm(this,z).has(z)}function $2(z,G){var Q=Jm(this,z),me=Q.size;return Q.set(z,G),this.size+=Q.size==me?0:1,this}Er.prototype.clear=ru,Er.prototype.delete=M2,Er.prototype.get=R2,Er.prototype.has=O2,Er.prototype.set=$2;function Rs(z){var G=this.__data__=new Zn(z);this.size=G.size}function N2(){this.__data__=new Zn,this.size=0}function D2(z){var G=this.__data__,Q=G.delete(z);return this.size=G.size,Q}function Ym(z){return this.__data__.get(z)}function L2(z){return this.__data__.has(z)}function F2(z,G){var Q=this.__data__;if(Q instanceof Zn){var me=Q.__data__;if(!Xt||me.length<n-1)return me.push([z,G]),this.size=++Q.size,this;Q=this.__data__=new Er(me)}return Q.set(z,G),this.size=Q.size,this}Rs.prototype.clear=N2,Rs.prototype.delete=D2,Rs.prototype.get=Ym,Rs.prototype.has=L2,Rs.prototype.set=F2;function B2(z,G){var Q=H2(z),me=!Q&&G2(z),nt=!Q&&!me&&WA(z),Ct=!Q&&!me&&!nt&&XA(z),jt=Q||me||nt||Ct,Xe=jt?De(z.length,String):[],Ut=Xe.length;for(var Oi in z)(G||bn.call(z,Oi))&&!(jt&&(Oi=="length"||nt&&(Oi=="offset"||Oi=="parent")||Ct&&(Oi=="buffer"||Oi=="byteLength"||Oi=="byteOffset")||HA(Oi,Ut)))&&Xe.push(Oi);return Xe}function Qf(z,G,Q){(Q!==void 0&&!e0(z[G],Q)||Q===void 0&&!(G in z))&&Tc(z,G,Q)}function z2(z,G,Q){var me=z[G];(!(bn.call(z,G)&&e0(me,Q))||Q===void 0&&!(G in z))&&Tc(z,G,Q)}function Ec(z,G){for(var Q=z.length;Q--;)if(e0(z[Q][0],G))return Q;return-1}function Tc(z,G,Q){G=="__proto__"&&ui?ui(z,G,{configurable:!0,enumerable:!0,value:Q,writable:!0}):z[G]=Q}var V2=KH();function Ac(z){return z==null?z===void 0?C:b:_n&&_n in Object(z)?XH(z):tq(z)}function Zm(z){return Zf(z)&&Ac(z)==s}function Yf(z){if(!iu(z)||JH(z))return!1;var G=W2(z)?ur:B;return G.test(oq(z))}function LH(z){return Zf(z)&&KA(z.length)&&!!j[Ac(z)]}function FH(z){if(!iu(z))return eq(z);var G=qA(z),Q=[];for(var me in z)me=="constructor"&&(G||!bn.call(z,me))||Q.push(me);return Q}function GA(z,G,Q,me,nt){z!==G&&V2(G,function(Ct,jt){if(nt||(nt=new Rs),iu(Ct))BH(z,G,jt,Q,GA,me,nt);else{var Xe=me?me(U2(z,jt),Ct,jt+"",z,G,nt):void 0;Xe===void 0&&(Xe=Ct),Qf(z,jt,Xe)}},QA)}function BH(z,G,Q,me,nt,Ct,jt){var Xe=U2(z,Q),Ut=U2(G,Q),Oi=jt.get(Ut);if(Oi){Qf(z,Q,Oi);return}var ci=Ct?Ct(Xe,Ut,Q+"",z,G,jt):void 0,Jf=ci===void 0;if(Jf){var K2=H2(Ut),X2=!K2&&WA(Ut),ZA=!K2&&!X2&&XA(Ut);ci=Ut,K2||X2||ZA?H2(Xe)?ci=Xe:aq(Xe)?ci=HH(Xe):X2?(Jf=!1,ci=jH(Ut,!0)):ZA?(Jf=!1,ci=GH(Ut,!0)):ci=[]:sq(Ut)||G2(Ut)?(ci=Xe,G2(Xe)?ci=lq(Xe):(!iu(Xe)||W2(Xe))&&(ci=QH(Ut))):Jf=!1}Jf&&(jt.set(Ut,ci),nt(ci,Ut,me,Ct,jt),jt.delete(Ut)),Qf(z,Q,ci)}function zH(z,G){return rq(nq(z,G,YA),z+"")}var VH=ui?function(z,G){return ui(z,"toString",{configurable:!0,enumerable:!1,value:cq(G),writable:!0})}:YA;function jH(z,G){if(G)return z.slice();var Q=z.length,me=$t?$t(Q):new z.constructor(Q);return z.copy(me),me}function UH(z){var G=new z.constructor(z.byteLength);return new rn(G).set(new rn(z)),G}function GH(z,G){var Q=G?UH(z.buffer):z.buffer;return new z.constructor(Q,z.byteOffset,z.length)}function HH(z,G){var Q=-1,me=z.length;for(G||(G=Array(me));++Q<me;)G[Q]=z[Q];return G}function qH(z,G,Q,me){var nt=!Q;Q||(Q={});for(var Ct=-1,jt=G.length;++Ct<jt;){var Xe=G[Ct],Ut=me?me(Q[Xe],z[Xe],Xe,Q,z):void 0;Ut===void 0&&(Ut=z[Xe]),nt?Tc(Q,Xe,Ut):z2(Q,Xe,Ut)}return Q}function WH(z){return zH(function(G,Q){var me=-1,nt=Q.length,Ct=nt>1?Q[nt-1]:void 0,jt=nt>2?Q[2]:void 0;for(Ct=z.length>3&&typeof Ct=="function"?(nt--,Ct):void 0,jt&&YH(Q[0],Q[1],jt)&&(Ct=nt<3?void 0:Ct,nt=1),G=Object(G);++me<nt;){var Xe=Q[me];Xe&&z(G,Xe,me,Ct)}return G})}function KH(z){return function(G,Q,me){for(var nt=-1,Ct=Object(G),jt=me(G),Xe=jt.length;Xe--;){var Ut=jt[z?Xe:++nt];if(Q(Ct[Ut],Ut,Ct)===!1)break}return G}}function Jm(z,G){var Q=z.__data__;return ZH(G)?Q[typeof G=="string"?"string":"hash"]:Q.map}function j2(z,G){var Q=tt(z,G);return Yf(Q)?Q:void 0}function XH(z){var G=bn.call(z,_n),Q=z[_n];try{z[_n]=void 0;var me=!0}catch{}var nt=co.call(z);return me&&(G?z[_n]=Q:delete z[_n]),nt}function QH(z){return typeof z.constructor=="function"&&!qA(z)?Yn(li(z)):{}}function HA(z,G){var Q=typeof z;return G=G??a,!!G&&(Q=="number"||Q!="symbol"&&U.test(z))&&z>-1&&z%1==0&&z<G}function YH(z,G,Q){if(!iu(Q))return!1;var me=typeof G;return(me=="number"?q2(Q)&&HA(G,Q.length):me=="string"&&G in Q)?e0(Q[G],z):!1}function ZH(z){var G=typeof z;return G=="string"||G=="number"||G=="symbol"||G=="boolean"?z!=="__proto__":z===null}function JH(z){return!!Vr&&Vr in z}function qA(z){var G=z&&z.constructor,Q=typeof G=="function"&&G.prototype||Vt;return z===Q}function eq(z){var G=[];if(z!=null)for(var Q in Object(z))G.push(Q);return G}function tq(z){return co.call(z)}function nq(z,G,Q){return G=jo(G===void 0?z.length-1:G,0),function(){for(var me=arguments,nt=-1,Ct=jo(me.length-G,0),jt=Array(Ct);++nt<Ct;)jt[nt]=me[G+nt];nt=-1;for(var Xe=Array(G+1);++nt<G;)Xe[nt]=me[nt];return Xe[G]=Q(jt),Me(z,this,Xe)}}function U2(z,G){if(!(G==="constructor"&&typeof z[G]=="function")&&G!="__proto__")return z[G]}var rq=iq(VH);function iq(z){var G=0,Q=0;return function(){var me=nu(),nt=o-(me-Q);if(Q=me,nt>0){if(++G>=i)return arguments[0]}else G=0;return z.apply(void 0,arguments)}}function oq(z){if(z!=null){try{return xt.call(z)}catch{}try{return z+""}catch{}}return""}function e0(z,G){return z===G||z!==z&&G!==G}var G2=Zm(function(){return arguments}())?Zm:function(z){return Zf(z)&&bn.call(z,"callee")&&!fo.call(z,"callee")},H2=Array.isArray;function q2(z){return z!=null&&KA(z.length)&&!W2(z)}function aq(z){return Zf(z)&&q2(z)}var WA=tu||dq;function W2(z){if(!iu(z))return!1;var G=Ac(z);return G==h||G==p||G==u||G==m}function KA(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=a}function iu(z){var G=typeof z;return z!=null&&(G=="object"||G=="function")}function Zf(z){return z!=null&&typeof z=="object"}function sq(z){if(!Zf(z)||Ac(z)!=y)return!1;var G=li(z);if(G===null)return!0;var Q=bn.call(G,"constructor")&&G.constructor;return typeof Q=="function"&&Q instanceof Q&&xt.call(Q)==Mi}var XA=Se?Ee(Se):LH;function lq(z){return qH(z,QA(z))}function QA(z){return q2(z)?B2(z,!0):FH(z)}var uq=WH(function(z,G,Q,me){GA(z,G,Q,me)});function cq(z){return function(){return z}}function YA(z){return z}function dq(){return!1}e.exports=uq})(H1,H1.exports);var Obe=H1.exports;const ca=Bl(Obe);var $be=e=>/!(important)?$/.test(e),L8=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Nbe=(e,t)=>n=>{const r=String(t),i=$be(r),o=L8(r),a=e?`${e}.${o}`:o;let s=ya(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=L8(s),i?`${s} !important`:s};function PT(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=Nbe(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var K0=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Di(e,t){return n=>{const r={property:n,scale:e};return r.transform=PT({scale:e,transform:t}),r}}var Dbe=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Lbe(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Dbe(t),transform:n?PT({scale:n,compose:r}):r}}var yV=["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 Fbe(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...yV].join(" ")}function Bbe(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...yV].join(" ")}var zbe={"--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(" ")},Vbe={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 jbe(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 Ube={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},r3={"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"},Gbe=new Set(Object.values(r3)),i3=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Hbe=e=>e.trim();function qbe(e,t){if(e==null||i3.has(e))return e;if(!(o3(e)||i3.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],a=i==null?void 0:i[2];if(!o||!a)return e;const s=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=a.split(",").map(Hbe).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in r3?r3[l]:l;u.unshift(c);const d=u.map(f=>{if(Gbe.has(f))return f;const h=f.indexOf(" "),[p,g]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],_=o3(g)?g:g&&g.split(" "),b=`colors.${p}`,y=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[y,...Array.isArray(_)?_:[_]].join(" "):y});return`${s}(${d.join(", ")})`}var o3=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Wbe=(e,t)=>qbe(e,t??{});function Kbe(e){return/^var\(--.+\)$/.test(e)}var Xbe=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},qo=e=>t=>`${e}(${t})`,Je={filter(e){return e!=="auto"?e:zbe},backdropFilter(e){return e!=="auto"?e:Vbe},ring(e){return jbe(Je.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Fbe():e==="auto-gpu"?Bbe():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Xbe(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(Kbe(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Wbe,blur:qo("blur"),opacity:qo("opacity"),brightness:qo("brightness"),contrast:qo("contrast"),dropShadow:qo("drop-shadow"),grayscale:qo("grayscale"),hueRotate:e=>qo("hue-rotate")(Je.degree(e)),invert:qo("invert"),saturate:qo("saturate"),sepia:qo("sepia"),bgImage(e){return e==null||o3(e)||i3.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=Ube[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},H={borderWidths:Di("borderWidths"),borderStyles:Di("borderStyles"),colors:Di("colors"),borders:Di("borders"),gradients:Di("gradients",Je.gradient),radii:Di("radii",Je.px),space:Di("space",K0(Je.vh,Je.px)),spaceT:Di("space",K0(Je.vh,Je.px)),degreeT(e){return{property:e,transform:Je.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:PT({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Di("sizes",K0(Je.vh,Je.px)),sizesT:Di("sizes",K0(Je.vh,Je.fraction)),shadows:Di("shadows"),logical:Lbe,blur:Di("blur",Je.blur)},ev={background:H.colors("background"),backgroundColor:H.colors("backgroundColor"),backgroundImage:H.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Je.bgClip},bgSize:H.prop("backgroundSize"),bgPosition:H.prop("backgroundPosition"),bg:H.colors("background"),bgColor:H.colors("backgroundColor"),bgPos:H.prop("backgroundPosition"),bgRepeat:H.prop("backgroundRepeat"),bgAttachment:H.prop("backgroundAttachment"),bgGradient:H.gradients("backgroundImage"),bgClip:{transform:Je.bgClip}};Object.assign(ev,{bgImage:ev.backgroundImage,bgImg:ev.backgroundImage});var dt={border:H.borders("border"),borderWidth:H.borderWidths("borderWidth"),borderStyle:H.borderStyles("borderStyle"),borderColor:H.colors("borderColor"),borderRadius:H.radii("borderRadius"),borderTop:H.borders("borderTop"),borderBlockStart:H.borders("borderBlockStart"),borderTopLeftRadius:H.radii("borderTopLeftRadius"),borderStartStartRadius:H.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:H.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:H.radii("borderTopRightRadius"),borderStartEndRadius:H.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:H.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:H.borders("borderRight"),borderInlineEnd:H.borders("borderInlineEnd"),borderBottom:H.borders("borderBottom"),borderBlockEnd:H.borders("borderBlockEnd"),borderBottomLeftRadius:H.radii("borderBottomLeftRadius"),borderBottomRightRadius:H.radii("borderBottomRightRadius"),borderLeft:H.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:H.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:H.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:H.borders(["borderLeft","borderRight"]),borderInline:H.borders("borderInline"),borderY:H.borders(["borderTop","borderBottom"]),borderBlock:H.borders("borderBlock"),borderTopWidth:H.borderWidths("borderTopWidth"),borderBlockStartWidth:H.borderWidths("borderBlockStartWidth"),borderTopColor:H.colors("borderTopColor"),borderBlockStartColor:H.colors("borderBlockStartColor"),borderTopStyle:H.borderStyles("borderTopStyle"),borderBlockStartStyle:H.borderStyles("borderBlockStartStyle"),borderBottomWidth:H.borderWidths("borderBottomWidth"),borderBlockEndWidth:H.borderWidths("borderBlockEndWidth"),borderBottomColor:H.colors("borderBottomColor"),borderBlockEndColor:H.colors("borderBlockEndColor"),borderBottomStyle:H.borderStyles("borderBottomStyle"),borderBlockEndStyle:H.borderStyles("borderBlockEndStyle"),borderLeftWidth:H.borderWidths("borderLeftWidth"),borderInlineStartWidth:H.borderWidths("borderInlineStartWidth"),borderLeftColor:H.colors("borderLeftColor"),borderInlineStartColor:H.colors("borderInlineStartColor"),borderLeftStyle:H.borderStyles("borderLeftStyle"),borderInlineStartStyle:H.borderStyles("borderInlineStartStyle"),borderRightWidth:H.borderWidths("borderRightWidth"),borderInlineEndWidth:H.borderWidths("borderInlineEndWidth"),borderRightColor:H.colors("borderRightColor"),borderInlineEndColor:H.colors("borderInlineEndColor"),borderRightStyle:H.borderStyles("borderRightStyle"),borderInlineEndStyle:H.borderStyles("borderInlineEndStyle"),borderTopRadius:H.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:H.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:H.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:H.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(dt,{rounded:dt.borderRadius,roundedTop:dt.borderTopRadius,roundedTopLeft:dt.borderTopLeftRadius,roundedTopRight:dt.borderTopRightRadius,roundedTopStart:dt.borderStartStartRadius,roundedTopEnd:dt.borderStartEndRadius,roundedBottom:dt.borderBottomRadius,roundedBottomLeft:dt.borderBottomLeftRadius,roundedBottomRight:dt.borderBottomRightRadius,roundedBottomStart:dt.borderEndStartRadius,roundedBottomEnd:dt.borderEndEndRadius,roundedLeft:dt.borderLeftRadius,roundedRight:dt.borderRightRadius,roundedStart:dt.borderInlineStartRadius,roundedEnd:dt.borderInlineEndRadius,borderStart:dt.borderInlineStart,borderEnd:dt.borderInlineEnd,borderTopStartRadius:dt.borderStartStartRadius,borderTopEndRadius:dt.borderStartEndRadius,borderBottomStartRadius:dt.borderEndStartRadius,borderBottomEndRadius:dt.borderEndEndRadius,borderStartRadius:dt.borderInlineStartRadius,borderEndRadius:dt.borderInlineEndRadius,borderStartWidth:dt.borderInlineStartWidth,borderEndWidth:dt.borderInlineEndWidth,borderStartColor:dt.borderInlineStartColor,borderEndColor:dt.borderInlineEndColor,borderStartStyle:dt.borderInlineStartStyle,borderEndStyle:dt.borderInlineEndStyle});var Qbe={color:H.colors("color"),textColor:H.colors("color"),fill:H.colors("fill"),stroke:H.colors("stroke")},a3={boxShadow:H.shadows("boxShadow"),mixBlendMode:!0,blendMode:H.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:H.prop("backgroundBlendMode"),opacity:!0};Object.assign(a3,{shadow:a3.boxShadow});var Ybe={filter:{transform:Je.filter},blur:H.blur("--chakra-blur"),brightness:H.propT("--chakra-brightness",Je.brightness),contrast:H.propT("--chakra-contrast",Je.contrast),hueRotate:H.propT("--chakra-hue-rotate",Je.hueRotate),invert:H.propT("--chakra-invert",Je.invert),saturate:H.propT("--chakra-saturate",Je.saturate),dropShadow:H.propT("--chakra-drop-shadow",Je.dropShadow),backdropFilter:{transform:Je.backdropFilter},backdropBlur:H.blur("--chakra-backdrop-blur"),backdropBrightness:H.propT("--chakra-backdrop-brightness",Je.brightness),backdropContrast:H.propT("--chakra-backdrop-contrast",Je.contrast),backdropHueRotate:H.propT("--chakra-backdrop-hue-rotate",Je.hueRotate),backdropInvert:H.propT("--chakra-backdrop-invert",Je.invert),backdropSaturate:H.propT("--chakra-backdrop-saturate",Je.saturate)},q1={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Je.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:H.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:H.space("gap"),rowGap:H.space("rowGap"),columnGap:H.space("columnGap")};Object.assign(q1,{flexDir:q1.flexDirection});var vV={gridGap:H.space("gridGap"),gridColumnGap:H.space("gridColumnGap"),gridRowGap:H.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},Zbe={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Je.outline},outlineOffset:!0,outlineColor:H.colors("outlineColor")},Bi={width:H.sizesT("width"),inlineSize:H.sizesT("inlineSize"),height:H.sizes("height"),blockSize:H.sizes("blockSize"),boxSize:H.sizes(["width","height"]),minWidth:H.sizes("minWidth"),minInlineSize:H.sizes("minInlineSize"),minHeight:H.sizes("minHeight"),minBlockSize:H.sizes("minBlockSize"),maxWidth:H.sizes("maxWidth"),maxInlineSize:H.sizes("maxInlineSize"),maxHeight:H.sizes("maxHeight"),maxBlockSize:H.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:H.propT("float",Je.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Bi,{w:Bi.width,h:Bi.height,minW:Bi.minWidth,maxW:Bi.maxWidth,minH:Bi.minHeight,maxH:Bi.maxHeight,overscroll:Bi.overscrollBehavior,overscrollX:Bi.overscrollBehaviorX,overscrollY:Bi.overscrollBehaviorY});var Jbe={listStyleType:!0,listStylePosition:!0,listStylePos:H.prop("listStylePosition"),listStyleImage:!0,listStyleImg:H.prop("listStyleImage")};function e_e(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 t_e=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},n_e=t_e(e_e),r_e={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},i_e={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},cw=(e,t,n)=>{const r={},i=n_e(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},o_e={srOnly:{transform(e){return e===!0?r_e:e==="focusable"?i_e:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>cw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>cw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>cw(t,e,n)}},gp={position:!0,pos:H.prop("position"),zIndex:H.prop("zIndex","zIndices"),inset:H.spaceT("inset"),insetX:H.spaceT(["left","right"]),insetInline:H.spaceT("insetInline"),insetY:H.spaceT(["top","bottom"]),insetBlock:H.spaceT("insetBlock"),top:H.spaceT("top"),insetBlockStart:H.spaceT("insetBlockStart"),bottom:H.spaceT("bottom"),insetBlockEnd:H.spaceT("insetBlockEnd"),left:H.spaceT("left"),insetInlineStart:H.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:H.spaceT("right"),insetInlineEnd:H.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(gp,{insetStart:gp.insetInlineStart,insetEnd:gp.insetInlineEnd});var a_e={ring:{transform:Je.ring},ringColor:H.colors("--chakra-ring-color"),ringOffset:H.prop("--chakra-ring-offset-width"),ringOffsetColor:H.colors("--chakra-ring-offset-color"),ringInset:H.prop("--chakra-ring-inset")},Dt={margin:H.spaceT("margin"),marginTop:H.spaceT("marginTop"),marginBlockStart:H.spaceT("marginBlockStart"),marginRight:H.spaceT("marginRight"),marginInlineEnd:H.spaceT("marginInlineEnd"),marginBottom:H.spaceT("marginBottom"),marginBlockEnd:H.spaceT("marginBlockEnd"),marginLeft:H.spaceT("marginLeft"),marginInlineStart:H.spaceT("marginInlineStart"),marginX:H.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:H.spaceT("marginInline"),marginY:H.spaceT(["marginTop","marginBottom"]),marginBlock:H.spaceT("marginBlock"),padding:H.space("padding"),paddingTop:H.space("paddingTop"),paddingBlockStart:H.space("paddingBlockStart"),paddingRight:H.space("paddingRight"),paddingBottom:H.space("paddingBottom"),paddingBlockEnd:H.space("paddingBlockEnd"),paddingLeft:H.space("paddingLeft"),paddingInlineStart:H.space("paddingInlineStart"),paddingInlineEnd:H.space("paddingInlineEnd"),paddingX:H.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:H.space("paddingInline"),paddingY:H.space(["paddingTop","paddingBottom"]),paddingBlock:H.space("paddingBlock")};Object.assign(Dt,{m:Dt.margin,mt:Dt.marginTop,mr:Dt.marginRight,me:Dt.marginInlineEnd,marginEnd:Dt.marginInlineEnd,mb:Dt.marginBottom,ml:Dt.marginLeft,ms:Dt.marginInlineStart,marginStart:Dt.marginInlineStart,mx:Dt.marginX,my:Dt.marginY,p:Dt.padding,pt:Dt.paddingTop,py:Dt.paddingY,px:Dt.paddingX,pb:Dt.paddingBottom,pl:Dt.paddingLeft,ps:Dt.paddingInlineStart,paddingStart:Dt.paddingInlineStart,pr:Dt.paddingRight,pe:Dt.paddingInlineEnd,paddingEnd:Dt.paddingInlineEnd});var s_e={textDecorationColor:H.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:H.shadows("textShadow")},l_e={clipPath:!0,transform:H.propT("transform",Je.transform),transformOrigin:!0,translateX:H.spaceT("--chakra-translate-x"),translateY:H.spaceT("--chakra-translate-y"),skewX:H.degreeT("--chakra-skew-x"),skewY:H.degreeT("--chakra-skew-y"),scaleX:H.prop("--chakra-scale-x"),scaleY:H.prop("--chakra-scale-y"),scale:H.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:H.degreeT("--chakra-rotate")},u_e={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:H.prop("transitionDuration","transition.duration"),transitionProperty:H.prop("transitionProperty","transition.property"),transitionTimingFunction:H.prop("transitionTimingFunction","transition.easing")},c_e={fontFamily:H.prop("fontFamily","fonts"),fontSize:H.prop("fontSize","fontSizes",Je.px),fontWeight:H.prop("fontWeight","fontWeights"),lineHeight:H.prop("lineHeight","lineHeights"),letterSpacing:H.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"}},d_e={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:H.spaceT("scrollMargin"),scrollMarginTop:H.spaceT("scrollMarginTop"),scrollMarginBottom:H.spaceT("scrollMarginBottom"),scrollMarginLeft:H.spaceT("scrollMarginLeft"),scrollMarginRight:H.spaceT("scrollMarginRight"),scrollMarginX:H.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:H.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:H.spaceT("scrollPadding"),scrollPaddingTop:H.spaceT("scrollPaddingTop"),scrollPaddingBottom:H.spaceT("scrollPaddingBottom"),scrollPaddingLeft:H.spaceT("scrollPaddingLeft"),scrollPaddingRight:H.spaceT("scrollPaddingRight"),scrollPaddingX:H.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:H.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function bV(e){return ya(e)&&e.reference?e.reference:String(e)}var hS=(e,...t)=>t.map(bV).join(` ${e} `).replace(/calc/g,""),F8=(...e)=>`calc(${hS("+",...e)})`,B8=(...e)=>`calc(${hS("-",...e)})`,s3=(...e)=>`calc(${hS("*",...e)})`,z8=(...e)=>`calc(${hS("/",...e)})`,V8=e=>{const t=bV(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:s3(t,-1)},Cu=Object.assign(e=>({add:(...t)=>Cu(F8(e,...t)),subtract:(...t)=>Cu(B8(e,...t)),multiply:(...t)=>Cu(s3(e,...t)),divide:(...t)=>Cu(z8(e,...t)),negate:()=>Cu(V8(e)),toString:()=>e.toString()}),{add:F8,subtract:B8,multiply:s3,divide:z8,negate:V8});function f_e(e,t="-"){return e.replace(/\s+/g,t)}function h_e(e){const t=f_e(e.toString());return g_e(p_e(t))}function p_e(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function g_e(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function m_e(e,t=""){return[t,e].filter(Boolean).join("-")}function y_e(e,t){return`var(${e}${t?`, ${t}`:""})`}function v_e(e,t=""){return h_e(`--${m_e(e,t)}`)}function ke(e,t,n){const r=v_e(e,n);return{variable:r,reference:y_e(r,t)}}function b_e(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=ke(`${e}-${i}`,o);continue}n[r]=ke(`${e}-${r}`)}return n}function __e(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function S_e(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function l3(e){if(e==null)return e;const{unitless:t}=S_e(e);return t||typeof e=="number"?`${e}px`:e}var _V=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,kT=e=>Object.fromEntries(Object.entries(e).sort(_V));function j8(e){const t=kT(e);return Object.assign(Object.values(t),t)}function x_e(e){const t=Object.keys(kT(e));return new Set(t)}function U8(e){var t;if(!e)return e;e=(t=l3(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function qh(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${l3(e)})`),t&&n.push("and",`(max-width: ${l3(t)})`),n.join(" ")}function w_e(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=j8(e),r=Object.entries(e).sort(_V).map(([a,s],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?U8(d):void 0,{_minW:U8(s),breakpoint:a,minW:s,maxW:d,maxWQuery:qh(null,d),minWQuery:qh(s),minMaxQuery:qh(s,d)}}),i=x_e(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:kT(e),asArray:j8(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>qh(a)).slice(1)],toArrayValue(a){if(!ya(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;__e(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=o[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var Jn={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}`},Ds=e=>SV(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Da=e=>SV(t=>e(t,"~ &"),"[data-peer]",".peer"),SV=(e,...t)=>t.map(e).join(", "),pS={_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:Ds(Jn.hover),_peerHover:Da(Jn.hover),_groupFocus:Ds(Jn.focus),_peerFocus:Da(Jn.focus),_groupFocusVisible:Ds(Jn.focusVisible),_peerFocusVisible:Da(Jn.focusVisible),_groupActive:Ds(Jn.active),_peerActive:Da(Jn.active),_groupDisabled:Ds(Jn.disabled),_peerDisabled:Da(Jn.disabled),_groupInvalid:Ds(Jn.invalid),_peerInvalid:Da(Jn.invalid),_groupChecked:Ds(Jn.checked),_peerChecked:Da(Jn.checked),_groupFocusWithin:Ds(Jn.focusWithin),_peerFocusWithin:Da(Jn.focusWithin),_peerPlaceholderShown:Da(Jn.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]"},xV=Object.keys(pS);function G8(e,t){return ke(String(e).replace(/\./g,"-"),void 0,t)}function C_e(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=G8(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,g=`${h}.-${p.join(".")}`,_=Cu.negate(s),b=Cu.negate(u);r[g]={value:_,var:l,varRef:b}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const c=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:_}=G8(p,t==null?void 0:t.cssVarPrefix);return _},d=ya(s)?s:{default:s};n=ca(n,Object.entries(d).reduce((f,[h,p])=>{var g,_;if(!p)return f;const b=c(`${p}`);if(h==="default")return f[l]=b,f;const y=(_=(g=pS)==null?void 0:g[h])!=null?_:h;return f[y]={[l]:b},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function E_e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function T_e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function A_e(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function H8(e,t,n={}){const{stop:r,getKey:i}=n;function o(a,s=[]){var l;if(A_e(a)||Array.isArray(a)){const u={};for(const[c,d]of Object.entries(a)){const f=(l=i==null?void 0:i(c))!=null?l:c,h=[...s,f];if(r!=null&&r(a,h))return t(a,s);u[f]=o(d,h)}return u}return t(a,s)}return o(e)}var P_e=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function k_e(e){return T_e(e,P_e)}function I_e(e){return e.semanticTokens}function M_e(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var R_e=e=>xV.includes(e)||e==="default";function O_e({tokens:e,semanticTokens:t}){const n={};return H8(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),H8(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(R_e)}),n}function $_e(e){var t;const n=M_e(e),r=k_e(n),i=I_e(n),o=O_e({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=C_e(o,{cssVarPrefix:a});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:s,__breakpoints:w_e(n.breakpoints)}),n}var IT=ca({},ev,dt,Qbe,q1,Bi,Ybe,a_e,Zbe,vV,o_e,gp,a3,Dt,d_e,c_e,s_e,l_e,Jbe,u_e),N_e=Object.assign({},Dt,Bi,q1,vV,gp),TUe=Object.keys(N_e),D_e=[...Object.keys(IT),...xV],L_e={...IT,...pS},F_e=e=>e in L_e,B_e=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=ua(e[a],t);if(s==null)continue;if(s=ya(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;u<l;u+=1){const c=i==null?void 0:i[u];if(!c){o[a]=s[u];continue}o[c]=o[c]||{},s[u]!=null&&(o[c][a]=s[u])}}return o};function z_e(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 V_e(e){return/^var\(--.+\)$/.test(e)}var j_e=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!V_e(t),U_e=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=z_e(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function G_e(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const c=ua(o,r),d=B_e(c)(r);let f={};for(let h in d){const p=d[h];let g=ua(p,r);h in n&&(h=n[h]),j_e(h,g)&&(g=U_e(r,g));let _=t[h];if(_===!0&&(_={property:h}),ya(g)){f[h]=(s=f[h])!=null?s:{},f[h]=ca({},f[h],i(g,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,g,r,c))!=null?u:g;b=_!=null&&_.processResult?i(b,!0):b;const y=ua(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const m=ua(_.static,r);f=ca({},f,m)}if(y&&Array.isArray(y)){for(const m of y)f[m]=b;continue}if(y){y==="&"&&ya(b)?f=ca({},f,b):f[y]=b;continue}if(ya(b)){f=ca({},f,b);continue}f[h]=b}return f};return i}var wV=e=>t=>G_e({theme:t,pseudos:pS,configs:IT})(e);function Ve(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function H_e(e,t){if(Array.isArray(e))return e;if(ya(e))return t(e);if(e!=null)return[e]}function q_e(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function W_e(e){const t=e.__breakpoints;return function(r,i,o,a){var s,l;if(!t)return;const u={},c=H_e(o,t.toArrayValue);if(!c)return u;const d=c.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const g=t.details[p],_=t.details[q_e(c,p)],b=qh(g.minW,_==null?void 0:_._minW),y=ua((s=r[i])==null?void 0:s[c[p]],a);if(y){if(h){(l=r.parts)==null||l.forEach(m=>{ca(u,{[m]:f?y[m]:{[b]:y[m]}})});continue}if(!h){f?ca(u,y):u[b]=y;continue}u[b]=y}}return u}}function K_e(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=W_e(o);return ca({},ua((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function AUe(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 Rm(e){return E_e(e,["styleConfig","size","variant","colorScheme"])}var X_e={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Q_e={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Y_e={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Z_e={property:X_e,easing:Q_e,duration:Y_e},J_e=Z_e,eSe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},tSe=eSe,nSe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},rSe=nSe,iSe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},oSe=iSe,aSe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},sSe=aSe,lSe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},uSe=lSe,cSe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},dSe=cSe,fSe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},hSe=fSe,pSe={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},CV=pSe,EV={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},gSe={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},mSe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},ySe={...EV,...gSe,container:mSe},TV=ySe,vSe={breakpoints:oSe,zIndices:tSe,radii:uSe,blur:hSe,colors:sSe,...CV,sizes:TV,shadows:dSe,space:EV,borders:rSe,transition:J_e},{defineMultiStyleConfig:bSe,definePartsStyle:Wh}=Ve(["stepper","step","title","description","indicator","separator","icon","number"]),Ka=ke("stepper-indicator-size"),ud=ke("stepper-icon-size"),cd=ke("stepper-title-font-size"),Kh=ke("stepper-description-font-size"),vh=ke("stepper-accent-color"),_Se=Wh(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[vh.variable]:`colors.${e}.500`,_dark:{[vh.variable]:`colors.${e}.200`}},title:{fontSize:cd.reference,fontWeight:"medium"},description:{fontSize:Kh.reference,color:"chakra-subtle-text"},number:{fontSize:cd.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:ud.reference,height:ud.reference},indicator:{flexShrink:0,borderRadius:"full",width:Ka.reference,height:Ka.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:vh.reference},"&[data-status=complete]":{bg:vh.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:vh.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Ka.reference} - 8px)`,top:`calc(${Ka.reference} + 4px)`,insetStart:`calc(${Ka.reference} / 2 - 1px)`}}})),SSe=bSe({baseStyle:_Se,sizes:{xs:Wh({stepper:{[Ka.variable]:"sizes.4",[ud.variable]:"sizes.3",[cd.variable]:"fontSizes.xs",[Kh.variable]:"fontSizes.xs"}}),sm:Wh({stepper:{[Ka.variable]:"sizes.6",[ud.variable]:"sizes.4",[cd.variable]:"fontSizes.sm",[Kh.variable]:"fontSizes.xs"}}),md:Wh({stepper:{[Ka.variable]:"sizes.8",[ud.variable]:"sizes.5",[cd.variable]:"fontSizes.md",[Kh.variable]:"fontSizes.sm"}}),lg:Wh({stepper:{[Ka.variable]:"sizes.10",[ud.variable]:"sizes.6",[cd.variable]:"fontSizes.lg",[Kh.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function mt(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return mt(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return mt(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var AV=mt("accordion").parts("root","container","button","panel").extend("icon"),xSe=mt("alert").parts("title","description","container").extend("icon","spinner"),wSe=mt("avatar").parts("label","badge","container").extend("excessLabel","group"),CSe=mt("breadcrumb").parts("link","item","container").extend("separator");mt("button").parts();var PV=mt("checkbox").parts("control","icon","container").extend("label");mt("progress").parts("track","filledTrack").extend("label");var ESe=mt("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),kV=mt("editable").parts("preview","input","textarea"),TSe=mt("form").parts("container","requiredIndicator","helperText"),ASe=mt("formError").parts("text","icon"),IV=mt("input").parts("addon","field","element","group"),PSe=mt("list").parts("container","item","icon"),MV=mt("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),RV=mt("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),OV=mt("numberinput").parts("root","field","stepperGroup","stepper");mt("pininput").parts("field");var $V=mt("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),NV=mt("progress").parts("label","filledTrack","track"),kSe=mt("radio").parts("container","control","label"),DV=mt("select").parts("field","icon"),LV=mt("slider").parts("container","track","thumb","filledTrack","mark"),ISe=mt("stat").parts("container","label","helpText","number","icon"),FV=mt("switch").parts("container","track","thumb","label"),MSe=mt("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),BV=mt("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),RSe=mt("tag").parts("container","label","closeButton"),OSe=mt("card").parts("container","header","body","footer");mt("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function Ou(e,t,n){return Math.min(Math.max(e,n),t)}class $Se extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Xh=$Se;function MT(e){if(typeof e!="string")throw new Xh(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=jSe.test(e)?LSe(e):e;const n=FSe.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(Dg(s,2),16)),parseInt(Dg(a[3]||"f",2),16)/255]}const r=BSe.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=zSe.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=VSe.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(Ou(0,100,s)!==s)throw new Xh(e);if(Ou(0,100,l)!==l)throw new Xh(e);return[...USe(a,s,l),Number.isNaN(u)?1:u]}throw new Xh(e)}function NSe(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const q8=e=>parseInt(e.replace(/_/g,""),36),DSe="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=q8(t.substring(0,3)),r=q8(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function LSe(e){const t=e.toLowerCase().trim(),n=DSe[NSe(t)];if(!n)throw new Xh(e);return`#${n}`}const Dg=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),FSe=new RegExp(`^#${Dg("([a-f0-9])",3)}([a-f0-9])?$`,"i"),BSe=new RegExp(`^#${Dg("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),zSe=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Dg(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),VSe=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,jSe=/^[a-z]+$/i,W8=e=>Math.round(e*255),USe=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(W8);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const c=r-o/2,d=s+c,f=l+c,h=u+c;return[d,f,h].map(W8)};function GSe(e,t,n,r){return`rgba(${Ou(0,255,e).toFixed()}, ${Ou(0,255,t).toFixed()}, ${Ou(0,255,n).toFixed()}, ${parseFloat(Ou(0,1,r).toFixed(3))})`}function HSe(e,t){const[n,r,i,o]=MT(e);return GSe(n,r,i,o-t)}function qSe(e){const[t,n,r,i]=MT(e);let o=a=>{const s=Ou(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function WSe(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var KSe=e=>Object.keys(e).length===0,Or=(e,t,n)=>{const r=WSe(e,`colors.${t}`,t);try{return qSe(r),r}catch{return n??"#000000"}},XSe=e=>{const[t,n,r]=MT(e);return(t*299+n*587+r*114)/1e3},QSe=e=>t=>{const n=Or(t,e);return XSe(n)<128?"dark":"light"},YSe=e=>t=>QSe(e)(t)==="dark",Sf=(e,t)=>n=>{const r=Or(n,e);return HSe(r,1-t)};function K8(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient(
45deg,
${t} 25%,
transparent 25%,
transparent 50%,
${t} 50%,
${t} 75%,
transparent 75%,
transparent
)`,backgroundSize:`${e} ${e}`}}var ZSe=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function JSe(e){const t=ZSe();return!e||KSe(e)?t:e.string&&e.colors?t2e(e.string,e.colors):e.string&&!e.colors?e2e(e.string):e.colors&&!e.string?n2e(e.colors):t}function e2e(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t),t=t&t;let n="#";for(let r=0;r<3;r+=1){const i=t>>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function t2e(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;r<e.length;r+=1)n=e.charCodeAt(r)+((n<<5)-n),n=n&n;return n=(n%t.length+t.length)%t.length,t[n]}function n2e(e){return e[Math.floor(Math.random()*e.length)]}function W(e,t){return n=>n.colorMode==="dark"?t:e}function RT(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function zV(e){return ya(e)&&e.reference?e.reference:String(e)}var gS=(e,...t)=>t.map(zV).join(` ${e} `).replace(/calc/g,""),X8=(...e)=>`calc(${gS("+",...e)})`,Q8=(...e)=>`calc(${gS("-",...e)})`,u3=(...e)=>`calc(${gS("*",...e)})`,Y8=(...e)=>`calc(${gS("/",...e)})`,Z8=e=>{const t=zV(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:u3(t,-1)},Xa=Object.assign(e=>({add:(...t)=>Xa(X8(e,...t)),subtract:(...t)=>Xa(Q8(e,...t)),multiply:(...t)=>Xa(u3(e,...t)),divide:(...t)=>Xa(Y8(e,...t)),negate:()=>Xa(Z8(e)),toString:()=>e.toString()}),{add:X8,subtract:Q8,multiply:u3,divide:Y8,negate:Z8});function r2e(e){return!Number.isInteger(parseFloat(e.toString()))}function i2e(e,t="-"){return e.replace(/\s+/g,t)}function VV(e){const t=i2e(e.toString());return t.includes("\\.")?e:r2e(e)?t.replace(".","\\."):e}function o2e(e,t=""){return[t,VV(e)].filter(Boolean).join("-")}function a2e(e,t){return`var(${VV(e)}${t?`, ${t}`:""})`}function s2e(e,t=""){return`--${o2e(e,t)}`}function tn(e,t){const n=s2e(e,t==null?void 0:t.prefix);return{variable:n,reference:a2e(n,l2e(t==null?void 0:t.fallback))}}function l2e(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:u2e,definePartsStyle:tv}=Ve(FV.keys),mp=tn("switch-track-width"),Gu=tn("switch-track-height"),dw=tn("switch-track-diff"),c2e=Xa.subtract(mp,Gu),c3=tn("switch-thumb-x"),bh=tn("switch-bg"),d2e=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[mp.reference],height:[Gu.reference],transitionProperty:"common",transitionDuration:"fast",[bh.variable]:"colors.gray.300",_dark:{[bh.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[bh.variable]:`colors.${t}.500`,_dark:{[bh.variable]:`colors.${t}.200`}},bg:bh.reference}},f2e={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Gu.reference],height:[Gu.reference],_checked:{transform:`translateX(${c3.reference})`}},h2e=tv(e=>({container:{[dw.variable]:c2e,[c3.variable]:dw.reference,_rtl:{[c3.variable]:Xa(dw).negate().toString()}},track:d2e(e),thumb:f2e})),p2e={sm:tv({container:{[mp.variable]:"1.375rem",[Gu.variable]:"sizes.3"}}),md:tv({container:{[mp.variable]:"1.875rem",[Gu.variable]:"sizes.4"}}),lg:tv({container:{[mp.variable]:"2.875rem",[Gu.variable]:"sizes.6"}})},g2e=u2e({baseStyle:h2e,sizes:p2e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:m2e,definePartsStyle:Vd}=Ve(MSe.keys),y2e=Vd({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),W1={"&[data-is-numeric=true]":{textAlign:"end"}},v2e=Vd(e=>{const{colorScheme:t}=e;return{th:{color:W("gray.600","gray.400")(e),borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...W1},td:{borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...W1},caption:{color:W("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),b2e=Vd(e=>{const{colorScheme:t}=e;return{th:{color:W("gray.600","gray.400")(e),borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...W1},td:{borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...W1},caption:{color:W("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e)},td:{background:W(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),_2e={simple:v2e,striped:b2e,unstyled:{}},S2e={sm:Vd({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Vd({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Vd({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},x2e=m2e({baseStyle:y2e,variants:_2e,sizes:S2e,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Kr=ke("tabs-color"),wo=ke("tabs-bg"),X0=ke("tabs-border-color"),{defineMultiStyleConfig:w2e,definePartsStyle:va}=Ve(BV.keys),C2e=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},E2e=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},T2e=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},A2e={p:4},P2e=va(e=>({root:C2e(e),tab:E2e(e),tablist:T2e(e),tabpanel:A2e})),k2e={sm:va({tab:{py:1,px:4,fontSize:"sm"}}),md:va({tab:{fontSize:"md",py:2,px:4}}),lg:va({tab:{fontSize:"lg",py:3,px:4}})},I2e=va(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Kr.variable]:`colors.${t}.600`,_dark:{[Kr.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[wo.variable]:"colors.gray.200",_dark:{[wo.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Kr.reference,bg:wo.reference}}}),M2e=va(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[X0.variable]:"transparent",_selected:{[Kr.variable]:`colors.${t}.600`,[X0.variable]:"colors.white",_dark:{[Kr.variable]:`colors.${t}.300`,[X0.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:X0.reference},color:Kr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),R2e=va(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[wo.variable]:"colors.gray.50",_dark:{[wo.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[wo.variable]:"colors.white",[Kr.variable]:`colors.${t}.600`,_dark:{[wo.variable]:"colors.gray.800",[Kr.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Kr.reference,bg:wo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),O2e=va(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Or(n,`${t}.700`),bg:Or(n,`${t}.100`)}}}}),$2e=va(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Kr.variable]:"colors.gray.600",_dark:{[Kr.variable]:"inherit"},_selected:{[Kr.variable]:"colors.white",[wo.variable]:`colors.${t}.600`,_dark:{[Kr.variable]:"colors.gray.800",[wo.variable]:`colors.${t}.300`}},color:Kr.reference,bg:wo.reference}}}),N2e=va({}),D2e={line:I2e,enclosed:M2e,"enclosed-colored":R2e,"soft-rounded":O2e,"solid-rounded":$2e,unstyled:N2e},L2e=w2e({baseStyle:P2e,sizes:k2e,variants:D2e,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),yn=b_e("badge",["bg","color","shadow"]),F2e={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:yn.bg.reference,color:yn.color.reference,boxShadow:yn.shadow.reference},B2e=e=>{const{colorScheme:t,theme:n}=e,r=Sf(`${t}.500`,.6)(n);return{[yn.bg.variable]:`colors.${t}.500`,[yn.color.variable]:"colors.white",_dark:{[yn.bg.variable]:r,[yn.color.variable]:"colors.whiteAlpha.800"}}},z2e=e=>{const{colorScheme:t,theme:n}=e,r=Sf(`${t}.200`,.16)(n);return{[yn.bg.variable]:`colors.${t}.100`,[yn.color.variable]:`colors.${t}.800`,_dark:{[yn.bg.variable]:r,[yn.color.variable]:`colors.${t}.200`}}},V2e=e=>{const{colorScheme:t,theme:n}=e,r=Sf(`${t}.200`,.8)(n);return{[yn.color.variable]:`colors.${t}.500`,_dark:{[yn.color.variable]:r},[yn.shadow.variable]:`inset 0 0 0px 1px ${yn.color.reference}`}},j2e={solid:B2e,subtle:z2e,outline:V2e},yp={baseStyle:F2e,variants:j2e,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:U2e,definePartsStyle:Hu}=Ve(RSe.keys),J8=ke("tag-bg"),e9=ke("tag-color"),fw=ke("tag-shadow"),nv=ke("tag-min-height"),rv=ke("tag-min-width"),iv=ke("tag-font-size"),ov=ke("tag-padding-inline"),G2e={fontWeight:"medium",lineHeight:1.2,outline:0,[e9.variable]:yn.color.reference,[J8.variable]:yn.bg.reference,[fw.variable]:yn.shadow.reference,color:e9.reference,bg:J8.reference,boxShadow:fw.reference,borderRadius:"md",minH:nv.reference,minW:rv.reference,fontSize:iv.reference,px:ov.reference,_focusVisible:{[fw.variable]:"shadows.outline"}},H2e={lineHeight:1.2,overflow:"visible"},q2e={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},W2e=Hu({container:G2e,label:H2e,closeButton:q2e}),K2e={sm:Hu({container:{[nv.variable]:"sizes.5",[rv.variable]:"sizes.5",[iv.variable]:"fontSizes.xs",[ov.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Hu({container:{[nv.variable]:"sizes.6",[rv.variable]:"sizes.6",[iv.variable]:"fontSizes.sm",[ov.variable]:"space.2"}}),lg:Hu({container:{[nv.variable]:"sizes.8",[rv.variable]:"sizes.8",[iv.variable]:"fontSizes.md",[ov.variable]:"space.3"}})},X2e={subtle:Hu(e=>{var t;return{container:(t=yp.variants)==null?void 0:t.subtle(e)}}),solid:Hu(e=>{var t;return{container:(t=yp.variants)==null?void 0:t.solid(e)}}),outline:Hu(e=>{var t;return{container:(t=yp.variants)==null?void 0:t.outline(e)}})},Q2e=U2e({variants:X2e,baseStyle:W2e,sizes:K2e,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Ja,defineMultiStyleConfig:Y2e}=Ve(IV.keys),dd=ke("input-height"),fd=ke("input-font-size"),hd=ke("input-padding"),pd=ke("input-border-radius"),Z2e=Ja({addon:{height:dd.reference,fontSize:fd.reference,px:hd.reference,borderRadius:pd.reference},field:{width:"100%",height:dd.reference,fontSize:fd.reference,px:hd.reference,borderRadius:pd.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Ls={lg:{[fd.variable]:"fontSizes.lg",[hd.variable]:"space.4",[pd.variable]:"radii.md",[dd.variable]:"sizes.12"},md:{[fd.variable]:"fontSizes.md",[hd.variable]:"space.4",[pd.variable]:"radii.md",[dd.variable]:"sizes.10"},sm:{[fd.variable]:"fontSizes.sm",[hd.variable]:"space.3",[pd.variable]:"radii.sm",[dd.variable]:"sizes.8"},xs:{[fd.variable]:"fontSizes.xs",[hd.variable]:"space.2",[pd.variable]:"radii.sm",[dd.variable]:"sizes.6"}},J2e={lg:Ja({field:Ls.lg,group:Ls.lg}),md:Ja({field:Ls.md,group:Ls.md}),sm:Ja({field:Ls.sm,group:Ls.sm}),xs:Ja({field:Ls.xs,group:Ls.xs})};function OT(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||W("blue.500","blue.300")(e),errorBorderColor:n||W("red.500","red.300")(e)}}var exe=Ja(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=OT(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:W("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Or(t,r),boxShadow:`0 0 0 1px ${Or(t,r)}`},_focusVisible:{zIndex:1,borderColor:Or(t,n),boxShadow:`0 0 0 1px ${Or(t,n)}`}},addon:{border:"1px solid",borderColor:W("inherit","whiteAlpha.50")(e),bg:W("gray.100","whiteAlpha.300")(e)}}}),txe=Ja(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=OT(e);return{field:{border:"2px solid",borderColor:"transparent",bg:W("gray.100","whiteAlpha.50")(e),_hover:{bg:W("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Or(t,r)},_focusVisible:{bg:"transparent",borderColor:Or(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:W("gray.100","whiteAlpha.50")(e)}}}),nxe=Ja(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=OT(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Or(t,r),boxShadow:`0px 1px 0px 0px ${Or(t,r)}`},_focusVisible:{borderColor:Or(t,n),boxShadow:`0px 1px 0px 0px ${Or(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),rxe=Ja({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),ixe={outline:exe,filled:txe,flushed:nxe,unstyled:rxe},gt=Y2e({baseStyle:Z2e,sizes:J2e,variants:ixe,defaultProps:{size:"md",variant:"outline"}}),t9,oxe={...(t9=gt.baseStyle)==null?void 0:t9.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},n9,r9,axe={outline:e=>{var t,n;return(n=(t=gt.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=gt.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=gt.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(r9=(n9=gt.variants)==null?void 0:n9.unstyled.field)!=null?r9:{}},i9,o9,a9,s9,l9,u9,c9,d9,sxe={xs:(o9=(i9=gt.sizes)==null?void 0:i9.xs.field)!=null?o9:{},sm:(s9=(a9=gt.sizes)==null?void 0:a9.sm.field)!=null?s9:{},md:(u9=(l9=gt.sizes)==null?void 0:l9.md.field)!=null?u9:{},lg:(d9=(c9=gt.sizes)==null?void 0:c9.lg.field)!=null?d9:{}},lxe={baseStyle:oxe,sizes:sxe,variants:axe,defaultProps:{size:"md",variant:"outline"}},Q0=tn("tooltip-bg"),hw=tn("tooltip-fg"),uxe=tn("popper-arrow-bg"),cxe={bg:Q0.reference,color:hw.reference,[Q0.variable]:"colors.gray.700",[hw.variable]:"colors.whiteAlpha.900",_dark:{[Q0.variable]:"colors.gray.300",[hw.variable]:"colors.gray.900"},[uxe.variable]:Q0.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},dxe={baseStyle:cxe},{defineMultiStyleConfig:fxe,definePartsStyle:Qh}=Ve(NV.keys),hxe=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=W(K8(),K8("1rem","rgba(0,0,0,0.1)"))(e),a=W(`${t}.500`,`${t}.200`)(e),s=`linear-gradient(
to right,
transparent 0%,
${Or(n,a)} 50%,
transparent 100%
)`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},pxe={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},gxe=e=>({bg:W("gray.100","whiteAlpha.300")(e)}),mxe=e=>({transitionProperty:"common",transitionDuration:"slow",...hxe(e)}),yxe=Qh(e=>({label:pxe,filledTrack:mxe(e),track:gxe(e)})),vxe={xs:Qh({track:{h:"1"}}),sm:Qh({track:{h:"2"}}),md:Qh({track:{h:"3"}}),lg:Qh({track:{h:"4"}})},bxe=fxe({sizes:vxe,baseStyle:yxe,defaultProps:{size:"md",colorScheme:"blue"}}),_xe=e=>typeof e=="function";function Nr(e,...t){return _xe(e)?e(...t):e}var{definePartsStyle:av,defineMultiStyleConfig:Sxe}=Ve(PV.keys),vp=ke("checkbox-size"),xxe=e=>{const{colorScheme:t}=e;return{w:vp.reference,h:vp.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:W(`${t}.500`,`${t}.200`)(e),borderColor:W(`${t}.500`,`${t}.200`)(e),color:W("white","gray.900")(e),_hover:{bg:W(`${t}.600`,`${t}.300`)(e),borderColor:W(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:W("gray.200","transparent")(e),bg:W("gray.200","whiteAlpha.300")(e),color:W("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:W(`${t}.500`,`${t}.200`)(e),borderColor:W(`${t}.500`,`${t}.200`)(e),color:W("white","gray.900")(e)},_disabled:{bg:W("gray.100","whiteAlpha.100")(e),borderColor:W("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:W("red.500","red.300")(e)}}},wxe={_disabled:{cursor:"not-allowed"}},Cxe={userSelect:"none",_disabled:{opacity:.4}},Exe={transitionProperty:"transform",transitionDuration:"normal"},Txe=av(e=>({icon:Exe,container:wxe,control:Nr(xxe,e),label:Cxe})),Axe={sm:av({control:{[vp.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:av({control:{[vp.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:av({control:{[vp.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},K1=Sxe({baseStyle:Txe,sizes:Axe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Pxe,definePartsStyle:sv}=Ve(kSe.keys),kxe=e=>{var t;const n=(t=Nr(K1.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Ixe=sv(e=>{var t,n,r,i;return{label:(n=(t=K1).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=K1).baseStyle)==null?void 0:i.call(r,e).container,control:kxe(e)}}),Mxe={md:sv({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:sv({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:sv({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Rxe=Pxe({baseStyle:Ixe,sizes:Mxe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Oxe,definePartsStyle:$xe}=Ve(DV.keys),Y0=ke("select-bg"),f9,Nxe={...(f9=gt.baseStyle)==null?void 0:f9.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Y0.reference,[Y0.variable]:"colors.white",_dark:{[Y0.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Y0.reference}},Dxe={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},Lxe=$xe({field:Nxe,icon:Dxe}),Z0={paddingInlineEnd:"8"},h9,p9,g9,m9,y9,v9,b9,_9,Fxe={lg:{...(h9=gt.sizes)==null?void 0:h9.lg,field:{...(p9=gt.sizes)==null?void 0:p9.lg.field,...Z0}},md:{...(g9=gt.sizes)==null?void 0:g9.md,field:{...(m9=gt.sizes)==null?void 0:m9.md.field,...Z0}},sm:{...(y9=gt.sizes)==null?void 0:y9.sm,field:{...(v9=gt.sizes)==null?void 0:v9.sm.field,...Z0}},xs:{...(b9=gt.sizes)==null?void 0:b9.xs,field:{...(_9=gt.sizes)==null?void 0:_9.xs.field,...Z0},icon:{insetEnd:"1"}}},Bxe=Oxe({baseStyle:Lxe,sizes:Fxe,variants:gt.variants,defaultProps:gt.defaultProps}),pw=ke("skeleton-start-color"),gw=ke("skeleton-end-color"),zxe={[pw.variable]:"colors.gray.100",[gw.variable]:"colors.gray.400",_dark:{[pw.variable]:"colors.gray.800",[gw.variable]:"colors.gray.600"},background:pw.reference,borderColor:gw.reference,opacity:.7,borderRadius:"sm"},Vxe={baseStyle:zxe},mw=ke("skip-link-bg"),jxe={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[mw.variable]:"colors.white",_dark:{[mw.variable]:"colors.gray.700"},bg:mw.reference}},Uxe={baseStyle:jxe},{defineMultiStyleConfig:Gxe,definePartsStyle:mS}=Ve(LV.keys),Lg=ke("slider-thumb-size"),Fg=ke("slider-track-size"),el=ke("slider-bg"),Hxe=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...RT({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},qxe=e=>({...RT({orientation:e.orientation,horizontal:{h:Fg.reference},vertical:{w:Fg.reference}}),overflow:"hidden",borderRadius:"sm",[el.variable]:"colors.gray.200",_dark:{[el.variable]:"colors.whiteAlpha.200"},_disabled:{[el.variable]:"colors.gray.300",_dark:{[el.variable]:"colors.whiteAlpha.300"}},bg:el.reference}),Wxe=e=>{const{orientation:t}=e;return{...RT({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Lg.reference,h:Lg.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},Kxe=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[el.variable]:`colors.${t}.500`,_dark:{[el.variable]:`colors.${t}.200`},bg:el.reference}},Xxe=mS(e=>({container:Hxe(e),track:qxe(e),thumb:Wxe(e),filledTrack:Kxe(e)})),Qxe=mS({container:{[Lg.variable]:"sizes.4",[Fg.variable]:"sizes.1"}}),Yxe=mS({container:{[Lg.variable]:"sizes.3.5",[Fg.variable]:"sizes.1"}}),Zxe=mS({container:{[Lg.variable]:"sizes.2.5",[Fg.variable]:"sizes.0.5"}}),Jxe={lg:Qxe,md:Yxe,sm:Zxe},ewe=Gxe({baseStyle:Xxe,sizes:Jxe,defaultProps:{size:"md",colorScheme:"blue"}}),Eu=tn("spinner-size"),twe={width:[Eu.reference],height:[Eu.reference]},nwe={xs:{[Eu.variable]:"sizes.3"},sm:{[Eu.variable]:"sizes.4"},md:{[Eu.variable]:"sizes.6"},lg:{[Eu.variable]:"sizes.8"},xl:{[Eu.variable]:"sizes.12"}},rwe={baseStyle:twe,sizes:nwe,defaultProps:{size:"md"}},{defineMultiStyleConfig:iwe,definePartsStyle:jV}=Ve(ISe.keys),owe={fontWeight:"medium"},awe={opacity:.8,marginBottom:"2"},swe={verticalAlign:"baseline",fontWeight:"semibold"},lwe={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},uwe=jV({container:{},label:owe,helpText:awe,number:swe,icon:lwe}),cwe={md:jV({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},dwe=iwe({baseStyle:uwe,sizes:cwe,defaultProps:{size:"md"}}),yw=ke("kbd-bg"),fwe={[yw.variable]:"colors.gray.100",_dark:{[yw.variable]:"colors.whiteAlpha.100"},bg:yw.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},hwe={baseStyle:fwe},pwe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},gwe={baseStyle:pwe},{defineMultiStyleConfig:mwe,definePartsStyle:ywe}=Ve(PSe.keys),vwe={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},bwe=ywe({icon:vwe}),_we=mwe({baseStyle:bwe}),{defineMultiStyleConfig:Swe,definePartsStyle:xwe}=Ve(MV.keys),Zo=ke("menu-bg"),vw=ke("menu-shadow"),wwe={[Zo.variable]:"#fff",[vw.variable]:"shadows.sm",_dark:{[Zo.variable]:"colors.gray.700",[vw.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Zo.reference,boxShadow:vw.reference},Cwe={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_active:{[Zo.variable]:"colors.gray.200",_dark:{[Zo.variable]:"colors.whiteAlpha.200"}},_expanded:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Zo.reference},Ewe={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Twe={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},Awe={opacity:.6},Pwe={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},kwe={transitionProperty:"common",transitionDuration:"normal"},Iwe=xwe({button:kwe,list:wwe,item:Cwe,groupTitle:Ewe,icon:Twe,command:Awe,divider:Pwe}),Mwe=Swe({baseStyle:Iwe}),{defineMultiStyleConfig:Rwe,definePartsStyle:d3}=Ve(RV.keys),bw=ke("modal-bg"),_w=ke("modal-shadow"),Owe={bg:"blackAlpha.600",zIndex:"modal"},$we=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},Nwe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[bw.variable]:"colors.white",[_w.variable]:"shadows.lg",_dark:{[bw.variable]:"colors.gray.700",[_w.variable]:"shadows.dark-lg"},bg:bw.reference,boxShadow:_w.reference}},Dwe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Lwe={position:"absolute",top:"2",insetEnd:"3"},Fwe=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},Bwe={px:"6",py:"4"},zwe=d3(e=>({overlay:Owe,dialogContainer:Nr($we,e),dialog:Nr(Nwe,e),header:Dwe,closeButton:Lwe,body:Nr(Fwe,e),footer:Bwe}));function po(e){return d3(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Vwe={xs:po("xs"),sm:po("sm"),md:po("md"),lg:po("lg"),xl:po("xl"),"2xl":po("2xl"),"3xl":po("3xl"),"4xl":po("4xl"),"5xl":po("5xl"),"6xl":po("6xl"),full:po("full")},jwe=Rwe({baseStyle:zwe,sizes:Vwe,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Uwe,definePartsStyle:UV}=Ve(OV.keys),$T=tn("number-input-stepper-width"),GV=tn("number-input-input-padding"),Gwe=Xa($T).add("0.5rem").toString(),Sw=tn("number-input-bg"),xw=tn("number-input-color"),ww=tn("number-input-border-color"),Hwe={[$T.variable]:"sizes.6",[GV.variable]:Gwe},qwe=e=>{var t,n;return(n=(t=Nr(gt.baseStyle,e))==null?void 0:t.field)!=null?n:{}},Wwe={width:$T.reference},Kwe={borderStart:"1px solid",borderStartColor:ww.reference,color:xw.reference,bg:Sw.reference,[xw.variable]:"colors.chakra-body-text",[ww.variable]:"colors.chakra-border-color",_dark:{[xw.variable]:"colors.whiteAlpha.800",[ww.variable]:"colors.whiteAlpha.300"},_active:{[Sw.variable]:"colors.gray.200",_dark:{[Sw.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},Xwe=UV(e=>{var t;return{root:Hwe,field:(t=Nr(qwe,e))!=null?t:{},stepperGroup:Wwe,stepper:Kwe}});function J0(e){var t,n,r;const i=(t=gt.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=CV.fontSizes[a];return UV({field:{...i.field,paddingInlineEnd:GV.reference,verticalAlign:"top"},stepper:{fontSize:Xa(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var Qwe={xs:J0("xs"),sm:J0("sm"),md:J0("md"),lg:J0("lg")},Ywe=Uwe({baseStyle:Xwe,sizes:Qwe,variants:gt.variants,defaultProps:gt.defaultProps}),S9,Zwe={...(S9=gt.baseStyle)==null?void 0:S9.field,textAlign:"center"},Jwe={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},x9,w9,eCe={outline:e=>{var t,n,r;return(r=(n=Nr((t=gt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Nr((t=gt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Nr((t=gt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(w9=(x9=gt.variants)==null?void 0:x9.unstyled.field)!=null?w9:{}},tCe={baseStyle:Zwe,sizes:Jwe,variants:eCe,defaultProps:gt.defaultProps},{defineMultiStyleConfig:nCe,definePartsStyle:rCe}=Ve($V.keys),ey=tn("popper-bg"),iCe=tn("popper-arrow-bg"),C9=tn("popper-arrow-shadow-color"),oCe={zIndex:10},aCe={[ey.variable]:"colors.white",bg:ey.reference,[iCe.variable]:ey.reference,[C9.variable]:"colors.gray.200",_dark:{[ey.variable]:"colors.gray.700",[C9.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},sCe={px:3,py:2,borderBottomWidth:"1px"},lCe={px:3,py:2},uCe={px:3,py:2,borderTopWidth:"1px"},cCe={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},dCe=rCe({popper:oCe,content:aCe,header:sCe,body:lCe,footer:uCe,closeButton:cCe}),fCe=nCe({baseStyle:dCe}),{definePartsStyle:f3,defineMultiStyleConfig:hCe}=Ve(ESe.keys),Cw=ke("drawer-bg"),Ew=ke("drawer-box-shadow");function Lc(e){return f3(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var pCe={bg:"blackAlpha.600",zIndex:"modal"},gCe={display:"flex",zIndex:"modal",justifyContent:"center"},mCe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Cw.variable]:"colors.white",[Ew.variable]:"shadows.lg",_dark:{[Cw.variable]:"colors.gray.700",[Ew.variable]:"shadows.dark-lg"},bg:Cw.reference,boxShadow:Ew.reference}},yCe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},vCe={position:"absolute",top:"2",insetEnd:"3"},bCe={px:"6",py:"2",flex:"1",overflow:"auto"},_Ce={px:"6",py:"4"},SCe=f3(e=>({overlay:pCe,dialogContainer:gCe,dialog:Nr(mCe,e),header:yCe,closeButton:vCe,body:bCe,footer:_Ce})),xCe={xs:Lc("xs"),sm:Lc("md"),md:Lc("lg"),lg:Lc("2xl"),xl:Lc("4xl"),full:Lc("full")},wCe=hCe({baseStyle:SCe,sizes:xCe,defaultProps:{size:"xs"}}),{definePartsStyle:CCe,defineMultiStyleConfig:ECe}=Ve(kV.keys),TCe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},ACe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},PCe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},kCe=CCe({preview:TCe,input:ACe,textarea:PCe}),ICe=ECe({baseStyle:kCe}),{definePartsStyle:MCe,defineMultiStyleConfig:RCe}=Ve(TSe.keys),jd=ke("form-control-color"),OCe={marginStart:"1",[jd.variable]:"colors.red.500",_dark:{[jd.variable]:"colors.red.300"},color:jd.reference},$Ce={mt:"2",[jd.variable]:"colors.gray.600",_dark:{[jd.variable]:"colors.whiteAlpha.600"},color:jd.reference,lineHeight:"normal",fontSize:"sm"},NCe=MCe({container:{width:"100%",position:"relative"},requiredIndicator:OCe,helperText:$Ce}),DCe=RCe({baseStyle:NCe}),{definePartsStyle:LCe,defineMultiStyleConfig:FCe}=Ve(ASe.keys),Ud=ke("form-error-color"),BCe={[Ud.variable]:"colors.red.500",_dark:{[Ud.variable]:"colors.red.300"},color:Ud.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},zCe={marginEnd:"0.5em",[Ud.variable]:"colors.red.500",_dark:{[Ud.variable]:"colors.red.300"},color:Ud.reference},VCe=LCe({text:BCe,icon:zCe}),jCe=FCe({baseStyle:VCe}),UCe={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},GCe={baseStyle:UCe},HCe={fontFamily:"heading",fontWeight:"bold"},qCe={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},WCe={baseStyle:HCe,sizes:qCe,defaultProps:{size:"xl"}},{defineMultiStyleConfig:KCe,definePartsStyle:XCe}=Ve(CSe.keys),Tw=ke("breadcrumb-link-decor"),QCe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Tw.reference,[Tw.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Tw.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},YCe=XCe({link:QCe}),ZCe=KCe({baseStyle:YCe}),JCe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},HV=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:W("gray.800","whiteAlpha.900")(e),_hover:{bg:W("gray.100","whiteAlpha.200")(e)},_active:{bg:W("gray.200","whiteAlpha.300")(e)}};const r=Sf(`${t}.200`,.12)(n),i=Sf(`${t}.200`,.24)(n);return{color:W(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:W(`${t}.50`,r)(e)},_active:{bg:W(`${t}.100`,i)(e)}}},e5e=e=>{const{colorScheme:t}=e,n=W("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Nr(HV,e)}},t5e={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},n5e=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=W("gray.100","whiteAlpha.200")(e);return{bg:l,color:W("gray.800","whiteAlpha.900")(e),_hover:{bg:W("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:W("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=t5e[n])!=null?t:{},s=W(r,`${n}.200`)(e);return{bg:s,color:W(i,"gray.800")(e),_hover:{bg:W(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:W(a,`${n}.400`)(e)}}},r5e=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:W(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:W(`${t}.700`,`${t}.500`)(e)}}},i5e={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},o5e={ghost:HV,outline:e5e,solid:n5e,link:r5e,unstyled:i5e},a5e={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},s5e={baseStyle:JCe,variants:o5e,sizes:a5e,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:qu,defineMultiStyleConfig:l5e}=Ve(OSe.keys),X1=ke("card-bg"),is=ke("card-padding"),qV=ke("card-shadow"),lv=ke("card-radius"),WV=ke("card-border-width","0"),KV=ke("card-border-color"),u5e=qu({container:{[X1.variable]:"colors.chakra-body-bg",backgroundColor:X1.reference,boxShadow:qV.reference,borderRadius:lv.reference,color:"chakra-body-text",borderWidth:WV.reference,borderColor:KV.reference},body:{padding:is.reference,flex:"1 1 0%"},header:{padding:is.reference},footer:{padding:is.reference}}),c5e={sm:qu({container:{[lv.variable]:"radii.base",[is.variable]:"space.3"}}),md:qu({container:{[lv.variable]:"radii.md",[is.variable]:"space.5"}}),lg:qu({container:{[lv.variable]:"radii.xl",[is.variable]:"space.7"}})},d5e={elevated:qu({container:{[qV.variable]:"shadows.base",_dark:{[X1.variable]:"colors.gray.700"}}}),outline:qu({container:{[WV.variable]:"1px",[KV.variable]:"colors.chakra-border-color"}}),filled:qu({container:{[X1.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[is.variable]:0},header:{[is.variable]:0},footer:{[is.variable]:0}}},f5e=l5e({baseStyle:u5e,variants:d5e,sizes:c5e,defaultProps:{variant:"elevated",size:"md"}}),bp=tn("close-button-size"),_h=tn("close-button-bg"),h5e={w:[bp.reference],h:[bp.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[_h.variable]:"colors.blackAlpha.100",_dark:{[_h.variable]:"colors.whiteAlpha.100"}},_active:{[_h.variable]:"colors.blackAlpha.200",_dark:{[_h.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:_h.reference},p5e={lg:{[bp.variable]:"sizes.10",fontSize:"md"},md:{[bp.variable]:"sizes.8",fontSize:"xs"},sm:{[bp.variable]:"sizes.6",fontSize:"2xs"}},g5e={baseStyle:h5e,sizes:p5e,defaultProps:{size:"md"}},{variants:m5e,defaultProps:y5e}=yp,v5e={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:yn.bg.reference,color:yn.color.reference,boxShadow:yn.shadow.reference},b5e={baseStyle:v5e,variants:m5e,defaultProps:y5e},_5e={w:"100%",mx:"auto",maxW:"prose",px:"4"},S5e={baseStyle:_5e},x5e={opacity:.6,borderColor:"inherit"},w5e={borderStyle:"solid"},C5e={borderStyle:"dashed"},E5e={solid:w5e,dashed:C5e},T5e={baseStyle:x5e,variants:E5e,defaultProps:{variant:"solid"}},{definePartsStyle:A5e,defineMultiStyleConfig:P5e}=Ve(AV.keys),k5e={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},I5e={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},M5e={pt:"2",px:"4",pb:"5"},R5e={fontSize:"1.25em"},O5e=A5e({container:k5e,button:I5e,panel:M5e,icon:R5e}),$5e=P5e({baseStyle:O5e}),{definePartsStyle:Om,defineMultiStyleConfig:N5e}=Ve(xSe.keys),xi=ke("alert-fg"),bs=ke("alert-bg"),D5e=Om({container:{bg:bs.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:xi.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:xi.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function NT(e){const{theme:t,colorScheme:n}=e,r=Sf(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var L5e=Om(e=>{const{colorScheme:t}=e,n=NT(e);return{container:{[xi.variable]:`colors.${t}.600`,[bs.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[bs.variable]:n.dark}}}}),F5e=Om(e=>{const{colorScheme:t}=e,n=NT(e);return{container:{[xi.variable]:`colors.${t}.600`,[bs.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[bs.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:xi.reference}}}),B5e=Om(e=>{const{colorScheme:t}=e,n=NT(e);return{container:{[xi.variable]:`colors.${t}.600`,[bs.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[bs.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:xi.reference}}}),z5e=Om(e=>{const{colorScheme:t}=e;return{container:{[xi.variable]:"colors.white",[bs.variable]:`colors.${t}.600`,_dark:{[xi.variable]:"colors.gray.900",[bs.variable]:`colors.${t}.200`},color:xi.reference}}}),V5e={subtle:L5e,"left-accent":F5e,"top-accent":B5e,solid:z5e},j5e=N5e({baseStyle:D5e,variants:V5e,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:XV,defineMultiStyleConfig:U5e}=Ve(wSe.keys),Gd=ke("avatar-border-color"),_p=ke("avatar-bg"),Bg=ke("avatar-font-size"),xf=ke("avatar-size"),G5e={borderRadius:"full",border:"0.2em solid",borderColor:Gd.reference,[Gd.variable]:"white",_dark:{[Gd.variable]:"colors.gray.800"}},H5e={bg:_p.reference,fontSize:Bg.reference,width:xf.reference,height:xf.reference,lineHeight:"1",[_p.variable]:"colors.gray.200",_dark:{[_p.variable]:"colors.whiteAlpha.400"}},q5e=e=>{const{name:t,theme:n}=e,r=t?JSe({string:t}):"colors.gray.400",i=YSe(r)(n);let o="white";return i||(o="gray.800"),{bg:_p.reference,fontSize:Bg.reference,color:o,borderColor:Gd.reference,verticalAlign:"top",width:xf.reference,height:xf.reference,"&:not([data-loaded])":{[_p.variable]:r},[Gd.variable]:"colors.white",_dark:{[Gd.variable]:"colors.gray.800"}}},W5e={fontSize:Bg.reference,lineHeight:"1"},K5e=XV(e=>({badge:Nr(G5e,e),excessLabel:Nr(H5e,e),container:Nr(q5e,e),label:W5e}));function Fs(e){const t=e!=="100%"?TV[e]:void 0;return XV({container:{[xf.variable]:t??e,[Bg.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[xf.variable]:t??e,[Bg.variable]:`calc(${t??e} / 2.5)`}})}var X5e={"2xs":Fs(4),xs:Fs(6),sm:Fs(8),md:Fs(12),lg:Fs(16),xl:Fs(24),"2xl":Fs(32),full:Fs("100%")},Q5e=U5e({baseStyle:K5e,sizes:X5e,defaultProps:{size:"md"}}),Y5e={Accordion:$5e,Alert:j5e,Avatar:Q5e,Badge:yp,Breadcrumb:ZCe,Button:s5e,Checkbox:K1,CloseButton:g5e,Code:b5e,Container:S5e,Divider:T5e,Drawer:wCe,Editable:ICe,Form:DCe,FormError:jCe,FormLabel:GCe,Heading:WCe,Input:gt,Kbd:hwe,Link:gwe,List:_we,Menu:Mwe,Modal:jwe,NumberInput:Ywe,PinInput:tCe,Popover:fCe,Progress:bxe,Radio:Rxe,Select:Bxe,Skeleton:Vxe,SkipLink:Uxe,Slider:ewe,Spinner:rwe,Stat:dwe,Switch:g2e,Table:x2e,Tabs:L2e,Tag:Q2e,Textarea:lxe,Tooltip:dxe,Card:f5e,Stepper:SSe},Z5e={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},J5e={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},e3e="ltr",t3e={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},n3e={semanticTokens:Z5e,direction:e3e,...vSe,components:Y5e,styles:J5e,config:t3e};function r3e(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function i3e(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 o3e=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},QV=o3e(i3e);function YV(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var ZV=e=>YV(e,t=>t!=null);function a3e(e){return typeof e=="function"}function JV(e,...t){return a3e(e)?e(...t):e}function PUe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var s3e=typeof Element<"u",l3e=typeof Map=="function",u3e=typeof Set=="function",c3e=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function uv(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(!uv(e[r],t[r]))return!1;return!0}var o;if(l3e&&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(!uv(r.value[1],t.get(r.value[0])))return!1;return!0}if(u3e&&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(c3e&&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(s3e&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!uv(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var d3e=function(t,n){try{return uv(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 f3e=Bl(d3e);function ej(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=mV(),s=e?QV(o,`components.${e}`):void 0,l=r||s,u=ca({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},ZV(r3e(i,["children"]))),c=k.useRef({});if(l){const f=K_e(l)(u);f3e(c.current,f)||(c.current=f)}return c.current}function $m(e,t={}){return ej(e,t)}function h3e(e,t={}){return ej(e,t)}var p3e=new Set([...D_e,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),g3e=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function m3e(e){return g3e.has(e)||!p3e.has(e)}function y3e(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}function v3e(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var b3e=/^((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)-.*))$/,_3e=oV(function(e){return b3e.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),S3e=_3e,x3e=function(t){return t!=="theme"},E9=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?S3e:x3e},T9=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},w3e=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return sV(n,r,i),hbe(function(){return lV(n,r,i)}),null},C3e=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=T9(t,n,r),l=s||E9(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var p=fV(function(g,_,b){var y=u&&g.as||i,m="",v=[],S=g;if(g.theme==null){S={};for(var w in g)S[w]=g[w];S.theme=k.useContext(Ng)}typeof g.className=="string"?m=abe(_.registered,v,g.className):g.className!=null&&(m=g.className+" ");var C=ET(d.concat(v),_.registered,S);m+=_.key+"-"+C.name,a!==void 0&&(m+=" "+a);var x=u&&s===void 0?E9(y):l,P={};for(var E in g)u&&E==="as"||x(E)&&(P[E]=g[E]);return P.className=m,P.ref=b,k.createElement(k.Fragment,null,k.createElement(w3e,{cache:_,serialized:C,isStringTag:typeof y=="string"}),k.createElement(y,P))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=d,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return"."+a}}),p.withComponent=function(g,_){return e(g,b1({},n,_,{shouldForwardProp:T9(p,_,!0)})).apply(void 0,d)},p}},E3e=["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"],Q1=C3e.bind();E3e.forEach(function(e){Q1[e]=Q1(e)});var A9,T3e=(A9=Q1.default)!=null?A9:Q1,A3e=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=YV(a,(d,f)=>F_e(f)),l=JV(e,t),u=y3e({},i,l,ZV(s),o),c=wV(u)(t.theme);return r?[c,r]:c};function Aw(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=m3e);const i=A3e({baseStyle:n}),o=T3e(e,r)(i);return J.forwardRef(function(l,u){const{colorMode:c,forced:d}=fS();return J.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function P3e(){const e=new Map;return new Proxy(Aw,{apply(t,n,r){return Aw(...r)},get(t,n){return e.has(n)||e.set(n,Aw(n)),e.get(n)}})}var lr=P3e();function Ii(e){return k.forwardRef(e)}function k3e(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=k.createContext(void 0);i.displayName=r;function o(){var a;const s=k.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function I3e(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=k.useMemo(()=>$_e(n),[n]);return oe.jsxs(mbe,{theme:i,children:[oe.jsx(M3e,{root:t}),r]})}function M3e({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return oe.jsx(hV,{styles:n=>({[t]:n.__cssVars})})}k3e({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function kUe(){const{colorMode:e}=fS();return oe.jsx(hV,{styles:t=>{const n=QV(t,"styles.global"),r=JV(n,{theme:t,colorMode:e});return r?wV(r)(t):void 0}})}var R3e=(e,t)=>e.find(n=>n.id===t);function P9(e,t){const n=tj(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function tj(e,t){for(const[n,r]of Object.entries(e))if(R3e(r,t))return n}function O3e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function $3e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function N3e(e,t=[]){const n=k.useRef(e);return k.useEffect(()=>{n.current=e}),k.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function D3e(e,t){const n=N3e(e);k.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function k9(e,t){const n=k.useRef(!1),r=k.useRef(!1);k.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),k.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const nj=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),yS=k.createContext({}),Nm=k.createContext(null),vS=typeof document<"u",DT=vS?k.useLayoutEffect:k.useEffect,rj=k.createContext({strict:!1});function L3e(e,t,n,r){const{visualElement:i}=k.useContext(yS),o=k.useContext(rj),a=k.useContext(Nm),s=k.useContext(nj).reducedMotion,l=k.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;k.useInsertionEffect(()=>{u&&u.update(n,a)});const c=k.useRef(!!window.HandoffAppearAnimations);return DT(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function gd(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function F3e(e,t,n){return k.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):gd(n)&&(n.current=r))},[t])}function zg(e){return typeof e=="string"||Array.isArray(e)}function bS(e){return typeof e=="object"&&typeof e.start=="function"}const LT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],FT=["initial",...LT];function _S(e){return bS(e.animate)||FT.some(t=>zg(e[t]))}function ij(e){return!!(_S(e)||e.variants)}function B3e(e,t){if(_S(e)){const{initial:n,animate:r}=e;return{initial:n===!1||zg(n)?n:void 0,animate:zg(r)?r:void 0}}return e.inherit!==!1?t:{}}function z3e(e){const{initial:t,animate:n}=B3e(e,k.useContext(yS));return k.useMemo(()=>({initial:t,animate:n}),[I9(t),I9(n)])}function I9(e){return Array.isArray(e)?e.join(" "):e}const M9={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"]},Vg={};for(const e in M9)Vg[e]={isEnabled:t=>M9[e].some(n=>!!t[n])};function V3e(e){for(const t in e)Vg[t]={...Vg[t],...e[t]}}const BT=k.createContext({}),oj=k.createContext({}),j3e=Symbol.for("motionComponentSymbol");function U3e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&V3e(e);function o(s,l){let u;const c={...k.useContext(nj),...s,layoutId:G3e(s)},{isStatic:d}=c,f=z3e(s),h=r(s,d);if(!d&&vS){f.visualElement=L3e(i,h,c,t);const p=k.useContext(oj),g=k.useContext(rj).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,g,e,p))}return k.createElement(yS.Provider,{value:f},u&&f.visualElement?k.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,s,F3e(h,f.visualElement,l),h,d,f.visualElement))}const a=k.forwardRef(o);return a[j3e]=i,a}function G3e({layoutId:e}){const t=k.useContext(BT).id;return t&&e!==void 0?t+"-"+e:e}function H3e(e){function t(r,i={}){return U3e(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 q3e=["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 zT(e){return typeof e!="string"||e.includes("-")?!1:!!(q3e.indexOf(e)>-1||/[A-Z]/.test(e))}const Y1={};function W3e(e){Object.assign(Y1,e)}const Dm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hc=new Set(Dm);function aj(e,{layout:t,layoutId:n}){return hc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y1[e]||e==="opacity")}const ai=e=>!!(e&&e.getVelocity),K3e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},X3e=Dm.length;function Q3e(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<X3e;a++){const s=Dm[a];if(e[s]!==void 0){const l=K3e[s]||s;o+=`${l}(${e[s]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const sj=e=>t=>typeof t=="string"&&t.startsWith(e),lj=sj("--"),h3=sj("var(--"),Y3e=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,Z3e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ol=(e,t,n)=>Math.min(Math.max(n,e),t),pc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sp={...pc,transform:e=>Ol(0,1,e)},ty={...pc,default:1},xp=e=>Math.round(e*1e5)/1e5,SS=/(-)?([\d]*\.?[\d])+/g,uj=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,J3e=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Lm(e){return typeof e=="string"}const Fm=e=>({test:t=>Lm(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Vs=Fm("deg"),ba=Fm("%"),Re=Fm("px"),e4e=Fm("vh"),t4e=Fm("vw"),R9={...ba,parse:e=>ba.parse(e)/100,transform:e=>ba.transform(e*100)},O9={...pc,transform:Math.round},cj={borderWidth:Re,borderTopWidth:Re,borderRightWidth:Re,borderBottomWidth:Re,borderLeftWidth:Re,borderRadius:Re,radius:Re,borderTopLeftRadius:Re,borderTopRightRadius:Re,borderBottomRightRadius:Re,borderBottomLeftRadius:Re,width:Re,maxWidth:Re,height:Re,maxHeight:Re,size:Re,top:Re,right:Re,bottom:Re,left:Re,padding:Re,paddingTop:Re,paddingRight:Re,paddingBottom:Re,paddingLeft:Re,margin:Re,marginTop:Re,marginRight:Re,marginBottom:Re,marginLeft:Re,rotate:Vs,rotateX:Vs,rotateY:Vs,rotateZ:Vs,scale:ty,scaleX:ty,scaleY:ty,scaleZ:ty,skew:Vs,skewX:Vs,skewY:Vs,distance:Re,translateX:Re,translateY:Re,translateZ:Re,x:Re,y:Re,z:Re,perspective:Re,transformPerspective:Re,opacity:Sp,originX:R9,originY:R9,originZ:Re,zIndex:O9,fillOpacity:Sp,strokeOpacity:Sp,numOctaves:O9};function VT(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if(lj(d)){o[d]=f;continue}const h=cj[d],p=Z3e(f,h);if(hc.has(d)){if(l=!0,a[d]=p,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,s[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=Q3e(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=s;i.transformOrigin=`${d} ${f} ${h}`}}const jT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dj(e,t,n){for(const r in t)!ai(t[r])&&!aj(r,n)&&(e[r]=t[r])}function n4e({transformTemplate:e},t,n){return k.useMemo(()=>{const r=jT();return VT(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function r4e(e,t,n){const r=e.style||{},i={};return dj(i,r,e),Object.assign(i,n4e(e,t,n)),e.transformValues?e.transformValues(i):i}function i4e(e,t,n){const r={},i=r4e(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 o4e=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 Z1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||o4e.has(e)}let fj=e=>!Z1(e);function a4e(e){e&&(fj=t=>t.startsWith("on")?!Z1(t):e(t))}try{a4e(require("@emotion/is-prop-valid").default)}catch{}function s4e(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(fj(i)||n===!0&&Z1(i)||!t&&!Z1(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function $9(e,t,n){return typeof e=="string"?e:Re.transform(t+n*e)}function l4e(e,t,n){const r=$9(t,e.x,e.width),i=$9(n,e.y,e.height);return`${r} ${i}`}const u4e={offset:"stroke-dashoffset",array:"stroke-dasharray"},c4e={offset:"strokeDashoffset",array:"strokeDasharray"};function d4e(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?u4e:c4e;e[o.offset]=Re.transform(-r);const a=Re.transform(t),s=Re.transform(n);e[o.array]=`${a} ${s}`}function UT(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,d,f){if(VT(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=l4e(g,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&d4e(h,a,s,l,!1)}const hj=()=>({...jT(),attrs:{}}),GT=e=>typeof e=="string"&&e.toLowerCase()==="svg";function f4e(e,t,n,r){const i=k.useMemo(()=>{const o=hj();return UT(o,t,{enableHardwareAcceleration:!1},GT(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};dj(o,e.style,e),i.style={...o,...i.style}}return i}function h4e(e=!1){return(n,r,i,{latestValues:o},a)=>{const l=(zT(n)?f4e:i4e)(r,o,a,n),c={...s4e(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=k.useMemo(()=>ai(d)?d.get():d,[d]);return k.createElement(n,{...c,children:f})}}const HT=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function pj(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 gj=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 mj(e,t,n,r){pj(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(gj.has(i)?i:HT(i),t.attrs[i])}function qT(e,t){const{style:n}=e,r={};for(const i in n)(ai(n[i])||t.style&&ai(t.style[i])||aj(i,e))&&(r[i]=n[i]);return r}function yj(e,t){const n=qT(e,t);for(const r in e)if(ai(e[r])||ai(t[r])){const i=Dm.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function WT(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 vj(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const J1=e=>Array.isArray(e),p4e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),g4e=e=>J1(e)?e[e.length-1]||0:e;function cv(e){const t=ai(e)?e.get():e;return p4e(t)?t.toValue():t}function m4e({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:y4e(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const bj=e=>(t,n)=>{const r=k.useContext(yS),i=k.useContext(Nm),o=()=>m4e(e,t,r,i);return n?o():vj(o)};function y4e(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=cv(o[f]);let{initial:a,animate:s}=e;const l=_S(e),u=ij(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const d=c?s:a;return d&&typeof d!="boolean"&&!bS(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=WT(e,h);if(!p)return;const{transitionEnd:g,transition:_,...b}=p;for(const y in b){let m=b[y];if(Array.isArray(m)){const v=c?m.length-1:0;m=m[v]}m!==null&&(i[y]=m)}for(const y in g)i[y]=g[y]}),i}const cn=e=>e;class N9{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function v4e(e){let t=new N9,n=new N9,r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&a.add(l),f.add(l)&&d&&i&&(r=t.order.length),l},cancel:l=>{n.remove(l),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let u=0;u<r;u++){const c=t.order[u];c(l),a.has(c)&&(s.schedule(c),e())}i=!1,o&&(o=!1,s.process(l))}};return s}const ny=["prepare","read","update","preRender","render","postRender"],b4e=40;function _4e(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=ny.reduce((d,f)=>(d[f]=v4e(()=>n=!0),d),{}),a=d=>o[d].process(i),s=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,b4e),1),i.timestamp=d,i.isProcessing=!0,ny.forEach(a),i.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,i.isProcessing||e(s)};return{schedule:ny.reduce((d,f)=>{const h=o[f];return d[f]=(p,g=!1,_=!1)=>(n||l(),h.schedule(p,g,_)),d},{}),cancel:d=>ny.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Rt,cancel:_s,state:zn,steps:Pw}=_4e(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0),S4e={useVisualState:bj({scrapeMotionValuesFromProps:yj,createRenderState:hj,onMount:(e,t,{renderState:n,latestValues:r})=>{Rt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Rt.render(()=>{UT(n,r,{enableHardwareAcceleration:!1},GT(t.tagName),e.transformTemplate),mj(t,n)})}})},x4e={useVisualState:bj({scrapeMotionValuesFromProps:qT,createRenderState:jT})};function w4e(e,{forwardMotionProps:t=!1},n,r){return{...zT(e)?S4e:x4e,preloadedFeatures:n,useRender:h4e(t),createVisualElement:r,Component:e}}function es(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const _j=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function xS(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const C4e=e=>t=>_j(t)&&e(t,xS(t));function os(e,t,n,r){return es(e,t,C4e(n),r)}const E4e=(e,t)=>n=>t(e(n)),_l=(...e)=>e.reduce(E4e);function Sj(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const D9=Sj("dragHorizontal"),L9=Sj("dragVertical");function xj(e){let t=!1;if(e==="y")t=L9();else if(e==="x")t=D9();else{const n=D9(),r=L9();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function wj(){const e=xj(!0);return e?(e(),!1):!0}class Xl{constructor(t){this.isMounted=!1,this.node=t}update(){}}function F9(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||wj())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Rt.update(()=>s[r](o,a))};return os(e.current,n,i,{passive:!e.getProps()[r]})}class T4e extends Xl{mount(){this.unmount=_l(F9(this.node,!0),F9(this.node,!1))}unmount(){}}class A4e extends Xl{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=_l(es(this.node.current,"focus",()=>this.onFocus()),es(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Cj=(e,t)=>t?e===t?!0:Cj(e,t.parentElement):!1;function kw(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,xS(n))}class P4e extends Xl{constructor(){super(...arguments),this.removeStartListeners=cn,this.removeEndListeners=cn,this.removeAccessibleListeners=cn,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=os(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Rt.update(()=>{Cj(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=os(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=_l(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||kw("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Rt.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=es(this.node.current,"keyup",a),kw("down",(s,l)=>{this.startPress(s,l)})},n=es(this.node.current,"keydown",t),r=()=>{this.isPressing&&kw("cancel",(o,a)=>this.cancelPress(o,a))},i=es(this.node.current,"blur",r);this.removeAccessibleListeners=_l(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&&Rt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!wj()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Rt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=os(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=es(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=_l(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const p3=new WeakMap,Iw=new WeakMap,k4e=e=>{const t=p3.get(e.target);t&&t(e)},I4e=e=>{e.forEach(k4e)};function M4e({root:e,...t}){const n=e||document;Iw.has(n)||Iw.set(n,{});const r=Iw.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(I4e,{root:e,...t})),r[i]}function R4e(e,t,n){const r=M4e(t);return p3.set(e,n),r.observe(e),()=>{p3.delete(e),r.unobserve(e)}}const O4e={some:0,all:1};class $4e extends Xl{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,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:O4e[i]},s=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:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return R4e(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(N4e(t,n))&&this.startObserver()}unmount(){}}function N4e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const D4e={inView:{Feature:$4e},tap:{Feature:P4e},focus:{Feature:A4e},hover:{Feature:T4e}};function Ej(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 L4e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function F4e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function wS(e,t,n){const r=e.getProps();return WT(r,t,n!==void 0?n:r.custom,L4e(e),F4e(e))}const B4e="framerAppearId",z4e="data-"+HT(B4e);let V4e=cn,KT=cn;const Sl=e=>e*1e3,as=e=>e/1e3,j4e={current:!1},Tj=e=>Array.isArray(e)&&typeof e[0]=="number";function Aj(e){return!!(!e||typeof e=="string"&&Pj[e]||Tj(e)||Array.isArray(e)&&e.every(Aj))}const Yh=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Pj={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yh([0,.65,.55,1]),circOut:Yh([.55,0,1,.45]),backIn:Yh([.31,.01,.66,-.59]),backOut:Yh([.33,1.53,.69,.99])};function kj(e){if(e)return Tj(e)?Yh(e):Array.isArray(e)?e.map(kj):Pj[e]}function U4e(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=kj(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function G4e(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const Ij=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,H4e=1e-7,q4e=12;function W4e(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=Ij(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>H4e&&++s<q4e);return a}function Bm(e,t,n,r){if(e===t&&n===r)return cn;const i=o=>W4e(o,0,1,e,n);return o=>o===0||o===1?o:Ij(i(o),t,r)}const K4e=Bm(.42,0,1,1),X4e=Bm(0,0,.58,1),Mj=Bm(.42,0,.58,1),Q4e=e=>Array.isArray(e)&&typeof e[0]!="number",Rj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Oj=e=>t=>1-e(1-t),$j=e=>1-Math.sin(Math.acos(e)),XT=Oj($j),Y4e=Rj(XT),Nj=Bm(.33,1.53,.69,.99),QT=Oj(Nj),Z4e=Rj(QT),J4e=e=>(e*=2)<1?.5*QT(e):.5*(2-Math.pow(2,-10*(e-1))),eEe={linear:cn,easeIn:K4e,easeInOut:Mj,easeOut:X4e,circIn:$j,circInOut:Y4e,circOut:XT,backIn:QT,backInOut:Z4e,backOut:Nj,anticipate:J4e},B9=e=>{if(Array.isArray(e)){KT(e.length===4);const[t,n,r,i]=e;return Bm(t,n,r,i)}else if(typeof e=="string")return eEe[e];return e},YT=(e,t)=>n=>!!(Lm(n)&&J3e.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Dj=(e,t,n)=>r=>{if(!Lm(r))return r;const[i,o,a,s]=r.match(SS);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},tEe=e=>Ol(0,255,e),Mw={...pc,transform:e=>Math.round(tEe(e))},$u={test:YT("rgb","red"),parse:Dj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Mw.transform(e)+", "+Mw.transform(t)+", "+Mw.transform(n)+", "+xp(Sp.transform(r))+")"};function nEe(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 g3={test:YT("#"),parse:nEe,transform:$u.transform},md={test:YT("hsl","hue"),parse:Dj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ba.transform(xp(t))+", "+ba.transform(xp(n))+", "+xp(Sp.transform(r))+")"},Ir={test:e=>$u.test(e)||g3.test(e)||md.test(e),parse:e=>$u.test(e)?$u.parse(e):md.test(e)?md.parse(e):g3.parse(e),transform:e=>Lm(e)?e:e.hasOwnProperty("red")?$u.transform(e):md.transform(e)},Zt=(e,t,n)=>-n*e+n*t+e;function Rw(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 rEe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=Rw(l,s,e+1/3),o=Rw(l,s,e),a=Rw(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Ow=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},iEe=[g3,$u,md],oEe=e=>iEe.find(t=>t.test(e));function z9(e){const t=oEe(e);let n=t.parse(e);return t===md&&(n=rEe(n)),n}const Lj=(e,t)=>{const n=z9(e),r=z9(t),i={...n};return o=>(i.red=Ow(n.red,r.red,o),i.green=Ow(n.green,r.green,o),i.blue=Ow(n.blue,r.blue,o),i.alpha=Zt(n.alpha,r.alpha,o),$u.transform(i))};function aEe(e){var t,n;return isNaN(e)&&Lm(e)&&(((t=e.match(SS))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(uj))===null||n===void 0?void 0:n.length)||0)>0}const Fj={regex:Y3e,countKey:"Vars",token:"${v}",parse:cn},Bj={regex:uj,countKey:"Colors",token:"${c}",parse:Ir.parse},zj={regex:SS,countKey:"Numbers",token:"${n}",parse:pc.parse};function $w(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 eb(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&$w(n,Fj),$w(n,Bj),$w(n,zj),n}function Vj(e){return eb(e).values}function jj(e){const{values:t,numColors:n,numVars:r,tokenised:i}=eb(e),o=t.length;return a=>{let s=i;for(let l=0;l<o;l++)l<r?s=s.replace(Fj.token,a[l]):l<r+n?s=s.replace(Bj.token,Ir.transform(a[l])):s=s.replace(zj.token,xp(a[l]));return s}}const sEe=e=>typeof e=="number"?0:e;function lEe(e){const t=Vj(e);return jj(e)(t.map(sEe))}const $l={test:aEe,parse:Vj,createTransformer:jj,getAnimatableNone:lEe},Uj=(e,t)=>n=>`${n>0?t:e}`;function Gj(e,t){return typeof e=="number"?n=>Zt(e,t,n):Ir.test(e)?Lj(e,t):e.startsWith("var(")?Uj(e,t):qj(e,t)}const Hj=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>Gj(o,t[a]));return o=>{for(let a=0;a<r;a++)n[a]=i[a](o);return n}},uEe=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Gj(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},qj=(e,t)=>{const n=$l.createTransformer(t),r=eb(e),i=eb(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?_l(Hj(r.values,i.values),n):Uj(e,t)},jg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},V9=(e,t)=>n=>Zt(e,t,n);function cEe(e){return typeof e=="number"?V9:typeof e=="string"?Ir.test(e)?Lj:qj:Array.isArray(e)?Hj:typeof e=="object"?uEe:V9}function dEe(e,t,n){const r=[],i=n||cEe(e[0]),o=e.length-1;for(let a=0;a<o;a++){let s=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||cn:t;s=_l(l,s)}r.push(s)}return r}function Wj(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(KT(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=dEe(t,r,i),s=a.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=jg(e[c],e[c+1],u);return a[c](d)};return n?u=>l(Ol(e[0],e[o-1],u)):l}function fEe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=jg(0,t,r);e.push(Zt(n,1,i))}}function hEe(e){const t=[0];return fEe(t,e.length-1),t}function pEe(e,t){return e.map(n=>n*t)}function gEe(e,t){return e.map(()=>t||Mj).splice(0,e.length-1)}function tb({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Q4e(r)?r.map(B9):B9(r),o={done:!1,value:t[0]},a=pEe(n&&n.length===t.length?n:hEe(t),e),s=Wj(a,t,{ease:Array.isArray(i)?i:gEe(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}function Kj(e,t){return t?e*(1e3/t):0}const mEe=5;function Xj(e,t,n){const r=Math.max(t-mEe,0);return Kj(n-e(r),t-r)}const Nw=.001,yEe=.01,j9=10,vEe=.05,bEe=1;function _Ee({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;V4e(e<=Sl(j9));let a=1-t;a=Ol(vEe,bEe,a),e=Ol(yEe,j9,as(e)),a<1?(i=u=>{const c=u*a,d=c*e,f=c-n,h=m3(u,a),p=Math.exp(-d);return Nw-f/h*p},o=u=>{const d=u*a*e,f=d*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-d),g=m3(Math.pow(u,2),a);return(-i(u)+Nw>0?-1:1)*((f-h)*p)/g}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Nw+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=xEe(i,o,s);if(e=Sl(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const SEe=12;function xEe(e,t,n){let r=n;for(let i=1;i<SEe;i++)r=r-e(r)/t(r);return r}function m3(e,t){return e*Math.sqrt(1-t*t)}const wEe=["duration","bounce"],CEe=["stiffness","damping","mass"];function U9(e,t){return t.some(n=>e[n]!==void 0)}function EEe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!U9(e,CEe)&&U9(e,wEe)){const n=_Ee(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function Qj({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=EEe(r),h=c?-as(c):0,p=l/(2*Math.sqrt(s*u)),g=o-i,_=as(Math.sqrt(s/u)),b=Math.abs(g)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let y;if(p<1){const m=m3(_,p);y=v=>{const S=Math.exp(-p*_*v);return o-S*((h+p*_*g)/m*Math.sin(m*v)+g*Math.cos(m*v))}}else if(p===1)y=m=>o-Math.exp(-_*m)*(g+(h+_*g)*m);else{const m=_*Math.sqrt(p*p-1);y=v=>{const S=Math.exp(-p*_*v),w=Math.min(m*v,300);return o-S*((h+p*_*g)*Math.sinh(w)+m*g*Math.cosh(w))/m}}return{calculatedDuration:f&&d||null,next:m=>{const v=y(m);if(f)a.done=m>=d;else{let S=h;m!==0&&(p<1?S=Xj(y,m,v):S=0);const w=Math.abs(S)<=n,C=Math.abs(o-v)<=t;a.done=w&&C}return a.value=a.done?o:v,a}}}function G9({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=x=>s!==void 0&&x<s||l!==void 0&&x>l,p=x=>s===void 0?l:l===void 0||Math.abs(s-x)<Math.abs(l-x)?s:l;let g=n*t;const _=d+g,b=a===void 0?_:a(_);b!==_&&(g=b-d);const y=x=>-g*Math.exp(-x/r),m=x=>b+y(x),v=x=>{const P=y(x),E=m(x);f.done=Math.abs(P)<=u,f.value=f.done?b:E};let S,w;const C=x=>{h(f.value)&&(S=x,w=Qj({keyframes:[f.value,p(f.value)],velocity:Xj(m,x,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:x=>{let P=!1;return!w&&S===void 0&&(P=!0,v(x),C(x)),S!==void 0&&x>S?w.next(x-S):(!P&&v(x),f)}}}const TEe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Rt.update(t,!0),stop:()=>_s(t),now:()=>zn.isProcessing?zn.timestamp:performance.now()}},H9=2e4;function q9(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<H9;)t+=n,r=e.next(t);return t>=H9?1/0:t}const AEe={decay:G9,inertia:G9,tween:tb,keyframes:tb,spring:Qj};function nb({autoplay:e=!0,delay:t=0,driver:n=TEe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,p=!1,g,_;const b=()=>{_=new Promise(B=>{g=B})};b();let y;const m=AEe[i]||tb;let v;m!==tb&&typeof r[0]!="number"&&(v=Wj([0,100],r,{clamp:!1}),r=[0,100]);const S=m({...f,keyframes:r});let w;s==="mirror"&&(w=m({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let C="idle",x=null,P=null,E=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=q9(S));const{calculatedDuration:I}=S;let N=1/0,M=1/0;I!==null&&(N=I+a,M=N*(o+1)-a);let T=0;const A=B=>{if(P===null)return;h>0&&(P=Math.min(P,B)),h<0&&(P=Math.min(B-M/h,P)),x!==null?T=x:T=Math.round(B-P)*h;const U=T-t*(h>=0?1:-1),j=h>=0?U<0:U>M;T=Math.max(U,0),C==="finished"&&x===null&&(T=M);let q=T,Y=S;if(o){const ee=T/N;let re=Math.floor(ee),fe=ee%1;!fe&&ee>=1&&(fe=1),fe===1&&re--,re=Math.min(re,o+1);const Se=!!(re%2);Se&&(s==="reverse"?(fe=1-fe,a&&(fe-=a/N)):s==="mirror"&&(Y=w));let Me=Ol(0,1,fe);T>M&&(Me=s==="reverse"&&Se?1:0),q=Me*N}const Z=j?{done:!1,value:r[0]}:Y.next(q);v&&(Z.value=v(Z.value));let{done:V}=Z;!j&&I!==null&&(V=h>=0?T>=M:T<=0);const K=x===null&&(C==="finished"||C==="running"&&V);return d&&d(Z.value),K&&$(),Z},R=()=>{y&&y.stop(),y=void 0},D=()=>{C="idle",R(),g(),b(),P=E=null},$=()=>{C="finished",c&&c(),R(),g()},L=()=>{if(p)return;y||(y=n(A));const B=y.now();l&&l(),x!==null?P=B-x:(!P||C==="finished")&&(P=B),C==="finished"&&b(),E=P,x=null,C="running",y.start()};e&&L();const O={then(B,U){return _.then(B,U)},get time(){return as(T)},set time(B){B=Sl(B),T=B,x!==null||!y||h===0?x=B:P=y.now()-B/h},get duration(){const B=S.calculatedDuration===null?q9(S):S.calculatedDuration;return as(B)},get speed(){return h},set speed(B){B===h||!y||(h=B,O.time=as(T))},get state(){return C},play:L,pause:()=>{C="paused",x=T},stop:()=>{p=!0,C!=="idle"&&(C="idle",u&&u(),D())},cancel:()=>{E!==null&&A(E),D()},complete:()=>{C="finished"},sample:B=>(P=0,A(B))};return O}function PEe(e){let t;return()=>(t===void 0&&(t=e()),t)}const kEe=PEe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),IEe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ry=10,MEe=2e4,REe=(e,t)=>t.type==="spring"||e==="backgroundColor"||!Aj(t.ease);function OEe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(kEe()&&IEe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(y=>{s=y})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(REe(t,i)){const y=nb({...i,repeat:0,delay:0});let m={done:!1,value:c[0]};const v=[];let S=0;for(;!m.done&&S<MEe;)m=y.sample(S),v.push(m.value),S+=ry;h=void 0,c=v,d=S-ry,f="linear"}const p=U4e(e.owner.current,t,c,{...i,duration:d,ease:f,times:h});i.syncStart&&(p.startTime=zn.isProcessing?zn.timestamp:document.timeline?document.timeline.currentTime:performance.now());const g=()=>p.cancel(),_=()=>{Rt.update(g),s(),u()};return p.onfinish=()=>{e.set(G4e(c,i)),r&&r(),_()},{then(y,m){return l.then(y,m)},attachTimeline(y){return p.timeline=y,p.onfinish=null,cn},get time(){return as(p.currentTime||0)},set time(y){p.currentTime=Sl(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return as(d)},play:()=>{a||(p.play(),_s(g))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const m=nb({...i,autoplay:!1});e.setWithVelocity(m.sample(y-ry).value,m.sample(y).value,ry)}_()},complete:()=>p.finish(),cancel:_}}function $Ee({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:cn,pause:cn,stop:cn,then:o=>(o(),Promise.resolve()),cancel:cn,complete:cn});return t?nb({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const NEe={type:"spring",stiffness:500,damping:25,restSpeed:10},DEe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),LEe={type:"keyframes",duration:.8},FEe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BEe=(e,{keyframes:t})=>t.length>2?LEe:hc.has(e)?e.startsWith("scale")?DEe(t[1]):NEe:FEe,y3=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&($l.test(t)||t==="0")&&!t.startsWith("url(")),zEe=new Set(["brightness","contrast","saturate","opacity"]);function VEe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(SS)||[];if(!r)return e;const i=n.replace(r,"");let o=zEe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const jEe=/([a-z-]*)\(.*?\)/g,v3={...$l,getAnimatableNone:e=>{const t=e.match(jEe);return t?t.map(VEe).join(" "):e}},UEe={...cj,color:Ir,backgroundColor:Ir,outlineColor:Ir,fill:Ir,stroke:Ir,borderColor:Ir,borderTopColor:Ir,borderRightColor:Ir,borderBottomColor:Ir,borderLeftColor:Ir,filter:v3,WebkitFilter:v3},ZT=e=>UEe[e];function Yj(e,t){let n=ZT(e);return n!==v3&&(n=$l),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Zj=e=>/^0[^.\s]+$/.test(e);function GEe(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||Zj(e)}function HEe(e,t,n,r){const i=y3(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?a:o[u-1]),GEe(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(s=o[u]);if(i&&l.length&&s)for(let u=0;u<l.length;u++){const c=l[u];o[c]=Yj(t,s)}return o}function qEe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Jj(e,t){return e[t]||e.default||e}const JT=(e,t,n,r={})=>i=>{const o=Jj(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Sl(a);const l=HEe(t,e,n,o),u=l[0],c=l[l.length-1],d=y3(e,u),f=y3(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(qEe(o)||(h={...h,...BEe(e,h)}),h.duration&&(h.duration=Sl(h.duration)),h.repeatDelay&&(h.repeatDelay=Sl(h.repeatDelay)),!d||!f||j4e.current||o.type===!1)return $Ee(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=OEe(t,e,h);if(p)return p}return nb(h)};function rb(e){return!!(ai(e)&&e.add)}const eU=e=>/^\-?\d*\.?\d+$/.test(e);function eA(e,t){e.indexOf(t)===-1&&e.push(t)}function tA(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class nA{constructor(){this.subscriptions=[]}add(t){return eA(this.subscriptions,t),()=>tA(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 a=this.subscriptions[o];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const WEe=e=>!isNaN(parseFloat(e));class KEe{constructor(t,n={}){this.version="10.16.4",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:a}=zn;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,Rt.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=()=>Rt.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=WEe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new nA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Rt.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 KEe(e,t)}const tU=e=>t=>t.test(e),XEe={test:e=>e==="auto",parse:e=>e},nU=[pc,Re,ba,Vs,t4e,e4e,XEe],Sh=e=>nU.find(tU(e)),QEe=[...nU,Ir,$l],YEe=e=>QEe.find(tU(e));function ZEe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wf(n))}function JEe(e,t){const n=wS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=g4e(o[a]);ZEe(e,a,s)}}function eTe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;s<a;s++){const l=o[s],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(eU(c)||Zj(c))?c=parseFloat(c):!YEe(c)&&$l.test(u)&&(c=Yj(l,u)),e.addValue(l,wf(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function tTe(e,t){return t?(t[e]||t.default||t).from:void 0}function nTe(e,t,n){const r={};for(const i in e){const o=tTe(i,t);if(o!==void 0)r[i]=o;else{const a=n.getValue(i);a&&(r[i]=a.get())}}return r}function rTe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function rU(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const f=e.getValue(d),h=s[d];if(!f||h===void 0||c&&rTe(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const _=e.getProps()[z4e];_&&(p.elapsed=window.HandoffAppearAnimations(_,d,f,Rt),p.syncStart=!0)}f.start(JT(d,f,h,e.shouldReduceMotion&&hc.has(d)?{type:!1}:p));const g=f.animation;rb(l)&&(l.add(d),g.then(()=>l.remove(d))),u.push(g)}return a&&Promise.all(u).then(()=>{a&&JEe(e,a)}),u}function b3(e,t,n={}){const r=wS(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(rU(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return iTe(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function iTe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(oTe).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(b3(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function oTe(e,t){return e.sortNodePosition(t)}function aTe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>b3(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=b3(e,t,n);else{const i=typeof t=="function"?wS(e,t,n.custom):t;r=Promise.all(rU(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const sTe=[...LT].reverse(),lTe=LT.length;function uTe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>aTe(e,n,r)))}function cTe(e){let t=uTe(e);const n=fTe();let r=!0;const i=(l,u)=>{const c=wS(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function o(l){t=l(e)}function a(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},g=1/0;for(let b=0;b<lTe;b++){const y=sTe[b],m=n[y],v=c[y]!==void 0?c[y]:d[y],S=zg(v),w=y===u?m.isActive:null;w===!1&&(g=b);let C=v===d[y]&&v!==c[y]&&S;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),m.protectedKeys={...p},!m.isActive&&w===null||!v&&!m.prevProp||bS(v)||typeof v=="boolean")continue;const x=dTe(m.prevProp,v);let P=x||y===u&&m.isActive&&!C&&S||b>g&&S;const E=Array.isArray(v)?v:[v];let I=E.reduce(i,{});w===!1&&(I={});const{prevResolvedValues:N={}}=m,M={...N,...I},T=A=>{P=!0,h.delete(A),m.needsAnimating[A]=!0};for(const A in M){const R=I[A],D=N[A];p.hasOwnProperty(A)||(R!==D?J1(R)&&J1(D)?!Ej(R,D)||x?T(A):m.protectedKeys[A]=!0:R!==void 0?T(A):h.add(A):R!==void 0&&h.has(A)?T(A):m.protectedKeys[A]=!0)}m.prevProp=v,m.prevResolvedValues=I,m.isActive&&(p={...p,...I}),r&&e.blockInitialAnimation&&(P=!1),P&&!C&&f.push(...E.map(A=>({animation:A,options:{type:y,...l}})))}if(h.size){const b={};h.forEach(y=>{const m=e.getBaseTarget(y);m!==void 0&&(b[y]=m)}),f.push({animation:b})}let _=!!f.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(f):Promise.resolve()}function s(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function dTe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ej(t,e):!1}function uu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fTe(){return{animate:uu(!0),whileInView:uu(),whileHover:uu(),whileTap:uu(),whileDrag:uu(),whileFocus:uu(),exit:uu()}}class hTe extends Xl{constructor(t){super(t),t.animationState||(t.animationState=cTe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),bS(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 pTe=0;class gTe extends Xl{constructor(){super(...arguments),this.id=pTe++}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 mTe={animation:{Feature:hTe},exit:{Feature:gTe}},W9=(e,t)=>Math.abs(e-t);function yTe(e,t){const n=W9(e.x,t.x),r=W9(e.y,t.y);return Math.sqrt(n**2+r**2)}class iU{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=Lw(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=yTe(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=zn;this.history.push({...f,timestamp:h});const{onStart:p,onMove:g}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Dw(c,this.transformPagePoint),Rt.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=Lw(u.type==="pointercancel"?this.lastMoveEventInfo:Dw(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!_j(t))return;this.handlers=n,this.transformPagePoint=r;const i=xS(t),o=Dw(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=zn;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,Lw(o,this.history)),this.removeListeners=_l(os(window,"pointermove",this.handlePointerMove),os(window,"pointerup",this.handlePointerUp),os(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_s(this.updatePoint)}}function Dw(e,t){return t?{point:t(e.point)}:e}function K9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lw({point:e},t){return{point:e,delta:K9(e,oU(t)),offset:K9(e,vTe(t)),velocity:bTe(t,.1)}}function vTe(e){return e[0]}function oU(e){return e[e.length-1]}function bTe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=oU(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Sl(t)));)n--;if(!r)return{x:0,y:0};const o=as(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ti(e){return e.max-e.min}function _3(e,t=0,n=.01){return Math.abs(e-t)<=n}function X9(e,t,n,r=.5){e.origin=r,e.originPoint=Zt(t.min,t.max,e.origin),e.scale=Ti(n)/Ti(t),(_3(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Zt(n.min,n.max,e.origin)-e.originPoint,(_3(e.translate)||isNaN(e.translate))&&(e.translate=0)}function wp(e,t,n,r){X9(e.x,t.x,n.x,r?r.originX:void 0),X9(e.y,t.y,n.y,r?r.originY:void 0)}function Q9(e,t,n){e.min=n.min+t.min,e.max=e.min+Ti(t)}function _Te(e,t,n){Q9(e.x,t.x,n.x),Q9(e.y,t.y,n.y)}function Y9(e,t,n){e.min=t.min-n.min,e.max=e.min+Ti(t)}function Cp(e,t,n){Y9(e.x,t.x,n.x),Y9(e.y,t.y,n.y)}function STe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Zt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Zt(n,e,r.max):Math.min(e,n)),e}function Z9(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 xTe(e,{top:t,left:n,bottom:r,right:i}){return{x:Z9(e.x,n,i),y:Z9(e.y,t,r)}}function J9(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 wTe(e,t){return{x:J9(e.x,t.x),y:J9(e.y,t.y)}}function CTe(e,t){let n=.5;const r=Ti(e),i=Ti(t);return i>r?n=jg(t.min,t.max-r,e.min):r>i&&(n=jg(e.min,e.max-i,t.min)),Ol(0,1,n)}function ETe(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 S3=.35;function TTe(e=S3){return e===!1?e=0:e===!0&&(e=S3),{x:eM(e,"left","right"),y:eM(e,"top","bottom")}}function eM(e,t,n){return{min:tM(e,t),max:tM(e,n)}}function tM(e,t){return typeof e=="number"?e:e[t]||0}const nM=()=>({translate:0,scale:1,origin:0,originPoint:0}),yd=()=>({x:nM(),y:nM()}),rM=()=>({min:0,max:0}),xn=()=>({x:rM(),y:rM()});function Xo(e){return[e("x"),e("y")]}function aU({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ATe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PTe(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 Fw(e){return e===void 0||e===1}function x3({scale:e,scaleX:t,scaleY:n}){return!Fw(e)||!Fw(t)||!Fw(n)}function vu(e){return x3(e)||sU(e)||e.z||e.rotate||e.rotateX||e.rotateY}function sU(e){return iM(e.x)||iM(e.y)}function iM(e){return e&&e!=="0%"}function ib(e,t,n){const r=e-n,i=t*r;return n+i}function oM(e,t,n,r,i){return i!==void 0&&(e=ib(e,i,r)),ib(e,n,r)+t}function w3(e,t=0,n=1,r,i){e.min=oM(e.min,t,n,r,i),e.max=oM(e.max,t,n,r,i)}function lU(e,{x:t,y:n}){w3(e.x,t.translate,t.scale,t.originPoint),w3(e.y,n.translate,n.scale,n.originPoint)}function kTe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s<i;s++){o=n[s],a=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&vd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,lU(e,a)),r&&vu(o.latestValues)&&vd(e,o.latestValues))}t.x=aM(t.x),t.y=aM(t.y)}function aM(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Ks(e,t){e.min=e.min+t,e.max=e.max+t}function sM(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=Zt(e.min,e.max,o);w3(e,t[n],t[r],a,t.scale)}const ITe=["x","scaleX","originX"],MTe=["y","scaleY","originY"];function vd(e,t){sM(e.x,t,ITe),sM(e.y,t,MTe)}function uU(e,t){return aU(PTe(e.getBoundingClientRect(),t))}function RTe(e,t,n){const r=uU(e,n),{scroll:i}=t;return i&&(Ks(r.x,i.offset.x),Ks(r.y,i.offset.y)),r}const OTe=new WeakMap;class $Te{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(xS(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=xj(c),!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),Xo(p=>{let g=this.getAxisMotionValue(p).get()||0;if(ba.test(g)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(g=Ti(b)*(parseFloat(g)/100))}}this.originPoint[p]=g}),f&&Rt.update(()=>f(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(d&&this.currentDirection===null){this.currentDirection=NTe(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new iU(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{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&&Rt.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||!iy(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=STe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&gd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=xTe(r.layoutBox,t):this.constraints=!1,this.elastic=TTe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xo(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=ETe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gd(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=RTe(r,i.root,this.visualElement.getTransformPagePoint());let a=wTe(i.layout.layoutBox,o);if(n){const s=n(ATe(a));this.hasMutatedConstraints=!!s,s&&(a=aU(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Xo(c=>{if(!iy(c,n,this.currentDirection))return;let d=l&&l[c]||{};a&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(JT(t,r,0,n))}stopAnimation(){Xo(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){Xo(n=>{const{drag:r}=this.getProps();if(!iy(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Zt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gd(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Xo(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=CTe({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Xo(a=>{if(!iy(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Zt(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;OTe.set(this.visualElement,this);const t=this.visualElement.current,n=os(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();gd(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 a=es(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xo(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=S3,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function iy(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function NTe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class DTe extends Xl{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new $Te(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const lM=e=>(t,n)=>{e&&Rt.update(()=>e(t,n))};class LTe extends Xl{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new iU(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:lM(t),onStart:lM(n),onMove:r,onEnd:(o,a)=>{delete this.session,i&&Rt.update(()=>i(o,a))}}}mount(){this.removePointerDownListener=os(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 FTe(){const e=k.useContext(Nm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=k.useId();return k.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function BTe(){return zTe(k.useContext(Nm))}function zTe(e){return e===null?!0:e.isPresent}const dv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uM(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Re.test(e))e=parseFloat(e);else return e;const n=uM(e,t.target.x),r=uM(e,t.target.y);return`${n}% ${r}%`}},VTe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=$l.parse(e);if(i.length>5)return r;const o=$l.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;const u=Zt(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}};class jTe extends J.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;W3e(UTe),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()})),dv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Rt.postRender(()=>{const s=a.getStack();(!s||!s.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 cU(e){const[t,n]=FTe(),r=k.useContext(BT);return J.createElement(jTe,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(oj),isPresent:t,safeToRemove:n})}const UTe={borderRadius:{...xh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xh,borderTopRightRadius:xh,borderBottomLeftRadius:xh,borderBottomRightRadius:xh,boxShadow:VTe},dU=["TopLeft","TopRight","BottomLeft","BottomRight"],GTe=dU.length,cM=e=>typeof e=="string"?parseFloat(e):e,dM=e=>typeof e=="number"||Re.test(e);function HTe(e,t,n,r,i,o){i?(e.opacity=Zt(0,n.opacity!==void 0?n.opacity:1,qTe(r)),e.opacityExit=Zt(t.opacity!==void 0?t.opacity:1,0,WTe(r))):o&&(e.opacity=Zt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<GTe;a++){const s=`border${dU[a]}Radius`;let l=fM(t,s),u=fM(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||dM(l)===dM(u)?(e[s]=Math.max(Zt(cM(l),cM(u),r),0),(ba.test(u)||ba.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=Zt(t.rotate||0,n.rotate||0,r))}function fM(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const qTe=fU(0,.5,XT),WTe=fU(.5,.95,cn);function fU(e,t,n){return r=>r<e?0:r>t?1:n(jg(e,t,r))}function hM(e,t){e.min=t.min,e.max=t.max}function Li(e,t){hM(e.x,t.x),hM(e.y,t.y)}function pM(e,t,n,r,i){return e-=t,e=ib(e,1/n,r),i!==void 0&&(e=ib(e,1/i,r)),e}function KTe(e,t=0,n=1,r=.5,i,o=e,a=e){if(ba.test(t)&&(t=parseFloat(t),t=Zt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Zt(o.min,o.max,r);e===o&&(s-=t),e.min=pM(e.min,t,n,s,i),e.max=pM(e.max,t,n,s,i)}function gM(e,t,[n,r,i],o,a){KTe(e,t[n],t[r],t[i],t.scale,o,a)}const XTe=["x","scaleX","originX"],QTe=["y","scaleY","originY"];function mM(e,t,n,r){gM(e.x,t,XTe,n?n.x:void 0,r?r.x:void 0),gM(e.y,t,QTe,n?n.y:void 0,r?r.y:void 0)}function yM(e){return e.translate===0&&e.scale===1}function hU(e){return yM(e.x)&&yM(e.y)}function YTe(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 pU(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function vM(e){return Ti(e.x)/Ti(e.y)}class ZTe{constructor(){this.members=[]}add(t){eA(this.members,t),t.scheduleRender()}remove(t){if(tA(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 bM(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:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const JTe=(e,t)=>e.depth-t.depth;class eAe{constructor(){this.children=[],this.isDirty=!1}add(t){eA(this.children,t),this.isDirty=!0}remove(t){tA(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(JTe),this.isDirty=!1,this.children.forEach(t)}}function tAe(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(_s(r),e(o-t))};return Rt.read(r,!0),()=>_s(r)}function nAe(e){window.MotionDebug&&window.MotionDebug.record(e)}function rAe(e){return e instanceof SVGElement&&e.tagName!=="svg"}function iAe(e,t,n){const r=ai(e)?e:wf(e);return r.start(JT("",r,t,n)),r.animation}const _M=["","X","Y","Z"],SM=1e3;let oAe=0;const bu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function gU({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=oAe++,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=()=>{bu.totalNodes=bu.resolvedTargetDeltas=bu.recalculatedProjection=0,this.nodes.forEach(lAe),this.nodes.forEach(hAe),this.nodes.forEach(pAe),this.nodes.forEach(uAe),nAe(bu)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new eAe)}addEventListener(a,s){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new nA),this.eventHandlers.get(a).add(s)}notifyListeners(a,...s){const l=this.eventHandlers.get(a);l&&l.notify(...s)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=rAe(a),this.instance=a;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=tAe(f,250),dv.hasAnimatedSinceResize&&(dv.hasAnimatedSinceResize=!1,this.nodes.forEach(wM))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||bAe,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!pU(this.targetLayout,p)||h,m=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,m);const v={...Jj(g,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else f||wM(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_s(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(gAe),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!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 c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xM);return}this.isUpdating||this.nodes.forEach(dAe),this.isUpdating=!1,this.nodes.forEach(fAe),this.nodes.forEach(aAe),this.nodes.forEach(sAe),this.clearAllSnapshots();const s=performance.now();zn.delta=Ol(0,1e3/60,s-zn.timestamp),zn.timestamp=s,zn.isProcessing=!0,Pw.update.process(zn),Pw.preRender.process(zn),Pw.render.process(zn),zn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(cAe),this.sharedNodes.forEach(mAe)}scheduleUpdateProjection(){Rt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Rt.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 a=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:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let s=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(s=!1),s&&(this.scroll={animationId:this.root.animationId,phase:a,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform,s=this.projectionDelta&&!hU(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;a&&(s||vu(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return a&&(l=this.removeTransform(l)),_Ae(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return xn();const s=a.measureViewportBox(),{scroll:l}=this.root;return l&&(Ks(s.x,l.offset.x),Ks(s.y,l.offset.y)),s}removeElementScroll(a){const s=xn();Li(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:d}=u;if(u!==this.root&&c&&d.layoutScroll){if(c.isRoot){Li(s,a);const{scroll:f}=this.root;f&&(Ks(s.x,-f.offset.x),Ks(s.y,-f.offset.y))}Ks(s.x,c.offset.x),Ks(s.y,c.offset.y)}}return s}applyTransform(a,s=!1){const l=xn();Li(l,a);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&vd(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),vu(c.latestValues)&&vd(l,c.latestValues)}return vu(this.latestValues)&&vd(l,this.latestValues),l}removeTransform(a){const s=xn();Li(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!vu(u.latestValues))continue;x3(u.latestValues)&&u.updateSnapshot();const c=xn(),d=u.measurePageBox();Li(c,d),mM(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return vu(this.latestValues)&&mM(s,this.latestValues),s}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==zn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var s;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(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=zn.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xn(),this.relativeTargetOrigin=xn(),Cp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Li(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(),_Te(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Li(this.target,this.layout.layoutBox),lU(this.target,this.targetDelta)):Li(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xn(),this.relativeTargetOrigin=xn(),Cp(this.relativeTargetOrigin,this.target,h.target),Li(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}bu.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||x3(this.parent.latestValues)||sU(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 a;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===zn.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Li(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;kTe(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox);const{target:p}=s;if(!p){this.projectionTransform&&(this.projectionDelta=yd(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=yd(),this.projectionDeltaWithTransform=yd());const g=this.projectionTransform;wp(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=bM(this.projectionDelta,this.treeScale),(this.projectionTransform!==g||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),bu.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),a){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(a,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=yd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=xn(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=h!==p,_=this.getStack(),b=!_||_.members.length<=1,y=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(vAe));this.animationProgress=0;let m;this.mixTargetDelta=v=>{const S=v/1e3;CM(d.x,a.x,S),CM(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cp(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yAe(this.relativeTarget,this.relativeTargetOrigin,f,S),m&&YTe(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=xn()),Li(m,this.relativeTarget)),g&&(this.animationValues=c,HTe(c,u,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_s(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Rt.update(()=>{dv.hasAnimatedSinceResize=!0,this.currentAnimation=iAe(0,SM,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SM),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&mU(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||xn();const d=Ti(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=Ti(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}Li(s,l),vd(s,c),wp(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new ZTe),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c<_M.length;c++){const d="rotate"+_M[c];l[d]&&(u[d]=l[d],a.setStaticValue(d,0))}a.render();for(const c in u)a.setStaticValue(c,u[c]);a.scheduleRender()}getProjectionStyles(a={}){var s,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=cv(a.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=cv(a.pointerEvents)||""),this.hasProjected&&!vu(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=bM(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Y1){if(f[g]===void 0)continue;const{correct:_,applyTo:b}=Y1[g],y=u.transform==="none"?f[g]:_(f[g],d);if(b){const m=b.length;for(let v=0;v<m;v++)u[b[v]]=y}else u[g]=y}return this.options.layoutId&&(u.pointerEvents=d===this?cv(a.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(xM),this.root.sharedNodes.clear()}}}function aAe(e){e.updateLayout()}function sAe(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,a=n.source!==e.layout.source;o==="size"?Xo(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=Ti(f);f.min=r[d].min,f.max=f.min+h}):mU(o,n.layoutBox,r)&&Xo(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=Ti(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const s=yd();wp(s,r,n.layoutBox);const l=yd();a?wp(l,e.applyTransform(i,!0),n.measuredBox):wp(l,r,n.layoutBox);const u=!hU(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=xn();Cp(p,n.layoutBox,f.layoutBox);const g=xn();Cp(g,r,h.layoutBox),pU(p,g)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function lAe(e){bu.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 uAe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cAe(e){e.clearSnapshot()}function xM(e){e.clearMeasurements()}function dAe(e){e.isLayoutDirty=!1}function fAe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wM(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hAe(e){e.resolveTargetDelta()}function pAe(e){e.calcProjection()}function gAe(e){e.resetRotation()}function mAe(e){e.removeLeadSnapshot()}function CM(e,t,n){e.translate=Zt(t.translate,0,n),e.scale=Zt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function EM(e,t,n,r){e.min=Zt(t.min,n.min,r),e.max=Zt(t.max,n.max,r)}function yAe(e,t,n,r){EM(e.x,t.x,n.x,r),EM(e.y,t.y,n.y,r)}function vAe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const bAe={duration:.45,ease:[.4,0,.1,1]},TM=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),AM=TM("applewebkit/")&&!TM("chrome/")?Math.round:cn;function PM(e){e.min=AM(e.min),e.max=AM(e.max)}function _Ae(e){PM(e.x),PM(e.y)}function mU(e,t,n){return e==="position"||e==="preserve-aspect"&&!_3(vM(t),vM(n),.2)}const SAe=gU({attachResizeListener:(e,t)=>es(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bw={current:void 0},yU=gU({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bw.current){const e=new SAe({});e.mount(window),e.setOptions({layoutScroll:!0}),Bw.current=e}return Bw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),xAe={pan:{Feature:LTe},drag:{Feature:DTe,ProjectionNode:yU,MeasureLayout:cU}},wAe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CAe(e){const t=wAe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function C3(e,t,n=1){const[r,i]=CAe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return eU(a)?parseFloat(a):a}else return h3(i)?C3(i,t,n+1):i}function EAe(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(!h3(o))return;const a=C3(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!h3(o))continue;const a=C3(o,r);a&&(t[i]=a,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const TAe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),vU=e=>TAe.has(e),AAe=e=>Object.keys(e).some(vU),kM=e=>e===pc||e===Re,IM=(e,t)=>parseFloat(e.split(", ")[t]),MM=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return IM(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?IM(o[1],e):0}},PAe=new Set(["x","y","z"]),kAe=Dm.filter(e=>!PAe.has(e));function IAe(e){const t=[];return kAe.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 Cf={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:MM(4,13),y:MM(5,14)};Cf.translateX=Cf.x;Cf.translateY=Cf.y;const MAe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=Cf[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=Cf[u](l,o)}),e},RAe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(vU);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=Sh(c);const f=t[l];let h;if(J1(f)){const p=f.length,g=f[0]===null?1:0;c=f[g],d=Sh(c);for(let _=g;_<p&&f[_]!==null;_++)h?KT(Sh(f[_])===h):h=Sh(f[_])}else h=Sh(f);if(d!==h)if(kM(d)&&kM(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===Re&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(c===0||f===0)?c===0?u.set(h.transform(c)):t[l]=d.transform(f):(a||(o=IAe(e),a=!0),s.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(f))}),s.length){const l=s.indexOf("height")>=0?window.pageYOffset:null,u=MAe(t,e,s);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),vS&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function OAe(e,t,n,r){return AAe(t)?RAe(e,t,n,r):{target:t,transitionEnd:r}}const $Ae=(e,t,n,r)=>{const i=EAe(e,t,r);return t=i.target,r=i.transitionEnd,OAe(e,t,n,r)},E3={current:null},bU={current:!1};function NAe(){if(bU.current=!0,!!vS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>E3.current=e.matches;e.addListener(t),t()}else E3.current=!1}function DAe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ai(o))e.addValue(i,o),rb(r)&&r.add(i);else if(ai(a))e.addValue(i,wf(o,{owner:e})),rb(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,wf(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const RM=new WeakMap,_U=Object.keys(Vg),LAe=_U.length,OM=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],FAe=FT.length;class BAe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){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=()=>Rt.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=_S(n),this.isVariantNode=ij(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const f=c[d];s[d]!==void 0&&ai(f)&&(f.set(s[d],!1),rb(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,RM.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)),bU.current||NAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:E3.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){RM.delete(this.current),this.projection&&this.projection.unmount(),_s(this.notifyUpdate),_s(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=hc.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Rt.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 a,s;for(let l=0;l<LAe;l++){const u=_U[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=Vg[u];f&&(a=f),c(n)&&(!this.features[u]&&d&&(this.features[u]=new d(this)),h&&(s=h))}if(!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&gd(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:h})}return s}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<OM.length;r++){const i=OM[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=DAe(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<FAe;r++){const i=FT[r],o=this.props[i];(zg(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=WT(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&&!ai(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 nA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class SU extends BAe{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 a=nTe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){eTe(this,r,a);const s=$Ae(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function zAe(e){return window.getComputedStyle(e)}class VAe extends SU{readValueFromInstance(t,n){if(hc.has(n)){const r=ZT(n);return r&&r.default||0}else{const r=zAe(t),i=(lj(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return uU(t,n)}build(t,n,r,i){VT(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return qT(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ai(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){pj(t,n,r,i)}}class jAe extends SU{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(hc.has(n)){const r=ZT(n);return r&&r.default||0}return n=gj.has(n)?n:HT(n),t.getAttribute(n)}measureInstanceViewportBox(){return xn()}scrapeMotionValuesFromProps(t,n){return yj(t,n)}build(t,n,r,i){UT(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){mj(t,n,r,i)}mount(t){this.isSVGTag=GT(t.tagName),super.mount(t)}}const UAe=(e,t)=>zT(e)?new jAe(t,{enableHardwareAcceleration:!1}):new VAe(t,{enableHardwareAcceleration:!0}),GAe={layout:{ProjectionNode:yU,MeasureLayout:cU}},HAe={...mTe,...D4e,...xAe,...GAe},xU=H3e((e,t)=>w4e(e,t,HAe,UAe));function wU(){const e=k.useRef(!1);return DT(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function qAe(){const e=wU(),[t,n]=k.useState(0),r=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>Rt.postRender(r),[r]),t]}class WAe extends k.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 KAe({children:e,isPresent:t}){const n=k.useId(),r=k.useRef(null),i=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)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: ${a}px !important;
top: ${s}px !important;
left: ${l}px !important;
}
`),()=>{document.head.removeChild(u)}},[t]),k.createElement(WAe,{isPresent:t,childRef:r,sizeRef:i},k.cloneElement(e,{ref:r}))}const zw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=vj(XAe),l=k.useId(),u=k.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{s.set(c,!0);for(const d of s.values())if(!d)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),o?void 0:[n]);return k.useMemo(()=>{s.forEach((c,d)=>s.set(d,!1))},[n]),k.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=k.createElement(KAe,{isPresent:n},e)),k.createElement(Nm.Provider,{value:u},e)};function XAe(){return new Map}function QAe(e){return k.useEffect(()=>()=>e(),[])}const Wc=e=>e.key||"";function YAe(e,t){e.forEach(n=>{const r=Wc(n);t.set(r,n)})}function ZAe(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const CU=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=k.useContext(BT).forceRender||qAe()[0],l=wU(),u=ZAe(e);let c=u;const d=k.useRef(new Map).current,f=k.useRef(c),h=k.useRef(new Map).current,p=k.useRef(!0);if(DT(()=>{p.current=!1,YAe(u,h),f.current=c}),QAe(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return k.createElement(k.Fragment,null,c.map(y=>k.createElement(zw,{key:Wc(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},y)));c=[...c];const g=f.current.map(Wc),_=u.map(Wc),b=g.length;for(let y=0;y<b;y++){const m=g[y];_.indexOf(m)===-1&&!d.has(m)&&d.set(m,void 0)}return a==="wait"&&d.size&&(c=[]),d.forEach((y,m)=>{if(_.indexOf(m)!==-1)return;const v=h.get(m);if(!v)return;const S=g.indexOf(m);let w=y;if(!w){const C=()=>{h.delete(m),d.delete(m);const x=f.current.findIndex(P=>P.key===m);if(f.current.splice(x,1),!d.size){if(f.current=u,l.current===!1)return;s(),r&&r()}};w=k.createElement(zw,{key:Wc(v),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:o,mode:a},v),d.set(m,w)}c.splice(S,0,w)}),c=c.map(y=>{const m=y.key;return d.has(m)?y:k.createElement(zw,{key:Wc(y),isPresent:!0,presenceAffectsLayout:o,mode:a},y)}),k.createElement(k.Fragment,null,d.size?c:c.map(y=>k.cloneElement(y)))};var JAe={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},EU=k.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=JAe,toastSpacing:c="0.5rem"}=e,[d,f]=k.useState(s),h=BTe();k9(()=>{h||r==null||r()},[h]),k9(()=>{f(s)},[s]);const p=()=>f(null),g=()=>f(s),_=()=>{h&&i()};k.useEffect(()=>{h&&o&&i()},[h,o,i]),D3e(_,d);const b=k.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),y=k.useMemo(()=>O3e(a),[a]);return oe.jsx(xU.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:g,custom:{position:a},style:y,children:oe.jsx(lr.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:ua(n,{id:t,onClose:_})})})});EU.displayName="ToastComponent";function ePe(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var $M={path:oe.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[oe.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),oe.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),oe.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},zm=Ii((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,c=Kl("chakra-icon",s),d=$m("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},h={ref:t,focusable:o,className:c,__css:f},p=r??$M.viewBox;if(n&&typeof n!="string")return oe.jsx(lr.svg,{as:n,...h,...u});const g=a??$M.path;return oe.jsx(lr.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:g})});zm.displayName="Icon";function tPe(e){return oe.jsx(zm,{viewBox:"0 0 24 24",...e,children:oe.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function nPe(e){return oe.jsx(zm,{viewBox:"0 0 24 24",...e,children:oe.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function NM(e){return oe.jsx(zm,{viewBox:"0 0 24 24",...e,children:oe.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var rPe=vbe({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),rA=Ii((e,t)=>{const n=$m("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Rm(e),u=Kl("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${rPe} ${o} linear infinite`,...n};return oe.jsx(lr.div,{ref:t,__css:c,className:u,...l,children:r&&oe.jsx(lr.span,{srOnly:!0,children:r})})});rA.displayName="Spinner";var[iPe,iA]=Mm({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[oPe,oA]=Mm({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),TU={info:{icon:nPe,colorScheme:"blue"},warning:{icon:NM,colorScheme:"orange"},success:{icon:tPe,colorScheme:"green"},error:{icon:NM,colorScheme:"red"},loading:{icon:rA,colorScheme:"blue"}};function aPe(e){return TU[e].colorScheme}function sPe(e){return TU[e].icon}var AU=Ii(function(t,n){const r=oA(),{status:i}=iA(),o={display:"inline",...r.description};return oe.jsx(lr.div,{ref:n,"data-status":i,...t,className:Kl("chakra-alert__desc",t.className),__css:o})});AU.displayName="AlertDescription";function PU(e){const{status:t}=iA(),n=sPe(t),r=oA(),i=t==="loading"?r.spinner:r.icon;return oe.jsx(lr.span,{display:"inherit","data-status":t,...e,className:Kl("chakra-alert__icon",e.className),__css:i,children:e.children||oe.jsx(n,{h:"100%",w:"100%"})})}PU.displayName="AlertIcon";var kU=Ii(function(t,n){const r=oA(),{status:i}=iA();return oe.jsx(lr.div,{ref:n,"data-status":i,...t,className:Kl("chakra-alert__title",t.className),__css:r.title})});kU.displayName="AlertTitle";var IU=Ii(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=Rm(t),s=(r=t.colorScheme)!=null?r:aPe(i),l=h3e("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return oe.jsx(iPe,{value:{status:i},children:oe.jsx(oPe,{value:l,children:oe.jsx(lr.div,{"data-status":i,role:o?"alert":void 0,ref:n,...a,className:Kl("chakra-alert",t.className),__css:u})})})});IU.displayName="Alert";function lPe(e){return oe.jsx(zm,{focusable:"false","aria-hidden":!0,...e,children:oe.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var MU=Ii(function(t,n){const r=$m("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Rm(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return oe.jsx(lr.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||oe.jsx(lPe,{width:"1em",height:"1em"})})});MU.displayName="CloseButton";var uPe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ia=cPe(uPe);function cPe(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=dPe(i,o),{position:s,id:l}=a;return r(u=>{var c,d;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(d=u[s])!=null?d:[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=P9(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:RU(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=tj(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>!!P9(ia.getState(),i).position}}var DM=0;function dPe(e,t={}){var n,r;DM+=1;const i=(n=t.id)!=null?n:DM,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ia.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var fPe=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return oe.jsxs(IU,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[oe.jsx(PU,{children:u}),oe.jsxs(lr.div,{flex:"1",maxWidth:"100%",children:[i&&oe.jsx(kU,{id:c==null?void 0:c.title,children:i}),s&&oe.jsx(AU,{id:c==null?void 0:c.description,display:"block",children:s})]}),o&&oe.jsx(MU,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function RU(e={}){const{render:t,toastComponent:n=fPe}=e;return i=>typeof t=="function"?t({...i,...e}):oe.jsx(n,{...i,...e})}function OU(e,t){const n=i=>{var o;return{...t,...i,position:ePe((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=RU(o);return ia.notify(a,o)};return r.update=(i,o)=>{ia.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...ua(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...ua(o.error,s)}))},r.closeAll=ia.closeAll,r.close=ia.close,r.isActive=ia.isActive,r}var[MUe,hPe]=Mm({name:"ToastOptionsContext",strict:!1}),pPe=e=>{const t=k.useSyncExternalStore(ia.subscribe,ia.getState,ia.getState),{motionVariants:n,component:r=EU,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return oe.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${s}`,id:`chakra-toast-manager-${s}`,style:$3e(s),children:oe.jsx(CU,{initial:!1,children:l.map(u=>oe.jsx(r,{motionVariants:n,...u},u.id))})},s)});return oe.jsx(dS,{...i,children:a})};function gPe(e){const{theme:t}=mV(),n=hPe();return k.useMemo(()=>OU(t.direction,{...n,...e}),[e,t.direction,n])}var mPe={duration:5e3,variant:"solid"},Fc={theme:n3e,colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{},defaultOptions:mPe,forced:!1};function yPe({theme:e=Fc.theme,colorMode:t=Fc.colorMode,toggleColorMode:n=Fc.toggleColorMode,setColorMode:r=Fc.setColorMode,defaultOptions:i=Fc.defaultOptions,motionVariants:o,toastSpacing:a,component:s,forced:l}=Fc){const u={colorMode:t,setColorMode:r,toggleColorMode:n,forced:l};return{ToastContainer:()=>oe.jsx(I3e,{theme:e,children:oe.jsx(AT.Provider,{value:u,children:oe.jsx(pPe,{defaultOptions:i,motionVariants:o,toastSpacing:a,component:s})})}),toast:OU(e.direction,i)}}var T3=Ii(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return oe.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});T3.displayName="NativeImage";function vPe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=k.useState("pending");k.useEffect(()=>{c(n?"loading":"pending")},[n]);const d=k.useRef(),f=k.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=g=>{h(),c("loaded"),i==null||i(g)},p.onerror=g=>{h(),c("failed"),o==null||o(g)},d.current=p},[n,a,r,s,i,o,t]),h=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return G1(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var bPe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function _Pe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var aA=Ii(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,g=r!==void 0||i!==void 0,_=u!=null||c||!g,b=vPe({...t,crossOrigin:d,ignoreFallback:_}),y=bPe(b,f),m={ref:n,objectFit:l,objectPosition:s,..._?p:_Pe(p,["onError","onLoad"])};return y?i||oe.jsx(lr.img,{as:T3,className:"chakra-image__placeholder",src:r,...m}):oe.jsx(lr.img,{as:T3,src:o,srcSet:a,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...m})});aA.displayName="Image";var $U=Ii(function(t,n){const r=$m("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Rm(t),u=v3e({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return oe.jsx(lr.p,{ref:n,className:Kl("chakra-text",t.className),...u,...l,__css:r})});$U.displayName="Text";var A3=Ii(function(t,n){const r=$m("Heading",t),{className:i,...o}=Rm(t);return oe.jsx(lr.h2,{ref:n,className:Kl("chakra-heading",t.className),...o,__css:r})});A3.displayName="Heading";var ob=lr("div");ob.displayName="Box";var NU=Ii(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return oe.jsx(ob,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});NU.displayName="Square";var SPe=Ii(function(t,n){const{size:r,...i}=t;return oe.jsx(NU,{size:r,ref:n,borderRadius:"9999px",...i})});SPe.displayName="Circle";var sA=Ii(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...c}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return oe.jsx(lr.div,{ref:n,__css:d,...c})});sA.displayName="Flex";const pt=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},xPe=F.object({status:F.literal(422),data:F.object({detail:F.array(F.object({loc:F.array(F.string()),msg:F.string(),type:F.string()}))})});function Gr(e,t,n=!1){e=String(e),t=String(t);const r=Array.from({length:21},(a,s)=>s*50),i=[0,5,10,15,20,25,30,35,40,45,50,55,59,64,68,73,77,82,86,95,100];return r.reduce((a,s,l)=>{const u=n?i[l]/100:1,c=n?50:i[r.length-1-l];return a[s]=`hsl(${e} ${t}% ${c}% / ${u})`,a},{})}const oy={H:220,S:16},ay={H:250,S:42},sy={H:47,S:42},ly={H:40,S:70},uy={H:28,S:42},cy={H:113,S:42},dy={H:0,S:42},wPe={base:Gr(oy.H,oy.S),baseAlpha:Gr(oy.H,oy.S,!0),accent:Gr(ay.H,ay.S),accentAlpha:Gr(ay.H,ay.S,!0),working:Gr(sy.H,sy.S),workingAlpha:Gr(sy.H,sy.S,!0),gold:Gr(ly.H,ly.S),goldAlpha:Gr(ly.H,ly.S,!0),warning:Gr(uy.H,uy.S),warningAlpha:Gr(uy.H,uy.S,!0),ok:Gr(cy.H,cy.S),okAlpha:Gr(cy.H,cy.S,!0),error:Gr(dy.H,dy.S),errorAlpha:Gr(dy.H,dy.S,!0)},{definePartsStyle:CPe,defineMultiStyleConfig:EPe}=Ve(AV.keys),TPe={border:"none"},APe=e=>{const{colorScheme:t}=e;return{fontWeight:"600",fontSize:"sm",border:"none",borderRadius:"base",bg:W(`${t}.200`,`${t}.700`)(e),color:W(`${t}.900`,`${t}.100`)(e),_hover:{bg:W(`${t}.250`,`${t}.650`)(e)},_expanded:{bg:W(`${t}.250`,`${t}.650`)(e),borderBottomRadius:"none",_hover:{bg:W(`${t}.300`,`${t}.600`)(e)}}}},PPe=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.100`,`${t}.800`)(e),borderRadius:"base",borderTopRadius:"none"}},kPe={},IPe=CPe(e=>({container:TPe,button:APe(e),panel:PPe(e),icon:kPe})),MPe=EPe({variants:{invokeAI:IPe},defaultProps:{variant:"invokeAI",colorScheme:"base"}}),RPe=e=>{const{colorScheme:t}=e;if(t==="base"){const r={bg:W("base.150","base.700")(e),color:W("base.300","base.500")(e),svg:{fill:W("base.300","base.500")(e)},opacity:1},i={bg:"none",color:W("base.300","base.500")(e),svg:{fill:W("base.500","base.500")(e)},opacity:1};return{bg:W("base.250","base.600")(e),color:W("base.850","base.100")(e),borderRadius:"base",svg:{fill:W("base.850","base.100")(e)},_hover:{bg:W("base.300","base.500")(e),color:W("base.900","base.50")(e),svg:{fill:W("base.900","base.50")(e)},_disabled:r},_disabled:r,'&[data-progress="true"]':{...i,_hover:i}}}const n={bg:W(`${t}.400`,`${t}.700`)(e),color:W(`${t}.600`,`${t}.500`)(e),svg:{fill:W(`${t}.600`,`${t}.500`)(e),filter:"unset"},opacity:.7,filter:"saturate(65%)"};return{bg:W(`${t}.400`,`${t}.600`)(e),color:W("base.50","base.100")(e),borderRadius:"base",svg:{fill:W("base.50","base.100")(e)},_disabled:n,_hover:{bg:W(`${t}.500`,`${t}.500`)(e),color:W("white","base.50")(e),svg:{fill:W("white","base.50")(e)},_disabled:n}}},OPe=e=>{const{colorScheme:t}=e,n=W("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",_hover:{bg:W(`${t}.500`,`${t}.500`)(e),color:W("white","base.50")(e),svg:{fill:W("white","base.50")(e)}},".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"}}},$Pe={variants:{invokeAI:RPe,invokeAIOutline:OPe},defaultProps:{variant:"invokeAI",colorScheme:"base"}},{definePartsStyle:NPe,defineMultiStyleConfig:DPe}=Ve(PV.keys),LPe=e=>{const{colorScheme:t}=e;return{bg:W("base.200","base.700")(e),borderColor:W("base.300","base.600")(e),color:W("base.900","base.100")(e),_checked:{bg:W(`${t}.300`,`${t}.500`)(e),borderColor:W(`${t}.300`,`${t}.500`)(e),color:W(`${t}.900`,`${t}.100`)(e),_hover:{bg:W(`${t}.400`,`${t}.500`)(e),borderColor:W(`${t}.400`,`${t}.500`)(e)},_disabled:{borderColor:"transparent",bg:"whiteAlpha.300",color:"whiteAlpha.500"}},_indeterminate:{bg:W(`${t}.300`,`${t}.600`)(e),borderColor:W(`${t}.300`,`${t}.600`)(e),color:W(`${t}.900`,`${t}.100`)(e)},_disabled:{bg:"whiteAlpha.100",borderColor:"transparent"},_focusVisible:{boxShadow:"none",outline:"none"},_invalid:{borderColor:W("error.600","error.300")(e)}}},FPe=NPe(e=>({control:LPe(e)})),BPe=DPe({variants:{invokeAI:FPe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{definePartsStyle:zPe,defineMultiStyleConfig:VPe}=Ve(kV.keys),jPe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},UPe=e=>({borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6},"::selection":{color:W("accent.900","accent.50")(e),bg:W("accent.200","accent.400")(e)}}),GPe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},HPe=zPe(e=>({preview:jPe,input:UPe(e),textarea:GPe})),qPe=VPe({variants:{invokeAI:HPe},defaultProps:{size:"sm",variant:"invokeAI"}}),WPe=e=>({fontSize:"sm",marginEnd:0,mb:1,fontWeight:"400",transitionProperty:"common",transitionDuration:"normal",whiteSpace:"nowrap",_disabled:{opacity:.4},color:W("base.700","base.300")(e),_invalid:{color:W("error.500","error.300")(e)}}),KPe={variants:{invokeAI:WPe},defaultProps:{variant:"invokeAI"}},CS=e=>({outline:"none",borderWidth:2,borderStyle:"solid",borderColor:W("base.200","base.800")(e),bg:W("base.50","base.900")(e),borderRadius:"base",color:W("base.900","base.100")(e),boxShadow:"none",_hover:{borderColor:W("base.300","base.600")(e)},_focus:{borderColor:W("accent.200","accent.600")(e),boxShadow:"none",_hover:{borderColor:W("accent.300","accent.500")(e)}},_invalid:{borderColor:W("error.300","error.600")(e),boxShadow:"none",_hover:{borderColor:W("error.400","error.500")(e)}},_disabled:{borderColor:W("base.300","base.700")(e),bg:W("base.300","base.700")(e),color:W("base.600","base.400")(e),_hover:{borderColor:W("base.300","base.700")(e)}},_placeholder:{color:W("base.700","base.400")(e)},"::selection":{bg:W("accent.200","accent.400")(e)}}),{definePartsStyle:XPe,defineMultiStyleConfig:QPe}=Ve(IV.keys),YPe=XPe(e=>({field:CS(e)})),ZPe=QPe({variants:{invokeAI:YPe},defaultProps:{size:"sm",variant:"invokeAI"}}),{definePartsStyle:JPe,defineMultiStyleConfig:eke}=Ve(MV.keys),tke=JPe(e=>({button:{fontWeight:500,bg:W("base.300","base.500")(e),color:W("base.900","base.100")(e),_hover:{bg:W("base.400","base.600")(e),color:W("base.900","base.50")(e),fontWeight:600}},list:{zIndex:9999,color:W("base.900","base.150")(e),bg:W("base.200","base.800")(e),shadow:"dark-lg",border:"none"},item:{fontSize:"sm",bg:W("base.200","base.800")(e),_hover:{bg:W("base.300","base.700")(e),svg:{opacity:1}},_focus:{bg:W("base.400","base.600")(e)},svg:{opacity:.7,fontSize:14}}})),nke=eke({variants:{invokeAI:tke},defaultProps:{variant:"invokeAI"}}),RUe={variants:{enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.07,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.07,easings:"easeOut"}}}},{defineMultiStyleConfig:rke,definePartsStyle:ike}=Ve(RV.keys),oke=e=>({bg:W("blackAlpha.700","blackAlpha.700")(e)}),ake={},ske=()=>({layerStyle:"first",maxH:"80vh"}),lke=()=>({fontWeight:"600",fontSize:"lg",layerStyle:"first",borderTopRadius:"base",borderInlineEndRadius:"base"}),uke={},cke={overflowY:"scroll"},dke={},fke=ike(e=>({overlay:oke(e),dialogContainer:ake,dialog:ske(),header:lke(),closeButton:uke,body:cke,footer:dke})),hke=rke({variants:{invokeAI:fke},defaultProps:{variant:"invokeAI",size:"lg"}}),{defineMultiStyleConfig:pke,definePartsStyle:gke}=Ve(OV.keys),mke=e=>({height:8}),yke=e=>({border:"none",fontWeight:"600",height:"auto",py:1,ps:2,pe:6,...CS(e)}),vke=e=>({display:"flex"}),bke=e=>({border:"none",px:2,py:0,mx:-2,my:0,svg:{color:W("base.700","base.300")(e),width:2.5,height:2.5,_hover:{color:W("base.900","base.100")(e)}}}),_ke=gke(e=>({root:mke(e),field:yke(e),stepperGroup:vke(e),stepper:bke(e)})),Ske=pke({variants:{invokeAI:_ke},defaultProps:{size:"sm",variant:"invokeAI"}}),{defineMultiStyleConfig:xke,definePartsStyle:DU}=Ve($V.keys),LU=tn("popper-bg"),FU=tn("popper-arrow-bg"),BU=tn("popper-arrow-shadow-color"),wke=e=>({[FU.variable]:W("colors.base.100","colors.base.800")(e),[LU.variable]:W("colors.base.100","colors.base.800")(e),[BU.variable]:W("colors.base.400","colors.base.600")(e),minW:"unset",width:"unset",p:4,bg:W("base.100","base.800")(e),border:"none",shadow:"dark-lg"}),Cke=e=>({[FU.variable]:W("colors.base.100","colors.base.700")(e),[LU.variable]:W("colors.base.100","colors.base.700")(e),[BU.variable]:W("colors.base.400","colors.base.400")(e),p:4,bg:W("base.100","base.700")(e),border:"none",shadow:"dark-lg"}),Eke=DU(e=>({content:wke(e),body:{padding:0}})),Tke=DU(e=>({content:Cke(e),body:{padding:0}})),Ake=xke({variants:{invokeAI:Eke,informational:Tke},defaultProps:{variant:"invokeAI"}}),{defineMultiStyleConfig:Pke,definePartsStyle:kke}=Ve(NV.keys),Ike=e=>({bg:"accentAlpha.700"}),Mke=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.200`,`${t}.700`)(e)}},Rke=kke(e=>({filledTrack:Ike(e),track:Mke(e)})),Oke=Pke({variants:{invokeAI:Rke},defaultProps:{variant:"invokeAI"}}),$ke={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},{definePartsStyle:Nke,defineMultiStyleConfig:Dke}=Ve(DV.keys),Lke=e=>({color:W("base.200","base.300")(e)}),Fke=e=>({fontWeight:"600",...CS(e)}),Bke=Nke(e=>({field:Fke(e),icon:Lke(e)})),zke=Dke({variants:{invokeAI:Bke},defaultProps:{size:"sm",variant:"invokeAI"}}),LM=ke("skeleton-start-color"),FM=ke("skeleton-end-color"),Vke={borderRadius:"base",maxW:"full",maxH:"full",_light:{[LM.variable]:"colors.base.250",[FM.variable]:"colors.base.450"},_dark:{[LM.variable]:"colors.base.700",[FM.variable]:"colors.base.500"}},jke={variants:{invokeAI:Vke},defaultProps:{variant:"invokeAI"}},{definePartsStyle:Uke,defineMultiStyleConfig:Gke}=Ve(LV.keys),Hke=e=>({bg:W("base.400","base.600")(e),h:1.5}),qke=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.400`,`${t}.600`)(e),h:1.5}},Wke=e=>({w:e.orientation==="horizontal"?2:4,h:e.orientation==="horizontal"?4:2,bg:W("base.50","base.100")(e)}),Kke=e=>({fontSize:"2xs",fontWeight:"500",color:W("base.700","base.400")(e),mt:2,insetInlineStart:"unset"}),Xke=Uke(e=>({container:{_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},track:Hke(e),filledTrack:qke(e),thumb:Wke(e),mark:Kke(e)})),Qke=Gke({variants:{invokeAI:Xke},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:Yke,definePartsStyle:Zke}=Ve(FV.keys),Jke=e=>{const{colorScheme:t}=e;return{bg:W("base.300","base.600")(e),_focusVisible:{boxShadow:"none"},_checked:{bg:W(`${t}.400`,`${t}.500`)(e)}}},e6e=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.50`,`${t}.50`)(e)}},t6e=Zke(e=>({container:{},track:Jke(e),thumb:e6e(e)})),n6e=Yke({variants:{invokeAI:t6e},defaultProps:{size:"md",variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:r6e,definePartsStyle:zU}=Ve(BV.keys),i6e=e=>({display:"flex",columnGap:4}),o6e=e=>({}),a6e=e=>{const{colorScheme:t}=e;return{display:"flex",flexDirection:"column",gap:1,color:W("base.700","base.400")(e),button:{fontSize:"sm",padding:2,borderRadius:"base",textShadow:W("0 0 0.3rem var(--invokeai-colors-accent-100)","0 0 0.3rem var(--invokeai-colors-accent-900)")(e),svg:{fill:W("base.700","base.300")(e)},_selected:{bg:W("accent.400","accent.600")(e),color:W("base.50","base.100")(e),svg:{fill:W("base.50","base.100")(e),filter:W(`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-600))`,`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-800))`)(e)},_hover:{bg:W("accent.500","accent.500")(e),color:W("white","base.50")(e),svg:{fill:W("white","base.50")(e)}}},_hover:{bg:W("base.100","base.800")(e),color:W("base.900","base.50")(e),svg:{fill:W("base.800","base.100")(e)}}}}},s6e=e=>({padding:0,height:"100%"}),l6e=zU(e=>({root:i6e(e),tab:o6e(e),tablist:a6e(e),tabpanel:s6e(e)})),u6e=zU(e=>({tab:{borderTopRadius:"base",px:4,py:1,fontSize:"sm",color:W("base.600","base.400")(e),fontWeight:500,_selected:{color:W("accent.600","accent.400")(e)}},tabpanel:{p:0,pt:4,w:"full",h:"full"},tabpanels:{w:"full",h:"full"}})),c6e=r6e({variants:{line:u6e,appTabs:l6e},defaultProps:{variant:"appTabs",colorScheme:"accent"}}),d6e=e=>({color:W("error.500","error.400")(e)}),f6e=e=>({color:W("base.500","base.400")(e)}),h6e={variants:{subtext:f6e,error:d6e}},p6e=e=>({...CS(e),"::-webkit-scrollbar":{display:"initial"},"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
var(--invokeai-colors-base-50) 0%,
var(--invokeai-colors-base-50) 70%,
var(--invokeai-colors-base-200) 70%,
var(--invokeai-colors-base-200) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
var(--invokeai-colors-base-50) 0%,
var(--invokeai-colors-base-50) 70%,
var(--invokeai-colors-base-200) 70%,
var(--invokeai-colors-base-200) 100%)`}},_dark:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
var(--invokeai-colors-base-900) 0%,
var(--invokeai-colors-base-900) 70%,
var(--invokeai-colors-base-800) 70%,
var(--invokeai-colors-base-800) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
var(--invokeai-colors-base-900) 0%,
var(--invokeai-colors-base-900) 70%,
var(--invokeai-colors-base-800) 70%,
var(--invokeai-colors-base-800) 100%)`}}},p:2}),g6e={variants:{invokeAI:p6e},defaultProps:{size:"md",variant:"invokeAI"}},m6e=tn("popper-arrow-bg"),y6e=e=>({borderRadius:"base",shadow:"dark-lg",bg:W("base.700","base.200")(e),[m6e.variable]:W("colors.base.700","colors.base.200")(e),pb:1.5}),v6e={baseStyle:y6e},BM={backgroundColor:"accentAlpha.150 !important",borderColor:"accentAlpha.700 !important",borderRadius:"base !important",borderStyle:"dashed !important",_dark:{borderColor:"accent.400 !important"}},b6e={".react-flow__nodesselection-rect":{...BM,padding:"1rem !important",boxSizing:"content-box !important",transform:"translate(-1rem, -1rem) !important"},".react-flow__selection":BM},_6e={config:{cssVarPrefix:"invokeai",initialColorMode:"dark",useSystemColorMode:!1},layerStyles:{body:{bg:"base.50",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.50"}},first:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.850",color:"base.100"}},second:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},third:{bg:"base.300",color:"base.900",".chakra-ui-dark &":{bg:"base.750",color:"base.100"}},nodeBody:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},nodeHeader:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}},nodeFooter:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}}},styles:{global:()=>({layerStyle:"body","*":{...$ke},...b6e})},direction:"ltr",fonts:{body:"'Inter Variable', sans-serif",heading:"'Inter Variable', sans-serif"},shadows:{light:{accent:"0 0 10px 0 var(--invokeai-colors-accent-300)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-400)",ok:"0 0 7px var(--invokeai-colors-ok-600)",working:"0 0 7px var(--invokeai-colors-working-600)",error:"0 0 7px var(--invokeai-colors-error-600)"},dark:{accent:"0 0 10px 0 var(--invokeai-colors-accent-600)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-500)",ok:"0 0 7px var(--invokeai-colors-ok-400)",working:"0 0 7px var(--invokeai-colors-working-400)",error:"0 0 7px var(--invokeai-colors-error-400)"},selected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-400)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-500)"},hoverSelected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-400)"},hoverUnselected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 3px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 3px var(--invokeai-colors-accent-400)"},nodeSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-400)",dark:"0 0 0 3px var(--invokeai-colors-accent-500)"},nodeHovered:{light:"0 0 0 2px var(--invokeai-colors-accent-500)",dark:"0 0 0 2px var(--invokeai-colors-accent-400)"},nodeHoveredSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-500)",dark:"0 0 0 3px var(--invokeai-colors-accent-400)"},nodeInProgress:{light:"0 0 0 2px var(--invokeai-colors-accent-500), 0 0 10px 2px var(--invokeai-colors-accent-600)",dark:"0 0 0 2px var(--invokeai-colors-yellow-400), 0 0 20px 2px var(--invokeai-colors-orange-700)"}},colors:wPe,components:{Button:$Pe,Input:ZPe,Editable:qPe,Textarea:g6e,Tabs:c6e,Progress:Oke,Accordion:MPe,FormLabel:KPe,Switch:n6e,NumberInput:Ske,Select:zke,Skeleton:jke,Slider:Qke,Popover:Ake,Modal:hke,Checkbox:BPe,Menu:nke,Text:h6e,Tooltip:v6e}},S6e={defaultOptions:{isClosable:!0}},{toast:wh}=yPe({theme:_6e,defaultOptions:S6e.defaultOptions}),x6e=()=>{pe({matcher:un.endpoints.enqueueBatch.matchFulfilled,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;se("queue").debug({enqueueResult:pt(t)},"Batch enqueued"),wh.isActive("batch-queued")||wh({id:"batch-queued",title:X("queue.batchQueued"),description:X("queue.batchQueuedDesc",{count:t.enqueued,direction:n.prepend?X("queue.front"):X("queue.back")}),duration:1e3,status:"success"})}}),pe({matcher:un.endpoints.enqueueBatch.matchRejected,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;if(!t){wh({title:X("queue.batchFailedToQueue"),status:"error",description:"Unknown Error"}),se("queue").error({batchConfig:pt(n),error:pt(t)},X("queue.batchFailedToQueue"));return}const r=xPe.safeParse(t);if(r.success)r.data.data.detail.map(i=>{wh({id:"batch-failed-to-queue",title:u6(XN(i.msg),{length:128}),status:"error",description:u6(`Path:
${i.loc.join(".")}`,{length:128})})});else{let i="Unknown Error",o;t.status===403&&"body"in t?i=Vy(t,"body.detail","Unknown Error"):t.status===403&&"error"in t?i=Vy(t,"error.detail","Unknown Error"):t.status===403&&"data"in t&&(i=Vy(t,"data.detail","Unknown Error"),o=15e3),wh({title:X("queue.batchFailedToQueue"),status:"error",description:i,...o?{duration:o}:{}})}se("queue").error({batchConfig:pt(n),error:pt(t)},X("queue.batchFailedToQueue"))}})},Vm={memoizeOptions:{resultEqualityCheck:SE}},VU=(e,t)=>{var d;const{generation:n,canvas:r,nodes:i,controlAdapters:o}=e,a=((d=n.initialImage)==null?void 0:d.imageName)===t,s=r.layerState.objects.some(f=>f.kind==="image"&&f.imageName===t),l=i.nodes.filter(on).some(f=>Gc(f.data.inputs,h=>{var p;return h.type==="ImageField"&&((p=h.value)==null?void 0:p.image_name)===t})),u=Aa(o).some(f=>f.controlImage===t||gi(f)&&f.processedControlImage===t);return{isInitialImage:a,isCanvasImage:s,isNodesImage:l,isControlImage:u}},w6e=qn([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>VU(e,r.image_name)):[]},Vm),C6e=()=>{pe({matcher:ce.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,a=!1,s=!1;const l=n();r.forEach(u=>{const c=VU(l,u);c.isInitialImage&&!i&&(t(DE()),i=!0),c.isCanvasImage&&!o&&(t(KE()),o=!0),c.isNodesImage&&!a&&(t(cve()),a=!0),c.isControlImage&&!s&&(t(zie()),s=!0)})}})},E6e=()=>{pe({matcher:si(M1,M5),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),a=M1.match(e)?e.payload.boardId:o.gallery.selectedBoardId,l=(M5.match(e)?e.payload:o.gallery.galleryView)==="images"?Fn:Pr,u={board_id:a??"none",categories:l};if(await r(()=>ce.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=ce.endpoints.listImages.select(u)(t());if(d){const f=bg.selectAll(d)[0],h=bg.selectById(d,e.payload.selectedImageName);n(pa(h||f||null))}else n(pa(null))}else n(pa(null))}})},T6e=ge("canvas/canvasSavedToGallery"),A6e=ge("canvas/canvasMaskSavedToGallery"),P6e=ge("canvas/canvasCopiedToClipboard"),k6e=ge("canvas/canvasDownloadedAsImage"),I6e=ge("canvas/canvasMerged"),M6e=ge("canvas/stagingAreaImageSaved"),R6e=ge("canvas/canvasMaskToControlAdapter"),O6e=ge("canvas/canvasImageToControlAdapter");let jU=null,UU=null;const OUe=e=>{jU=e},ES=()=>jU,$Ue=e=>{UU=e},$6e=()=>UU,N6e=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),ab=async(e,t)=>await N6e(e.toCanvas(t)),TS=async(e,t=!1)=>{const n=ES();if(!n)throw new Error("Problem getting base layer blob");const{shouldCropToBoundingBoxOnSave:r,boundingBoxCoordinates:i,boundingBoxDimensions:o}=e.canvas,a=n.clone();a.scale({x:1,y:1});const s=a.getAbsolutePosition(),l=r||t?{x:i.x+s.x,y:i.y+s.y,width:o.width,height:o.height}:a.getClientRect();return ab(a,l)},D6e=(e,t="image/png")=>{navigator.clipboard.write([new ClipboardItem({[t]:e})])},L6e=()=>{pe({actionCreator:P6e,effect:async(e,{dispatch:t,getState:n})=>{const r=J_.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n();try{const o=TS(i);D6e(o)}catch(o){r.error(String(o)),t(it({title:X("toast.problemCopyingCanvas"),description:X("toast.problemCopyingCanvasDesc"),status:"error"}));return}t(it({title:X("toast.canvasCopiedClipboard"),status:"success"}))}})},F6e=(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()},B6e=()=>{pe({actionCreator:k6e,effect:async(e,{dispatch:t,getState:n})=>{const r=J_.get().child({namespace:"canvasSavedToGalleryListener"}),i=n();let o;try{o=await TS(i)}catch(a){r.error(String(a)),t(it({title:X("toast.problemDownloadingCanvas"),description:X("toast.problemDownloadingCanvasDesc"),status:"error"}));return}F6e(o,"canvas.png"),t(it({title:X("toast.canvasDownloaded"),status:"success"}))}})},z6e=()=>{pe({actionCreator:O6e,effect:async(e,{dispatch:t,getState:n})=>{const r=se("canvas"),i=n(),{id:o}=e.payload;let a;try{a=await TS(i,!0)}catch(c){r.error(String(c)),t(it({title:X("toast.problemSavingCanvas"),description:X("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery,l=await t(ce.endpoints.uploadImage.initiate({file:new File([a],"savedCanvas.png",{type:"image/png"}),image_category:"control",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:u}=l;t(Hl({id:o,controlImage:u}))}})};var lA={exports:{}},AS={},GU={},Ge={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof He<"u"?He:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.3",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)})(Ge);var nn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Ge;class n{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.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(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var S=this.m;return{x:S[0]*v.x+S[2]*v.y+S[4],y:S[1]*v.x+S[3]*v.y+S[5]}}translate(v,S){return this.m[4]+=this.m[0]*v+this.m[2]*S,this.m[5]+=this.m[1]*v+this.m[3]*S,this}scale(v,S){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=S,this.m[3]*=S,this}rotate(v){var S=Math.cos(v),w=Math.sin(v),C=this.m[0]*S+this.m[2]*w,x=this.m[1]*S+this.m[3]*w,P=this.m[0]*-w+this.m[2]*S,E=this.m[1]*-w+this.m[3]*S;return this.m[0]=C,this.m[1]=x,this.m[2]=P,this.m[3]=E,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,S){var w=this.m[0]+this.m[2]*S,C=this.m[1]+this.m[3]*S,x=this.m[2]+this.m[0]*v,P=this.m[3]+this.m[1]*v;return this.m[0]=w,this.m[1]=C,this.m[2]=x,this.m[3]=P,this}multiply(v){var S=this.m[0]*v.m[0]+this.m[2]*v.m[1],w=this.m[1]*v.m[0]+this.m[3]*v.m[1],C=this.m[0]*v.m[2]+this.m[2]*v.m[3],x=this.m[1]*v.m[2]+this.m[3]*v.m[3],P=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],E=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=S,this.m[1]=w,this.m[2]=C,this.m[3]=x,this.m[4]=P,this.m[5]=E,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*v,w=-this.m[1]*v,C=-this.m[2]*v,x=this.m[0]*v,P=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),E=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=S,this.m[1]=w,this.m[2]=C,this.m[3]=x,this.m[4]=P,this.m[5]=E,this}getMatrix(){return this.m}decompose(){var v=this.m[0],S=this.m[1],w=this.m[2],C=this.m[3],x=this.m[4],P=this.m[5],E=v*C-S*w;let I={x,y:P,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||S!=0){var N=Math.sqrt(v*v+S*S);I.rotation=S>0?Math.acos(v/N):-Math.acos(v/N),I.scaleX=N,I.scaleY=E/N,I.skewX=(v*w+S*C)/E,I.skewY=0}else if(w!=0||C!=0){var M=Math.sqrt(w*w+C*C);I.rotation=Math.PI/2-(C>0?Math.acos(-w/M):-Math.acos(w/M)),I.scaleX=E/M,I.scaleY=M,I.skewX=0,I.skewY=(v*w+S*C)/E}return I.rotation=e.Util._getRotation(I.rotation),I}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",f="Konva warning: ",h="Konva error: ",p="rgb(",g={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]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(m){setTimeout(m,60)};e.Util={_isElement(m){return!!(m&&m.nodeType==1)},_isFunction(m){return!!(m&&m.constructor&&m.call&&m.apply)},_isPlainObject(m){return!!m&&m.constructor===Object},_isArray(m){return Object.prototype.toString.call(m)===r},_isNumber(m){return Object.prototype.toString.call(m)===i&&!isNaN(m)&&isFinite(m)},_isString(m){return Object.prototype.toString.call(m)===o},_isBoolean(m){return Object.prototype.toString.call(m)===a},isObject(m){return m instanceof Object},isValidSelector(m){if(typeof m!="string")return!1;var v=m[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(m){return m===0||m>0?1:-1},requestAnimFrame(m){b.push(m),b.length===1&&y(function(){const v=b;b=[],v.forEach(function(S){S()})})},createCanvasElement(){var m=document.createElement("canvas");try{m.style=m.style||{}}catch{}return m},createImageElement(){return document.createElement("img")},_isInDocument(m){for(;m=m.parentNode;)if(m==document)return!0;return!1},_urlToImage(m,v){var S=e.Util.createImageElement();S.onload=function(){v(S)},S.src=m},_rgbToHex(m,v,S){return((1<<24)+(m<<16)+(v<<8)+S).toString(16).slice(1)},_hexToRgb(m){m=m.replace(u,c);var v=parseInt(m,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var m=(Math.random()*16777215<<0).toString(16);m.length<6;)m=d+m;return u+m},getRGB(m){var v;return m in g?(v=g[m],{r:v[0],g:v[1],b:v[2]}):m[0]===u?this._hexToRgb(m.substring(1)):m.substr(0,4)===p?(v=_.exec(m.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[3],10)}):{r:0,g:0,b:0}},colorToRGBA(m){return m=m||"black",e.Util._namedColorToRBA(m)||e.Util._hex3ColorToRGBA(m)||e.Util._hex4ColorToRGBA(m)||e.Util._hex6ColorToRGBA(m)||e.Util._hex8ColorToRGBA(m)||e.Util._rgbColorToRGBA(m)||e.Util._rgbaColorToRGBA(m)||e.Util._hslColorToRGBA(m)},_namedColorToRBA(m){var v=g[m.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(m){if(m.indexOf("rgb(")===0){m=m.match(/rgb\(([^)]+)\)/)[1];var v=m.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(m){if(m.indexOf("rgba(")===0){m=m.match(/rgba\(([^)]+)\)/)[1];var v=m.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(m){if(m[0]==="#"&&m.length===9)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:parseInt(m.slice(7,9),16)/255}},_hex6ColorToRGBA(m){if(m[0]==="#"&&m.length===7)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:1}},_hex4ColorToRGBA(m){if(m[0]==="#"&&m.length===5)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:parseInt(m[4]+m[4],16)/255}},_hex3ColorToRGBA(m){if(m[0]==="#"&&m.length===4)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:1}},_hslColorToRGBA(m){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(m)){const[v,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(m),w=Number(S[0])/360,C=Number(S[1])/100,x=Number(S[2])/100;let P,E,I;if(C===0)return I=x*255,{r:Math.round(I),g:Math.round(I),b:Math.round(I),a:1};x<.5?P=x*(1+C):P=x+C-x*C;const N=2*x-P,M=[0,0,0];for(let T=0;T<3;T++)E=w+1/3*-(T-1),E<0&&E++,E>1&&E--,6*E<1?I=N+(P-N)*6*E:2*E<1?I=P:3*E<2?I=N+(P-N)*(2/3-E)*6:I=N,M[T]=I*255;return{r:Math.round(M[0]),g:Math.round(M[1]),b:Math.round(M[2]),a:1}}},haveIntersection(m,v){return!(v.x>m.x+m.width||v.x+v.width<m.x||v.y>m.y+m.height||v.y+v.height<m.y)},cloneObject(m){var v={};for(var S in m)this._isPlainObject(m[S])?v[S]=this.cloneObject(m[S]):this._isArray(m[S])?v[S]=this.cloneArray(m[S]):v[S]=m[S];return v},cloneArray(m){return m.slice(0)},degToRad(m){return m*s},radToDeg(m){return m*l},_degToRad(m){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(m)},_radToDeg(m){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(m)},_getRotation(m){return t.Konva.angleDeg?e.Util.radToDeg(m):m},_capitalize(m){return m.charAt(0).toUpperCase()+m.slice(1)},throw(m){throw new Error(h+m)},error(m){console.error(h+m)},warn(m){t.Konva.showWarnings&&console.warn(f+m)},each(m,v){for(var S in m)v(S,m[S])},_inRange(m,v,S){return v<=m&&m<S},_getProjectionToSegment(m,v,S,w,C,x){var P,E,I,N=(m-S)*(m-S)+(v-w)*(v-w);if(N==0)P=m,E=v,I=(C-S)*(C-S)+(x-w)*(x-w);else{var M=((C-m)*(S-m)+(x-v)*(w-v))/N;M<0?(P=m,E=v,I=(m-C)*(m-C)+(v-x)*(v-x)):M>1?(P=S,E=w,I=(S-C)*(S-C)+(w-x)*(w-x)):(P=m+M*(S-m),E=v+M*(w-v),I=(P-C)*(P-C)+(E-x)*(E-x))}return[P,E,I]},_getProjectionToLine(m,v,S){var w=e.Util.cloneObject(m),C=Number.MAX_VALUE;return v.forEach(function(x,P){if(!(!S&&P===v.length-1)){var E=v[(P+1)%v.length],I=e.Util._getProjectionToSegment(x.x,x.y,E.x,E.y,m.x,m.y),N=I[0],M=I[1],T=I[2];T<C&&(w.x=N,w.y=M,C=T)}}),w},_prepareArrayForTween(m,v,S){var w,C=[],x=[];if(m.length>v.length){var P=v;v=m,m=P}for(w=0;w<m.length;w+=2)C.push({x:m[w],y:m[w+1]});for(w=0;w<v.length;w+=2)x.push({x:v[w],y:v[w+1]});var E=[];return x.forEach(function(I){var N=e.Util._getProjectionToLine(I,C,S);E.push(N.x),E.push(N.y)}),E},_prepareToStringify(m){var v;m.visitedByCircularReferenceRemoval=!0;for(var S in m)if(m.hasOwnProperty(S)&&m[S]&&typeof m[S]=="object"){if(v=Object.getOwnPropertyDescriptor(m,S),m[S].visitedByCircularReferenceRemoval||e.Util._isElement(m[S]))if(v.configurable)delete m[S];else return null;else if(e.Util._prepareToStringify(m[S])===null)if(v.configurable)delete m[S];else return null}return delete m.visitedByCircularReferenceRemoval,m},_assign(m,v){for(var S in v)m[S]=v[S];return m},_getFirstPointerId(m){return m.touches?m.changedTouches[0].identifier:m.pointerId||999},releaseCanvas(...m){t.Konva.releaseCanvasOnDestroy&&m.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(m,v,S,w){let C=0,x=0,P=0,E=0;typeof w=="number"?C=x=P=E=Math.min(w,v/2,S/2):(C=Math.min(w[0]||0,v/2,S/2),x=Math.min(w[1]||0,v/2,S/2),E=Math.min(w[2]||0,v/2,S/2),P=Math.min(w[3]||0,v/2,S/2)),m.moveTo(C,0),m.lineTo(v-x,0),m.arc(v-x,x,x,Math.PI*3/2,0,!1),m.lineTo(v,S-E),m.arc(v-E,S-E,E,0,Math.PI/2,!1),m.lineTo(P,S),m.arc(P,S-P,P,Math.PI/2,Math.PI,!1),m.lineTo(0,C),m.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(nn);var Kt={},je={},Te={};Object.defineProperty(Te,"__esModule",{value:!0});Te.getComponentValidator=Te.getBooleanValidator=Te.getNumberArrayValidator=Te.getFunctionValidator=Te.getStringOrGradientValidator=Te.getStringValidator=Te.getNumberOrAutoValidator=Te.getNumberOrArrayOfNumbersValidator=Te.getNumberValidator=Te.alphaComponent=Te.RGBComponent=void 0;const Es=Ge,dn=nn;function Ts(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 V6e(e){return e>255?255:e<0?0:Math.round(e)}Te.RGBComponent=V6e;function j6e(e){return e>1?1:e<1e-4?1e-4:e}Te.alphaComponent=j6e;function U6e(){if(Es.Konva.isUnminified)return function(e,t){return dn.Util._isNumber(e)||dn.Util.warn(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Te.getNumberValidator=U6e;function G6e(e){if(Es.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(Ts(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Te.getNumberOrArrayOfNumbersValidator=G6e;function H6e(){if(Es.Konva.isUnminified)return function(e,t){var n=dn.Util._isNumber(e),r=e==="auto";return n||r||dn.Util.warn(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Te.getNumberOrAutoValidator=H6e;function q6e(){if(Es.Konva.isUnminified)return function(e,t){return dn.Util._isString(e)||dn.Util.warn(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Te.getStringValidator=q6e;function W6e(){if(Es.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(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Te.getStringOrGradientValidator=W6e;function K6e(){if(Es.Konva.isUnminified)return function(e,t){return dn.Util._isFunction(e)||dn.Util.warn(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Te.getFunctionValidator=K6e;function X6e(){if(Es.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(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Te.getNumberArrayValidator=X6e;function Q6e(){if(Es.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||dn.Util.warn(Ts(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Te.getBooleanValidator=Q6e;function Y6e(e){if(Es.Konva.isUnminified)return function(t,n){return t==null||dn.Util.isObject(t)||dn.Util.warn(Ts(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Te.getComponentValidator=Y6e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=nn,n=Te;var r="get",i="set";e.Factory={addGetterSetter(o,a,s,l,u){e.Factory.addGetter(o,a,s),e.Factory.addSetter(o,a,l,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,s){var l=r+t.Util._capitalize(a);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[a];return u===void 0?s:u}},addSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,s,l)},overWriteSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,a)),this._setAttr(a,c),l&&l.call(this),this}},addComponentsGetterSetter(o,a,s,l,u){var c=s.length,d=t.Util._capitalize,f=r+d(a),h=i+d(a),p,g;o.prototype[f]=function(){var b={};for(p=0;p<c;p++)g=s[p],b[g]=this.getAttr(a+d(g));return b};var _=(0,n.getComponentValidator)(s);o.prototype[h]=function(b){var y=this.attrs[a],m;l&&(b=l.call(this,b)),_&&_.call(this,b,a);for(m in b)b.hasOwnProperty(m)&&this._setAttr(a+d(m),b[m]);return b||s.forEach(v=>{this._setAttr(a+d(v),void 0)}),this._fireChangeEvent(a,y,b),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var s=t.Util._capitalize(a),l=i+s,u=r+s;o.prototype[a]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,s,l){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?s:d},e.Factory.addSetter(o,a,l,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(s,l){var u=o.prototype[l],c=r+t.Util._capitalize(s),d=i+t.Util._capitalize(s);function f(){u.apply(this,arguments),t.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[s]=f,o.prototype[c]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(je);var Mo={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.HitContext=ss.SceneContext=ss.Context=void 0;const HU=nn,Z6e=Ge;function J6e(e){var t=[],n=e.length,r=HU.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 zM=",",eIe="(",tIe=")",nIe="([",rIe="])",iIe=";",oIe="()",aIe="=",VM=["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"],sIe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const lIe=100;class PS{constructor(t){this.canvas=t,Z6e.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="",a,s,l,u;for(a=0;a<i;a++)s=r[a],l=s.method,l?(u=s.args,o+=l,t?o+=oIe:HU.Util._isArray(u[0])?o+=nIe+u.join(zM)+rIe:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=eIe+u.join(zM)+tIe)):(o+=s.property,t||(o+=aIe+s.val)),o+=iIe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=lIe&&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,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}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,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(t,n,r):c.length===5?d.drawImage(t,n,r,i,o):c.length===9&&d.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,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,a){this._context.setTransform(t,n,r,i,o,a)}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,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=VM.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=J6e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i<n;i++)a(VM[i]);t.setAttr=function(){r.apply(t,arguments);var s=arguments[0],l=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:s,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}ss.Context=PS;sIe.forEach(function(e){Object.defineProperty(PS.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class uIe extends PS{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 a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):a&&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 a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+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",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),c=l.x*u,d=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*d)}}ss.SceneContext=uIe;class cIe extends PS{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()}}}ss.HitContext=cIe;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.HitCanvas=Mo.SceneCanvas=Mo.Canvas=void 0;const sb=nn,qU=ss,WU=Ge,dIe=je,fIe=Te;var fy;function hIe(){if(fy)return fy;var e=sb.Util.createCanvasElement(),t=e.getContext("2d");return fy=function(){var n=WU.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),sb.Util.releaseCanvas(e),fy}class kS{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||WU.Konva.pixelRatio||hIe();this.pixelRatio=r,this._canvas=sb.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 sb.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Mo.Canvas=kS;dIe.Factory.addGetterSetter(kS,"pixelRatio",void 0,(0,fIe.getNumberValidator)());class pIe extends kS{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new qU.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}Mo.SceneCanvas=pIe;class gIe extends kS{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new qU.HitContext(this),this.setSize(t.width,t.height)}}Mo.HitCanvas=gIe;var IS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Ge,n=nn;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,a)=>{const{node:s}=o,l=s.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(d<c||(s.startDrag({evt:r}),!s.isDragging()))return}s._setDragPosition(r,o),i.push(s)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,s=a.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(c=>c.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))})(IS);Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Node=void 0;const qe=nn,jm=je,hy=Mo,cu=Ge,Fi=IS,vn=Te;var fv="absoluteOpacity",py="allEventListeners",za="absoluteTransform",jM="absoluteScale",du="canvas",mIe="Change",yIe="children",vIe="konva",P3="listening",UM="mouseenter",GM="mouseleave",HM="set",qM="Shape",hv=" ",WM="stage",js="transform",bIe="Stage",k3="visible",_Ie=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(hv);let SIe=1;class Ne{constructor(t){this._id=SIe++,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===js||t===za)&&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===js||t===za,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(hv);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(du)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===za&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(du)){const{scene:t,filter:n,hit:r}=this._cache.get(du);qe.Util.releaseCanvas(t,n,r),this._cache.delete(du)}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()||void 0}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=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,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){qe.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,s-=u,l-=u;var f=new hy.SceneCanvas({pixelRatio:a,width:i,height:o}),h=new hy.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),p=new hy.HitCanvas({pixelRatio:d,width:i,height:o}),g=f.getContext(),_=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(du),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),g.save(),_.save(),g.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(fv),this._clearSelfAndDescendantCache(jM),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,g.restore(),_.restore(),c&&(g.save(),g.beginPath(),g.rect(0,0,i,o),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),this._cache.set(du,{scene:f,filter:h,hit:p,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(du)}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=1/0,o=1/0,a=-1/0,s=-1/0,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),{x:i,y:o,width:a-i,height:s-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(),a,s,l,u;if(t){if(!this._filterUpToDate){var c=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<a;l++){if(u=t[l],typeof u!="function"){qe.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,s),o.putImageData(s,0,0)}}catch(d){qe.Util.error("Unable to apply filter. "+d.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(py),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(hv),i=r.length,o,a,s,l,u;for(o=0;o<i;o++)a=r[o],s=a.split("."),l=s[0],u=s[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(hv),i=r.length,o,a,s,l,u,c;if(this._cache&&this._cache.delete(py),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(s=r[o],l=s.split("."),u=l[0],c=l[1],u)this.eventListeners[u]&&this._off(u,c,n);else for(a in this.eventListeners)this._off(a,c,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 a=o.target.findAncestors(n,!0,i),s=0;s<a.length;s++)o=qe.Util.cloneObject(o),o.currentTarget=a[s],r.call(a[s],o)})}remove(){return this.isDragging()&&this.stopDrag(),Fi.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(za),this._clearSelfAndDescendantCache(fv),this._clearSelfAndDescendantCache(jM),this._clearSelfAndDescendantCache(WM),this._clearSelfAndDescendantCache(k3),this._clearSelfAndDescendantCache(P3)}_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"+qe.Util._capitalize(t);return qe.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!==yIe&&(r=HM+qe.Util._capitalize(n),qe.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(P3,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(k3,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;Fi.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!cu.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,a,s;function l(c){for(i=[],o=c.length,a=0;a<o;a++)s=c[a],r++,s.nodeType!==qM&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=t&&l(i)}const u=this.getStage();return n.nodeType!==bIe&&u&&l(u.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(js),this._clearSelfAndDescendantCache(za)),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(){const t=this.getStage();if(!t)return null;var n=t.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}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 qe.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(js);var o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(t.x,t.y),t={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(js),this._clearSelfAndDescendantCache(za),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,a;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,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return qe.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 qe.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 qe.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 qe.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 qe.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&qe.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(fv,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,a,s;t.attrs={};for(r in n)i=n[r],s=qe.Util.isObject(i)&&!qe.Util._isPlainObject(i)&&!qe.Util._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),qe.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],qe.Util.isValidSelector(o)||(qe.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),qe.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),qe.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(WM,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}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(za,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new qe.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(za)||new qe.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,a=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-a,o-s)}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(js,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(js)||new qe.Transform;r.reset();var i=this.x(),o=this.y(),a=cu.Konva.getAngle(this.rotation()),s=(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,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(u!==0||c!==0)&&r.skew(u,c),(s!==1||l!==1)&&r.scale(s,l),(d!==0||f!==0)&&r.translate(-1*d,-1*f),r.dirty=!1,r}clone(t){var n=qe.Util.cloneObject(this.attrs),r,i,o,a,s;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,a=0;a<o;a++)s=i[a],s.name.indexOf(vIe)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(s));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),a=t.pixelRatio||1,s=new hy.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),l=s.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(s),l.restore(),s}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,qe.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():cu.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o<i.length;o++)if(a=i[o].name,s=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===s)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+mIe,{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[HM+qe.Util._capitalize(t)];return qe.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(cu.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!qe.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===qM&&(n.target=this);var i=(t===UM||t===GM)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===UM||t===GM)&&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(py))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let s=Object.getPrototypeOf(this);for(;s;){const l=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];a.push(...l),s=Object.getPrototypeOf(s)}o[t]=a,this._cache.set(py,o)}return a}_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();if(r){var o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Fi.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){Fi.DD._dragElements.has(this._id)||this._createDragElement(t);const r=Fi.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 a=o.call(this,i,t);a?i=a:qe.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=Fi.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Fi.DD._endDragBefore(t),Fi.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Fi.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||cu.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;Fi.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=Fi.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Fi.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 qe.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return qe.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=Ne.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),cu.Konva[r]||(qe.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=cu.Konva[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s<a;s++)o.add(Ne._createNode(i[s]));return o}}Kt.Node=Ne;Ne.prototype.nodeType="Node";Ne.prototype._attrsAffectingSize=[];Ne.prototype.eventListeners={};Ne.prototype.on.call(Ne.prototype,_Ie,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(js),this._clearSelfAndDescendantCache(za)});Ne.prototype.on.call(Ne.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(k3)});Ne.prototype.on.call(Ne.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(P3)});Ne.prototype.on.call(Ne.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(fv)});const Et=jm.Factory.addGetterSetter;Et(Ne,"zIndex");Et(Ne,"absolutePosition");Et(Ne,"position");Et(Ne,"x",0,(0,vn.getNumberValidator)());Et(Ne,"y",0,(0,vn.getNumberValidator)());Et(Ne,"globalCompositeOperation","source-over",(0,vn.getStringValidator)());Et(Ne,"opacity",1,(0,vn.getNumberValidator)());Et(Ne,"name","",(0,vn.getStringValidator)());Et(Ne,"id","",(0,vn.getStringValidator)());Et(Ne,"rotation",0,(0,vn.getNumberValidator)());jm.Factory.addComponentsGetterSetter(Ne,"scale",["x","y"]);Et(Ne,"scaleX",1,(0,vn.getNumberValidator)());Et(Ne,"scaleY",1,(0,vn.getNumberValidator)());jm.Factory.addComponentsGetterSetter(Ne,"skew",["x","y"]);Et(Ne,"skewX",0,(0,vn.getNumberValidator)());Et(Ne,"skewY",0,(0,vn.getNumberValidator)());jm.Factory.addComponentsGetterSetter(Ne,"offset",["x","y"]);Et(Ne,"offsetX",0,(0,vn.getNumberValidator)());Et(Ne,"offsetY",0,(0,vn.getNumberValidator)());Et(Ne,"dragDistance",null,(0,vn.getNumberValidator)());Et(Ne,"width",0,(0,vn.getNumberValidator)());Et(Ne,"height",0,(0,vn.getNumberValidator)());Et(Ne,"listening",!0,(0,vn.getBooleanValidator)());Et(Ne,"preventDefault",!0,(0,vn.getBooleanValidator)());Et(Ne,"filters",null,function(e){return this._filterUpToDate=!1,e});Et(Ne,"visible",!0,(0,vn.getBooleanValidator)());Et(Ne,"transformsEnabled","all",(0,vn.getStringValidator)());Et(Ne,"size");Et(Ne,"dragBoundFunc");Et(Ne,"draggable",!1,(0,vn.getBooleanValidator)());jm.Factory.backCompat(Ne,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var gc={};Object.defineProperty(gc,"__esModule",{value:!0});gc.Container=void 0;const Ff=je,Vw=Kt,MS=Te;class mc extends Vw.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=Vw.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=Vw.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(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(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){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(),a=this._getCanvasCache(),s=a&&a.hit;if(s){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(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const c=r===this;if(u){o.save();var d=this.getAbsoluteTransform(r),f=d.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let _;if(l)_=l.call(this,o,this);else{var h=this.clipX(),p=this.clipY();o.rect(h,p,a,s)}o.clip.apply(o,_),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var g=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";g&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),g&&o.restore(),u&&o.restore()}getClientRect(t={}){var n,r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(g){if(g.visible()){var _=g.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var d=this.find("Shape"),f=!1,h=0;h<d.length;h++){var p=d[h];if(p._isVisible(this)){f=!0;break}}return f&&o!==void 0?u={x:o,y:a,width:s-o,height:l-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}}gc.Container=mc;Ff.Factory.addComponentsGetterSetter(mc,"clip",["x","y","width","height"]);Ff.Factory.addGetterSetter(mc,"clipX",void 0,(0,MS.getNumberValidator)());Ff.Factory.addGetterSetter(mc,"clipY",void 0,(0,MS.getNumberValidator)());Ff.Factory.addGetterSetter(mc,"clipWidth",void 0,(0,MS.getNumberValidator)());Ff.Factory.addGetterSetter(mc,"clipHeight",void 0,(0,MS.getNumberValidator)());Ff.Factory.addGetterSetter(mc,"clipFunc");var KU={},yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.releaseCapture=yi.setPointerCapture=yi.hasPointerCapture=yi.createEvent=yi.getCapturedShape=void 0;const xIe=Ge,Ug=new Map,XU=xIe.Konva._global.PointerEvent!==void 0;function wIe(e){return Ug.get(e)}yi.getCapturedShape=wIe;function uA(e){return{evt:e,pointerId:e.pointerId}}yi.createEvent=uA;function CIe(e,t){return Ug.get(e)===t}yi.hasPointerCapture=CIe;function EIe(e,t){QU(e),t.getStage()&&(Ug.set(e,t),XU&&t._fire("gotpointercapture",uA(new PointerEvent("gotpointercapture"))))}yi.setPointerCapture=EIe;function QU(e,t){const n=Ug.get(e);if(!n)return;const r=n.getStage();r&&r.content,Ug.delete(e),XU&&n._fire("lostpointercapture",uA(new PointerEvent("lostpointercapture")))}yi.releaseCapture=QU;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=nn,n=je,r=gc,i=Ge,o=Mo,a=IS,s=Ge,l=yi;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",g="mouseenter",_="mousemove",b="mousedown",y="mouseup",m="pointermove",v="pointerdown",S="pointerup",w="pointercancel",C="lostpointercapture",x="pointerout",P="pointerleave",E="pointerover",I="pointerenter",N="contextmenu",M="touchstart",T="touchend",A="touchmove",R="touchcancel",D="wheel",$=5,L=[[g,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[M,"_pointerdown"],[A,"_pointermove"],[T,"_pointerup"],[R,"_pointercancel"],[p,"_pointerover"],[D,"_wheel"],[N,"_contextmenu"],[v,"_pointerdown"],[m,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[C,"_lostpointercapture"]];const O={mouse:{[x]:f,[P]:h,[E]:p,[I]:g,[m]:_,[v]:b,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[x]:"touchout",[P]:"touchleave",[E]:"touchover",[I]:"touchenter",[m]:A,[v]:M,[S]:T,[w]:R,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[x]:x,[P]:P,[E]:E,[I]:I,[m]:m,[v]:v,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=Z=>Z.indexOf("pointer")>=0?"pointer":Z.indexOf("touch")>=0?"touch":"mouse",U=Z=>{const V=B(Z);if(V==="pointer")return i.Konva.pointerEventsEnabled&&O.pointer;if(V==="touch")return O.touch;if(V==="mouse")return O.mouse};function j(Z={}){return(Z.clipFunc||Z.clipWidth||Z.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Z}const q="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 Y extends r.Container{constructor(V){super(j(V)),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",()=>{j(this.attrs)}),this._checkVisibility()}_validateAdd(V){const K=V.getType()==="Layer",ee=V.getType()==="FastLayer";K||ee||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const V=this.visible()?"":"none";this.content.style.display=V}setContainer(V){if(typeof V===c){if(V.charAt(0)==="."){var K=V.slice(1);V=document.getElementsByClassName(K)[0]}else{var ee;V.charAt(0)!=="#"?ee=V:ee=V.slice(1),V=document.getElementById(ee)}if(!V)throw"Can not find container in document with id "+ee}return this._setAttr("container",V),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),V.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var V=this.children,K=V.length,ee;for(ee=0;ee<K;ee++)V[ee].clear();return this}clone(V){return V||(V={}),V.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,V)}destroy(){super.destroy();var V=this.content;V&&t.Util._isInDocument(V)&&this.container().removeChild(V);var K=e.stages.indexOf(this);return K>-1&&e.stages.splice(K,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const V=this._pointerPositions[0]||this._changedPointerPositions[0];return V?{x:V.x,y:V.y}:(t.Util.warn(q),null)}_getPointerById(V){return this._pointerPositions.find(K=>K.id===V)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(V){V=V||{},V.x=V.x||0,V.y=V.y||0,V.width=V.width||this.width(),V.height=V.height||this.height();var K=new o.SceneCanvas({width:V.width,height:V.height,pixelRatio:V.pixelRatio||1}),ee=K.getContext()._context,re=this.children;return(V.x||V.y)&&ee.translate(-1*V.x,-1*V.y),re.forEach(function(fe){if(fe.isVisible()){var Se=fe._toKonvaCanvas(V);ee.drawImage(Se._canvas,V.x,V.y,Se.getWidth()/Se.getPixelRatio(),Se.getHeight()/Se.getPixelRatio())}}),K}getIntersection(V){if(!V)return null;var K=this.children,ee=K.length,re=ee-1,fe;for(fe=re;fe>=0;fe--){const Se=K[fe].getIntersection(V);if(Se)return Se}return null}_resizeDOM(){var V=this.width(),K=this.height();this.content&&(this.content.style.width=V+d,this.content.style.height=K+d),this.bufferCanvas.setSize(V,K),this.bufferHitCanvas.setSize(V,K),this.children.forEach(ee=>{ee.setSize({width:V,height:K}),ee.draw()})}add(V,...K){if(arguments.length>1){for(var ee=0;ee<arguments.length;ee++)this.add(arguments[ee]);return this}super.add(V);var re=this.children.length;return re>$&&t.Util.warn("The stage has "+re+" 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."),V.setSize({width:this.width(),height:this.height()}),V.draw(),i.Konva.isBrowser&&this.content.appendChild(V.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(V){return l.hasPointerCapture(V,this)}setPointerCapture(V){l.setPointerCapture(V,this)}releaseCapture(V){l.releaseCapture(V,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&L.forEach(([V,K])=>{this.content.addEventListener(V,ee=>{this[K](ee)},{passive:!1})})}_pointerenter(V){this.setPointersPositions(V);const K=U(V.type);K&&this._fire(K.pointerenter,{evt:V,target:this,currentTarget:this})}_pointerover(V){this.setPointersPositions(V);const K=U(V.type);K&&this._fire(K.pointerover,{evt:V,target:this,currentTarget:this})}_getTargetShape(V){let K=this[V+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(V){const K=U(V.type),ee=B(V.type);if(K){this.setPointersPositions(V);var re=this._getTargetShape(ee),fe=!a.DD.isDragging||i.Konva.hitOnDragEnabled;re&&fe?(re._fireAndBubble(K.pointerout,{evt:V}),re._fireAndBubble(K.pointerleave,{evt:V}),this._fire(K.pointerleave,{evt:V,target:this,currentTarget:this}),this[ee+"targetShape"]=null):fe&&(this._fire(K.pointerleave,{evt:V,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:V,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(V){const K=U(V.type),ee=B(V.type);if(K){this.setPointersPositions(V);var re=!1;this._changedPointerPositions.forEach(fe=>{var Se=this.getIntersection(fe);if(a.DD.justDragged=!1,i.Konva["_"+ee+"ListenClick"]=!0,!Se||!Se.isListening())return;i.Konva.capturePointerEventsEnabled&&Se.setPointerCapture(fe.id),this[ee+"ClickStartShape"]=Se,Se._fireAndBubble(K.pointerdown,{evt:V,pointerId:fe.id}),re=!0;const Me=V.type.indexOf("touch")>=0;Se.preventDefault()&&V.cancelable&&Me&&V.preventDefault()}),re||this._fire(K.pointerdown,{evt:V,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(V){const K=U(V.type),ee=B(V.type);if(!K)return;a.DD.isDragging&&a.DD.node.preventDefault()&&V.cancelable&&V.preventDefault(),this.setPointersPositions(V);var re=!a.DD.isDragging||i.Konva.hitOnDragEnabled;if(!re)return;var fe={};let Se=!1;var Me=this._getTargetShape(ee);this._changedPointerPositions.forEach(De=>{const Ee=l.getCapturedShape(De.id)||this.getIntersection(De),tt=De.id,ot={evt:V,pointerId:tt};var we=Me!==Ee;if(we&&Me&&(Me._fireAndBubble(K.pointerout,{...ot},Ee),Me._fireAndBubble(K.pointerleave,{...ot},Ee)),Ee){if(fe[Ee._id])return;fe[Ee._id]=!0}Ee&&Ee.isListening()?(Se=!0,we&&(Ee._fireAndBubble(K.pointerover,{...ot},Me),Ee._fireAndBubble(K.pointerenter,{...ot},Me),this[ee+"targetShape"]=Ee),Ee._fireAndBubble(K.pointermove,{...ot})):Me&&(this._fire(K.pointerover,{evt:V,target:this,currentTarget:this,pointerId:tt}),this[ee+"targetShape"]=null)}),Se||this._fire(K.pointermove,{evt:V,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(V){const K=U(V.type),ee=B(V.type);if(!K)return;this.setPointersPositions(V);const re=this[ee+"ClickStartShape"],fe=this[ee+"ClickEndShape"];var Se={};let Me=!1;this._changedPointerPositions.forEach(De=>{const Ee=l.getCapturedShape(De.id)||this.getIntersection(De);if(Ee){if(Ee.releaseCapture(De.id),Se[Ee._id])return;Se[Ee._id]=!0}const tt=De.id,ot={evt:V,pointerId:tt};let we=!1;i.Konva["_"+ee+"InDblClickWindow"]?(we=!0,clearTimeout(this[ee+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+ee+"InDblClickWindow"]=!0,clearTimeout(this[ee+"DblTimeout"])),this[ee+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ee+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Ee&&Ee.isListening()?(Me=!0,this[ee+"ClickEndShape"]=Ee,Ee._fireAndBubble(K.pointerup,{...ot}),i.Konva["_"+ee+"ListenClick"]&&re&&re===Ee&&(Ee._fireAndBubble(K.pointerclick,{...ot}),we&&fe&&fe===Ee&&Ee._fireAndBubble(K.pointerdblclick,{...ot}))):(this[ee+"ClickEndShape"]=null,i.Konva["_"+ee+"ListenClick"]&&this._fire(K.pointerclick,{evt:V,target:this,currentTarget:this,pointerId:tt}),we&&this._fire(K.pointerdblclick,{evt:V,target:this,currentTarget:this,pointerId:tt}))}),Me||this._fire(K.pointerup,{evt:V,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ee+"ListenClick"]=!1,V.cancelable&&ee!=="touch"&&V.preventDefault()}_contextmenu(V){this.setPointersPositions(V);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(N,{evt:V}):this._fire(N,{evt:V,target:this,currentTarget:this})}_wheel(V){this.setPointersPositions(V);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(D,{evt:V}):this._fire(D,{evt:V,target:this,currentTarget:this})}_pointercancel(V){this.setPointersPositions(V);const K=l.getCapturedShape(V.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(S,l.createEvent(V)),l.releaseCapture(V.pointerId)}_lostpointercapture(V){l.releaseCapture(V.pointerId)}setPointersPositions(V){var K=this._getContentPosition(),ee=null,re=null;V=V||window.event,V.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(V.touches,fe=>{this._pointerPositions.push({id:fe.identifier,x:(fe.clientX-K.left)/K.scaleX,y:(fe.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(V.changedTouches||V.touches,fe=>{this._changedPointerPositions.push({id:fe.identifier,x:(fe.clientX-K.left)/K.scaleX,y:(fe.clientY-K.top)/K.scaleY})})):(ee=(V.clientX-K.left)/K.scaleX,re=(V.clientY-K.top)/K.scaleY,this.pointerPos={x:ee,y:re},this._pointerPositions=[{x:ee,y:re,id:t.Util._getFirstPointerId(V)}],this._changedPointerPositions=[{x:ee,y:re,id:t.Util._getFirstPointerId(V)}])}_setPointerPosition(V){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(V)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var V=this.content.getBoundingClientRect();return{top:V.top,left:V.left,scaleX:V.width/this.content.clientWidth||1,scaleY:V.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 V=this.container();if(!V)throw"Stage has no container. A container is required.";V.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"),V.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(V){V.batchDraw()}),this}}e.Stage=Y,Y.prototype.nodeType=u,(0,s._registerNode)(Y),n.Factory.addGetterSetter(Y,"container")})(KU);var Um={},On={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Ge,n=nn,r=je,i=Kt,o=Te,a=Ge,s=yi;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function g(P){const E=this.attrs.fillRule;E?P.fill(E):P.fill()}function _(P){P.stroke()}function b(P){P.fill()}function y(P){P.stroke()}function m(){this._clearCache(l)}function v(){this._clearCache(u)}function S(){this._clearCache(c)}function w(){this._clearCache(d)}function C(){this._clearCache(f)}class x extends i.Node{constructor(E){super(E);let I;for(;I=n.Util.getRandomColor(),!(I&&!(I in e.shapes)););this.colorKey=I,e.shapes[I]=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(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var E=p();const I=E.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(I&&I.setTransform){const N=new n.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(t.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const M=N.getMatrix(),T=typeof DOMMatrix>"u"?{a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]}:new DOMMatrix(M);I.setTransform(T)}return I}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var E=this.fillLinearGradientColorStops();if(E){for(var I=p(),N=this.fillLinearGradientStartPoint(),M=this.fillLinearGradientEndPoint(),T=I.createLinearGradient(N.x,N.y,M.x,M.y),A=0;A<E.length;A+=2)T.addColorStop(E[A],E[A+1]);return T}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var E=this.fillRadialGradientColorStops();if(E){for(var I=p(),N=this.fillRadialGradientStartPoint(),M=this.fillRadialGradientEndPoint(),T=I.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),M.x,M.y,this.fillRadialGradientEndRadius()),A=0;A<E.length;A+=2)T.addColorStop(E[A],E[A+1]);return T}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var E=n.Util.colorToRGBA(this.shadowColor());if(E)return"rgba("+E.r+","+E.g+","+E.b+","+E.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 E=this.hitStrokeWidth();return E==="auto"?this.hasStroke():this.strokeEnabled()&&!!E}intersects(E){var I=this.getStage();if(!I)return!1;const N=I.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(E.x),Math.round(E.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(E){var I;if(!this.getStage()||!((I=this.attrs.perfectDrawEnabled)!==null&&I!==void 0?I:!0))return!1;const M=E||this.hasFill(),T=this.hasStroke(),A=this.getAbsoluteOpacity()!==1;if(M&&T&&A)return!0;const R=this.hasShadow(),D=this.shadowForStrokeEnabled();return!!(M&&T&&R&&D)}setStrokeHitEnabled(E){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),E?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var E=this.size();return{x:this._centroid?-E.width/2:0,y:this._centroid?-E.height/2:0,width:E.width,height:E.height}}getClientRect(E={}){const I=E.skipTransform,N=E.relativeTo,M=this.getSelfRect(),A=!E.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,R=M.width+A,D=M.height+A,$=!E.skipShadow&&this.hasShadow(),L=$?this.shadowOffsetX():0,O=$?this.shadowOffsetY():0,B=R+Math.abs(L),U=D+Math.abs(O),j=$&&this.shadowBlur()||0,q=B+j*2,Y=U+j*2,Z={width:q,height:Y,x:-(A/2+j)+Math.min(L,0)+M.x,y:-(A/2+j)+Math.min(O,0)+M.y};return I?Z:this._transformedRect(Z,N)}drawScene(E,I){var N=this.getLayer(),M=E||N.getCanvas(),T=M.getContext(),A=this._getCanvasCache(),R=this.getSceneFunc(),D=this.hasShadow(),$,L,O,B=M.isCache,U=I===this;if(!this.isVisible()&&!U)return this;if(A){T.save();var j=this.getAbsoluteTransform(I).getMatrix();return T.transform(j[0],j[1],j[2],j[3],j[4],j[5]),this._drawCachedSceneCanvas(T),T.restore(),this}if(!R)return this;if(T.save(),this._useBufferCanvas()&&!B){$=this.getStage(),L=$.bufferCanvas,O=L.getContext(),O.clear(),O.save(),O._applyLineJoin(this);var q=this.getAbsoluteTransform(I).getMatrix();O.transform(q[0],q[1],q[2],q[3],q[4],q[5]),R.call(this,O,this),O.restore();var Y=L.pixelRatio;D&&T._applyShadow(this),T._applyOpacity(this),T._applyGlobalCompositeOperation(this),T.drawImage(L._canvas,0,0,L.width/Y,L.height/Y)}else{if(T._applyLineJoin(this),!U){var q=this.getAbsoluteTransform(I).getMatrix();T.transform(q[0],q[1],q[2],q[3],q[4],q[5]),T._applyOpacity(this),T._applyGlobalCompositeOperation(this)}D&&T._applyShadow(this),R.call(this,T,this)}return T.restore(),this}drawHit(E,I,N=!1){if(!this.shouldDrawHit(I,N))return this;var M=this.getLayer(),T=E||M.hitCanvas,A=T&&T.getContext(),R=this.hitFunc()||this.sceneFunc(),D=this._getCanvasCache(),$=D&&D.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()"),$){A.save();var L=this.getAbsoluteTransform(I).getMatrix();return A.transform(L[0],L[1],L[2],L[3],L[4],L[5]),this._drawCachedHitCanvas(A),A.restore(),this}if(!R)return this;if(A.save(),A._applyLineJoin(this),!(this===I)){var B=this.getAbsoluteTransform(I).getMatrix();A.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return R.call(this,A,this),A.restore(),this}drawHitFromCache(E=0){var I=this._getCanvasCache(),N=this._getCachedSceneCanvas(),M=I.hit,T=M.getContext(),A=M.getWidth(),R=M.getHeight(),D,$,L,O,B,U;T.clear(),T.drawImage(N._canvas,0,0,A,R);try{for(D=T.getImageData(0,0,A,R),$=D.data,L=$.length,O=n.Util._hexToRgb(this.colorKey),B=0;B<L;B+=4)U=$[B+3],U>E?($[B]=O.r,$[B+1]=O.g,$[B+2]=O.b,$[B+3]=255):$[B+3]=0;T.putImageData(D,0,0)}catch(j){n.Util.error("Unable to draw hit graph from cached scene canvas. "+j.message)}return this}hasPointerCapture(E){return s.hasPointerCapture(E,this)}setPointerCapture(E){s.setPointerCapture(E,this)}releaseCapture(E){s.releaseCapture(E,this)}}e.Shape=x,x.prototype._fillFunc=g,x.prototype._strokeFunc=_,x.prototype._fillFuncHit=b,x.prototype._strokeFuncHit=y,x.prototype._centroid=!1,x.prototype.nodeType="Shape",(0,a._registerNode)(x),x.prototype.eventListeners={},x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",S),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),r.Factory.addGetterSetter(x,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(x,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(x,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(x,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(x,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(x,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(x,"lineJoin"),r.Factory.addGetterSetter(x,"lineCap"),r.Factory.addGetterSetter(x,"sceneFunc"),r.Factory.addGetterSetter(x,"hitFunc"),r.Factory.addGetterSetter(x,"dash"),r.Factory.addGetterSetter(x,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(x,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(x,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(x,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillPatternImage"),r.Factory.addGetterSetter(x,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(x,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(x,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(x,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(x,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(x,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(x,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(x,"fillEnabled",!0),r.Factory.addGetterSetter(x,"strokeEnabled",!0),r.Factory.addGetterSetter(x,"shadowEnabled",!0),r.Factory.addGetterSetter(x,"dashEnabled",!0),r.Factory.addGetterSetter(x,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(x,"fillPriority","color"),r.Factory.addComponentsGetterSetter(x,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(x,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(x,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(x,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(x,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(x,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(x,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(x,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(x,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(x,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(x,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(x,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(x,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(x,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(x,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(x,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(x,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(x,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(x,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(x,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(x,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(x,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(x,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(x,"fillPatternRotation",0),r.Factory.addGetterSetter(x,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(x,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(On);Object.defineProperty(Um,"__esModule",{value:!0});Um.Layer=void 0;const La=nn,jw=gc,Bc=Kt,cA=je,KM=Mo,TIe=Te,AIe=On,PIe=Ge;var kIe="#",IIe="beforeDraw",MIe="draw",YU=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],RIe=YU.length;class Bf extends jw.Container{constructor(t){super(t),this.canvas=new KM.SceneCanvas,this.hitCanvas=new KM.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(){Bc.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=Bc.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(Bc.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(Bc.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 Bc.Node.prototype.remove.call(this),t&&t.parentNode&&La.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"&&La.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(),Bc.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(){La.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){La.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,La.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<RIe;i++){const o=YU[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.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=La.Util._rgbToHex(r[0],r[1],r[2]),a=AIe.shapes[kIe+o];return a?{shape:a}:{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(IIe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),jw.Container.prototype.drawScene.call(this,i,n),this._fire(MIe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),jw.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){La.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return La.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 La.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Um.Layer=Bf;Bf.prototype.nodeType="Layer";(0,PIe._registerNode)(Bf);cA.Factory.addGetterSetter(Bf,"imageSmoothingEnabled",!0);cA.Factory.addGetterSetter(Bf,"clearBeforeDraw",!0);cA.Factory.addGetterSetter(Bf,"hitGraphEnabled",!0,(0,TIe.getBooleanValidator)());var RS={};Object.defineProperty(RS,"__esModule",{value:!0});RS.FastLayer=void 0;const OIe=nn,$Ie=Um,NIe=Ge;class dA extends $Ie.Layer{constructor(t){super(t),this.listening(!1),OIe.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}RS.FastLayer=dA;dA.prototype.nodeType="FastLayer";(0,NIe._registerNode)(dA);var zf={};Object.defineProperty(zf,"__esModule",{value:!0});zf.Group=void 0;const DIe=nn,LIe=gc,FIe=Ge;class fA extends LIe.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&DIe.Util.throw("You may only add groups and shapes to groups.")}}zf.Group=fA;fA.prototype.nodeType="Group";(0,FIe._registerNode)(fA);var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.Animation=void 0;const Uw=Ge,XM=nn,Gw=function(){return Uw.glob.performance&&Uw.glob.performance.now?function(){return Uw.glob.performance.now()}:function(){return new Date().getTime()}}();class oa{constructor(t,n){this.id=oa.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Gw(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const n=oa.animations,r=n.length;for(let 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=Gw(),oa._addAnimation(this),this}stop(){return oa._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){const n=t.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const t={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,a=i.func;i._updateFrameObject(Gw());const s=o.length;let l;if(a?l=a.call(i,i.frame)!==!1:l=!0,!!l)for(let u=0;u<s;u++){const c=o[u];c._id!==void 0&&(t[c._id]=c)}}for(let r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=oa;t.animations.length?(t._runFrames(),XM.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,XM.Util.requestAnimFrame(this._animationLoop))}}Vf.Animation=oa;oa.animations=[];oa.animIdCounter=0;oa.animRunning=!1;var ZU={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=nn,n=Vf,r=Kt,i=Ge;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,s=2,l=3,u=0,c=["fill","stroke","shadowColor"];class d{constructor(p,g,_,b,y,m,v){this.prop=p,this.propFunc=g,this.begin=b,this._pos=b,this.duration=m,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=y-this.begin,this.pause()}fire(p){var g=this[p];g&&g()}setTime(p){p>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():p<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=p,this.update())}getTime(){return this._time}setPosition(p){this.prevPos=this._pos,this.propFunc(p),this._pos=p}getPosition(p){return p===void 0&&(p=this._time),this.func(p,this.begin,this._change,this.duration)}play(){this.state=s,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(p){this.pause(),this._time=p,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 p=this.getTimer()-this._startTime;this.state===s?this.setTime(p):this.state===l&&this.setTime(this.duration-p)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(p){var g=this,_=p.node,b=_._id,y,m=p.easing||e.Easings.Linear,v=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=_,this._id=u++;var w=_.getLayer()||(_ instanceof i.Konva.Stage?_.getLayers():null);w||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(){g.tween.onEnterFrame()},w),this.tween=new d(S,function(C){g._tweenFunc(C)},m,0,1,y*1e3,v),this._addListeners(),f.attrs[b]||(f.attrs[b]={}),f.attrs[b][this._id]||(f.attrs[b][this._id]={}),f.tweens[b]||(f.tweens[b]={});for(S in p)o[S]===void 0&&this._addAttr(S,p[S]);this.reset(),this.onFinish=p.onFinish,this.onReset=p.onReset,this.onUpdate=p.onUpdate}_addAttr(p,g){var _=this.node,b=_._id,y,m,v,S,w,C,x,P;if(v=f.tweens[b][p],v&&delete f.attrs[b][v][p],y=_.getAttr(p),t.Util._isArray(g))if(m=[],w=Math.max(g.length,y.length),p==="points"&&g.length!==y.length&&(g.length>y.length?(x=y,y=t.Util._prepareArrayForTween(y,g,_.closed())):(C=g,g=t.Util._prepareArrayForTween(g,y,_.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)m.push(g[S]-y[S]);else{var E=t.Util.colorToRGBA(y[S]);P=t.Util.colorToRGBA(g[S]),y[S]=E,m.push({r:P.r-E.r,g:P.g-E.g,b:P.b-E.b,a:P.a-E.a})}else for(S=0;S<w;S++)m.push(g[S]-y[S]);else c.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),P=t.Util.colorToRGBA(g),m={r:P.r-y.r,g:P.g-y.g,b:P.b-y.b,a:P.a-y.a}):m=g-y;f.attrs[b][this._id][p]={start:y,diff:m,end:g,trueEnd:C,trueStart:x},f.tweens[b][p]=this._id}_tweenFunc(p){var g=this.node,_=f.attrs[g._id][this._id],b,y,m,v,S,w,C,x;for(b in _){if(y=_[b],m=y.start,v=y.diff,x=y.end,t.Util._isArray(m))if(S=[],C=Math.max(m.length,x.length),b.indexOf("fill")===0)for(w=0;w<C;w++)w%2===0?S.push((m[w]||0)+v[w]*p):S.push("rgba("+Math.round(m[w].r+v[w].r*p)+","+Math.round(m[w].g+v[w].g*p)+","+Math.round(m[w].b+v[w].b*p)+","+(m[w].a+v[w].a*p)+")");else for(w=0;w<C;w++)S.push((m[w]||0)+v[w]*p);else c.indexOf(b)!==-1?S="rgba("+Math.round(m.r+v.r*p)+","+Math.round(m.g+v.g*p)+","+Math.round(m.b+v.b*p)+","+(m.a+v.a*p)+")":S=m+v*p;g.setAttr(b,S)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var p=this.node,g=f.attrs[p._id][this._id];g.points&&g.points.trueEnd&&p.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,g=f.attrs[p._id][this._id];g.points&&g.points.trueStart&&p.points(g.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(p){return this.tween.seek(p*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var p=this.node._id,g=this._id,_=f.tweens[p],b;this.pause();for(b in _)delete f.tweens[p][b];delete f.attrs[p][g]}}e.Tween=f,f.attrs={},f.tweens={},r.Node.prototype.to=function(h){var p=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),p&&p()};var g=new f(h);g.play()},e.Easings={BackEaseIn(h,p,g,_){var b=1.70158;return g*(h/=_)*h*((b+1)*h-b)+p},BackEaseOut(h,p,g,_){var b=1.70158;return g*((h=h/_-1)*h*((b+1)*h+b)+1)+p},BackEaseInOut(h,p,g,_){var b=1.70158;return(h/=_/2)<1?g/2*(h*h*(((b*=1.525)+1)*h-b))+p:g/2*((h-=2)*h*(((b*=1.525)+1)*h+b)+2)+p},ElasticEaseIn(h,p,g,_,b,y){var m=0;return h===0?p:(h/=_)===1?p+g:(y||(y=_*.3),!b||b<Math.abs(g)?(b=g,m=y/4):m=y/(2*Math.PI)*Math.asin(g/b),-(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-m)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,g,_,b,y){var m=0;return h===0?p:(h/=_)===1?p+g:(y||(y=_*.3),!b||b<Math.abs(g)?(b=g,m=y/4):m=y/(2*Math.PI)*Math.asin(g/b),b*Math.pow(2,-10*h)*Math.sin((h*_-m)*(2*Math.PI)/y)+g+p)},ElasticEaseInOut(h,p,g,_,b,y){var m=0;return h===0?p:(h/=_/2)===2?p+g:(y||(y=_*(.3*1.5)),!b||b<Math.abs(g)?(b=g,m=y/4):m=y/(2*Math.PI)*Math.asin(g/b),h<1?-.5*(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-m)*(2*Math.PI)/y))+p:b*Math.pow(2,-10*(h-=1))*Math.sin((h*_-m)*(2*Math.PI)/y)*.5+g+p)},BounceEaseOut(h,p,g,_){return(h/=_)<1/2.75?g*(7.5625*h*h)+p:h<2/2.75?g*(7.5625*(h-=1.5/2.75)*h+.75)+p:h<2.5/2.75?g*(7.5625*(h-=2.25/2.75)*h+.9375)+p:g*(7.5625*(h-=2.625/2.75)*h+.984375)+p},BounceEaseIn(h,p,g,_){return g-e.Easings.BounceEaseOut(_-h,0,g,_)+p},BounceEaseInOut(h,p,g,_){return h<_/2?e.Easings.BounceEaseIn(h*2,0,g,_)*.5+p:e.Easings.BounceEaseOut(h*2-_,0,g,_)*.5+g*.5+p},EaseIn(h,p,g,_){return g*(h/=_)*h+p},EaseOut(h,p,g,_){return-g*(h/=_)*(h-2)+p},EaseInOut(h,p,g,_){return(h/=_/2)<1?g/2*h*h+p:-g/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,g,_){return g*(h/=_)*h*h*h*h+p},StrongEaseOut(h,p,g,_){return g*((h=h/_-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,g,_){return(h/=_/2)<1?g/2*h*h*h*h*h+p:g/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,g,_){return g*h/_+p}}})(ZU);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Ge,n=nn,r=Kt,i=gc,o=KU,a=Um,s=RS,l=zf,u=IS,c=On,d=Vf,f=ZU,h=ss,p=Mo;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:a.Layer,FastLayer:s.FastLayer,Group:l.Group,DD:u.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(GU);var OS={};Object.defineProperty(OS,"__esModule",{value:!0});OS.Arc=void 0;const $S=je,BIe=On,QM=Ge,NS=Te,zIe=Ge;class As extends BIe.Shape{_sceneFunc(t){var n=QM.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=QM.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,s=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),c=a*n,d=s*(s>0?t:n),f=l*(l>0?n:t);return{x:u,y:r?-1*f:d,width:c-u,height:f-d}}}OS.Arc=As;As.prototype._centroid=!0;As.prototype.className="Arc";As.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,zIe._registerNode)(As);$S.Factory.addGetterSetter(As,"innerRadius",0,(0,NS.getNumberValidator)());$S.Factory.addGetterSetter(As,"outerRadius",0,(0,NS.getNumberValidator)());$S.Factory.addGetterSetter(As,"angle",0,(0,NS.getNumberValidator)());$S.Factory.addGetterSetter(As,"clockwise",!1,(0,NS.getBooleanValidator)());var DS={},Gm={};Object.defineProperty(Gm,"__esModule",{value:!0});Gm.Line=void 0;const LS=je,VIe=On,JU=Te,jIe=Ge;function I3(e,t,n,r,i,o,a){var s=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=a*s/(s+l),c=a*l/(s+l),d=n-u*(i-e),f=r-u*(o-t),h=n+c*(i-e),p=r+c*(o-t);return[d,f,h,p]}function YM(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=I3(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 Ql extends VIe.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(),a=this.bezier(),s,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);u<l-2;)t.bezierCurveTo(s[u++],s[u++],s[u++],s[u++],s[u++],s[u++]);o||t.quadraticCurveTo(s[l-2],s[l-1],n[r-2],n[r-1])}else if(a)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():YM(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=I3(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=I3(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),a=YM(t,r),s=[i[2],i[3]].concat(a).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return s}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],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);return{x:n,y:i,width:r-n,height:o-i}}}Gm.Line=Ql;Ql.prototype.className="Line";Ql.prototype._attrsAffectingSize=["points","bezier","tension"];(0,jIe._registerNode)(Ql);LS.Factory.addGetterSetter(Ql,"closed",!1);LS.Factory.addGetterSetter(Ql,"bezier",!1);LS.Factory.addGetterSetter(Ql,"tension",0,(0,JU.getNumberValidator)());LS.Factory.addGetterSetter(Ql,"points",[],(0,JU.getNumberArrayValidator)());var jf={},eG={};(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=(a,s,l)=>{let u,c,d;u=l/2,c=0;for(let h=0;h<20;h++)d=u*e.tValues[20][h]+u,c+=e.cValues[20][h]*r(a,s,d);return u*c};e.getCubicArcLength=t;const n=(a,s,l)=>{l===void 0&&(l=1);const u=a[0]-2*a[1]+a[2],c=s[0]-2*s[1]+s[2],d=2*a[1]-2*a[0],f=2*s[1]-2*s[0],h=4*(u*u+c*c),p=4*(u*d+c*f),g=d*d+f*f;if(h===0)return l*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(s[2]-s[0],2));const _=p/(2*h),b=g/h,y=l+_,m=b-_*_,v=y*y+m>0?Math.sqrt(y*y+m):0,S=_*_+m>0?Math.sqrt(_*_+m):0,w=_+Math.sqrt(_*_+m)!==0?m*Math.log(Math.abs((y+v)/(_+S))):0;return Math.sqrt(h)/2*(y*v-_*S+w)};e.getQuadraticArcLength=n;function r(a,s,l){const u=i(1,l,a),c=i(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const i=(a,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(a===0){d=0;for(let f=0;f<=u;f++)d+=e.binomialCoefficients[u][f]*Math.pow(1-s,u-f)*Math.pow(s,f)*l[f];return d}else{c=new Array(u);for(let f=0;f<u;f++)c[f]=u*(l[f+1]-l[f]);return i(a-1,s,c)}},o=(a,s,l)=>{let u=1,c=a/s,d=(a-l(c))/s,f=0;for(;u>.001;){const h=l(c+d),p=Math.abs(a-h)/s;if(p<u)u=p,c+=d;else{const g=l(c-d),_=Math.abs(a-g)/s;_<u?(u=_,c-=d):d/=2}if(f++,f>500)break}return c};e.t2length=o})(eG);Object.defineProperty(jf,"__esModule",{value:!0});jf.Path=void 0;const UIe=je,GIe=On,HIe=Ge,zc=eG;class An extends GIe.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=An.parsePathData(this.data()),this.pathLength=An.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,a=n[i].points;switch(o){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6],p=a[7],g=u>c?u:c,_=u>c?1:u/c,b=u>c?c/u:1;t.translate(s,l),t.rotate(h),t.scale(_,b),t.arc(0,0,g,d,d+f,1-p),t.scale(1/_,1/b),t.rotate(-h),t.translate(-s,-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 c=u.points[4],d=u.points[5],f=u.points[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),d<0)for(let p=c-h;p>f;p-=h){const g=An.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(g.x,g.y)}else for(let p=c+h;p<f;p+=h){const g=An.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(g.x,g.y)}}else if(u.command==="C")for(let p=0;p<=1;p+=.01){const g=An.getPointOnCubicBezier(p,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(g.x,g.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(s)||(i=Math.min(i,s),o=Math.max(o,s));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return An.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 a=n[i],s=a.points;switch(a.command){case"L":return An.getPointOnLine(t,a.start.x,a.start.y,s[0],s[1]);case"C":return An.getPointOnCubicBezier((0,zc.t2length)(t,An.getPathLength(n),g=>(0,zc.getCubicArcLength)([a.start.x,s[0],s[2],s[4]],[a.start.y,s[1],s[3],s[5]],g)),a.start.x,a.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return An.getPointOnQuadraticBezier((0,zc.t2length)(t,An.getPathLength(n),g=>(0,zc.getQuadraticArcLength)([a.start.x,s[0],s[2]],[a.start.y,s[1],s[3]],g)),a.start.x,a.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],h=s[5],p=s[6];return f+=h*t/a.pathLength,An.getPointOnEllipticalArc(l,u,c,d,f,p)}return null}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var c=l*u,d;if(i===n)d={x:a,y:s+c};else if((s-r)/(a-n+1e-8)===l)d={x:a+u,y:s+c};else{var f,h,p=this.getLineLength(n,r,i,o),g=(a-n)*(i-n)+(s-r)*(o-r);g=g/(p*p),f=n+g*(i-n),h=r+g*(o-r);var _=this.getLineLength(a,s,f,h),b=Math.sqrt(t*t-_*_);u=Math.sqrt(b*b/(1+l*l)),i<n&&(u*=-1),c=l*u,d={x:f+u,y:h+c}}return d}static getPointOnCubicBezier(t,n,r,i,o,a,s,l,u){function c(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function h(_){return(1-_)*(1-_)*(1-_)}var p=l*c(t)+a*d(t)+i*f(t)+n*h(t),g=u*c(t)+s*d(t)+o*f(t)+r*h(t);return{x:p,y:g}}static getPointOnQuadraticBezier(t,n,r,i,o,a,s){function l(h){return h*h}function u(h){return 2*h*(1-h)}function c(h){return(1-h)*(1-h)}var d=a*l(t)+i*u(t)+n*c(t),f=s*l(t)+o*u(t)+r*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,a){var s=Math.cos(a),l=Math.sin(a),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*s-u.y*l),y:n+(u.x*l+u.y*s)}}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("|"),a=[],s=[],l=0,u=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(i=1;i<o.length;i++){var f=o[i],h=f.charAt(0);for(f=f.slice(1),s.length=0;d=c.exec(f);)s.push(d[0]);for(var p=[],g=0,_=s.length;g<_;g++){if(s[g]==="00"){p.push(0,0);continue}var b=parseFloat(s[g]);isNaN(b)?p.push(0):p.push(b)}for(;p.length>0&&!isNaN(p[0]);){var y="",m=[],v=l,S=u,w,C,x,P,E,I,N,M,T,A;switch(h){case"l":l+=p.shift(),u+=p.shift(),y="L",m.push(l,u);break;case"L":l=p.shift(),u=p.shift(),m.push(l,u);break;case"m":var R=p.shift(),D=p.shift();if(l+=R,u+=D,y="M",a.length>2&&a[a.length-1].command==="z"){for(var $=a.length-2;$>=0;$--)if(a[$].command==="M"){l=a[$].points[0]+R,u=a[$].points[1]+D;break}}m.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),y="M",m.push(l,u),h="L";break;case"h":l+=p.shift(),y="L",m.push(l,u);break;case"H":l=p.shift(),y="L",m.push(l,u);break;case"v":u+=p.shift(),y="L",m.push(l,u);break;case"V":u=p.shift(),y="L",m.push(l,u);break;case"C":m.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),u=p.shift(),m.push(l,u);break;case"c":m.push(l+p.shift(),u+p.shift(),l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",m.push(l,u);break;case"S":C=l,x=u,w=a[a.length-1],w.command==="C"&&(C=l+(l-w.points[2]),x=u+(u-w.points[3])),m.push(C,x,p.shift(),p.shift()),l=p.shift(),u=p.shift(),y="C",m.push(l,u);break;case"s":C=l,x=u,w=a[a.length-1],w.command==="C"&&(C=l+(l-w.points[2]),x=u+(u-w.points[3])),m.push(C,x,l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",m.push(l,u);break;case"Q":m.push(p.shift(),p.shift()),l=p.shift(),u=p.shift(),m.push(l,u);break;case"q":m.push(l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="Q",m.push(l,u);break;case"T":C=l,x=u,w=a[a.length-1],w.command==="Q"&&(C=l+(l-w.points[0]),x=u+(u-w.points[1])),l=p.shift(),u=p.shift(),y="Q",m.push(C,x,l,u);break;case"t":C=l,x=u,w=a[a.length-1],w.command==="Q"&&(C=l+(l-w.points[0]),x=u+(u-w.points[1])),l+=p.shift(),u+=p.shift(),y="Q",m.push(C,x,l,u);break;case"A":P=p.shift(),E=p.shift(),I=p.shift(),N=p.shift(),M=p.shift(),T=l,A=u,l=p.shift(),u=p.shift(),y="A",m=this.convertEndpointToCenterParameterization(T,A,l,u,N,M,P,E,I);break;case"a":P=p.shift(),E=p.shift(),I=p.shift(),N=p.shift(),M=p.shift(),T=l,A=u,l+=p.shift(),u+=p.shift(),y="A",m=this.convertEndpointToCenterParameterization(T,A,l,u,N,M,P,E,I);break}a.push({command:y||h,points:m,start:{x:v,y:S},pathLength:this.calcLength(v,S,y||h,m)})}(h==="z"||h==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=An;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,zc.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,zc.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var c=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),d<0)for(l=c-h;l>f;l-=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l<f;l+=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,a,s,l,u){var c=u*(Math.PI/180),d=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,f=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,h=d*d/(s*s)+f*f/(l*l);h>1&&(s*=Math.sqrt(h),l*=Math.sqrt(h));var p=Math.sqrt((s*s*(l*l)-s*s*(f*f)-l*l*(d*d))/(s*s*(f*f)+l*l*(d*d)));o===a&&(p*=-1),isNaN(p)&&(p=0);var g=p*s*f/l,_=p*-l*d/s,b=(t+r)/2+Math.cos(c)*g-Math.sin(c)*_,y=(n+i)/2+Math.sin(c)*g+Math.cos(c)*_,m=function(E){return Math.sqrt(E[0]*E[0]+E[1]*E[1])},v=function(E,I){return(E[0]*I[0]+E[1]*I[1])/(m(E)*m(I))},S=function(E,I){return(E[0]*I[1]<E[1]*I[0]?-1:1)*Math.acos(v(E,I))},w=S([1,0],[(d-g)/s,(f-_)/l]),C=[(d-g)/s,(f-_)/l],x=[(-1*d-g)/s,(-1*f-_)/l],P=S(C,x);return v(C,x)<=-1&&(P=Math.PI),v(C,x)>=1&&(P=0),a===0&&P>0&&(P=P-2*Math.PI),a===1&&P<0&&(P=P+2*Math.PI),[b,y,s,l,w,P,c,a]}}jf.Path=An;An.prototype.className="Path";An.prototype._attrsAffectingSize=["data"];(0,HIe._registerNode)(An);UIe.Factory.addGetterSetter(An,"data");Object.defineProperty(DS,"__esModule",{value:!0});DS.Arrow=void 0;const FS=je,qIe=Gm,tG=Te,WIe=Ge,ZM=jf;class yc extends qIe.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 a=this.pointerLength(),s=r.length,l,u;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],h=ZM.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=ZM.Path.getPointOnQuadraticBezier(Math.min(1,1-a/h),f[0],f[1],f[2],f[3],f[4],f[5]);l=r[s-2]-p.x,u=r[s-1]-p.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/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(-a,d/2),t.lineTo(-a,-d/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}}}DS.Arrow=yc;yc.prototype.className="Arrow";(0,WIe._registerNode)(yc);FS.Factory.addGetterSetter(yc,"pointerLength",10,(0,tG.getNumberValidator)());FS.Factory.addGetterSetter(yc,"pointerWidth",10,(0,tG.getNumberValidator)());FS.Factory.addGetterSetter(yc,"pointerAtBeginning",!1);FS.Factory.addGetterSetter(yc,"pointerAtEnding",!0);var BS={};Object.defineProperty(BS,"__esModule",{value:!0});BS.Circle=void 0;const KIe=je,XIe=On,QIe=Te,YIe=Ge;class Uf extends XIe.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)}}BS.Circle=Uf;Uf.prototype._centroid=!0;Uf.prototype.className="Circle";Uf.prototype._attrsAffectingSize=["radius"];(0,YIe._registerNode)(Uf);KIe.Factory.addGetterSetter(Uf,"radius",0,(0,QIe.getNumberValidator)());var zS={};Object.defineProperty(zS,"__esModule",{value:!0});zS.Ellipse=void 0;const hA=je,ZIe=On,nG=Te,JIe=Ge;class Yl extends ZIe.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)}}zS.Ellipse=Yl;Yl.prototype.className="Ellipse";Yl.prototype._centroid=!0;Yl.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,JIe._registerNode)(Yl);hA.Factory.addComponentsGetterSetter(Yl,"radius",["x","y"]);hA.Factory.addGetterSetter(Yl,"radiusX",0,(0,nG.getNumberValidator)());hA.Factory.addGetterSetter(Yl,"radiusY",0,(0,nG.getNumberValidator)());var VS={};Object.defineProperty(VS,"__esModule",{value:!0});VS.Image=void 0;const Hw=nn,vc=je,e8e=On,t8e=Ge,Hm=Te;let Ia=class rG extends e8e.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 a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?Hw.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,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?Hw.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=Hw.Util.createImageElement();i.onload=function(){var o=new rG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};VS.Image=Ia;Ia.prototype.className="Image";(0,t8e._registerNode)(Ia);vc.Factory.addGetterSetter(Ia,"cornerRadius",0,(0,Hm.getNumberOrArrayOfNumbersValidator)(4));vc.Factory.addGetterSetter(Ia,"image");vc.Factory.addComponentsGetterSetter(Ia,"crop",["x","y","width","height"]);vc.Factory.addGetterSetter(Ia,"cropX",0,(0,Hm.getNumberValidator)());vc.Factory.addGetterSetter(Ia,"cropY",0,(0,Hm.getNumberValidator)());vc.Factory.addGetterSetter(Ia,"cropWidth",0,(0,Hm.getNumberValidator)());vc.Factory.addGetterSetter(Ia,"cropHeight",0,(0,Hm.getNumberValidator)());var Ef={};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.Tag=Ef.Label=void 0;const jS=je,n8e=On,r8e=zf,pA=Te,iG=Ge;var oG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],i8e="Change.konva",o8e="none",M3="up",R3="right",O3="down",$3="left",a8e=oG.length;class gA extends r8e.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<a8e;r++)t.on(oG[r]+i8e,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,a,s,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),a=n.pointerWidth(),u=n.pointerHeight(),s=0,l=0,o){case M3:s=r/2,l=-1*u;break;case R3:s=r+a,l=i/2;break;case O3:s=r/2,l=i+u;break;case $3:s=-1*a,l=i/2;break}n.setAttrs({x:-1*s,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*s,y:-1*l})}}}Ef.Label=gA;gA.prototype.className="Label";(0,iG._registerNode)(gA);class bc extends n8e.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),s=this.cornerRadius();let l=0,u=0,c=0,d=0;typeof s=="number"?l=u=c=d=Math.min(s,n/2,r/2):(l=Math.min(s[0]||0,n/2,r/2),u=Math.min(s[1]||0,n/2,r/2),d=Math.min(s[2]||0,n/2,r/2),c=Math.min(s[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===M3&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*a),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===R3&&(t.lineTo(n,(r-a)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+a)/2)),t.lineTo(n,r-d),t.arc(n-d,r-d,d,0,Math.PI/2,!1),i===O3&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+a),t.lineTo((n-o)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===$3&&(t.lineTo(0,(r+a)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-a)/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(),a=this.width(),s=this.height();return o===M3?(n-=i,s+=i):o===O3?s+=i:o===$3?(t-=r*1.5,a+=r):o===R3&&(a+=r*1.5),{x:t,y:n,width:a,height:s}}}Ef.Tag=bc;bc.prototype.className="Tag";(0,iG._registerNode)(bc);jS.Factory.addGetterSetter(bc,"pointerDirection",o8e);jS.Factory.addGetterSetter(bc,"pointerWidth",0,(0,pA.getNumberValidator)());jS.Factory.addGetterSetter(bc,"pointerHeight",0,(0,pA.getNumberValidator)());jS.Factory.addGetterSetter(bc,"cornerRadius",0,(0,pA.getNumberOrArrayOfNumbersValidator)(4));var qm={};Object.defineProperty(qm,"__esModule",{value:!0});qm.Rect=void 0;const s8e=je,l8e=On,u8e=Ge,c8e=nn,d8e=Te;let US=class extends l8e.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?c8e.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};qm.Rect=US;US.prototype.className="Rect";(0,u8e._registerNode)(US);s8e.Factory.addGetterSetter(US,"cornerRadius",0,(0,d8e.getNumberOrArrayOfNumbersValidator)(4));var GS={};Object.defineProperty(GS,"__esModule",{value:!0});GS.RegularPolygon=void 0;const aG=je,f8e=On,sG=Te,h8e=Ge;class _c extends f8e.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(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.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)}}GS.RegularPolygon=_c;_c.prototype.className="RegularPolygon";_c.prototype._centroid=!0;_c.prototype._attrsAffectingSize=["radius"];(0,h8e._registerNode)(_c);aG.Factory.addGetterSetter(_c,"radius",0,(0,sG.getNumberValidator)());aG.Factory.addGetterSetter(_c,"sides",0,(0,sG.getNumberValidator)());var HS={};Object.defineProperty(HS,"__esModule",{value:!0});HS.Ring=void 0;const lG=je,p8e=On,uG=Te,g8e=Ge;var JM=Math.PI*2;class Sc extends p8e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,JM,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),JM,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)}}HS.Ring=Sc;Sc.prototype.className="Ring";Sc.prototype._centroid=!0;Sc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,g8e._registerNode)(Sc);lG.Factory.addGetterSetter(Sc,"innerRadius",0,(0,uG.getNumberValidator)());lG.Factory.addGetterSetter(Sc,"outerRadius",0,(0,uG.getNumberValidator)());var qS={};Object.defineProperty(qS,"__esModule",{value:!0});qS.Sprite=void 0;const xc=je,m8e=On,y8e=Vf,cG=Te,v8e=Ge;class Ma extends m8e.Shape{constructor(t){super(t),this._updated=!0,this.anim=new y8e.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],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[n],h=r*2;t.drawImage(d,s,l,u,c,f[h+0],f[h+1],u,c)}else t.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],c=r*2;t.rect(u[c+0],u[c+1],s,l)}else t.rect(0,0,s,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)}}qS.Sprite=Ma;Ma.prototype.className="Sprite";(0,v8e._registerNode)(Ma);xc.Factory.addGetterSetter(Ma,"animation");xc.Factory.addGetterSetter(Ma,"animations");xc.Factory.addGetterSetter(Ma,"frameOffsets");xc.Factory.addGetterSetter(Ma,"image");xc.Factory.addGetterSetter(Ma,"frameIndex",0,(0,cG.getNumberValidator)());xc.Factory.addGetterSetter(Ma,"frameRate",17,(0,cG.getNumberValidator)());xc.Factory.backCompat(Ma,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var WS={};Object.defineProperty(WS,"__esModule",{value:!0});WS.Star=void 0;const mA=je,b8e=On,yA=Te,_8e=Ge;class Zl extends b8e.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 a=o%2===0?r:n,s=a*Math.sin(o*Math.PI/i),l=-1*a*Math.cos(o*Math.PI/i);t.lineTo(s,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)}}WS.Star=Zl;Zl.prototype.className="Star";Zl.prototype._centroid=!0;Zl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_8e._registerNode)(Zl);mA.Factory.addGetterSetter(Zl,"numPoints",5,(0,yA.getNumberValidator)());mA.Factory.addGetterSetter(Zl,"innerRadius",0,(0,yA.getNumberValidator)());mA.Factory.addGetterSetter(Zl,"outerRadius",0,(0,yA.getNumberValidator)());var lc={};Object.defineProperty(lc,"__esModule",{value:!0});lc.Text=lc.stringToArray=void 0;const N3=nn,Sr=je,S8e=On,Jl=Te,x8e=Ge;function dG(e){return Array.from(e)}lc.stringToArray=dG;var Vc="auto",w8e="center",fG="inherit",Ch="justify",C8e="Change.konva",E8e="2d",eR="-",hG="left",T8e="text",A8e="Text",P8e="top",k8e="bottom",tR="middle",pG="normal",I8e="px ",gy=" ",M8e="right",nR="rtl",R8e="word",O8e="char",rR="none",qw="…",gG=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],$8e=gG.length;function N8e(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 my;function Ww(){return my||(my=N3.Util.createCanvasElement().getContext(E8e),my)}function D8e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function L8e(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function F8e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class hn extends S8e.Shape{constructor(t){super(F8e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<$8e;n++)this.on(gG[n]+C8e,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,s=this.verticalAlign(),l=this.direction(),u=0,c=this.align(),d=this.getWidth(),f=this.letterSpacing(),h=this.fill(),p=this.textDecoration(),g=p.indexOf("underline")!==-1,_=p.indexOf("line-through")!==-1,b;l=l===fG?t.direction:l;var y=0,y=a/2,m=0,v=0;for(l===nR&&t.setAttr("direction",l),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",tR),t.setAttr("textAlign",hG),s===tR?u=(this.getHeight()-r*a-i*2)/2:s===k8e&&(u=this.getHeight()-r*a-i*2),t.translate(i,u+i),b=0;b<r;b++){var m=0,v=0,S=n[b],w=S.text,C=S.width,x=S.lastInParagraph,P,E,I;if(t.save(),c===M8e?m+=d-C-i*2:c===w8e&&(m+=(d-C-i*2)/2),g){t.save(),t.beginPath(),t.moveTo(m,y+v+Math.round(o/2)),P=w.split(" ").length-1,E=P===0,I=c===Ch&&!x?d-i*2:C,t.lineTo(m+Math.round(I),y+v+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||h,t.stroke(),t.restore()}if(_){t.save(),t.beginPath(),t.moveTo(m,y+v),P=w.split(" ").length-1,E=P===0,I=c===Ch&&x&&!E?d-i*2:C,t.lineTo(m+Math.round(I),y+v),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||h,t.stroke(),t.restore()}if(l!==nR&&(f!==0||c===Ch)){P=w.split(" ").length-1;for(var N=dG(w),M=0;M<N.length;M++){var T=N[M];T===" "&&!x&&c===Ch&&(m+=(d-i*2-C)/P),this._partialTextX=m,this._partialTextY=y+v,this._partialText=T,t.fillStrokeShape(this),m+=this.measureSize(T).width+f}}else f!==0&&t.setAttr("letterSpacing",`${f}px`),this._partialTextX=m,this._partialTextY=y+v,this._partialText=w,t.fillStrokeShape(this);t.restore(),r>1&&(y+=a)}}}_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=N3.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(T8e,n),this}getWidth(){var t=this.attrs.width===Vc||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Vc||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 N3.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=Ww(),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()+gy+this.fontVariant()+gy+(this.fontSize()+I8e)+N8e(this.fontFamily())}_addTextLine(t){this.align()===Ch&&(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 Ww().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,a=this.attrs.height,s=o!==Vc&&o!==void 0,l=a!==Vc&&a!==void 0,u=this.padding(),c=o-u*2,d=a-u*2,f=0,h=this.wrap(),p=h!==rR,g=h!==O8e&&p,_=this.ellipsis();this.textArr=[],Ww().font=this._getContextFont();for(var b=_?this._getTextWidth(qw):0,y=0,m=t.length;y<m;++y){var v=t[y],S=this._getTextWidth(v);if(s&&S>c)for(;v.length>0;){for(var w=0,C=v.length,x="",P=0;w<C;){var E=w+C>>>1,I=v.slice(0,E+1),N=this._getTextWidth(I)+b;N<=c?(w=E+1,x=I,P=N):C=E}if(x){if(g){var M,T=v[x.length],A=T===gy||T===eR;A&&P<=c?M=x.length:M=Math.max(x.lastIndexOf(gy),x.lastIndexOf(eR))+1,M>0&&(w=M,x=x.slice(0,w),P=this._getTextWidth(x))}x=x.trimRight(),this._addTextLine(x),r=Math.max(r,P),f+=i;var R=this._shouldHandleEllipsis(f);if(R){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(w),v=v.trimLeft(),v.length>0&&(S=this._getTextWidth(v),S<=c)){this._addTextLine(v),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(v),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<m-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&f+i>d)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Vc&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==rR;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Vc&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+qw)<i;s||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+qw)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return t&&n?!0:super._useBufferCanvas()}}lc.Text=hn;hn.prototype._fillFunc=D8e;hn.prototype._strokeFunc=L8e;hn.prototype.className=A8e;hn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,x8e._registerNode)(hn);Sr.Factory.overWriteSetter(hn,"width",(0,Jl.getNumberOrAutoValidator)());Sr.Factory.overWriteSetter(hn,"height",(0,Jl.getNumberOrAutoValidator)());Sr.Factory.addGetterSetter(hn,"direction",fG);Sr.Factory.addGetterSetter(hn,"fontFamily","Arial");Sr.Factory.addGetterSetter(hn,"fontSize",12,(0,Jl.getNumberValidator)());Sr.Factory.addGetterSetter(hn,"fontStyle",pG);Sr.Factory.addGetterSetter(hn,"fontVariant",pG);Sr.Factory.addGetterSetter(hn,"padding",0,(0,Jl.getNumberValidator)());Sr.Factory.addGetterSetter(hn,"align",hG);Sr.Factory.addGetterSetter(hn,"verticalAlign",P8e);Sr.Factory.addGetterSetter(hn,"lineHeight",1,(0,Jl.getNumberValidator)());Sr.Factory.addGetterSetter(hn,"wrap",R8e);Sr.Factory.addGetterSetter(hn,"ellipsis",!1,(0,Jl.getBooleanValidator)());Sr.Factory.addGetterSetter(hn,"letterSpacing",0,(0,Jl.getNumberValidator)());Sr.Factory.addGetterSetter(hn,"text","",(0,Jl.getStringValidator)());Sr.Factory.addGetterSetter(hn,"textDecoration","");var KS={};Object.defineProperty(KS,"__esModule",{value:!0});KS.TextPath=void 0;const Kw=nn,Vo=je,B8e=On,Eh=jf,Xw=lc,mG=Te,z8e=Ge;var V8e="",yG="normal";function vG(e){e.fillText(this.partialText,0,0)}function bG(e){e.strokeText(this.partialText,0,0)}class $n extends B8e.Shape{constructor(t){super(t),this.dummyCanvas=Kw.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 Eh.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:Eh.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Eh.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 a=0;a<o.length;a++){t.save();var s=o[a].p0;t.translate(s.x,s.y),t.rotate(o[a].rotation),this.partialText=o[a].text,t.fillStrokeShape(this),n==="underline"&&(a===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 Kw.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 Xw.Text.prototype.setText.call(this,t)}_getContextFont(){return Xw.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(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let s=0;i==="center"&&(s=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(s=Math.max(0,this.pathLength-a));const l=(0,Xw.stringToArray)(this.text());let u=s;for(var c=0;c<l.length;c++){const d=this._getPointAtLength(u);if(!d)return;let f=this._getTextSize(l[c]).width+r;if(l[c]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-a)/y}const h=this._getPointAtLength(u+f);if(!h)return;const p=Eh.Path.getLineLength(d.x,d.y,h.x,h.y);let g=0;if(o)try{g=o(l[c-1],l[c])*this.fontSize()}catch{g=0}d.x+=g,h.x+=g,this.textWidth+=g;const _=Eh.Path.getPointOnLine(g+p/2,d.x,d.y,h.x,h.y),b=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:l[c],rotation:b,p0:d,p1:h}),u+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return Kw.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}KS.TextPath=$n;$n.prototype._fillFunc=vG;$n.prototype._strokeFunc=bG;$n.prototype._fillFuncHit=vG;$n.prototype._strokeFuncHit=bG;$n.prototype.className="TextPath";$n.prototype._attrsAffectingSize=["text","fontSize","data"];(0,z8e._registerNode)($n);Vo.Factory.addGetterSetter($n,"data");Vo.Factory.addGetterSetter($n,"fontFamily","Arial");Vo.Factory.addGetterSetter($n,"fontSize",12,(0,mG.getNumberValidator)());Vo.Factory.addGetterSetter($n,"fontStyle",yG);Vo.Factory.addGetterSetter($n,"align","left");Vo.Factory.addGetterSetter($n,"letterSpacing",0,(0,mG.getNumberValidator)());Vo.Factory.addGetterSetter($n,"textBaseline","middle");Vo.Factory.addGetterSetter($n,"fontVariant",yG);Vo.Factory.addGetterSetter($n,"text",V8e);Vo.Factory.addGetterSetter($n,"textDecoration",null);Vo.Factory.addGetterSetter($n,"kerningFunc",null);var XS={};Object.defineProperty(XS,"__esModule",{value:!0});XS.Transformer=void 0;const _t=nn,yt=je,iR=Kt,j8e=On,U8e=qm,oR=zf,go=Ge,eu=Te,G8e=Ge;var _G="tr-konva",H8e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${_G}`).join(" "),aR="nodesRect",q8e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],W8e={"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 K8e="ontouchstart"in go.Konva._global;function X8e(e,t,n){if(e==="rotater")return n;t+=_t.Util.degToRad(W8e[e]||0);var r=(_t.Util.radToDeg(t)%360+360)%360;return _t.Util._inRange(r,315+22.5,360)||_t.Util._inRange(r,0,22.5)?"ns-resize":_t.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":_t.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":_t.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":_t.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":_t.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":_t.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":_t.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(_t.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var lb=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],sR=1e8;function Q8e(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 SG(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{...e,rotation:e.rotation+t,x:r,y:i}}function Y8e(e,t){const n=Q8e(e);return SG(e,t,n)}function Z8e(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=go.Konva.getAngle(e[i]),a=Math.abs(o-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}class lt extends oR.Group{constructor(t){super(t),this._movingAnchorName=null,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(H8e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return _t.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 _G+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(_t.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()},a=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(q8e.map(s=>s+`.${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,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.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(aR),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(aR,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(go.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return SG(c,-go.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-sR,y:-sR,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=u.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new _t.Transform;r.rotate(-go.Konva.getAngle(this.rotation()));var i=1/0,o=1/0,a=-1/0,s=-1/0;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:go.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(),lb.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var n=new U8e.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:K8e?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=go.Konva.getAngle(this.rotation()),o=this.rotateAnchorCursor(),a=X8e(t,i,o);n.getStage().content&&(n.getStage().content.style.cursor=a),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new j8e.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n,r){var i=r.getParent(),o=i.padding();n.beginPath(),n.rect(-o,-o,r.width()+o*2,r.height()+o*2),n.moveTo(r.width()/2,-o),i.rotateEnabled()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*_t.Util._sign(r.height())-o),n.fillStrokeShape(r)},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 a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.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),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();n=o.x()-d.width/2,r=-o.y()+d.height/2;let M=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(M-=Math.PI);var f=go.Konva.getAngle(this.rotation());const T=f+M,A=go.Konva.getAngle(this.rotationSnapTolerance()),D=Z8e(this.rotationSnaps(),T,A)-d.rotation,$=Y8e(d,D);this._fitNodesInto($,t);return}var h=this.shiftBehavior(),p;h==="inverted"?p=this.keepRatio()&&!t.shiftKey:h==="none"?p=this.keepRatio():p=this.keepRatio()||t.shiftKey;var m=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(p){var g=m?{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(g.x-o.x(),2)+Math.pow(g.y-o.y(),2));var _=this.findOne(".top-left").x()>g.x?-1:1,b=this.findOne(".top-left").y()>g.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-left").x(g.x-n),this.findOne(".top-left").y(g.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(p){var g=m?{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()-g.x,2)+Math.pow(g.y-o.y(),2));var _=this.findOne(".top-right").x()<g.x?-1:1,b=this.findOne(".top-right").y()>g.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-right").x(g.x+n),this.findOne(".top-right").y(g.y-r)}var y=o.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.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(p){var g=m?{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(g.x-o.x(),2)+Math.pow(o.y()-g.y,2));var _=g.x<o.x()?-1:1,b=o.y()<g.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,o.x(g.x-n),o.y(g.y+r)}y=o.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(p){var g=m?{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()-g.x,2)+Math.pow(o.y()-g.y,2));var _=this.findOne(".bottom-right").x()<g.x?-1:1,b=this.findOne(".bottom-right").y()<g.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".bottom-right").x(g.x+n),this.findOne(".bottom-right").y(g.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var m=this.centeredScaling()||t.altKey;if(m){var v=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=v.x(),C=v.y(),x=this.getWidth()-S.x(),P=this.getHeight()-S.y();S.move({x:-w,y:-C}),v.move({x,y:P})}var E=this.findOne(".top-left").getAbsolutePosition();n=E.x,r=E.y;var I=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),N=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:I,height:N,rotation:go.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(_t.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(_t.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var o=new _t.Transform;if(o.rotate(go.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const f=o.point({x:-this.padding()*2,y:0});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}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const f=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const f=o.point({x:0,y:-this.padding()*2});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}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const f=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const f=this.boundBoxFunc()(r,t);f?t=f:_t.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,s=new _t.Transform;s.translate(r.x,r.y),s.rotate(r.rotation),s.scale(r.width/a,r.height/a);const l=new _t.Transform,u=t.width/a,c=t.height/a;this.flipEnabled()===!1?(l.translate(t.x,t.y),l.rotate(t.rotation),l.translate(t.width<0?t.width:0,t.height<0?t.height:0),l.scale(Math.abs(u),Math.abs(c))):(l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(u,c));const d=l.multiply(s.invert());this._nodes.forEach(f=>{var h;const p=f.getParent().getAbsoluteTransform(),g=f.getTransform().copy();g.translate(f.offsetX(),f.offsetY());const _=new _t.Transform;_.multiply(p.copy().invert()).multiply(d).multiply(p).multiply(g);const b=_.decompose();f.setAttrs(b),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(_t.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(_t.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(d=>{d.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+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*_t.Util._sign(i)-s,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 c=this.anchorStyleFunc();c&&u.forEach(d=>{c(d)}),(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=""),oR.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return iR.Node.prototype.toObject.call(this)}clone(t){var n=iR.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}XS.Transformer=lt;function J8e(e){return e instanceof Array||_t.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){lb.indexOf(t)===-1&&_t.Util.warn("Unknown anchor name: "+t+". Available names are: "+lb.join(", "))}),e||[]}lt.prototype.className="Transformer";(0,G8e._registerNode)(lt);yt.Factory.addGetterSetter(lt,"enabledAnchors",lb,J8e);yt.Factory.addGetterSetter(lt,"flipEnabled",!0,(0,eu.getBooleanValidator)());yt.Factory.addGetterSetter(lt,"resizeEnabled",!0);yt.Factory.addGetterSetter(lt,"anchorSize",10,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"rotateEnabled",!0);yt.Factory.addGetterSetter(lt,"rotationSnaps",[]);yt.Factory.addGetterSetter(lt,"rotateAnchorOffset",50,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"rotateAnchorCursor","crosshair");yt.Factory.addGetterSetter(lt,"rotationSnapTolerance",5,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"borderEnabled",!0);yt.Factory.addGetterSetter(lt,"anchorStroke","rgb(0, 161, 255)");yt.Factory.addGetterSetter(lt,"anchorStrokeWidth",1,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"anchorFill","white");yt.Factory.addGetterSetter(lt,"anchorCornerRadius",0,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"borderStroke","rgb(0, 161, 255)");yt.Factory.addGetterSetter(lt,"borderStrokeWidth",1,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"borderDash");yt.Factory.addGetterSetter(lt,"keepRatio",!0);yt.Factory.addGetterSetter(lt,"shiftBehavior","default");yt.Factory.addGetterSetter(lt,"centeredScaling",!1);yt.Factory.addGetterSetter(lt,"ignoreStroke",!1);yt.Factory.addGetterSetter(lt,"padding",0,(0,eu.getNumberValidator)());yt.Factory.addGetterSetter(lt,"node");yt.Factory.addGetterSetter(lt,"nodes");yt.Factory.addGetterSetter(lt,"boundBoxFunc");yt.Factory.addGetterSetter(lt,"anchorDragBoundFunc");yt.Factory.addGetterSetter(lt,"anchorStyleFunc");yt.Factory.addGetterSetter(lt,"shouldOverdrawWholeArea",!1);yt.Factory.addGetterSetter(lt,"useSingleNodeRotation",!0);yt.Factory.backCompat(lt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var QS={};Object.defineProperty(QS,"__esModule",{value:!0});QS.Wedge=void 0;const YS=je,e9e=On,t9e=Ge,xG=Te,n9e=Ge;class Ps extends e9e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,t9e.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)}}QS.Wedge=Ps;Ps.prototype.className="Wedge";Ps.prototype._centroid=!0;Ps.prototype._attrsAffectingSize=["radius"];(0,n9e._registerNode)(Ps);YS.Factory.addGetterSetter(Ps,"radius",0,(0,xG.getNumberValidator)());YS.Factory.addGetterSetter(Ps,"angle",0,(0,xG.getNumberValidator)());YS.Factory.addGetterSetter(Ps,"clockwise",!1);YS.Factory.backCompat(Ps,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});ZS.Blur=void 0;const lR=je,r9e=Kt,i9e=Te;function uR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var o9e=[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],a9e=[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 s9e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,c,d,f,h,p,g,_,b,y,m,v,S,w,C,x,P,E,I,N,M=t+t+1,T=r-1,A=i-1,R=t+1,D=R*(R+1)/2,$=new uR,L=null,O=$,B=null,U=null,j=o9e[t],q=a9e[t];for(s=1;s<M;s++)O=O.next=new uR,s===R&&(L=O);for(O.next=$,d=c=0,a=0;a<i;a++){for(v=S=w=C=f=h=p=g=0,_=R*(x=n[c]),b=R*(P=n[c+1]),y=R*(E=n[c+2]),m=R*(I=n[c+3]),f+=D*x,h+=D*P,p+=D*E,g+=D*I,O=$,s=0;s<R;s++)O.r=x,O.g=P,O.b=E,O.a=I,O=O.next;for(s=1;s<R;s++)l=c+((T<s?T:s)<<2),f+=(O.r=x=n[l])*(N=R-s),h+=(O.g=P=n[l+1])*N,p+=(O.b=E=n[l+2])*N,g+=(O.a=I=n[l+3])*N,v+=x,S+=P,w+=E,C+=I,O=O.next;for(B=$,U=L,o=0;o<r;o++)n[c+3]=I=g*j>>q,I!==0?(I=255/I,n[c]=(f*j>>q)*I,n[c+1]=(h*j>>q)*I,n[c+2]=(p*j>>q)*I):n[c]=n[c+1]=n[c+2]=0,f-=_,h-=b,p-=y,g-=m,_-=B.r,b-=B.g,y-=B.b,m-=B.a,l=d+((l=o+t+1)<T?l:T)<<2,v+=B.r=n[l],S+=B.g=n[l+1],w+=B.b=n[l+2],C+=B.a=n[l+3],f+=v,h+=S,p+=w,g+=C,B=B.next,_+=x=U.r,b+=P=U.g,y+=E=U.b,m+=I=U.a,v-=x,S-=P,w-=E,C-=I,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=C=v=h=p=g=f=0,c=o<<2,_=R*(x=n[c]),b=R*(P=n[c+1]),y=R*(E=n[c+2]),m=R*(I=n[c+3]),f+=D*x,h+=D*P,p+=D*E,g+=D*I,O=$,s=0;s<R;s++)O.r=x,O.g=P,O.b=E,O.a=I,O=O.next;for(u=r,s=1;s<=t;s++)c=u+o<<2,f+=(O.r=x=n[c])*(N=R-s),h+=(O.g=P=n[c+1])*N,p+=(O.b=E=n[c+2])*N,g+=(O.a=I=n[c+3])*N,v+=x,S+=P,w+=E,C+=I,O=O.next,s<A&&(u+=r);for(c=o,B=$,U=L,a=0;a<i;a++)l=c<<2,n[l+3]=I=g*j>>q,I>0?(I=255/I,n[l]=(f*j>>q)*I,n[l+1]=(h*j>>q)*I,n[l+2]=(p*j>>q)*I):n[l]=n[l+1]=n[l+2]=0,f-=_,h-=b,p-=y,g-=m,_-=B.r,b-=B.g,y-=B.b,m-=B.a,l=o+((l=a+R)<A?l:A)*r<<2,f+=v+=B.r=n[l],h+=S+=B.g=n[l+1],p+=w+=B.b=n[l+2],g+=C+=B.a=n[l+3],B=B.next,_+=x=U.r,b+=P=U.g,y+=E=U.b,m+=I=U.a,v-=x,S-=P,w-=E,C-=I,U=U.next,c+=r}}const l9e=function(t){var n=Math.round(this.blurRadius());n>0&&s9e(t,n)};ZS.Blur=l9e;lR.Factory.addGetterSetter(r9e.Node,"blurRadius",0,(0,i9e.getNumberValidator)(),lR.Factory.afterSetFilter);var JS={};Object.defineProperty(JS,"__esModule",{value:!0});JS.Brighten=void 0;const cR=je,u9e=Kt,c9e=Te,d9e=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=d9e;cR.Factory.addGetterSetter(u9e.Node,"brightness",0,(0,c9e.getNumberValidator)(),cR.Factory.afterSetFilter);var e2={};Object.defineProperty(e2,"__esModule",{value:!0});e2.Contrast=void 0;const dR=je,f9e=Kt,h9e=Te,p9e=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,a=150,s;for(s=0;s<r;s+=4)i=n[s],o=n[s+1],a=n[s+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};e2.Contrast=p9e;dR.Factory.addGetterSetter(f9e.Node,"contrast",0,(0,h9e.getNumberValidator)(),dR.Factory.afterSetFilter);var t2={};Object.defineProperty(t2,"__esModule",{value:!0});t2.Emboss=void 0;const Nl=je,n2=Kt,g9e=nn,wG=Te,m9e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,c=l*4,d=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:g9e.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=o;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,g=l;do{var _=f+(g-1)*4,b=a;g+b<1&&(b=0),g+b>l&&(b=0);var y=p+(g-1+b)*4,m=s[_]-s[y],v=s[_+1]-s[y+1],S=s[_+2]-s[y+2],w=m,C=w>0?w:-w,x=v>0?v:-v,P=S>0?S:-S;if(x>C&&(w=v),P>C&&(w=S),w*=t,i){var E=s[_]+w,I=s[_+1]+w,N=s[_+2]+w;s[_]=E>255?255:E<0?0:E,s[_+1]=I>255?255:I<0?0:I,s[_+2]=N>255?255:N<0?0:N}else{var M=n-w;M<0?M=0:M>255&&(M=255),s[_]=s[_+1]=s[_+2]=M}}while(--g)}while(--d)};t2.Emboss=m9e;Nl.Factory.addGetterSetter(n2.Node,"embossStrength",.5,(0,wG.getNumberValidator)(),Nl.Factory.afterSetFilter);Nl.Factory.addGetterSetter(n2.Node,"embossWhiteLevel",.5,(0,wG.getNumberValidator)(),Nl.Factory.afterSetFilter);Nl.Factory.addGetterSetter(n2.Node,"embossDirection","top-left",null,Nl.Factory.afterSetFilter);Nl.Factory.addGetterSetter(n2.Node,"embossBlend",!1,null,Nl.Factory.afterSetFilter);var r2={};Object.defineProperty(r2,"__esModule",{value:!0});r2.Enhance=void 0;const fR=je,y9e=Kt,v9e=Te;function Qw(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const b9e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],c=u,d,f,h=this.enhance();if(h!==0){for(f=0;f<n;f+=4)o=t[f+0],o<r?r=o:o>i&&(i=o),l=t[f+1],l<a?a=l:l>s&&(s=l),d=t[f+2],d<u?u=d:d>c&&(c=d);i===r&&(i=255,r=0),s===a&&(s=255,a=0),c===u&&(c=255,u=0);var p,g,_,b,y,m,v,S,w;for(h>0?(g=i+h*(255-i),_=r-h*(r-0),y=s+h*(255-s),m=a-h*(a-0),S=c+h*(255-c),w=u-h*(u-0)):(p=(i+r)*.5,g=i+h*(i-p),_=r+h*(r-p),b=(s+a)*.5,y=s+h*(s-b),m=a+h*(a-b),v=(c+u)*.5,S=c+h*(c-v),w=u+h*(u-v)),f=0;f<n;f+=4)t[f+0]=Qw(t[f+0],r,i,_,g),t[f+1]=Qw(t[f+1],a,s,m,y),t[f+2]=Qw(t[f+2],u,c,w,S)}};r2.Enhance=b9e;fR.Factory.addGetterSetter(y9e.Node,"enhance",0,(0,v9e.getNumberValidator)(),fR.Factory.afterSetFilter);var i2={};Object.defineProperty(i2,"__esModule",{value:!0});i2.Grayscale=void 0;const _9e=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};i2.Grayscale=_9e;var o2={};Object.defineProperty(o2,"__esModule",{value:!0});o2.HSL=void 0;const Tf=je,vA=Kt,bA=Te;Tf.Factory.addGetterSetter(vA.Node,"hue",0,(0,bA.getNumberValidator)(),Tf.Factory.afterSetFilter);Tf.Factory.addGetterSetter(vA.Node,"saturation",0,(0,bA.getNumberValidator)(),Tf.Factory.afterSetFilter);Tf.Factory.addGetterSetter(vA.Node,"luminance",0,(0,bA.getNumberValidator)(),Tf.Factory.afterSetFilter);const S9e=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,s,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*l+.167*u,d=.587*r-.587*l+.33*u,f=.114*r-.114*l-.497*u,h=.299*r-.299*l-.328*u,p=.587*r+.413*l+.035*u,g=.114*r-.114*l+.293*u,_=.299*r-.3*l+1.25*u,b=.587*r-.586*l-1.05*u,y=.114*r+.886*l-.2*u,m,v,S,w;for(s=0;s<n;s+=4)m=t[s+0],v=t[s+1],S=t[s+2],w=t[s+3],t[s+0]=c*m+d*v+f*S+a,t[s+1]=h*m+p*v+g*S+a,t[s+2]=_*m+b*v+y*S+a,t[s+3]=w};o2.HSL=S9e;var a2={};Object.defineProperty(a2,"__esModule",{value:!0});a2.HSV=void 0;const Af=je,_A=Kt,SA=Te,x9e=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,a,s=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*s+.167*l,c=.587*r-.587*s+.33*l,d=.114*r-.114*s-.497*l,f=.299*r-.299*s-.328*l,h=.587*r+.413*s+.035*l,p=.114*r-.114*s+.293*l,g=.299*r-.3*s+1.25*l,_=.587*r-.586*s-1.05*l,b=.114*r+.886*s-.2*l,y,m,v,S;for(a=0;a<n;a+=4)y=t[a+0],m=t[a+1],v=t[a+2],S=t[a+3],t[a+0]=u*y+c*m+d*v,t[a+1]=f*y+h*m+p*v,t[a+2]=g*y+_*m+b*v,t[a+3]=S};a2.HSV=x9e;Af.Factory.addGetterSetter(_A.Node,"hue",0,(0,SA.getNumberValidator)(),Af.Factory.afterSetFilter);Af.Factory.addGetterSetter(_A.Node,"saturation",0,(0,SA.getNumberValidator)(),Af.Factory.afterSetFilter);Af.Factory.addGetterSetter(_A.Node,"value",0,(0,SA.getNumberValidator)(),Af.Factory.afterSetFilter);var s2={};Object.defineProperty(s2,"__esModule",{value:!0});s2.Invert=void 0;const w9e=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]};s2.Invert=w9e;var l2={};Object.defineProperty(l2,"__esModule",{value:!0});l2.Kaleidoscope=void 0;const ub=je,CG=Kt,hR=nn,EG=Te;var C9e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f=0,h=0,p=0,g=0,_,b=Math.sqrt(s*s+l*l);c=o-s,d=a-l,_=Math.sqrt(c*c+d*d),b=_>b?_:b;var y=a,m=o,v,S,w=360/m*Math.PI/180,C,x;for(S=0;S<m;S+=1)for(C=Math.sin(S*w),x=Math.cos(S*w),v=0;v<y;v+=1)c=Math.floor(s+b*v/y*x),d=Math.floor(l+b*v/y*C),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],g=r[u+3],u=(S+v*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=g},E9e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f,h,p=0,g=0,_=0,b=0,y,m=Math.sqrt(s*s+l*l);c=o-s,d=a-l,y=Math.sqrt(c*c+d*d),m=y>m?y:m;var v=a,S=o,w,C,x=n.polarRotation||0,P,E;for(c=0;c<o;c+=1)for(d=0;d<a;d+=1)f=c-s,h=d-l,w=Math.sqrt(f*f+h*h)*v/m,C=(Math.atan2(h,f)*180/Math.PI+360+x)%360,C=C*S/360,P=Math.floor(C),E=Math.floor(w),u=(E*o+P)*4,p=r[u+0],g=r[u+1],_=r[u+2],b=r[u+3],u=(d*o+c)*4,i[u+0]=p,i[u+1]=g,i[u+2]=_,i[u+3]=b};const T9e=function(e){var t=e.width,n=e.height,r,i,o,a,s,l,u,c,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),g=Math.floor(t*(p%360)/360);if(!(h<1)){var _=hR.Util.createCanvasElement();_.width=t,_.height=n;var b=_.getContext("2d").getImageData(0,0,t,n);hR.Util.releaseCanvas(_),C9e(e,b,{polarCenterX:t/2,polarCenterY:n/2});for(var y=t/Math.pow(2,h);y<=8;)y=y*2,h-=1;y=Math.ceil(y);var m=y,v=0,S=m,w=1;for(g+y>t&&(v=m,S=0,w=-1),i=0;i<n;i+=1)for(r=v;r!==S;r+=w)o=Math.round(r+g)%t,d=(t*i+o)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+r)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;for(i=0;i<n;i+=1)for(m=Math.floor(y),a=0;a<h;a+=1){for(r=0;r<m+1;r+=1)d=(t*i+r)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+m*2-r-1)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;m*=2}E9e(b,e,{polarRotation:0})}};l2.Kaleidoscope=T9e;ub.Factory.addGetterSetter(CG.Node,"kaleidoscopePower",2,(0,EG.getNumberValidator)(),ub.Factory.afterSetFilter);ub.Factory.addGetterSetter(CG.Node,"kaleidoscopeAngle",0,(0,EG.getNumberValidator)(),ub.Factory.afterSetFilter);var u2={};Object.defineProperty(u2,"__esModule",{value:!0});u2.Mask=void 0;const pR=je,A9e=Kt,P9e=Te;function yy(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 Th(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 k9e(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 I9e(e,t){var n=yy(e,0,0),r=yy(e,e.width-1,0),i=yy(e,0,e.height-1),o=yy(e,e.width-1,e.height-1),a=t||10;if(Th(n,r)<a&&Th(r,o)<a&&Th(o,i)<a&&Th(i,n)<a){for(var s=k9e([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var c=Th(s,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=c<a?0:255}return l}}function M9e(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function R9e(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),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var g=h*t+p,_=r[d*i+f];c+=e[g]*_}}a[u]=c===255*8?255:0}return a}function O9e(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),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var g=h*t+p,_=r[d*i+f];c+=e[g]*_}}a[u]=c>=255*4?255:0}return a}function $9e(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),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var g=h*t+p,_=r[d*i+f];c+=e[g]*_}}a[u]=c}return a}const N9e=function(e){var t=this.threshold(),n=I9e(e,t);return n&&(n=R9e(n,e.width,e.height),n=O9e(n,e.width,e.height),n=$9e(n,e.width,e.height),M9e(e,n)),e};u2.Mask=N9e;pR.Factory.addGetterSetter(A9e.Node,"threshold",0,(0,P9e.getNumberValidator)(),pR.Factory.afterSetFilter);var c2={};Object.defineProperty(c2,"__esModule",{value:!0});c2.Noise=void 0;const gR=je,D9e=Kt,L9e=Te,F9e=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()};c2.Noise=F9e;gR.Factory.addGetterSetter(D9e.Node,"noise",.2,(0,L9e.getNumberValidator)(),gR.Factory.afterSetFilter);var d2={};Object.defineProperty(d2,"__esModule",{value:!0});d2.Pixelate=void 0;const mR=je,B9e=nn,z9e=Kt,V9e=Te,j9e=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,a,s,l,u,c,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,g,_,b,y,m,v=e.data;if(t<=0){B9e.Util.error("pixelSize value can not be <= 0");return}for(b=0;b<d;b+=1)for(y=0;y<f;y+=1){for(s=0,l=0,u=0,c=0,h=b*t,p=h+t,g=y*t,_=g+t,m=0,i=h;i<p;i+=1)if(!(i>=n))for(o=g;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=v[a+0],l+=v[a+1],u+=v[a+2],c+=v[a+3],m+=1);for(s=s/m,l=l/m,u=u/m,c=c/m,i=h;i<p;i+=1)if(!(i>=n))for(o=g;o<_;o+=1)o>=r||(a=(n*o+i)*4,v[a+0]=s,v[a+1]=l,v[a+2]=u,v[a+3]=c)}};d2.Pixelate=j9e;mR.Factory.addGetterSetter(z9e.Node,"pixelSize",8,(0,V9e.getNumberValidator)(),mR.Factory.afterSetFilter);var f2={};Object.defineProperty(f2,"__esModule",{value:!0});f2.Posterize=void 0;const yR=je,U9e=Kt,G9e=Te,H9e=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};f2.Posterize=H9e;yR.Factory.addGetterSetter(U9e.Node,"levels",.5,(0,G9e.getNumberValidator)(),yR.Factory.afterSetFilter);var h2={};Object.defineProperty(h2,"__esModule",{value:!0});h2.RGB=void 0;const cb=je,xA=Kt,q9e=Te,W9e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a,s;for(a=0;a<n;a+=4)s=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=s*r,t[a+1]=s*i,t[a+2]=s*o,t[a+3]=t[a+3]};h2.RGB=W9e;cb.Factory.addGetterSetter(xA.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});cb.Factory.addGetterSetter(xA.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});cb.Factory.addGetterSetter(xA.Node,"blue",0,q9e.RGBComponent,cb.Factory.afterSetFilter);var p2={};Object.defineProperty(p2,"__esModule",{value:!0});p2.RGBA=void 0;const Gg=je,g2=Kt,K9e=Te,X9e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s<n;s+=4)l=1-a,t[s]=r*a+t[s]*l,t[s+1]=i*a+t[s+1]*l,t[s+2]=o*a+t[s+2]*l};p2.RGBA=X9e;Gg.Factory.addGetterSetter(g2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gg.Factory.addGetterSetter(g2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gg.Factory.addGetterSetter(g2.Node,"blue",0,K9e.RGBComponent,Gg.Factory.afterSetFilter);Gg.Factory.addGetterSetter(g2.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var m2={};Object.defineProperty(m2,"__esModule",{value:!0});m2.Sepia=void 0;const Q9e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],a=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+a*.189),t[r+1]=Math.min(255,i*.349+o*.686+a*.168),t[r+2]=Math.min(255,i*.272+o*.534+a*.131)};m2.Sepia=Q9e;var y2={};Object.defineProperty(y2,"__esModule",{value:!0});y2.Solarize=void 0;const Y9e=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var a=(o-1)*i,s=n;do{var l=a+(s-1)*4,u=t[l],c=t[l+1],d=t[l+2];u>127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),t[l]=u,t[l+1]=c,t[l+2]=d}while(--s)}while(--o)};y2.Solarize=Y9e;var v2={};Object.defineProperty(v2,"__esModule",{value:!0});v2.Threshold=void 0;const vR=je,Z9e=Kt,J9e=Te,eMe=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};v2.Threshold=eMe;vR.Factory.addGetterSetter(Z9e.Node,"threshold",.5,(0,J9e.getNumberValidator)(),vR.Factory.afterSetFilter);Object.defineProperty(AS,"__esModule",{value:!0});AS.Konva=void 0;const bR=GU,tMe=OS,nMe=DS,rMe=BS,iMe=zS,oMe=VS,_R=Ef,aMe=Gm,sMe=jf,lMe=qm,uMe=GS,cMe=HS,dMe=qS,fMe=WS,hMe=lc,pMe=KS,gMe=XS,mMe=QS,yMe=ZS,vMe=JS,bMe=e2,_Me=t2,SMe=r2,xMe=i2,wMe=o2,CMe=a2,EMe=s2,TMe=l2,AMe=u2,PMe=c2,kMe=d2,IMe=f2,MMe=h2,RMe=p2,OMe=m2,$Me=y2,NMe=v2;AS.Konva=bR.Konva.Util._assign(bR.Konva,{Arc:tMe.Arc,Arrow:nMe.Arrow,Circle:rMe.Circle,Ellipse:iMe.Ellipse,Image:oMe.Image,Label:_R.Label,Tag:_R.Tag,Line:aMe.Line,Path:sMe.Path,Rect:lMe.Rect,RegularPolygon:uMe.RegularPolygon,Ring:cMe.Ring,Sprite:dMe.Sprite,Star:fMe.Star,Text:hMe.Text,TextPath:pMe.TextPath,Transformer:gMe.Transformer,Wedge:mMe.Wedge,Filters:{Blur:yMe.Blur,Brighten:vMe.Brighten,Contrast:bMe.Contrast,Emboss:_Me.Emboss,Enhance:SMe.Enhance,Grayscale:xMe.Grayscale,HSL:wMe.HSL,HSV:CMe.HSV,Invert:EMe.Invert,Kaleidoscope:TMe.Kaleidoscope,Mask:AMe.Mask,Noise:PMe.Noise,Pixelate:kMe.Pixelate,Posterize:IMe.Posterize,RGB:MMe.RGB,RGBA:RMe.RGBA,Sepia:OMe.Sepia,Solarize:$Me.Solarize,Threshold:NMe.Threshold}});var DMe=lA.exports;Object.defineProperty(DMe,"__esModule",{value:!0});const LMe=AS;lA.exports=LMe.Konva;var FMe=lA.exports;const Ah=Bl(FMe),BMe=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),a=new Ah.Stage({container:o,width:r,height:i}),s=new Ah.Layer,l=new Ah.Layer;return s.add(new Ah.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new Ah.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"}))),a.add(s),a.add(l),o.remove(),a},zMe=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d"),s=new Image;if(!a){o.remove(),i("Unable to get context");return}s.onload=function(){a.drawImage(s,0,0),o.remove(),r(a.getImageData(0,0,t,n))},s.src=e}),SR=async(e,t)=>{const n=e.toDataURL(t);return await zMe(n,t.width,t.height)},wA=async(e,t,n,r,i)=>{const o=se("canvas"),a=ES(),s=$6e();if(!a||!s){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=a.clone();u.scale({x:1,y:1});const c=u.getAbsolutePosition(),d={x:l.x+c.x,y:l.y+c.y,width:l.width,height:l.height},f=await ab(u,d),h=await SR(u,d),p=await BMe(r?e.objects.filter(wL):[],l,i),g=await ab(p,l),_=await SR(p,l);return{baseBlob:f,baseImageData:h,maskBlob:g,maskImageData:_}},VMe=()=>{pe({actionCreator:A6e,effect:async(e,{dispatch:t,getState:n})=>{const r=se("canvas"),i=n(),o=await wA(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(it({title:X("toast.problemSavingMask"),description:X("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(ce.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.maskSavedAssets")}}}))}})},jMe=()=>{pe({actionCreator:R6e,effect:async(e,{dispatch:t,getState:n})=>{const r=se("canvas"),i=n(),{id:o}=e.payload,a=await wA(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!a)return;const{maskBlob:s}=a;if(!s){r.error("Problem getting mask layer blob"),t(it({title:X("toast.problemImportingMask"),description:X("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:l}=i.gallery,u=await t(ce.endpoints.uploadImage.initiate({file:new File([s],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:l==="none"?void 0:l,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:c}=u;t(Hl({id:o,controlImage:c}))}})},UMe=async()=>{const e=ES();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),ab(t,t.getClientRect())},GMe=()=>{pe({actionCreator:I6e,effect:async(e,{dispatch:t})=>{const n=J_.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await UMe();if(!r){n.error("Problem getting base layer blob"),t(it({title:X("toast.problemMergingCanvas"),description:X("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=ES();if(!i){n.error("Problem getting canvas base layer"),t(it({title:X("toast.problemMergingCanvas"),description:X("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()??void 0}),a=await t(ce.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.canvasMerged")}}})).unwrap(),{image_name:s}=a;t(Mle({kind:"image",layer:"base",imageName:s,...o}))}})},HMe=()=>{pe({actionCreator:T6e,effect:async(e,{dispatch:t,getState:n})=>{const r=se("canvas"),i=n();let o;try{o=await TS(i)}catch(s){r.error(String(s)),t(it({title:X("toast.problemSavingCanvas"),description:X("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(ce.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.canvasSavedGallery")}}}))}})},qMe=(e,t,n)=>{if(!(Fie.match(e)||S6.match(e)||Hl.match(e)||Bie.match(e)||x6.match(e)))return!1;const{id:i}=e.payload,o=di(n.controlAdapters,i),a=di(t.controlAdapters,i);if(!o||!gi(o)||!a||!gi(a)||x6.match(e)&&o.shouldAutoConfig===!0)return!1;const{controlImage:s,processorType:l,shouldAutoConfig:u}=a;return S6.match(e)&&!u?!1:l!=="none"&&!!s},WMe=()=>{pe({predicate:qMe,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=se("session"),{id:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(IE({id:o}))}})},TG=e=>(e==null?void 0:e.type)==="image_output",KMe=()=>{pe({actionCreator:IE,effect:async(e,{dispatch:t,getState:n,take:r})=>{var u;const i=se("session"),{id:o}=e.payload,a=di(n().controlAdapters,o);if(!(a!=null&&a.controlImage)||!gi(a)){i.error("Unable to process ControlNet image");return}if(a.processorType==="none"||a.processorNode.type==="none")return;const s=a.processorNode.id,l={prepend:!0,batch:{graph:{nodes:{[a.processorNode.id]:{...a.processorNode,is_intermediate:!0,use_cache:!1,image:{image_name:a.controlImage}}}},runs:1}};try{const c=t(un.endpoints.enqueueBatch.initiate(l,{fixedCacheKey:"enqueueBatch"})),d=await c.unwrap();c.reset(),i.debug({enqueueResult:pt(d)},X("queue.graphQueued"));const[f]=await r(h=>TE.match(h)&&h.payload.data.queue_batch_id===d.batch.batch_id&&h.payload.data.source_node_id===s);if(TG(f.payload.data.result)){const{image_name:h}=f.payload.data.result.image,[{payload:p}]=await r(_=>ce.endpoints.getImageDTO.matchFulfilled(_)&&_.payload.image_name===h),g=p;i.debug({controlNetId:e.payload,processedControlImage:g},"ControlNet image processed"),t(RE({id:o,processedControlImage:g.image_name}))}}catch(c){if(i.error({enqueueBatchArg:pt(l)},X("queue.graphFailedToQueue")),c instanceof Object&&"data"in c&&"status"in c&&c.status===403){const d=((u=c.data)==null?void 0:u.detail)||"Unknown Error";t(it({title:X("queue.graphFailedToQueue"),status:"error",description:d,duration:15e3})),t(Vie()),t(Hl({id:o,controlImage:null}));return}t(it({title:X("queue.graphFailedToQueue"),status:"error"}))}}})},CA=ge("app/enqueueRequested");ge("app/batchEnqueued");const XMe=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>")})},xR=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)}),QMe=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}},YMe=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},ZMe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=QMe(e.data),i=YMe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},_e="positive_conditioning",Ce="negative_conditioning",ue="denoise_latents",Kc="denoise_latents_hrf",xe="latents_to_image",tl="latents_to_image_hrf_hr",_u="latents_to_image_hrf_lr",Ph="image_to_latents_hrf",Us="resize_hrf",Zh="esrgan_hrf",Wu="linear_ui_output",xl="nsfw_checker",Nu="invisible_watermark",ve="noise",kh="noise_hrf",Ro="main_model_loader",b2="onnx_model_loader",fi="vae_loader",AG="lora_loader",ct="clip_skip",Bt="image_to_latents",aa="resize_image",Ku="img2img_resize",le="canvas_output",It="inpaint_image",JMe="scaled_inpaint_image",Gn="inpaint_image_resize_up",or="inpaint_image_resize_down",at="inpaint_infill",ts="inpaint_infill_resize_down",eRe="inpaint_final_image",Pt="inpaint_create_mask",tRe="inpaint_mask",$e="canvas_coherence_denoise_latents",rt="canvas_coherence_noise",Dl="canvas_coherence_noise_increment",ln="canvas_coherence_mask_edge",et="canvas_coherence_inpaint_create_mask",Hd="tomask",gr="mask_blur",rr="mask_combine",kt="mask_resize_up",vr="mask_resize_down",nRe="img_paste",Ih="control_net_collect",vy="ip_adapter_collect",Mh="t2i_adapter_collect",vi="core_metadata",Jh="esrgan",rRe="scale_image",mr="sdxl_model_loader",ae="sdxl_denoise_latents",fu="sdxl_refiner_model_loader",by="sdxl_refiner_positive_conditioning",_y="sdxl_refiner_negative_conditioning",Wo="sdxl_refiner_denoise_latents",zi="refiner_inpaint_create_mask",In="seamless",Co="refiner_seamless",iRe=[le,xe,tl,xl,Nu,Jh,Zh,Us,_u,Ku,It,JMe,Gn,or,at,ts,eRe,Pt,tRe,nRe,rRe],PG="text_to_image_graph",D3="image_to_image_graph",kG="canvas_text_to_image_graph",L3="canvas_image_to_image_graph",_2="canvas_inpaint_graph",S2="canvas_outpaint_graph",EA="sdxl_text_to_image_graph",db="sxdl_image_to_image_graph",x2="sdxl_canvas_text_to_image_graph",Hg="sdxl_canvas_image_to_image_graph",Ll="sdxl_canvas_inpaint_graph",Fl="sdxl_canvas_outpaint_graph",ks=(e,t,n)=>{e.nodes[vi]={id:vi,type:"core_metadata",...t},e.edges.push({source:{node_id:vi,field:"metadata"},destination:{node_id:n,field:"metadata"}})},Lo=(e,t)=>{const n=e.nodes[vi];n&&Object.assign(n,t)},Rh=(e,t)=>{const n=e.nodes[vi];n&&delete n[t]},Oh=e=>!!e.nodes[vi],oRe=(e,t)=>{e.edges=e.edges.filter(n=>n.source.node_id!==vi),e.edges.push({source:{node_id:vi,field:"metadata"},destination:{node_id:t,field:"metadata"}})},no=(e,t,n)=>{const r=Iie(e.controlAdapters).filter(o=>{var a,s;return((a=o.model)==null?void 0:a.base_model)===((s=e.generation.model)==null?void 0:s.base_model)}),i=[];if(r.length){const o={id:Ih,type:"collect",is_intermediate:!0};t.nodes[Ih]=o,t.edges.push({source:{node_id:Ih,field:"collection"},destination:{node_id:n,field:"control"}}),$e in t.nodes&&t.edges.push({source:{node_id:Ih,field:"collection"},destination:{node_id:$e,field:"control"}}),r.forEach(a=>{if(!a.model)return;const{id:s,controlImage:l,processedControlImage:u,beginStepPct:c,endStepPct:d,controlMode:f,resizeMode:h,model:p,processorType:g,weight:_}=a,b={id:`control_net_${s}`,type:"controlnet",is_intermediate:!0,begin_step_percent:c,end_step_percent:d,control_mode:f,resize_mode:h,control_model:p,control_weight:_};if(u&&g!=="none")b.image={image_name:u};else if(l)b.image={image_name:l};else return;t.nodes[b.id]=b,i.push($f(b,["id","type","is_intermediate"])),t.edges.push({source:{node_id:b.id,field:"control"},destination:{node_id:Ih,field:"item"}})}),Lo(t,{controlnets:i})}},ro=(e,t,n)=>{const r=Rie(e.controlAdapters).filter(i=>{var o,a;return((o=i.model)==null?void 0:o.base_model)===((a=e.generation.model)==null?void 0:a.base_model)});if(r.length){const i={id:vy,type:"collect",is_intermediate:!0};t.nodes[vy]=i,t.edges.push({source:{node_id:vy,field:"collection"},destination:{node_id:n,field:"ip_adapter"}}),$e in t.nodes&&t.edges.push({source:{node_id:vy,field:"collection"},destination:{node_id:$e,field:"ip_adapter"}});const o=[];r.forEach(a=>{if(!a.model)return;const{id:s,weight:l,model:u,beginStepPct:c,endStepPct:d}=a,f={id:`ip_adapter_${s}`,type:"ip_adapter",is_intermediate:!0,weight:l,ip_adapter_model:u,begin_step_percent:c,end_step_percent:d};if(a.controlImage)f.image={image_name:a.controlImage};else return;t.nodes[f.id]=f,o.push($f(f,["id","type","is_intermediate"])),t.edges.push({source:{node_id:f.id,field:"ip_adapter"},destination:{node_id:i.id,field:"item"}})}),Lo(t,{ipAdapters:o})}},Gf=(e,t,n,r=Ro)=>{const{loras:i}=e.lora,o=r_(i);if(o===0)return;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===ct&&["clip"].includes(u.source.field)));let a="",s=0;const l=[];ps(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${AG}_${c.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:c,base_model:d},weight:f};l.push({lora:{model_name:c,base_model:d},weight:f}),t.nodes[h]=p,s===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:ct,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:a,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:a,field:"clip"},destination:{node_id:h,field:"clip"}})),s===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[_2,S2].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:$e,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:_e,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Ce,field:"clip"}})),a=h,s+=1}),Lo(t,{loras:l})},io=(e,t,n=xe)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:xl,type:"img_nsfw",is_intermediate:!0};t.nodes[xl]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:xl,field:"image"}})},aRe=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],TA=qn(e=>e,({ui:e})=>_E(e.activeTab)?e.activeTab:"txt2img"),DUe=qn(e=>e,({ui:e,config:t})=>{const r=aRe.filter(i=>!t.disabledTabs.includes(i)).indexOf(e.activeTab);return r===-1?0:r}),LUe=qn(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:SE}}),oo=(e,t)=>{const r=TA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,{autoAddBoardId:i}=e.gallery,o={id:Wu,type:"linear_ui_output",is_intermediate:r,use_cache:!1,board:i==="none"?void 0:{board_id:i}};t.nodes[Wu]=o;const a={node_id:Wu,field:"image"};Nu in t.nodes?t.edges.push({source:{node_id:Nu,field:"image"},destination:a}):xl in t.nodes?t.edges.push({source:{node_id:xl,field:"image"},destination:a}):le in t.nodes?t.edges.push({source:{node_id:le,field:"image"},destination:a}):tl in t.nodes?t.edges.push({source:{node_id:tl,field:"image"},destination:a}):xe in t.nodes&&t.edges.push({source:{node_id:xe,field:"image"},destination:a})},ao=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[In]={id:In,type:"seamless",seamless_x:r,seamless_y:i},r&&Lo(t,{seamless_x:r}),i&&Lo(t,{seamless_y:i});let o=ue;(t.id===EA||t.id===db||t.id===x2||t.id===Hg||t.id===Ll||t.id===Fl)&&(o=ae),t.edges=t.edges.filter(a=>!(a.source.node_id===n&&["unet"].includes(a.source.field))&&!(a.source.node_id===n&&["vae"].includes(a.source.field))),t.edges.push({source:{node_id:n,field:"unet"},destination:{node_id:In,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:In,field:"vae"}},{source:{node_id:In,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==_2||t.id===S2||t.id===Ll||t.id===Fl)&&t.edges.push({source:{node_id:In,field:"unet"},destination:{node_id:$e,field:"unet"}})},so=(e,t,n)=>{const r=$ie(e.controlAdapters).filter(i=>{var o,a;return((o=i.model)==null?void 0:o.base_model)===((a=e.generation.model)==null?void 0:a.base_model)});if(r.length){const i={id:Mh,type:"collect",is_intermediate:!0};t.nodes[Mh]=i,t.edges.push({source:{node_id:Mh,field:"collection"},destination:{node_id:n,field:"t2i_adapter"}}),$e in t.nodes&&t.edges.push({source:{node_id:Mh,field:"collection"},destination:{node_id:$e,field:"t2i_adapter"}});const o=[];r.forEach(a=>{if(!a.model)return;const{id:s,controlImage:l,processedControlImage:u,beginStepPct:c,endStepPct:d,resizeMode:f,model:h,processorType:p,weight:g}=a,_={id:`t2i_adapter_${s}`,type:"t2i_adapter",is_intermediate:!0,begin_step_percent:c,end_step_percent:d,resize_mode:f,t2i_adapter_model:h,weight:g};if(u&&p!=="none")_.image={image_name:u};else if(l)_.image={image_name:l};else return;t.nodes[_.id]=_,o.push($f(_,["id","type","is_intermediate"])),t.edges.push({source:{node_id:_.id,field:"t2i_adapter"},destination:{node_id:Mh,field:"item"}})}),Lo(t,{t2iAdapters:o})}},lo=(e,t,n=Ro)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:a}=e.sdxl,s=["auto","manual"].includes(o),l=!r;l||(t.nodes[fi]={type:"vae_loader",id:fi,is_intermediate:!0,vae_model:r});const u=n==b2;(t.id===PG||t.id===D3||t.id===EA||t.id===db)&&t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:xe,field:"vae"}}),(t.id===kG||t.id===L3||t.id===x2||t.id==Hg)&&t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:s?xe:le,field:"vae"}}),(t.id===D3||t.id===db||t.id===L3||t.id===Hg)&&t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:Bt,field:"vae"}}),(t.id===_2||t.id===S2||t.id===Ll||t.id===Fl)&&(t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:It,field:"vae"}},{source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:Pt,field:"vae"}},{source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:xe,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:et,field:"vae"}})),a&&(t.id===Ll||t.id===Fl)&&t.edges.push({source:{node_id:l?n:fi,field:l&&u?"vae_decoder":"vae"},destination:{node_id:zi,field:"vae"}}),r&&Lo(t,{vae:r})},uo=(e,t,n=xe)=>{const i=TA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],a=t.nodes[xl];if(!o)return;const s={id:Nu,type:"img_watermark",is_intermediate:i};t.nodes[Nu]=s,o.is_intermediate=!0,o.use_cache=!0,a?(a.is_intermediate=!0,t.edges.push({source:{node_id:xl,field:"image"},destination:{node_id:Nu,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Nu,field:"image"}})},sRe=(e,t)=>{const n=se("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,img2imgStrength:c,vaePrecision:d,clipSkip:f,shouldUseCpuNoise:h,seamlessXAxis:p,seamlessYAxis:g}=e.generation,{width:_,height:b}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:m}=e.canvas,v=d==="fp32",S=!0,w=["auto","manual"].includes(m);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let C=Ro;const x=h,P={id:L3,nodes:{[C]:{type:"main_model_loader",id:C,is_intermediate:S,model:o},[ct]:{type:"clip_skip",id:ct,is_intermediate:S,skipped_layers:f},[_e]:{type:"compel",id:_e,is_intermediate:S,prompt:r},[Ce]:{type:"compel",id:Ce,is_intermediate:S,prompt:i},[ve]:{type:"noise",id:ve,is_intermediate:S,use_cpu:x,seed:l,width:w?y.width:_,height:w?y.height:b},[Bt]:{type:"i2l",id:Bt,is_intermediate:S},[ue]:{type:"denoise_latents",id:ue,is_intermediate:S,cfg_scale:a,scheduler:s,steps:u,denoising_start:1-c,denoising_end:1},[le]:{type:"l2i",id:le,is_intermediate:S}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}},{source:{node_id:Bt,field:"latents"},destination:{node_id:ue,field:"latents"}}]};return w?(P.nodes[Ku]={id:Ku,type:"img_resize",is_intermediate:S,image:t,width:y.width,height:y.height},P.nodes[xe]={id:xe,type:"l2i",is_intermediate:S,fp32:v},P.nodes[le]={id:le,type:"img_resize",is_intermediate:S,width:_,height:b},P.edges.push({source:{node_id:Ku,field:"image"},destination:{node_id:Bt,field:"image"}},{source:{node_id:ue,field:"latents"},destination:{node_id:xe,field:"latents"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}})):(P.nodes[le]={type:"l2i",id:le,is_intermediate:S,fp32:v},P.nodes[Bt].image=t,P.edges.push({source:{node_id:ue,field:"latents"},destination:{node_id:le,field:"latents"}})),ks(P,{generation_mode:"img2img",cfg_scale:a,width:w?y.width:_,height:w?y.height:b,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:x?"cpu":"cuda",scheduler:s,clip_skip:f,strength:c,init_image:t.image_name},le),(p||g)&&(ao(e,P,C),C=In),Gf(e,P,ue),lo(e,P,C),no(e,P,ue),ro(e,P,ue),so(e,P,ue),e.system.shouldUseNSFWChecker&&io(e,P,le),e.system.shouldUseWatermarker&&uo(e,P,le),oo(e,P),P},lRe=(e,t,n)=>{const r=se("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:g,canvasCoherenceMode:_,canvasCoherenceSteps:b,canvasCoherenceStrength:y,clipSkip:m,seamlessXAxis:v,seamlessYAxis:S}=e.generation;if(!a)throw r.error("No Image found in state"),new Error("No Image found in state");const{width:w,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:x,boundingBoxScaleMethod:P}=e.canvas,E=!0,I=f==="fp32",N=["auto","manual"].includes(P);let M=Ro;const T=h,A={id:_2,nodes:{[M]:{type:"main_model_loader",id:M,is_intermediate:E,model:a},[ct]:{type:"clip_skip",id:ct,is_intermediate:E,skipped_layers:m},[_e]:{type:"compel",id:_e,is_intermediate:E,prompt:i},[Ce]:{type:"compel",id:Ce,is_intermediate:E,prompt:o},[gr]:{type:"img_blur",id:gr,is_intermediate:E,radius:p,blur_type:g},[It]:{type:"i2l",id:It,is_intermediate:E,fp32:I},[ve]:{type:"noise",id:ve,use_cpu:T,seed:d,is_intermediate:E},[Pt]:{type:"create_denoise_mask",id:Pt,is_intermediate:E,fp32:I},[ue]:{type:"denoise_latents",id:ue,is_intermediate:E,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[rt]:{type:"noise",id:rt,use_cpu:T,seed:d+1,is_intermediate:E},[Dl]:{type:"add",id:Dl,b:1,is_intermediate:E},[$e]:{type:"denoise_latents",id:$e,is_intermediate:E,steps:b,cfg_scale:s,scheduler:l,denoising_start:1-y,denoising_end:1},[xe]:{type:"l2i",id:xe,is_intermediate:E,fp32:I},[le]:{type:"color_correct",id:le,is_intermediate:E,reference:t}},edges:[{source:{node_id:M,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:M,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}},{source:{node_id:It,field:"latents"},destination:{node_id:ue,field:"latents"}},{source:{node_id:gr,field:"image"},destination:{node_id:Pt,field:"mask"}},{source:{node_id:Pt,field:"denoise_mask"},destination:{node_id:ue,field:"denoise_mask"}},{source:{node_id:M,field:"unet"},destination:{node_id:$e,field:"unet"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:$e,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:$e,field:"negative_conditioning"}},{source:{node_id:rt,field:"noise"},destination:{node_id:$e,field:"noise"}},{source:{node_id:ue,field:"latents"},destination:{node_id:$e,field:"latents"}},{source:{node_id:$e,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(N){const R=x.width,D=x.height;A.nodes[Gn]={type:"img_resize",id:Gn,is_intermediate:E,width:R,height:D,image:t},A.nodes[kt]={type:"img_resize",id:kt,is_intermediate:E,width:R,height:D,image:n},A.nodes[or]={type:"img_resize",id:or,is_intermediate:E,width:w,height:C},A.nodes[vr]={type:"img_resize",id:vr,is_intermediate:E,width:w,height:C},A.nodes[ve].width=R,A.nodes[ve].height=D,A.nodes[rt].width=R,A.nodes[rt].height=D,A.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:It,field:"image"}},{source:{node_id:kt,field:"image"},destination:{node_id:gr,field:"image"}},{source:{node_id:Gn,field:"image"},destination:{node_id:Pt,field:"image"}},{source:{node_id:xe,field:"image"},destination:{node_id:or,field:"image"}},{source:{node_id:or,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:gr,field:"image"},destination:{node_id:vr,field:"image"}},{source:{node_id:vr,field:"image"},destination:{node_id:le,field:"mask"}})}else A.nodes[ve].width=w,A.nodes[ve].height=C,A.nodes[rt].width=w,A.nodes[rt].height=C,A.nodes[It]={...A.nodes[It],image:t},A.nodes[gr]={...A.nodes[gr],image:n},A.nodes[Pt]={...A.nodes[Pt],image:t},A.edges.push({source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:gr,field:"image"},destination:{node_id:le,field:"mask"}});return _!=="unmasked"&&(A.nodes[et]={type:"create_denoise_mask",id:et,is_intermediate:E,fp32:I},N?A.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:et,field:"image"}}):A.nodes[et]={...A.nodes[et],image:t},_==="mask"&&(N?A.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:et,field:"mask"}}):A.nodes[et]={...A.nodes[et],mask:n}),_==="edge"&&(A.nodes[ln]={type:"mask_edge",id:ln,is_intermediate:E,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},N?A.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:ln,field:"image"}}):A.nodes[ln]={...A.nodes[ln],image:n},A.edges.push({source:{node_id:ln,field:"image"},destination:{node_id:et,field:"mask"}})),A.edges.push({source:{node_id:et,field:"denoise_mask"},destination:{node_id:$e,field:"denoise_mask"}})),(v||S)&&(ao(e,A,M),M=In),lo(e,A,M),Gf(e,A,ue,M),no(e,A,ue),ro(e,A,ue),so(e,A,ue),e.system.shouldUseNSFWChecker&&io(e,A,le),e.system.shouldUseWatermarker&&uo(e,A,le),oo(e,A),A},uRe=(e,t,n)=>{const r=se("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:g,canvasCoherenceSteps:_,canvasCoherenceStrength:b,infillTileSize:y,infillPatchmatchDownscaleSize:m,infillMethod:v,clipSkip:S,seamlessXAxis:w,seamlessYAxis:C}=e.generation;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:P}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:E,boundingBoxScaleMethod:I}=e.canvas,N=f==="fp32",M=!0,T=["auto","manual"].includes(I);let A=Ro;const R=h,D={id:S2,nodes:{[A]:{type:"main_model_loader",id:A,is_intermediate:M,model:a},[ct]:{type:"clip_skip",id:ct,is_intermediate:M,skipped_layers:S},[_e]:{type:"compel",id:_e,is_intermediate:M,prompt:i},[Ce]:{type:"compel",id:Ce,is_intermediate:M,prompt:o},[Hd]:{type:"tomask",id:Hd,is_intermediate:M,image:t},[rr]:{type:"mask_combine",id:rr,is_intermediate:M,mask2:n},[It]:{type:"i2l",id:It,is_intermediate:M,fp32:N},[ve]:{type:"noise",id:ve,use_cpu:R,seed:d,is_intermediate:M},[Pt]:{type:"create_denoise_mask",id:Pt,is_intermediate:M,fp32:N},[ue]:{type:"denoise_latents",id:ue,is_intermediate:M,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[rt]:{type:"noise",id:rt,use_cpu:R,seed:d+1,is_intermediate:M},[Dl]:{type:"add",id:Dl,b:1,is_intermediate:M},[$e]:{type:"denoise_latents",id:$e,is_intermediate:M,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[xe]:{type:"l2i",id:xe,is_intermediate:M,fp32:N},[le]:{type:"color_correct",id:le,is_intermediate:M}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:at,field:"image"},destination:{node_id:It,field:"image"}},{source:{node_id:Hd,field:"image"},destination:{node_id:rr,field:"mask1"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}},{source:{node_id:It,field:"latents"},destination:{node_id:ue,field:"latents"}},{source:{node_id:T?kt:rr,field:"image"},destination:{node_id:Pt,field:"mask"}},{source:{node_id:Pt,field:"denoise_mask"},destination:{node_id:ue,field:"denoise_mask"}},{source:{node_id:A,field:"unet"},destination:{node_id:$e,field:"unet"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:$e,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:$e,field:"negative_conditioning"}},{source:{node_id:rt,field:"noise"},destination:{node_id:$e,field:"noise"}},{source:{node_id:ue,field:"latents"},destination:{node_id:$e,field:"latents"}},{source:{node_id:at,field:"image"},destination:{node_id:Pt,field:"image"}},{source:{node_id:$e,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(v==="patchmatch"&&(D.nodes[at]={type:"infill_patchmatch",id:at,is_intermediate:M,downscale:m}),v==="lama"&&(D.nodes[at]={type:"infill_lama",id:at,is_intermediate:M}),v==="cv2"&&(D.nodes[at]={type:"infill_cv2",id:at,is_intermediate:M}),v==="tile"&&(D.nodes[at]={type:"infill_tile",id:at,is_intermediate:M,tile_size:y}),T){const $=E.width,L=E.height;D.nodes[Gn]={type:"img_resize",id:Gn,is_intermediate:M,width:$,height:L,image:t},D.nodes[kt]={type:"img_resize",id:kt,is_intermediate:M,width:$,height:L},D.nodes[or]={type:"img_resize",id:or,is_intermediate:M,width:x,height:P},D.nodes[ts]={type:"img_resize",id:ts,is_intermediate:M,width:x,height:P},D.nodes[vr]={type:"img_resize",id:vr,is_intermediate:M,width:x,height:P},D.nodes[ve].width=$,D.nodes[ve].height=L,D.nodes[rt].width=$,D.nodes[rt].height=L,D.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:at,field:"image"}},{source:{node_id:rr,field:"image"},destination:{node_id:kt,field:"image"}},{source:{node_id:xe,field:"image"},destination:{node_id:or,field:"image"}},{source:{node_id:kt,field:"image"},destination:{node_id:vr,field:"image"}},{source:{node_id:at,field:"image"},destination:{node_id:ts,field:"image"}},{source:{node_id:ts,field:"image"},destination:{node_id:le,field:"reference"}},{source:{node_id:or,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:vr,field:"image"},destination:{node_id:le,field:"mask"}})}else D.nodes[at]={...D.nodes[at],image:t},D.nodes[ve].width=x,D.nodes[ve].height=P,D.nodes[rt].width=x,D.nodes[rt].height=P,D.nodes[It]={...D.nodes[It],image:t},D.edges.push({source:{node_id:at,field:"image"},destination:{node_id:le,field:"reference"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:rr,field:"image"},destination:{node_id:le,field:"mask"}});return g!=="unmasked"&&(D.nodes[et]={type:"create_denoise_mask",id:et,is_intermediate:M,fp32:N},D.edges.push({source:{node_id:at,field:"image"},destination:{node_id:et,field:"image"}}),g==="mask"&&(T?D.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:et,field:"mask"}}):D.edges.push({source:{node_id:rr,field:"image"},destination:{node_id:et,field:"mask"}})),g==="edge"&&(D.nodes[ln]={type:"mask_edge",id:ln,is_intermediate:M,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},T?D.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:ln,field:"image"}}):D.edges.push({source:{node_id:rr,field:"image"},destination:{node_id:ln,field:"image"}}),D.edges.push({source:{node_id:ln,field:"image"},destination:{node_id:et,field:"mask"}})),D.edges.push({source:{node_id:et,field:"denoise_mask"},destination:{node_id:$e,field:"denoise_mask"}})),(w||C)&&(ao(e,D,A),A=In),lo(e,D,A),Gf(e,D,ue,A),no(e,D,ue),ro(e,D,ue),so(e,D,ue),e.system.shouldUseNSFWChecker&&io(e,D,le),e.system.shouldUseWatermarker&&uo(e,D,le),oo(e,D),D},Hf=(e,t,n,r=mr)=>{const{loras:i}=e.lora,o=r_(i);if(o===0)return;const a=[],s=r;let l=r;[In,zi].includes(r)&&(l=mr),t.edges=t.edges.filter(d=>!(d.source.node_id===s&&["unet"].includes(d.source.field))&&!(d.source.node_id===l&&["clip"].includes(d.source.field))&&!(d.source.node_id===l&&["clip2"].includes(d.source.field)));let u="",c=0;ps(i,d=>{const{model_name:f,base_model:h,weight:p}=d,g=`${AG}_${f.replace(".","_")}`,_={type:"sdxl_lora_loader",id:g,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};a.push(qF.parse({lora:{model_name:f,base_model:h},weight:p})),t.nodes[g]=_,c===0?(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:l,field:"clip"},destination:{node_id:g,field:"clip"}}),t.edges.push({source:{node_id:l,field:"clip2"},destination:{node_id:g,field:"clip2"}})):(t.edges.push({source:{node_id:u,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:u,field:"clip"},destination:{node_id:g,field:"clip"}}),t.edges.push({source:{node_id:u,field:"clip2"},destination:{node_id:g,field:"clip2"}})),c===o-1&&(t.edges.push({source:{node_id:g,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[Ll,Fl].includes(t.id)&&t.edges.push({source:{node_id:g,field:"unet"},destination:{node_id:$e,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:Ce,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:Ce,field:"clip2"}})),u=g,c+=1}),Lo(t,{loras:a})},wc=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:a}=e.sdxl,s=a||t?[n,i].join(" "):i,l=a||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:s,joinedNegativeStylePrompt:l}},qf=(e,t,n,r,i,o)=>{const{refinerModel:a,refinerPositiveAestheticScore:s,refinerNegativeAestheticScore:l,refinerSteps:u,refinerScheduler:c,refinerCFGScale:d,refinerStart:f}=e.sdxl,{seamlessXAxis:h,seamlessYAxis:p,vaePrecision:g}=e.generation,{boundingBoxScaleMethod:_}=e.canvas,b=g==="fp32",y=["auto","manual"].includes(_);if(!a)return;Lo(t,{refiner_model:a,refiner_positive_aesthetic_score:s,refiner_negative_aesthetic_score:l,refiner_cfg_scale:d,refiner_scheduler:c,refiner_start:f,refiner_steps:u});const m=r||mr,{joinedPositiveStylePrompt:v,joinedNegativeStylePrompt:S}=wc(e,!0);t.edges=t.edges.filter(w=>!(w.source.node_id===n&&["latents"].includes(w.source.field))),t.edges=t.edges.filter(w=>!(w.source.node_id===m&&["vae"].includes(w.source.field))),t.nodes[fu]={type:"sdxl_refiner_model_loader",id:fu,model:a},t.nodes[by]={type:"sdxl_refiner_compel_prompt",id:by,style:v,aesthetic_score:s},t.nodes[_y]={type:"sdxl_refiner_compel_prompt",id:_y,style:S,aesthetic_score:l},t.nodes[Wo]={type:"denoise_latents",id:Wo,cfg_scale:d,steps:u,scheduler:c,denoising_start:f,denoising_end:1},h||p?(t.nodes[Co]={id:Co,type:"seamless",seamless_x:h,seamless_y:p},t.edges.push({source:{node_id:fu,field:"unet"},destination:{node_id:Co,field:"unet"}},{source:{node_id:fu,field:"vae"},destination:{node_id:Co,field:"vae"}},{source:{node_id:Co,field:"unet"},destination:{node_id:Wo,field:"unet"}})):t.edges.push({source:{node_id:fu,field:"unet"},destination:{node_id:Wo,field:"unet"}}),t.edges.push({source:{node_id:fu,field:"clip2"},destination:{node_id:by,field:"clip2"}},{source:{node_id:fu,field:"clip2"},destination:{node_id:_y,field:"clip2"}},{source:{node_id:by,field:"conditioning"},destination:{node_id:Wo,field:"positive_conditioning"}},{source:{node_id:_y,field:"conditioning"},destination:{node_id:Wo,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:Wo,field:"latents"}}),(t.id===Ll||t.id===Fl)&&(t.nodes[zi]={type:"create_denoise_mask",id:zi,is_intermediate:!0,fp32:b},y?t.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:zi,field:"image"}}):t.nodes[zi]={...t.nodes[zi],image:i},t.id===Ll&&(y?t.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:zi,field:"mask"}}):t.nodes[zi]={...t.nodes[zi],mask:o}),t.id===Fl&&t.edges.push({source:{node_id:y?kt:rr,field:"image"},destination:{node_id:zi,field:"mask"}}),t.edges.push({source:{node_id:zi,field:"denoise_mask"},destination:{node_id:Wo,field:"denoise_mask"}})),t.id===x2||t.id===Hg?t.edges.push({source:{node_id:Wo,field:"latents"},destination:{node_id:y?xe:le,field:"latents"}}):t.edges.push({source:{node_id:Wo,field:"latents"},destination:{node_id:xe,field:"latents"}})},cRe=(e,t)=>{const n=se("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,vaePrecision:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{shouldUseSDXLRefiner:p,refinerStart:g,sdxlImg2ImgDenoisingStrength:_}=e.sdxl,{width:b,height:y}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:m,boundingBoxScaleMethod:v}=e.canvas,S=c==="fp32",w=!0,C=["auto","manual"].includes(v);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=mr;const P=d,{joinedPositiveStylePrompt:E,joinedNegativeStylePrompt:I}=wc(e),N={id:Hg,nodes:{[x]:{type:"sdxl_model_loader",id:x,model:o},[_e]:{type:"sdxl_compel_prompt",id:_e,prompt:r,style:E},[Ce]:{type:"sdxl_compel_prompt",id:Ce,prompt:i,style:I},[ve]:{type:"noise",id:ve,is_intermediate:w,use_cpu:P,seed:l,width:C?m.width:b,height:C?m.height:y},[Bt]:{type:"i2l",id:Bt,is_intermediate:w,fp32:S},[ae]:{type:"denoise_latents",id:ae,is_intermediate:w,cfg_scale:a,scheduler:s,steps:u,denoising_start:p?Math.min(g,1-_):1-_,denoising_end:p?g:1}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:x,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}},{source:{node_id:Bt,field:"latents"},destination:{node_id:ae,field:"latents"}}]};return C?(N.nodes[Ku]={id:Ku,type:"img_resize",is_intermediate:w,image:t,width:m.width,height:m.height},N.nodes[xe]={id:xe,type:"l2i",is_intermediate:w,fp32:S},N.nodes[le]={id:le,type:"img_resize",is_intermediate:w,width:b,height:y},N.edges.push({source:{node_id:Ku,field:"image"},destination:{node_id:Bt,field:"image"}},{source:{node_id:ae,field:"latents"},destination:{node_id:xe,field:"latents"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}})):(N.nodes[le]={type:"l2i",id:le,is_intermediate:w,fp32:S},N.nodes[Bt].image=t,N.edges.push({source:{node_id:ae,field:"latents"},destination:{node_id:le,field:"latents"}})),ks(N,{generation_mode:"img2img",cfg_scale:a,width:C?m.width:b,height:C?m.height:y,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:P?"cpu":"cuda",scheduler:s,strength:_,init_image:t.image_name},le),(f||h)&&(ao(e,N,x),x=In),p&&(qf(e,N,ae,x),(f||h)&&(x=Co)),lo(e,N,x),Hf(e,N,ae,x),no(e,N,ae),ro(e,N,ae),so(e,N,ae),e.system.shouldUseNSFWChecker&&io(e,N,le),e.system.shouldUseWatermarker&&uo(e,N,le),oo(e,N),N},dRe=(e,t,n)=>{const r=se("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:g,canvasCoherenceSteps:_,canvasCoherenceStrength:b,seamlessXAxis:y,seamlessYAxis:m}=e.generation,{sdxlImg2ImgDenoisingStrength:v,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:E}=e.canvas,I=d==="fp32",N=!0,M=["auto","manual"].includes(E);let T=mr;const A=f,{joinedPositiveStylePrompt:R,joinedNegativeStylePrompt:D}=wc(e),$={id:Ll,nodes:{[T]:{type:"sdxl_model_loader",id:T,model:a},[_e]:{type:"sdxl_compel_prompt",id:_e,prompt:i,style:R},[Ce]:{type:"sdxl_compel_prompt",id:Ce,prompt:o,style:D},[gr]:{type:"img_blur",id:gr,is_intermediate:N,radius:h,blur_type:p},[It]:{type:"i2l",id:It,is_intermediate:N,fp32:I},[ve]:{type:"noise",id:ve,use_cpu:A,seed:c,is_intermediate:N},[Pt]:{type:"create_denoise_mask",id:Pt,is_intermediate:N,fp32:I},[ae]:{type:"denoise_latents",id:ae,is_intermediate:N,steps:u,cfg_scale:s,scheduler:l,denoising_start:S?Math.min(w,1-v):1-v,denoising_end:S?w:1},[rt]:{type:"noise",id:rt,use_cpu:A,seed:c+1,is_intermediate:N},[Dl]:{type:"add",id:Dl,b:1,is_intermediate:N},[$e]:{type:"denoise_latents",id:$e,is_intermediate:N,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[xe]:{type:"l2i",id:xe,is_intermediate:N,fp32:I},[le]:{type:"color_correct",id:le,is_intermediate:N,reference:t}},edges:[{source:{node_id:T,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:T,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:T,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}},{source:{node_id:It,field:"latents"},destination:{node_id:ae,field:"latents"}},{source:{node_id:gr,field:"image"},destination:{node_id:Pt,field:"mask"}},{source:{node_id:Pt,field:"denoise_mask"},destination:{node_id:ae,field:"denoise_mask"}},{source:{node_id:T,field:"unet"},destination:{node_id:$e,field:"unet"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:$e,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:$e,field:"negative_conditioning"}},{source:{node_id:rt,field:"noise"},destination:{node_id:$e,field:"noise"}},{source:{node_id:ae,field:"latents"},destination:{node_id:$e,field:"latents"}},{source:{node_id:$e,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(M){const L=P.width,O=P.height;$.nodes[Gn]={type:"img_resize",id:Gn,is_intermediate:N,width:L,height:O,image:t},$.nodes[kt]={type:"img_resize",id:kt,is_intermediate:N,width:L,height:O,image:n},$.nodes[or]={type:"img_resize",id:or,is_intermediate:N,width:C,height:x},$.nodes[vr]={type:"img_resize",id:vr,is_intermediate:N,width:C,height:x},$.nodes[ve].width=L,$.nodes[ve].height=O,$.nodes[rt].width=L,$.nodes[rt].height=O,$.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:It,field:"image"}},{source:{node_id:kt,field:"image"},destination:{node_id:gr,field:"image"}},{source:{node_id:Gn,field:"image"},destination:{node_id:Pt,field:"image"}},{source:{node_id:xe,field:"image"},destination:{node_id:or,field:"image"}},{source:{node_id:or,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:gr,field:"image"},destination:{node_id:vr,field:"image"}},{source:{node_id:vr,field:"image"},destination:{node_id:le,field:"mask"}})}else $.nodes[ve].width=C,$.nodes[ve].height=x,$.nodes[rt].width=C,$.nodes[rt].height=x,$.nodes[It]={...$.nodes[It],image:t},$.nodes[gr]={...$.nodes[gr],image:n},$.nodes[Pt]={...$.nodes[Pt],image:t},$.edges.push({source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:gr,field:"image"},destination:{node_id:le,field:"mask"}});return g!=="unmasked"&&($.nodes[et]={type:"create_denoise_mask",id:et,is_intermediate:N,fp32:I},M?$.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:et,field:"image"}}):$.nodes[et]={...$.nodes[et],image:t},g==="mask"&&(M?$.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:et,field:"mask"}}):$.nodes[et]={...$.nodes[et],mask:n}),g==="edge"&&($.nodes[ln]={type:"mask_edge",id:ln,is_intermediate:N,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},M?$.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:ln,field:"image"}}):$.nodes[ln]={...$.nodes[ln],image:n},$.edges.push({source:{node_id:ln,field:"image"},destination:{node_id:et,field:"mask"}})),$.edges.push({source:{node_id:et,field:"denoise_mask"},destination:{node_id:$e,field:"denoise_mask"}})),(y||m)&&(ao(e,$,T),T=In),S&&(qf(e,$,$e,T,t,n),(y||m)&&(T=Co)),lo(e,$,T),Hf(e,$,ae,T),no(e,$,ae),ro(e,$,ae),so(e,$,ae),e.system.shouldUseNSFWChecker&&io(e,$,le),e.system.shouldUseWatermarker&&uo(e,$,le),oo(e,$),$},fRe=(e,t,n)=>{const r=se("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:g,canvasCoherenceStrength:_,infillTileSize:b,infillPatchmatchDownscaleSize:y,infillMethod:m,seamlessXAxis:v,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:C,refinerStart:x}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:P,height:E}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:I,boundingBoxScaleMethod:N}=e.canvas,M=d==="fp32",T=!0,A=["auto","manual"].includes(N);let R=mr;const D=f,{joinedPositiveStylePrompt:$,joinedNegativeStylePrompt:L}=wc(e),O={id:Fl,nodes:{[mr]:{type:"sdxl_model_loader",id:mr,model:a},[_e]:{type:"sdxl_compel_prompt",id:_e,prompt:i,style:$},[Ce]:{type:"sdxl_compel_prompt",id:Ce,prompt:o,style:L},[Hd]:{type:"tomask",id:Hd,is_intermediate:T,image:t},[rr]:{type:"mask_combine",id:rr,is_intermediate:T,mask2:n},[It]:{type:"i2l",id:It,is_intermediate:T,fp32:M},[ve]:{type:"noise",id:ve,use_cpu:D,seed:c,is_intermediate:T},[Pt]:{type:"create_denoise_mask",id:Pt,is_intermediate:T,fp32:M},[ae]:{type:"denoise_latents",id:ae,is_intermediate:T,steps:u,cfg_scale:s,scheduler:l,denoising_start:C?Math.min(x,1-w):1-w,denoising_end:C?x:1},[rt]:{type:"noise",id:rt,use_cpu:D,seed:c+1,is_intermediate:T},[Dl]:{type:"add",id:Dl,b:1,is_intermediate:T},[$e]:{type:"denoise_latents",id:$e,is_intermediate:T,steps:g,cfg_scale:s,scheduler:l,denoising_start:1-_,denoising_end:1},[xe]:{type:"l2i",id:xe,is_intermediate:T,fp32:M},[le]:{type:"color_correct",id:le,is_intermediate:T}},edges:[{source:{node_id:mr,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:mr,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:mr,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:mr,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:mr,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:at,field:"image"},destination:{node_id:It,field:"image"}},{source:{node_id:Hd,field:"image"},destination:{node_id:rr,field:"mask1"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}},{source:{node_id:It,field:"latents"},destination:{node_id:ae,field:"latents"}},{source:{node_id:A?kt:rr,field:"image"},destination:{node_id:Pt,field:"mask"}},{source:{node_id:Pt,field:"denoise_mask"},destination:{node_id:ae,field:"denoise_mask"}},{source:{node_id:R,field:"unet"},destination:{node_id:$e,field:"unet"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:$e,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:$e,field:"negative_conditioning"}},{source:{node_id:rt,field:"noise"},destination:{node_id:$e,field:"noise"}},{source:{node_id:ae,field:"latents"},destination:{node_id:$e,field:"latents"}},{source:{node_id:at,field:"image"},destination:{node_id:Pt,field:"image"}},{source:{node_id:$e,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(m==="patchmatch"&&(O.nodes[at]={type:"infill_patchmatch",id:at,is_intermediate:T,downscale:y}),m==="lama"&&(O.nodes[at]={type:"infill_lama",id:at,is_intermediate:T}),m==="cv2"&&(O.nodes[at]={type:"infill_cv2",id:at,is_intermediate:T}),m==="tile"&&(O.nodes[at]={type:"infill_tile",id:at,is_intermediate:T,tile_size:b}),A){const B=I.width,U=I.height;O.nodes[Gn]={type:"img_resize",id:Gn,is_intermediate:T,width:B,height:U,image:t},O.nodes[kt]={type:"img_resize",id:kt,is_intermediate:T,width:B,height:U},O.nodes[or]={type:"img_resize",id:or,is_intermediate:T,width:P,height:E},O.nodes[ts]={type:"img_resize",id:ts,is_intermediate:T,width:P,height:E},O.nodes[vr]={type:"img_resize",id:vr,is_intermediate:T,width:P,height:E},O.nodes[ve].width=B,O.nodes[ve].height=U,O.nodes[rt].width=B,O.nodes[rt].height=U,O.edges.push({source:{node_id:Gn,field:"image"},destination:{node_id:at,field:"image"}},{source:{node_id:rr,field:"image"},destination:{node_id:kt,field:"image"}},{source:{node_id:xe,field:"image"},destination:{node_id:or,field:"image"}},{source:{node_id:kt,field:"image"},destination:{node_id:vr,field:"image"}},{source:{node_id:at,field:"image"},destination:{node_id:ts,field:"image"}},{source:{node_id:ts,field:"image"},destination:{node_id:le,field:"reference"}},{source:{node_id:or,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:vr,field:"image"},destination:{node_id:le,field:"mask"}})}else O.nodes[at]={...O.nodes[at],image:t},O.nodes[ve].width=P,O.nodes[ve].height=E,O.nodes[rt].width=P,O.nodes[rt].height=E,O.nodes[It]={...O.nodes[It],image:t},O.edges.push({source:{node_id:at,field:"image"},destination:{node_id:le,field:"reference"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}},{source:{node_id:rr,field:"image"},destination:{node_id:le,field:"mask"}});return p!=="unmasked"&&(O.nodes[et]={type:"create_denoise_mask",id:et,is_intermediate:T,fp32:M},O.edges.push({source:{node_id:at,field:"image"},destination:{node_id:et,field:"image"}}),p==="mask"&&(A?O.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:et,field:"mask"}}):O.edges.push({source:{node_id:rr,field:"image"},destination:{node_id:et,field:"mask"}})),p==="edge"&&(O.nodes[ln]={type:"mask_edge",id:ln,is_intermediate:T,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},A?O.edges.push({source:{node_id:kt,field:"image"},destination:{node_id:ln,field:"image"}}):O.edges.push({source:{node_id:rr,field:"image"},destination:{node_id:ln,field:"image"}}),O.edges.push({source:{node_id:ln,field:"image"},destination:{node_id:et,field:"mask"}})),O.edges.push({source:{node_id:et,field:"denoise_mask"},destination:{node_id:$e,field:"denoise_mask"}})),(v||S)&&(ao(e,O,R),R=In),C&&(qf(e,O,$e,R,t),(v||S)&&(R=Co)),lo(e,O,R),Hf(e,O,ae,R),no(e,O,ae),ro(e,O,ae),so(e,O,ae),e.system.shouldUseNSFWChecker&&io(e,O,le),e.system.shouldUseWatermarker&&uo(e,O,le),oo(e,O),O},hRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,shouldUseCpuNoise:c,seamlessXAxis:d,seamlessYAxis:f}=e.generation,{width:h,height:p}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:g,boundingBoxScaleMethod:_}=e.canvas,b=u==="fp32",y=!0,m=["auto","manual"].includes(_),{shouldUseSDXLRefiner:v,refinerStart:S}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=c,C=i.model_type==="onnx";let x=C?b2:mr;const P=C?"onnx_model_loader":"sdxl_model_loader",E=C?{type:"t2l_onnx",id:ae,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:ae,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:v?S:1},{joinedPositiveStylePrompt:I,joinedNegativeStylePrompt:N}=wc(e),M={id:x2,nodes:{[x]:{type:P,id:x,is_intermediate:y,model:i},[_e]:{type:C?"prompt_onnx":"sdxl_compel_prompt",id:_e,is_intermediate:y,prompt:n,style:I},[Ce]:{type:C?"prompt_onnx":"sdxl_compel_prompt",id:Ce,is_intermediate:y,prompt:r,style:N},[ve]:{type:"noise",id:ve,is_intermediate:y,seed:s,width:m?g.width:h,height:m?g.height:p,use_cpu:w},[E.id]:E},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:x,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}}]};return m?(M.nodes[xe]={id:xe,type:C?"l2i_onnx":"l2i",is_intermediate:y,fp32:b},M.nodes[le]={id:le,type:"img_resize",is_intermediate:y,width:h,height:p},M.edges.push({source:{node_id:ae,field:"latents"},destination:{node_id:xe,field:"latents"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}})):(M.nodes[le]={type:C?"l2i_onnx":"l2i",id:le,is_intermediate:y,fp32:b},M.edges.push({source:{node_id:ae,field:"latents"},destination:{node_id:le,field:"latents"}})),ks(M,{generation_mode:"txt2img",cfg_scale:o,width:m?g.width:h,height:m?g.height:p,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a},le),(d||f)&&(ao(e,M,x),x=In),v&&(qf(e,M,ae,x),(d||f)&&(x=Co)),Hf(e,M,ae,x),lo(e,M,x),no(e,M,ae),ro(e,M,ae),so(e,M,ae),e.system.shouldUseNSFWChecker&&io(e,M,le),e.system.shouldUseWatermarker&&uo(e,M,le),oo(e,M),M},pRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:g}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:_,boundingBoxScaleMethod:b}=e.canvas,y=u==="fp32",m=!0,v=["auto","manual"].includes(b);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d,w=i.model_type==="onnx";let C=w?b2:Ro;const x=w?"onnx_model_loader":"main_model_loader",P=w?{type:"t2l_onnx",id:ue,is_intermediate:m,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:ue,is_intermediate:m,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:1},E={id:kG,nodes:{[C]:{type:x,id:C,is_intermediate:m,model:i},[ct]:{type:"clip_skip",id:ct,is_intermediate:m,skipped_layers:c},[_e]:{type:w?"prompt_onnx":"compel",id:_e,is_intermediate:m,prompt:n},[Ce]:{type:w?"prompt_onnx":"compel",id:Ce,is_intermediate:m,prompt:r},[ve]:{type:"noise",id:ve,is_intermediate:m,seed:s,width:v?_.width:p,height:v?_.height:g,use_cpu:S},[P.id]:P},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}}]};return v?(E.nodes[xe]={id:xe,type:w?"l2i_onnx":"l2i",is_intermediate:m,fp32:y},E.nodes[le]={id:le,type:"img_resize",is_intermediate:m,width:p,height:g},E.edges.push({source:{node_id:ue,field:"latents"},destination:{node_id:xe,field:"latents"}},{source:{node_id:xe,field:"image"},destination:{node_id:le,field:"image"}})):(E.nodes[le]={type:w?"l2i_onnx":"l2i",id:le,is_intermediate:m,fp32:y},E.edges.push({source:{node_id:ue,field:"latents"},destination:{node_id:le,field:"latents"}})),ks(E,{generation_mode:"txt2img",cfg_scale:o,width:v?_.width:p,height:v?_.height:g,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:S?"cpu":"cuda",scheduler:a,clip_skip:c},le),(f||h)&&(ao(e,E,C),C=In),lo(e,E,C),Gf(e,E,ue,C),no(e,E,ue),ro(e,E,ue),so(e,E,ue),e.system.shouldUseNSFWChecker&&io(e,E,le),e.system.shouldUseWatermarker&&uo(e,E,le),oo(e,E),E},gRe=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=hRe(e):i=pRe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=cRe(e,n):i=sRe(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=dRe(e,n,r):i=lRe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=fRe(e,n,r):i=uRe(e,n,r)}return i},Yw=({count:e,start:t,min:n=Hie,max:r=hp})=>{const i=t??Ire(n,r),o=[];for(let a=i;a<i+e;a++)o.push(a%r);return o},IG=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:a}=e.generation,{shouldConcatSDXLStylePrompt:s,positiveStylePrompt:l}=e.sdxl,{prompts:u,seedBehaviour:c}=e.dynamicPrompts,d=[];if(u.length===1){const h=Yw({count:r,start:o?void 0:a}),p=[];t.nodes[ve]&&p.push({node_path:ve,field_name:"seed",items:h}),Oh(t)&&(Rh(t,"seed"),p.push({node_path:vi,field_name:"seed",items:h})),t.nodes[rt]&&p.push({node_path:rt,field_name:"seed",items:h.map(g=>(g+1)%hp)}),d.push(p)}else{const h=[],p=[];if(c==="PER_PROMPT"){const _=Yw({count:u.length*r,start:o?void 0:a});t.nodes[ve]&&h.push({node_path:ve,field_name:"seed",items:_}),Oh(t)&&(Rh(t,"seed"),h.push({node_path:vi,field_name:"seed",items:_})),t.nodes[rt]&&h.push({node_path:rt,field_name:"seed",items:_.map(b=>(b+1)%hp)})}else{const _=Yw({count:r,start:o?void 0:a});t.nodes[ve]&&p.push({node_path:ve,field_name:"seed",items:_}),Oh(t)&&(Rh(t,"seed"),p.push({node_path:vi,field_name:"seed",items:_})),t.nodes[rt]&&p.push({node_path:rt,field_name:"seed",items:_.map(b=>(b+1)%hp)}),d.push(p)}const g=c==="PER_PROMPT"?Dre(r).flatMap(()=>u):u;if(t.nodes[_e]&&h.push({node_path:_e,field_name:"prompt",items:g}),Oh(t)&&(Rh(t,"positive_prompt"),h.push({node_path:vi,field_name:"positive_prompt",items:g})),s&&(i==null?void 0:i.base_model)==="sdxl"){const _=g.map(b=>[b,l].join(" "));t.nodes[_e]&&h.push({node_path:_e,field_name:"style",items:_}),Oh(t)&&(Rh(t,"positive_style_prompt"),h.push({node_path:vi,field_name:"positive_style_prompt",items:g}))}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},mRe=()=>{pe({predicate:e=>CA.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=se("queue"),{prepend:i}=e.payload,o=t(),{layerState:a,boundingBoxCoordinates:s,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await wA(a,s,l,u,c);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:g}=d,_=ZMe(h,g);if(o.system.enableImageDebugging){const S=await xR(f),w=await xR(p);XMe([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${_}`);let b,y;["img2img","inpaint","outpaint"].includes(_)&&(b=await n(ce.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(_)&&(y=await n(ce.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const m=gRe(o,_,b,y);r.debug({graph:pt(m)},"Canvas graph built"),n(Yz(m));const v=IG(o,m,i);try{const S=n(un.endpoints.enqueueBatch.initiate(v,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset();const C=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(Rle({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(Ole(C))}catch{}}})},yRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,img2imgStrength:c,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:p,shouldUseCpuNoise:g,vaePrecision:_,seamlessXAxis:b,seamlessYAxis:y}=e.generation;if(!u)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 m=_==="fp32",v=!0;let S=Ro;const w=g,C={id:D3,nodes:{[S]:{type:"main_model_loader",id:S,model:i,is_intermediate:v},[ct]:{type:"clip_skip",id:ct,skipped_layers:p,is_intermediate:v},[_e]:{type:"compel",id:_e,prompt:n,is_intermediate:v},[Ce]:{type:"compel",id:Ce,prompt:r,is_intermediate:v},[ve]:{type:"noise",id:ve,use_cpu:w,seed:s,is_intermediate:v},[xe]:{type:"l2i",id:xe,fp32:m,is_intermediate:v},[ue]:{type:"denoise_latents",id:ue,cfg_scale:o,scheduler:a,steps:l,denoising_start:1-c,denoising_end:1,is_intermediate:v},[Bt]:{type:"i2l",id:Bt,fp32:m,is_intermediate:v}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}},{source:{node_id:Bt,field:"latents"},destination:{node_id:ue,field:"latents"}},{source:{node_id:ue,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const x={id:aa,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};C.nodes[aa]=x,C.edges.push({source:{node_id:aa,field:"image"},destination:{node_id:Bt,field:"image"}}),C.edges.push({source:{node_id:aa,field:"width"},destination:{node_id:ve,field:"width"}}),C.edges.push({source:{node_id:aa,field:"height"},destination:{node_id:ve,field:"height"}})}else C.nodes[Bt].image={image_name:u.imageName},C.edges.push({source:{node_id:Bt,field:"width"},destination:{node_id:ve,field:"width"}}),C.edges.push({source:{node_id:Bt,field:"height"},destination:{node_id:ve,field:"height"}});return ks(C,{generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,clip_skip:p,strength:c,init_image:u.imageName},xe),(b||y)&&(ao(e,C,S),S=In),lo(e,C,S),Gf(e,C,ue,S),no(e,C,ue),ro(e,C,ue),so(e,C,ue),e.system.shouldUseNSFWChecker&&io(e,C),e.system.shouldUseWatermarker&&uo(e,C),oo(e,C),C},vRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,shouldFitToWidthHeight:c,width:d,height:f,shouldUseCpuNoise:h,vaePrecision:p,seamlessXAxis:g,seamlessYAxis:_}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:y,shouldUseSDXLRefiner:m,refinerStart:v,sdxlImg2ImgDenoisingStrength:S}=e.sdxl;if(!u)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 w=p==="fp32",C=!0;let x=mr;const P=h,{joinedPositiveStylePrompt:E,joinedNegativeStylePrompt:I}=wc(e),N={id:db,nodes:{[x]:{type:"sdxl_model_loader",id:x,model:i,is_intermediate:C},[_e]:{type:"sdxl_compel_prompt",id:_e,prompt:n,style:E,is_intermediate:C},[Ce]:{type:"sdxl_compel_prompt",id:Ce,prompt:r,style:I,is_intermediate:C},[ve]:{type:"noise",id:ve,use_cpu:P,seed:s,is_intermediate:C},[xe]:{type:"l2i",id:xe,fp32:w,is_intermediate:C},[ae]:{type:"denoise_latents",id:ae,cfg_scale:o,scheduler:a,steps:l,denoising_start:m?Math.min(v,1-S):1-S,denoising_end:m?v:1,is_intermediate:C},[Bt]:{type:"i2l",id:Bt,fp32:w,is_intermediate:C}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:x,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}},{source:{node_id:Bt,field:"latents"},destination:{node_id:ae,field:"latents"}},{source:{node_id:ae,field:"latents"},destination:{node_id:xe,field:"latents"}}]};if(c&&(u.width!==d||u.height!==f)){const M={id:aa,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:d,height:f};N.nodes[aa]=M,N.edges.push({source:{node_id:aa,field:"image"},destination:{node_id:Bt,field:"image"}}),N.edges.push({source:{node_id:aa,field:"width"},destination:{node_id:ve,field:"width"}}),N.edges.push({source:{node_id:aa,field:"height"},destination:{node_id:ve,field:"height"}})}else N.nodes[Bt].image={image_name:u.imageName},N.edges.push({source:{node_id:Bt,field:"width"},destination:{node_id:ve,field:"width"}}),N.edges.push({source:{node_id:Bt,field:"height"},destination:{node_id:ve,field:"height"}});return ks(N,{generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:P?"cpu":"cuda",scheduler:a,strength:S,init_image:u.imageName,positive_style_prompt:b,negative_style_prompt:y},xe),(g||_)&&(ao(e,N,x),x=In),m&&(qf(e,N,ae),(g||_)&&(x=Co)),lo(e,N,x),Hf(e,N,ae,x),no(e,N,ae),ro(e,N,ae),so(e,N,ae),e.system.shouldUseNSFWChecker&&io(e,N),e.system.shouldUseWatermarker&&uo(e,N),oo(e,N),N},bRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,width:u,height:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{positiveStylePrompt:g,negativeStylePrompt:_,shouldUseSDXLRefiner:b,refinerStart:y}=e.sdxl,m=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const v=f==="fp32",S=!0,{joinedPositiveStylePrompt:w,joinedNegativeStylePrompt:C}=wc(e);let x=mr;const P={id:EA,nodes:{[x]:{type:"sdxl_model_loader",id:x,model:i,is_intermediate:S},[_e]:{type:"sdxl_compel_prompt",id:_e,prompt:n,style:w,is_intermediate:S},[Ce]:{type:"sdxl_compel_prompt",id:Ce,prompt:r,style:C,is_intermediate:S},[ve]:{type:"noise",id:ve,seed:s,width:u,height:c,use_cpu:m,is_intermediate:S},[ae]:{type:"denoise_latents",id:ae,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:b?y:1,is_intermediate:S},[xe]:{type:"l2i",id:xe,fp32:v,is_intermediate:S}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:ae,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:_e,field:"clip2"}},{source:{node_id:x,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:x,field:"clip2"},destination:{node_id:Ce,field:"clip2"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ae,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ae,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ae,field:"noise"}},{source:{node_id:ae,field:"latents"},destination:{node_id:xe,field:"latents"}}]};return ks(P,{generation_mode:"sdxl_txt2img",cfg_scale:o,height:c,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:m?"cpu":"cuda",scheduler:a,positive_style_prompt:g,negative_style_prompt:_},xe),(h||p)&&(ao(e,P,x),x=In),b&&(qf(e,P,ae),(h||p)&&(x=Co)),lo(e,P,x),Hf(e,P,ae,x),no(e,P,ae),ro(e,P,ae),so(e,P,ae),e.system.shouldUseNSFWChecker&&io(e,P),e.system.shouldUseWatermarker&&uo(e,P),oo(e,P),P};function _Re(e){const t=["vae","control","ip_adapter","metadata","unet","positive_conditioning","negative_conditioning"],n=[];e.edges.forEach(r=>{r.destination.node_id===ue&&t.includes(r.destination.field)&&n.push({source:{node_id:r.source.node_id,field:r.source.field},destination:{node_id:Kc,field:r.destination.field}})}),e.edges=e.edges.concat(n)}function SRe(e,t,n){const r=t/n;let i;e=="sdxl"?i=1024:i=512;const o=Math.floor(i*.5),a=i*i;let s,l;r>1?(l=Math.max(o,Math.sqrt(a/r)),s=l*r):(s=Math.max(o,Math.sqrt(a*r)),l=s/r),s=Math.min(t,s),l=Math.min(n,l);const u=Rr(Math.floor(s),8),c=Rr(Math.floor(l),8);return{newWidth:u,newHeight:c}}const xRe=(e,t)=>{var _;if(!e.generation.hrfEnabled||e.config.disabledSDFeatures.includes("hrf")||((_=e.generation.model)==null?void 0:_.model_type)==="onnx")return;const n=se("txt2img"),{vae:r,hrfStrength:i,hrfEnabled:o,hrfMethod:a}=e.generation,s=!r,l=e.generation.width,u=e.generation.height,c=e.generation.model?e.generation.model.base_model:"sd1",{newWidth:d,newHeight:f}=SRe(c,l,u),h=t.nodes[ue],p=t.nodes[ve],g=t.nodes[xe];if(!h){n.error("originalDenoiseLatentsNode is undefined");return}if(!p){n.error("originalNoiseNode is undefined");return}if(!g){n.error("originalLatentsToImageNode is undefined");return}if(p&&(p.width=d,p.height=f),t.nodes[_u]={type:"l2i",id:_u,fp32:g==null?void 0:g.fp32,is_intermediate:!0},t.edges.push({source:{node_id:ue,field:"latents"},destination:{node_id:_u,field:"latents"}},{source:{node_id:s?Ro:fi,field:"vae"},destination:{node_id:_u,field:"vae"}}),t.nodes[Us]={id:Us,type:"img_resize",is_intermediate:!0,width:l,height:u},a=="ESRGAN"){let b="RealESRGAN_x2plus.pth";l*u/(d*f)>2&&(b="RealESRGAN_x4plus.pth"),t.nodes[Zh]={id:Zh,type:"esrgan",model_name:b,is_intermediate:!0},t.edges.push({source:{node_id:_u,field:"image"},destination:{node_id:Zh,field:"image"}},{source:{node_id:Zh,field:"image"},destination:{node_id:Us,field:"image"}})}else t.edges.push({source:{node_id:_u,field:"image"},destination:{node_id:Us,field:"image"}});t.nodes[kh]={type:"noise",id:kh,seed:p==null?void 0:p.seed,use_cpu:p==null?void 0:p.use_cpu,is_intermediate:!0},t.edges.push({source:{node_id:Us,field:"height"},destination:{node_id:kh,field:"height"}},{source:{node_id:Us,field:"width"},destination:{node_id:kh,field:"width"}}),t.nodes[Ph]={type:"i2l",id:Ph,is_intermediate:!0},t.edges.push({source:{node_id:s?Ro:fi,field:"vae"},destination:{node_id:Ph,field:"vae"}},{source:{node_id:Us,field:"image"},destination:{node_id:Ph,field:"image"}}),t.nodes[Kc]={type:"denoise_latents",id:Kc,is_intermediate:!0,cfg_scale:h==null?void 0:h.cfg_scale,scheduler:h==null?void 0:h.scheduler,steps:h==null?void 0:h.steps,denoising_start:1-e.generation.hrfStrength,denoising_end:1},t.edges.push({source:{node_id:Ph,field:"latents"},destination:{node_id:Kc,field:"latents"}},{source:{node_id:kh,field:"noise"},destination:{node_id:Kc,field:"noise"}}),_Re(t),t.nodes[tl]={type:"l2i",id:tl,fp32:g==null?void 0:g.fp32,is_intermediate:!0},t.edges.push({source:{node_id:s?Ro:fi,field:"vae"},destination:{node_id:tl,field:"vae"}},{source:{node_id:Kc,field:"latents"},destination:{node_id:tl,field:"latents"}}),Lo(t,{hrf_strength:i,hrf_enabled:o,hrf_method:a}),oRe(t,tl)},wRe=e=>{const t=se("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,steps:s,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p,seed:g}=e.generation,_=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const b=f==="fp32",y=!0,m=i.model_type==="onnx";let v=m?b2:Ro;const S=m?"onnx_model_loader":"main_model_loader",w=m?{type:"t2l_onnx",id:ue,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s}:{type:"denoise_latents",id:ue,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s,denoising_start:0,denoising_end:1},C={id:PG,nodes:{[v]:{type:S,id:v,is_intermediate:y,model:i},[ct]:{type:"clip_skip",id:ct,skipped_layers:c,is_intermediate:y},[_e]:{type:m?"prompt_onnx":"compel",id:_e,prompt:n,is_intermediate:y},[Ce]:{type:m?"prompt_onnx":"compel",id:Ce,prompt:r,is_intermediate:y},[ve]:{type:"noise",id:ve,seed:g,width:l,height:u,use_cpu:_,is_intermediate:y},[w.id]:w,[xe]:{type:m?"l2i_onnx":"l2i",id:xe,fp32:b,is_intermediate:y}},edges:[{source:{node_id:v,field:"unet"},destination:{node_id:ue,field:"unet"}},{source:{node_id:v,field:"clip"},destination:{node_id:ct,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:_e,field:"clip"}},{source:{node_id:ct,field:"clip"},destination:{node_id:Ce,field:"clip"}},{source:{node_id:_e,field:"conditioning"},destination:{node_id:ue,field:"positive_conditioning"}},{source:{node_id:Ce,field:"conditioning"},destination:{node_id:ue,field:"negative_conditioning"}},{source:{node_id:ve,field:"noise"},destination:{node_id:ue,field:"noise"}},{source:{node_id:ue,field:"latents"},destination:{node_id:xe,field:"latents"}}]};return ks(C,{generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:n,negative_prompt:r,model:i,seed:g,steps:s,rand_device:_?"cpu":"cuda",scheduler:a,clip_skip:c},xe),(h||p)&&(ao(e,C,v),v=In),lo(e,C,v),Gf(e,C,ue,v),no(e,C,ue),ro(e,C,ue),so(e,C,ue),e.generation.hrfEnabled&&!m&&xRe(e,C),e.system.shouldUseNSFWChecker&&io(e,C),e.system.shouldUseWatermarker&&uo(e,C),oo(e,C),C},CRe=()=>{pe({predicate:e=>CA.match(e)&&(e.payload.tabName==="txt2img"||e.payload.tabName==="img2img"),effect:async(e,{getState:t,dispatch:n})=>{const r=t(),i=r.generation.model,{prepend:o}=e.payload;let a;i&&i.base_model==="sdxl"?e.payload.tabName==="txt2img"?a=bRe(r):a=vRe(r):e.payload.tabName==="txt2img"?a=wRe(r):a=yRe(r);const s=IG(r,a,o);n(un.endpoints.enqueueBatch.initiate(s,{fixedCacheKey:"enqueueBatch"})).reset()}})},ERe=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function TRe(e){return e.length===1?e[0].toString():e.reduce((t,n)=>{if(typeof n=="number")return t+"["+n.toString()+"]";if(n.includes('"'))return t+'["'+ARe(n)+'"]';if(!ERe.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function ARe(e){return e.replace(/"/g,'\\"')}function PRe(e){return e.length!==0}const kRe=99,MG="; ",RG=", or ",AA="Validation error",OG=": ";class $G extends Error{constructor(n,r=[]){super(n);Q2(this,"details");Q2(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function PA(e){const{issue:t,issueSeparator:n,unionSeparator:r,includePath:i}=e;if(t.code==="invalid_union")return t.unionErrors.reduce((o,a)=>{const s=a.issues.map(l=>PA({issue:l,issueSeparator:n,unionSeparator:r,includePath:i})).join(n);return o.includes(s)||o.push(s),o},[]).join(r);if(i&&PRe(t.path)){if(t.path.length===1){const o=t.path[0];if(typeof o=="number")return`${t.message} at index ${o}`}return`${t.message} at "${TRe(t.path)}"`}return t.message}function NG(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:AA}function FUe(e,t={}){const{issueSeparator:n=MG,unionSeparator:r=RG,prefixSeparator:i=OG,prefix:o=AA,includePath:a=!0}=t,s=PA({issue:e,issueSeparator:n,unionSeparator:r,includePath:a}),l=NG(s,o,i);return new $G(l,[e])}function wR(e,t={}){const{maxIssuesInMessage:n=kRe,issueSeparator:r=MG,unionSeparator:i=RG,prefixSeparator:o=OG,prefix:a=AA,includePath:s=!0}=t,l=e.errors.slice(0,n).map(c=>PA({issue:c,issueSeparator:r,unionSeparator:i,includePath:s})).join(r),u=NG(l,a,o);return new $G(u,e.errors)}const IRe=e=>{const{workflow:t,nodes:n,edges:r}=e,i={...t,nodes:[],edges:[]};return n.filter(o=>["invocation","notes"].includes(o.type??"__UNKNOWN_NODE_TYPE__")).forEach(o=>{const a=XF.safeParse(o);if(!a.success){const{message:s}=wR(a.error,{prefix:de.t("nodes.unableToParseNode")});se("nodes").warn({node:pt(o)},s);return}i.nodes.push(a.data)}),r.forEach(o=>{const a=QF.safeParse(o);if(!a.success){const{message:s}=wR(a.error,{prefix:de.t("nodes.unableToParseEdge")});se("nodes").warn({edge:pt(o)},s);return}i.edges.push(a.data)}),i},MRe=e=>{if(e.type==="ColorField"&&e.value){const t=Ye(e.value),{r:n,g:r,b:i,a:o}=e.value,a=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a}),t}return e.value},RRe=e=>{const{nodes:t,edges:n}=e,i=t.filter(on).reduce((l,u)=>{const{id:c,data:d}=u,{type:f,inputs:h,isIntermediate:p,embedWorkflow:g}=d,_=tg(h,(y,m,v)=>{const S=MRe(m);return y[v]=S,y},{});_.use_cache=u.data.useCache;const b={type:f,id:c,..._,is_intermediate:p};return g&&Object.assign(b,{workflow:IRe(e)}),Object.assign(l,{[c]:b}),l},{}),a=n.filter(l=>l.type!=="collapsed").reduce((l,u)=>{const{source:c,target:d,sourceHandle:f,targetHandle:h}=u;return l.push({source:{node_id:c,field:f},destination:{node_id:d,field:h}}),l},[]);return a.forEach(l=>{const u=i[l.destination.node_id],c=l.destination.field;i[l.destination.node_id]=$f(u,c)}),{id:yl(),nodes:i,edges:a}},ORe=()=>{pe({predicate:e=>CA.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=t(),o={batch:{graph:RRe(r.nodes),runs:r.generation.iterations},prepend:e.payload.prepend};n(un.endpoints.enqueueBatch.initiate(o,{fixedCacheKey:"enqueueBatch"})).reset()}})},$Re=()=>{pe({matcher:ce.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=se("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},NRe=()=>{pe({matcher:ce.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=se("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},kA=ge("deleteImageModal/imageDeletionConfirmed"),BUe=qn(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],Vm),DG=qn([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?Fn:Pr,offset:0,limit:Kle,is_intermediate:!1}},Vm),DRe=()=>{pe({actionCreator:kA,effect:async(e,{dispatch:t,getState:n,condition:r})=>{var f;const{imageDTOs:i,imagesUsage:o}=e.payload;if(i.length!==1||o.length!==1)return;const a=i[0],s=o[0];if(!a||!s)return;t(XE(!1));const l=n(),u=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(a&&(a==null?void 0:a.image_name)===u){const{image_name:h}=a,p=DG(l),{data:g}=ce.endpoints.listImages.select(p)(l),_=g?Lt.getSelectors().selectAll(g):[],b=_.findIndex(S=>S.image_name===h),y=_.filter(S=>S.image_name!==h),m=al(b,0,y.length-1),v=y[m];t(pa(v||null))}s.isCanvasImage&&t(KE()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(DE()),ps(Aa(n().controlAdapters),g=>{(g.controlImage===h.image_name||gi(g)&&g.processedControlImage===h.image_name)&&(t(Hl({id:g.id,controlImage:null})),t(RE({id:g.id,processedControlImage:null})))}),n().nodes.nodes.forEach(g=>{on(g)&&ps(g.data.inputs,_=>{var b;_.type==="ImageField"&&((b=_.value)==null?void 0:b.image_name)===h.image_name&&t(aS({nodeId:g.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:c}=t(ce.endpoints.deleteImage.initiate(a));await r(h=>ce.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t(Do.util.invalidateTags([{type:"Board",id:a.board_id??"none"}]))}})},LRe=()=>{pe({actionCreator:kA,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(ce.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),a=DG(o),{data:s}=ce.endpoints.listImages.select(a)(o),l=s?Lt.getSelectors().selectAll(s)[0]:void 0;t(pa(l||null)),t(XE(!1)),i.some(u=>u.isCanvasImage)&&t(KE()),r.forEach(u=>{var c;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(DE()),ps(Aa(n().controlAdapters),d=>{(d.controlImage===u.image_name||gi(d)&&d.processedControlImage===u.image_name)&&(t(Hl({id:d.id,controlImage:null})),t(RE({id:d.id,processedControlImage:null})))}),n().nodes.nodes.forEach(d=>{on(d)&&ps(d.data.inputs,f=>{var h;f.type==="ImageField"&&((h=f.value)==null?void 0:h.image_name)===u.image_name&&t(aS({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},FRe=()=>{pe({matcher:ce.endpoints.deleteImage.matchPending,effect:()=>{}})},BRe=()=>{pe({matcher:ce.endpoints.deleteImage.matchFulfilled,effect:e=>{se("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},zRe=()=>{pe({matcher:ce.endpoints.deleteImage.matchRejected,effect:e=>{se("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},LG=ge("dnd/dndDropped"),VRe=()=>{pe({actionCreator:LG,effect:async(e,{dispatch:t})=>{const n=se("dnd"),{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`):r.payloadType==="NODE_FIELD"?n.debug({activeData:pt(r),overData:pt(i)},"Node field dropped"):n.debug({activeData:r,overData:i},"Unknown payload dropped"),i.actionType==="ADD_FIELD_TO_LINEAR"&&r.payloadType==="NODE_FIELD"){const{nodeId:o,field:a}=r.payload;t(dve({nodeId:o,fieldName:a.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(pa(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(c_(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROL_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{id:o}=i.context;t(Hl({id:o,controlImage:r.payload.imageDTO.image_name})),t(OE({id:o,isEnabled:!0}));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(lF(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:a}=i.context;t(aS({nodeId:a,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:a}=i.context;t(ce.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(ce.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:a}=i.context;t(ce.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(ce.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},jRe=()=>{pe({matcher:ce.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=se("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},URe=()=>{pe({matcher:ce.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=se("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},GRe=()=>{pe({actionCreator:Ble,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,a=w6e(n()),s=a.some(l=>l.isCanvasImage)||a.some(l=>l.isInitialImage)||a.some(l=>l.isControlImage)||a.some(l=>l.isNodesImage);if(o||s){t(XE(!0));return}t(kA({imageDTOs:r,imagesUsage:a}))}})},HRe=()=>{pe({matcher:ce.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=se("images"),i=e.payload,o=n(),{autoAddBoardId:a}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:s}=e.meta.arg.originalArgs;if(e.payload.is_intermediate&&!s)return;const l={title:X("toast.imageUploaded"),status:"success"};if((s==null?void 0:s.type)==="TOAST"){const{toastOptions:u}=s;if(!a||a==="none")t(it({...l,...u}));else{t(ce.endpoints.addImageToBoard.initiate({board_id:a,imageDTO:i}));const{data:c}=Qe.endpoints.listAllBoards.select()(o),d=c==null?void 0:c.find(h=>h.board_id===a),f=d?`${X("toast.addedToBoard")} ${d.board_name}`:`${X("toast.addedToBoard")} ${a}`;t(it({...l,description:f}))}return}if((s==null?void 0:s.type)==="SET_CANVAS_INITIAL_IMAGE"){t(lF(i)),t(it({...l,description:X("toast.setAsCanvasInitialImage")}));return}if((s==null?void 0:s.type)==="SET_CONTROL_ADAPTER_IMAGE"){const{id:u}=s;t(OE({id:u,isEnabled:!0})),t(Hl({id:u,controlImage:i.image_name})),t(it({...l,description:X("toast.setControlImage")}));return}if((s==null?void 0:s.type)==="SET_INITIAL_IMAGE"){t(c_(i)),t(it({...l,description:X("toast.setInitialImage")}));return}if((s==null?void 0:s.type)==="SET_NODES_IMAGE"){const{nodeId:u,fieldName:c}=s;t(aS({nodeId:u,fieldName:c,value:i})),t(it({...l,description:`${X("toast.setNodeField")} ${c}`}));return}}})},qRe=()=>{pe({matcher:ce.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=se("images"),r={arg:{...$f(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(it({title:X("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},WRe=()=>{pe({matcher:ce.endpoints.starImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!0}):a.push(s)}),t(JF(a))}})},KRe=()=>{pe({matcher:ce.endpoints.unstarImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!1}):a.push(s)}),t(JF(a))}})},XRe=ge("generation/initialImageSelected"),QRe=ge("generation/modelSelected"),YRe=()=>{pe({actionCreator:XRe,effect:(e,{dispatch:t})=>{if(!e.payload){t(it(vs({title:X("toast.imageNotLoadedDesc"),status:"error"})));return}t(c_(e.payload)),t(it(vs(X("toast.sentToImageToImage"))))}})},ZRe=()=>{pe({actionCreator:QRe,effect:(e,{getState:t,dispatch:n})=>{var l,u;const r=se("models"),i=t(),o=Sm.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const a=o.data,{base_model:s}=a;if(((l=i.generation.model)==null?void 0:l.base_model)!==s){let c=0;ps(i.lora.loras,(f,h)=>{f.base_model!==s&&(n(tB(h)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==s&&(n(xL(null)),c+=1),Aa(i.controlAdapters).forEach(f=>{var h;((h=f.model)==null?void 0:h.base_model)!==s&&(n(OE({id:f.id,isEnabled:!1})),c+=1)}),c>0&&n(it(vs({title:X("toast.baseModelChangedCleared",{count:c}),status:"warning"})))}((u=i.generation.model)==null?void 0:u.base_model)!==a.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(a.base_model)?(n(E6(1024)),n(T6(1024)),n(Z6({width:1024,height:1024}))):(n(E6(512)),n(T6(512)),n(Z6({width:512,height:512})))),n(sl(a))}})},qg=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),CR=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),ER=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),TR=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),AR=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),PR=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),kR=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),F3=Ji({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),JRe=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,Bs=e=>{const t=[];return e.forEach(n=>{const r={...Ye(n),id:JRe(n)};t.push(r)}),t},Qo=Do.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${pp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return CR.setAll(CR.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${pp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return qg.setAll(qg.getInitialState(),n)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:["Model"]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:["Model"]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:["Model"]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:["Model"]}),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:["Model"]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:["Model"]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:["Model"]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return ER.setAll(ER.getInitialState(),n)}}),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:kr}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:kr}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return TR.setAll(TR.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return AR.setAll(AR.getInitialState(),n)}}),getT2IAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"t2i_adapter"}}),providesTags:t=>{const n=[{type:"T2IAdapterModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"T2IAdapterModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return PR.setAll(PR.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return F3.setAll(F3.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:kr},"Model"];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=Bs(t.models);return kR.setAll(kR.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${pp.stringify(t,{})}`})}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:zUe,useGetOnnxModelsQuery:VUe,useGetControlNetModelsQuery:jUe,useGetIPAdapterModelsQuery:UUe,useGetT2IAdapterModelsQuery:GUe,useGetLoRAModelsQuery:HUe,useGetTextualInversionModelsQuery:qUe,useGetVaeModelsQuery:WUe,useUpdateMainModelsMutation:KUe,useDeleteMainModelsMutation:XUe,useImportMainModelsMutation:QUe,useAddMainModelsMutation:YUe,useConvertMainModelsMutation:ZUe,useMergeMainModelsMutation:JUe,useDeleteLoRAModelsMutation:eGe,useUpdateLoRAModelsMutation:tGe,useSyncModelsMutation:nGe,useGetModelsInFolderQuery:rGe,useGetCheckpointConfigsQuery:iGe}=Qo,eOe=()=>{pe({predicate:e=>Qo.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=se("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=qg.getSelectors().selectAll(e.payload);if(o.length===0){n(sl(null));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=Sm.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse main model");return}n(sl(s.data))}}),pe({predicate:e=>Qo.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=se("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=qg.getSelectors().selectAll(e.payload);if(o.length===0){n(_8(null)),n(gve(!1));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=$E.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse SDXL Refiner Model");return}n(_8(s.data))}}),pe({matcher:Qo.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=se("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||Gc(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 a=F3.getSelectors().selectAll(e.payload)[0];if(!a){n(sl(null));return}const s=_L.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse VAE model");return}n(xL(s.data))}}),pe({matcher:Qo.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{se("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;ps(i,(o,a)=>{Gc(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(tB(a))})}}),pe({matcher:Qo.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{se("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),kie(t().controlAdapters).forEach(i=>{Gc(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Nx({id:i.id}))})}}),pe({matcher:Qo.endpoints.getT2IAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{se("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),Oie(t().controlAdapters).forEach(i=>{Gc(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Nx({id:i.id}))})}}),pe({matcher:Qo.endpoints.getIPAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{se("models").info({models:e.payload.entities},`IP Adapter models loaded (${e.payload.ids.length})`),Mie(t().controlAdapters).forEach(i=>{Gc(e.payload.entities,a=>{var s,l;return(a==null?void 0:a.model_name)===((s=i==null?void 0:i.model)==null?void 0:s.model_name)&&(a==null?void 0:a.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Nx({id:i.id}))})}}),pe({matcher:Qo.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{se("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},tOe=Do.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),nOe=si(uae,Gle,jle,Ule,CE),rOe=()=>{pe({matcher:nOe,effect:async(e,{dispatch:t,getState:n,cancelActiveListeners:r,delay:i})=>{r(),await i(1e3);const o=n();if(o.config.disabledFeatures.includes("dynamicPrompting"))return;const{positivePrompt:a}=o.generation,{maxPrompts:s}=o.dynamicPrompts;t(Ux(!0));try{const l=t(tOe.endpoints.dynamicPrompts.initiate({prompt:a,max_prompts:s})),u=await l.unwrap();l.unsubscribe(),t(Hle(u.prompts)),t(qle(u.error)),t(J6(!1)),t(Ux(!1))}catch{t(J6(!0)),t(Ux(!1))}}})},zs=e=>e.$ref.split("/").slice(-1)[0],iOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",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&&_a(e.exclusiveMaximum)&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&_a(e.exclusiveMinimum)&&(n.exclusiveMinimum=e.exclusiveMinimum),n},oOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"IntegerPolymorphic",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&&_a(e.exclusiveMaximum)&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&_a(e.exclusiveMinimum)&&(n.exclusiveMinimum=e.exclusiveMinimum),n},aOe=({schemaObject:e,baseField:t})=>{const n=_a(e.item_default)&&Qne(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},sOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",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&&_a(e.exclusiveMaximum)&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&_a(e.exclusiveMinimum)&&(n.exclusiveMinimum=e.exclusiveMinimum),n},lOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"FloatPolymorphic",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&&_a(e.exclusiveMaximum)&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&_a(e.exclusiveMinimum)&&(n.exclusiveMinimum=e.exclusiveMinimum),n},uOe=({schemaObject:e,baseField:t})=>{const n=_a(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},cOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",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},dOe=({schemaObject:e,baseField:t})=>{const n={...t,type:"StringPolymorphic",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},fOe=({schemaObject:e,baseField:t})=>{const n=_E(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},hOe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),pOe=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),gOe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&Xne(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},mOe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),yOe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),vOe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),bOe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),_Oe=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),SOe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),xOe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),wOe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterModelField",default:e.default??void 0}),COe=({schemaObject:e,baseField:t})=>({...t,type:"BoardField",default:e.default??void 0}),EOe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),TOe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),AOe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),POe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),kOe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),IOe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),MOe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),ROe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),OOe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),$Oe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),NOe=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),DOe=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),LOe=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),FOe=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),BOe=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),zOe=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),VOe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),jOe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterPolymorphic",default:e.default??void 0}),UOe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),GOe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterField",default:e.default??void 0}),HOe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterPolymorphic",default:e.default??void 0}),qOe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),WOe=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",options:n,ui_choice_labels:e.ui_choice_labels,default:e.default??n[0]}},KOe=({baseField:e})=>({...e,type:"Collection",default:[]}),XOe=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),QOe=({baseField:e})=>({...e,type:"Any",default:void 0}),YOe=({baseField:e})=>({...e,type:"MetadataItemField",default:void 0}),ZOe=({baseField:e})=>({...e,type:"MetadataItemCollection",default:void 0}),JOe=({baseField:e})=>({...e,type:"MetadataItemPolymorphic",default:void 0}),e7e=({baseField:e})=>({...e,type:"MetadataField",default:void 0}),t7e=({baseField:e})=>({...e,type:"MetadataCollection",default:void 0}),n7e=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),r7e=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),i7e=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),o7e=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),B3=e=>{if(N0(e)){if(e.type){if(e.enum)return"enum";if(e.type){if(e.type==="number")return"float";if(e.type==="array"){const t=N0(e.items)?e.items.type:zs(e.items);return Tn(t)?void 0:hye(t)?vT[t]:void 0}else if(!Tn(e.type))return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&au(t[0]))return zs(t[0])}else if(e.anyOf){const t=e.anyOf.filter(i=>!(N0(i)&&i.type==="null"));if(t.length===1){if(au(t[0]))return zs(t[0]);if(N0(t[0]))return B3(t[0])}let n,r;if(mI(t[0])){const i=t[0].items,o=t[1];au(i)&&au(o)?(n=zs(i),r=zs(o)):D0(i)&&D0(o)&&(n=i.type,r=o.type)}else if(mI(t[1])){const i=t[0],o=t[1].items;au(i)&&au(o)?(n=zs(i),r=zs(o)):D0(i)&&D0(o)&&(n=i.type,r=o.type)}if(n===r&&gye(n))return wz[n]}}else if(au(e))return zs(e)},FG={BoardField:COe,Any:QOe,boolean:hOe,BooleanCollection:gOe,BooleanPolymorphic:pOe,ClipField:DOe,Collection:KOe,CollectionItem:XOe,ColorCollection:i7e,ColorField:n7e,ColorPolymorphic:r7e,ConditioningCollection:$Oe,ConditioningField:ROe,ConditioningPolymorphic:OOe,ControlCollection:zOe,ControlField:FOe,ControlNetModelField:SOe,ControlPolymorphic:BOe,DenoiseMaskField:POe,enum:WOe,float:sOe,FloatCollection:uOe,FloatPolymorphic:lOe,ImageCollection:AOe,ImageField:EOe,ImagePolymorphic:TOe,integer:iOe,IntegerCollection:aOe,IntegerPolymorphic:oOe,IPAdapterCollection:UOe,IPAdapterField:VOe,IPAdapterModelField:xOe,IPAdapterPolymorphic:jOe,LatentsCollection:MOe,LatentsField:kOe,LatentsPolymorphic:IOe,LoRAModelField:_Oe,MetadataItemField:YOe,MetadataItemCollection:ZOe,MetadataItemPolymorphic:JOe,MetadataField:e7e,MetadataCollection:t7e,MainModelField:mOe,Scheduler:o7e,SDXLMainModelField:yOe,SDXLRefinerModelField:vOe,string:cOe,StringCollection:fOe,StringPolymorphic:dOe,T2IAdapterCollection:qOe,T2IAdapterField:GOe,T2IAdapterModelField:wOe,T2IAdapterPolymorphic:HOe,UNetField:NOe,VaeField:LOe,VaeModelField:bOe},a7e=e=>!!(e&&e in FG),s7e=(e,t,n,r)=>{var p;const{input:i,ui_hidden:o,ui_component:a,ui_type:s,ui_order:l,ui_choice_labels:u,item_default:c}=t,d={input:Gh.includes(r)?"connection":i,ui_hidden:o,ui_component:a,ui_type:s,required:((p=e.required)==null?void 0:p.includes(n))??!1,ui_order:l,ui_choice_labels:u,item_default:c},f={name:n,title:t.title??(n?wE(n):""),description:t.description??"",fieldKind:"input",...d};if(!a7e(r))return;const h=FG[r];if(h)return h({schemaObject:t,baseField:f})},l7e=["id","type","use_cache"],u7e=["type"],c7e=["IsIntermediate"],d7e=["graph","linear_ui_output"],f7e=(e,t)=>!!(l7e.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),h7e=e=>!!c7e.includes(e),p7e=(e,t)=>!u7e.includes(t),g7e=e=>!d7e.includes(e.properties.type.default),m7e=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(xfe).filter(g7e).filter(a=>t?t.includes(a.properties.type.default):!0).filter(a=>n?!n.includes(a.properties.type.default):!0).reduce((a,s)=>{var S,w;const l=s.properties.type.default,u=s.title.replace("Invocation",""),c=s.tags??[],d=s.description??"",f=s.version;let h=!1;const p=tg(s.properties,(C,x,P)=>{if(f7e(l,P))return se("nodes").trace({node:l,fieldName:P,field:pt(x)},"Skipped reserved input field"),C;if(!yI(x))return se("nodes").warn({node:l,propertyName:P,property:pt(x)},"Unhandled input property"),C;const E=x.ui_type??B3(x);if(!E)return se("nodes").warn({node:l,fieldName:P,fieldType:E,field:pt(x)},"Missing input field type"),C;if(E==="WorkflowField")return h=!0,C;if(h7e(E))return se("nodes").trace({node:l,fieldName:P,fieldType:E,field:pt(x)},`Skipping reserved input field type: ${E}`),C;if(!gI(E))return se("nodes").warn({node:l,fieldName:P,fieldType:E,field:pt(x)},`Skipping unknown input field type: ${E}`),C;const I=s7e(s,x,P,E);return I?(C[P]=I,C):(se("nodes").warn({node:l,fieldName:P,fieldType:E,field:pt(x)},"Skipping input field with no template"),C)},{}),g=s.output.$ref.split("/").pop();if(!g)return se("nodes").warn({outputRefObject:pt(s.output)},"No output schema name found in ref object"),a;const _=(w=(S=e.components)==null?void 0:S.schemas)==null?void 0:w[g];if(!_)return se("nodes").warn({outputSchemaName:g},"Output schema not found"),a;if(!wfe(_))return se("nodes").error({outputSchema:pt(_)},"Invalid output schema"),a;const b=_.properties.type.default,y=tg(_.properties,(C,x,P)=>{if(!p7e(l,P))return se("nodes").trace({type:l,propertyName:P,property:pt(x)},"Skipped reserved output field"),C;if(!yI(x))return se("nodes").warn({type:l,propertyName:P,property:pt(x)},"Unhandled output property"),C;const E=x.ui_type??B3(x);return gI(E)?(C[P]={fieldKind:"output",name:P,title:x.title??(P?wE(P):""),description:x.description??"",type:E,ui_hidden:x.ui_hidden??!1,ui_type:x.ui_type,ui_order:x.ui_order},C):(se("nodes").warn({fieldName:P,fieldType:E,field:pt(x)},"Skipping unknown output field type"),C)},{}),m=s.properties.use_cache.default,v={title:u,type:l,version:f,tags:c,description:d,outputType:b,inputs:p,outputs:y,useCache:m,withWorkflow:h};return Object.assign(a,{[l]:v}),a},{})},y7e=()=>{pe({actionCreator:Ig.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=se("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:a}=n().config,s=m7e(i,o,a);r.debug({nodeTemplates:pt(s)},`Built ${r_(s)} node templates`),t($z(s))}}),pe({actionCreator:Ig.rejected,effect:e=>{se("system").error({error:pt(e.error)},"Problem retrieving OpenAPI Schema")}})},v7e=()=>{pe({actionCreator:VD,effect:(e,{dispatch:t,getState:n})=>{se("socketio").debug("Connected");const{nodes:i,config:o,system:a}=n(),{disabledTabs:s}=o;!r_(i.nodeTemplates)&&!s.includes("nodes")&&t(Ig()),a.isInitialized?t(Do.util.resetApiState()):t(Sve(!0)),t(CE(e.payload))}})},b7e=()=>{pe({actionCreator:jD,effect:(e,{dispatch:t})=>{se("socketio").debug("Disconnected"),t(UD(e.payload))}})},_7e=()=>{pe({actionCreator:KD,effect:(e,{dispatch:t})=>{se("socketio").trace(e.payload,"Generator progress"),t(PE(e.payload))}})},S7e=()=>{pe({actionCreator:qD,effect:(e,{dispatch:t})=>{se("socketio").debug(e.payload,"Session complete"),t(WD(e.payload))}})},x7e=["load_image","image"],w7e=()=>{pe({actionCreator:TE,effect:async(e,{dispatch:t,getState:n})=>{const r=se("socketio"),{data:i}=e.payload;r.debug({data:pt(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:a,queue_batch_id:s,source_node_id:l}=i;if(TG(o)&&!x7e.includes(a.type)&&!iRe.includes(l)){const{image_name:u}=o.image,{canvas:c,gallery:d}=n(),f=t(ce.endpoints.getImageDTO.initiate(u,{forceRefetch:!0})),h=await f.unwrap();if(f.unsubscribe(),c.batchIds.includes(s)&&[Wu].includes(i.source_node_id)&&t(Ple(h)),!h.is_intermediate){t(ce.util.updateQueryData("listImages",{board_id:h.board_id??"none",categories:Fn},g=>{Lt.addOne(g,h)})),t(Qe.util.updateQueryData("getBoardImagesTotal",h.board_id??"none",g=>{g.total+=1})),t(ce.util.invalidateTags([{type:"Board",id:h.board_id??"none"}]));const{shouldAutoSwitch:p}=d;p&&(d.galleryView!=="images"&&t(M5("images")),h.board_id&&h.board_id!==d.selectedBoardId&&t(M1({boardId:h.board_id,selectedImageName:h.image_name})),!h.board_id&&d.selectedBoardId!=="none"&&t(M1({boardId:"none",selectedImageName:h.image_name})),t(pa(h)))}}t(AE(e.payload))}})},C7e=()=>{pe({actionCreator:HD,effect:(e,{dispatch:t})=>{se("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(i_(e.payload))}})},E7e=()=>{pe({actionCreator:tL,effect:(e,{dispatch:t})=>{se("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(nL(e.payload))}})},T7e=()=>{pe({actionCreator:GD,effect:(e,{dispatch:t})=>{se("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(EE(e.payload))}})},A7e=()=>{pe({actionCreator:XD,effect:(e,{dispatch:t})=>{const n=se("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load started: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(QD(e.payload))}}),pe({actionCreator:YD,effect:(e,{dispatch:t})=>{const n=se("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load complete: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(ZD(e.payload))}})},P7e=()=>{pe({actionCreator:rL,effect:async(e,{dispatch:t})=>{const n=se("socketio"),{queue_item:r,batch_status:i,queue_status:o}=e.payload.data;n.debug(e.payload,`Queue item ${r.item_id} status updated: ${r.status}`),t(un.util.updateQueryData("listQueueItems",void 0,a=>{xu.updateOne(a,{id:r.item_id,changes:r})})),t(un.util.updateQueryData("getQueueStatus",void 0,a=>{a&&Object.assign(a.queue,o)})),t(un.util.updateQueryData("getBatchStatus",{batch_id:i.batch_id},()=>i)),t(un.util.updateQueryData("getQueueItem",r.item_id,a=>{a&&Object.assign(a,r)})),t(un.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem","InvocationCacheStatus"])),t(o_(e.payload))}})},k7e=()=>{pe({actionCreator:JD,effect:(e,{dispatch:t})=>{se("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(eL(e.payload))}})},I7e=()=>{pe({actionCreator:Zre,effect:(e,{dispatch:t})=>{se("socketio").debug(e.payload,"Subscribed"),t(Jre(e.payload))}})},M7e=()=>{pe({actionCreator:eie,effect:(e,{dispatch:t})=>{se("socketio").debug(e.payload,"Unsubscribed"),t(tie(e.payload))}})},R7e=()=>{pe({actionCreator:M6e,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(ce.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(ce.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(it({title:X("toast.imageSaved"),status:"success"}))}catch(i){t(it({title:X("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},oGe=["sd-1","sd-2","sdxl","sdxl-refiner"],O7e=["sd-1","sd-2","sdxl"],aGe=["sdxl"],sGe=["sd-1","sd-2"],lGe=["sdxl-refiner"],$7e=()=>{pe({actionCreator:qz,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 a=n(Qo.endpoints.getMainModels.initiate(O7e)),s=await a.unwrap();if(a.unsubscribe(),!s.ids.length){n(sl(null));return}const u=qg.getSelectors().selectAll(s).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n(sl(null));return}const{base_model:c,model_name:d,model_type:f}=u;n(sl({base_model:c,model_name:d,model_type:f}))}catch{n(sl(null))}}}})},N7e=({image_name:e,esrganModelName:t,autoAddBoardId:n})=>{const r={id:Jh,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},i={id:Wu,type:"linear_ui_output",use_cache:!1,is_intermediate:!1,board:n==="none"?void 0:{board_id:n}},o={id:"adhoc-esrgan-graph",nodes:{[Jh]:r,[Wu]:i},edges:[{source:{node_id:Jh,field:"image"},destination:{node_id:Wu,field:"image"}}]};return ks(o,{},Jh),Lo(o,{esrgan_model:t}),o},w2=()=>oF(),C2=YL;function D7e(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const IR={};function z3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&IR[t[0]]||(typeof t[0]=="string"&&(IR[t[0]]=new Date),D7e(...t))}const BG=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function MR(e,t,n){e.loadNamespaces(t,BG(e,n))}function RR(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,BG(e,r))}function L7e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=t.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function F7e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(z3("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):L7e(e,t,n)}const B7e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,z7e={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},V7e=e=>z7e[e],j7e=e=>e.replace(B7e,V7e);let V3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:j7e};function U7e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};V3={...V3,...e}}function G7e(){return V3}let zG;function H7e(e){zG=e}function q7e(){return zG}const W7e={type:"3rdParty",init(e){U7e(e.options.react),H7e(e)}},K7e=k.createContext();class X7e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Q7e=(e,t)=>{const n=k.useRef();return k.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function VG(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=k.useContext(K7e)||{},o=n||r||q7e();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new X7e),!o){z3("You will need to pass in an i18next instance by using initReactI18next");const m=(S,w)=>typeof w=="string"?w:w&&typeof w=="object"&&typeof w.defaultValue=="string"?w.defaultValue:Array.isArray(S)?S[S.length-1]:S,v=[m,{},!1];return v.t=m,v.i18n={},v.ready=!1,v}o.options.react&&o.options.react.wait!==void 0&&z3("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...G7e(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e||i||o.options&&o.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(m=>F7e(m,o,a));function d(){return o.getFixedT(t.lng||null,a.nsMode==="fallback"?u:u[0],l)}const[f,h]=k.useState(d);let p=u.join();t.lng&&(p=`${t.lng}${p}`);const g=Q7e(p),_=k.useRef(!0);k.useEffect(()=>{const{bindI18n:m,bindI18nStore:v}=a;_.current=!0,!c&&!s&&(t.lng?RR(o,t.lng,u,()=>{_.current&&h(d)}):MR(o,u,()=>{_.current&&h(d)})),c&&g&&g!==p&&_.current&&h(d);function S(){_.current&&h(d)}return m&&o&&o.on(m,S),v&&o&&o.store.on(v,S),()=>{_.current=!1,m&&o&&m.split(" ").forEach(w=>o.off(w,S)),v&&o&&v.split(" ").forEach(w=>o.store.off(w,S))}},[o,p]);const b=k.useRef(!0);k.useEffect(()=>{_.current&&!b.current&&h(d),b.current=!1},[o,l]);const y=[f,o,c];if(y.t=f,y.i18n=o,y.ready=c,c||!c&&!s)return y;throw new Promise(m=>{t.lng?RR(o,t.lng,u,()=>m()):MR(o,u,()=>m())})}const Y7e=(e,t)=>{if(!e||!t)return;const{width:n,height:r}=e,i=r*4*n*4,o=r*2*n*2;return{x4:i,x2:o}},Z7e=(e,t)=>{if(!e||!t)return{x4:!0,x2:!0};const n={x4:!1,x2:!1};return e.x4<=t&&(n.x4=!0),e.x2<=t&&(n.x2=!0),n},J7e=(e,t)=>{if(!(!e||!t)&&!(e.x4&&e.x2)){if(!e.x2&&!e.x4)return"parameters.isAllowedToUpscale.tooLarge";if(!e.x4&&e.x2&&t===4)return"parameters.isAllowedToUpscale.useX2Model"}},jG=e=>qn(IA,({postprocessing:t,config:n})=>{const{esrganModelName:r}=t,{maxUpscalePixels:i}=n,o=Y7e(e,i),a=Z7e(o,i),s=r.includes("x2")?2:4,l=J7e(a,s);return{isAllowedToUpscale:s===2?a.x2:a.x4,detailTKey:l}},Vm),uGe=e=>{const{t}=VG(),n=k.useMemo(()=>jG(e),[e]),{isAllowedToUpscale:r,detailTKey:i}=C2(n);return{isAllowedToUpscale:r,detail:i?t(i):void 0}},e$e=ge("upscale/upscaleRequested"),t$e=()=>{pe({actionCreator:e$e,effect:async(e,{dispatch:t,getState:n})=>{var f;const r=se("session"),{imageDTO:i}=e.payload,{image_name:o}=i,a=n(),{isAllowedToUpscale:s,detailTKey:l}=jG(i)(a);if(!s){r.error({imageDTO:i},X(l??"parameters.isAllowedToUpscale.tooLarge")),t(it({title:X(l??"parameters.isAllowedToUpscale.tooLarge"),status:"error"}));return}const{esrganModelName:u}=a.postprocessing,{autoAddBoardId:c}=a.gallery,d={prepend:!0,batch:{graph:N7e({image_name:o,esrganModelName:u,autoAddBoardId:c}),runs:1}};try{const h=t(un.endpoints.enqueueBatch.initiate(d,{fixedCacheKey:"enqueueBatch"})),p=await h.unwrap();h.reset(),r.debug({enqueueResult:pt(p)},X("queue.graphQueued"))}catch(h){if(r.error({enqueueBatchArg:pt(d)},X("queue.graphFailedToQueue")),h instanceof Object&&"data"in h&&"status"in h&&h.status===403){const p=((f=h.data)==null?void 0:f.detail)||"Unknown Error";t(it({title:X("queue.graphFailedToQueue"),status:"error",description:p,duration:15e3}));return}t(it({title:X("queue.graphFailedToQueue"),status:"error"}))}}})},n$e=Pa(null),r$e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,fb=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(r$e);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},OR=e=>e==="*"||e==="x"||e==="X",$R=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},i$e=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],o$e=(e,t)=>{if(OR(e)||OR(t))return 0;const[n,r]=i$e($R(e),$R(t));return n>r?1:n<r?-1:0},bd=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=o$e(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},UG=(e,t)=>{const n=fb(e),r=fb(t),i=n.pop(),o=r.pop(),a=bd(n,r);return a!==0?a:i&&o?bd(i.split("."),o.split(".")):i||o?i?-1:1:0},a$e=(e,t,n)=>{s$e(n);const r=UG(e,t);return GG[n].includes(r)},GG={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},NR=Object.keys(GG),s$e=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(NR.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${NR.join("|")}`)},pv=(e,t)=>{if(t=t.replace(/([><=]+)\s+/g,"$1"),t.includes("||"))return t.split("||").some(_=>pv(e,_));if(t.includes(" - ")){const[_,b]=t.split(" - ",2);return pv(e,`>=${_} <=${b}`)}else if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(_=>pv(e,_));const n=t.match(/^([<>=~^]+)/),r=n?n[1]:"=";if(r!=="^"&&r!=="~")return a$e(e,t,r);const[i,o,a,,s]=fb(e),[l,u,c,,d]=fb(t),f=[i,o,a],h=[l,u??"x",c??"x"];if(d&&(!s||bd(f,h)!==0||bd(s.split("."),d.split("."))===-1))return!1;const p=h.findIndex(_=>_!=="0")+1,g=r==="~"?2:p>1?p:1;return!(bd(f.slice(0,g),h.slice(0,g))!==0||bd(f.slice(g),h.slice(g))===-1)},l$e=(e,t)=>{const n=Ye(e),{nodes:r,edges:i}=n,o=[],a=r.filter(I5),s=xE(a,"id");return r.forEach(l=>{if(!I5(l))return;const u=t[l.data.type];if(!u){o.push({message:`${de.t("nodes.node")} "${l.data.type}" ${de.t("nodes.skipped")}`,issues:[`${de.t("nodes.nodeType")}"${l.data.type}" ${de.t("nodes.doesNotExist")}`],data:l});return}if(u.version&&l.data.version&&UG(u.version,l.data.version)!==0){o.push({message:`${de.t("nodes.node")} "${l.data.type}" ${de.t("nodes.mismatchedVersion")}`,issues:[`${de.t("nodes.node")} "${l.data.type}" v${l.data.version} ${de.t("nodes.maybeIncompatible")} v${u.version}`],data:{node:l,nodeTemplate:pt(u)}});return}}),i.forEach((l,u)=>{const c=s[l.source],d=s[l.target],f=[];if(c?l.type==="default"&&!(l.sourceHandle in c.data.outputs)&&f.push(`${de.t("nodes.outputNode")} "${l.source}.${l.sourceHandle}" ${de.t("nodes.doesNotExist")}`):f.push(`${de.t("nodes.outputNode")} ${l.source} ${de.t("nodes.doesNotExist")}`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`${de.t("nodes.inputField")} "${l.target}.${l.targetHandle}" ${de.t("nodes.doesNotExist")}`):f.push(`${de.t("nodes.inputNode")} ${l.target} ${de.t("nodes.doesNotExist")}`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${de.t("nodes.sourceNode")} "${l.source}" ${de.t("nodes.missingTemplate")} "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${de.t("nodes.sourceNode")}"${l.target}" ${de.t("nodes.missingTemplate")} "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},u$e=()=>{pe({actionCreator:v1e,effect:(e,{dispatch:t,getState:n})=>{const r=se("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:a,errors:s}=l$e(i,o);t(fve(a)),s.length?(t(it(vs({title:X("toast.loadedWithWarnings"),status:"warning"}))),s.forEach(({message:l,...u})=>{r.warn(u,l)})):t(it(vs({title:X("toast.workflowLoaded"),status:"success"}))),t(qz("nodes")),requestAnimationFrame(()=>{var l;(l=n$e.get())==null||l.fitView()})}})},c$e={Any:void 0,enum:"",BoardField:void 0,boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,IPAdapterCollection:[],IPAdapterField:void 0,IPAdapterModelField:void 0,IPAdapterPolymorphic:void 0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,MetadataItemField:void 0,MetadataItemCollection:[],MetadataItemPolymorphic:void 0,MetadataField:void 0,MetadataCollection:[],LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",T2IAdapterCollection:[],T2IAdapterField:void 0,T2IAdapterModelField:void 0,T2IAdapterPolymorphic:void 0,UNetField:void 0,VaeField:void 0,VaeModelField:void 0},d$e=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??c$e[t.type],n},Zw={dragHandle:`.${xz}`},f$e=(e,t,n)=>{const r=yl();if(e==="current_image")return{...Zw,id:r,type:"current_image",position:t,data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(e==="notes")return{...Zw,id:r,type:"notes",position:t,data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};if(n===void 0){console.error(`Unable to find template ${e}.`);return}const i=tg(n.inputs,(s,l,u)=>{const c=yl(),d=d$e(c,l);return s[u]=d,s},{}),o=tg(n.outputs,(s,l,u)=>{const d={id:yl(),name:u,type:l.type,fieldKind:"output"};return s[u]=d,s},{});return{...Zw,id:r,type:"invocation",position:t,data:{id:r,type:e,version:n.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:e!=="save_image",inputs:i,outputs:o,useCache:n.useCache}}},h$e=()=>{const e=w2(),t=C2(r=>r.system.toastQueue),n=gPe();return k.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(vve())},[e,n,t]),null},p$e=()=>{const e=w2();return k.useCallback(n=>e(it(vs(n))),[e])},cGe=k.memo(h$e),hb=(e,t)=>!on(e)||!t?!1:e.data.version!==t.version,HG=(e,t)=>{if(!hb(e,t)||!on(e)||!t||!e.data.version)return!1;const r=Pfe.parse(t.version).major;return pv(e.data.version,`^${r}`)},qG=(e,t)=>{if(!HG(e,t)||!on(e)||!t||!e.data.version)return;const r=f$e(e.data.type,e.position,t),i=Ye(e);return i.data.version=t.version,ID(i,r),i},dGe=e=>{const t=w2(),n=p$e(),{t:r}=VG(),i=k.useMemo(()=>qn(IA,({nodes:c})=>{const d=c.nodes.find(h=>h.id===e),f=c.nodeTemplates[(d==null?void 0:d.data.type)??""];return{node:d,nodeTemplate:f}},Vm),[e]),{node:o,nodeTemplate:a}=C2(i),s=k.useMemo(()=>hb(o,a),[o,a]),l=k.useMemo(()=>HG(o,a),[o,a]),u=k.useCallback(()=>{const c=hb(o,a),d=qG(o,a);if(!d){c&&n({title:r("nodes.unableToUpdateNodes",{count:1})});return}t(Oz({nodeId:d.id,node:d}))},[t,o,a,r,n]);return{needsUpdate:s,mayUpdate:l,updateNode:u}},g$e=()=>{pe({actionCreator:b1e,effect:(e,{dispatch:t,getState:n})=>{const r=se("nodes"),i=n().nodes.nodes,o=n().nodes.nodeTemplates;let a=0;i.forEach(s=>{const l=o[s.data.type],u=hb(s,l),c=qG(s,l);if(!c){u&&a++;return}t(Oz({nodeId:c.id,node:c}))}),a&&(r.warn(`Unable to update ${a} nodes. Please report this issue.`),t(it(vs({title:X("nodes.unableToUpdateNodes",{count:a})}))))}})},WG=mN(),pe=WG.startListening;HRe();qRe();YRe();DRe();LRe();FRe();BRe();zRe();C6e();GRe();WRe();KRe();mRe();ORe();CRe();T1e();x6e();HMe();VMe();z6e();jMe();B6e();L6e();GMe();R7e();C1e();_7e();S7e();w7e();C7e();T7e();v7e();b7e();I7e();M7e();A7e();k7e();E7e();P7e();KMe();WMe();$Re();NRe();jRe();URe();E6e();y7e();u$e();g$e();VRe();ZRe();k1e();eOe();A1e();E1e();t$e();$7e();rOe();const m$e={canvas:Nle,gallery:Lfe,generation:dae,nodes:hve,postprocessing:pve,system:xve,config:Yre,ui:Ave,hotkeys:Tve,controlAdapters:jie,dynamicPrompts:Wle,deleteImageModal:zle,changeBoardModal:Lle,lora:zfe,modelmanager:Eve,sdxl:mve,queue:Cae,[Do.reducerPath]:Do.reducer},y$e=Mf(m$e),v$e=Zve(y$e),b$e=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlAdapters","dynamicPrompts","lora","modelmanager"],KG=Y$({reducer:v$e,enhancers:e=>e.concat(Jve(window.localStorage,b$e,{persistDebounce:300,serialize:d1e,unserialize:h1e,prefix:e1e})).concat(vN()),middleware:e=>e({serializableCheck:!1,immutableCheck:!1}).concat(Do.middleware).concat(Mve).prepend(WG.middleware),devTools:{actionSanitizer:_1e,stateSanitizer:x1e,trace:!0,predicate:(e,t)=>!S1e.includes(t.type)}}),IA=e=>e;BF.set(KG);const _$e=e=>{const{socket:t,storeApi:n}=e,{dispatch:r}=n;t.on("connect",()=>{se("socketio").debug("Connected"),r(VD());const o=Dn.get();t.emit("subscribe_queue",{queue_id:o})}),t.on("connect_error",i=>{i&&i.message&&i.data==="ERR_UNAUTHENTICATED"&&r(it(vs({title:i.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(jD())}),t.on("invocation_started",i=>{r(GD({data:i}))}),t.on("generator_progress",i=>{r(KD({data:i}))}),t.on("invocation_error",i=>{r(HD({data:i}))}),t.on("invocation_complete",i=>{r(TE({data:i}))}),t.on("graph_execution_state_complete",i=>{r(qD({data:i}))}),t.on("model_load_started",i=>{r(XD({data:i}))}),t.on("model_load_completed",i=>{r(YD({data:i}))}),t.on("session_retrieval_error",i=>{r(JD({data:i}))}),t.on("invocation_retrieval_error",i=>{r(tL({data:i}))}),t.on("queue_item_status_changed",i=>{r(rL({data:i}))})},Ca=Object.create(null);Ca.open="0";Ca.close="1";Ca.ping="2";Ca.pong="3";Ca.message="4";Ca.upgrade="5";Ca.noop="6";const gv=Object.create(null);Object.keys(Ca).forEach(e=>{gv[Ca[e]]=e});const j3={type:"error",data:"parser error"},XG=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",QG=typeof ArrayBuffer=="function",YG=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,MA=({type:e,data:t},n,r)=>XG&&t instanceof Blob?n?r(t):DR(t,r):QG&&(t instanceof ArrayBuffer||YG(t))?n?r(t):DR(new Blob([t]),r):r(Ca[e]+(t||"")),DR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function LR(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Jw;function S$e(e,t){if(XG&&e.data instanceof Blob)return e.data.arrayBuffer().then(LR).then(t);if(QG&&(e.data instanceof ArrayBuffer||YG(e.data)))return t(LR(e.data));MA(e,!1,n=>{Jw||(Jw=new TextEncoder),t(Jw.encode(n))})}const FR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ep=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<FR.length;e++)ep[FR.charCodeAt(e)]=e;const x$e=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=ep[e.charCodeAt(r)],a=ep[e.charCodeAt(r+1)],s=ep[e.charCodeAt(r+2)],l=ep[e.charCodeAt(r+3)],c[i++]=o<<2|a>>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},w$e=typeof ArrayBuffer=="function",RA=(e,t)=>{if(typeof e!="string")return{type:"message",data:ZG(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:C$e(e.substring(1),t)}:gv[n]?e.length>1?{type:gv[n],data:e.substring(1)}:{type:gv[n]}:j3},C$e=(e,t)=>{if(w$e){const n=x$e(e);return ZG(n,t)}else return{base64:!0,data:e}},ZG=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},JG=String.fromCharCode(30),E$e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{MA(o,!1,s=>{r[a]=s,++i===n&&t(r.join(JG))})})},T$e=(e,t)=>{const n=e.split(JG),r=[];for(let i=0;i<n.length;i++){const o=RA(n[i],t);if(r.push(o),o.type==="error")break}return r};function A$e(){return new TransformStream({transform(e,t){S$e(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let eC;function Sy(e){return e.reduce((t,n)=>t+n.length,0)}function xy(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function P$e(e,t){eC||(eC=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(Sy(n)<1)break;const l=xy(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Sy(n)<2)break;const l=xy(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Sy(n)<8)break;const l=xy(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(j3);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Sy(n)<i)break;const l=xy(n,i);s.enqueue(RA(o?l:eC.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(j3);break}}}})}const eH=4;function En(e){if(e)return k$e(e)}function k$e(e){for(var t in En.prototype)e[t]=En.prototype[t];return e}En.prototype.on=En.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};En.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};En.prototype.off=En.prototype.removeListener=En.prototype.removeAllListeners=En.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};En.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};En.prototype.emitReserved=En.prototype.emit;En.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};En.prototype.hasListeners=function(e){return!!this.listeners(e).length};const qi=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function tH(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const I$e=qi.setTimeout,M$e=qi.clearTimeout;function E2(e,t){t.useNativeTimers?(e.setTimeoutFn=I$e.bind(qi),e.clearTimeoutFn=M$e.bind(qi)):(e.setTimeoutFn=qi.setTimeout.bind(qi),e.clearTimeoutFn=qi.clearTimeout.bind(qi))}const R$e=1.33;function O$e(e){return typeof e=="string"?$$e(e):Math.ceil((e.byteLength||e.size)*R$e)}function $$e(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 N$e(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function D$e(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 L$e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class OA extends En{constructor(t){super(),this.writable=!1,E2(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new L$e(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=RA(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=N$e(t);return n.length?"?"+n:""}}const nH="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),U3=64,F$e={};let BR=0,wy=0,zR;function VR(e){let t="";do t=nH[e%U3]+t,e=Math.floor(e/U3);while(e>0);return t}function rH(){const e=VR(+new Date);return e!==zR?(BR=0,zR=e):e+"."+VR(BR++)}for(;wy<U3;wy++)F$e[nH[wy]]=wy;let iH=!1;try{iH=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const B$e=iH;function oH(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||B$e))return new XMLHttpRequest}catch{}if(!t)try{return new qi[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function z$e(){}const V$e=function(){return new oH({xdomain:!1}).responseType!=null}();class j$e extends OA{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=V$e&&!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)};T$e(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,E$e(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]=rH()),!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 qd(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 qd=class mv extends En{constructor(t,n){super(),E2(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=tH(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new oH(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=mv.requestsCount++,mv.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=z$e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete mv.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()}};qd.requestsCount=0;qd.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jR);else if(typeof addEventListener=="function"){const e="onpagehide"in qi?"pagehide":"unload";addEventListener(e,jR,!1)}}function jR(){for(let e in qd.requests)qd.requests.hasOwnProperty(e)&&qd.requests[e].abort()}const $A=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Cy=qi.WebSocket||qi.MozWebSocket,UR=!0,U$e="arraybuffer",GR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class G$e extends OA{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=GR?{}:tH(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=UR&&!GR?n?new Cy(t,n):new Cy(t):new Cy(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,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;MA(r,this.supportsBinary,o=>{const a={};try{UR&&this.ws.send(o)}catch{}i&&$A(()=>{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]=rH()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Cy}}class H$e extends OA{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=P$e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=A$e();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).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;this.writer.write(r).then(()=>{i&&$A(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const q$e={websocket:G$e,webtransport:H$e,polling:j$e},W$e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,K$e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function G3(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=W$e.exec(e||""),o={},a=14;for(;a--;)o[K$e[a]]=i[a]||"";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=X$e(o,o.path),o.queryKey=Q$e(o,o.query),o}function X$e(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 Q$e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let aH=class Xc extends En{constructor(t,n={}){super(),this.binaryType=U$e,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=G3(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=G3(n.host).host),E2(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=D$e(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=eH,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 q$e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Xc.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;Xc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),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",Xc.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"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":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+=O$e(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){Xc.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}};aH.protocol=eH;function Y$e(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=G3(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 Z$e=typeof ArrayBuffer=="function",J$e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,sH=Object.prototype.toString,eNe=typeof Blob=="function"||typeof Blob<"u"&&sH.call(Blob)==="[object BlobConstructor]",tNe=typeof File=="function"||typeof File<"u"&&sH.call(File)==="[object FileConstructor]";function NA(e){return Z$e&&(e instanceof ArrayBuffer||J$e(e))||eNe&&e instanceof Blob||tNe&&e instanceof File}function yv(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(yv(e[n]))return!0;return!1}if(NA(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return yv(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&yv(e[n]))return!0;return!1}function nNe(e){const t=[],n=e.data,r=e;return r.data=H3(n,t),r.attachments=t.length,{packet:r,buffers:t}}function H3(e,t){if(!e)return e;if(NA(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]=H3(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]=H3(e[r],t));return n}return e}function rNe(e,t){return e.data=q3(e.data,t),delete e.attachments,e}function q3(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]=q3(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=q3(e[n],t));return e}const iNe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],oNe=5;var Ze;(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"})(Ze||(Ze={}));class aNe{constructor(t){this.replacer=t}encode(t){return(t.type===Ze.EVENT||t.type===Ze.ACK)&&yv(t)?this.encodeAsBinary({type:t.type===Ze.EVENT?Ze.BINARY_EVENT:Ze.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ze.BINARY_EVENT||t.type===Ze.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=nNe(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function HR(e){return Object.prototype.toString.call(e)==="[object Object]"}class DA extends En{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===Ze.BINARY_EVENT;r||n.type===Ze.BINARY_ACK?(n.type=r?Ze.EVENT:Ze.ACK,this.reconstructor=new sNe(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(NA(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(Ze[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ze.BINARY_EVENT||r.type===Ze.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}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 a=t.charAt(n);if(a==null||Number(a)!=a){--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(DA.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 Ze.CONNECT:return HR(n);case Ze.DISCONNECT:return n===void 0;case Ze.CONNECT_ERROR:return typeof n=="string"||HR(n);case Ze.EVENT:case Ze.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&iNe.indexOf(n[0])===-1);case Ze.ACK:case Ze.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sNe{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=rNe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const lNe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:DA,Encoder:aNe,get PacketType(){return Ze},protocol:oNe},Symbol.toStringTag,{value:"Module"}));function bo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const uNe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class lH extends En{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=[bo(t,"open",this.onopen.bind(this)),bo(t,"packet",this.onpacket.bind(this)),bo(t,"error",this.onerror.bind(this)),bo(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(uNe.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:Ze.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}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 a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),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:Ze.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 Ze.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 Ze.EVENT:case Ze.BINARY_EVENT:this.onevent(t);break;case Ze.ACK:case Ze.BINARY_ACK:this.onack(t);break;case Ze.DISCONNECT:this.ondisconnect();break;case Ze.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:Ze.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:Ze.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 Wf(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}Wf.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};Wf.prototype.reset=function(){this.attempts=0};Wf.prototype.setMin=function(e){this.ms=e};Wf.prototype.setMax=function(e){this.max=e};Wf.prototype.setJitter=function(e){this.jitter=e};class W3 extends En{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,E2(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 Wf({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||lNe;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 aH(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=bo(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=bo(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(bo(t,"ping",this.onping.bind(this)),bo(t,"data",this.ondata.bind(this)),bo(t,"error",this.onerror.bind(this)),bo(t,"close",this.onclose.bind(this)),bo(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){$A(()=>{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 lH(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 $h={};function vv(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Y$e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=$h[i]&&o in $h[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new W3(r,t):($h[i]||($h[i]=new W3(r,t)),l=$h[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(vv,{Manager:W3,Socket:lH,io:vv,connect:vv});const qR=()=>{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 a=vg.get();a&&(n=a.replace(/^https?\:\/\//i,""));const s=yg.get();s&&(r.auth={token:s}),r.transports=["websocket","polling"]}const i=vv(n,r);return a=>s=>l=>{e||(_$e({storeApi:a,socket:i}),e=!0,i.connect()),s(l)}},cNe=""+new URL("logo-13003d72.png",import.meta.url).href,dNe=()=>oe.jsxs(sA,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[oe.jsx(aA,{src:cNe,w:"8rem",h:"8rem"}),oe.jsx(rA,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),fNe=k.memo(dNe);function K3(e){"@babel/helpers - typeof";return K3=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},K3(e)}var uH=[],hNe=uH.forEach,pNe=uH.slice;function X3(e){return hNe.call(pNe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function cH(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":K3(XMLHttpRequest))==="object"}function gNe(e){return!!e&&typeof e.then=="function"}function mNe(e){return gNe(e)?e:Promise.resolve(e)}function yNe(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 Q3={exports:{}},Ey={exports:{}},WR;function vNe(){return WR||(WR=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof He<"u"&&He,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s=typeof o<"u"&&o||typeof self<"u"&&self||typeof s<"u"&&s,l={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(A){return A&&DataView.prototype.isPrototypeOf(A)}if(l.arrayBuffer)var c=["[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&&c.indexOf(Object.prototype.toString.call(A))>-1};function f(A){if(typeof A!="string"&&(A=String(A)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(A)||A==="")throw new TypeError('Invalid character in header field name: "'+A+'"');return A.toLowerCase()}function h(A){return typeof A!="string"&&(A=String(A)),A}function p(A){var R={next:function(){var D=A.shift();return{done:D===void 0,value:D}}};return l.iterable&&(R[Symbol.iterator]=function(){return R}),R}function g(A){this.map={},A instanceof g?A.forEach(function(R,D){this.append(D,R)},this):Array.isArray(A)?A.forEach(function(R){this.append(R[0],R[1])},this):A&&Object.getOwnPropertyNames(A).forEach(function(R){this.append(R,A[R])},this)}g.prototype.append=function(A,R){A=f(A),R=h(R);var D=this.map[A];this.map[A]=D?D+", "+R:R},g.prototype.delete=function(A){delete this.map[f(A)]},g.prototype.get=function(A){return A=f(A),this.has(A)?this.map[A]:null},g.prototype.has=function(A){return this.map.hasOwnProperty(f(A))},g.prototype.set=function(A,R){this.map[f(A)]=h(R)},g.prototype.forEach=function(A,R){for(var D in this.map)this.map.hasOwnProperty(D)&&A.call(R,this.map[D],D,this)},g.prototype.keys=function(){var A=[];return this.forEach(function(R,D){A.push(D)}),p(A)},g.prototype.values=function(){var A=[];return this.forEach(function(R){A.push(R)}),p(A)},g.prototype.entries=function(){var A=[];return this.forEach(function(R,D){A.push([D,R])}),p(A)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function _(A){if(A.bodyUsed)return Promise.reject(new TypeError("Already read"));A.bodyUsed=!0}function b(A){return new Promise(function(R,D){A.onload=function(){R(A.result)},A.onerror=function(){D(A.error)}})}function y(A){var R=new FileReader,D=b(R);return R.readAsArrayBuffer(A),D}function m(A){var R=new FileReader,D=b(R);return R.readAsText(A),D}function v(A){for(var R=new Uint8Array(A),D=new Array(R.length),$=0;$<R.length;$++)D[$]=String.fromCharCode(R[$]);return D.join("")}function S(A){if(A.slice)return A.slice(0);var R=new Uint8Array(A.byteLength);return R.set(new Uint8Array(A)),R.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(A){this.bodyUsed=this.bodyUsed,this._bodyInit=A,A?typeof A=="string"?this._bodyText=A:l.blob&&Blob.prototype.isPrototypeOf(A)?this._bodyBlob=A:l.formData&&FormData.prototype.isPrototypeOf(A)?this._bodyFormData=A:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)?this._bodyText=A.toString():l.arrayBuffer&&l.blob&&u(A)?(this._bodyArrayBuffer=S(A.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.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):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var A=_(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(){if(this._bodyArrayBuffer){var A=_(this);return A||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(y)}),this.text=function(){var A=_(this);if(A)return A;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(v(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(A){var R=A.toUpperCase();return C.indexOf(R)>-1?R:A}function P(A,R){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var D=R.body;if(A instanceof P){if(A.bodyUsed)throw new TypeError("Already read");this.url=A.url,this.credentials=A.credentials,R.headers||(this.headers=new g(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=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new g(R.headers)),this.method=x(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(D),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var $=/([?&])_=[^&]*/;if($.test(this.url))this.url=this.url.replace($,"$1_="+new Date().getTime());else{var L=/\?/;this.url+=(L.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function E(A){var R=new FormData;return A.trim().split("&").forEach(function(D){if(D){var $=D.split("="),L=$.shift().replace(/\+/g," "),O=$.join("=").replace(/\+/g," ");R.append(decodeURIComponent(L),decodeURIComponent(O))}}),R}function I(A){var R=new g,D=A.replace(/\r?\n[\t ]+/g," ");return D.split("\r").map(function($){return $.indexOf(`
`)===0?$.substr(1,$.length):$}).forEach(function($){var L=$.split(":"),O=L.shift().trim();if(O){var B=L.join(":").trim();R.append(O,B)}}),R}w.call(P.prototype);function N(A,R){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new g(R.headers),this.url=R.url||"",this._initBody(A)}w.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},N.error=function(){var A=new N(null,{status:0,statusText:""});return A.type="error",A};var M=[301,302,303,307,308];N.redirect=function(A,R){if(M.indexOf(R)===-1)throw new RangeError("Invalid status code");return new N(null,{status:R,headers:{location:A}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(R,D){this.message=R,this.name=D;var $=Error(R);this.stack=$.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function T(A,R){return new Promise(function(D,$){var L=new P(A,R);if(L.signal&&L.signal.aborted)return $(new a.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function B(){O.abort()}O.onload=function(){var j={status:O.status,statusText:O.statusText,headers:I(O.getAllResponseHeaders()||"")};j.url="responseURL"in O?O.responseURL:j.headers.get("X-Request-URL");var q="response"in O?O.response:O.responseText;setTimeout(function(){D(new N(q,j))},0)},O.onerror=function(){setTimeout(function(){$(new TypeError("Network request failed"))},0)},O.ontimeout=function(){setTimeout(function(){$(new TypeError("Network request failed"))},0)},O.onabort=function(){setTimeout(function(){$(new a.DOMException("Aborted","AbortError"))},0)};function U(j){try{return j===""&&s.location.href?s.location.href:j}catch{return j}}O.open(L.method,U(L.url),!0),L.credentials==="include"?O.withCredentials=!0:L.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&(l.blob?O.responseType="blob":l.arrayBuffer&&L.headers.get("Content-Type")&&L.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(O.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof g)?Object.getOwnPropertyNames(R.headers).forEach(function(j){O.setRequestHeader(j,h(R.headers[j]))}):L.headers.forEach(function(j,q){O.setRequestHeader(q,j)}),L.signal&&(L.signal.addEventListener("abort",B),O.onreadystatechange=function(){O.readyState===4&&L.signal.removeEventListener("abort",B)}),O.send(typeof L._bodyInit>"u"?null:L._bodyInit)})}return T.polyfill=!0,s.fetch||(s.fetch=T,s.Headers=g,s.Request=P,s.Response=N),a.Headers=g,a.Request=P,a.Response=N,a.fetch=T,a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n: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}(Ey,Ey.exports)),Ey.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof He<"u"&&He.fetch?n=He.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof yNe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||vNe();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(Q3,Q3.exports);var dH=Q3.exports;const fH=Bl(dH),KR=gO({__proto__:null,default:fH},[dH]);function pb(e){"@babel/helpers - typeof";return pb=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},pb(e)}var ls;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?ls=global.fetch:typeof window<"u"&&window.fetch?ls=window.fetch:ls=fetch);var Wg;cH()&&(typeof global<"u"&&global.XMLHttpRequest?Wg=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Wg=window.XMLHttpRequest));var gb;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?gb=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(gb=window.ActiveXObject));!ls&&KR&&!Wg&&!gb&&(ls=fH||KR);typeof ls!="function"&&(ls=void 0);var Y3=function(t,n){if(n&&pb(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},XR=function(t,n,r){var i=function(a){if(!a.ok)return r(a.statusText||"Error",{status:a.status});a.text().then(function(s){r(null,{status:a.status,data:s})}).catch(r)};typeof fetch=="function"?fetch(t,n).then(i).catch(r):ls(t,n).then(i).catch(r)},QR=!1,bNe=function(t,n,r,i){t.queryStringParams&&(n=Y3(n,t.queryStringParams));var o=X3({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=X3({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},QR?{}:a);try{XR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),XR(n,s,i),QR=!0}catch(u){i(u)}}},_Ne=function(t,n,r,i){r&&pb(r)==="object"&&(r=Y3("",r).slice(1)),t.queryStringParams&&(n=Y3(n,t.queryStringParams));try{var o;Wg?o=new Wg:o=new gb("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 a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);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)}},SNe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},ls&&n.indexOf("file:")!==0)return bNe(t,n,r,i);if(cH()||typeof ActiveXObject=="function")return _Ne(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Kg(e){"@babel/helpers - typeof";return Kg=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},Kg(e)}function xNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YR(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,hH(r.key),r)}}function wNe(e,t,n){return t&&YR(e.prototype,t),n&&YR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CNe(e,t,n){return t=hH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hH(e){var t=ENe(e,"string");return Kg(t)==="symbol"?t:String(t)}function ENe(e,t){if(Kg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TNe=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return CNe({},r,i||"")},parseLoadPayload:function(n,r){},request:SNe,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},pH=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]:{};xNe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return wNe(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=X3(i,this.options||{},TNe()),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,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=mNe(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(c,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,h;try{typeof d.data=="string"?f=a.options.parse(d.data,i,o):f=d.data}catch{h="failed parsing "+n+" to json"}if(h)return r(h,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var p=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,p,l,function(g,_){u+=1,c.push(g),d.push(_),u===n.length&&typeof a=="function"&&a(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(c),h),i.loaded("".concat(c,"|").concat(d),f,h)})})})}}}]),e}();pH.type="backend";de.use(pH).use(W7e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const T2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Kf(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function LA(e){return"nodeType"in e}function zr(e){var t,n;return e?Kf(e)?e:LA(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function FA(e){const{Document:t}=zr(e);return e instanceof t}function Wm(e){return Kf(e)?!1:e instanceof zr(e).HTMLElement}function gH(e){return e instanceof zr(e).SVGElement}function Xf(e){return e?Kf(e)?e.document:LA(e)?FA(e)?e:Wm(e)||gH(e)?e.ownerDocument:document:document:document}const Ea=T2?k.useLayoutEffect:k.useEffect;function A2(e){const t=k.useRef(e);return Ea(()=>{t.current=e}),k.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 ANe(){const e=k.useRef(null),t=k.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Xg(e,t){t===void 0&&(t=[e]);const n=k.useRef(e);return Ea(()=>{n.current!==e&&(n.current=e)},t),n}function Km(e,t){const n=k.useRef();return k.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function mb(e){const t=A2(e),n=k.useRef(null),r=k.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function yb(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let tC={};function P2(e,t){return k.useMemo(()=>{if(t)return t;const n=tC[e]==null?0:tC[e]+1;return tC[e]=n,e+"-"+n},[e,t])}function mH(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,a)=>{const s=Object.entries(a);for(const[l,u]of s){const c=o[l];c!=null&&(o[l]=c+e*u)}return o},{...t})}}const Wd=mH(1),vb=mH(-1);function PNe(e){return"clientX"in e&&"clientY"in e}function BA(e){if(!e)return!1;const{KeyboardEvent:t}=zr(e.target);return t&&e instanceof t}function kNe(e){if(!e)return!1;const{TouchEvent:t}=zr(e.target);return t&&e instanceof t}function Qg(e){if(kNe(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 PNe(e)?{x:e.clientX,y:e.clientY}:null}const Yg=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[Yg.Translate.toString(e),Yg.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ZR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function INe(e){return e.matches(ZR)?e:e.querySelector(ZR)}const MNe={display:"none"};function RNe(e){let{id:t,value:n}=e;return J.createElement("div",{id:t,style:MNe},n)}function ONe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={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"};return J.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function $Ne(){const[e,t]=k.useState("");return{announce:k.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const yH=k.createContext(null);function NNe(e){const t=k.useContext(yH);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function DNe(){const[e]=k.useState(()=>new Set),t=k.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[k.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const LNe={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.
`},FNe={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 BNe(e){let{announcements:t=FNe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=LNe}=e;const{announce:o,announcement:a}=$Ne(),s=P2("DndLiveRegion"),[l,u]=k.useState(!1);if(k.useEffect(()=>{u(!0)},[]),NNe(k.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const c=J.createElement(J.Fragment,null,J.createElement(RNe,{id:r,value:i.draggable}),J.createElement(ONe,{id:s,announcement:a}));return n?mi.createPortal(c,n):c}var kn;(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"})(kn||(kn={}));function bb(){}function JR(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function zNe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Fo=Object.freeze({x:0,y:0});function VNe(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jNe(e,t){const n=Qg(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 UNe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function GNe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function HNe(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 qNe(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function WNe(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),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,c=a*s,d=c/(l+u-c);return Number(d.toFixed(4))}return 0}const KNe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=WNe(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(GNe)};function XNe(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 QNe=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:a}=o,s=n.get(a);if(s&&XNe(r,s)){const u=HNe(s).reduce((d,f)=>d+VNe(r,f),0),c=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(UNe)};function YNe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function vH(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fo}function ZNe(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((a,s)=>({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const JNe=ZNe(1);function bH(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 eDe(e,t,n){const r=bH(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const tDe={ignoreTransform:!1};function Xm(e,t){t===void 0&&(t=tDe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=zr(e).getComputedStyle(e);u&&(n=eDe(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function eO(e){return Xm(e,{ignoreTransform:!0})}function nDe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function rDe(e,t){return t===void 0&&(t=zr(e).getComputedStyle(e)),t.position==="fixed"}function iDe(e,t){t===void 0&&(t=zr(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 zA(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(FA(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Wm(i)||gH(i)||n.includes(i))return n;const o=zr(e).getComputedStyle(i);return i!==e&&iDe(i,o)&&n.push(i),rDe(i,o)?n:r(i.parentNode)}return e?r(e):n}function _H(e){const[t]=zA(e,1);return t??null}function nC(e){return!T2||!e?null:Kf(e)?e:LA(e)?FA(e)||e===Xf(e).scrollingElement?window:Wm(e)?e:null:null}function SH(e){return Kf(e)?e.scrollX:e.scrollLeft}function xH(e){return Kf(e)?e.scrollY:e.scrollTop}function Z3(e){return{x:SH(e),y:xH(e)}}var jn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(jn||(jn={}));function wH(e){return!T2||!e?!1:e===document.scrollingElement}function CH(e){const t={x:0,y:0},n=wH(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,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const oDe={x:.2,y:.2};function aDe(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=oDe);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=CH(e),h={x:0,y:0},p={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+g.height?(h.y=jn.Backward,p.y=r*Math.abs((t.top+g.height-o)/g.height)):!c&&l>=t.bottom-g.height&&(h.y=jn.Forward,p.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!f&&s>=t.right-g.width?(h.x=jn.Forward,p.x=r*Math.abs((t.right-g.width-s)/g.width)):!d&&a<=t.left+g.width&&(h.x=jn.Backward,p.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:h,speed:p}}function sDe(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}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 EH(e){return e.reduce((t,n)=>Wd(t,Z3(n)),Fo)}function lDe(e){return e.reduce((t,n)=>t+SH(n),0)}function uDe(e){return e.reduce((t,n)=>t+xH(n),0)}function TH(e,t){if(t===void 0&&(t=Xm),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);_H(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const cDe=[["x",["left","right"],lDe],["y",["top","bottom"],uDe]];class VA{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=zA(n),i=EH(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of cDe)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),c=i[o]-u;return this.rect[l]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ep{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 dDe(e){const{EventTarget:t}=zr(e);return e instanceof t?e:Xf(e)}function rC(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 Ui;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ui||(Ui={}));function tO(e){e.preventDefault()}function fDe(e){e.stopPropagation()}var At;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(At||(At={}));const AH={start:[At.Space,At.Enter],cancel:[At.Esc],end:[At.Space,At.Enter]},hDe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case At.Right:return{...n,x:n.x+25};case At.Left:return{...n,x:n.x-25};case At.Down:return{...n,y:n.y+25};case At.Up:return{...n,y:n.y-25}}};class PH{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 Ep(Xf(n)),this.windowListeners=new Ep(zr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ui.Resize,this.handleCancel),this.windowListeners.add(Ui.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ui.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&TH(r),n(Fo)}handleKeyDown(t){if(BA(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=AH,coordinateGetter:a=hDe,scrollBehavior:s="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,c=u?{x:u.left,y:u.top}:Fo;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=vb(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const g of p){const _=t.code,{isTop:b,isRight:y,isLeft:m,isBottom:v,maxScroll:S,minScroll:w}=CH(g),C=sDe(g),x={x:Math.min(_===At.Right?C.right-C.width/2:C.right,Math.max(_===At.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(_===At.Down?C.bottom-C.height/2:C.bottom,Math.max(_===At.Down?C.top:C.top+C.height/2,d.y))},P=_===At.Right&&!y||_===At.Left&&!m,E=_===At.Down&&!v||_===At.Up&&!b;if(P&&x.x!==d.x){const I=g.scrollLeft+f.x,N=_===At.Right&&I<=S.x||_===At.Left&&I>=w.x;if(N&&!f.y){g.scrollTo({left:I,behavior:s});return}N?h.x=g.scrollLeft-I:h.x=_===At.Right?g.scrollLeft-S.x:g.scrollLeft-w.x,h.x&&g.scrollBy({left:-h.x,behavior:s});break}else if(E&&x.y!==d.y){const I=g.scrollTop+f.y,N=_===At.Down&&I<=S.y||_===At.Up&&I>=w.y;if(N&&!f.x){g.scrollTo({top:I,behavior:s});return}N?h.y=g.scrollTop-I:h.y=_===At.Down?g.scrollTop-S.y:g.scrollTop-w.y,h.y&&g.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,Wd(vb(d,this.referenceCoordinates),h))}}}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()}}PH.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=AH,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function nO(e){return!!(e&&"distance"in e)}function rO(e){return!!(e&&"delay"in e)}class jA{constructor(t,n,r){var i;r===void 0&&(r=dDe(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:a}=o;this.props=t,this.events=n,this.document=Xf(a),this.documentListeners=new Ep(this.document),this.listeners=new Ep(r),this.windowListeners=new Ep(zr(a)),this.initialCoordinates=(i=Qg(o))!=null?i:Fo,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,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Ui.Resize,this.handleCancel),this.windowListeners.add(Ui.DragStart,tO),this.windowListeners.add(Ui.VisibilityChange,this.handleCancel),this.windowListeners.add(Ui.ContextMenu,tO),this.documentListeners.add(Ui.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rO(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(nO(n))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(Ui.Click,fDe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ui.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=Qg(t))!=null?n:Fo,u=vb(i,l);if(!r&&s){if(nO(s)){if(s.tolerance!=null&&rC(u,s.tolerance))return this.handleCancel();if(rC(u,s.distance))return this.handleStart()}return rO(s)&&rC(u,s.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===At.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const pDe={move:{name:"pointermove"},end:{name:"pointerup"}};class kH extends jA{constructor(t){const{event:n}=t,r=Xf(n.target);super(t,pDe,r)}}kH.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 gDe={move:{name:"mousemove"},end:{name:"mouseup"}};var J3;(function(e){e[e.RightClick=2]="RightClick"})(J3||(J3={}));class IH extends jA{constructor(t){super(t,gDe,Xf(t.event.target))}}IH.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===J3.RightClick?!1:(r==null||r({event:n}),!0)}}];const iC={move:{name:"touchmove"},end:{name:"touchend"}};class MH extends jA{constructor(t){super(t,iC)}static setup(){return window.addEventListener(iC.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(iC.move.name,t)};function t(){}}}MH.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 Tp;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Tp||(Tp={}));var _b;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(_b||(_b={}));function mDe(e){let{acceleration:t,activator:n=Tp.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=_b.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const h=vDe({delta:d,disabled:!o}),[p,g]=ANe(),_=k.useRef({x:0,y:0}),b=k.useRef({x:0,y:0}),y=k.useMemo(()=>{switch(n){case Tp.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Tp.DraggableRect:return i}},[n,i,l]),m=k.useRef(null),v=k.useCallback(()=>{const w=m.current;if(!w)return;const C=_.current.x*b.current.x,x=_.current.y*b.current.y;w.scrollBy(C,x)},[]),S=k.useMemo(()=>s===_b.TreeOrder?[...u].reverse():u,[s,u]);k.useEffect(()=>{if(!o||!u.length||!y){g();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const C=u.indexOf(w),x=c[C];if(!x)continue;const{direction:P,speed:E}=aDe(w,x,y,t,f);for(const I of["x","y"])h[I][P[I]]||(E[I]=0,P[I]=0);if(E.x>0||E.y>0){g(),m.current=w,p(v,a),_.current=E,b.current=P;return}}_.current={x:0,y:0},b.current={x:0,y:0},g()},[t,v,r,g,o,a,JSON.stringify(y),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const yDe={x:{[jn.Backward]:!1,[jn.Forward]:!1},y:{[jn.Backward]:!1,[jn.Forward]:!1}};function vDe(e){let{delta:t,disabled:n}=e;const r=yb(t);return Km(i=>{if(n||!r||!i)return yDe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[jn.Backward]:i.x[jn.Backward]||o.x===-1,[jn.Forward]:i.x[jn.Forward]||o.x===1},y:{[jn.Backward]:i.y[jn.Backward]||o.y===-1,[jn.Forward]:i.y[jn.Forward]||o.y===1}}},[n,t,r])}function bDe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Km(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function _De(e,t){return k.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Zg;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Zg||(Zg={}));var e4;(function(e){e.Optimized="optimized"})(e4||(e4={}));const iO=new Map;function SDe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=k.useState(null),{frequency:s,measure:l,strategy:u}=i,c=k.useRef(e),d=_(),f=Xg(d),h=k.useCallback(function(b){b===void 0&&(b=[]),!f.current&&a(y=>y===null?b:y.concat(b.filter(m=>!y.includes(m))))},[f]),p=k.useRef(null),g=Km(b=>{if(d&&!n)return iO;if(!b||b===iO||c.current!==e||o!=null){const y=new Map;for(let m of e){if(!m)continue;if(o&&o.length>0&&!o.includes(m.id)&&m.rect.current){y.set(m.id,m.rect.current);continue}const v=m.node.current,S=v?new VA(l(v),v):null;m.rect.current=S,S&&y.set(m.id,S)}return y}return b},[e,o,n,d,l]);return k.useEffect(()=>{c.current=e},[e]),k.useEffect(()=>{d||h()},[n,d]),k.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),k.useEffect(()=>{d||typeof s!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},s))},[s,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:o!=null};function _(){switch(u){case Zg.Always:return!1;case Zg.BeforeDragging:return n;default:return!n}}}function UA(e,t){return Km(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xDe(e,t){return UA(e,t)}function wDe(e){let{callback:t,disabled:n}=e;const r=A2(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function k2(e){let{callback:t,disabled:n}=e;const r=A2(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function CDe(e){return new VA(Xm(e),e)}function oO(e,t,n){t===void 0&&(t=CDe);const[r,i]=k.useReducer(s,null),o=wDe({callback(l){if(e)for(const u of l){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=k2({callback:i});return Ea(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const c=t(e);return JSON.stringify(l)===JSON.stringify(c)?l:c}}function EDe(e){const t=UA(e);return vH(e,t)}const aO=[];function TDe(e){const t=k.useRef(e),n=Km(r=>e?r&&r!==aO&&e&&t.current&&e.parentNode===t.current.parentNode?r:zA(e):aO,[e]);return k.useEffect(()=>{t.current=e},[e]),n}function ADe(e){const[t,n]=k.useState(null),r=k.useRef(e),i=k.useCallback(o=>{const a=nC(o.target);a&&n(s=>s?(s.set(a,Z3(a)),new Map(s)):null)},[]);return k.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=nC(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Z3(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=nC(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Wd(o,a),Fo):EH(e):Fo,[e,t])}function sO(e,t){t===void 0&&(t=[]);const n=k.useRef(null);return k.useEffect(()=>{n.current=null},t),k.useEffect(()=>{const r=e!==Fo;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?vb(e,n.current):Fo}function PDe(e){k.useEffect(()=>{if(!T2)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 kDe(e,t){return k.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function RH(e){return k.useMemo(()=>e?nDe(e):null,[e])}const oC=[];function IDe(e,t){t===void 0&&(t=Xm);const[n]=e,r=RH(n?zr(n):null),[i,o]=k.useReducer(s,oC),a=k2({callback:o});return e.length>0&&i===oC&&o(),Ea(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(l=>wH(l)?r:new VA(t(l),l)):oC}}function OH(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wm(t)?t:e}function MDe(e){let{measure:t}=e;const[n,r]=k.useState(null),i=k.useCallback(u=>{for(const{target:c}of u)if(Wm(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=k2({callback:i}),a=k.useCallback(u=>{const c=OH(u);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,l]=mb(a);return k.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const RDe=[{sensor:kH,options:{}},{sensor:PH,options:{}}],ODe={current:{}},bv={draggable:{measure:eO},droppable:{measure:eO,strategy:Zg.WhileDragging,frequency:e4.Optimized},dragOverlay:{measure:Xm}};class Ap 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 $De={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ap,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:bb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bv,measureDroppableContainers:bb,windowRect:null,measuringScheduled:!1},$H={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:bb,draggableNodes:new Map,over:null,measureDroppableContainers:bb},Qm=k.createContext($H),NH=k.createContext($De);function NDe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ap}}}function DDe(e,t){switch(t.type){case kn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case kn.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 kn.DragEnd:case kn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case kn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Ap(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case kn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Ap(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case kn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Ap(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function LDe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=k.useContext(Qm),o=yb(r),a=yb(n==null?void 0:n.id);return k.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!BA(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[l.current,u.current]){if(!c)continue;const d=INe(c);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function DH(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function FDe(e){return k.useMemo(()=>({draggable:{...bv.draggable,...e==null?void 0:e.draggable},droppable:{...bv.droppable,...e==null?void 0:e.droppable},dragOverlay:{...bv.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 BDe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=k.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Ea(()=>{if(!a&&!s||!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 c=n(u),d=vH(c,r);if(a||(d.x=0),s||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=_H(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,s,r,n])}const I2=k.createContext({...Fo,scaleX:1,scaleY:1});var Xs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Xs||(Xs={}));const zDe=k.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:c=RDe,collisionDetection:d=KNe,measuring:f,modifiers:h,...p}=t;const g=k.useReducer(DDe,void 0,NDe),[_,b]=g,[y,m]=DNe(),[v,S]=k.useState(Xs.Uninitialized),w=v===Xs.Initialized,{draggable:{active:C,nodes:x,translate:P},droppable:{containers:E}}=_,I=C?x.get(C):null,N=k.useRef({initial:null,translated:null}),M=k.useMemo(()=>{var Xt;return C!=null?{id:C,data:(Xt=I==null?void 0:I.data)!=null?Xt:ODe,rect:N}:null},[C,I]),T=k.useRef(null),[A,R]=k.useState(null),[D,$]=k.useState(null),L=Xg(p,Object.values(p)),O=P2("DndDescribedBy",a),B=k.useMemo(()=>E.getEnabled(),[E]),U=FDe(f),{droppableRects:j,measureDroppableContainers:q,measuringScheduled:Y}=SDe(B,{dragging:w,dependencies:[P.x,P.y],config:U.droppable}),Z=bDe(x,C),V=k.useMemo(()=>D?Qg(D):null,[D]),K=nu(),ee=xDe(Z,U.draggable.measure);BDe({activeNode:C?x.get(C):null,config:K.layoutShiftCompensation,initialRect:ee,measure:U.draggable.measure});const re=oO(Z,U.draggable.measure,ee),fe=oO(Z?Z.parentElement:null),Se=k.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=E.getNodeFor((n=Se.current.over)==null?void 0:n.id),De=MDe({measure:U.dragOverlay.measure}),Ee=(r=De.nodeRef.current)!=null?r:Z,tt=w?(i=De.rect)!=null?i:re:null,ot=!!(De.nodeRef.current&&De.rect),we=EDe(ot?null:re),Xn=RH(Ee?zr(Ee):null),Vt=TDe(w?Me??Z:null),Ot=IDe(Vt),xt=DH(h,{transform:{x:P.x-we.x,y:P.y-we.y,scaleX:1,scaleY:1},activatorEvent:D,active:M,activeNodeRect:re,containerNodeRect:fe,draggingNodeRect:tt,over:Se.current.over,overlayNodeRect:De.rect,scrollableAncestors:Vt,scrollableAncestorRects:Ot,windowRect:Xn}),bn=V?Wd(V,P):null,Vr=ADe(Vt),co=sO(Vr),Mi=sO(Vr,[re]),ur=Wd(xt,co),Qn=tt?JNe(tt,xt):null,xr=M&&Qn?d({active:M,collisionRect:Qn,droppableRects:j,droppableContainers:B,pointerCoordinates:bn}):null,rn=qNe(xr,"id"),[$t,li]=k.useState(null),Ri=ot?xt:Wd(xt,Mi),fo=YNe(Ri,(o=$t==null?void 0:$t.rect)!=null?o:null,re),jr=k.useCallback((Xt,wt)=>{let{sensor:Yn,options:Nn}=wt;if(T.current==null)return;const cr=x.get(T.current);if(!cr)return;const wr=Xt.nativeEvent,Ur=new Yn({active:T.current,activeNode:cr,event:wr,options:Nn,context:Se,onStart(Cr){const Zn=T.current;if(Zn==null)return;const Ra=x.get(Zn);if(!Ra)return;const{onDragStart:Is}=L.current,Ms={active:{id:Zn,data:Ra.data,rect:N}};mi.unstable_batchedUpdates(()=>{Is==null||Is(Ms),S(Xs.Initializing),b({type:kn.DragStart,initialCoordinates:Cr,active:Zn}),y({type:"onDragStart",event:Ms})})},onMove(Cr){b({type:kn.DragMove,coordinates:Cr})},onEnd:Uo(kn.DragEnd),onCancel:Uo(kn.DragCancel)});mi.unstable_batchedUpdates(()=>{R(Ur),$(Xt.nativeEvent)});function Uo(Cr){return async function(){const{active:Ra,collisions:Is,over:Ms,scrollAdjustedTranslate:Cc}=Se.current;let Oa=null;if(Ra&&Cc){const{cancelDrop:Er}=L.current;Oa={activatorEvent:wr,active:Ra,collisions:Is,delta:Cc,over:Ms},Cr===kn.DragEnd&&typeof Er=="function"&&await Promise.resolve(Er(Oa))&&(Cr=kn.DragCancel)}T.current=null,mi.unstable_batchedUpdates(()=>{b({type:Cr}),S(Xs.Uninitialized),li(null),R(null),$(null);const Er=Cr===kn.DragEnd?"onDragEnd":"onDragCancel";if(Oa){const ru=L.current[Er];ru==null||ru(Oa),y({type:Er,event:Oa})}})}}},[x]),_n=k.useCallback((Xt,wt)=>(Yn,Nn)=>{const cr=Yn.nativeEvent,wr=x.get(Nn);if(T.current!==null||!wr||cr.dndKit||cr.defaultPrevented)return;const Ur={active:wr};Xt(Yn,wt.options,Ur)===!0&&(cr.dndKit={capturedBy:wt.sensor},T.current=Nn,jr(Yn,wt))},[x,jr]),ui=_De(c,_n);PDe(c),Ea(()=>{re&&v===Xs.Initializing&&S(Xs.Initialized)},[re,v]),k.useEffect(()=>{const{onDragMove:Xt}=L.current,{active:wt,activatorEvent:Yn,collisions:Nn,over:cr}=Se.current;if(!wt||!Yn)return;const wr={active:wt,activatorEvent:Yn,collisions:Nn,delta:{x:ur.x,y:ur.y},over:cr};mi.unstable_batchedUpdates(()=>{Xt==null||Xt(wr),y({type:"onDragMove",event:wr})})},[ur.x,ur.y]),k.useEffect(()=>{const{active:Xt,activatorEvent:wt,collisions:Yn,droppableContainers:Nn,scrollAdjustedTranslate:cr}=Se.current;if(!Xt||T.current==null||!wt||!cr)return;const{onDragOver:wr}=L.current,Ur=Nn.get(rn),Uo=Ur&&Ur.rect.current?{id:Ur.id,rect:Ur.rect.current,data:Ur.data,disabled:Ur.disabled}:null,Cr={active:Xt,activatorEvent:wt,collisions:Yn,delta:{x:cr.x,y:cr.y},over:Uo};mi.unstable_batchedUpdates(()=>{li(Uo),wr==null||wr(Cr),y({type:"onDragOver",event:Cr})})},[rn]),Ea(()=>{Se.current={activatorEvent:D,active:M,activeNode:Z,collisionRect:Qn,collisions:xr,droppableRects:j,draggableNodes:x,draggingNode:Ee,draggingNodeRect:tt,droppableContainers:E,over:$t,scrollableAncestors:Vt,scrollAdjustedTranslate:ur},N.current={initial:tt,translated:Qn}},[M,Z,xr,Qn,x,Ee,tt,j,E,$t,Vt,ur]),mDe({...K,delta:P,draggingRect:Qn,pointerCoordinates:bn,scrollableAncestors:Vt,scrollableAncestorRects:Ot});const tu=k.useMemo(()=>({active:M,activeNode:Z,activeNodeRect:re,activatorEvent:D,collisions:xr,containerNodeRect:fe,dragOverlay:De,draggableNodes:x,droppableContainers:E,droppableRects:j,over:$t,measureDroppableContainers:q,scrollableAncestors:Vt,scrollableAncestorRects:Ot,measuringConfiguration:U,measuringScheduled:Y,windowRect:Xn}),[M,Z,re,D,xr,fe,De,x,E,j,$t,q,Vt,Ot,U,Y,Xn]),jo=k.useMemo(()=>({activatorEvent:D,activators:ui,active:M,activeNodeRect:re,ariaDescribedById:{draggable:O},dispatch:b,draggableNodes:x,over:$t,measureDroppableContainers:q}),[D,ui,M,re,b,O,x,$t,q]);return J.createElement(yH.Provider,{value:m},J.createElement(Qm.Provider,{value:jo},J.createElement(NH.Provider,{value:tu},J.createElement(I2.Provider,{value:fo},u)),J.createElement(LDe,{disabled:(s==null?void 0:s.restoreFocus)===!1})),J.createElement(BNe,{...s,hiddenTextDescribedById:O}));function nu(){const Xt=(A==null?void 0:A.autoScrollEnabled)===!1,wt=typeof l=="object"?l.enabled===!1:l===!1,Yn=w&&!Xt&&!wt;return typeof l=="object"?{...l,enabled:Yn}:{enabled:Yn}}}),VDe=k.createContext(null),lO="button",jDe="Droppable";function fGe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=P2(jDe),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=k.useContext(Qm),{role:h=lO,roleDescription:p="draggable",tabIndex:g=0}=i??{},_=(l==null?void 0:l.id)===t,b=k.useContext(_?I2:VDe),[y,m]=mb(),[v,S]=mb(),w=kDe(a,t),C=Xg(n);Ea(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:v,data:C}),()=>{const P=d.get(t);P&&P.key===o&&d.delete(t)}),[d,t]);const x=k.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":_&&h===lO?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[r,h,g,_,p,c.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:x,isDragging:_,listeners:r?void 0:w,node:y,over:f,setNodeRef:m,setActivatorNodeRef:S,transform:b}}function UDe(){return k.useContext(NH)}const GDe="Droppable",HDe={timeout:25};function hGe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=P2(GDe),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=k.useContext(Qm),c=k.useRef({disabled:n}),d=k.useRef(!1),f=k.useRef(null),h=k.useRef(null),{disabled:p,updateMeasurementsFor:g,timeout:_}={...HDe,...i},b=Xg(g??r),y=k.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},_)},[_]),m=k2({callback:y,disabled:p||!a}),v=k.useCallback((x,P)=>{m&&(P&&(m.unobserve(P),d.current=!1),x&&m.observe(x))},[m]),[S,w]=mb(v),C=Xg(t);return k.useEffect(()=>{!m||!S.current||(m.disconnect(),d.current=!1,m.observe(S.current))},[S,m]),Ea(()=>(s({type:kn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:C}}),()=>s({type:kn.UnregisterDroppable,key:o,id:r})),[r]),k.useEffect(()=>{n!==c.current.disabled&&(s({type:kn.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function qDe(e){let{animation:t,children:n}=e;const[r,i]=k.useState(null),[o,a]=k.useState(null),s=yb(n);return!n&&!r&&s&&i(s),Ea(()=>{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]),J.createElement(J.Fragment,null,n,r?k.cloneElement(r,{ref:a}):null)}const WDe={x:0,y:0,scaleX:1,scaleY:1};function KDe(e){let{children:t}=e;return J.createElement(Qm.Provider,{value:$H},J.createElement(I2.Provider,{value:WDe},t))}const XDe={position:"fixed",touchAction:"none"},QDe=e=>BA(e)?"transform 250ms ease":void 0,YDe=k.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:c=QDe}=e;if(!s)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...XDe,width:s.width,height:s.height,top:s.top,left:s.left,transform:Yg.Transform.toString(d),transformOrigin:i&&r?jNe(r,s):void 0,transition:typeof c=="function"?c(r):c,...l};return J.createElement(n,{className:a,style:f,ref:t},o)}),ZDe=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},JDe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Yg.Transform.toString(t)},{transform:Yg.Transform.toString(n)}]},eLe={duration:250,easing:"ease",keyframes:JDe,sideEffects:ZDe({styles:{active:{opacity:"0"}}})};function tLe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return A2((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=OH(a);if(!u)return;const{transform:c}=zr(a).getComputedStyle(a),d=bH(c);if(!d)return;const f=typeof t=="function"?t:nLe(t);return TH(l,i.draggable.measure),f({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function nLe(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...eLe,...e};return o=>{let{active:a,dragOverlay:s,transform:l,...u}=o;if(!t)return;const c={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},f={x:l.x-c.x,y:l.y-c.y,...d},h=i({...u,active:a,dragOverlay:s,transform:{initial:l,final:f}}),[p]=h,g=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;const _=r==null?void 0:r({active:a,dragOverlay:s,...u}),b=s.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{_==null||_(),y()}})}}let uO=0;function rLe(e){return k.useMemo(()=>{if(e!=null)return uO++,uO},[e])}const iLe=J.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:g,dragOverlay:_,over:b,measuringConfiguration:y,scrollableAncestors:m,scrollableAncestorRects:v,windowRect:S}=UDe(),w=k.useContext(I2),C=rLe(d==null?void 0:d.id),x=DH(a,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:_.rect,over:b,overlayNodeRect:_.rect,scrollableAncestors:m,scrollableAncestorRects:v,transform:w,windowRect:S}),P=UA(f),E=tLe({config:r,draggableNodes:p,droppableContainers:g,measuringConfiguration:y}),I=P?_.setRef:void 0;return J.createElement(KDe,null,J.createElement(qDe,{animation:E},d&&C?J.createElement(YDe,{key:C,id:d.id,ref:I,as:s,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:P,style:{zIndex:u,...i},transform:x},n):null))}),oLe=qn([IA,TA],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),aLe=()=>{const e=C2(oLe);return k.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=Qg(n);if(!o)return i;const a=o.x-r.left,s=o.y-r.top,l=i.x+a-r.width/2,u=i.y+s-r.height/2,c=i.scaleX*e,d=i.scaleY*e;return{x:l,y:u,scaleX:c,scaleY:d}}return i},[e])},sLe=e=>{if(!e.pointerCoordinates)return[];const t=document.elementsFromPoint(e.pointerCoordinates.x,e.pointerCoordinates.y),n=e.droppableContainers.filter(r=>r.node.current?t.includes(r.node.current):!1);return QNe({...e,droppableContainers:n})};function lLe(e){return oe.jsx(zDe,{...e})}const Ty=28,cO={w:Ty,h:Ty,maxW:Ty,maxH:Ty,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},uLe=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return oe.jsx(ob,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:oe.jsx($U,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return oe.jsx(ob,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:oe.jsx(aA,{sx:{...cO},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?oe.jsxs(sA,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...cO},children:[oe.jsx(A3,{children:e.dragData.payload.imageDTOs.length}),oe.jsx(A3,{size:"sm",children:"Images"})]}):null},cLe=k.memo(uLe),dLe=e=>{const[t,n]=k.useState(null),r=se("images"),i=w2(),o=k.useCallback(d=>{r.trace({dragData:pt(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),a=k.useCallback(d=>{var h;r.trace({dragData:pt(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(LG({overData:f,activeData:t})),n(null))},[t,i,r]),s=JR(IH,{activationConstraint:{distance:10}}),l=JR(MH,{activationConstraint:{distance:10}}),u=zNe(s,l),c=aLe();return oe.jsxs(lLe,{onDragStart:o,onDragEnd:a,sensors:u,collisionDetection:sLe,autoScroll:!1,children:[e.children,oe.jsx(iLe,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"grabbing",userSelect:"none",padding:"10rem"},children:oe.jsx(CU,{children:t&&oe.jsx(xU.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:oe.jsx(cLe,{dragData:t})},"overlay-drag-image")})})]})},fLe=k.memo(dLe),dO=Pa(void 0),fO=Pa(void 0),hLe=k.lazy(()=>k$(()=>import("./App-6440ab3b.js"),["./App-6440ab3b.js","./MantineProvider-a6a1d85c.js","./App-6125620a.css"],import.meta.url)),pLe=k.lazy(()=>k$(()=>import("./ThemeLocaleProvider-9d17ef9a.js"),["./ThemeLocaleProvider-9d17ef9a.js","./MantineProvider-a6a1d85c.js","./ThemeLocaleProvider-f5f9aabf.css"],import.meta.url)),gLe=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:a,selectedImage:s,customStarUi:l})=>(k.useEffect(()=>(t&&yg.set(t),e&&vg.set(e),o&&x1.set(o),a&&Dn.set(a),Wz(),i&&i.length>0?Z5(qR(),...i):Z5(qR()),()=>{vg.set(void 0),yg.set(void 0),x1.set(void 0),Dn.set(CL)}),[e,t,i,o,a]),k.useEffect(()=>(l&&dO.set(l),()=>{dO.set(void 0)}),[l]),k.useEffect(()=>(r&&fO.set(r),()=>{fO.set(void 0)}),[r]),oe.jsx(J.StrictMode,{children:oe.jsx(tle,{store:KG,children:oe.jsx(J.Suspense,{fallback:oe.jsx(fNe,{}),children:oe.jsx(pLe,{children:oe.jsx(fLe,{children:oe.jsx(hLe,{config:n,selectedImage:s})})})})})})),mLe=k.memo(gLe);aC.createRoot(document.getElementById("root")).render(oe.jsx(mLe,{}));export{G1 as $,So as A,Sme as B,ii as C,vl as D,Yo as E,dVe as F,hT as G,Ii as H,oe as I,zm as J,Mm as K,lr as L,Kl as M,N3e as N,CUe as O,Cme as P,SUe as Q,J as R,eg as S,CU as T,xU as U,h3e as V,Rm as W,rA as X,$m as Y,xUe as Z,wUe as _,SN as a,Nze as a$,k9 as a0,vbe as a1,EUe as a2,ua as a3,Bl as a4,b1 as a5,tX as a6,JV as a7,PUe as a8,v3e as a9,jze as aA,ibe as aB,ET as aC,lV as aD,abe as aE,mi as aF,nP as aG,fS as aH,w2 as aI,Zje as aJ,Cze as aK,Gze as aL,Hze as aM,_ze as aN,vze as aO,$U as aP,Gc as aQ,w6e as aR,VU as aS,Uje as aT,Sze as aU,XE as aV,kA as aW,hUe as aX,aA as aY,cNe as aZ,de as a_,ya as aa,gV as ab,dS as ac,FTe as ad,MU as ae,TUe as af,ke as ag,_Ue as ah,AUe as ai,qn as aj,IA as ak,SE as al,C2 as am,Mze as an,Tm as ao,fF as ap,FF as aq,J_ as ar,se as as,ob as at,sA as au,A3 as av,TA as aw,Vm as ax,p$e as ay,VG as az,Kb as b,QRe as b$,Uze as b0,uBe as b1,zie as b2,KE as b3,it as b4,jLe as b5,sUe as b6,qje as b7,pUe as b8,fUe as b9,X as bA,eVe as bB,iVe as bC,Eze as bD,Tze as bE,Fze as bF,M1 as bG,Pze as bH,al as bI,b0 as bJ,rVe as bK,tVe as bL,nVe as bM,vLe as bN,NLe as bO,DLe as bP,LLe as bQ,FLe as bR,uae as bS,hFe as bT,Oje as bU,$je as bV,ULe as bW,_Fe as bX,zLe as bY,lFe as bZ,qLe as b_,e1e as ba,Hje as bb,Kje as bc,bve as bd,_ve as be,iUe as bf,aUe as bg,Wje as bh,uUe as bi,Xje as bj,Gje as bk,Ize as bl,RUe as bm,pq as bn,SLe as bo,bLe as bp,_Le as bq,He as br,kze as bs,Yze as bt,Qze as bu,Aze as bv,oVe as bw,hGe as bx,fGe as by,yl as bz,JQ as c,Dze as c$,VLe as c0,pFe as c1,KLe as c2,xL as c3,BLe as c4,EFe as c5,GLe as c6,E6 as c7,HLe as c8,T6 as c9,_8 as cA,Lje as cB,Fje as cC,Bje as cD,tFe as cE,zje as cF,nFe as cG,Vje as cH,rFe as cI,jje as cJ,uVe as cK,yg as cL,D6e as cM,Bze as cN,Iu as cO,Do as cP,Dfe as cQ,ge as cR,dO as cS,Zze as cT,Jze as cU,Ble as cV,v1e as cW,qz as cX,lF as cY,bze as cZ,DG as c_,JLe as ca,cFe as cb,iFe as cc,DFe as cd,LFe as ce,eFe as cf,FFe as cg,HUe as ch,XLe as ci,ER as cj,cVe as ck,jUe as cl,QLe as cm,TR as cn,Su as co,Tie as cp,Die as cq,GUe as cr,PR as cs,Aie as ct,UUe as cu,ZLe as cv,AR as cw,Pie as cx,XRe as cy,WLe as cz,Bne as d,qVe as d$,bg as d0,JF as d1,bUe as d2,Lze as d3,$0 as d4,M5 as d5,hBe as d6,aBe as d7,ZFe as d8,JFe as d9,yVe as dA,Oze as dB,Rze as dC,_Ve as dD,wE as dE,VVe as dF,pVe as dG,NVe as dH,DVe as dI,Zoe as dJ,LVe as dK,RLe as dL,FVe as dM,aS as dN,Yoe as dO,jVe as dP,Sm as dQ,nGe as dR,vs as dS,VUe as dT,sGe as dU,zUe as dV,UVe as dW,GVe as dX,lGe as dY,HVe as dZ,aGe as d_,iBe as da,on as db,pT as dc,ps as dd,Aa as de,gi as df,rBe as dg,oFe as dh,CA as di,oBe as dj,dUe as dk,_E as dl,ije as dm,$ze as dn,rje as dp,dGe as dq,Aje as dr,wje as ds,Cje as dt,Ije as du,Eje as dv,kje as dw,Pje as dx,IRe as dy,YVe as dz,xD as e,zFe as e$,WVe as e0,_L as e1,WUe as e2,KVe as e3,Joe as e4,BVe as e5,eae as e6,zVe as e7,$Ve as e8,Tje as e9,O6e as eA,R6e as eB,PLe as eC,kLe as eD,s_ as eE,ILe as eF,Bie as eG,MLe as eH,TLe as eI,ELe as eJ,OE as eK,Nie as eL,Mie as eM,Rie as eN,kie as eO,Iie as eP,Oie as eQ,$ie as eR,wLe as eS,qUe as eT,Nje as eU,$E as eV,gve as eW,O7e as eX,LUe as eY,VFe as eZ,cae as e_,Od as ea,$f as eb,dFe as ec,jle as ed,Ule as ee,xze as ef,sVe as eg,lVe as eh,tB as ei,aVe as ej,r_ as ek,BFe as el,OFe as em,$Fe as en,NFe as eo,Gie as ep,di as eq,S6 as er,ALe as es,Kze as et,qze as eu,Wze as ev,Hl as ew,Z6 as ex,Fie as ey,x6 as ez,kN as f,xz as f$,Rr as f0,uFe as f1,xFe as f2,Hie as f3,hp as f4,CFe as f5,Dje as f6,yFe as f7,vFe as f8,bFe as f9,Yje as fA,QUe as fB,oGe as fC,rGe as fD,Qje as fE,JUe as fF,ZUe as fG,KUe as fH,tGe as fI,$Le as fJ,XUe as fK,eGe as fL,OLe as fM,sz as fN,gVe as fO,f$e as fP,ZVe as fQ,wVe as fR,CVe as fS,mye as fT,y8 as fU,zB as fV,km as fW,fVe as fX,wu as fY,eje as fZ,cUe as f_,gFe as fa,mFe as fb,lae as fc,PFe as fd,AFe as fe,MBe as ff,KFe as fg,pze as fh,RBe as fi,MFe as fj,RFe as fk,IFe as fl,DE as fm,sBe as fn,Rje as fo,uGe as fp,e$e as fq,tUe as fr,ce as fs,Qe as ft,Lt as fu,pa as fv,YLe as fw,BUe as fx,iGe as fy,YUe as fz,LN as g,lze as g$,YL as g0,Gh as g1,bVe as g2,mVe as g3,JVe as g4,tje as g5,lje as g6,hVe as g7,nje as g8,V1 as g9,FUe as gA,wR as gB,pt as gC,cve as gD,Ig as gE,Rl as gF,Sje as gG,mje as gH,_je as gI,yje as gJ,pje as gK,oje as gL,bje as gM,_z as gN,vUe as gO,gUe as gP,mUe as gQ,yUe as gR,pBe as gS,nBe as gT,cBe as gU,fBe as gV,xu as gW,GU as gX,Dq as gY,Ge as gZ,UBe as g_,Pe as ga,a$e as gb,dve as gc,q0 as gd,vVe as ge,uje as gf,aje as gg,MVe as gh,PVe as gi,AVe as gj,TVe as gk,RVe as gl,sje as gm,fje as gn,dje as go,xje as gp,n$e as gq,kVe as gr,IVe as gs,Mje as gt,hje as gu,cje as gv,gje as gw,cye as gx,hb as gy,b1e as gz,t_ as h,hze as h$,sze as h0,ABe as h1,ZBe as h2,cze as h3,$6e as h4,_Be as h5,FBe as h6,Ah as h7,NBe as h8,SBe as h9,kBe as hA,GBe as hB,jBe as hC,BBe as hD,HFe as hE,qFe as hF,yze as hG,$Ue as hH,OUe as hI,HBe as hJ,A6e as hK,YBe as hL,qBe as hM,TBe as hN,bBe as hO,ize as hP,rze as hQ,XBe as hR,WBe as hS,KBe as hT,gze as hU,tze as hV,mze as hW,mBe as hX,gBe as hY,$Be as hZ,OBe as h_,ES as ha,LBe as hb,yBe as hc,DBe as hd,vBe as he,wBe as hf,GFe as hg,UFe as hh,jFe as hi,uze as hj,Dre as hk,_a as hl,wL as hm,pae as hn,XFe as ho,QFe as hp,YFe as hq,aze as hr,EBe as hs,CBe as ht,kle as hu,oze as hv,M6e as hw,Ile as hx,wA as hy,ZMe as hz,One as i,I6e as i0,T6e as i1,P6e as i2,k6e as i3,WFe as i4,PBe as i5,DUe as i6,gPe as i7,Jje as i8,eUe as i9,Qre as ia,P1e as ib,cGe as ic,fO as id,hV as ie,AT as ig,ca as ih,n3e as ii,I3e as ij,kUe as ik,xbe as il,MUe as im,pPe as io,_6e as ip,S6e as iq,mbe as ir,Tn as j,hee as k,e_ as l,Of as m,ym as n,ri as o,Yb as p,lE as q,AN as r,pE as s,bm as t,gD as u,k as v,to as w,fn as x,Fd as y,Kn as z};