InvokeAI/invokeai/frontend/web/dist/assets/index-fbe0e055.js
2023-12-29 13:16:23 +11:00

156 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 oq=Object.defineProperty;var sq=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Kl=(e,t,n)=>(sq(e,typeof t!="symbol"?t+"":t,n),n),sx=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y=(e,t,n)=>(sx(e,t,"read from private field"),n?n.call(e):t.get(e)),Bt=(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)},Ni=(e,t,n,r)=>(sx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var th=(e,t,n,r)=>({set _(i){Ni(e,t,i,n)},get _(){return Y(e,t,r)}}),Wo=(e,t,n)=>(sx(e,t,"access private method"),n);function MO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var RO={exports:{}},Tb={},OO={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"),aq=Symbol.for("react.portal"),lq=Symbol.for("react.fragment"),cq=Symbol.for("react.strict_mode"),uq=Symbol.for("react.profiler"),dq=Symbol.for("react.provider"),fq=Symbol.for("react.context"),hq=Symbol.for("react.forward_ref"),pq=Symbol.for("react.suspense"),gq=Symbol.for("react.memo"),mq=Symbol.for("react.lazy"),_k=Symbol.iterator;function yq(e){return e===null||typeof e!="object"?null:(e=_k&&e[_k]||e["@@iterator"],typeof e=="function"?e:null)}var $O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},NO=Object.assign,FO={};function Tf(e,t,n){this.props=e,this.context=t,this.refs=FO,this.updater=n||$O}Tf.prototype.isReactComponent={};Tf.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")};Tf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function DO(){}DO.prototype=Tf.prototype;function vE(e,t,n){this.props=e,this.context=t,this.refs=FO,this.updater=n||$O}var bE=vE.prototype=new DO;bE.constructor=vE;NO(bE,Tf.prototype);bE.isPureReactComponent=!0;var Sk=Array.isArray,LO=Object.prototype.hasOwnProperty,_E={current:null},BO={key:!0,ref:!0,__self:!0,__source:!0};function zO(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)LO.call(t,r)&&!BO.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:rm,type:e,key:o,ref:s,props:i,_owner:_E.current}}function vq(e,t){return{$$typeof:rm,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function SE(e){return typeof e=="object"&&e!==null&&e.$$typeof===rm}function bq(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var xk=/\/+/g;function ax(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bq(""+e.key):t.toString(36)}function Ny(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case rm:case aq:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ax(s,0):r,Sk(i)?(n="",e!=null&&(n=e.replace(xk,"$&/")+"/"),Ny(i,t,n,"",function(c){return c})):i!=null&&(SE(i)&&(i=vq(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(xk,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Sk(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+ax(o,a);s+=Ny(o,t,n,l,i)}else if(l=yq(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+ax(o,a++),s+=Ny(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function p0(e,t,n){if(e==null)return e;var r=[],i=0;return Ny(e,r,"","",function(o){return t.call(n,o,i++)}),r}function _q(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 Lr={current:null},Fy={transition:null},Sq={ReactCurrentDispatcher:Lr,ReactCurrentBatchConfig:Fy,ReactCurrentOwner:_E};Ke.Children={map:p0,forEach:function(e,t,n){p0(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return p0(e,function(){t++}),t},toArray:function(e){return p0(e,function(t){return t})||[]},only:function(e){if(!SE(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=Tf;Ke.Fragment=lq;Ke.Profiler=uq;Ke.PureComponent=vE;Ke.StrictMode=cq;Ke.Suspense=pq;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sq;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=NO({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=_E.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)LO.call(t,l)&&!BO.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:rm,type:e.type,key:i,ref:o,props:r,_owner:s}};Ke.createContext=function(e){return e={$$typeof:fq,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:dq,_context:e},e.Consumer=e};Ke.createElement=zO;Ke.createFactory=function(e){var t=zO.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:hq,render:e}};Ke.isValidElement=SE;Ke.lazy=function(e){return{$$typeof:mq,_payload:{_status:-1,_result:e},_init:_q}};Ke.memo=function(e,t){return{$$typeof:gq,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Fy.transition;Fy.transition={};try{e()}finally{Fy.transition=t}};Ke.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ke.useCallback=function(e,t){return Lr.current.useCallback(e,t)};Ke.useContext=function(e){return Lr.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return Lr.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return Lr.current.useEffect(e,t)};Ke.useId=function(){return Lr.current.useId()};Ke.useImperativeHandle=function(e,t,n){return Lr.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return Lr.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return Lr.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return Lr.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return Lr.current.useReducer(e,t,n)};Ke.useRef=function(e){return Lr.current.useRef(e)};Ke.useState=function(e){return Lr.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return Lr.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return Lr.current.useTransition()};Ke.version="18.2.0";OO.exports=Ke;var I=OO.exports;const Q=Ml(I),Ev=MO({__proto__:null,default:Q},[I]);/**
* @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 xq=I,wq=Symbol.for("react.element"),Cq=Symbol.for("react.fragment"),Eq=Object.prototype.hasOwnProperty,Tq=xq.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Aq={key:!0,ref:!0,__self:!0,__source:!0};function jO(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Eq.call(t,r)&&!Aq.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:wq,type:e,key:o,ref:s,props:i,_owner:Tq.current}}Tb.Fragment=Cq;Tb.jsx=jO;Tb.jsxs=jO;RO.exports=Tb;var ie=RO.exports,mC={},VO={exports:{}},ki={},UO={exports:{}},GO={};/**
* @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($,D){var N=$.length;$.push(D);e:for(;0<N;){var z=N-1>>>1,V=$[z];if(0<i(V,D))$[z]=D,$[N]=V,N=z;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var D=$[0],N=$.pop();if(N!==D){$[0]=N;e:for(var z=0,V=$.length,H=V>>>1;z<H;){var X=2*(z+1)-1,te=$[X],ee=X+1,j=$[ee];if(0>i(te,N))ee<V&&0>i(j,te)?($[z]=j,$[ee]=N,z=ee):($[z]=te,$[X]=N,z=X);else if(ee<V&&0>i(j,N))$[z]=j,$[ee]=N,z=ee;else break e}}return D}function i($,D){var N=$.sortIndex-D.sortIndex;return N!==0?N:$.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,v=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 g($){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=$)r(c),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(c)}}function b($){if(m=!1,g($),!p)if(n(l)!==null)p=!0,O(S);else{var D=n(c);D!==null&&F(b,D.startTime-$)}}function S($,D){p=!1,m&&(m=!1,v(x),x=-1),h=!0;var N=f;try{for(g(D),d=n(l);d!==null&&(!(d.expirationTime>D)||$&&!R());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var V=z(d.expirationTime<=D);D=e.unstable_now(),typeof V=="function"?d.callback=V:d===n(l)&&r(l),g(D)}else r(l);d=n(l)}if(d!==null)var H=!0;else{var X=n(c);X!==null&&F(b,X.startTime-D),H=!1}return H}finally{d=null,f=N,h=!1}}var w=!1,C=null,x=-1,k=5,A=-1;function R(){return!(e.unstable_now()-A<k)}function L(){if(C!==null){var $=e.unstable_now();A=$;var D=!0;try{D=C(!0,$)}finally{D?M():(w=!1,C=null)}}else w=!1}var M;if(typeof y=="function")M=function(){y(L)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,P=E.port2;E.port1.onmessage=L,M=function(){P.postMessage(null)}}else M=function(){_(L,0)};function O($){C=$,w||(w=!0,M())}function F($,D){x=_(function(){$(e.unstable_now())},D)}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,O(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"):k=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 D=3;break;default:D=f}var N=f;f=D;try{return $()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var N=f;f=$;try{return D()}finally{f=N}},e.unstable_scheduleCallback=function($,D,N){var z=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?z+N:z):N=z,$){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=N+V,$={id:u++,callback:D,priorityLevel:$,startTime:N,expirationTime:V,sortIndex:-1},N>z?($.sortIndex=N,t(c,$),n(l)===null&&$===n(c)&&(m?(v(x),x=-1):m=!0,F(b,N-z))):($.sortIndex=V,t(l,$),p||h||(p=!0,O(S))),$},e.unstable_shouldYield=R,e.unstable_wrapCallback=function($){var D=f;return function(){var N=f;f=D;try{return $.apply(this,arguments)}finally{f=N}}}})(GO);UO.exports=GO;var kq=UO.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 HO=I,wi=kq;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 WO=new Set,Rp={};function su(e,t){Yd(e,t),Yd(e+"Capture",t)}function Yd(e,t){for(Rp[e]=t,e=0;e<t.length;e++)WO.add(t[e])}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yC=Object.prototype.hasOwnProperty,Pq=/^[: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]*$/,wk={},Ck={};function Iq(e){return yC.call(Ck,e)?!0:yC.call(wk,e)?!1:Pq.test(e)?Ck[e]=!0:(wk[e]=!0,!1)}function Mq(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 Rq(e,t,n,r){if(t===null||typeof t>"u"||Mq(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,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var ir={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ir[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];ir[t]=new Br(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ir[e]=new Br(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ir[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){ir[e]=new Br(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ir[e]=new Br(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ir[e]=new Br(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ir[e]=new Br(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ir[e]=new Br(e,5,!1,e.toLowerCase(),null,!1,!1)});var xE=/[\-:]([a-z])/g;function wE(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(xE,wE);ir[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(xE,wE);ir[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(xE,wE);ir[t]=new Br(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ir[e]=new Br(e,1,!1,e.toLowerCase(),null,!1,!1)});ir.xlinkHref=new Br("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ir[e]=new Br(e,1,!1,e.toLowerCase(),null,!0,!0)});function CE(e,t,n,r){var i=ir.hasOwnProperty(t)?ir[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Rq(t,n,i,r)&&(n=null),r||i===null?Iq(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 ga=HO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,g0=Symbol.for("react.element"),Xu=Symbol.for("react.portal"),Qu=Symbol.for("react.fragment"),EE=Symbol.for("react.strict_mode"),vC=Symbol.for("react.profiler"),qO=Symbol.for("react.provider"),KO=Symbol.for("react.context"),TE=Symbol.for("react.forward_ref"),bC=Symbol.for("react.suspense"),_C=Symbol.for("react.suspense_list"),AE=Symbol.for("react.memo"),La=Symbol.for("react.lazy"),XO=Symbol.for("react.offscreen"),Ek=Symbol.iterator;function nh(e){return e===null||typeof e!="object"?null:(e=Ek&&e[Ek]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,lx;function Dh(e){if(lx===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);lx=t&&t[1]||""}return`
`+lx+e}var cx=!1;function ux(e,t){if(!e||cx)return"";cx=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),o=r.stack.split(`
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{cx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Dh(e):""}function Oq(e){switch(e.tag){case 5:return Dh(e.type);case 16:return Dh("Lazy");case 13:return Dh("Suspense");case 19:return Dh("SuspenseList");case 0:case 2:case 15:return e=ux(e.type,!1),e;case 11:return e=ux(e.type.render,!1),e;case 1:return e=ux(e.type,!0),e;default:return""}}function SC(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 Qu:return"Fragment";case Xu:return"Portal";case vC:return"Profiler";case EE:return"StrictMode";case bC:return"Suspense";case _C:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case KO:return(e.displayName||"Context")+".Consumer";case qO:return(e._context.displayName||"Context")+".Provider";case TE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case AE:return t=e.displayName||null,t!==null?t:SC(e.type)||"Memo";case La:t=e._payload,e=e._init;try{return SC(e(t))}catch{}}return null}function $q(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 SC(t);case 8:return t===EE?"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 ml(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nq(e){var t=QO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function m0(e){e._valueTracker||(e._valueTracker=Nq(e))}function YO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=QO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tv(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 xC(e,t){var n=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ml(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 ZO(e,t){t=t.checked,t!=null&&CE(e,"checked",t,!1)}function wC(e,t){ZO(e,t);var n=ml(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")?CC(e,t.type,n):t.hasOwnProperty("defaultValue")&&CC(e,t.type,ml(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ak(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 CC(e,t,n){(t!=="number"||Tv(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Lh=Array.isArray;function xd(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=""+ml(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 EC(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function kk(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(Lh(n)){if(1<n.length)throw Error(ne(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ml(n)}}function JO(e,t){var n=ml(t.value),r=ml(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 Pk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function e7(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 TC(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?e7(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var y0,t7=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(y0=y0||document.createElement("div"),y0.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=y0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Op(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var np={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},Fq=["Webkit","ms","Moz","O"];Object.keys(np).forEach(function(e){Fq.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),np[t]=np[e]})});function n7(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||np.hasOwnProperty(e)&&np[e]?(""+t).trim():t+"px"}function r7(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=n7(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Dq=Kt({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 AC(e,t){if(t){if(Dq[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 kC(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 PC=null;function kE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var IC=null,wd=null,Cd=null;function Ik(e){if(e=sm(e)){if(typeof IC!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=Mb(t),IC(e.stateNode,e.type,t))}}function i7(e){wd?Cd?Cd.push(e):Cd=[e]:wd=e}function o7(){if(wd){var e=wd,t=Cd;if(Cd=wd=null,Ik(e),t)for(e=0;e<t.length;e++)Ik(t[e])}}function s7(e,t){return e(t)}function a7(){}var dx=!1;function l7(e,t,n){if(dx)return e(t,n);dx=!0;try{return s7(e,t,n)}finally{dx=!1,(wd!==null||Cd!==null)&&(a7(),o7())}}function $p(e,t){var n=e.stateNode;if(n===null)return null;var r=Mb(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 MC=!1;if(sa)try{var rh={};Object.defineProperty(rh,"passive",{get:function(){MC=!0}}),window.addEventListener("test",rh,rh),window.removeEventListener("test",rh,rh)}catch{MC=!1}function Lq(e,t,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var rp=!1,Av=null,kv=!1,RC=null,Bq={onError:function(e){rp=!0,Av=e}};function zq(e,t,n,r,i,o,s,a,l){rp=!1,Av=null,Lq.apply(Bq,arguments)}function jq(e,t,n,r,i,o,s,a,l){if(zq.apply(this,arguments),rp){if(rp){var c=Av;rp=!1,Av=null}else throw Error(ne(198));kv||(kv=!0,RC=c)}}function au(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 c7(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 Mk(e){if(au(e)!==e)throw Error(ne(188))}function Vq(e){var t=e.alternate;if(!t){if(t=au(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 Mk(i),e;if(o===r)return Mk(i),t;o=o.sibling}throw Error(ne(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(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 u7(e){return e=Vq(e),e!==null?d7(e):null}function d7(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=d7(e);if(t!==null)return t;e=e.sibling}return null}var f7=wi.unstable_scheduleCallback,Rk=wi.unstable_cancelCallback,Uq=wi.unstable_shouldYield,Gq=wi.unstable_requestPaint,cn=wi.unstable_now,Hq=wi.unstable_getCurrentPriorityLevel,PE=wi.unstable_ImmediatePriority,h7=wi.unstable_UserBlockingPriority,Pv=wi.unstable_NormalPriority,Wq=wi.unstable_LowPriority,p7=wi.unstable_IdlePriority,Ab=null,fs=null;function qq(e){if(fs&&typeof fs.onCommitFiberRoot=="function")try{fs.onCommitFiberRoot(Ab,e,void 0,(e.current.flags&128)===128)}catch{}}var Ao=Math.clz32?Math.clz32:Qq,Kq=Math.log,Xq=Math.LN2;function Qq(e){return e>>>=0,e===0?32:31-(Kq(e)/Xq|0)|0}var v0=64,b0=4194304;function Bh(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 Iv(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Bh(a):(o&=s,o!==0&&(r=Bh(o)))}else s=n&~i,s!==0?r=Bh(s):o!==0&&(r=Bh(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-Ao(t),i=1<<n,r|=e[n],t&=~i;return r}function Yq(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 Zq(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-Ao(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=Yq(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function OC(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function g7(){var e=v0;return v0<<=1,!(v0&4194240)&&(v0=64),e}function fx(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-Ao(t),e[t]=n}function Jq(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-Ao(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function IE(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ao(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var mt=0;function m7(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var y7,ME,v7,b7,_7,$C=!1,_0=[],nl=null,rl=null,il=null,Np=new Map,Fp=new Map,Ga=[],eK="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 Ok(e,t){switch(e){case"focusin":case"focusout":nl=null;break;case"dragenter":case"dragleave":rl=null;break;case"mouseover":case"mouseout":il=null;break;case"pointerover":case"pointerout":Np.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fp.delete(t.pointerId)}}function ih(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=sm(t),t!==null&&ME(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function tK(e,t,n,r,i){switch(t){case"focusin":return nl=ih(nl,e,t,n,r,i),!0;case"dragenter":return rl=ih(rl,e,t,n,r,i),!0;case"mouseover":return il=ih(il,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Np.set(o,ih(Np.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Fp.set(o,ih(Fp.get(o)||null,e,t,n,r,i)),!0}return!1}function S7(e){var t=vc(e.target);if(t!==null){var n=au(t);if(n!==null){if(t=n.tag,t===13){if(t=c7(n),t!==null){e.blockedOn=t,_7(e.priority,function(){v7(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 Dy(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=NC(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);PC=r,n.target.dispatchEvent(r),PC=null}else return t=sm(n),t!==null&&ME(t),e.blockedOn=n,!1;t.shift()}return!0}function $k(e,t,n){Dy(e)&&n.delete(t)}function nK(){$C=!1,nl!==null&&Dy(nl)&&(nl=null),rl!==null&&Dy(rl)&&(rl=null),il!==null&&Dy(il)&&(il=null),Np.forEach($k),Fp.forEach($k)}function oh(e,t){e.blockedOn===t&&(e.blockedOn=null,$C||($C=!0,wi.unstable_scheduleCallback(wi.unstable_NormalPriority,nK)))}function Dp(e){function t(i){return oh(i,e)}if(0<_0.length){oh(_0[0],e);for(var n=1;n<_0.length;n++){var r=_0[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nl!==null&&oh(nl,e),rl!==null&&oh(rl,e),il!==null&&oh(il,e),Np.forEach(t),Fp.forEach(t),n=0;n<Ga.length;n++)r=Ga[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ga.length&&(n=Ga[0],n.blockedOn===null);)S7(n),n.blockedOn===null&&Ga.shift()}var Ed=ga.ReactCurrentBatchConfig,Mv=!0;function rK(e,t,n,r){var i=mt,o=Ed.transition;Ed.transition=null;try{mt=1,RE(e,t,n,r)}finally{mt=i,Ed.transition=o}}function iK(e,t,n,r){var i=mt,o=Ed.transition;Ed.transition=null;try{mt=4,RE(e,t,n,r)}finally{mt=i,Ed.transition=o}}function RE(e,t,n,r){if(Mv){var i=NC(e,t,n,r);if(i===null)xx(e,t,r,Rv,n),Ok(e,r);else if(tK(i,e,t,n,r))r.stopPropagation();else if(Ok(e,r),t&4&&-1<eK.indexOf(e)){for(;i!==null;){var o=sm(i);if(o!==null&&y7(o),o=NC(e,t,n,r),o===null&&xx(e,t,r,Rv,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else xx(e,t,r,null,n)}}var Rv=null;function NC(e,t,n,r){if(Rv=null,e=kE(r),e=vc(e),e!==null)if(t=au(e),t===null)e=null;else if(n=t.tag,n===13){if(e=c7(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 Rv=e,null}function x7(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(Hq()){case PE:return 1;case h7:return 4;case Pv:case Wq:return 16;case p7:return 536870912;default:return 16}default:return 16}}var Za=null,OE=null,Ly=null;function w7(){if(Ly)return Ly;var e,t=OE,n=t.length,r,i="value"in Za?Za.value:Za.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return Ly=i.slice(e,1<r?1-r:void 0)}function By(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 S0(){return!0}function Nk(){return!1}function Pi(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?S0:Nk,this.isPropagationStopped=Nk,this}return Kt(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=S0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=S0)},persist:function(){},isPersistent:S0}),t}var Af={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$E=Pi(Af),om=Kt({},Af,{view:0,detail:0}),oK=Pi(om),hx,px,sh,kb=Kt({},om,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:NE,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!==sh&&(sh&&e.type==="mousemove"?(hx=e.screenX-sh.screenX,px=e.screenY-sh.screenY):px=hx=0,sh=e),hx)},movementY:function(e){return"movementY"in e?e.movementY:px}}),Fk=Pi(kb),sK=Kt({},kb,{dataTransfer:0}),aK=Pi(sK),lK=Kt({},om,{relatedTarget:0}),gx=Pi(lK),cK=Kt({},Af,{animationName:0,elapsedTime:0,pseudoElement:0}),uK=Pi(cK),dK=Kt({},Af,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fK=Pi(dK),hK=Kt({},Af,{data:0}),Dk=Pi(hK),pK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gK={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"},mK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yK(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mK[e])?!!t[e]:!1}function NE(){return yK}var vK=Kt({},om,{key:function(e){if(e.key){var t=pK[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=By(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gK[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:NE,charCode:function(e){return e.type==="keypress"?By(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?By(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bK=Pi(vK),_K=Kt({},kb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lk=Pi(_K),SK=Kt({},om,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:NE}),xK=Pi(SK),wK=Kt({},Af,{propertyName:0,elapsedTime:0,pseudoElement:0}),CK=Pi(wK),EK=Kt({},kb,{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}),TK=Pi(EK),AK=[9,13,27,32],FE=sa&&"CompositionEvent"in window,ip=null;sa&&"documentMode"in document&&(ip=document.documentMode);var kK=sa&&"TextEvent"in window&&!ip,C7=sa&&(!FE||ip&&8<ip&&11>=ip),Bk=String.fromCharCode(32),zk=!1;function E7(e,t){switch(e){case"keyup":return AK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yu=!1;function PK(e,t){switch(e){case"compositionend":return T7(t);case"keypress":return t.which!==32?null:(zk=!0,Bk);case"textInput":return e=t.data,e===Bk&&zk?null:e;default:return null}}function IK(e,t){if(Yu)return e==="compositionend"||!FE&&E7(e,t)?(e=w7(),Ly=OE=Za=null,Yu=!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 C7&&t.locale!=="ko"?null:t.data;default:return null}}var MK={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 jk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MK[e.type]:t==="textarea"}function A7(e,t,n,r){i7(r),t=Ov(t,"onChange"),0<t.length&&(n=new $E("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var op=null,Lp=null;function RK(e){L7(e,0)}function Pb(e){var t=ed(e);if(YO(t))return e}function OK(e,t){if(e==="change")return t}var k7=!1;if(sa){var mx;if(sa){var yx="oninput"in document;if(!yx){var Vk=document.createElement("div");Vk.setAttribute("oninput","return;"),yx=typeof Vk.oninput=="function"}mx=yx}else mx=!1;k7=mx&&(!document.documentMode||9<document.documentMode)}function Uk(){op&&(op.detachEvent("onpropertychange",P7),Lp=op=null)}function P7(e){if(e.propertyName==="value"&&Pb(Lp)){var t=[];A7(t,Lp,e,kE(e)),l7(RK,t)}}function $K(e,t,n){e==="focusin"?(Uk(),op=t,Lp=n,op.attachEvent("onpropertychange",P7)):e==="focusout"&&Uk()}function NK(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pb(Lp)}function FK(e,t){if(e==="click")return Pb(t)}function DK(e,t){if(e==="input"||e==="change")return Pb(t)}function LK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $o=typeof Object.is=="function"?Object.is:LK;function Bp(e,t){if($o(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(!yC.call(t,i)||!$o(e[i],t[i]))return!1}return!0}function Gk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hk(e,t){var n=Gk(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=Gk(n)}}function I7(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?I7(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M7(){for(var e=window,t=Tv();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tv(e.document)}return t}function DE(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 BK(e){var t=M7(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&I7(n.ownerDocument.documentElement,n)){if(r!==null&&DE(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=Hk(n,o);var s=Hk(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var zK=sa&&"documentMode"in document&&11>=document.documentMode,Zu=null,FC=null,sp=null,DC=!1;function Wk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;DC||Zu==null||Zu!==Tv(r)||(r=Zu,"selectionStart"in r&&DE(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}),sp&&Bp(sp,r)||(sp=r,r=Ov(FC,"onSelect"),0<r.length&&(t=new $E("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zu)))}function x0(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ju={animationend:x0("Animation","AnimationEnd"),animationiteration:x0("Animation","AnimationIteration"),animationstart:x0("Animation","AnimationStart"),transitionend:x0("Transition","TransitionEnd")},vx={},R7={};sa&&(R7=document.createElement("div").style,"AnimationEvent"in window||(delete Ju.animationend.animation,delete Ju.animationiteration.animation,delete Ju.animationstart.animation),"TransitionEvent"in window||delete Ju.transitionend.transition);function Ib(e){if(vx[e])return vx[e];if(!Ju[e])return e;var t=Ju[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in R7)return vx[e]=t[n];return e}var O7=Ib("animationend"),$7=Ib("animationiteration"),N7=Ib("animationstart"),F7=Ib("transitionend"),D7=new Map,qk="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 Rl(e,t){D7.set(e,t),su(t,[e])}for(var bx=0;bx<qk.length;bx++){var _x=qk[bx],jK=_x.toLowerCase(),VK=_x[0].toUpperCase()+_x.slice(1);Rl(jK,"on"+VK)}Rl(O7,"onAnimationEnd");Rl($7,"onAnimationIteration");Rl(N7,"onAnimationStart");Rl("dblclick","onDoubleClick");Rl("focusin","onFocus");Rl("focusout","onBlur");Rl(F7,"onTransitionEnd");Yd("onMouseEnter",["mouseout","mouseover"]);Yd("onMouseLeave",["mouseout","mouseover"]);Yd("onPointerEnter",["pointerout","pointerover"]);Yd("onPointerLeave",["pointerout","pointerover"]);su("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));su("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));su("onBeforeInput",["compositionend","keypress","textInput","paste"]);su("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));su("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));su("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zh="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(" "),UK=new Set("cancel close invalid load scroll toggle".split(" ").concat(zh));function Kk(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jq(r,t,void 0,e),e.currentTarget=null}function L7(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;Kk(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;Kk(i,a,c),o=l}}}if(kv)throw e=RC,kv=!1,RC=null,e}function Mt(e,t){var n=t[VC];n===void 0&&(n=t[VC]=new Set);var r=e+"__bubble";n.has(r)||(B7(t,e,2,!1),n.add(r))}function Sx(e,t,n){var r=0;t&&(r|=4),B7(n,e,r,t)}var w0="_reactListening"+Math.random().toString(36).slice(2);function zp(e){if(!e[w0]){e[w0]=!0,WO.forEach(function(n){n!=="selectionchange"&&(UK.has(n)||Sx(n,!1,e),Sx(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[w0]||(t[w0]=!0,Sx("selectionchange",!1,t))}}function B7(e,t,n,r){switch(x7(t)){case 1:var i=rK;break;case 4:i=iK;break;default:i=RE}n=i.bind(null,t,n,e),i=void 0,!MC||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 xx(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=vc(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}l7(function(){var c=o,u=kE(n),d=[];e:{var f=D7.get(e);if(f!==void 0){var h=$E,p=e;switch(e){case"keypress":if(By(n)===0)break e;case"keydown":case"keyup":h=bK;break;case"focusin":p="focus",h=gx;break;case"focusout":p="blur",h=gx;break;case"beforeblur":case"afterblur":h=gx;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=Fk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=aK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=xK;break;case O7:case $7:case N7:h=uK;break;case F7:h=CK;break;case"scroll":h=oK;break;case"wheel":h=TK;break;case"copy":case"cut":case"paste":h=fK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Lk}var m=(t&4)!==0,_=!m&&e==="scroll",v=m?f!==null?f+"Capture":null:f;m=[];for(var y=c,g;y!==null;){g=y;var b=g.stateNode;if(g.tag===5&&b!==null&&(g=b,v!==null&&(b=$p(y,v),b!=null&&m.push(jp(y,b,g)))),_)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,u),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==PC&&(p=n.relatedTarget||n.fromElement)&&(vc(p)||p[aa]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?vc(p):null,p!==null&&(_=au(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=c),h!==p)){if(m=Fk,b="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=Lk,b="onPointerLeave",v="onPointerEnter",y="pointer"),_=h==null?f:ed(h),g=p==null?f:ed(p),f=new m(b,y+"leave",h,n,u),f.target=_,f.relatedTarget=g,b=null,vc(u)===c&&(m=new m(v,y+"enter",p,n,u),m.target=g,m.relatedTarget=_,b=m),_=b,h&&p)t:{for(m=h,v=p,y=0,g=m;g;g=Au(g))y++;for(g=0,b=v;b;b=Au(b))g++;for(;0<y-g;)m=Au(m),y--;for(;0<g-y;)v=Au(v),g--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=Au(m),v=Au(v)}m=null}else m=null;h!==null&&Xk(d,f,h,m,!1),p!==null&&_!==null&&Xk(d,_,p,m,!0)}}e:{if(f=c?ed(c):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=OK;else if(jk(f))if(k7)S=DK;else{S=NK;var w=$K}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=FK);if(S&&(S=S(e,c))){A7(d,S,n,u);break e}w&&w(e,f,c),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&CC(f,"number",f.value)}switch(w=c?ed(c):window,e){case"focusin":(jk(w)||w.contentEditable==="true")&&(Zu=w,FC=c,sp=null);break;case"focusout":sp=FC=Zu=null;break;case"mousedown":DC=!0;break;case"contextmenu":case"mouseup":case"dragend":DC=!1,Wk(d,n,u);break;case"selectionchange":if(zK)break;case"keydown":case"keyup":Wk(d,n,u)}var C;if(FE)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 Yu?E7(e,n)&&(x="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(x="onCompositionStart");x&&(C7&&n.locale!=="ko"&&(Yu||x!=="onCompositionStart"?x==="onCompositionEnd"&&Yu&&(C=w7()):(Za=u,OE="value"in Za?Za.value:Za.textContent,Yu=!0)),w=Ov(c,x),0<w.length&&(x=new Dk(x,e,null,n,u),d.push({event:x,listeners:w}),C?x.data=C:(C=T7(n),C!==null&&(x.data=C)))),(C=kK?PK(e,n):IK(e,n))&&(c=Ov(c,"onBeforeInput"),0<c.length&&(u=new Dk("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=C))}L7(d,t)})}function jp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ov(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=$p(e,n),o!=null&&r.unshift(jp(e,o,i)),o=$p(e,t),o!=null&&r.push(jp(e,o,i))),e=e.return}return r}function Au(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xk(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=$p(n,o),l!=null&&s.unshift(jp(n,l,a))):i||(l=$p(n,o),l!=null&&s.push(jp(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var GK=/\r\n?/g,HK=/\u0000|\uFFFD/g;function Qk(e){return(typeof e=="string"?e:""+e).replace(GK,`
`).replace(HK,"")}function C0(e,t,n){if(t=Qk(t),Qk(e)!==t&&n)throw Error(ne(425))}function $v(){}var LC=null,BC=null;function zC(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jC=typeof setTimeout=="function"?setTimeout:void 0,WK=typeof clearTimeout=="function"?clearTimeout:void 0,Yk=typeof Promise=="function"?Promise:void 0,qK=typeof queueMicrotask=="function"?queueMicrotask:typeof Yk<"u"?function(e){return Yk.resolve(null).then(e).catch(KK)}:jC;function KK(e){setTimeout(function(){throw e})}function wx(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),Dp(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Dp(t)}function ol(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 Zk(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 kf=Math.random().toString(36).slice(2),os="__reactFiber$"+kf,Vp="__reactProps$"+kf,aa="__reactContainer$"+kf,VC="__reactEvents$"+kf,XK="__reactListeners$"+kf,QK="__reactHandles$"+kf;function vc(e){var t=e[os];if(t)return t;for(var n=e.parentNode;n;){if(t=n[aa]||n[os]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Zk(e);e!==null;){if(n=e[os])return n;e=Zk(e)}return t}e=n,n=e.parentNode}return null}function sm(e){return e=e[os]||e[aa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ed(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function Mb(e){return e[Vp]||null}var UC=[],td=-1;function Ol(e){return{current:e}}function Ft(e){0>td||(e.current=UC[td],UC[td]=null,td--)}function kt(e,t){td++,UC[td]=e.current,e.current=t}var yl={},vr=Ol(yl),Yr=Ol(!1),Vc=yl;function Zd(e,t){var n=e.type.contextTypes;if(!n)return yl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Zr(e){return e=e.childContextTypes,e!=null}function Nv(){Ft(Yr),Ft(vr)}function Jk(e,t,n){if(vr.current!==yl)throw Error(ne(168));kt(vr,t),kt(Yr,n)}function z7(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,$q(e)||"Unknown",i));return Kt({},n,r)}function Fv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yl,Vc=vr.current,kt(vr,e),kt(Yr,Yr.current),!0}function eP(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=z7(e,t,Vc),r.__reactInternalMemoizedMergedChildContext=e,Ft(Yr),Ft(vr),kt(vr,e)):Ft(Yr),kt(Yr,n)}var Bs=null,Rb=!1,Cx=!1;function j7(e){Bs===null?Bs=[e]:Bs.push(e)}function YK(e){Rb=!0,j7(e)}function $l(){if(!Cx&&Bs!==null){Cx=!0;var e=0,t=mt;try{var n=Bs;for(mt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Bs=null,Rb=!1}catch(i){throw Bs!==null&&(Bs=Bs.slice(e+1)),f7(PE,$l),i}finally{mt=t,Cx=!1}}return null}var nd=[],rd=0,Dv=null,Lv=0,Hi=[],Wi=0,Uc=null,qs=1,Ks="";function rc(e,t){nd[rd++]=Lv,nd[rd++]=Dv,Dv=e,Lv=t}function V7(e,t,n){Hi[Wi++]=qs,Hi[Wi++]=Ks,Hi[Wi++]=Uc,Uc=e;var r=qs;e=Ks;var i=32-Ao(r)-1;r&=~(1<<i),n+=1;var o=32-Ao(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,qs=1<<32-Ao(t)+i|n<<i|r,Ks=o+e}else qs=1<<o|n<<i|r,Ks=e}function LE(e){e.return!==null&&(rc(e,1),V7(e,1,0))}function BE(e){for(;e===Dv;)Dv=nd[--rd],nd[rd]=null,Lv=nd[--rd],nd[rd]=null;for(;e===Uc;)Uc=Hi[--Wi],Hi[Wi]=null,Ks=Hi[--Wi],Hi[Wi]=null,qs=Hi[--Wi],Hi[Wi]=null}var _i=null,vi=null,zt=!1,So=null;function U7(e,t){var n=Ki(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 tP(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,vi=ol(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_i=e,vi=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Uc!==null?{id:qs,overflow:Ks}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ki(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_i=e,vi=null,!0):!1;default:return!1}}function GC(e){return(e.mode&1)!==0&&(e.flags&128)===0}function HC(e){if(zt){var t=vi;if(t){var n=t;if(!tP(e,t)){if(GC(e))throw Error(ne(418));t=ol(n.nextSibling);var r=_i;t&&tP(e,t)?U7(r,n):(e.flags=e.flags&-4097|2,zt=!1,_i=e)}}else{if(GC(e))throw Error(ne(418));e.flags=e.flags&-4097|2,zt=!1,_i=e}}}function nP(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_i=e}function E0(e){if(e!==_i)return!1;if(!zt)return nP(e),zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zC(e.type,e.memoizedProps)),t&&(t=vi)){if(GC(e))throw G7(),Error(ne(418));for(;t;)U7(e,t),t=ol(t.nextSibling)}if(nP(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){vi=ol(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vi=null}}else vi=_i?ol(e.stateNode.nextSibling):null;return!0}function G7(){for(var e=vi;e;)e=ol(e.nextSibling)}function Jd(){vi=_i=null,zt=!1}function zE(e){So===null?So=[e]:So.push(e)}var ZK=ga.ReactCurrentBatchConfig;function yo(e,t){if(e&&e.defaultProps){t=Kt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Bv=Ol(null),zv=null,id=null,jE=null;function VE(){jE=id=zv=null}function UE(e){var t=Bv.current;Ft(Bv),e._currentValue=t}function WC(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 Td(e,t){zv=e,jE=id=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xr=!0),e.firstContext=null)}function Yi(e){var t=e._currentValue;if(jE!==e)if(e={context:e,memoizedValue:t,next:null},id===null){if(zv===null)throw Error(ne(308));id=e,zv.dependencies={lanes:0,firstContext:e}}else id=id.next=e;return t}var bc=null;function GE(e){bc===null?bc=[e]:bc.push(e)}function H7(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,GE(t)):(n.next=i.next,i.next=n),t.interleaved=n,la(e,r)}function la(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 Ba=!1;function HE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function W7(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 Js(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,it&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,la(e,n)}return i=r.interleaved,i===null?(t.next=t,GE(r)):(t.next=i.next,i.next=t),r.interleaved=t,la(e,n)}function zy(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,IE(e,n)}}function rP(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jv(e,t,n,r){var i=e.updateQueue;Ba=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,u=c=l=null,a=o;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(f=t,h=n,m.tag){case 1:if(p=m.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=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=Kt({},d,f);break e;case 2:Ba=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,s|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Hc|=s,e.lanes=s,e.memoizedState=d}}function iP(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 q7=new HO.Component().refs;function qC(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ob={isMounted:function(e){return(e=e._reactInternals)?au(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nr(),i=ll(e),o=Js(r,i);o.payload=t,n!=null&&(o.callback=n),t=sl(e,o,i),t!==null&&(ko(t,e,i,r),zy(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nr(),i=ll(e),o=Js(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=sl(e,o,i),t!==null&&(ko(t,e,i,r),zy(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nr(),r=ll(e),i=Js(n,r);i.tag=2,t!=null&&(i.callback=t),t=sl(e,i,r),t!==null&&(ko(t,e,r,n),zy(t,e,r))}};function oP(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!Bp(n,r)||!Bp(i,o):!0}function K7(e,t,n){var r=!1,i=yl,o=t.contextType;return typeof o=="object"&&o!==null?o=Yi(o):(i=Zr(t)?Vc:vr.current,r=t.contextTypes,o=(r=r!=null)?Zd(e,i):yl),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ob,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function sP(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&&Ob.enqueueReplaceState(t,t.state,null)}function KC(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=q7,HE(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Yi(o):(o=Zr(t)?Vc:vr.current,i.context=Zd(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(qC(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&&Ob.enqueueReplaceState(i,i.state,null),jv(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(s){var a=i.refs;a===q7&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,e))}return e}function T0(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function aP(e){var t=e._init;return t(e._payload)}function X7(e){function t(v,y){if(e){var g=v.deletions;g===null?(v.deletions=[y],v.flags|=16):g.push(y)}}function n(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function i(v,y){return v=cl(v,y),v.index=0,v.sibling=null,v}function o(v,y,g){return v.index=g,e?(g=v.alternate,g!==null?(g=g.index,g<y?(v.flags|=2,y):g):(v.flags|=2,y)):(v.flags|=1048576,y)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,y,g,b){return y===null||y.tag!==6?(y=Mx(g,v.mode,b),y.return=v,y):(y=i(y,g),y.return=v,y)}function l(v,y,g,b){var S=g.type;return S===Qu?u(v,y,g.props.children,b,g.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===La&&aP(S)===y.type)?(b=i(y,g.props),b.ref=ah(v,y,g),b.return=v,b):(b=Wy(g.type,g.key,g.props,null,v.mode,b),b.ref=ah(v,y,g),b.return=v,b)}function c(v,y,g,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Rx(g,v.mode,b),y.return=v,y):(y=i(y,g.children||[]),y.return=v,y)}function u(v,y,g,b,S){return y===null||y.tag!==7?(y=Pc(g,v.mode,b,S),y.return=v,y):(y=i(y,g),y.return=v,y)}function d(v,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Mx(""+y,v.mode,g),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case g0:return g=Wy(y.type,y.key,y.props,null,v.mode,g),g.ref=ah(v,null,y),g.return=v,g;case Xu:return y=Rx(y,v.mode,g),y.return=v,y;case La:var b=y._init;return d(v,b(y._payload),g)}if(Lh(y)||nh(y))return y=Pc(y,v.mode,g,null),y.return=v,y;T0(v,y)}return null}function f(v,y,g,b){var S=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:a(v,y,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case g0:return g.key===S?l(v,y,g,b):null;case Xu:return g.key===S?c(v,y,g,b):null;case La:return S=g._init,f(v,y,S(g._payload),b)}if(Lh(g)||nh(g))return S!==null?null:u(v,y,g,b,null);T0(v,g)}return null}function h(v,y,g,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(g)||null,a(y,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case g0:return v=v.get(b.key===null?g:b.key)||null,l(y,v,b,S);case Xu:return v=v.get(b.key===null?g:b.key)||null,c(y,v,b,S);case La:var w=b._init;return h(v,y,g,w(b._payload),S)}if(Lh(b)||nh(b))return v=v.get(g)||null,u(y,v,b,S,null);T0(y,b)}return null}function p(v,y,g,b){for(var S=null,w=null,C=y,x=y=0,k=null;C!==null&&x<g.length;x++){C.index>x?(k=C,C=null):k=C.sibling;var A=f(v,C,g[x],b);if(A===null){C===null&&(C=k);break}e&&C&&A.alternate===null&&t(v,C),y=o(A,y,x),w===null?S=A:w.sibling=A,w=A,C=k}if(x===g.length)return n(v,C),zt&&rc(v,x),S;if(C===null){for(;x<g.length;x++)C=d(v,g[x],b),C!==null&&(y=o(C,y,x),w===null?S=C:w.sibling=C,w=C);return zt&&rc(v,x),S}for(C=r(v,C);x<g.length;x++)k=h(C,v,x,g[x],b),k!==null&&(e&&k.alternate!==null&&C.delete(k.key===null?x:k.key),y=o(k,y,x),w===null?S=k:w.sibling=k,w=k);return e&&C.forEach(function(R){return t(v,R)}),zt&&rc(v,x),S}function m(v,y,g,b){var S=nh(g);if(typeof S!="function")throw Error(ne(150));if(g=S.call(g),g==null)throw Error(ne(151));for(var w=S=null,C=y,x=y=0,k=null,A=g.next();C!==null&&!A.done;x++,A=g.next()){C.index>x?(k=C,C=null):k=C.sibling;var R=f(v,C,A.value,b);if(R===null){C===null&&(C=k);break}e&&C&&R.alternate===null&&t(v,C),y=o(R,y,x),w===null?S=R:w.sibling=R,w=R,C=k}if(A.done)return n(v,C),zt&&rc(v,x),S;if(C===null){for(;!A.done;x++,A=g.next())A=d(v,A.value,b),A!==null&&(y=o(A,y,x),w===null?S=A:w.sibling=A,w=A);return zt&&rc(v,x),S}for(C=r(v,C);!A.done;x++,A=g.next())A=h(C,v,x,A.value,b),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?x:A.key),y=o(A,y,x),w===null?S=A:w.sibling=A,w=A);return e&&C.forEach(function(L){return t(v,L)}),zt&&rc(v,x),S}function _(v,y,g,b){if(typeof g=="object"&&g!==null&&g.type===Qu&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case g0:e:{for(var S=g.key,w=y;w!==null;){if(w.key===S){if(S=g.type,S===Qu){if(w.tag===7){n(v,w.sibling),y=i(w,g.props.children),y.return=v,v=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===La&&aP(S)===w.type){n(v,w.sibling),y=i(w,g.props),y.ref=ah(v,w,g),y.return=v,v=y;break e}n(v,w);break}else t(v,w);w=w.sibling}g.type===Qu?(y=Pc(g.props.children,v.mode,b,g.key),y.return=v,v=y):(b=Wy(g.type,g.key,g.props,null,v.mode,b),b.ref=ah(v,y,g),b.return=v,v=b)}return s(v);case Xu:e:{for(w=g.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(v,y.sibling),y=i(y,g.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else t(v,y);y=y.sibling}y=Rx(g,v.mode,b),y.return=v,v=y}return s(v);case La:return w=g._init,_(v,y,w(g._payload),b)}if(Lh(g))return p(v,y,g,b);if(nh(g))return m(v,y,g,b);T0(v,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,g),y.return=v,v=y):(n(v,y),y=Mx(g,v.mode,b),y.return=v,v=y),s(v)):n(v,y)}return _}var ef=X7(!0),Q7=X7(!1),am={},hs=Ol(am),Up=Ol(am),Gp=Ol(am);function _c(e){if(e===am)throw Error(ne(174));return e}function WE(e,t){switch(kt(Gp,t),kt(Up,e),kt(hs,am),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:TC(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=TC(t,e)}Ft(hs),kt(hs,t)}function tf(){Ft(hs),Ft(Up),Ft(Gp)}function Y7(e){_c(Gp.current);var t=_c(hs.current),n=TC(t,e.type);t!==n&&(kt(Up,e),kt(hs,n))}function qE(e){Up.current===e&&(Ft(hs),Ft(Up))}var Ht=Ol(0);function Vv(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 Ex=[];function KE(){for(var e=0;e<Ex.length;e++)Ex[e]._workInProgressVersionPrimary=null;Ex.length=0}var jy=ga.ReactCurrentDispatcher,Tx=ga.ReactCurrentBatchConfig,Gc=0,qt=null,xn=null,Nn=null,Uv=!1,ap=!1,Hp=0,JK=0;function cr(){throw Error(ne(321))}function XE(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$o(e[n],t[n]))return!1;return!0}function QE(e,t,n,r,i,o){if(Gc=o,qt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,jy.current=e===null||e.memoizedState===null?rX:iX,e=n(r,i),ap){o=0;do{if(ap=!1,Hp=0,25<=o)throw Error(ne(301));o+=1,Nn=xn=null,t.updateQueue=null,jy.current=oX,e=n(r,i)}while(ap)}if(jy.current=Gv,t=xn!==null&&xn.next!==null,Gc=0,Nn=xn=qt=null,Uv=!1,t)throw Error(ne(300));return e}function YE(){var e=Hp!==0;return Hp=0,e}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?qt.memoizedState=Nn=e:Nn=Nn.next=e,Nn}function Zi(){if(xn===null){var e=qt.alternate;e=e!==null?e.memoizedState:null}else e=xn.next;var t=Nn===null?qt.memoizedState:Nn.next;if(t!==null)Nn=t,xn=e;else{if(e===null)throw Error(ne(310));xn=e,e={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Nn===null?qt.memoizedState=Nn=e:Nn=Nn.next=e}return Nn}function Wp(e,t){return typeof t=="function"?t(e):t}function Ax(e){var t=Zi(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=xn,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((Gc&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,qt.lanes|=u,Hc|=u}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,$o(r,t.memoizedState)||(Xr=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,qt.lanes|=o,Hc|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function kx(e){var t=Zi(),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 s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);$o(o,t.memoizedState)||(Xr=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Z7(){}function J7(e,t){var n=qt,r=Zi(),i=t(),o=!$o(r.memoizedState,i);if(o&&(r.memoizedState=i,Xr=!0),r=r.queue,ZE(n$.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Nn!==null&&Nn.memoizedState.tag&1){if(n.flags|=2048,qp(9,t$.bind(null,n,r,i,t),void 0,null),Ln===null)throw Error(ne(349));Gc&30||e$(n,t,i)}return i}function e$(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function t$(e,t,n,r){t.value=n,t.getSnapshot=r,r$(t)&&i$(e)}function n$(e,t,n){return n(function(){r$(t)&&i$(e)})}function r$(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$o(e,n)}catch{return!0}}function i$(e){var t=la(e,1);t!==null&&ko(t,e,1,-1)}function lP(e){var t=Qo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wp,lastRenderedState:e},t.queue=e,e=e.dispatch=nX.bind(null,qt,e),[t.memoizedState,e]}function qp(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.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 o$(){return Zi().memoizedState}function Vy(e,t,n,r){var i=Qo();qt.flags|=e,i.memoizedState=qp(1|t,n,void 0,r===void 0?null:r)}function $b(e,t,n,r){var i=Zi();r=r===void 0?null:r;var o=void 0;if(xn!==null){var s=xn.memoizedState;if(o=s.destroy,r!==null&&XE(r,s.deps)){i.memoizedState=qp(t,n,o,r);return}}qt.flags|=e,i.memoizedState=qp(1|t,n,o,r)}function cP(e,t){return Vy(8390656,8,e,t)}function ZE(e,t){return $b(2048,8,e,t)}function s$(e,t){return $b(4,2,e,t)}function a$(e,t){return $b(4,4,e,t)}function l$(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 c$(e,t,n){return n=n!=null?n.concat([e]):null,$b(4,4,l$.bind(null,t,e),n)}function JE(){}function u$(e,t){var n=Zi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&XE(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function d$(e,t){var n=Zi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&XE(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function f$(e,t,n){return Gc&21?($o(n,t)||(n=g7(),qt.lanes|=n,Hc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xr=!0),e.memoizedState=n)}function eX(e,t){var n=mt;mt=n!==0&&4>n?n:4,e(!0);var r=Tx.transition;Tx.transition={};try{e(!1),t()}finally{mt=n,Tx.transition=r}}function h$(){return Zi().memoizedState}function tX(e,t,n){var r=ll(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},p$(e))g$(t,n);else if(n=H7(e,t,n,r),n!==null){var i=Nr();ko(n,e,r,i),m$(n,t,r)}}function nX(e,t,n){var r=ll(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(p$(e))g$(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,$o(a,s)){var l=t.interleaved;l===null?(i.next=i,GE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=H7(e,t,i,r),n!==null&&(i=Nr(),ko(n,e,r,i),m$(n,t,r))}}function p$(e){var t=e.alternate;return e===qt||t!==null&&t===qt}function g$(e,t){ap=Uv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function m$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,IE(e,n)}}var Gv={readContext:Yi,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},rX={readContext:Yi,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:cP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vy(4194308,4,l$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vy(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vy(4,2,e,t)},useMemo:function(e,t){var n=Qo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qo();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=tX.bind(null,qt,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:lP,useDebugValue:JE,useDeferredValue:function(e){return Qo().memoizedState=e},useTransition:function(){var e=lP(!1),t=e[0];return e=eX.bind(null,e[1]),Qo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qt,i=Qo();if(zt){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),Ln===null)throw Error(ne(349));Gc&30||e$(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,cP(n$.bind(null,r,o,e),[e]),r.flags|=2048,qp(9,t$.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Qo(),t=Ln.identifierPrefix;if(zt){var n=Ks,r=qs;n=(r&~(1<<32-Ao(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Hp++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=JK++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},iX={readContext:Yi,useCallback:u$,useContext:Yi,useEffect:ZE,useImperativeHandle:c$,useInsertionEffect:s$,useLayoutEffect:a$,useMemo:d$,useReducer:Ax,useRef:o$,useState:function(){return Ax(Wp)},useDebugValue:JE,useDeferredValue:function(e){var t=Zi();return f$(t,xn.memoizedState,e)},useTransition:function(){var e=Ax(Wp)[0],t=Zi().memoizedState;return[e,t]},useMutableSource:Z7,useSyncExternalStore:J7,useId:h$,unstable_isNewReconciler:!1},oX={readContext:Yi,useCallback:u$,useContext:Yi,useEffect:ZE,useImperativeHandle:c$,useInsertionEffect:s$,useLayoutEffect:a$,useMemo:d$,useReducer:kx,useRef:o$,useState:function(){return kx(Wp)},useDebugValue:JE,useDeferredValue:function(e){var t=Zi();return xn===null?t.memoizedState=e:f$(t,xn.memoizedState,e)},useTransition:function(){var e=kx(Wp)[0],t=Zi().memoizedState;return[e,t]},useMutableSource:Z7,useSyncExternalStore:J7,useId:h$,unstable_isNewReconciler:!1};function nf(e,t){try{var n="",r=t;do n+=Oq(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 Px(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function XC(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var sX=typeof WeakMap=="function"?WeakMap:Map;function y$(e,t,n){n=Js(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wv||(Wv=!0,o5=r),XC(e,t)},n}function v$(e,t,n){n=Js(-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(){XC(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){XC(e,t),typeof r!="function"&&(al===null?al=new Set([this]):al.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function uP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sX;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=_X.bind(null,e,t,n),t.then(e,e))}function dP(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 fP(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=Js(-1,1),t.tag=2,sl(n,t,1))),n.lanes|=1),e)}var aX=ga.ReactCurrentOwner,Xr=!1;function Rr(e,t,n,r){t.child=e===null?Q7(t,null,n,r):ef(t,e.child,n,r)}function hP(e,t,n,r,i){n=n.render;var o=t.ref;return Td(t,i),r=QE(e,t,n,r,o,i),n=YE(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(zt&&n&&LE(t),t.flags|=1,Rr(e,t,r,i),t.child)}function pP(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!a4(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,b$(e,t,o,r,i)):(e=Wy(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Bp,n(s,r)&&e.ref===t.ref)return ca(e,t,i)}return t.flags|=1,e=cl(o,r),e.ref=t.ref,e.return=t,t.child=e}function b$(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Bp(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,ca(e,t,i)}return QC(e,t,n,r,i)}function _$(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},kt(sd,fi),fi|=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,kt(sd,fi),fi|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,kt(sd,fi),fi|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,kt(sd,fi),fi|=r;return Rr(e,t,i,n),t.child}function S$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function QC(e,t,n,r,i){var o=Zr(n)?Vc:vr.current;return o=Zd(t,o),Td(t,i),n=QE(e,t,n,r,o,i),r=YE(),e!==null&&!Xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(zt&&r&&LE(t),t.flags|=1,Rr(e,t,n,i),t.child)}function gP(e,t,n,r,i){if(Zr(n)){var o=!0;Fv(t)}else o=!1;if(Td(t,i),t.stateNode===null)Uy(e,t),K7(t,n,r),KC(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Yi(c):(c=Zr(n)?Vc:vr.current,c=Zd(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&sP(t,s,r,c),Ba=!1;var f=t.memoizedState;s.state=f,jv(t,r,s,i),l=t.memoizedState,a!==r||f!==l||Yr.current||Ba?(typeof u=="function"&&(qC(t,n,u,r),l=t.memoizedState),(a=Ba||oP(t,n,a,r,f,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,W7(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:yo(t.type,a),s.props=c,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Yi(l):(l=Zr(n)?Vc:vr.current,l=Zd(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&sP(t,s,r,l),Ba=!1,f=t.memoizedState,s.state=f,jv(t,r,s,i);var p=t.memoizedState;a!==d||f!==p||Yr.current||Ba?(typeof h=="function"&&(qC(t,n,h,r),p=t.memoizedState),(c=Ba||oP(t,n,c,r,f,p,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return YC(e,t,n,r,o,i)}function YC(e,t,n,r,i,o){S$(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&eP(t,n,!1),ca(e,t,o);r=t.stateNode,aX.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ef(t,e.child,null,o),t.child=ef(t,null,a,o)):Rr(e,t,a,o),t.memoizedState=r.state,i&&eP(t,n,!0),t.child}function x$(e){var t=e.stateNode;t.pendingContext?Jk(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jk(e,t.context,!1),WE(e,t.containerInfo)}function mP(e,t,n,r,i){return Jd(),zE(i),t.flags|=256,Rr(e,t,n,r),t.child}var ZC={dehydrated:null,treeContext:null,retryLane:0};function JC(e){return{baseLanes:e,cachePool:null,transitions:null}}function w$(e,t,n){var r=t.pendingProps,i=Ht.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),kt(Ht,i&1),e===null)return HC(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Db(s,r,0,null),e=Pc(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=JC(n),t.memoizedState=ZC,e):e4(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return lX(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=cl(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=cl(a,o):(o=Pc(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?JC(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=ZC,r}return o=e.child,e=o.sibling,r=cl(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 e4(e,t){return t=Db({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function A0(e,t,n,r){return r!==null&&zE(r),ef(t,e.child,null,n),e=e4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lX(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Px(Error(ne(422))),A0(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Db({mode:"visible",children:r.children},i,0,null),o=Pc(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ef(t,e.child,null,s),t.child.memoizedState=JC(s),t.memoizedState=ZC,o);if(!(t.mode&1))return A0(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(ne(419)),r=Px(o,r,void 0),A0(e,t,s,r)}if(a=(s&e.childLanes)!==0,Xr||a){if(r=Ln,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,la(e,i),ko(r,e,i,-1))}return s4(),r=Px(Error(ne(421))),A0(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=SX.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,vi=ol(i.nextSibling),_i=t,zt=!0,So=null,e!==null&&(Hi[Wi++]=qs,Hi[Wi++]=Ks,Hi[Wi++]=Uc,qs=e.id,Ks=e.overflow,Uc=t),t=e4(t,r.children),t.flags|=4096,t)}function yP(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),WC(e.return,t,n)}function Ix(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 C$(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Rr(e,t,r.children,n),r=Ht.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(kt(Ht,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&&Vv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ix(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&&Vv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ix(t,!0,n,null,o);break;case"together":Ix(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Uy(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hc|=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=cl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cX(e,t,n){switch(t.tag){case 3:x$(t),Jd();break;case 5:Y7(t);break;case 1:Zr(t.type)&&Fv(t);break;case 4:WE(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;kt(Bv,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(kt(Ht,Ht.current&1),t.flags|=128,null):n&t.child.childLanes?w$(e,t,n):(kt(Ht,Ht.current&1),e=ca(e,t,n),e!==null?e.sibling:null);kt(Ht,Ht.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return C$(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),kt(Ht,Ht.current),r)break;return null;case 22:case 23:return t.lanes=0,_$(e,t,n)}return ca(e,t,n)}var E$,e5,T$,A$;E$=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}};e5=function(){};T$=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_c(hs.current);var o=null;switch(n){case"input":i=xC(e,i),r=xC(e,r),o=[];break;case"select":i=Kt({},i,{value:void 0}),r=Kt({},r,{value:void 0}),o=[];break;case"textarea":i=EC(e,i),r=EC(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=$v)}AC(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Rp.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Rp.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Mt("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};A$=function(e,t,n,r){n!==r&&(t.flags|=4)};function lh(e,t){if(!zt)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 ur(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 uX(e,t,n){var r=t.pendingProps;switch(BE(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(t),null;case 1:return Zr(t.type)&&Nv(),ur(t),null;case 3:return r=t.stateNode,tf(),Ft(Yr),Ft(vr),KE(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(E0(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,So!==null&&(l5(So),So=null))),e5(e,t),ur(t),null;case 5:qE(t);var i=_c(Gp.current);if(n=t.type,e!==null&&t.stateNode!=null)T$(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 ur(t),null}if(e=_c(hs.current),E0(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[os]=t,r[Vp]=o,e=(t.mode&1)!==0,n){case"dialog":Mt("cancel",r),Mt("close",r);break;case"iframe":case"object":case"embed":Mt("load",r);break;case"video":case"audio":for(i=0;i<zh.length;i++)Mt(zh[i],r);break;case"source":Mt("error",r);break;case"img":case"image":case"link":Mt("error",r),Mt("load",r);break;case"details":Mt("toggle",r);break;case"input":Tk(r,o),Mt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Mt("invalid",r);break;case"textarea":kk(r,o),Mt("invalid",r)}AC(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&C0(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&C0(r.textContent,a,e),i=["children",""+a]):Rp.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Mt("scroll",r)}switch(n){case"input":m0(r),Ak(r,o,!0);break;case"textarea":m0(r),Pk(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=$v)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=e7(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[os]=t,e[Vp]=r,E$(e,t,!1,!1),t.stateNode=e;e:{switch(s=kC(n,r),n){case"dialog":Mt("cancel",e),Mt("close",e),i=r;break;case"iframe":case"object":case"embed":Mt("load",e),i=r;break;case"video":case"audio":for(i=0;i<zh.length;i++)Mt(zh[i],e);i=r;break;case"source":Mt("error",e),i=r;break;case"img":case"image":case"link":Mt("error",e),Mt("load",e),i=r;break;case"details":Mt("toggle",e),i=r;break;case"input":Tk(e,r),i=xC(e,r),Mt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Kt({},r,{value:void 0}),Mt("invalid",e);break;case"textarea":kk(e,r),i=EC(e,r),Mt("invalid",e);break;default:i=r}AC(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?r7(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&t7(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Op(e,l):typeof l=="number"&&Op(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Rp.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Mt("scroll",e):l!=null&&CE(e,o,l,s))}switch(n){case"input":m0(e),Ak(e,r,!1);break;case"textarea":m0(e),Pk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ml(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?xd(e,!!r.multiple,o,!1):r.defaultValue!=null&&xd(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=$v)}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 ur(t),null;case 6:if(e&&t.stateNode!=null)A$(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ne(166));if(n=_c(Gp.current),_c(hs.current),E0(t)){if(r=t.stateNode,n=t.memoizedProps,r[os]=t,(o=r.nodeValue!==n)&&(e=_i,e!==null))switch(e.tag){case 3:C0(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&C0(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[os]=t,t.stateNode=r}return ur(t),null;case 13:if(Ft(Ht),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(zt&&vi!==null&&t.mode&1&&!(t.flags&128))G7(),Jd(),t.flags|=98560,o=!1;else if(o=E0(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[os]=t}else Jd(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ur(t),o=!1}else So!==null&&(l5(So),So=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||Ht.current&1?En===0&&(En=3):s4())),t.updateQueue!==null&&(t.flags|=4),ur(t),null);case 4:return tf(),e5(e,t),e===null&&zp(t.stateNode.containerInfo),ur(t),null;case 10:return UE(t.type._context),ur(t),null;case 17:return Zr(t.type)&&Nv(),ur(t),null;case 19:if(Ft(Ht),o=t.memoizedState,o===null)return ur(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)lh(o,!1);else{if(En!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Vv(e),s!==null){for(t.flags|=128,lh(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return kt(Ht,Ht.current&1|2),t.child}e=e.sibling}o.tail!==null&&cn()>rf&&(t.flags|=128,r=!0,lh(o,!1),t.lanes=4194304)}else{if(!r)if(e=Vv(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!zt)return ur(t),null}else 2*cn()-o.renderingStartTime>rf&&n!==1073741824&&(t.flags|=128,r=!0,lh(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=cn(),t.sibling=null,n=Ht.current,kt(Ht,r?n&1|2:n&1),t):(ur(t),null);case 22:case 23:return o4(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fi&1073741824&&(ur(t),t.subtreeFlags&6&&(t.flags|=8192)):ur(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function dX(e,t){switch(BE(t),t.tag){case 1:return Zr(t.type)&&Nv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tf(),Ft(Yr),Ft(vr),KE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qE(t),null;case 13:if(Ft(Ht),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));Jd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ft(Ht),null;case 4:return tf(),null;case 10:return UE(t.type._context),null;case 22:case 23:return o4(),null;case 24:return null;default:return null}}var k0=!1,gr=!1,fX=typeof WeakSet=="function"?WeakSet:Set,ye=null;function od(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zt(e,t,r)}else n.current=null}function t5(e,t,n){try{n()}catch(r){Zt(e,t,r)}}var vP=!1;function hX(e,t){if(LC=Mv,e=M7(),DE(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++c===i&&(a=s),f===o&&++u===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(BC={focusedElem:e,selectionRange:n},Mv=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;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 m=p.memoizedProps,_=p.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:yo(t.type,m),_);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(b){Zt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return p=vP,vP=!1,p}function lp(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&&t5(t,n,o)}i=i.next}while(i!==r)}}function Nb(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 n5(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 k$(e){var t=e.alternate;t!==null&&(e.alternate=null,k$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[os],delete t[Vp],delete t[VC],delete t[XK],delete t[QK])),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 P$(e){return e.tag===5||e.tag===3||e.tag===4}function bP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P$(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 r5(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=$v));else if(r!==4&&(e=e.child,e!==null))for(r5(e,t,n),e=e.sibling;e!==null;)r5(e,t,n),e=e.sibling}function i5(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(i5(e,t,n),e=e.sibling;e!==null;)i5(e,t,n),e=e.sibling}var Zn=null,bo=!1;function Aa(e,t,n){for(n=n.child;n!==null;)I$(e,t,n),n=n.sibling}function I$(e,t,n){if(fs&&typeof fs.onCommitFiberUnmount=="function")try{fs.onCommitFiberUnmount(Ab,n)}catch{}switch(n.tag){case 5:gr||od(n,t);case 6:var r=Zn,i=bo;Zn=null,Aa(e,t,n),Zn=r,bo=i,Zn!==null&&(bo?(e=Zn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Zn.removeChild(n.stateNode));break;case 18:Zn!==null&&(bo?(e=Zn,n=n.stateNode,e.nodeType===8?wx(e.parentNode,n):e.nodeType===1&&wx(e,n),Dp(e)):wx(Zn,n.stateNode));break;case 4:r=Zn,i=bo,Zn=n.stateNode.containerInfo,bo=!0,Aa(e,t,n),Zn=r,bo=i;break;case 0:case 11:case 14:case 15:if(!gr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&t5(n,t,s),i=i.next}while(i!==r)}Aa(e,t,n);break;case 1:if(!gr&&(od(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Zt(n,t,a)}Aa(e,t,n);break;case 21:Aa(e,t,n);break;case 22:n.mode&1?(gr=(r=gr)||n.memoizedState!==null,Aa(e,t,n),gr=r):Aa(e,t,n);break;default:Aa(e,t,n)}}function _P(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fX),t.forEach(function(r){var i=xX.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function po(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Zn=a.stateNode,bo=!1;break e;case 3:Zn=a.stateNode.containerInfo,bo=!0;break e;case 4:Zn=a.stateNode.containerInfo,bo=!0;break e}a=a.return}if(Zn===null)throw Error(ne(160));I$(o,s,i),Zn=null,bo=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Zt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)M$(t,e),t=t.sibling}function M$(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(po(t,e),qo(e),r&4){try{lp(3,e,e.return),Nb(3,e)}catch(m){Zt(e,e.return,m)}try{lp(5,e,e.return)}catch(m){Zt(e,e.return,m)}}break;case 1:po(t,e),qo(e),r&512&&n!==null&&od(n,n.return);break;case 5:if(po(t,e),qo(e),r&512&&n!==null&&od(n,n.return),e.flags&32){var i=e.stateNode;try{Op(i,"")}catch(m){Zt(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&ZO(i,o),kC(a,s);var c=kC(a,o);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?r7(i,d):u==="dangerouslySetInnerHTML"?t7(i,d):u==="children"?Op(i,d):CE(i,u,d,c)}switch(a){case"input":wC(i,o);break;case"textarea":JO(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?xd(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?xd(i,!!o.multiple,o.defaultValue,!0):xd(i,!!o.multiple,o.multiple?[]:"",!1))}i[Vp]=o}catch(m){Zt(e,e.return,m)}}break;case 6:if(po(t,e),qo(e),r&4){if(e.stateNode===null)throw Error(ne(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){Zt(e,e.return,m)}}break;case 3:if(po(t,e),qo(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Dp(t.containerInfo)}catch(m){Zt(e,e.return,m)}break;case 4:po(t,e),qo(e);break;case 13:po(t,e),qo(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(r4=cn())),r&4&&_P(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(gr=(c=gr)||u,po(t,e),gr=c):po(t,e),qo(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(ye=e,u=e.child;u!==null;){for(d=ye=u;ye!==null;){switch(f=ye,h=f.child,f.tag){case 0:case 11:case 14:case 15:lp(4,f,f.return);break;case 1:od(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(m){Zt(r,n,m)}}break;case 5:od(f,f.return);break;case 22:if(f.memoizedState!==null){xP(d);continue}}h!==null?(h.return=f,ye=h):xP(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{i=d.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=n7("display",s))}catch(m){Zt(e,e.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(m){Zt(e,e.return,m)}}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;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:po(t,e),qo(e),r&4&&_P(e);break;case 21:break;default:po(t,e),qo(e)}}function qo(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(P$(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&&(Op(i,""),r.flags&=-33);var o=bP(e);i5(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=bP(e);r5(e,a,s);break;default:throw Error(ne(161))}}catch(l){Zt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pX(e,t,n){ye=e,R$(e)}function R$(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var i=ye,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||k0;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||gr;a=k0;var c=gr;if(k0=s,(gr=l)&&!c)for(ye=i;ye!==null;)s=ye,l=s.child,s.tag===22&&s.memoizedState!==null?wP(i):l!==null?(l.return=s,ye=l):wP(i);for(;o!==null;)ye=o,R$(o),o=o.sibling;ye=i,k0=a,gr=c}SP(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ye=o):SP(e)}}function SP(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gr||Nb(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!gr)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&iP(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}iP(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Dp(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}gr||t.flags&512&&n5(t)}catch(f){Zt(t,t.return,f)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function xP(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function wP(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Nb(4,t)}catch(l){Zt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Zt(t,i,l)}}var o=t.return;try{n5(t)}catch(l){Zt(t,o,l)}break;case 5:var s=t.return;try{n5(t)}catch(l){Zt(t,s,l)}}}catch(l){Zt(t,t.return,l)}if(t===e){ye=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ye=a;break}ye=t.return}}var gX=Math.ceil,Hv=ga.ReactCurrentDispatcher,t4=ga.ReactCurrentOwner,Qi=ga.ReactCurrentBatchConfig,it=0,Ln=null,yn=null,rr=0,fi=0,sd=Ol(0),En=0,Kp=null,Hc=0,Fb=0,n4=0,cp=null,qr=null,r4=0,rf=1/0,Ls=null,Wv=!1,o5=null,al=null,P0=!1,Ja=null,qv=0,up=0,s5=null,Gy=-1,Hy=0;function Nr(){return it&6?cn():Gy!==-1?Gy:Gy=cn()}function ll(e){return e.mode&1?it&2&&rr!==0?rr&-rr:ZK.transition!==null?(Hy===0&&(Hy=g7()),Hy):(e=mt,e!==0||(e=window.event,e=e===void 0?16:x7(e.type)),e):1}function ko(e,t,n,r){if(50<up)throw up=0,s5=null,Error(ne(185));im(e,n,r),(!(it&2)||e!==Ln)&&(e===Ln&&(!(it&2)&&(Fb|=n),En===4&&Ha(e,rr)),Jr(e,r),n===1&&it===0&&!(t.mode&1)&&(rf=cn()+500,Rb&&$l()))}function Jr(e,t){var n=e.callbackNode;Zq(e,t);var r=Iv(e,e===Ln?rr:0);if(r===0)n!==null&&Rk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Rk(n),t===1)e.tag===0?YK(CP.bind(null,e)):j7(CP.bind(null,e)),qK(function(){!(it&6)&&$l()}),n=null;else{switch(m7(r)){case 1:n=PE;break;case 4:n=h7;break;case 16:n=Pv;break;case 536870912:n=p7;break;default:n=Pv}n=z$(n,O$.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function O$(e,t){if(Gy=-1,Hy=0,it&6)throw Error(ne(327));var n=e.callbackNode;if(Ad()&&e.callbackNode!==n)return null;var r=Iv(e,e===Ln?rr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Kv(e,r);else{t=r;var i=it;it|=2;var o=N$();(Ln!==e||rr!==t)&&(Ls=null,rf=cn()+500,kc(e,t));do try{vX();break}catch(a){$$(e,a)}while(1);VE(),Hv.current=o,it=i,yn!==null?t=0:(Ln=null,rr=0,t=En)}if(t!==0){if(t===2&&(i=OC(e),i!==0&&(r=i,t=a5(e,i))),t===1)throw n=Kp,kc(e,0),Ha(e,r),Jr(e,cn()),n;if(t===6)Ha(e,r);else{if(i=e.current.alternate,!(r&30)&&!mX(i)&&(t=Kv(e,r),t===2&&(o=OC(e),o!==0&&(r=o,t=a5(e,o))),t===1))throw n=Kp,kc(e,0),Ha(e,r),Jr(e,cn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ne(345));case 2:ic(e,qr,Ls);break;case 3:if(Ha(e,r),(r&130023424)===r&&(t=r4+500-cn(),10<t)){if(Iv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Nr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=jC(ic.bind(null,e,qr,Ls),t);break}ic(e,qr,Ls);break;case 4:if(Ha(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Ao(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=cn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gX(r/1960))-r,10<r){e.timeoutHandle=jC(ic.bind(null,e,qr,Ls),r);break}ic(e,qr,Ls);break;case 5:ic(e,qr,Ls);break;default:throw Error(ne(329))}}}return Jr(e,cn()),e.callbackNode===n?O$.bind(null,e):null}function a5(e,t){var n=cp;return e.current.memoizedState.isDehydrated&&(kc(e,t).flags|=256),e=Kv(e,t),e!==2&&(t=qr,qr=n,t!==null&&l5(t)),e}function l5(e){qr===null?qr=e:qr.push.apply(qr,e)}function mX(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(!$o(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 Ha(e,t){for(t&=~n4,t&=~Fb,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ao(t),r=1<<n;e[n]=-1,t&=~r}}function CP(e){if(it&6)throw Error(ne(327));Ad();var t=Iv(e,0);if(!(t&1))return Jr(e,cn()),null;var n=Kv(e,t);if(e.tag!==0&&n===2){var r=OC(e);r!==0&&(t=r,n=a5(e,r))}if(n===1)throw n=Kp,kc(e,0),Ha(e,t),Jr(e,cn()),n;if(n===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ic(e,qr,Ls),Jr(e,cn()),null}function i4(e,t){var n=it;it|=1;try{return e(t)}finally{it=n,it===0&&(rf=cn()+500,Rb&&$l())}}function Wc(e){Ja!==null&&Ja.tag===0&&!(it&6)&&Ad();var t=it;it|=1;var n=Qi.transition,r=mt;try{if(Qi.transition=null,mt=1,e)return e()}finally{mt=r,Qi.transition=n,it=t,!(it&6)&&$l()}}function o4(){fi=sd.current,Ft(sd)}function kc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,WK(n)),yn!==null)for(n=yn.return;n!==null;){var r=n;switch(BE(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nv();break;case 3:tf(),Ft(Yr),Ft(vr),KE();break;case 5:qE(r);break;case 4:tf();break;case 13:Ft(Ht);break;case 19:Ft(Ht);break;case 10:UE(r.type._context);break;case 22:case 23:o4()}n=n.return}if(Ln=e,yn=e=cl(e.current,null),rr=fi=t,En=0,Kp=null,n4=Fb=Hc=0,qr=cp=null,bc!==null){for(t=0;t<bc.length;t++)if(n=bc[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}bc=null}return e}function $$(e,t){do{var n=yn;try{if(VE(),jy.current=Gv,Uv){for(var r=qt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Uv=!1}if(Gc=0,Nn=xn=qt=null,ap=!1,Hp=0,t4.current=null,n===null||n.return===null){En=1,Kp=t,yn=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=rr,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=dP(s);if(h!==null){h.flags&=-257,fP(h,s,a,o,t),h.mode&1&&uP(o,c,t),t=h,l=c;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){uP(o,c,t),s4();break e}l=Error(ne(426))}}else if(zt&&a.mode&1){var _=dP(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),fP(_,s,a,o,t),zE(nf(l,a));break e}}o=l=nf(l,a),En!==4&&(En=2),cp===null?cp=[o]:cp.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=y$(o,l,t);rP(o,v);break e;case 1:a=l;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(al===null||!al.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var b=v$(o,a,t);rP(o,b);break e}}o=o.return}while(o!==null)}D$(n)}catch(S){t=S,yn===n&&n!==null&&(yn=n=n.return);continue}break}while(1)}function N$(){var e=Hv.current;return Hv.current=Gv,e===null?Gv:e}function s4(){(En===0||En===3||En===2)&&(En=4),Ln===null||!(Hc&268435455)&&!(Fb&268435455)||Ha(Ln,rr)}function Kv(e,t){var n=it;it|=2;var r=N$();(Ln!==e||rr!==t)&&(Ls=null,kc(e,t));do try{yX();break}catch(i){$$(e,i)}while(1);if(VE(),it=n,Hv.current=r,yn!==null)throw Error(ne(261));return Ln=null,rr=0,En}function yX(){for(;yn!==null;)F$(yn)}function vX(){for(;yn!==null&&!Uq();)F$(yn)}function F$(e){var t=B$(e.alternate,e,fi);e.memoizedProps=e.pendingProps,t===null?D$(e):yn=t,t4.current=null}function D$(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dX(n,t),n!==null){n.flags&=32767,yn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{En=6,yn=null;return}}else if(n=uX(n,t,fi),n!==null){yn=n;return}if(t=t.sibling,t!==null){yn=t;return}yn=t=e}while(t!==null);En===0&&(En=5)}function ic(e,t,n){var r=mt,i=Qi.transition;try{Qi.transition=null,mt=1,bX(e,t,n,r)}finally{Qi.transition=i,mt=r}return null}function bX(e,t,n,r){do Ad();while(Ja!==null);if(it&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(Jq(e,o),e===Ln&&(yn=Ln=null,rr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||P0||(P0=!0,z$(Pv,function(){return Ad(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Qi.transition,Qi.transition=null;var s=mt;mt=1;var a=it;it|=4,t4.current=null,hX(e,n),M$(n,e),BK(BC),Mv=!!LC,BC=LC=null,e.current=n,pX(n),Gq(),it=a,mt=s,Qi.transition=o}else e.current=n;if(P0&&(P0=!1,Ja=e,qv=i),o=e.pendingLanes,o===0&&(al=null),qq(n.stateNode),Jr(e,cn()),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(Wv)throw Wv=!1,e=o5,o5=null,e;return qv&1&&e.tag!==0&&Ad(),o=e.pendingLanes,o&1?e===s5?up++:(up=0,s5=e):up=0,$l(),null}function Ad(){if(Ja!==null){var e=m7(qv),t=Qi.transition,n=mt;try{if(Qi.transition=null,mt=16>e?16:e,Ja===null)var r=!1;else{if(e=Ja,Ja=null,qv=0,it&6)throw Error(ne(331));var i=it;for(it|=4,ye=e.current;ye!==null;){var o=ye,s=o.child;if(ye.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ye=c;ye!==null;){var u=ye;switch(u.tag){case 0:case 11:case 15:lp(8,u,o)}var d=u.child;if(d!==null)d.return=u,ye=d;else for(;ye!==null;){u=ye;var f=u.sibling,h=u.return;if(k$(u),u===c){ye=null;break}if(f!==null){f.return=h,ye=f;break}ye=h}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}ye=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,ye=s;else e:for(;ye!==null;){if(o=ye,o.flags&2048)switch(o.tag){case 0:case 11:case 15:lp(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,ye=v;break e}ye=o.return}}var y=e.current;for(ye=y;ye!==null;){s=ye;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,ye=g;else e:for(s=y;ye!==null;){if(a=ye,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Nb(9,a)}}catch(S){Zt(a,a.return,S)}if(a===s){ye=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,ye=b;break e}ye=a.return}}if(it=i,$l(),fs&&typeof fs.onPostCommitFiberRoot=="function")try{fs.onPostCommitFiberRoot(Ab,e)}catch{}r=!0}return r}finally{mt=n,Qi.transition=t}}return!1}function EP(e,t,n){t=nf(n,t),t=y$(e,t,1),e=sl(e,t,1),t=Nr(),e!==null&&(im(e,1,t),Jr(e,t))}function Zt(e,t,n){if(e.tag===3)EP(e,e,n);else for(;t!==null;){if(t.tag===3){EP(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(al===null||!al.has(r))){e=nf(n,e),e=v$(t,e,1),t=sl(t,e,1),e=Nr(),t!==null&&(im(t,1,e),Jr(t,e));break}}t=t.return}}function _X(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Nr(),e.pingedLanes|=e.suspendedLanes&n,Ln===e&&(rr&n)===n&&(En===4||En===3&&(rr&130023424)===rr&&500>cn()-r4?kc(e,0):n4|=n),Jr(e,t)}function L$(e,t){t===0&&(e.mode&1?(t=b0,b0<<=1,!(b0&130023424)&&(b0=4194304)):t=1);var n=Nr();e=la(e,t),e!==null&&(im(e,t,n),Jr(e,n))}function SX(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),L$(e,n)}function xX(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),L$(e,n)}var B$;B$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yr.current)Xr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xr=!1,cX(e,t,n);Xr=!!(e.flags&131072)}else Xr=!1,zt&&t.flags&1048576&&V7(t,Lv,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Uy(e,t),e=t.pendingProps;var i=Zd(t,vr.current);Td(t,n),i=QE(null,t,r,e,i,n);var o=YE();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,Zr(r)?(o=!0,Fv(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,HE(t),i.updater=Ob,t.stateNode=i,i._reactInternals=t,KC(t,r,e,n),t=YC(null,t,r,!0,o,n)):(t.tag=0,zt&&o&&LE(t),Rr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Uy(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=CX(r),e=yo(r,e),i){case 0:t=QC(null,t,r,e,n);break e;case 1:t=gP(null,t,r,e,n);break e;case 11:t=hP(null,t,r,e,n);break e;case 14:t=pP(null,t,r,yo(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:yo(r,i),QC(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yo(r,i),gP(e,t,r,i,n);case 3:e:{if(x$(t),e===null)throw Error(ne(387));r=t.pendingProps,o=t.memoizedState,i=o.element,W7(e,t),jv(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=nf(Error(ne(423)),t),t=mP(e,t,r,n,i);break e}else if(r!==i){i=nf(Error(ne(424)),t),t=mP(e,t,r,n,i);break e}else for(vi=ol(t.stateNode.containerInfo.firstChild),_i=t,zt=!0,So=null,n=Q7(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jd(),r===i){t=ca(e,t,n);break e}Rr(e,t,r,n)}t=t.child}return t;case 5:return Y7(t),e===null&&HC(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,zC(r,i)?s=null:o!==null&&zC(r,o)&&(t.flags|=32),S$(e,t),Rr(e,t,s,n),t.child;case 6:return e===null&&HC(t),null;case 13:return w$(e,t,n);case 4:return WE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ef(t,null,r,n):Rr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yo(r,i),hP(e,t,r,i,n);case 7:return Rr(e,t,t.pendingProps,n),t.child;case 8:return Rr(e,t,t.pendingProps.children,n),t.child;case 12:return Rr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,kt(Bv,r._currentValue),r._currentValue=s,o!==null)if($o(o.value,s)){if(o.children===i.children&&!Yr.current){t=ca(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Js(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),WC(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ne(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),WC(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Rr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Td(t,n),i=Yi(i),r=r(i),t.flags|=1,Rr(e,t,r,n),t.child;case 14:return r=t.type,i=yo(r,t.pendingProps),i=yo(r.type,i),pP(e,t,r,i,n);case 15:return b$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yo(r,i),Uy(e,t),t.tag=1,Zr(r)?(e=!0,Fv(t)):e=!1,Td(t,n),K7(t,r,i),KC(t,r,i,n),YC(null,t,r,!0,e,n);case 19:return C$(e,t,n);case 22:return _$(e,t,n)}throw Error(ne(156,t.tag))};function z$(e,t){return f7(e,t)}function wX(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 Ki(e,t,n,r){return new wX(e,t,n,r)}function a4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function CX(e){if(typeof e=="function")return a4(e)?1:0;if(e!=null){if(e=e.$$typeof,e===TE)return 11;if(e===AE)return 14}return 2}function cl(e,t){var n=e.alternate;return n===null?(n=Ki(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 Wy(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")a4(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qu:return Pc(n.children,i,o,t);case EE:s=8,i|=8;break;case vC:return e=Ki(12,n,t,i|2),e.elementType=vC,e.lanes=o,e;case bC:return e=Ki(13,n,t,i),e.elementType=bC,e.lanes=o,e;case _C:return e=Ki(19,n,t,i),e.elementType=_C,e.lanes=o,e;case XO:return Db(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qO:s=10;break e;case KO:s=9;break e;case TE:s=11;break e;case AE:s=14;break e;case La:s=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Ki(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Pc(e,t,n,r){return e=Ki(7,e,r,t),e.lanes=n,e}function Db(e,t,n,r){return e=Ki(22,e,r,t),e.elementType=XO,e.lanes=n,e.stateNode={isHidden:!1},e}function Mx(e,t,n){return e=Ki(6,e,null,t),e.lanes=n,e}function Rx(e,t,n){return t=Ki(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function EX(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=fx(0),this.expirationTimes=fx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fx(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function l4(e,t,n,r,i,o,s,a,l){return e=new EX(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ki(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},HE(o),e}function TX(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xu,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function j$(e){if(!e)return yl;e=e._reactInternals;e:{if(au(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(Zr(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(Zr(n))return z7(e,n,t)}return t}function V$(e,t,n,r,i,o,s,a,l){return e=l4(n,r,!0,e,i,o,s,a,l),e.context=j$(null),n=e.current,r=Nr(),i=ll(n),o=Js(r,i),o.callback=t??null,sl(n,o,i),e.current.lanes=i,im(e,i,r),Jr(e,r),e}function Lb(e,t,n,r){var i=t.current,o=Nr(),s=ll(i);return n=j$(n),t.context===null?t.context=n:t.pendingContext=n,t=Js(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=sl(i,t,s),e!==null&&(ko(e,i,s,o),zy(e,i,s)),s}function Xv(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 TP(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function c4(e,t){TP(e,t),(e=e.alternate)&&TP(e,t)}function AX(){return null}var U$=typeof reportError=="function"?reportError:function(e){console.error(e)};function u4(e){this._internalRoot=e}Bb.prototype.render=u4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));Lb(e,t,null,null)};Bb.prototype.unmount=u4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wc(function(){Lb(null,e,null,null)}),t[aa]=null}};function Bb(e){this._internalRoot=e}Bb.prototype.unstable_scheduleHydration=function(e){if(e){var t=b7();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ga.length&&t!==0&&t<Ga[n].priority;n++);Ga.splice(n,0,e),n===0&&S7(e)}};function d4(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function AP(){}function kX(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=Xv(s);o.call(c)}}var s=V$(t,r,e,0,null,!1,!1,"",AP);return e._reactRootContainer=s,e[aa]=s.current,zp(e.nodeType===8?e.parentNode:e),Wc(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Xv(l);a.call(c)}}var l=l4(e,0,!1,null,null,!1,!1,"",AP);return e._reactRootContainer=l,e[aa]=l.current,zp(e.nodeType===8?e.parentNode:e),Wc(function(){Lb(t,l,n,r)}),l}function jb(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=Xv(s);a.call(l)}}Lb(t,s,e,i)}else s=kX(n,t,e,i,r);return Xv(s)}y7=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Bh(t.pendingLanes);n!==0&&(IE(t,n|1),Jr(t,cn()),!(it&6)&&(rf=cn()+500,$l()))}break;case 13:Wc(function(){var r=la(e,1);if(r!==null){var i=Nr();ko(r,e,1,i)}}),c4(e,1)}};ME=function(e){if(e.tag===13){var t=la(e,134217728);if(t!==null){var n=Nr();ko(t,e,134217728,n)}c4(e,134217728)}};v7=function(e){if(e.tag===13){var t=ll(e),n=la(e,t);if(n!==null){var r=Nr();ko(n,e,t,r)}c4(e,t)}};b7=function(){return mt};_7=function(e,t){var n=mt;try{return mt=e,t()}finally{mt=n}};IC=function(e,t,n){switch(t){case"input":if(wC(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=Mb(r);if(!i)throw Error(ne(90));YO(r),wC(r,i)}}}break;case"textarea":JO(e,n);break;case"select":t=n.value,t!=null&&xd(e,!!n.multiple,t,!1)}};s7=i4;a7=Wc;var PX={usingClientEntryPoint:!1,Events:[sm,ed,Mb,i7,o7,i4]},ch={findFiberByHostInstance:vc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},IX={bundleType:ch.bundleType,version:ch.version,rendererPackageName:ch.rendererPackageName,rendererConfig:ch.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ga.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=u7(e),e===null?null:e.stateNode},findFiberByHostInstance:ch.findFiberByHostInstance||AX,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 I0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!I0.isDisabled&&I0.supportsFiber)try{Ab=I0.inject(IX),fs=I0}catch{}}ki.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PX;ki.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d4(t))throw Error(ne(200));return TX(e,t,null,n)};ki.createRoot=function(e,t){if(!d4(e))throw Error(ne(299));var n=!1,r="",i=U$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=l4(e,1,!1,null,null,n,!1,r,i),e[aa]=t.current,zp(e.nodeType===8?e.parentNode:e),new u4(t)};ki.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=u7(t),e=e===null?null:e.stateNode,e};ki.flushSync=function(e){return Wc(e)};ki.hydrate=function(e,t,n){if(!zb(t))throw Error(ne(200));return jb(null,e,t,!0,n)};ki.hydrateRoot=function(e,t,n){if(!d4(e))throw Error(ne(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=U$;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=V$(t,null,e,1,n??null,i,!1,o,s),e[aa]=t.current,zp(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 Bb(t)};ki.render=function(e,t,n){if(!zb(t))throw Error(ne(200));return jb(null,e,t,!1,n)};ki.unmountComponentAtNode=function(e){if(!zb(e))throw Error(ne(40));return e._reactRootContainer?(Wc(function(){jb(null,null,e,!1,function(){e._reactRootContainer=null,e[aa]=null})}),!0):!1};ki.unstable_batchedUpdates=i4;ki.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zb(n))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return jb(e,t,n,!1,r)};ki.version="18.2.0-next-9e3b772b8-20220608";function G$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(G$)}catch(e){console.error(e)}}G$(),VO.exports=ki;var gi=VO.exports;const pze=Ml(gi);var kP=gi;mC.createRoot=kP.createRoot,mC.hydrateRoot=kP.hydrateRoot;const MX="modulepreload",RX=function(e,t){return new URL(e,t).href},PP={},H$=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=RX(o,r),o in PP)return;PP[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let u=i.length-1;u>=0;u--){const d=i[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":MX,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};let Ar=[],to=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let s=n.indexOf(i);~s&&(n.splice(s,2),--r.lc||r.off())}},notify(i){let o=!Ar.length;for(let s=0;s<n.length;s+=2)Ar.push(n[s],n[s+1],r.value,i);if(o){for(let s=0;s<Ar.length;s+=4){let a;for(let l=s+1;!a&&(l+=4)<Ar.length;)Ar[l]<Ar[s+1]&&(a=Ar.push(Ar[s],Ar[s+1],Ar[s+2],Ar[s+3]));a||Ar[s](Ar[s+2],Ar[s+3])}Ar.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let s=r.listen(i,o);return i(r.value),s},value:e};return r};function OX(e,t,n){let r=new Set([...t,void 0]);return e.listen((i,o)=>{r.has(o)&&n(i,o)})}let $X=(e={})=>{let t=to(e);return t.setKey=function(n,r){typeof r>"u"?n in t.value&&(t.value={...t.value},delete t.value[n],t.notify(n)):t.value[n]!==r&&(t.value={...t.value,[n]:r},t.notify(n))},t};function Ox(e,t={}){let n=I.useCallback(i=>t.keys?OX(e,t.keys,i):e.listen(i),[t.keys,e]),r=e.get.bind(e);return I.useSyncExternalStore(n,r,r)}const Qv=to(),Yv=to(),Zv=to(!1);var W$={exports:{}},q$={};/**
* @license React
* use-sync-external-store-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 lm=I;function NX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var FX=typeof Object.is=="function"?Object.is:NX,DX=lm.useSyncExternalStore,LX=lm.useRef,BX=lm.useEffect,zX=lm.useMemo,jX=lm.useDebugValue;q$.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=LX(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=zX(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return d=p}return d=h}if(p=d,FX(u,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(u=h,d=m)}var c=!1,u,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 a=DX(e,o[0],o[1]);return BX(function(){s.hasValue=!0,s.value=a},[a]),jX(a),a};W$.exports=q$;var VX=W$.exports;function UX(e){e()}var K$=UX,GX=e=>K$=e,HX=()=>K$,bi="default"in Ev?Q:Ev,IP=Symbol.for("react-redux-context"),MP=typeof globalThis<"u"?globalThis:{};function WX(){if(!bi.createContext)return{};const e=MP[IP]??(MP[IP]=new Map);let t=e.get(bi.createContext);return t||(t=bi.createContext(null),e.set(bi.createContext,t)),t}var vl=WX(),qX=()=>{throw new Error("uSES not initialized!")};function f4(e=vl){return function(){return bi.useContext(e)}}var X$=f4(),Q$=qX,KX=e=>{Q$=e},XX=(e,t)=>e===t;function QX(e=vl){const t=e===vl?X$:f4(e);return function(r,i={}){const{equalityFn:o=XX,devModeChecks:s={}}=typeof i=="function"?{equalityFn:i}:i,{store:a,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:d}=t();bi.useRef(!0);const f=bi.useCallback({[r.name](p){return r(p)}}[r.name],[r,u,s.stabilityCheck]),h=Q$(l.addNestedSub,a.getState,c||a.getState,f,o);return bi.useDebugValue(h),h}}var Y$=QX();function YX(){const e=HX();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)}}}}var RP={notify(){},get:()=>[]};function ZX(e,t){let n,r=RP,i=0,o=!1;function s(m){u();const _=r.subscribe(m);let v=!1;return()=>{v||(v=!0,_(),d())}}function a(){r.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return o}function u(){i++,n||(n=t?t.addNestedSub(l):e.subscribe(l),r=YX())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=RP)}function f(){o||(o=!0,u())}function h(){o&&(o=!1,d())}const p={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:f,tryUnsubscribe:h,getListeners:()=>r};return p}var JX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eQ=JX?bi.useLayoutEffect:bi.useEffect;function OP(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Jv(e,t){if(OP(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])||!OP(e[n[i]],t[n[i]]))return!1;return!0}function tQ({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",identityFunctionCheck:o="once"}){const s=bi.useMemo(()=>{const c=ZX(e);return{store:e,subscription:c,getServerState:r?()=>r:void 0,stabilityCheck:i,identityFunctionCheck:o}},[e,r,i,o]),a=bi.useMemo(()=>e.getState(),[e]);eQ(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==e.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,a]);const l=t||vl;return bi.createElement(l.Provider,{value:s},n)}var nQ=tQ;function Z$(e=vl){const t=e===vl?X$:f4(e);return function(){const{store:r}=t();return r}}var J$=Z$();function rQ(e=vl){const t=e===vl?J$:Z$(e);return function(){return t().dispatch}}var eN=rQ();KX(VX.useSyncExternalStoreWithSelector);GX(gi.unstable_batchedUpdates);var iQ=gi.unstable_batchedUpdates;const tN=()=>eN(),nN=Y$,rN="default",In=to(rN);function Yn(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 oQ=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),$P=oQ,$x=()=>Math.random().toString(36).substring(7).split("").join("."),sQ={INIT:`@@redux/INIT${$x()}`,REPLACE:`@@redux/REPLACE${$x()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$x()}`},e1=sQ;function _s(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function iN(e,t,n){if(typeof e!="function")throw new Error(Yn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yn(1));return n(iN)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach((_,v)=>{s.set(v,_)}))}function u(){if(l)throw new Error(Yn(3));return i}function d(_){if(typeof _!="function")throw new Error(Yn(4));if(l)throw new Error(Yn(5));let v=!0;c();const y=a++;return s.set(y,_),function(){if(v){if(l)throw new Error(Yn(6));v=!1,c(),s.delete(y),o=null}}}function f(_){if(!_s(_))throw new Error(Yn(7));if(typeof _.type>"u")throw new Error(Yn(8));if(typeof _.type!="string")throw new Error(Yn(17));if(l)throw new Error(Yn(9));try{l=!0,i=r(i,_)}finally{l=!1}return(o=s).forEach(y=>{y()}),_}function h(_){if(typeof _!="function")throw new Error(Yn(10));r=_,f({type:e1.REPLACE})}function p(){const _=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Yn(11));function y(){const b=v;b.next&&b.next(u())}return y(),{unsubscribe:_(y)}},[$P](){return this}}}return f({type:e1.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[$P]:p}}function aQ(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:e1.INIT})>"u")throw new Error(Yn(12));if(typeof n(void 0,{type:e1.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yn(13))})}function Vb(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{aQ(n)}catch(o){i=o}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const d=r[u],f=n[d],h=s[d],p=f(h,a);if(typeof p>"u")throw a&&a.type,new Error(Yn(14));c[d]=p,l=l||p!==h}return l=l||r.length!==Object.keys(s).length,l?c:s}}function t1(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function lQ(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(Yn(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=t1(...a)(i.dispatch),{...i,dispatch:o}}}function Ub(e){return _s(e)&&"type"in e&&typeof e.type=="string"}var h4=Symbol.for("immer-nothing"),dp=Symbol.for("immer-draftable"),ei=Symbol.for("immer-state");function tr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var qc=Object.getPrototypeOf;function Ji(e){return!!e&&!!e[ei]}function No(e){var t;return e?oN(e)||Array.isArray(e)||!!e[dp]||!!((t=e.constructor)!=null&&t[dp])||cm(e)||um(e):!1}var cQ=Object.prototype.constructor.toString();function oN(e){if(!e||typeof e!="object")return!1;const t=qc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===cQ}function uQ(e){return Ji(e)||tr(15,e),e[ei].base_}function of(e,t){Kc(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kc(e){const t=e[ei];return t?t.type_:Array.isArray(e)?1:cm(e)?2:um(e)?3:0}function Xp(e,t){return Kc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nx(e,t){return Kc(e)===2?e.get(t):e[t]}function sN(e,t,n){const r=Kc(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function dQ(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cm(e){return e instanceof Map}function um(e){return e instanceof Set}function oc(e){return e.copy_||e.base_}function c5(e,t){if(cm(e))return new Map(e);if(um(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&oN(e))return qc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ei];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(qc(e),n)}function p4(e,t=!1){return Gb(e)||Ji(e)||!No(e)||(Kc(e)>1&&(e.set=e.add=e.clear=e.delete=fQ),Object.freeze(e),t&&of(e,(n,r)=>p4(r,!0))),e}function fQ(){tr(2)}function Gb(e){return Object.isFrozen(e)}var u5={};function Xc(e){const t=u5[e];return t||tr(0,e),t}function hQ(e,t){u5[e]||(u5[e]=t)}var Qp;function aN(){return Qp}function pQ(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function NP(e,t){t&&(Xc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function d5(e){f5(e),e.drafts_.forEach(gQ),e.drafts_=null}function f5(e){e===Qp&&(Qp=e.parent_)}function FP(e){return Qp=pQ(Qp,e)}function gQ(e){const t=e[ei];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function DP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ei].modified_&&(d5(t),tr(4)),No(e)&&(e=n1(t,e),t.parent_||r1(t,e)),t.patches_&&Xc("Patches").generateReplacementPatches_(n[ei].base_,e,t.patches_,t.inversePatches_)):e=n1(t,n,[]),d5(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==h4?e:void 0}function n1(e,t,n){if(Gb(t))return t;const r=t[ei];if(!r)return of(t,(i,o)=>LP(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return r1(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),of(o,(a,l)=>LP(e,r,i,a,l,n,s)),r1(e,i,!1),n&&e.patches_&&Xc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function LP(e,t,n,r,i,o,s){if(Ji(i)){const a=o&&t&&t.type_!==3&&!Xp(t.assigned_,r)?o.concat(r):void 0,l=n1(e,i,a);if(sN(n,r,l),Ji(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(No(i)&&!Gb(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;n1(e,i),(!t||!t.scope_.parent_)&&r1(e,i)}}function r1(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&p4(t,n)}function mQ(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:aN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=g4;n&&(i=[r],o=Yp);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var g4={get(e,t){if(t===ei)return e;const n=oc(e);if(!Xp(n,t))return yQ(e,n,t);const r=n[t];return e.finalized_||!No(r)?r:r===Fx(e.base_,t)?(Dx(e),e.copy_[t]=p5(r,e)):r},has(e,t){return t in oc(e)},ownKeys(e){return Reflect.ownKeys(oc(e))},set(e,t,n){const r=lN(oc(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Fx(oc(e),t),o=i==null?void 0:i[ei];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(dQ(n,i)&&(n!==void 0||Xp(e.base_,t)))return!0;Dx(e),h5(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Fx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Dx(e),h5(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=oc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){tr(11)},getPrototypeOf(e){return qc(e.base_)},setPrototypeOf(){tr(12)}},Yp={};of(g4,(e,t)=>{Yp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Yp.deleteProperty=function(e,t){return Yp.set.call(this,e,t,void 0)};Yp.set=function(e,t,n){return g4.set.call(this,e[0],t,n,e[0])};function Fx(e,t){const n=e[ei];return(n?oc(n):e)[t]}function yQ(e,t,n){var i;const r=lN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function lN(e,t){if(!(t in e))return;let n=qc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=qc(n)}}function h5(e){e.modified_||(e.modified_=!0,e.parent_&&h5(e.parent_))}function Dx(e){e.copy_||(e.copy_=c5(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vQ=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&tr(6),r!==void 0&&typeof r!="function"&&tr(7);let i;if(No(t)){const o=FP(this),s=p5(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?d5(o):f5(o)}return NP(o,r),DP(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===h4&&(i=void 0),this.autoFreeze_&&p4(i,!0),r){const o=[],s=[];Xc("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else tr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){No(e)||tr(8),Ji(e)&&(e=cN(e));const t=FP(this),n=p5(e,void 0);return n[ei].isManual_=!0,f5(t),n}finishDraft(e,t){const n=e&&e[ei];(!n||!n.isManual_)&&tr(9);const{scope_:r}=n;return NP(r,t),DP(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Xc("Patches").applyPatches_;return Ji(e)?r(e,t):this.produce(e,i=>r(i,t))}};function p5(e,t){const n=cm(e)?Xc("MapSet").proxyMap_(e,t):um(e)?Xc("MapSet").proxySet_(e,t):mQ(e,t);return(t?t.scope_:aN()).drafts_.push(n),n}function cN(e){return Ji(e)||tr(10,e),uN(e)}function uN(e){if(!No(e)||Gb(e))return e;const t=e[ei];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=c5(e,t.scope_.immer_.useStrictShallowCopy_)}else n=c5(e,!0);return of(n,(r,i)=>{sN(n,r,uN(i))}),t&&(t.finalized_=!1),n}function bQ(){const t="replace",n="add",r="remove";function i(f,h,p,m){switch(f.type_){case 0:case 2:return s(f,h,p,m);case 1:return o(f,h,p,m);case 3:return a(f,h,p,m)}}function o(f,h,p,m){let{base_:_,assigned_:v}=f,y=f.copy_;y.length<_.length&&([_,y]=[y,_],[p,m]=[m,p]);for(let g=0;g<_.length;g++)if(v[g]&&y[g]!==_[g]){const b=h.concat([g]);p.push({op:t,path:b,value:d(y[g])}),m.push({op:t,path:b,value:d(_[g])})}for(let g=_.length;g<y.length;g++){const b=h.concat([g]);p.push({op:n,path:b,value:d(y[g])})}for(let g=y.length-1;_.length<=g;--g){const b=h.concat([g]);m.push({op:r,path:b})}}function s(f,h,p,m){const{base_:_,copy_:v}=f;of(f.assigned_,(y,g)=>{const b=Nx(_,y),S=Nx(v,y),w=g?Xp(_,y)?t:n:r;if(b===S&&w===t)return;const C=h.concat(y);p.push(w===r?{op:w,path:C}:{op:w,path:C,value:S}),m.push(w===n?{op:r,path:C}:w===r?{op:n,path:C,value:d(b)}:{op:t,path:C,value:d(b)})})}function a(f,h,p,m){let{base_:_,copy_:v}=f,y=0;_.forEach(g=>{if(!v.has(g)){const b=h.concat([y]);p.push({op:r,path:b,value:g}),m.unshift({op:n,path:b,value:g})}y++}),y=0,v.forEach(g=>{if(!_.has(g)){const b=h.concat([y]);p.push({op:n,path:b,value:g}),m.unshift({op:r,path:b,value:g})}y++})}function l(f,h,p,m){p.push({op:t,path:[],value:h===h4?void 0:h}),m.push({op:t,path:[],value:f})}function c(f,h){return h.forEach(p=>{const{path:m,op:_}=p;let v=f;for(let S=0;S<m.length-1;S++){const w=Kc(v);let C=m[S];typeof C!="string"&&typeof C!="number"&&(C=""+C),(w===0||w===1)&&(C==="__proto__"||C==="constructor")&&tr(16+3),typeof v=="function"&&C==="prototype"&&tr(16+3),v=Nx(v,C),typeof v!="object"&&tr(16+2,m.join("/"))}const y=Kc(v),g=u(p.value),b=m[m.length-1];switch(_){case t:switch(y){case 2:return v.set(b,g);case 3:tr(16);default:return v[b]=g}case n:switch(y){case 1:return b==="-"?v.push(g):v.splice(b,0,g);case 2:return v.set(b,g);case 3:return v.add(g);default:return v[b]=g}case r:switch(y){case 1:return v.splice(b,1);case 2:return v.delete(b);case 3:return v.delete(p.value);default:return delete v[b]}default:tr(16+1,_)}}),f}function u(f){if(!No(f))return f;if(Array.isArray(f))return f.map(u);if(cm(f))return new Map(Array.from(f.entries()).map(([p,m])=>[p,u(m)]));if(um(f))return new Set(Array.from(f).map(u));const h=Object.create(qc(f));for(const p in f)h[p]=u(f[p]);return Xp(f,dp)&&(h[dp]=f[dp]),h}function d(f){return Ji(f)?u(f):f}hQ("Patches",{applyPatches_:c,generatePatches_:i,generateReplacementPatches_:l})}var Ci=new vQ,Pf=Ci.produce,dN=Ci.produceWithPatches.bind(Ci);Ci.setAutoFreeze.bind(Ci);Ci.setUseStrictShallowCopy.bind(Ci);var BP=Ci.applyPatches.bind(Ci);Ci.createDraft.bind(Ci);Ci.finishDraft.bind(Ci);var i1="NOT_FOUND";function _Q(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function SQ(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var zP=e=>Array.isArray(e)?e:[e];function xQ(e){const t=Array.isArray(e[0])?e[0]:e;return SQ(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function wQ(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function CQ(e){let t;return{get(n){return t&&e(t.key,n)?t.value:i1},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function EQ(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return i1}function i(a,l){r(a)===i1&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var TQ=(e,t)=>e===t;function AQ(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function kQ(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=TQ,maxSize:i=1,resultEqualityCheck:o}=n,s=AQ(r);let a=0;const l=i===1?CQ(s):EQ(i,s);function c(){let u=l.get(arguments);if(u===i1){if(u=e.apply(null,arguments),a++,o){const f=l.getEntries().find(h=>o(h.value,u));f&&(u=f.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var PQ=class{constructor(e){this.value=e}deref(){return this.value}},IQ=typeof WeakRef<"u"?WeakRef:PQ,MQ=0,jP=1;function M0(){return{s:MQ,v:void 0,o:null,p:null}}function Zp(e,t={}){let n=M0();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const h=arguments[d];if(typeof h=="function"||typeof h=="object"&&h!==null){let p=a.o;p===null&&(a.o=p=new WeakMap);const m=p.get(h);m===void 0?(a=M0(),p.set(h,a)):a=m}else{let p=a.p;p===null&&(a.p=p=new Map);const m=p.get(h);m===void 0?(a=M0(),p.set(h,a)):a=m}}const c=a;let u;if(a.s===jP?u=a.v:(u=e.apply(null,arguments),o++),c.s=jP,r){const d=(i==null?void 0:i.deref())??i;d!=null&&r(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new IQ(u):u}return c.v=u,u}return s.clearCache=()=>{n=M0(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function m4(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e;return(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),_Q(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:h=Zp,argsMemoizeOptions:p=[],devModeChecks:m={}}=u,_=zP(f),v=zP(p),y=xQ(i),g=d(function(){return o++,c.apply(null,arguments)},..._),b=h(function(){s++;const w=wQ(y,arguments);return a=g.apply(null,w),a},...v);return Object.assign(b,{resultFunc:c,memoizedResultFunc:g,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:d,argsMemoize:h})}}var fp=m4(Zp);function fN(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var RQ=fN(),OQ=fN,$Q=(...e)=>{const t=m4(...e);return(...n)=>{const r=t(...n),i=(o,...s)=>r(Ji(o)?cN(o):o,...s);return Object.assign(i,r),i}},NQ=$Q(Zp),FQ=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?t1:t1.apply(null,arguments)},DQ=e=>e&&typeof e.match=="function";function he(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(yr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Ub(r)&&r.type===e,n}function LQ(e){return Ub(e)&&Object.keys(e).every(BQ)}function BQ(e){return["type","payload","error","meta"].indexOf(e)>-1}function VP(e,t){for(const n of e)if(t(n))return n}var hN=class jh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,jh.prototype)}static get[Symbol.species](){return jh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new jh(...t[0].concat(this)):new jh(...t.concat(this))}};function UP(e){return No(e)?Pf(e,()=>{}):e}function GP(e,t,n){if(e.has(t)){let i=e.get(t);return n.update&&(i=n.update(i,t,e),e.set(t,i)),i}if(!n.insert)throw new Error(yr(10));const r=n.insert(t,e);return e.set(t,r),r}function zQ(e){return typeof e=="boolean"}var jQ=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new hN;return n&&(zQ(n)?s.push(RQ):s.push(OQ(n.extraArgument))),s},ad="RTK_autoBatch",uh=()=>e=>({payload:e,meta:{[ad]:!0}}),pN=e=>t=>{setTimeout(t,e)},VQ=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:pN(10),gN=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,s=!1;const a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?VQ:e.type==="callback"?e.queueNotification:pN(e.timeout),c=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>i&&u(),f=r.subscribe(d);return a.add(u),()=>{f(),a.delete(u)}},dispatch(u){var d;try{return i=!((d=u==null?void 0:u.meta)!=null&&d[ad]),o=!i,o&&(s||(s=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},UQ=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new hN(e);return r&&i.push(gN(typeof r=="object"?r:void 0)),i},GQ=!0;function HQ(e){const t=jQ(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(_s(n))a=Vb(n);else throw new Error(yr(1));let l;typeof r=="function"?l=r(t):l=t();let c=t1;i&&(c=FQ({trace:!GQ,...typeof i=="object"&&i}));const u=lQ(...l),d=UQ(u);let f=typeof s=="function"?s(d):d();const h=c(...f);return iN(a,o,h)}function mN(e){const t={},n=[];let r;const i={addCase(o,s){const a=typeof o=="string"?o:o.type;if(!a)throw new Error(yr(28));if(a in t)throw new Error(yr(29));return t[a]=s,i},addMatcher(o,s){return n.push({matcher:o,reducer:s}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function WQ(e){return typeof e=="function"}function qQ(e,t){let[n,r,i]=mN(t),o;if(WQ(e))o=()=>UP(e());else{const a=UP(e);o=()=>a}function s(a=o(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[i]),c.reduce((u,d)=>{if(d)if(Ji(u)){const h=d(u,l);return h===void 0?u:h}else{if(No(u))return Pf(u,f=>d(f,l));{const f=d(u,l);if(f===void 0){if(u===null)return u;throw new Error(yr(9))}return f}}return u},a)}return s.getInitialState=o,s}var KQ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",y4=(e=21)=>{let t="",n=e;for(;n--;)t+=KQ[Math.random()*64|0];return t},yN=(e,t)=>DQ(e)?e.match(t):e(t);function br(...e){return t=>e.some(n=>yN(n,t))}function hp(...e){return t=>e.every(n=>yN(n,t))}function Hb(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function dm(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function v4(...e){return e.length===0?t=>Hb(t,["pending"]):dm(e)?t=>{const n=e.map(i=>i.pending);return br(...n)(t)}:v4()(e[0])}function sf(...e){return e.length===0?t=>Hb(t,["rejected"]):dm(e)?t=>{const n=e.map(i=>i.rejected);return br(...n)(t)}:sf()(e[0])}function fm(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?n=>hp(sf(...e),t)(n):dm(e)?n=>hp(sf(...e),t)(n):fm()(e[0])}function bl(...e){return e.length===0?t=>Hb(t,["fulfilled"]):dm(e)?t=>{const n=e.map(i=>i.fulfilled);return br(...n)(t)}:bl()(e[0])}function g5(...e){return e.length===0?t=>Hb(t,["pending","fulfilled","rejected"]):dm(e)?t=>{const n=[];for(const i of e)n.push(i.pending,i.rejected,i.fulfilled);return br(...n)(t)}:g5()(e[0])}var XQ=["name","message","stack","code"],Lx=class{constructor(e,t){Kl(this,"_type");this.payload=e,this.meta=t}},HP=class{constructor(e,t){Kl(this,"_type");this.payload=e,this.meta=t}},QQ=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of XQ)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},m5=(()=>{function e(t,n,r){const i=he(t+"/fulfilled",(l,c,u,d)=>({payload:l,meta:{...d||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),o=he(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=he(t+"/rejected",(l,c,u,d,f)=>({payload:d,error:(r&&r.serializeError||QQ)(l||"Rejected"),meta:{...f||{},arg:u,requestId:c,rejectedWithValue:!!d,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"}}));function a(l){return(c,u,d)=>{const f=r!=null&&r.idGenerator?r.idGenerator(l):y4(),h=new AbortController;let p;function m(v){p=v,h.abort()}const _=async function(){var g,b;let v;try{let S=(g=r==null?void 0:r.condition)==null?void 0:g.call(r,l,{getState:u,extra:d});if(ZQ(S)&&(S=await S),S===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const w=new Promise((C,x)=>h.signal.addEventListener("abort",()=>x({name:"AbortError",message:p||"Aborted"})));c(o(f,l,(b=r==null?void 0:r.getPendingMeta)==null?void 0:b.call(r,{requestId:f,arg:l},{getState:u,extra:d}))),v=await Promise.race([w,Promise.resolve(n(l,{dispatch:c,getState:u,extra:d,requestId:f,signal:h.signal,abort:m,rejectWithValue:(C,x)=>new Lx(C,x),fulfillWithValue:(C,x)=>new HP(C,x)})).then(C=>{if(C instanceof Lx)throw C;return C instanceof HP?i(C.payload,f,l,C.meta):i(C,f,l)})])}catch(S){v=S instanceof Lx?s(null,f,l,S.payload,S.meta):s(S,f,l)}return r&&!r.dispatchConditionRejection&&s.match(v)&&v.meta.condition||c(v),v}();return Object.assign(_,{abort:m,requestId:f,arg:l,unwrap(){return _.then(YQ)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:i,settled:br(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function YQ(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function ZQ(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var JQ=Symbol.for("rtk-slice-createasyncthunk");function eY(e,t){return`${e}/${t}`}function tY({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[JQ];return function(i){const{name:o,reducerPath:s=o}=i;if(!o)throw new Error(yr(11));typeof process<"u";const a=(typeof i.reducers=="function"?i.reducers(rY()):i.reducers)||{},l=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(_,v){const y=typeof _=="string"?_:_.type;if(!y)throw new Error(yr(12));if(y in c.sliceCaseReducersByType)throw new Error(yr(13));return c.sliceCaseReducersByType[y]=v,u},addMatcher(_,v){return c.sliceMatchers.push({matcher:_,reducer:v}),u},exposeAction(_,v){return c.actionCreators[_]=v,u},exposeCaseReducer(_,v){return c.sliceCaseReducersByName[_]=v,u}};l.forEach(_=>{const v=a[_],y={reducerName:_,type:eY(o,_),createNotation:typeof i.reducers=="function"};oY(v)?aY(y,v,u,t):iY(y,v,u)});function d(){const[_={},v=[],y=void 0]=typeof i.extraReducers=="function"?mN(i.extraReducers):[i.extraReducers],g={..._,...c.sliceCaseReducersByType};return qQ(i.initialState,b=>{for(let S in g)b.addCase(S,g[S]);for(let S of c.sliceMatchers)b.addMatcher(S.matcher,S.reducer);for(let S of v)b.addMatcher(S.matcher,S.reducer);y&&b.addDefaultCase(y)})}const f=_=>_,h=new WeakMap;let p;const m={name:o,reducerPath:s,reducer(_,v){return p||(p=d()),p(_,v)},actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState(){return p||(p=d()),p.getInitialState()},getSelectors(_=f){const v=GP(h,this,{insert:()=>new WeakMap});return GP(v,_,{insert:()=>{const y={};for(const[g,b]of Object.entries(i.selectors??{}))y[g]=nY(this,b,_,this!==m);return y}})},selectSlice(_){let v=_[this.reducerPath];return typeof v>"u"&&this!==m&&(v=this.getInitialState()),v},get selectors(){return this.getSelectors(this.selectSlice)},injectInto(_,{reducerPath:v,...y}={}){const g=v??this.reducerPath;return _.inject({reducerPath:g,reducer:this.reducer},y),{...this,reducerPath:g}}};return m}}function nY(e,t,n,r){function i(o,...s){let a=n.call(e,o);return typeof a>"u"&&r&&(a=e.getInitialState()),t(a,...s)}return i.unwrapped=t,i}var jt=tY();function rY(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function iY({type:e,reducerName:t,createNotation:n},r,i){let o,s;if("reducer"in r){if(n&&!sY(r))throw new Error(yr(17));o=r.reducer,s=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?he(e,s):he(e))}function oY(e){return e._reducerDefinitionType==="asyncThunk"}function sY(e){return e._reducerDefinitionType==="reducerWithPrepare"}function aY({type:e,reducerName:t},n,r,i){if(!i)throw new Error(yr(18));const{payloadCreator:o,fulfilled:s,pending:a,rejected:l,settled:c,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),a&&r.addCase(d.pending,a),l&&r.addCase(d.rejected,l),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:s||R0,pending:a||R0,rejected:l||R0,settled:c||R0})}function R0(){}function lY(){return{ids:[],entities:{}}}function cY(){function e(t={}){return Object.assign(lY(),t)}return{getInitialState:e}}function uY(){function e(t,n={}){const{createSelector:r=NQ}=n,i=d=>d.ids,o=d=>d.entities,s=r(i,o,(d,f)=>d.map(h=>f[h])),a=(d,f)=>f,l=(d,f)=>d[f],c=r(i,d=>d.length);if(!t)return{selectIds:i,selectEntities:o,selectAll:s,selectTotal:c,selectById:r(o,a,l)};const u=r(t,o);return{selectIds:r(t,i),selectEntities:u,selectAll:r(t,s),selectTotal:r(t,c),selectById:r(u,a,l)}}return{getSelectors:e}}var dY=Ji;function fY(e){const t=ln((n,r)=>e(r));return function(r){return t(r,void 0)}}function ln(e){return function(n,r){function i(s){return LQ(s)}const o=s=>{i(r)?e(r.payload,s):e(r,s)};return dY(n)?(o(n),n):Pf(n,o)}}function ld(e,t){return t(e)}function Ic(e){return Array.isArray(e)||(e=Object.values(e)),e}function vN(e,t,n){e=Ic(e);const r=[],i=[];for(const o of e){const s=ld(o,t);s in n.entities?i.push({id:s,changes:o}):r.push(o)}return[r,i]}function bN(e){function t(p,m){const _=ld(p,e);_ in m.entities||(m.ids.push(_),m.entities[_]=p)}function n(p,m){p=Ic(p);for(const _ of p)t(_,m)}function r(p,m){const _=ld(p,e);_ in m.entities||m.ids.push(_),m.entities[_]=p}function i(p,m){p=Ic(p);for(const _ of p)r(_,m)}function o(p,m){p=Ic(p),m.ids=[],m.entities={},n(p,m)}function s(p,m){return a([p],m)}function a(p,m){let _=!1;p.forEach(v=>{v in m.entities&&(delete m.entities[v],_=!0)}),_&&(m.ids=m.ids.filter(v=>v in m.entities))}function l(p){Object.assign(p,{ids:[],entities:{}})}function c(p,m,_){const v=_.entities[m.id];if(v===void 0)return!1;const y=Object.assign({},v,m.changes),g=ld(y,e),b=g!==m.id;return b&&(p[m.id]=g,delete _.entities[m.id]),_.entities[g]=y,b}function u(p,m){return d([p],m)}function d(p,m){const _={},v={};p.forEach(g=>{g.id in m.entities&&(v[g.id]={id:g.id,changes:{...v[g.id]?v[g.id].changes:null,...g.changes}})}),p=Object.values(v),p.length>0&&p.filter(b=>c(_,b,m)).length>0&&(m.ids=Object.values(m.entities).map(b=>ld(b,e)))}function f(p,m){return h([p],m)}function h(p,m){const[_,v]=vN(p,e,m);d(v,m),n(_,m)}return{removeAll:fY(l),addOne:ln(t),addMany:ln(n),setOne:ln(r),setMany:ln(i),setAll:ln(o),updateOne:ln(u),updateMany:ln(d),upsertOne:ln(f),upsertMany:ln(h),removeOne:ln(s),removeMany:ln(a)}}function hY(e,t){const{removeOne:n,removeMany:r,removeAll:i}=bN(e);function o(v,y){return s([v],y)}function s(v,y){v=Ic(v);const g=v.filter(b=>!(ld(b,e)in y.entities));g.length!==0&&m(g,y)}function a(v,y){return l([v],y)}function l(v,y){v=Ic(v),v.length!==0&&m(v,y)}function c(v,y){v=Ic(v),y.entities={},y.ids=[],s(v,y)}function u(v,y){return d([v],y)}function d(v,y){let g=!1;for(let b of v){const S=y.entities[b.id];if(!S)continue;g=!0,Object.assign(S,b.changes);const w=e(S);b.id!==w&&(delete y.entities[b.id],y.entities[w]=S)}g&&_(y)}function f(v,y){return h([v],y)}function h(v,y){const[g,b]=vN(v,e,y);d(b,y),s(g,y)}function p(v,y){if(v.length!==y.length)return!1;for(let g=0;g<v.length&&g<y.length;g++)if(v[g]!==y[g])return!1;return!0}function m(v,y){v.forEach(g=>{y.entities[e(g)]=g}),_(y)}function _(v){const y=Object.values(v.entities);y.sort(t);const g=y.map(e),{ids:b}=v;p(b,g)||(v.ids=g)}return{removeOne:n,removeMany:r,removeAll:i,addOne:ln(o),updateOne:ln(u),upsertOne:ln(f),setOne:ln(a),setMany:ln(l),setAll:ln(c),addMany:ln(s),updateMany:ln(d),upsertMany:ln(h)}}function jo(e={}){const{selectId:t,sortComparer:n}={sortComparer:!1,selectId:s=>s.id,...e},r=cY(),i=uY(),o=n?hY(t,n):bN(t);return{selectId:t,sortComparer:n,...r,...i,...o}}var b4=(e,t)=>{if(typeof e!="function")throw new Error(yr(32))},y5=()=>{},_N=(e,t=y5)=>(e.catch(t),e),SN=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Mc=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},pY="task",xN="listener",wN="completed",_4="cancelled",gY=`task-${_4}`,mY=`task-${wN}`,v5=`${xN}-${_4}`,yY=`${xN}-${wN}`,Wb=class{constructor(e){Kl(this,"name","TaskAbortError");Kl(this,"message");this.code=e,this.message=`${pY} ${_4} (reason: ${e})`}},Rc=e=>{if(e.aborted){const{reason:t}=e;throw new Wb(t)}};function CN(e,t){let n=y5;return new Promise((r,i)=>{const o=()=>i(new Wb(e.reason));if(e.aborted){o();return}n=SN(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=y5})}var vY=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Wb?"cancelled":"rejected",error:n}}finally{t==null||t()}},o1=e=>t=>_N(CN(e,t).then(n=>(Rc(e),n))),EN=e=>{const t=o1(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:bY}=Object,WP={},qb="listenerMiddleware",_Y=(e,t)=>{const n=r=>SN(e,()=>Mc(r,e.reason));return(r,i)=>{b4(r);const o=new AbortController;n(o);const s=vY(async()=>{Rc(e),Rc(o.signal);const a=await r({pause:o1(o.signal),delay:EN(o.signal),signal:o.signal});return Rc(o.signal),a},()=>Mc(o,mY));return i!=null&&i.autoJoin&&t.push(s),{result:o1(e)(s),cancel(){Mc(o,gY)}}}},SY=(e,t)=>{const n=async(r,i)=>{Rc(t);let o=()=>{};const a=[new Promise((l,c)=>{let u=e({predicate:r,effect:(d,f)=>{f.unsubscribe(),l([d,f.getState(),f.getOriginalState()])}});o=()=>{u(),c()}})];i!=null&&a.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await CN(t,Promise.race(a));return Rc(t),l}finally{o()}};return(r,i)=>_N(n(r,i))},TN=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=he(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(yr(21));return b4(o),{predicate:i,type:t,effect:o}},xY=e=>{const{type:t,predicate:n,effect:r}=TN(e);return{id:y4(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(yr(22))}}},b5=e=>{e.pending.forEach(t=>{Mc(t,v5)})},wY=e=>()=>{e.forEach(b5),e.clear()},qP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},CY=he(`${qb}/add`),EY=he(`${qb}/removeAll`),TY=he(`${qb}/remove`),AY=(...e)=>{console.error(`${qb}/error`,...e)};function kY(e={}){const t=new Map,{extra:n,onError:r=AY}=e;b4(r);const i=u=>(u.unsubscribe=()=>t.delete(u.id),t.set(u.id,u),d=>{u.unsubscribe(),d!=null&&d.cancelActive&&b5(u)}),o=u=>{let d=VP(Array.from(t.values()),f=>f.effect===u.effect);return d||(d=xY(u)),i(d)},s=u=>{const{type:d,effect:f,predicate:h}=TN(u),p=VP(Array.from(t.values()),m=>(typeof d=="string"?m.type===d:m.predicate===h)&&m.effect===f);return p&&(p.unsubscribe(),u.cancelActive&&b5(p)),!!p},a=async(u,d,f,h)=>{const p=new AbortController,m=SY(o,p.signal),_=[];try{u.pending.add(p),await Promise.resolve(u.effect(d,bY({},f,{getOriginalState:h,condition:(v,y)=>m(v,y).then(Boolean),take:m,delay:EN(p.signal),pause:o1(p.signal),extra:n,signal:p.signal,fork:_Y(p.signal,_),unsubscribe:u.unsubscribe,subscribe:()=>{t.set(u.id,u)},cancelActiveListeners:()=>{u.pending.forEach((v,y,g)=>{v!==p&&(Mc(v,v5),g.delete(v))})},cancel:()=>{Mc(p,v5),u.pending.delete(p)},throwIfCancelled:()=>{Rc(p.signal)}})))}catch(v){v instanceof Wb||qP(r,v,{raisedBy:"effect"})}finally{await Promise.allSettled(_),Mc(p,yY),u.pending.delete(p)}},l=wY(t);return{middleware:u=>d=>f=>{if(!Ub(f))return d(f);if(CY.match(f))return o(f.payload);if(EY.match(f)){l();return}if(TY.match(f))return s(f.payload);let h=u.getState();const p=()=>{if(h===WP)throw new Error(yr(23));return h};let m;try{if(m=d(f),t.size>0){let _=u.getState();const v=Array.from(t.values());for(let y of v){let g=!1;try{g=y.predicate(f,_,h)}catch(b){g=!1,qP(r,b,{raisedBy:"predicate"})}g&&a(y,f,u,p)}}}finally{h=WP}return m},startListening:o,stopListening:s,clearListeners:l}}function yr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const PY={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 s1{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||PY,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 s1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new s1(this.logger,t)}}var cs=new s1;class Kb{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(s=>{s(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(s=>{s.apply(s,[t,...r])})}}function dh(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function KP(e){return e==null?"":""+e}function IY(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function S4(e,t,n){function r(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const s=r(o.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function XP(e,t,n){const{obj:r,k:i}=S4(e,t,Object);r[i]=n}function MY(e,t,n,r){const{obj:i,k:o}=S4(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function a1(e,t){const{obj:n,k:r}=S4(e,t);if(n)return n[r]}function RY(e,t,n){const r=a1(e,n);return r!==void 0?r:a1(t,n)}function AN(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]):AN(e[r],t[r],n):e[r]=t[r]);return e}function ku(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var OY={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function $Y(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>OY[t]):e}const NY=[" ",",","?","!",";"];function FY(e,t,n){t=t||"",n=n||"";const r=NY.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}function l1(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let s=2,a=r.slice(o,o+s).join(n),l=i[a];for(;l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}const c=r.slice(o+s).join(n);return c?l1(l,c,n):void 0}i=i[r[o]]}return i}function c1(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class QP extends Kb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a=[t,n];r&&typeof r!="string"&&(a=a.concat(r)),r&&typeof r=="string"&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."));const l=a1(this.data,a);return l||!s||typeof r!="string"?l:l1(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),XP(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Object.prototype.toString.apply(r[o])==="[object Array]")&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=a1(this.data,a)||{};i?AN(l,r,o):l={...l,...r},XP(this.data,a,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var kN={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 YP={};class u1 extends Kb{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IY(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=cs.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!FY(t,r,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const b=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${b}${s}`,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${b}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||s,p=d&&d.exactUsedKey||s,m=Object.prototype.toString.apply(f),_=["[object Number]","[object Function]","[object RegExp]"],v=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(m)<0&&!(typeof v=="string"&&m==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=b,d.usedParams=this.getUsedParamsDetails(n),d):b}if(o){const b=m==="[object Array]",S=b?[]:{},w=b?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:a}),S[C]===x&&(S[C]=f[C])}f=S}}else if(y&&typeof v=="string"&&m==="[object Array]")f=f.join(v),f&&(f=this.extendTranslation(f,t,n,r));else{let b=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",C=u1.hasDefaultValue(n),x=w?this.pluralResolver.getSuffix(c,n.count,n):"",k=n.ordinal&&w?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",A=n[`defaultValue${x}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(f)&&C&&(b=!0,f=A),this.isValidLookup(f)||(S=!0,f=s);const L=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,M=C&&A!==f&&this.options.updateMissing;if(S||b||M){if(this.logger.log(M?"updateKey":"missingKey",c,l,s,M?A:f),o){const F=this.resolve(s,{...n,keySeparator:!1});F&&F.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 E=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let F=0;F<P.length;F++)E.push(P[F]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(n.lng||this.language):E.push(n.lng||this.language);const O=(F,$,D)=>{const N=C&&D!==f?D:L;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,$,N,M,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,l,$,N,M,n),this.emit("missingKey",F,l,$,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach(F=>{this.pluralResolver.getSuffixes(F,n).forEach($=>{O([F],s+$,n[`defaultValue${$}`]||A)})}):O(E,s,A))}f=this.extendTranslation(f,t,n,d,r),S&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(S||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,b?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 s=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 c=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const f=t.match(this.interpolator.nestingRegexp);u=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),c){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;u<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?(s.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):s.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,l=typeof a=="string"?[a]:a;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=kN.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.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!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(_=>{this.isValidLookup(r)||(a=_,!YP[`${m[0]}-${_}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(YP[`${m[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(v=>{if(this.isValidLookup(r))return;s=v;const y=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,u,v,_,n);else{let b;f&&(b=this.pluralResolver.getSuffix(v,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(u+b),n.ordinal&&b.indexOf(w)===0&&y.push(u+b.replace(w,this.options.pluralSeparator)),h&&y.push(u+S)),p){const C=`${u}${this.options.contextSeparator}${n.context}`;y.push(C),f&&(y.push(C+b),n.ordinal&&b.indexOf(w)===0&&y.push(C+b.replace(w,this.options.pluralSeparator)),h&&y.push(C+S))}}let g;for(;g=y.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(v,_,g,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}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 Bx(e){return e.charAt(0).toUpperCase()+e.slice(1)}class ZP{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=cs.create("languageUtils")}getScriptPartFromCode(t){if(t=c1(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=c1(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]=Bx(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]=Bx(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Bx(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let DY=[{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}],LY={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 BY=["v1","v2","v3"],zY=["v4"],JP={zero:0,one:1,two:2,few:3,many:4,other:5};function jY(){const e={};return DY.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:LY[t.fc]}})}),e}class VY{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=cs.create("pluralResolver"),(!this.options.compatibilityJSON||zY.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=jY()}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(c1(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)=>JP[i]-JP[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!BY.includes(this.options.compatibilityJSON)}}function e6(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=RY(e,t,n);return!o&&i&&typeof n=="string"&&(o=l1(e,n,r),o===void 0&&(o=l1(t,n,r))),o}class UY{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=cs.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:$Y,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ku(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ku(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?ku(n.nestingPrefix):n.nestingPrefixEscaped||ku("$t("),this.nestingSuffix=n.nestingSuffix?ku(n.nestingSuffix):n.nestingSuffixEscaped||ku(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(p){return p.replace(/\$/g,"$$$$")}const u=p=>{if(p.indexOf(this.formatSeparator)<0){const y=e6(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const m=p.split(this.formatSeparator),_=m.shift().trim(),v=m.join(this.formatSeparator).trim();return this.format(e6(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),v,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=>c(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?c(this.escape(p)):c(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const m=o[1].trim();if(s=u(m),s===void 0)if(typeof d=="function"){const v=d(t,o,i);s=typeof v=="string"?v:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))s="";else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=KP(s));const _=p.safeValue(s);if(t=t.replace(o[0],_),f?(p.regex.lastIndex+=s.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,s;function a(l,c){const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const h=f.match(/'/g),p=f.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),c&&(s={...c,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${u}${f}`}return delete s.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=KP(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function GY(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(!s)return;const[a,...l]=s.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");n[a.trim()]||(n[a.trim()]=c),c==="false"&&(n[a.trim()]=!1),c==="true"&&(n[a.trim()]=!0),isNaN(c)||(n[a.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:n}}function Pu(e){const t={};return function(r,i,o){const s=i+JSON.stringify(o);let a=t[s];return a||(a=e(c1(i),o),t[s]=a),a(r)}}class HY{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=cs.create("formatter"),this.options=t,this.formats={number:Pu((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:Pu((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:Pu((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:Pu((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:Pu((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()]=Pu(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,l)=>{const{formatName:c,formatOptions:u}=GY(l);if(this.formats[c]){let d=a;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[c](a,h,{...u,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${c}`);return a},t)}}function WY(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class qY extends Kb{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=cs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,u=!1,s[f]===void 0&&(s[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(a[c]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),r&&this.store.addResourceBundle(o,s,r),this.state[t]=n?-1:2;const a={};this.queue.forEach(l=>{MY(l.loaded,[o],s),WY(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const a=(c,u)=>{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(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>a(null,u)).catch(a):a(null,c)}catch(c){a(c)}return}return l(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}else c(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function t6(){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 n6(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 O0(){}function KY(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Jp extends Kb{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=n6(t),this.services={},this.logger=cs,this.modules={external:[]},KY(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=t6();this.options={...i,...this.options,...n6(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(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?cs.init(o(this.modules.logger),this.options):cs.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=HY);const d=new ZP(this.options);this.store=new QP(this.options.resources,this.options);const f=this.services;f.logger=cs,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new VY(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new UY(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new qY(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),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 u1(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=O0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=dh(),c=()=>{const u=(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 u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O0;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=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const i=dh();return t||(t=this.languages),n||(n=this.options.ns),r||(r=O0),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"&&kN.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=dh();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{s(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,r){var i=this;const o=function(s,a){let l;if(typeof a!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([s,a].concat(u))}else l={...a};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||r||o.keyPrefix;const f=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(s)?h=s.map(p=>`${l.keyPrefix}${f}${p}`):h=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s,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 s=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=dh();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=dh();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new ZP(t6());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 Jp(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O0;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Jp(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new QP(this.store.data,i),o.services.resourceStore=o.store),o.translator=new u1(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(a,...c)}),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 Oe=Jp.createInstance();Oe.createInstance=Jp.createInstance;Oe.createInstance;Oe.dir;Oe.init;Oe.loadResources;Oe.reloadResources;Oe.use;Oe.changeLanguage;Oe.getFixedT;const J=Oe.t;Oe.exists;Oe.setDefaultNamespace;Oe.hasLoadedNamespace;Oe.loadNamespaces;Oe.loadLanguages;var XY=typeof global=="object"&&global&&global.Object===Object&&global;const PN=XY;var QY=typeof self=="object"&&self&&self.Object===Object&&self,YY=PN||QY||Function("return this")();const Es=YY;var ZY=Es.Symbol;const eo=ZY;var IN=Object.prototype,JY=IN.hasOwnProperty,eZ=IN.toString,fh=eo?eo.toStringTag:void 0;function tZ(e){var t=JY.call(e,fh),n=e[fh];try{e[fh]=void 0;var r=!0}catch{}var i=eZ.call(e);return r&&(t?e[fh]=n:delete e[fh]),i}var nZ=Object.prototype,rZ=nZ.toString;function iZ(e){return rZ.call(e)}var oZ="[object Null]",sZ="[object Undefined]",r6=eo?eo.toStringTag:void 0;function Ts(e){return e==null?e===void 0?sZ:oZ:r6&&r6 in Object(e)?tZ(e):iZ(e)}function Ei(e){return e!=null&&typeof e=="object"}var aZ="[object Symbol]";function Xb(e){return typeof e=="symbol"||Ei(e)&&Ts(e)==aZ}function MN(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 lZ=Array.isArray;const bn=lZ;var cZ=1/0,i6=eo?eo.prototype:void 0,o6=i6?i6.toString:void 0;function d1(e){if(typeof e=="string")return e;if(bn(e))return MN(e,d1)+"";if(Xb(e))return o6?o6.call(e):"";var t=e+"";return t=="0"&&1/e==-cZ?"-0":t}var uZ=/\s/;function dZ(e){for(var t=e.length;t--&&uZ.test(e.charAt(t)););return t}var fZ=/^\s+/;function hZ(e){return e&&e.slice(0,dZ(e)+1).replace(fZ,"")}function _r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var s6=0/0,pZ=/^[-+]0x[0-9a-f]+$/i,gZ=/^0b[01]+$/i,mZ=/^0o[0-7]+$/i,yZ=parseInt;function qy(e){if(typeof e=="number")return e;if(Xb(e))return s6;if(_r(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_r(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=hZ(e);var n=gZ.test(e);return n||mZ.test(e)?yZ(e.slice(2),n?2:8):pZ.test(e)?s6:+e}var a6=1/0,vZ=17976931348623157e292;function kd(e){if(!e)return e===0?e:0;if(e=qy(e),e===a6||e===-a6){var t=e<0?-1:1;return t*vZ}return e===e?e:0}function bZ(e){var t=kd(e),n=t%1;return t===t?n?t-n:t:0}function Qb(e){return e}var _Z="[object AsyncFunction]",SZ="[object Function]",xZ="[object GeneratorFunction]",wZ="[object Proxy]";function x4(e){if(!_r(e))return!1;var t=Ts(e);return t==SZ||t==xZ||t==_Z||t==wZ}var CZ=Es["__core-js_shared__"];const zx=CZ;var l6=function(){var e=/[^.]+$/.exec(zx&&zx.keys&&zx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function EZ(e){return!!l6&&l6 in e}var TZ=Function.prototype,AZ=TZ.toString;function lu(e){if(e!=null){try{return AZ.call(e)}catch{}try{return e+""}catch{}}return""}var kZ=/[\\^$.*+?()[\]{}|]/g,PZ=/^\[object .+?Constructor\]$/,IZ=Function.prototype,MZ=Object.prototype,RZ=IZ.toString,OZ=MZ.hasOwnProperty,$Z=RegExp("^"+RZ.call(OZ).replace(kZ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NZ(e){if(!_r(e)||EZ(e))return!1;var t=x4(e)?$Z:PZ;return t.test(lu(e))}function FZ(e,t){return e==null?void 0:e[t]}function cu(e,t){var n=FZ(e,t);return NZ(n)?n:void 0}var DZ=cu(Es,"WeakMap");const _5=DZ;var c6=Object.create,LZ=function(){function e(){}return function(t){if(!_r(t))return{};if(c6)return c6(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const BZ=LZ;function RN(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 zZ(){}function ON(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var jZ=800,VZ=16,UZ=Date.now;function GZ(e){var t=0,n=0;return function(){var r=UZ(),i=VZ-(r-n);if(n=r,i>0){if(++t>=jZ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function HZ(e){return function(){return e}}var WZ=function(){try{var e=cu(Object,"defineProperty");return e({},"",{}),e}catch{}}();const f1=WZ;var qZ=f1?function(e,t){return f1(e,"toString",{configurable:!0,enumerable:!1,value:HZ(t),writable:!0})}:Qb;const KZ=qZ;var XZ=GZ(KZ);const $N=XZ;function NN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function QZ(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 YZ(e){return e!==e}function ZZ(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function JZ(e,t,n){return t===t?ZZ(e,t,n):QZ(e,YZ,n)}function eJ(e,t){var n=e==null?0:e.length;return!!n&&JZ(e,t,0)>-1}var tJ=9007199254740991,nJ=/^(?:0|[1-9]\d*)$/;function Yb(e,t){var n=typeof e;return t=t??tJ,!!t&&(n=="number"||n!="symbol"&&nJ.test(e))&&e>-1&&e%1==0&&e<t}function Zb(e,t,n){t=="__proto__"&&f1?f1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hm(e,t){return e===t||e!==e&&t!==t}var rJ=Object.prototype,iJ=rJ.hasOwnProperty;function w4(e,t,n){var r=e[t];(!(iJ.call(e,t)&&hm(r,n))||n===void 0&&!(t in e))&&Zb(e,t,n)}function If(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=r?r(n[a],e[a],a,n,e):void 0;l===void 0&&(l=e[a]),i?Zb(n,a,l):w4(n,a,l)}return n}var u6=Math.max;function FN(e,t,n){return t=u6(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=u6(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),RN(e,this,a)}}function DN(e,t){return $N(FN(e,t,Qb),e+"")}var oJ=9007199254740991;function C4(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=oJ}function Mf(e){return e!=null&&C4(e.length)&&!x4(e)}function Jb(e,t,n){if(!_r(n))return!1;var r=typeof t;return(r=="number"?Mf(n)&&Yb(t,n.length):r=="string"&&t in n)?hm(n[t],e):!1}function LN(e){return DN(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&Jb(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t})}var sJ=Object.prototype;function E4(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||sJ;return e===n}function aJ(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var lJ="[object Arguments]";function d6(e){return Ei(e)&&Ts(e)==lJ}var BN=Object.prototype,cJ=BN.hasOwnProperty,uJ=BN.propertyIsEnumerable,dJ=d6(function(){return arguments}())?d6:function(e){return Ei(e)&&cJ.call(e,"callee")&&!uJ.call(e,"callee")};const eg=dJ;function fJ(){return!1}var zN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,f6=zN&&typeof module=="object"&&module&&!module.nodeType&&module,hJ=f6&&f6.exports===zN,h6=hJ?Es.Buffer:void 0,pJ=h6?h6.isBuffer:void 0,gJ=pJ||fJ;const tg=gJ;var mJ="[object Arguments]",yJ="[object Array]",vJ="[object Boolean]",bJ="[object Date]",_J="[object Error]",SJ="[object Function]",xJ="[object Map]",wJ="[object Number]",CJ="[object Object]",EJ="[object RegExp]",TJ="[object Set]",AJ="[object String]",kJ="[object WeakMap]",PJ="[object ArrayBuffer]",IJ="[object DataView]",MJ="[object Float32Array]",RJ="[object Float64Array]",OJ="[object Int8Array]",$J="[object Int16Array]",NJ="[object Int32Array]",FJ="[object Uint8Array]",DJ="[object Uint8ClampedArray]",LJ="[object Uint16Array]",BJ="[object Uint32Array]",$t={};$t[MJ]=$t[RJ]=$t[OJ]=$t[$J]=$t[NJ]=$t[FJ]=$t[DJ]=$t[LJ]=$t[BJ]=!0;$t[mJ]=$t[yJ]=$t[PJ]=$t[vJ]=$t[IJ]=$t[bJ]=$t[_J]=$t[SJ]=$t[xJ]=$t[wJ]=$t[CJ]=$t[EJ]=$t[TJ]=$t[AJ]=$t[kJ]=!1;function zJ(e){return Ei(e)&&C4(e.length)&&!!$t[Ts(e)]}function e_(e){return function(t){return e(t)}}var jN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pp=jN&&typeof module=="object"&&module&&!module.nodeType&&module,jJ=pp&&pp.exports===jN,jx=jJ&&PN.process,VJ=function(){try{var e=pp&&pp.require&&pp.require("util").types;return e||jx&&jx.binding&&jx.binding("util")}catch{}}();const _l=VJ;var p6=_l&&_l.isTypedArray,UJ=p6?e_(p6):zJ;const T4=UJ;var GJ=Object.prototype,HJ=GJ.hasOwnProperty;function VN(e,t){var n=bn(e),r=!n&&eg(e),i=!n&&!r&&tg(e),o=!n&&!r&&!i&&T4(e),s=n||r||i||o,a=s?aJ(e.length,String):[],l=a.length;for(var c in e)(t||HJ.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yb(c,l)))&&a.push(c);return a}function UN(e,t){return function(n){return e(t(n))}}var WJ=UN(Object.keys,Object);const qJ=WJ;var KJ=Object.prototype,XJ=KJ.hasOwnProperty;function GN(e){if(!E4(e))return qJ(e);var t=[];for(var n in Object(e))XJ.call(e,n)&&n!="constructor"&&t.push(n);return t}function Qc(e){return Mf(e)?VN(e):GN(e)}function QJ(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var YJ=Object.prototype,ZJ=YJ.hasOwnProperty;function JJ(e){if(!_r(e))return QJ(e);var t=E4(e),n=[];for(var r in e)r=="constructor"&&(t||!ZJ.call(e,r))||n.push(r);return n}function pm(e){return Mf(e)?VN(e,!0):JJ(e)}var eee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tee=/^\w*$/;function A4(e,t){if(bn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Xb(e)?!0:tee.test(e)||!eee.test(e)||t!=null&&e in Object(t)}var nee=cu(Object,"create");const ng=nee;function ree(){this.__data__=ng?ng(null):{},this.size=0}function iee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var oee="__lodash_hash_undefined__",see=Object.prototype,aee=see.hasOwnProperty;function lee(e){var t=this.__data__;if(ng){var n=t[e];return n===oee?void 0:n}return aee.call(t,e)?t[e]:void 0}var cee=Object.prototype,uee=cee.hasOwnProperty;function dee(e){var t=this.__data__;return ng?t[e]!==void 0:uee.call(t,e)}var fee="__lodash_hash_undefined__";function hee(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ng&&t===void 0?fee:t,this}function Yc(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])}}Yc.prototype.clear=ree;Yc.prototype.delete=iee;Yc.prototype.get=lee;Yc.prototype.has=dee;Yc.prototype.set=hee;function pee(){this.__data__=[],this.size=0}function t_(e,t){for(var n=e.length;n--;)if(hm(e[n][0],t))return n;return-1}var gee=Array.prototype,mee=gee.splice;function yee(e){var t=this.__data__,n=t_(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():mee.call(t,n,1),--this.size,!0}function vee(e){var t=this.__data__,n=t_(t,e);return n<0?void 0:t[n][1]}function bee(e){return t_(this.__data__,e)>-1}function _ee(e,t){var n=this.__data__,r=t_(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ma(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])}}ma.prototype.clear=pee;ma.prototype.delete=yee;ma.prototype.get=vee;ma.prototype.has=bee;ma.prototype.set=_ee;var See=cu(Es,"Map");const rg=See;function xee(){this.size=0,this.__data__={hash:new Yc,map:new(rg||ma),string:new Yc}}function wee(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function n_(e,t){var n=e.__data__;return wee(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cee(e){var t=n_(this,e).delete(e);return this.size-=t?1:0,t}function Eee(e){return n_(this,e).get(e)}function Tee(e){return n_(this,e).has(e)}function Aee(e,t){var n=n_(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ya(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])}}ya.prototype.clear=xee;ya.prototype.delete=Cee;ya.prototype.get=Eee;ya.prototype.has=Tee;ya.prototype.set=Aee;var kee="Expected a function";function k4(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kee);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(k4.Cache||ya),n}k4.Cache=ya;var Pee=500;function Iee(e){var t=k4(e,function(r){return n.size===Pee&&n.clear(),r}),n=t.cache;return t}var Mee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ree=/\\(\\)?/g,Oee=Iee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Mee,function(n,r,i,o){t.push(i?o.replace(Ree,"$1"):r||n)}),t});const $ee=Oee;function af(e){return e==null?"":d1(e)}function Rf(e,t){return bn(e)?e:A4(e,t)?[e]:$ee(af(e))}var Nee=1/0;function Of(e){if(typeof e=="string"||Xb(e))return e;var t=e+"";return t=="0"&&1/e==-Nee?"-0":t}function r_(e,t){t=Rf(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Of(t[n++])];return n&&n==r?e:void 0}function HN(e,t,n){var r=e==null?void 0:r_(e,t);return r===void 0?n:r}function P4(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var g6=eo?eo.isConcatSpreadable:void 0;function Fee(e){return bn(e)||eg(e)||!!(g6&&e&&e[g6])}function WN(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=Fee),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?WN(a,t-1,n,r,i):P4(i,a):r||(i[i.length]=a)}return i}function Dee(e){var t=e==null?0:e.length;return t?WN(e,1):[]}function qN(e){return $N(FN(e,void 0,Dee),e+"")}var Lee=UN(Object.getPrototypeOf,Object);const I4=Lee;var Bee="[object Object]",zee=Function.prototype,jee=Object.prototype,KN=zee.toString,Vee=jee.hasOwnProperty,Uee=KN.call(Object);function XN(e){if(!Ei(e)||Ts(e)!=Bee)return!1;var t=I4(e);if(t===null)return!0;var n=Vee.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&KN.call(n)==Uee}function QN(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 YN(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:QN(e,t,n)}var Gee="\\ud800-\\udfff",Hee="\\u0300-\\u036f",Wee="\\ufe20-\\ufe2f",qee="\\u20d0-\\u20ff",Kee=Hee+Wee+qee,Xee="\\ufe0e\\ufe0f",Qee="\\u200d",Yee=RegExp("["+Qee+Gee+Kee+Xee+"]");function i_(e){return Yee.test(e)}function Zee(e){return e.split("")}var ZN="\\ud800-\\udfff",Jee="\\u0300-\\u036f",ete="\\ufe20-\\ufe2f",tte="\\u20d0-\\u20ff",nte=Jee+ete+tte,rte="\\ufe0e\\ufe0f",ite="["+ZN+"]",S5="["+nte+"]",x5="\\ud83c[\\udffb-\\udfff]",ote="(?:"+S5+"|"+x5+")",JN="[^"+ZN+"]",eF="(?:\\ud83c[\\udde6-\\uddff]){2}",tF="[\\ud800-\\udbff][\\udc00-\\udfff]",ste="\\u200d",nF=ote+"?",rF="["+rte+"]?",ate="(?:"+ste+"(?:"+[JN,eF,tF].join("|")+")"+rF+nF+")*",lte=rF+nF+ate,cte="(?:"+[JN+S5+"?",S5,eF,tF,ite].join("|")+")",ute=RegExp(x5+"(?="+x5+")|"+cte+lte,"g");function dte(e){return e.match(ute)||[]}function iF(e){return i_(e)?dte(e):Zee(e)}function fte(e){return function(t){t=af(t);var n=i_(t)?iF(t):void 0,r=n?n[0]:t.charAt(0),i=n?YN(n,1).join(""):t.slice(1);return r[e]()+i}}var hte=fte("toUpperCase");const oF=hte;function sF(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 pte(e){return function(t){return e==null?void 0:e[t]}}var gte={À:"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"},mte=pte(gte);const yte=mte;var vte=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bte="\\u0300-\\u036f",_te="\\ufe20-\\ufe2f",Ste="\\u20d0-\\u20ff",xte=bte+_te+Ste,wte="["+xte+"]",Cte=RegExp(wte,"g");function Ete(e){return e=af(e),e&&e.replace(vte,yte).replace(Cte,"")}var Tte=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ate(e){return e.match(Tte)||[]}var kte=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Pte(e){return kte.test(e)}var aF="\\ud800-\\udfff",Ite="\\u0300-\\u036f",Mte="\\ufe20-\\ufe2f",Rte="\\u20d0-\\u20ff",Ote=Ite+Mte+Rte,lF="\\u2700-\\u27bf",cF="a-z\\xdf-\\xf6\\xf8-\\xff",$te="\\xac\\xb1\\xd7\\xf7",Nte="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Fte="\\u2000-\\u206f",Dte=" \\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",uF="A-Z\\xc0-\\xd6\\xd8-\\xde",Lte="\\ufe0e\\ufe0f",dF=$te+Nte+Fte+Dte,fF="[']",m6="["+dF+"]",Bte="["+Ote+"]",hF="\\d+",zte="["+lF+"]",pF="["+cF+"]",gF="[^"+aF+dF+hF+lF+cF+uF+"]",jte="\\ud83c[\\udffb-\\udfff]",Vte="(?:"+Bte+"|"+jte+")",Ute="[^"+aF+"]",mF="(?:\\ud83c[\\udde6-\\uddff]){2}",yF="[\\ud800-\\udbff][\\udc00-\\udfff]",Uu="["+uF+"]",Gte="\\u200d",y6="(?:"+pF+"|"+gF+")",Hte="(?:"+Uu+"|"+gF+")",v6="(?:"+fF+"(?:d|ll|m|re|s|t|ve))?",b6="(?:"+fF+"(?:D|LL|M|RE|S|T|VE))?",vF=Vte+"?",bF="["+Lte+"]?",Wte="(?:"+Gte+"(?:"+[Ute,mF,yF].join("|")+")"+bF+vF+")*",qte="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kte="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xte=bF+vF+Wte,Qte="(?:"+[zte,mF,yF].join("|")+")"+Xte,Yte=RegExp([Uu+"?"+pF+"+"+v6+"(?="+[m6,Uu,"$"].join("|")+")",Hte+"+"+b6+"(?="+[m6,Uu+y6,"$"].join("|")+")",Uu+"?"+y6+"+"+v6,Uu+"+"+b6,Kte,qte,hF,Qte].join("|"),"g");function Zte(e){return e.match(Yte)||[]}function Jte(e,t,n){return e=af(e),t=n?void 0:t,t===void 0?Pte(e)?Zte(e):Ate(e):e.match(t)||[]}var ene="[']",tne=RegExp(ene,"g");function nne(e){return function(t){return sF(Jte(Ete(t).replace(tne,"")),e,"")}}function rne(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function el(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=qy(n),n=n===n?n:0),t!==void 0&&(t=qy(t),t=t===t?t:0),rne(qy(e),t,n)}function ine(){this.__data__=new ma,this.size=0}function one(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function sne(e){return this.__data__.get(e)}function ane(e){return this.__data__.has(e)}var lne=200;function cne(e,t){var n=this.__data__;if(n instanceof ma){var r=n.__data__;if(!rg||r.length<lne-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ya(r)}return n.set(e,t),this.size=n.size,this}function Po(e){var t=this.__data__=new ma(e);this.size=t.size}Po.prototype.clear=ine;Po.prototype.delete=one;Po.prototype.get=sne;Po.prototype.has=ane;Po.prototype.set=cne;function une(e,t){return e&&If(t,Qc(t),e)}function dne(e,t){return e&&If(t,pm(t),e)}var _F=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_6=_F&&typeof module=="object"&&module&&!module.nodeType&&module,fne=_6&&_6.exports===_F,S6=fne?Es.Buffer:void 0,x6=S6?S6.allocUnsafe:void 0;function SF(e,t){if(t)return e.slice();var n=e.length,r=x6?x6(n):new e.constructor(n);return e.copy(r),r}function hne(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function xF(){return[]}var pne=Object.prototype,gne=pne.propertyIsEnumerable,w6=Object.getOwnPropertySymbols,mne=w6?function(e){return e==null?[]:(e=Object(e),hne(w6(e),function(t){return gne.call(e,t)}))}:xF;const M4=mne;function yne(e,t){return If(e,M4(e),t)}var vne=Object.getOwnPropertySymbols,bne=vne?function(e){for(var t=[];e;)P4(t,M4(e)),e=I4(e);return t}:xF;const wF=bne;function _ne(e,t){return If(e,wF(e),t)}function CF(e,t,n){var r=t(e);return bn(e)?r:P4(r,n(e))}function w5(e){return CF(e,Qc,M4)}function EF(e){return CF(e,pm,wF)}var Sne=cu(Es,"DataView");const C5=Sne;var xne=cu(Es,"Promise");const E5=xne;var wne=cu(Es,"Set");const Pd=wne;var C6="[object Map]",Cne="[object Object]",E6="[object Promise]",T6="[object Set]",A6="[object WeakMap]",k6="[object DataView]",Ene=lu(C5),Tne=lu(rg),Ane=lu(E5),kne=lu(Pd),Pne=lu(_5),sc=Ts;(C5&&sc(new C5(new ArrayBuffer(1)))!=k6||rg&&sc(new rg)!=C6||E5&&sc(E5.resolve())!=E6||Pd&&sc(new Pd)!=T6||_5&&sc(new _5)!=A6)&&(sc=function(e){var t=Ts(e),n=t==Cne?e.constructor:void 0,r=n?lu(n):"";if(r)switch(r){case Ene:return k6;case Tne:return C6;case Ane:return E6;case kne:return T6;case Pne:return A6}return t});const lf=sc;var Ine=Object.prototype,Mne=Ine.hasOwnProperty;function Rne(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Mne.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var One=Es.Uint8Array;const h1=One;function R4(e){var t=new e.constructor(e.byteLength);return new h1(t).set(new h1(e)),t}function $ne(e,t){var n=t?R4(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Nne=/\w*$/;function Fne(e){var t=new e.constructor(e.source,Nne.exec(e));return t.lastIndex=e.lastIndex,t}var P6=eo?eo.prototype:void 0,I6=P6?P6.valueOf:void 0;function Dne(e){return I6?Object(I6.call(e)):{}}function TF(e,t){var n=t?R4(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Lne="[object Boolean]",Bne="[object Date]",zne="[object Map]",jne="[object Number]",Vne="[object RegExp]",Une="[object Set]",Gne="[object String]",Hne="[object Symbol]",Wne="[object ArrayBuffer]",qne="[object DataView]",Kne="[object Float32Array]",Xne="[object Float64Array]",Qne="[object Int8Array]",Yne="[object Int16Array]",Zne="[object Int32Array]",Jne="[object Uint8Array]",ere="[object Uint8ClampedArray]",tre="[object Uint16Array]",nre="[object Uint32Array]";function rre(e,t,n){var r=e.constructor;switch(t){case Wne:return R4(e);case Lne:case Bne:return new r(+e);case qne:return $ne(e,n);case Kne:case Xne:case Qne:case Yne:case Zne:case Jne:case ere:case tre:case nre:return TF(e,n);case zne:return new r;case jne:case Gne:return new r(e);case Vne:return Fne(e);case Une:return new r;case Hne:return Dne(e)}}function AF(e){return typeof e.constructor=="function"&&!E4(e)?BZ(I4(e)):{}}var ire="[object Map]";function ore(e){return Ei(e)&&lf(e)==ire}var M6=_l&&_l.isMap,sre=M6?e_(M6):ore;const are=sre;var lre="[object Set]";function cre(e){return Ei(e)&&lf(e)==lre}var R6=_l&&_l.isSet,ure=R6?e_(R6):cre;const dre=ure;var fre=1,hre=2,pre=4,kF="[object Arguments]",gre="[object Array]",mre="[object Boolean]",yre="[object Date]",vre="[object Error]",PF="[object Function]",bre="[object GeneratorFunction]",_re="[object Map]",Sre="[object Number]",IF="[object Object]",xre="[object RegExp]",wre="[object Set]",Cre="[object String]",Ere="[object Symbol]",Tre="[object WeakMap]",Are="[object ArrayBuffer]",kre="[object DataView]",Pre="[object Float32Array]",Ire="[object Float64Array]",Mre="[object Int8Array]",Rre="[object Int16Array]",Ore="[object Int32Array]",$re="[object Uint8Array]",Nre="[object Uint8ClampedArray]",Fre="[object Uint16Array]",Dre="[object Uint32Array]",wt={};wt[kF]=wt[gre]=wt[Are]=wt[kre]=wt[mre]=wt[yre]=wt[Pre]=wt[Ire]=wt[Mre]=wt[Rre]=wt[Ore]=wt[_re]=wt[Sre]=wt[IF]=wt[xre]=wt[wre]=wt[Cre]=wt[Ere]=wt[$re]=wt[Nre]=wt[Fre]=wt[Dre]=!0;wt[vre]=wt[PF]=wt[Tre]=!1;function gp(e,t,n,r,i,o){var s,a=t&fre,l=t&hre,c=t&pre;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!_r(e))return e;var u=bn(e);if(u){if(s=Rne(e),!a)return ON(e,s)}else{var d=lf(e),f=d==PF||d==bre;if(tg(e))return SF(e,a);if(d==IF||d==kF||f&&!i){if(s=l||f?{}:AF(e),!a)return l?_ne(e,dne(s,e)):yne(e,une(s,e))}else{if(!wt[d])return i?e:{};s=rre(e,d,a)}}o||(o=new Po);var h=o.get(e);if(h)return h;o.set(e,s),dre(e)?e.forEach(function(_){s.add(gp(_,t,n,_,e,o))}):are(e)&&e.forEach(function(_,v){s.set(v,gp(_,t,n,v,e,o))});var p=c?l?EF:w5:l?pm:Qc,m=u?void 0:p(e);return NN(m||e,function(_,v){m&&(v=_,_=e[v]),w4(s,v,gp(_,t,n,v,e,o))}),s}var Lre=1,Bre=4;function Ge(e){return gp(e,Lre|Bre)}var zre="__lodash_hash_undefined__";function jre(e){return this.__data__.set(e,zre),this}function Vre(e){return this.__data__.has(e)}function ig(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ya;++t<n;)this.add(e[t])}ig.prototype.add=ig.prototype.push=jre;ig.prototype.has=Vre;function MF(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 RF(e,t){return e.has(t)}var Ure=1,Gre=2;function OF(e,t,n,r,i,o){var s=n&Ure,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var d=-1,f=!0,h=n&Gre?new ig:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var p=e[d],m=t[d];if(r)var _=s?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(_!==void 0){if(_)continue;f=!1;break}if(h){if(!MF(t,function(v,y){if(!RF(h,y)&&(p===v||i(p,v,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Hre(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function O4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Wre=1,qre=2,Kre="[object Boolean]",Xre="[object Date]",Qre="[object Error]",Yre="[object Map]",Zre="[object Number]",Jre="[object RegExp]",eie="[object Set]",tie="[object String]",nie="[object Symbol]",rie="[object ArrayBuffer]",iie="[object DataView]",O6=eo?eo.prototype:void 0,Vx=O6?O6.valueOf:void 0;function oie(e,t,n,r,i,o,s){switch(n){case iie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case rie:return!(e.byteLength!=t.byteLength||!o(new h1(e),new h1(t)));case Kre:case Xre:case Zre:return hm(+e,+t);case Qre:return e.name==t.name&&e.message==t.message;case Jre:case tie:return e==t+"";case Yre:var a=Hre;case eie:var l=r&Wre;if(a||(a=O4),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=qre,s.set(e,t);var u=OF(a(e),a(t),r,i,o,s);return s.delete(e),u;case nie:if(Vx)return Vx.call(e)==Vx.call(t)}return!1}var sie=1,aie=Object.prototype,lie=aie.hasOwnProperty;function cie(e,t,n,r,i,o){var s=n&sie,a=w5(e),l=a.length,c=w5(t),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in t:lie.call(t,f)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var _=s;++d<l;){f=a[d];var v=e[f],y=t[f];if(r)var g=s?r(y,v,f,t,e,o):r(v,y,f,e,t,o);if(!(g===void 0?v===y||i(v,y,n,r,o):g)){m=!1;break}_||(_=f=="constructor")}if(m&&!_){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var uie=1,$6="[object Arguments]",N6="[object Array]",$0="[object Object]",die=Object.prototype,F6=die.hasOwnProperty;function fie(e,t,n,r,i,o){var s=bn(e),a=bn(t),l=s?N6:lf(e),c=a?N6:lf(t);l=l==$6?$0:l,c=c==$6?$0:c;var u=l==$0,d=c==$0,f=l==c;if(f&&tg(e)){if(!tg(t))return!1;s=!0,u=!1}if(f&&!u)return o||(o=new Po),s||T4(e)?OF(e,t,n,r,i,o):oie(e,t,l,n,r,i,o);if(!(n&uie)){var h=u&&F6.call(e,"__wrapped__"),p=d&&F6.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,_=p?t.value():t;return o||(o=new Po),i(m,_,n,r,o)}}return f?(o||(o=new Po),cie(e,t,n,r,i,o)):!1}function o_(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ei(e)&&!Ei(t)?e!==e&&t!==t:fie(e,t,n,r,o_,i)}var hie=1,pie=2;function gie(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Po;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?o_(u,c,hie|pie,r,d):f))return!1}}return!0}function $F(e){return e===e&&!_r(e)}function mie(e){for(var t=Qc(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,$F(i)]}return t}function NF(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function yie(e){var t=mie(e);return t.length==1&&t[0][2]?NF(t[0][0],t[0][1]):function(n){return n===e||gie(n,e,t)}}function vie(e,t){return e!=null&&t in Object(e)}function bie(e,t,n){t=Rf(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Of(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&C4(i)&&Yb(s,i)&&(bn(e)||eg(e)))}function FF(e,t){return e!=null&&bie(e,t,vie)}var _ie=1,Sie=2;function xie(e,t){return A4(e)&&$F(t)?NF(Of(e),t):function(n){var r=HN(n,e);return r===void 0&&r===t?FF(n,e):o_(t,r,_ie|Sie)}}function DF(e){return function(t){return t==null?void 0:t[e]}}function wie(e){return function(t){return r_(t,e)}}function Cie(e){return A4(e)?DF(Of(e)):wie(e)}function s_(e){return typeof e=="function"?e:e==null?Qb:typeof e=="object"?bn(e)?xie(e[0],e[1]):yie(e):Cie(e)}function Eie(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function Tie(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var Aie=Tie();const LF=Aie;function kie(e,t){return e&&LF(e,t,Qc)}function Pie(e,t){return function(n,r){if(n==null)return n;if(!Mf(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var Iie=Pie(kie);const a_=Iie;function Mie(e,t,n,r){return a_(e,function(i,o,s){t(r,i,n(i),s)}),r}function Rie(e,t){return function(n,r){var i=bn(n)?Eie:Mie,o=t?t():{};return i(n,e,s_(r),o)}}function T5(e,t,n){(n!==void 0&&!hm(e[t],n)||n===void 0&&!(t in e))&&Zb(e,t,n)}function Oie(e){return Ei(e)&&Mf(e)}function A5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function $ie(e){return If(e,pm(e))}function Nie(e,t,n,r,i,o,s){var a=A5(e,n),l=A5(t,n),c=s.get(l);if(c){T5(e,n,c);return}var u=o?o(a,l,n+"",e,t,s):void 0,d=u===void 0;if(d){var f=bn(l),h=!f&&tg(l),p=!f&&!h&&T4(l);u=l,f||h||p?bn(a)?u=a:Oie(a)?u=ON(a):h?(d=!1,u=SF(l,!0)):p?(d=!1,u=TF(l,!0)):u=[]:XN(l)||eg(l)?(u=a,eg(a)?u=$ie(a):(!_r(a)||x4(a))&&(u=AF(l))):d=!1}d&&(s.set(l,u),i(u,l,r,o,s),s.delete(l)),T5(e,n,u)}function l_(e,t,n,r,i){e!==t&&LF(t,function(o,s){if(i||(i=new Po),_r(o))Nie(e,t,s,n,l_,r,i);else{var a=r?r(A5(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),T5(e,s,a)}},pm)}function BF(e,t,n,r,i,o){return _r(e)&&_r(t)&&(o.set(t,e),l_(e,t,void 0,BF,o),o.delete(t)),e}var Fie=LN(function(e,t,n,r){l_(e,t,n,r)});const Die=Fie;var Lie=DN(function(e){return e.push(void 0,BF),RN(Die,void 0,e)});const zF=Lie;function Bie(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 zie(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function jie(e){return typeof e=="function"?e:Qb}function Fo(e,t){var n=bn(e)?NN:a_;return n(e,jie(t))}var Vie="[object String]";function jF(e){return typeof e=="string"||!bn(e)&&Ei(e)&&Ts(e)==Vie}function Uie(e,t){return t.length<2?e:r_(e,QN(t,0,-1))}function $4(e,t){return o_(e,t)}var Gie="[object Number]";function p1(e){return typeof e=="number"||Ei(e)&&Ts(e)==Gie}var Hie="[object RegExp]";function Wie(e){return Ei(e)&&Ts(e)==Hie}var D6=_l&&_l.isRegExp,qie=D6?e_(D6):Wie;const Kie=qie;var Xie=Rie(function(e,t,n){Zb(e,n,t)});const VF=Xie;var Qie=LN(function(e,t,n){l_(e,t,n)});const Id=Qie;function Yie(e,t){return t=Rf(t,e),e=Uie(e,t),e==null||delete e[Of(zie(t))]}function Zie(e){return XN(e)?void 0:e}var Jie=1,eoe=2,toe=4,noe=qN(function(e,t){var n={};if(e==null)return n;var r=!1;t=MN(t,function(o){return o=Rf(o,e),r||(r=o.length>1),o}),If(e,EF(e),n),r&&(n=gp(n,Jie|eoe|toe,Zie));for(var i=t.length;i--;)Yie(n,t[i]);return n});const uu=noe;function roe(e,t,n,r){if(!_r(e))return e;t=Rf(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var l=Of(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=s){var u=a[l];c=r?r(u,l,a):void 0,c===void 0&&(c=_r(u)?u:Yb(t[i+1])?[]:{})}w4(a,l,c),a=a[l]}return e}function ioe(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=r_(e,s);n(a,s)&&roe(o,Rf(s,e),a)}return o}var ooe=DF("length");const soe=ooe;var UF="\\ud800-\\udfff",aoe="\\u0300-\\u036f",loe="\\ufe20-\\ufe2f",coe="\\u20d0-\\u20ff",uoe=aoe+loe+coe,doe="\\ufe0e\\ufe0f",foe="["+UF+"]",k5="["+uoe+"]",P5="\\ud83c[\\udffb-\\udfff]",hoe="(?:"+k5+"|"+P5+")",GF="[^"+UF+"]",HF="(?:\\ud83c[\\udde6-\\uddff]){2}",WF="[\\ud800-\\udbff][\\udc00-\\udfff]",poe="\\u200d",qF=hoe+"?",KF="["+doe+"]?",goe="(?:"+poe+"(?:"+[GF,HF,WF].join("|")+")"+KF+qF+")*",moe=KF+qF+goe,yoe="(?:"+[GF+k5+"?",k5,HF,WF,foe].join("|")+")",L6=RegExp(P5+"(?="+P5+")|"+yoe+moe,"g");function voe(e){for(var t=L6.lastIndex=0;L6.test(e);)++t;return t}function XF(e){return i_(e)?voe(e):soe(e)}function boe(e,t){return ioe(e,t,function(n,r){return FF(e,r)})}var _oe=qN(function(e,t){return e==null?{}:boe(e,t)});const B6=_oe;var Soe=Math.floor,xoe=Math.random;function woe(e,t){return e+Soe(xoe()*(t-e+1))}var Coe=parseFloat,Eoe=Math.min,Toe=Math.random;function Aoe(e,t,n){if(n&&typeof n!="boolean"&&Jb(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=kd(e),t===void 0?(t=e,e=0):t=kd(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Toe();return Eoe(e+i*(t-e+Coe("1e-"+((i+"").length-1))),t)}return woe(e,t)}var koe=Math.ceil,Poe=Math.max;function Ioe(e,t,n,r){for(var i=-1,o=Poe(koe((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}function Moe(e){return function(t,n,r){return r&&typeof r!="number"&&Jb(t,n,r)&&(n=r=void 0),t=kd(t),n===void 0?(n=t,t=0):n=kd(n),r=r===void 0?t<n?1:-1:kd(r),Ioe(t,n,r,e)}}var Roe=Moe();const Ooe=Roe;function $oe(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}function og(e,t,n){var r=bn(e)?sF:$oe,i=arguments.length<3;return r(e,s_(t),n,i,a_)}var Noe="[object Map]",Foe="[object Set]";function c_(e){if(e==null)return 0;if(Mf(e))return jF(e)?XF(e):e.length;var t=lf(e);return t==Noe||t==Foe?e.size:GN(e).length}function Doe(e,t){var n;return a_(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function Gu(e,t,n){var r=bn(e)?MF:Doe;return n&&Jb(e,t,n)&&(t=void 0),r(e,s_(t))}var Loe=nne(function(e,t,n){return e+(n?" ":"")+oF(t)});const N4=Loe;var Boe=30,zoe="...",joe=/\w*$/;function z6(e,t){var n=Boe,r=zoe;if(_r(t)){var i="separator"in t?t.separator:i;n="length"in t?bZ(t.length):n,r="omission"in t?d1(t.omission):r}e=af(e);var o=e.length;if(i_(e)){var s=iF(e);o=s.length}if(n>=o)return e;var a=n-XF(r);if(a<1)return r;var l=s?YN(s,0,a).join(""):e.slice(0,a);if(i===void 0)return l+r;if(s&&(a+=l.length-a),Kie(i)){if(e.slice(a).search(i)){var c,u=l;for(i.global||(i=RegExp(i.source,af(joe.exec(i))+"g")),i.lastIndex=0;c=i.exec(u);)var d=c.index;l=l.slice(0,d===void 0?a:d)}}else if(e.indexOf(d1(i),a)!=a){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Voe=1/0,Uoe=Pd&&1/O4(new Pd([,-0]))[1]==Voe?function(e){return new Pd(e)}:zZ;const Goe=Uoe;var Hoe=200;function QF(e,t,n){var r=-1,i=eJ,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Bie;else if(o>=Hoe){var c=t?null:Goe(e);if(c)return O4(c);s=!1,i=RF,l=new ig}else l=t?[]:a;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function Woe(e){return e&&e.length?QF(e):[]}function YF(e,t){return e&&e.length?QF(e,s_(t)):[]}const ZF=he("socket/socketConnected"),F4=he("socket/appSocketConnected"),JF=he("socket/socketDisconnected"),eD=he("socket/appSocketDisconnected"),qoe=he("socket/socketSubscribedSession"),Koe=he("socket/appSocketSubscribedSession"),Xoe=he("socket/socketUnsubscribedSession"),Qoe=he("socket/appSocketUnsubscribedSession"),tD=he("socket/socketInvocationStarted"),D4=he("socket/appSocketInvocationStarted"),L4=he("socket/socketInvocationComplete"),B4=he("socket/appSocketInvocationComplete"),nD=he("socket/socketInvocationError"),u_=he("socket/appSocketInvocationError"),rD=he("socket/socketGraphExecutionStateComplete"),iD=he("socket/appSocketGraphExecutionStateComplete"),oD=he("socket/socketGeneratorProgress"),z4=he("socket/appSocketGeneratorProgress"),sD=he("socket/socketModelLoadStarted"),aD=he("socket/appSocketModelLoadStarted"),lD=he("socket/socketModelLoadCompleted"),cD=he("socket/appSocketModelLoadCompleted"),uD=he("socket/socketSessionRetrievalError"),dD=he("socket/appSocketSessionRetrievalError"),fD=he("socket/socketInvocationRetrievalError"),hD=he("socket/appSocketInvocationRetrievalError"),pD=he("socket/socketQueueItemStatusChanged"),d_=he("socket/appSocketQueueItemStatusChanged"),Yoe=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),pi=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},gD={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"},mD=jt({name:"system",initialState:gD,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(F4,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(eD,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(D4,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(z4,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:s,graph_execution_state_id:a,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:Yoe(r,i,o),progress_image:s,session_id:a,batch_id:l},t.status="PROCESSING"}),e.addCase(B4,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(iD,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(aD,t=>{t.status="LOADING_MODEL"}),e.addCase(cD,t=>{t.status="CONNECTED"}),e.addCase(d_,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.queue_item.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(nse,(t,n)=>{t.toastQueue.push(pi({title:J("toast.serverError"),status:"error",description:N4(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:gze,setEnableImageDebugging:mze,addToast:Ve,clearToastQueue:yze,consoleLogLevelChanged:vze,shouldLogToConsoleChanged:bze,shouldAntialiasProgressImageChanged:_ze,languageChanged:Sze,shouldUseNSFWCheckerChanged:Zoe,shouldUseWatermarkerChanged:Joe,setShouldEnableInformationalPopovers:xze,isInitializedChanged:ese}=mD.actions,tse=mD.reducer,nse=br(u_,dD,hD),rse=e=>{const{socket:t,dispatch:n}=e;t.on("connect",()=>{n(ZF());const r=In.get();t.emit("subscribe_queue",{queue_id:r})}),t.on("connect_error",r=>{r&&r.message&&r.data==="ERR_UNAUTHENTICATED"&&n(Ve(pi({title:r.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{n(JF())}),t.on("invocation_started",r=>{n(tD({data:r}))}),t.on("generator_progress",r=>{n(oD({data:r}))}),t.on("invocation_error",r=>{n(nD({data:r}))}),t.on("invocation_complete",r=>{n(L4({data:r}))}),t.on("graph_execution_state_complete",r=>{n(rD({data:r}))}),t.on("model_load_started",r=>{n(sD({data:r}))}),t.on("model_load_completed",r=>{n(lD({data:r}))}),t.on("session_retrieval_error",r=>{n(uD({data:r}))}),t.on("invocation_retrieval_error",r=>{n(fD({data:r}))}),t.on("queue_item_status_changed",r=>{n(pD({data:r}))})},Ss=Object.create(null);Ss.open="0";Ss.close="1";Ss.ping="2";Ss.pong="3";Ss.message="4";Ss.upgrade="5";Ss.noop="6";const Ky=Object.create(null);Object.keys(Ss).forEach(e=>{Ky[Ss[e]]=e});const I5={type:"error",data:"parser error"},yD=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vD=typeof ArrayBuffer=="function",bD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,j4=({type:e,data:t},n,r)=>yD&&t instanceof Blob?n?r(t):j6(t,r):vD&&(t instanceof ArrayBuffer||bD(t))?n?r(t):j6(new Blob([t]),r):r(Ss[e]+(t||"")),j6=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function V6(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ux;function ise(e,t){if(yD&&e.data instanceof Blob)return e.data.arrayBuffer().then(V6).then(t);if(vD&&(e.data instanceof ArrayBuffer||bD(e.data)))return t(V6(e.data));j4(e,!1,n=>{Ux||(Ux=new TextEncoder),t(Ux.encode(n))})}const U6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<U6.length;e++)Vh[U6.charCodeAt(e)]=e;const ose=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Vh[e.charCodeAt(r)],s=Vh[e.charCodeAt(r+1)],a=Vh[e.charCodeAt(r+2)],l=Vh[e.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},sse=typeof ArrayBuffer=="function",V4=(e,t)=>{if(typeof e!="string")return{type:"message",data:_D(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ase(e.substring(1),t)}:Ky[n]?e.length>1?{type:Ky[n],data:e.substring(1)}:{type:Ky[n]}:I5},ase=(e,t)=>{if(sse){const n=ose(e);return _D(n,t)}else return{base64:!0,data:e}},_D=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},SD=String.fromCharCode(30),lse=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{j4(o,!1,a=>{r[s]=a,++i===n&&t(r.join(SD))})})},cse=(e,t)=>{const n=e.split(SD),r=[];for(let i=0;i<n.length;i++){const o=V4(n[i],t);if(r.push(o),o.type==="error")break}return r};function use(){return new TransformStream({transform(e,t){ise(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 Gx;function N0(e){return e.reduce((t,n)=>t+n.length,0)}function F0(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 dse(e,t){Gx||(Gx=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(N0(n)<1)break;const l=F0(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(N0(n)<2)break;const l=F0(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(N0(n)<8)break;const l=F0(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(I5);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(N0(n)<i)break;const l=F0(n,i);a.enqueue(V4(o?l:Gx.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(I5);break}}}})}const xD=4;function vn(e){if(e)return fse(e)}function fse(e){for(var t in vn.prototype)e[t]=vn.prototype[t];return e}vn.prototype.on=vn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};vn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};vn.prototype.off=vn.prototype.removeListener=vn.prototype.removeAllListeners=vn.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};vn.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};vn.prototype.emitReserved=vn.prototype.emit;vn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};vn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const qi=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function wD(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const hse=qi.setTimeout,pse=qi.clearTimeout;function f_(e,t){t.useNativeTimers?(e.setTimeoutFn=hse.bind(qi),e.clearTimeoutFn=pse.bind(qi)):(e.setTimeoutFn=qi.setTimeout.bind(qi),e.clearTimeoutFn=qi.clearTimeout.bind(qi))}const gse=1.33;function mse(e){return typeof e=="string"?yse(e):Math.ceil((e.byteLength||e.size)*gse)}function yse(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 vse(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function bse(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 _se extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class U4 extends vn{constructor(t){super(),this.writable=!1,f_(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new _se(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=V4(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=vse(t);return n.length?"?"+n:""}}const CD="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),M5=64,Sse={};let G6=0,D0=0,H6;function W6(e){let t="";do t=CD[e%M5]+t,e=Math.floor(e/M5);while(e>0);return t}function ED(){const e=W6(+new Date);return e!==H6?(G6=0,H6=e):e+"."+W6(G6++)}for(;D0<M5;D0++)Sse[CD[D0]]=D0;let TD=!1;try{TD=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xse=TD;function AD(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||xse))return new XMLHttpRequest}catch{}if(!t)try{return new qi[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function wse(){}const Cse=function(){return new AD({xdomain:!1}).responseType!=null}();class Ese extends U4{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=Cse&&!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)};cse(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,lse(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]=ED()),!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 Md(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 Md=class Xy extends vn{constructor(t,n){super(),f_(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=wD(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new AD(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=Xy.requestsCount++,Xy.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=wse,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Xy.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()}};Md.requestsCount=0;Md.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",q6);else if(typeof addEventListener=="function"){const e="onpagehide"in qi?"pagehide":"unload";addEventListener(e,q6,!1)}}function q6(){for(let e in Md.requests)Md.requests.hasOwnProperty(e)&&Md.requests[e].abort()}const G4=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),L0=qi.WebSocket||qi.MozWebSocket,K6=!0,Tse="arraybuffer",X6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ase extends U4{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=X6?{}:wD(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=K6&&!X6?n?new L0(t,n):new L0(t):new L0(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;j4(r,this.supportsBinary,o=>{const s={};try{K6&&this.ws.send(o)}catch{}i&&G4(()=>{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]=ED()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!L0}}class kse extends U4{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=dse(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=use();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).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&&G4(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const Pse={websocket:Ase,webtransport:kse,polling:Ese},Ise=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Mse=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function R5(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=Ise.exec(e||""),o={},s=14;for(;s--;)o[Mse[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Rse(o,o.path),o.queryKey=Ose(o,o.query),o}function Rse(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 Ose(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let kD=class Hu extends vn{constructor(t,n={}){super(),this.binaryType=Tse,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=R5(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=R5(n.host).host),f_(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=bse(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=xD,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 Pse[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hu.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;Hu.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;Hu.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),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,u(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Hu.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+=mse(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){Hu.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}};kD.protocol=xD;function $se(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=R5(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 Nse=typeof ArrayBuffer=="function",Fse=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,PD=Object.prototype.toString,Dse=typeof Blob=="function"||typeof Blob<"u"&&PD.call(Blob)==="[object BlobConstructor]",Lse=typeof File=="function"||typeof File<"u"&&PD.call(File)==="[object FileConstructor]";function H4(e){return Nse&&(e instanceof ArrayBuffer||Fse(e))||Dse&&e instanceof Blob||Lse&&e instanceof File}function Qy(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Qy(e[n]))return!0;return!1}if(H4(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Qy(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Qy(e[n]))return!0;return!1}function Bse(e){const t=[],n=e.data,r=e;return r.data=O5(n,t),r.attachments=t.length,{packet:r,buffers:t}}function O5(e,t){if(!e)return e;if(H4(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]=O5(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]=O5(e[r],t));return n}return e}function zse(e,t){return e.data=$5(e.data,t),delete e.attachments,e}function $5(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]=$5(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=$5(e[n],t));return e}const jse=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Vse=5;var Ye;(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"})(Ye||(Ye={}));class Use{constructor(t){this.replacer=t}encode(t){return(t.type===Ye.EVENT||t.type===Ye.ACK)&&Qy(t)?this.encodeAsBinary({type:t.type===Ye.EVENT?Ye.BINARY_EVENT:Ye.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ye.BINARY_EVENT||t.type===Ye.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=Bse(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Q6(e){return Object.prototype.toString.call(e)==="[object Object]"}class W4 extends vn{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===Ye.BINARY_EVENT;r||n.type===Ye.BINARY_ACK?(n.type=r?Ye.EVENT:Ye.ACK,this.reconstructor=new Gse(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(H4(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(Ye[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ye.BINARY_EVENT||r.type===Ye.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(W4.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 Ye.CONNECT:return Q6(n);case Ye.DISCONNECT:return n===void 0;case Ye.CONNECT_ERROR:return typeof n=="string"||Q6(n);case Ye.EVENT:case Ye.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&jse.indexOf(n[0])===-1);case Ye.ACK:case Ye.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Gse{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=zse(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Hse=Object.freeze(Object.defineProperty({__proto__:null,Decoder:W4,Encoder:Use,get PacketType(){return Ye},protocol:Vse},Symbol.toStringTag,{value:"Module"}));function _o(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Wse=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ID extends vn{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=[_o(t,"open",this.onopen.bind(this)),_o(t,"packet",this.onpacket.bind(this)),_o(t,"error",this.onerror.bind(this)),_o(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(Wse.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:Ye.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ye.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 Ye.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 Ye.EVENT:case Ye.BINARY_EVENT:this.onevent(t);break;case Ye.ACK:case Ye.BINARY_ACK:this.onack(t);break;case Ye.DISCONNECT:this.ondisconnect();break;case Ye.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:Ye.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:Ye.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 $f(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}$f.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};$f.prototype.reset=function(){this.attempts=0};$f.prototype.setMin=function(e){this.ms=e};$f.prototype.setMax=function(e){this.max=e};$f.prototype.setJitter=function(e){this.jitter=e};class N5 extends vn{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,f_(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 $f({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||Hse;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 kD(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=_o(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=_o(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(_o(t,"ping",this.onping.bind(this)),_o(t,"data",this.ondata.bind(this)),_o(t,"error",this.onerror.bind(this)),_o(t,"close",this.onclose.bind(this)),_o(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){G4(()=>{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 ID(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 hh={};function Yy(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$se(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=hh[i]&&o in hh[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new N5(r,t):(hh[i]||(hh[i]=new N5(r,t)),l=hh[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Yy,{Manager:N5,Socket:ID,io:Yy,connect:Yy});const g1=$X({}),Hx=to(!1),wze=()=>{const e=tN(),t=Ox(Yv),n=Ox(Qv),r=Ox(g1),i=I.useMemo(()=>{const s=window.location.protocol==="https:"?"wss":"ws";return t?t.replace(/^https?:\/\//i,""):`${s}://${window.location.host}`},[t]),o=I.useMemo(()=>{const s={timeout:6e4,path:"/ws/socket.io",autoConnect:!1,forceNew:!0};return n&&(s.auth={token:n},s.transports=["websocket","polling"]),{...s,...r}},[n,r]);I.useEffect(()=>{if(Hx.get())return;const s=Yy(i,o);return rse({dispatch:e,socket:s}),s.connect(),Zv.get()&&(window.$socketOptions=g1,console.log("Socket initialized",s)),Hx.set(!0),()=>{Zv.get()&&(window.$socketOptions=void 0,console.log("Socket teardown",s)),s.disconnect(),Hx.set(!1)}},[e,o,i])},Y6=to(void 0),Z6=to(void 0),F5=to(),MD=to(),B0=(e,t)=>Math.floor(e/t)*t,Or=(e,t)=>Math.round(e/t)*t,RD={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}}}},OD=jt({name:"config",initialState:RD,reducers:{configChanged:(e,t)=>{Id(e,t.payload)}}}),{configChanged:qse}=OD.actions,Kse=OD.reducer;let z0;const Xse=new Uint8Array(16);function Qse(){if(!z0&&(z0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!z0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z0(Xse)}const Qn=[];for(let e=0;e<256;++e)Qn.push((e+256).toString(16).slice(1));function Yse(e,t=0){return Qn[e[t+0]]+Qn[e[t+1]]+Qn[e[t+2]]+Qn[e[t+3]]+"-"+Qn[e[t+4]]+Qn[e[t+5]]+"-"+Qn[e[t+6]]+Qn[e[t+7]]+"-"+Qn[e[t+8]]+Qn[e[t+9]]+"-"+Qn[e[t+10]]+Qn[e[t+11]]+Qn[e[t+12]]+Qn[e[t+13]]+Qn[e[t+14]]+Qn[e[t+15]]}const Zse=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),J6={randomUUID:Zse};function ul(e,t,n){if(J6.randomUUID&&!t&&!e)return J6.randomUUID();e=e||{};const r=e.random||(e.rng||Qse)();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 Yse(r)}const hc={none:{type:"none",get label(){return Oe.t("controlnet.none")},get description(){return Oe.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return Oe.t("controlnet.canny")},get description(){return Oe.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 Oe.t("controlnet.colorMap")},get description(){return Oe.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 Oe.t("controlnet.contentShuffle")},get description(){return Oe.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 Oe.t("controlnet.hed")},get description(){return Oe.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 Oe.t("controlnet.lineartAnime")},get description(){return Oe.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 Oe.t("controlnet.lineart")},get description(){return Oe.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 Oe.t("controlnet.mediapipeFace")},get description(){return Oe.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 Oe.t("controlnet.depthMidas")},get description(){return Oe.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 Oe.t("controlnet.mlsd")},get description(){return Oe.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 Oe.t("controlnet.normalBae")},get description(){return Oe.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 Oe.t("controlnet.openPose")},get description(){return Oe.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 Oe.t("controlnet.pidi")},get description(){return Oe.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 Oe.t("controlnet.depthZoe")},get description(){return Oe.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},j0={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"},Jse={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:hc.canny_image_processor.default,shouldAutoConfig:!0},eae={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:hc.canny_image_processor.default,shouldAutoConfig:!0},tae={type:"ip_adapter",isEnabled:!0,controlImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},eI=(e,t,n={})=>{switch(t){case"controlnet":return Id(Ge(Jse),{id:e,...n});case"t2i_adapter":return Id(Ge(eae),{id:e,...n});case"ip_adapter":return Id(Ge(tae),{id:e,...n});default:throw new Error(`Unknown control adapter type: ${t}`)}},q4=he("controlAdapters/imageProcessed"),h_=e=>e.type==="controlnet",$D=e=>e.type==="ip_adapter",K4=e=>e.type==="t2i_adapter",hi=e=>h_(e)||K4(e),an=jo({selectId:e=>e.id}),{selectById:li,selectAll:As,selectEntities:Cze,selectIds:Eze,selectTotal:Tze}=an.getSelectors(),D5=an.getInitialState({pendingControlImages:[]}),nae=e=>As(e).filter(h_),rae=e=>As(e).filter(h_).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),iae=e=>As(e).filter($D),oae=e=>As(e).filter($D).filter(t=>t.isEnabled&&t.model&&!!t.controlImage),sae=e=>As(e).filter(K4),aae=e=>As(e).filter(K4).filter(t=>t.isEnabled&&t.model&&(!!t.processedControlImage||t.processorType==="none"&&!!t.controlImage)),ND=jt({name:"controlAdapters",initialState:D5,reducers:{controlAdapterAdded:{reducer:(e,t)=>{const{id:n,type:r,overrides:i}=t.payload;an.addOne(e,eI(n,r,i))},prepare:({type:e,overrides:t})=>({payload:{id:ul(),type:e,overrides:t}})},controlAdapterRecalled:(e,t)=>{an.addOne(e,t.payload)},controlAdapterDuplicated:{reducer:(e,t)=>{const{id:n,newId:r}=t.payload,i=li(e,n);if(!i)return;const o=Id(Ge(i),{id:r,isEnabled:!0});an.addOne(e,o)},prepare:e=>({payload:{id:e,newId:ul()}})},controlAdapterAddedFromImage:{reducer:(e,t)=>{const{id:n,type:r,controlImage:i}=t.payload;an.addOne(e,eI(n,r,{controlImage:i}))},prepare:e=>({payload:{...e,id:ul()}})},controlAdapterRemoved:(e,t)=>{an.removeOne(e,t.payload.id)},controlAdapterIsEnabledChanged:(e,t)=>{const{id:n,isEnabled:r}=t.payload;an.updateOne(e,{id:n,changes:{isEnabled:r}})},controlAdapterImageChanged:(e,t)=>{const{id:n,controlImage:r}=t.payload,i=li(e,n);i&&(an.updateOne(e,{id:n,changes:{controlImage:r,processedControlImage:null}}),r!==null&&hi(i)&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlAdapterProcessedImageChanged:(e,t)=>{const{id:n,processedControlImage:r}=t.payload,i=li(e,n);i&&hi(i)&&(an.updateOne(e,{id:n,changes:{processedControlImage:r}}),e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlAdapterModelCleared:(e,t)=>{an.updateOne(e,{id:t.payload.id,changes:{model:null}})},controlAdapterModelChanged:(e,t)=>{const{id:n,model:r}=t.payload,i=li(e,n);if(!i)return;if(!hi(i)){an.updateOne(e,{id:n,changes:{model:r}});return}const o={id:n,changes:{model:r}};if(o.changes.processedControlImage=null,i.shouldAutoConfig){let s;for(const a in j0)if(r.model_name.includes(a)){s=j0[a];break}s?(o.changes.processorType=s,o.changes.processorNode=hc[s].default):(o.changes.processorType="none",o.changes.processorNode=hc.none.default)}an.updateOne(e,o)},controlAdapterWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload;an.updateOne(e,{id:n,changes:{weight:r}})},controlAdapterBeginStepPctChanged:(e,t)=>{const{id:n,beginStepPct:r}=t.payload;an.updateOne(e,{id:n,changes:{beginStepPct:r}})},controlAdapterEndStepPctChanged:(e,t)=>{const{id:n,endStepPct:r}=t.payload;an.updateOne(e,{id:n,changes:{endStepPct:r}})},controlAdapterControlModeChanged:(e,t)=>{const{id:n,controlMode:r}=t.payload,i=li(e,n);!i||!h_(i)||an.updateOne(e,{id:n,changes:{controlMode:r}})},controlAdapterResizeModeChanged:(e,t)=>{const{id:n,resizeMode:r}=t.payload,i=li(e,n);!i||!hi(i)||an.updateOne(e,{id:n,changes:{resizeMode:r}})},controlAdapterProcessorParamsChanged:(e,t)=>{const{id:n,params:r}=t.payload,i=li(e,n);if(!i||!hi(i)||!i.processorNode)return;const o=Id(Ge(i.processorNode),r);an.updateOne(e,{id:n,changes:{shouldAutoConfig:!1,processorNode:o}})},controlAdapterProcessortTypeChanged:(e,t)=>{const{id:n,processorType:r}=t.payload,i=li(e,n);if(!i||!hi(i))return;const o=Ge(hc[r].default);an.updateOne(e,{id:n,changes:{processorType:r,processedControlImage:null,processorNode:o,shouldAutoConfig:!1}})},controlAdapterAutoConfigToggled:(e,t)=>{var o;const{id:n}=t.payload,r=li(e,n);if(!r||!hi(r))return;const i={id:n,changes:{shouldAutoConfig:!r.shouldAutoConfig}};if(i.changes.shouldAutoConfig){let s;for(const a in j0)if((o=r.model)!=null&&o.model_name.includes(a)){s=j0[a];break}s?(i.changes.processorType=s,i.changes.processorNode=hc[s].default):(i.changes.processorType="none",i.changes.processorNode=hc.none.default)}an.updateOne(e,i)},controlAdaptersReset:()=>Ge(D5),pendingControlImagesCleared:e=>{e.pendingControlImages=[]}},extraReducers:e=>{e.addCase(q4,(t,n)=>{const r=li(t,n.payload.id);r&&r.controlImage!==null&&(t.pendingControlImages=Woe(t.pendingControlImages.concat(n.payload.id)))}),e.addCase(u_,t=>{t.pendingControlImages=[]})}}),{controlAdapterAdded:lae,controlAdapterRecalled:cae,controlAdapterDuplicated:Aze,controlAdapterAddedFromImage:uae,controlAdapterRemoved:kze,controlAdapterImageChanged:Nl,controlAdapterProcessedImageChanged:X4,controlAdapterIsEnabledChanged:Q4,controlAdapterModelChanged:tI,controlAdapterWeightChanged:Pze,controlAdapterBeginStepPctChanged:Ize,controlAdapterEndStepPctChanged:Mze,controlAdapterControlModeChanged:Rze,controlAdapterResizeModeChanged:Oze,controlAdapterProcessorParamsChanged:dae,controlAdapterProcessortTypeChanged:fae,controlAdaptersReset:hae,controlAdapterAutoConfigToggled:nI,pendingControlImagesCleared:pae,controlAdapterModelCleared:Wx}=ND.actions,gae=ND.reducer,mae=br(lae,uae,cae),$ze={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},Nze={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},yae={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]}},Fze={lycoris:"LyCORIS",diffusers:"Diffusers"},Dze={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"},vae=0,mp=4294967295;var st;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(st||(st={}));var L5;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(L5||(L5={}));const de=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wa=e=>{switch(typeof e){case"undefined":return de.undefined;case"string":return de.string;case"number":return isNaN(e)?de.nan:de.number;case"boolean":return de.boolean;case"function":return de.function;case"bigint":return de.bigint;case"symbol":return de.symbol;case"object":return Array.isArray(e)?de.array:e===null?de.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?de.promise:typeof Map<"u"&&e instanceof Map?de.map:typeof Set<"u"&&e instanceof Set?de.set:typeof Date<"u"&&e instanceof Date?de.date:de.object;default:return de.unknown}},re=st.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"]),bae=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Io extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.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()}}Io.create=e=>new Io(e);const sg=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===de.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,st.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${st.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${st.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${st.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.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}"`:st.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.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 re.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 re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,st.assertNever(e)}return{message:n}};let FD=sg;function _ae(e){FD=e}function m1(){return FD}const y1=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},Sae=[];function ge(e,t){const n=y1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m1(),sg].filter(r=>!!r)});e.common.issues.push(n)}class Sr{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 Ne;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 Sr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Ne;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const Ne=Object.freeze({status:"aborted"}),DD=e=>({status:"dirty",value:e}),Dr=e=>({status:"valid",value:e}),B5=e=>e.status==="aborted",z5=e=>e.status==="dirty",ag=e=>e.status==="valid",v1=e=>typeof Promise<"u"&&e instanceof Promise;var ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ke||(ke={}));class xs{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 rI=(e,t)=>{if(ag(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 Io(e.common.issues);return this._error=n,this._error}}};function Fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class De{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 Wa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Wa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Sr,ctx:{common:t.parent.common,data:t.data,parsedType:Wa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(v1(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:Wa(t)},o=this._parseSync({data:t,path:i.path,parent:i});return rI(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:Wa(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(v1(i)?i:Promise.resolve(i));return rI(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:re.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Do({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ea.create(this,this._def)}nullable(){return eu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mo.create(this,this._def)}promise(){return uf.create(this,this._def)}or(t){return dg.create([this,t],this._def)}and(t){return fg.create(this,t,this._def)}transform(t){return new Do({...Fe(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new yg({...Fe(this._def),innerType:this,defaultValue:n,typeName:Ie.ZodDefault})}brand(){return new BD({typeName:Ie.ZodBranded,type:this,...Fe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new x1({...Fe(this._def),innerType:this,catchValue:n,typeName:Ie.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return gm.create(this,t)}readonly(){return C1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xae=/^c[^\s-]{8,}$/i,wae=/^[a-z][a-z0-9]*$/,Cae=/^[0-9A-HJKMNP-TV-Z]{26}$/,Eae=/^[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,Tae=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Aae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let qx;const kae=/^(((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}))$/,Pae=/^(([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})))$/,Iae=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 Mae(e,t){return!!((t==="v4"||!t)&&kae.test(e)||(t==="v6"||!t)&&Pae.test(e))}class To extends De{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==de.string){const o=this._getOrReturnCtx(t);return ge(o,{code:re.invalid_type,expected:de.string,received:o.parsedType}),Ne}const r=new Sr;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ge(i,{code:re.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),ge(i,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?ge(i,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ge(i,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Tae.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"email",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")qx||(qx=new RegExp(Aae,"u")),qx.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"emoji",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Eae.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"uuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")xae.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"cuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")wae.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"cuid2",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Cae.test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"ulid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ge(i,{validation:"url",code:re.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),ge(i,{validation:"regex",code:re.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),ge(i,{code:re.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),ge(i,{code:re.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ge(i,{code:re.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Iae(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ge(i,{code:re.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Mae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ge(i,{validation:"ip",code:re.invalid_string,message:o.message}),r.dirty()):st.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:re.invalid_string,...ke.errToObj(r)})}_addCheck(t){return new To({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ke.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,...ke.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ke.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ke.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ke.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ke.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ke.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ke.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ke.errToObj(n)})}nonempty(t){return this.min(1,ke.errToObj(t))}trim(){return new To({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new To({...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}}To.create=e=>{var t;return new To({checks:[],typeName:Ie.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};function Rae(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Sl extends De{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)!==de.number){const o=this._getOrReturnCtx(t);return ge(o,{code:re.invalid_type,expected:de.number,received:o.parsedType}),Ne}let r;const i=new Sr;for(const o of this._def.checks)o.kind==="int"?st.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:re.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),ge(r,{code:re.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),ge(r,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Rae(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ge(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ge(r,{code:re.not_finite,message:o.message}),i.dirty()):st.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,r,i){return new Sl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ke.toString(i)}]})}_addCheck(t){return new Sl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.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"&&st.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)}}Sl.create=e=>new Sl({checks:[],typeName:Ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class xl extends De{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)!==de.bigint){const o=this._getOrReturnCtx(t);return ge(o,{code:re.invalid_type,expected:de.bigint,received:o.parsedType}),Ne}let r;const i=new Sr;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),ge(r,{code:re.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),ge(r,{code:re.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),ge(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):st.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ke.toString(n))}setLimit(t,n,r,i){return new xl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ke.toString(i)}]})}_addCheck(t){return new xl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ke.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}}xl.create=e=>{var t;return new xl({checks:[],typeName:Ie.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};class lg extends De{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==de.boolean){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.boolean,received:r.parsedType}),Ne}return Dr(t.data)}}lg.create=e=>new lg({typeName:Ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class Zc extends De{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==de.date){const o=this._getOrReturnCtx(t);return ge(o,{code:re.invalid_type,expected:de.date,received:o.parsedType}),Ne}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ge(o,{code:re.invalid_date}),Ne}const r=new Sr;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ge(i,{code:re.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),ge(i,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):st.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Zc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ke.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ke.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}}Zc.create=e=>new Zc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...Fe(e)});class b1 extends De{_parse(t){if(this._getType(t)!==de.symbol){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.symbol,received:r.parsedType}),Ne}return Dr(t.data)}}b1.create=e=>new b1({typeName:Ie.ZodSymbol,...Fe(e)});class cg extends De{_parse(t){if(this._getType(t)!==de.undefined){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.undefined,received:r.parsedType}),Ne}return Dr(t.data)}}cg.create=e=>new cg({typeName:Ie.ZodUndefined,...Fe(e)});class ug extends De{_parse(t){if(this._getType(t)!==de.null){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.null,received:r.parsedType}),Ne}return Dr(t.data)}}ug.create=e=>new ug({typeName:Ie.ZodNull,...Fe(e)});class cf extends De{constructor(){super(...arguments),this._any=!0}_parse(t){return Dr(t.data)}}cf.create=e=>new cf({typeName:Ie.ZodAny,...Fe(e)});class Oc extends De{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Dr(t.data)}}Oc.create=e=>new Oc({typeName:Ie.ZodUnknown,...Fe(e)});class ua extends De{_parse(t){const n=this._getOrReturnCtx(t);return ge(n,{code:re.invalid_type,expected:de.never,received:n.parsedType}),Ne}}ua.create=e=>new ua({typeName:Ie.ZodNever,...Fe(e)});class _1 extends De{_parse(t){if(this._getType(t)!==de.undefined){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.void,received:r.parsedType}),Ne}return Dr(t.data)}}_1.create=e=>new _1({typeName:Ie.ZodVoid,...Fe(e)});class Mo extends De{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==de.array)return ge(n,{code:re.invalid_type,expected:de.array,received:n.parsedType}),Ne;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(ge(n,{code:s?re.too_big:re.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ge(n,{code:re.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&&(ge(n,{code:re.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new xs(n,s,n.path,a)))).then(s=>Sr.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new xs(n,s,n.path,a)));return Sr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Mo({...this._def,minLength:{value:t,message:ke.toString(n)}})}max(t,n){return new Mo({...this._def,maxLength:{value:t,message:ke.toString(n)}})}length(t,n){return new Mo({...this._def,exactLength:{value:t,message:ke.toString(n)}})}nonempty(t){return this.min(1,t)}}Mo.create=(e,t)=>new Mo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...Fe(t)});function Wu(e){if(e instanceof Gt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ea.create(Wu(r))}return new Gt({...e._def,shape:()=>t})}else return e instanceof Mo?new Mo({...e._def,type:Wu(e.element)}):e instanceof ea?ea.create(Wu(e.unwrap())):e instanceof eu?eu.create(Wu(e.unwrap())):e instanceof ws?ws.create(e.items.map(t=>Wu(t))):e}class Gt extends De{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=st.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==de.object){const c=this._getOrReturnCtx(t);return ge(c,{code:re.invalid_type,expected:de.object,received:c.parsedType}),Ne}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ua&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new xs(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ua){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(ge(i,{code:re.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new xs(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>Sr.mergeObjectSync(r,c)):Sr.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ke.errToObj,new Gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ke.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Gt({...this._def,unknownKeys:"strip"})}passthrough(){return new Gt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Gt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Gt({...this._def,catchall:t})}pick(t){const n={};return st.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Gt({...this._def,shape:()=>n})}omit(t){const n={};return st.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Gt({...this._def,shape:()=>n})}deepPartial(){return Wu(this)}partial(t){const n={};return st.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Gt({...this._def,shape:()=>n})}required(t){const n={};return st.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ea;)o=o._def.innerType;n[r]=o}}),new Gt({...this._def,shape:()=>n})}keyof(){return LD(st.objectKeys(this.shape))}}Gt.create=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strip",catchall:ua.create(),typeName:Ie.ZodObject,...Fe(t)});Gt.strictCreate=(e,t)=>new Gt({shape:()=>e,unknownKeys:"strict",catchall:ua.create(),typeName:Ie.ZodObject,...Fe(t)});Gt.lazycreate=(e,t)=>new Gt({shape:e,unknownKeys:"strip",catchall:ua.create(),typeName:Ie.ZodObject,...Fe(t)});class dg extends De{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Io(a.ctx.common.issues));return ge(n,{code:re.invalid_union,unionErrors:s}),Ne}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Io(l));return ge(n,{code:re.invalid_union,unionErrors:a}),Ne}}get options(){return this._def.options}}dg.create=(e,t)=>new dg({options:e,typeName:Ie.ZodUnion,...Fe(t)});const Zy=e=>e instanceof pg?Zy(e.schema):e instanceof Do?Zy(e.innerType()):e instanceof gg?[e.value]:e instanceof wl?e.options:e instanceof mg?Object.keys(e.enum):e instanceof yg?Zy(e._def.innerType):e instanceof cg?[void 0]:e instanceof ug?[null]:null;class p_ extends De{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.object)return ge(n,{code:re.invalid_type,expected:de.object,received:n.parsedType}),Ne;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}):(ge(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ne)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=Zy(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new p_({typeName:Ie.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Fe(r)})}}function j5(e,t){const n=Wa(e),r=Wa(t);if(e===t)return{valid:!0,data:e};if(n===de.object&&r===de.object){const i=st.objectKeys(t),o=st.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=j5(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===de.array&&r===de.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],l=j5(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===de.date&&r===de.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fg extends De{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(B5(o)||B5(s))return Ne;const a=j5(o.value,s.value);return a.valid?((z5(o)||z5(s))&&n.dirty(),{status:n.value,value:a.data}):(ge(r,{code:re.invalid_intersection_types}),Ne)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}fg.create=(e,t,n)=>new fg({left:e,right:t,typeName:Ie.ZodIntersection,...Fe(n)});class ws extends De{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.array)return ge(r,{code:re.invalid_type,expected:de.array,received:r.parsedType}),Ne;if(r.data.length<this._def.items.length)return ge(r,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ne;!this._def.rest&&r.data.length>this._def.items.length&&(ge(r,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new xs(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Sr.mergeArray(n,s)):Sr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ws({...this._def,rest:t})}}ws.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ws({items:e,typeName:Ie.ZodTuple,rest:null,...Fe(t)})};class hg extends De{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!==de.object)return ge(r,{code:re.invalid_type,expected:de.object,received:r.parsedType}),Ne;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new xs(r,a,r.path,a)),value:s._parse(new xs(r,r.data[a],r.path,a))});return r.common.async?Sr.mergeObjectAsync(n,i):Sr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof De?new hg({keyType:t,valueType:n,typeName:Ie.ZodRecord,...Fe(r)}):new hg({keyType:To.create(),valueType:t,typeName:Ie.ZodRecord,...Fe(n)})}}class S1 extends De{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!==de.map)return ge(r,{code:re.invalid_type,expected:de.map,received:r.parsedType}),Ne;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new xs(r,a,r.path,[c,"key"])),value:o._parse(new xs(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}S1.create=(e,t,n)=>new S1({valueType:t,keyType:e,typeName:Ie.ZodMap,...Fe(n)});class Jc extends De{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==de.set)return ge(r,{code:re.invalid_type,expected:de.set,received:r.parsedType}),Ne;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ge(r,{code:re.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&&(ge(r,{code:re.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ne;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new xs(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new Jc({...this._def,minSize:{value:t,message:ke.toString(n)}})}max(t,n){return new Jc({...this._def,maxSize:{value:t,message:ke.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Jc.create=(e,t)=>new Jc({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...Fe(t)});class Rd extends De{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.function)return ge(n,{code:re.invalid_type,expected:de.function,received:n.parsedType}),Ne;function r(a,l){return y1({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,m1(),sg].filter(c=>!!c),issueData:{code:re.invalid_arguments,argumentsError:l}})}function i(a,l){return y1({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,m1(),sg].filter(c=>!!c),issueData:{code:re.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof uf){const a=this;return Dr(async function(...l){const c=new Io([]),u=await a._def.args.parseAsync(l,o).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(h=>{throw c.addIssue(i(d,h)),c})})}else{const a=this;return Dr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Io([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Io([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Rd({...this._def,args:ws.create(t).rest(Oc.create())})}returns(t){return new Rd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Rd({args:t||ws.create([]).rest(Oc.create()),returns:n||Oc.create(),typeName:Ie.ZodFunction,...Fe(r)})}}class pg extends De{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})}}pg.create=(e,t)=>new pg({getter:e,typeName:Ie.ZodLazy,...Fe(t)});class gg extends De{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ge(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),Ne}return{status:"valid",value:t.data}}get value(){return this._def.value}}gg.create=(e,t)=>new gg({value:e,typeName:Ie.ZodLiteral,...Fe(t)});function LD(e,t){return new wl({values:e,typeName:Ie.ZodEnum,...Fe(t)})}class wl extends De{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ge(n,{expected:st.joinValues(r),received:n.parsedType,code:re.invalid_type}),Ne}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ge(n,{received:n.data,code:re.invalid_enum_value,options:r}),Ne}return Dr(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 wl.create(t)}exclude(t){return wl.create(this.options.filter(n=>!t.includes(n)))}}wl.create=LD;class mg extends De{_parse(t){const n=st.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==de.string&&r.parsedType!==de.number){const i=st.objectValues(n);return ge(r,{expected:st.joinValues(i),received:r.parsedType,code:re.invalid_type}),Ne}if(n.indexOf(t.data)===-1){const i=st.objectValues(n);return ge(r,{received:r.data,code:re.invalid_enum_value,options:i}),Ne}return Dr(t.data)}get enum(){return this._def.values}}mg.create=(e,t)=>new mg({values:e,typeName:Ie.ZodNativeEnum,...Fe(t)});class uf extends De{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.promise&&n.common.async===!1)return ge(n,{code:re.invalid_type,expected:de.promise,received:n.parsedType}),Ne;const r=n.parsedType===de.promise?n.data:Promise.resolve(n.data);return Dr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}uf.create=(e,t)=>new uf({type:e,typeName:Ie.ZodPromise,...Fe(t)});class Do extends De{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.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:s=>{ge(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ag(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ag(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);st.assertNever(i)}}Do.create=(e,t,n)=>new Do({schema:e,typeName:Ie.ZodEffects,effect:t,...Fe(n)});Do.createWithPreprocess=(e,t,n)=>new Do({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...Fe(n)});class ea extends De{_parse(t){return this._getType(t)===de.undefined?Dr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ea.create=(e,t)=>new ea({innerType:e,typeName:Ie.ZodOptional,...Fe(t)});class eu extends De{_parse(t){return this._getType(t)===de.null?Dr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:Ie.ZodNullable,...Fe(t)});class yg extends De{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===de.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yg.create=(e,t)=>new yg({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});class x1 extends De{_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 v1(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}x1.create=(e,t)=>new x1({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});class w1 extends De{_parse(t){if(this._getType(t)!==de.nan){const r=this._getOrReturnCtx(t);return ge(r,{code:re.invalid_type,expected:de.nan,received:r.parsedType}),Ne}return{status:"valid",value:t.data}}}w1.create=e=>new w1({typeName:Ie.ZodNaN,...Fe(e)});const Oae=Symbol("zod_brand");class BD extends De{_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 gm extends De{_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"?Ne:o.status==="dirty"?(n.dirty(),DD(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"?Ne: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 gm({in:t,out:n,typeName:Ie.ZodPipeline})}}class C1 extends De{_parse(t){const n=this._def.innerType._parse(t);return ag(n)&&(n.value=Object.freeze(n.value)),n}}C1.create=(e,t)=>new C1({innerType:e,typeName:Ie.ZodReadonly,...Fe(t)});const zD=(e,t={},n)=>e?cf.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):cf.create(),$ae={object:Gt.lazycreate};var Ie;(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"})(Ie||(Ie={}));const Nae=(e,t={message:`Input not instance of ${e.name}`})=>zD(n=>n instanceof e,t),jD=To.create,VD=Sl.create,Fae=w1.create,Dae=xl.create,UD=lg.create,Lae=Zc.create,Bae=b1.create,zae=cg.create,jae=ug.create,Vae=cf.create,Uae=Oc.create,Gae=ua.create,Hae=_1.create,Wae=Mo.create,qae=Gt.create,Kae=Gt.strictCreate,Xae=dg.create,Qae=p_.create,Yae=fg.create,Zae=ws.create,Jae=hg.create,ele=S1.create,tle=Jc.create,nle=Rd.create,rle=pg.create,ile=gg.create,ole=wl.create,sle=mg.create,ale=uf.create,iI=Do.create,lle=ea.create,cle=eu.create,ule=Do.createWithPreprocess,dle=gm.create,fle=()=>jD().optional(),hle=()=>VD().optional(),ple=()=>UD().optional(),gle={string:e=>To.create({...e,coerce:!0}),number:e=>Sl.create({...e,coerce:!0}),boolean:e=>lg.create({...e,coerce:!0}),bigint:e=>xl.create({...e,coerce:!0}),date:e=>Zc.create({...e,coerce:!0})},mle=Ne;var T=Object.freeze({__proto__:null,defaultErrorMap:sg,setErrorMap:_ae,getErrorMap:m1,makeIssue:y1,EMPTY_PATH:Sae,addIssueToContext:ge,ParseStatus:Sr,INVALID:Ne,DIRTY:DD,OK:Dr,isAborted:B5,isDirty:z5,isValid:ag,isAsync:v1,get util(){return st},get objectUtil(){return L5},ZodParsedType:de,getParsedType:Wa,ZodType:De,ZodString:To,ZodNumber:Sl,ZodBigInt:xl,ZodBoolean:lg,ZodDate:Zc,ZodSymbol:b1,ZodUndefined:cg,ZodNull:ug,ZodAny:cf,ZodUnknown:Oc,ZodNever:ua,ZodVoid:_1,ZodArray:Mo,ZodObject:Gt,ZodUnion:dg,ZodDiscriminatedUnion:p_,ZodIntersection:fg,ZodTuple:ws,ZodRecord:hg,ZodMap:S1,ZodSet:Jc,ZodFunction:Rd,ZodLazy:pg,ZodLiteral:gg,ZodEnum:wl,ZodNativeEnum:mg,ZodPromise:uf,ZodEffects:Do,ZodTransformer:Do,ZodOptional:ea,ZodNullable:eu,ZodDefault:yg,ZodCatch:x1,ZodNaN:w1,BRAND:Oae,ZodBranded:BD,ZodPipeline:gm,ZodReadonly:C1,custom:zD,Schema:De,ZodSchema:De,late:$ae,get ZodFirstPartyTypeKind(){return Ie},coerce:gle,any:Vae,array:Wae,bigint:Dae,boolean:UD,date:Lae,discriminatedUnion:Qae,effect:iI,enum:ole,function:nle,instanceof:Nae,intersection:Yae,lazy:rle,literal:ile,map:ele,nan:Fae,nativeEnum:sle,never:Gae,null:jae,nullable:cle,number:VD,object:qae,oboolean:ple,onumber:hle,optional:lle,ostring:fle,pipeline:dle,preprocess:ule,promise:ale,record:Jae,set:tle,strictObject:Kae,string:jD,symbol:Bae,transformer:iI,tuple:Zae,undefined:zae,union:Xae,unknown:Uae,void:Hae,NEVER:mle,ZodIssueCode:re,quotelessJson:bae,ZodError:Io});const mm=T.object({image_name:T.string().trim().min(1)}),yle=T.object({board_id:T.string().trim().min(1)}),vle=T.object({r:T.number().int().min(0).max(255),g:T.number().int().min(0).max(255),b:T.number().int().min(0).max(255),a:T.number().int().min(0).max(255)}),ble=T.enum(["stable","beta","prototype"]),GD=T.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"]),Y4=T.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),_le=T.enum(["onnx","main","vae","lora","controlnet","embedding"]),Z4=T.string().trim().min(1),Nf=T.object({model_name:Z4,base_model:Y4}),HD=T.object({model_name:Z4,base_model:Y4,model_type:T.literal("main")}),WD=T.object({model_name:Z4,base_model:Y4,model_type:T.literal("onnx")}),qD=T.union([HD,WD]),KD=T.object({model_name:T.string().min(1),base_model:T.literal("sdxl-refiner"),model_type:T.literal("main")}),Sle=T.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),J4=Nf,df=Nf.extend({model_type:_le,submodel:Sle.optional()}),eT=Nf,tT=Nf,nT=Nf,rT=Nf,XD=df.extend({weight:T.number().optional()});T.object({unet:df,scheduler:df,loras:T.array(XD)});T.object({tokenizer:df,text_encoder:df,skipped_layers:T.number(),loras:T.array(XD)});T.object({vae:df});const xle=T.object({image:mm,control_model:tT,control_weight:T.union([T.number(),T.array(T.number())]).optional(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional(),control_mode:T.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:T.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),wle=T.object({image:mm,ip_adapter_model:nT,weight:T.number(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional()}),Cle=T.object({image:mm,t2i_adapter_model:rT,weight:T.union([T.number(),T.array(T.number())]).optional(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional(),resize_mode:T.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),Ele=T.object({dataURL:T.string(),width:T.number().int(),height:T.number().int()}),Tle=T.object({image:mm,width:T.number().int().gt(0),height:T.number().int().gt(0),type:T.literal("image_output")}),QD=e=>Tle.safeParse(e).success,Ale=T.string(),Lze=e=>Ale.safeParse(e).success,kle=T.string(),Bze=e=>kle.safeParse(e).success,Ple=T.string(),zze=e=>Ple.safeParse(e).success,Ile=T.string(),jze=e=>Ile.safeParse(e).success,Mle=T.number().int().min(1),Vze=e=>Mle.safeParse(e).success,Rle=T.number().min(1),Uze=e=>Rle.safeParse(e).success,Ole=T.number().gte(0).lt(1),Gze=e=>Ole.safeParse(e).success,$le=GD,Hze=e=>$le.safeParse(e).success,Nle=T.number().int().min(0).max(mp),Wze=e=>Nle.safeParse(e).success,YD=T.number().multipleOf(8).min(64),qze=e=>YD.safeParse(e).success,Fle=YD,Kze=e=>Fle.safeParse(e).success,g_=qD,Xze=e=>g_.safeParse(e).success,ZD=KD,Qze=e=>ZD.safeParse(e).success,JD=J4,Yze=e=>JD.safeParse(e).success,Dle=eT,Zze=e=>Dle.safeParse(e).success,Lle=tT,Jze=e=>Lle.safeParse(e).success,Ble=nT,eje=e=>Ble.safeParse(e).success,zle=rT,tje=e=>zle.safeParse(e).success,jle=T.number().min(0).max(1),nje=e=>jle.safeParse(e).success;T.enum(["fp16","fp32"]);const Vle=T.enum(["ESRGAN","bilinear"]),rje=e=>Vle.safeParse(e).success,Ule=T.boolean(),ije=e=>Ule.safeParse(e).success&&e!==null&&e!==void 0,eL=T.number().min(1).max(10),oje=e=>eL.safeParse(e).success,Gle=eL,sje=e=>Gle.safeParse(e).success,Hle=T.number().min(0).max(1),aje=e=>Hle.safeParse(e).success;T.enum(["box","gaussian"]);T.enum(["unmasked","mask","edge"]);const iT={hrfStrength:.45,hrfEnabled:!1,hrfMethod:"ESRGAN",cfgScale:7.5,cfgRescaleMultiplier:0,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},Wle=iT,tL=jt({name:"generation",initialState:Wle,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=el(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=el(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setCfgRescaleMultiplier:(e,t)=>{e.cfgRescaleMultiplier=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,...iT}),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}=yae[e.model.base_model];e.clipSkip=el(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=Or(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(qse,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,s,a]=r.split("/"),l=g_.safeParse({model_name:a,base_model:o,model_type:s});l.success&&(t.model=l.data)}}),e.addMatcher(mae,(t,n)=>{n.payload.type==="t2i_adapter"&&(t.width=Or(t.width,64),t.height=Or(t.height,64))})}}),{clampSymmetrySteps:lje,clearInitialImage:oT,resetParametersState:cje,resetSeed:uje,setCfgScale:dje,setCfgRescaleMultiplier:fje,setWidth:oI,setHeight:sI,toggleSize:hje,setImg2imgStrength:pje,setInfillMethod:qle,setIterations:gje,setPerlin:mje,setPositivePrompt:Kle,setNegativePrompt:yje,setScheduler:vje,setMaskBlur:bje,setMaskBlurMethod:_je,setCanvasCoherenceMode:Sje,setCanvasCoherenceSteps:xje,setCanvasCoherenceStrength:wje,setSeed:Cje,setSeedWeights:Eje,setShouldFitToWidthHeight:Tje,setShouldGenerateVariations:Aje,setShouldRandomizeSeed:kje,setSteps:Pje,setThreshold:Ije,setInfillTileSize:Mje,setInfillPatchmatchDownscaleSize:Rje,setVariationAmount:Oje,setShouldUseSymmetry:$je,setHorizontalSymmetrySteps:Nje,setVerticalSymmetrySteps:Fje,initialImageChanged:m_,modelChanged:tl,vaeSelected:nL,setSeamlessXAxis:Dje,setSeamlessYAxis:Lje,setClipSkip:Bje,setHrfEnabled:zje,setHrfStrength:jje,setHrfMethod:Vje,shouldUseCpuNoiseChanged:Uje,setAspectRatio:Xle,setShouldLockAspectRatio:Gje,vaePrecisionChanged:Hje}=tL.actions,Qle=tL.reducer,V0=(e,t,n,r,i,o,s)=>{const a=Math.floor(e/2-(n+i/2)*s),l=Math.floor(t/2-(r+o/2)*s);return{x:a,y:l}},U0=(e,t,n,r,i=.95)=>{const o=e*i/n,s=t*i/r,a=Math.min(1,Math.min(o,s));return a||1},Wje=.999,qje=.1,Kje=20,G0=.95,Xje=30,Qje=10,Yle=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Iu=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let s=t*n,a=448;for(;s<i;)if(a+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=a,r.height=Or(a/o,64)):o<1&&(r.height=a,r.width=Or(a*o,64)),s=r.width*r.height;return r},Zle=e=>({width:Or(e.width,64),height:Or(e.height,64)}),Yje=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],Zje=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],rL=e=>e.kind==="line"&&e.layer==="mask",Jje=e=>e.kind==="line"&&e.layer==="base",Jle=e=>e.kind==="image"&&e.layer==="base",eVe=e=>e.kind==="fillRect"&&e.layer==="base",tVe=e=>e.kind==="eraseRect"&&e.layer==="base",ece=e=>e.kind==="line",tce={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},nce=tce,iL=jt({name:"queue",initialState:nce,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:nVe,listPriorityChanged:rVe,listParamsReset:rce,queueItemSelectionToggled:iVe,resumeProcessorOnEnqueueChanged:oVe}=iL.actions,ice=iL.reducer,oL="%[a-f0-9]{2}",aI=new RegExp("("+oL+")|([^%]+?)","gi"),lI=new RegExp("("+oL+")+","gi");function V5(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([],V5(n),V5(r))}function oce(e){try{return decodeURIComponent(e)}catch{let t=e.match(aI)||[];for(let n=1;n<t.length;n++)e=V5(t,n).join(""),t=e.match(aI)||[];return e}}function sce(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=lI.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=oce(n[0]);i!==n[0]&&(t[n[0]]=i)}n=lI.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 ace(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return sce(e)}}function sL(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 lce(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 cce=e=>e==null,uce=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),U5=Symbol("encodeFragmentIdentifier");function dce(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,[pn(t,e),"[",i,"]"].join("")]:[...n,[pn(t,e),"[",pn(i,e),"]=",pn(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[pn(t,e),"[]"].join("")]:[...n,[pn(t,e),"[]=",pn(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,[pn(t,e),":list="].join("")]:[...n,[pn(t,e),":list=",pn(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?[[pn(n,e),t,pn(i,e)].join("")]:[[r,pn(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,pn(t,e)]:[...n,[pn(t,e),"=",pn(r,e)].join("")]}}function fce(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),s=typeof r=="string"&&!o&&zs(r,e).includes(e.arrayFormatSeparator);r=s?zs(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>zs(l,e)):r===null?r:zs(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&zs(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>zs(a,e));if(i[n]===void 0){i[n]=s;return}i[n]=[...i[n],...s]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function aL(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function pn(e,t){return t.encode?t.strict?uce(e):encodeURIComponent(e):e}function zs(e,t){return t.decode?ace(e):e}function lL(e){return Array.isArray(e)?e.sort():typeof e=="object"?lL(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function cL(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function hce(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function cI(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 sT(e){e=cL(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function aT(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},aL(t.arrayFormatSeparator);const n=fce(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replace(/\+/g," "):i;let[s,a]=sL(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:zs(a,t),n(zs(s,t),a,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[s,a]of Object.entries(o))o[s]=cI(a,t);else r[i]=cI(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const s=r[o];return s&&typeof s=="object"&&!Array.isArray(s)?i[o]=lL(s):i[o]=s,i},Object.create(null))}function uL(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},aL(t.arrayFormatSeparator);const n=s=>t.skipNull&&cce(e[s])||t.skipEmptyString&&e[s]==="",r=dce(t),i={};for(const[s,a]of Object.entries(e))n(s)||(i[s]=a);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(s=>{const a=e[s];return a===void 0?"":a===null?pn(s,t):Array.isArray(a)?a.length===0&&t.arrayFormat==="bracket-separator"?pn(s,t)+"[]":a.reduce(r(s),[]).join("&"):pn(s,t)+"="+pn(a,t)}).filter(s=>s.length>0).join("&")}function dL(e,t){var i;t={decode:!0,...t};let[n,r]=sL(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:aT(sT(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:zs(r,t)}:{}}}function fL(e,t){t={encode:!0,strict:!0,[U5]:!0,...t};const n=cL(e.url).split("?")[0]||"",r=sT(e.url),i={...aT(r,{sort:!1}),...e.query};let o=uL(i,t);o&&(o=`?${o}`);let s=hce(e.url);if(e.fragmentIdentifier){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[U5]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function hL(e,t,n){n={parseFragmentIdentifier:!0,[U5]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=dL(e,n);return fL({url:r,query:lce(i,t),fragmentIdentifier:o},n)}function pce(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return hL(e,r,n)}const yp=Object.freeze(Object.defineProperty({__proto__:null,exclude:pce,extract:sT,parse:aT,parseUrl:dL,pick:hL,stringify:uL,stringifyUrl:fL},Symbol.toStringTag,{value:"Module"}));var pL=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(pL||{});function gce(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}function mce(e){return new RegExp("(^|:)//").test(e)}var yce=e=>e.replace(/\/$/,""),vce=e=>e.replace(/^\//,"");function bce(e,t){if(!e)return t;if(!t)return e;if(mce(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=yce(e),t=vce(t),`${e}${n}${t}`}var uI=e=>[].concat(...e);function _ce(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Sce(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var dI=_s;function gL(e,t){if(e===t||!(dI(e)&&dI(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const s of n)o[s]=gL(e[s],t[s]),i&&(i=e[s]===o[s]);return i?e:o}var fI=(...e)=>fetch(...e),xce=e=>e.status>=200&&e.status<=299,wce=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function hI(e){if(!_s(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}function Cce({baseUrl:e,prepareHeaders:t=d=>d,fetchFn:n=fI,paramsSerializer:r,isJsonContentType:i=wce,jsonContentType:o="application/json",jsonReplacer:s,timeout:a,responseHandler:l,validateStatus:c,...u}={}){return typeof fetch>"u"&&n===fI&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,h)=>{const{signal:p,getState:m,extra:_,endpoint:v,forced:y,type:g}=h;let b,{url:S,headers:w=new Headers(u.headers),params:C=void 0,responseHandler:x=l??"json",validateStatus:k=c??xce,timeout:A=a,...R}=typeof f=="string"?{url:f}:f,L={...u,signal:p,...R};w=new Headers(hI(w)),L.headers=await t(w,{getState:m,extra:_,endpoint:v,forced:y,type:g})||w;const M=V=>typeof V=="object"&&(_s(V)||Array.isArray(V)||typeof V.toJSON=="function");if(!L.headers.has("content-type")&&M(L.body)&&L.headers.set("content-type",o),M(L.body)&&i(L.headers)&&(L.body=JSON.stringify(L.body,s)),C){const V=~S.indexOf("?")?"&":"?",H=r?r(C):new URLSearchParams(hI(C));S+=V+H}S=bce(e,S);const E=new Request(S,L);b={request:new Request(S,L)};let O,F=!1,$=A&&setTimeout(()=>{F=!0,h.abort()},A);try{O=await n(E)}catch(V){return{error:{status:F?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:b}}finally{$&&clearTimeout($)}const D=O.clone();b.response=D;let N,z="";try{let V;if(await Promise.all([d(O,x).then(H=>N=H,H=>V=H),D.text().then(H=>z=H,()=>{})]),V)throw V}catch(V){return{error:{status:"PARSING_ERROR",originalStatus:O.status,data:z,error:String(V)},meta:b}}return k(O,N)?{data:N,meta:b}:{error:{status:O.status,data:N},meta:b}};async function d(f,h){if(typeof h=="function")return h(f);if(h==="content-type"&&(h=i(f.headers)?"json":"text"),h==="json"){const p=await f.text();return p.length?JSON.parse(p):null}return f.text()}}var pI=class{constructor(e,t=void 0){this.value=e,this.meta=t}},lT=he("__rtkq/focused"),mL=he("__rtkq/unfocused"),cT=he("__rtkq/online"),yL=he("__rtkq/offline");function vL(e){return e.type==="query"}function Ece(e){return e.type==="mutation"}function uT(e,t,n,r,i,o){return Tce(e)?e(t,n,r,i).map(G5).map(o):Array.isArray(e)?e.map(G5).map(o):[]}function Tce(e){return typeof e=="function"}function G5(e){return typeof e=="string"?{type:e}:e}function gI(e){return e!=null}function Od(e){let t=0;for(const n in e)t++;return t}var vg=Symbol("forceQueryFn"),H5=e=>typeof e[vg]=="function";function Ace({serializeQueryArgs:e,queryThunk:t,mutationThunk:n,api:r,context:i}){const o=new Map,s=new Map,{unsubscribeQueryResult:a,removeMutationResult:l,updateSubscriptionOptions:c}=r.internalActions;return{buildInitiateQuery:p,buildInitiateMutation:m,getRunningQueryThunk:u,getRunningMutationThunk:d,getRunningQueriesThunk:f,getRunningMutationsThunk:h};function u(_,v){return y=>{var S;const g=i.endpointDefinitions[_],b=e({queryArgs:v,endpointDefinition:g,endpointName:_});return(S=o.get(y))==null?void 0:S[b]}}function d(_,v){return y=>{var g;return(g=s.get(y))==null?void 0:g[v]}}function f(){return _=>Object.values(o.get(_)||{}).filter(gI)}function h(){return _=>Object.values(s.get(_)||{}).filter(gI)}function p(_,v){const y=(g,{subscribe:b=!0,forceRefetch:S,subscriptionOptions:w,[vg]:C}={})=>(x,k)=>{var z;const A=e({queryArgs:g,endpointDefinition:v,endpointName:_}),R=t({type:"query",subscribe:b,forceRefetch:S,subscriptionOptions:w,endpointName:_,originalArgs:g,queryCacheKey:A,[vg]:C}),L=r.endpoints[_].select(g),M=x(R),E=L(k()),{requestId:P,abort:O}=M,F=E.requestId!==P,$=(z=o.get(x))==null?void 0:z[A],D=()=>L(k()),N=Object.assign(C?M.then(D):F&&!$?Promise.resolve(E):Promise.all([$,M]).then(D),{arg:g,requestId:P,subscriptionOptions:w,queryCacheKey:A,abort:O,async unwrap(){const V=await N;if(V.isError)throw V.error;return V.data},refetch:()=>x(y(g,{subscribe:!1,forceRefetch:!0})),unsubscribe(){b&&x(a({queryCacheKey:A,requestId:P}))},updateSubscriptionOptions(V){N.subscriptionOptions=V,x(c({endpointName:_,requestId:P,queryCacheKey:A,options:V}))}});if(!$&&!F&&!C){const V=o.get(x)||{};V[A]=N,o.set(x,V),N.then(()=>{delete V[A],Od(V)||o.delete(x)})}return N};return y}function m(_){return(v,{track:y=!0,fixedCacheKey:g}={})=>(b,S)=>{const w=n({type:"mutation",endpointName:_,originalArgs:v,track:y,fixedCacheKey:g}),C=b(w),{requestId:x,abort:k,unwrap:A}=C,R=C.unwrap().then(P=>({data:P})).catch(P=>({error:P})),L=()=>{b(l({requestId:x,fixedCacheKey:g}))},M=Object.assign(R,{arg:C.arg,requestId:x,abort:k,unwrap:A,reset:L}),E=s.get(b)||{};return s.set(b,E),E[x]=M,M.then(()=>{delete E[x],Od(E)||s.delete(b)}),g&&(E[g]=M,M.then(()=>{E[g]===M&&(delete E[g],Od(E)||s.delete(b))})),M}}}function mI(e){return e}function kce({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o}){const s=(y,g,b,S)=>(w,C)=>{const x=n[y],k=r({queryArgs:g,endpointDefinition:x,endpointName:y});if(w(i.internalActions.queryResultPatched({queryCacheKey:k,patches:b})),!S)return;const A=i.endpoints[y].select(g)(C()),R=uT(x.providesTags,A.data,void 0,g,{},o);w(i.internalActions.updateProvidedBy({queryCacheKey:k,providedTags:R}))},a=(y,g,b,S=!0)=>(w,C)=>{const k=i.endpoints[y].select(g)(C());let A={patches:[],inversePatches:[],undo:()=>w(i.util.patchQueryData(y,g,A.inversePatches,S))};if(k.status==="uninitialized")return A;let R;if("data"in k)if(No(k.data)){const[L,M,E]=dN(k.data,b);A.patches.push(...M),A.inversePatches.push(...E),R=L}else R=b(k.data),A.patches.push({op:"replace",path:[],value:R}),A.inversePatches.push({op:"replace",path:[],value:k.data});return w(i.util.patchQueryData(y,g,A.patches,S)),A},l=(y,g,b)=>S=>S(i.endpoints[y].initiate(g,{subscribe:!1,forceRefetch:!0,[vg]:()=>({data:b})})),c=async(y,{signal:g,abort:b,rejectWithValue:S,fulfillWithValue:w,dispatch:C,getState:x,extra:k})=>{const A=n[y.endpointName];try{let R=mI,L;const M={signal:g,abort:b,dispatch:C,getState:x,extra:k,endpoint:y.endpointName,type:y.type,forced:y.type==="query"?u(y,x()):void 0},E=y.type==="query"?y[vg]:void 0;if(E?L=E():A.query?(L=await t(A.query(y.originalArgs),M,A.extraOptions),A.transformResponse&&(R=A.transformResponse)):L=await A.queryFn(y.originalArgs,M,A.extraOptions,P=>t(P,M,A.extraOptions)),typeof process<"u",L.error)throw new pI(L.error,L.meta);return w(await R(L.data,L.meta,y.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:L.meta,[ad]:!0})}catch(R){let L=R;if(L instanceof pI){let M=mI;A.query&&A.transformErrorResponse&&(M=A.transformErrorResponse);try{return S(await M(L.value,L.meta,y.originalArgs),{baseQueryMeta:L.meta,[ad]:!0})}catch(E){L=E}}throw typeof process<"u",console.error(L),L}};function u(y,g){var x,k,A;const b=(k=(x=g[e])==null?void 0:x.queries)==null?void 0:k[y.queryCacheKey],S=(A=g[e])==null?void 0:A.config.refetchOnMountOrArgChange,w=b==null?void 0:b.fulfilledTimeStamp,C=y.forceRefetch??(y.subscribe&&S);return C?C===!0||(Number(new Date)-Number(w))/1e3>=C:!1}const d=m5(`${e}/executeQuery`,c,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ad]:!0}},condition(y,{getState:g}){var A,R,L;const b=g(),S=(R=(A=b[e])==null?void 0:A.queries)==null?void 0:R[y.queryCacheKey],w=S==null?void 0:S.fulfilledTimeStamp,C=y.originalArgs,x=S==null?void 0:S.originalArgs,k=n[y.endpointName];return H5(y)?!0:(S==null?void 0:S.status)==="pending"?!1:u(y,b)||vL(k)&&((L=k==null?void 0:k.forceRefetch)!=null&&L.call(k,{currentArg:C,previousArg:x,endpointState:S,state:b}))?!0:!w},dispatchConditionRejection:!0}),f=m5(`${e}/executeMutation`,c,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ad]:!0}}}),h=y=>"force"in y,p=y=>"ifOlderThan"in y,m=(y,g,b)=>(S,w)=>{const C=h(b)&&b.force,x=p(b)&&b.ifOlderThan,k=(R=!0)=>i.endpoints[y].initiate(g,{forceRefetch:R}),A=i.endpoints[y].select(g)(w());if(C)S(k());else if(x){const R=A==null?void 0:A.fulfilledTimeStamp;if(!R){S(k());return}(Number(new Date)-Number(new Date(R)))/1e3>=x&&S(k())}else S(k(!1))};function _(y){return g=>{var b,S;return((S=(b=g==null?void 0:g.meta)==null?void 0:b.arg)==null?void 0:S.endpointName)===y}}function v(y,g){return{matchPending:hp(v4(y),_(g)),matchFulfilled:hp(bl(y),_(g)),matchRejected:hp(sf(y),_(g))}}return{queryThunk:d,mutationThunk:f,prefetch:m,updateQueryData:a,upsertQueryData:l,patchQueryData:s,buildMatchThunkActions:v}}function bL(e,t,n,r){return uT(n[e.meta.arg.endpointName][t],bl(e)?e.payload:void 0,fm(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function H0(e,t,n){const r=e[t];r&&n(r)}function bg(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function yI(e,t,n){const r=e[bg(t)];r&&n(r)}var ph={};function Pce({reducerPath:e,queryThunk:t,mutationThunk:n,context:{endpointDefinitions:r,apiUid:i,extractRehydrationInfo:o,hasRehydrationInfo:s},assertTagType:a,config:l}){const c=he(`${e}/resetApiState`),u=jt({name:`${e}/queries`,initialState:ph,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:b}}){delete g[b]},prepare:uh()},queryResultPatched:{reducer(g,{payload:{queryCacheKey:b,patches:S}}){H0(g,b,w=>{w.data=BP(w.data,S.concat())})},prepare:uh()}},extraReducers(g){g.addCase(t.pending,(b,{meta:S,meta:{arg:w}})=>{var x;const C=H5(w);b[x=w.queryCacheKey]??(b[x]={status:"uninitialized",endpointName:w.endpointName}),H0(b,w.queryCacheKey,k=>{k.status="pending",k.requestId=C&&k.requestId?k.requestId:S.requestId,w.originalArgs!==void 0&&(k.originalArgs=w.originalArgs),k.startedTimeStamp=S.startedTimeStamp})}).addCase(t.fulfilled,(b,{meta:S,payload:w})=>{H0(b,S.arg.queryCacheKey,C=>{if(C.requestId!==S.requestId&&!H5(S.arg))return;const{merge:x}=r[S.arg.endpointName];if(C.status="fulfilled",x)if(C.data!==void 0){const{fulfilledTimeStamp:k,arg:A,baseQueryMeta:R,requestId:L}=S;let M=Pf(C.data,E=>x(E,w,{arg:A.originalArgs,baseQueryMeta:R,fulfilledTimeStamp:k,requestId:L}));C.data=M}else C.data=w;else C.data=r[S.arg.endpointName].structuralSharing??!0?gL(Ji(C.data)?uQ(C.data):C.data,w):w;delete C.error,C.fulfilledTimeStamp=S.fulfilledTimeStamp})}).addCase(t.rejected,(b,{meta:{condition:S,arg:w,requestId:C},error:x,payload:k})=>{H0(b,w.queryCacheKey,A=>{if(!S){if(A.requestId!==C)return;A.status="rejected",A.error=k??x}})}).addMatcher(s,(b,S)=>{const{queries:w}=o(S);for(const[C,x]of Object.entries(w))((x==null?void 0:x.status)==="fulfilled"||(x==null?void 0:x.status)==="rejected")&&(b[C]=x)})}}),d=jt({name:`${e}/mutations`,initialState:ph,reducers:{removeMutationResult:{reducer(g,{payload:b}){const S=bg(b);S in g&&delete g[S]},prepare:uh()}},extraReducers(g){g.addCase(n.pending,(b,{meta:S,meta:{requestId:w,arg:C,startedTimeStamp:x}})=>{C.track&&(b[bg(S)]={requestId:w,status:"pending",endpointName:C.endpointName,startedTimeStamp:x})}).addCase(n.fulfilled,(b,{payload:S,meta:w})=>{w.arg.track&&yI(b,w,C=>{C.requestId===w.requestId&&(C.status="fulfilled",C.data=S,C.fulfilledTimeStamp=w.fulfilledTimeStamp)})}).addCase(n.rejected,(b,{payload:S,error:w,meta:C})=>{C.arg.track&&yI(b,C,x=>{x.requestId===C.requestId&&(x.status="rejected",x.error=S??w)})}).addMatcher(s,(b,S)=>{const{mutations:w}=o(S);for(const[C,x]of Object.entries(w))((x==null?void 0:x.status)==="fulfilled"||(x==null?void 0:x.status)==="rejected")&&C!==(x==null?void 0:x.requestId)&&(b[C]=x)})}}),f=jt({name:`${e}/invalidation`,initialState:ph,reducers:{updateProvidedBy:{reducer(g,b){var C,x;const{queryCacheKey:S,providedTags:w}=b.payload;for(const k of Object.values(g))for(const A of Object.values(k)){const R=A.indexOf(S);R!==-1&&A.splice(R,1)}for(const{type:k,id:A}of w){const R=(C=g[k]??(g[k]={}))[x=A||"__internal_without_id"]??(C[x]=[]);R.includes(S)||R.push(S)}},prepare:uh()}},extraReducers(g){g.addCase(u.actions.removeQueryResult,(b,{payload:{queryCacheKey:S}})=>{for(const w of Object.values(b))for(const C of Object.values(w)){const x=C.indexOf(S);x!==-1&&C.splice(x,1)}}).addMatcher(s,(b,S)=>{var C,x;const{provided:w}=o(S);for(const[k,A]of Object.entries(w))for(const[R,L]of Object.entries(A)){const M=(C=b[k]??(b[k]={}))[x=R||"__internal_without_id"]??(C[x]=[]);for(const E of L)M.includes(E)||M.push(E)}}).addMatcher(br(bl(t),fm(t)),(b,S)=>{const w=bL(S,"providesTags",r,a),{queryCacheKey:C}=S.meta.arg;f.caseReducers.updateProvidedBy(b,f.actions.updateProvidedBy({queryCacheKey:C,providedTags:w}))})}}),h=jt({name:`${e}/subscriptions`,initialState:ph,reducers:{updateSubscriptionOptions(g,b){},unsubscribeQueryResult(g,b){},internal_getRTKQSubscriptions(){}}}),p=jt({name:`${e}/internalSubscriptions`,initialState:ph,reducers:{subscriptionsUpdated:{reducer(g,b){return BP(g,b.payload)},prepare:uh()}}}),m=jt({name:`${e}/config`,initialState:{online:_ce(),focused:Sce(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(g,{payload:b}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||i!==b?"conflict":!0}},extraReducers:g=>{g.addCase(cT,b=>{b.online=!0}).addCase(yL,b=>{b.online=!1}).addCase(lT,b=>{b.focused=!0}).addCase(mL,b=>{b.focused=!1}).addMatcher(s,b=>({...b}))}}),_=Vb({queries:u.reducer,mutations:d.reducer,provided:f.reducer,subscriptions:p.reducer,config:m.reducer}),v=(g,b)=>_(c.match(b)?void 0:g,b),y={...m.actions,...u.actions,...h.actions,...p.actions,...d.actions,...f.actions,resetApiState:c};return{reducer:v,actions:y}}var Sc=Symbol.for("RTKQ/skipToken"),_L={status:"uninitialized"},vI=Pf(_L,()=>{}),bI=Pf(_L,()=>{});function Ice({serializeQueryArgs:e,reducerPath:t}){const n=u=>vI,r=u=>bI;return{buildQuerySelector:s,buildMutationSelector:a,selectInvalidatedBy:l,selectCachedArgsForQuery:c};function i(u){return{...u,...gce(u.status)}}function o(u){return u[t]}function s(u,d){return f=>{const h=e({queryArgs:f,endpointDefinition:d,endpointName:u});return fp(f===Sc?n:_=>{var v,y;return((y=(v=o(_))==null?void 0:v.queries)==null?void 0:y[h])??vI},i)}}function a(){return u=>{let d;return typeof u=="object"?d=bg(u)??Sc:d=u,fp(d===Sc?r:p=>{var m,_;return((_=(m=o(p))==null?void 0:m.mutations)==null?void 0:_[d])??bI},i)}}function l(u,d){const f=u[t],h=new Set;for(const p of d.map(G5)){const m=f.provided[p.type];if(!m)continue;let _=(p.id!==void 0?m[p.id]:uI(Object.values(m)))??[];for(const v of _)h.add(v)}return uI(Array.from(h.values()).map(p=>{const m=f.queries[p];return m?[{queryCacheKey:p,endpointName:m.endpointName,originalArgs:m.originalArgs}]:[]}))}function c(u,d){return Object.values(u[t].queries).filter(f=>(f==null?void 0:f.endpointName)===d&&f.status!=="uninitialized").map(f=>f.originalArgs)}}var Mu=WeakMap?new WeakMap:void 0,_I=({endpointName:e,queryArgs:t})=>{let n="";const r=Mu==null?void 0:Mu.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,s)=>_s(s)?Object.keys(s).sort().reduce((a,l)=>(a[l]=s[l],a),{}):s);_s(t)&&(Mu==null||Mu.set(t,i)),n=i}return`${e}(${n})`};function Mce(...e){return function(n){const r=Zp(c=>{var u;return(u=n.extractRehydrationInfo)==null?void 0:u.call(n,c,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(c){let u=_I;if("serializeQueryArgs"in c.endpointDefinition){const d=c.endpointDefinition.serializeQueryArgs;u=f=>{const h=d(f);return typeof h=="string"?h:_I({...f,queryArgs:h})}}else n.serializeQueryArgs&&(u=n.serializeQueryArgs);return u(c)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(c){c()},apiUid:y4(),extractRehydrationInfo:r,hasRehydrationInfo:Zp(c=>r(c)!=null)},s={injectEndpoints:l,enhanceEndpoints({addTagTypes:c,endpoints:u}){if(c)for(const d of c)i.tagTypes.includes(d)||i.tagTypes.push(d);if(u)for(const[d,f]of Object.entries(u))typeof f=="function"?f(o.endpointDefinitions[d]):Object.assign(o.endpointDefinitions[d]||{},f);return s}},a=e.map(c=>c.init(s,i,o));function l(c){const u=c.endpoints({query:d=>({...d,type:"query"}),mutation:d=>({...d,type:"mutation"})});for(const[d,f]of Object.entries(u)){if(!c.overrideExisting&&d in o.endpointDefinitions){typeof process<"u";continue}o.endpointDefinitions[d]=f;for(const h of a)h.injectEndpoint(d,f)}return s}return s.injectEndpoints({endpoints:n.endpoints})}}function Rce(e){for(let t in e)return!1;return!0}var Oce=2147483647/1e3-1,$ce=({reducerPath:e,api:t,context:n,internalState:r})=>{const{removeQueryResult:i,unsubscribeQueryResult:o}=t.internalActions;function s(u){const d=r.currentSubscriptions[u];return!!d&&!Rce(d)}const a={},l=(u,d,f)=>{var h;if(o.match(u)){const p=d.getState()[e],{queryCacheKey:m}=u.payload;c(m,(h=p.queries[m])==null?void 0:h.endpointName,d,p.config)}if(t.util.resetApiState.match(u))for(const[p,m]of Object.entries(a))m&&clearTimeout(m),delete a[p];if(n.hasRehydrationInfo(u)){const p=d.getState()[e],{queries:m}=n.extractRehydrationInfo(u);for(const[_,v]of Object.entries(m))c(_,v==null?void 0:v.endpointName,d,p.config)}};function c(u,d,f,h){const p=n.endpointDefinitions[d],m=(p==null?void 0:p.keepUnusedDataFor)??h.keepUnusedDataFor;if(m===1/0)return;const _=Math.max(0,Math.min(m,Oce));if(!s(u)){const v=a[u];v&&clearTimeout(v),a[u]=setTimeout(()=>{s(u)||f.dispatch(i({queryCacheKey:u})),delete a[u]},_*1e3)}}return l},Nce=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:s,refetchQuery:a,internalState:l})=>{const{removeQueryResult:c}=o.internalActions,u=br(bl(r),fm(r)),d=br(bl(r,i),sf(r,i));let f=[];const h=(_,v)=>{u(_)?m(bL(_,"invalidatesTags",n,s),v):d(_)?m([],v):o.util.invalidateTags.match(_)&&m(uT(_.payload,void 0,void 0,void 0,void 0,s),v)};function p(_){var v,y;for(const g in _.queries)if(((v=_.queries[g])==null?void 0:v.status)==="pending")return!0;for(const g in _.mutations)if(((y=_.mutations[g])==null?void 0:y.status)==="pending")return!0;return!1}function m(_,v){const y=v.getState(),g=y[e];if(f.push(..._),g.config.invalidationBehavior==="delayed"&&p(g))return;const b=f;if(f=[],b.length===0)return;const S=o.util.selectInvalidatedBy(y,b);t.batch(()=>{const w=Array.from(S.values());for(const{queryCacheKey:C}of w){const x=g.queries[C],k=l.currentSubscriptions[C]??{};x&&(Od(k)===0?v.dispatch(c({queryCacheKey:C})):x.status!=="uninitialized"&&v.dispatch(a(x,C)))}})}return h},Fce=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const o={},s=(f,h)=>{(n.internalActions.updateSubscriptionOptions.match(f)||n.internalActions.unsubscribeQueryResult.match(f))&&l(f.payload,h),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&l(f.meta.arg,h),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&a(f.meta.arg,h),n.util.resetApiState.match(f)&&u()};function a({queryCacheKey:f},h){const m=h.getState()[e].queries[f],_=i.currentSubscriptions[f];if(!m||m.status==="uninitialized")return;const v=d(_);if(!Number.isFinite(v))return;const y=o[f];y!=null&&y.timeout&&(clearTimeout(y.timeout),y.timeout=void 0);const g=Date.now()+v,b=o[f]={nextPollTimestamp:g,pollingInterval:v,timeout:setTimeout(()=>{b.timeout=void 0,h.dispatch(r(m,f))},v)}}function l({queryCacheKey:f},h){const m=h.getState()[e].queries[f],_=i.currentSubscriptions[f];if(!m||m.status==="uninitialized")return;const v=d(_);if(!Number.isFinite(v)){c(f);return}const y=o[f],g=Date.now()+v;(!y||g<y.nextPollTimestamp)&&a({queryCacheKey:f},h)}function c(f){const h=o[f];h!=null&&h.timeout&&clearTimeout(h.timeout),delete o[f]}function u(){for(const f of Object.keys(o))c(f)}function d(f={}){let h=Number.POSITIVE_INFINITY;for(let p in f)f[p].pollingInterval&&(h=Math.min(f[p].pollingInterval,h));return h}return s},Dce=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,s=(l,c)=>{lT.match(l)&&a(c,"refetchOnFocus"),cT.match(l)&&a(c,"refetchOnReconnect")};function a(l,c){const u=l.getState()[e],d=u.queries,f=i.currentSubscriptions;t.batch(()=>{for(const h of Object.keys(f)){const p=d[h],m=f[h];if(!m||!p)continue;(Object.values(m).some(v=>v[c]===!0)||Object.values(m).every(v=>v[c]===void 0)&&u.config[c])&&(Od(m)===0?l.dispatch(o({queryCacheKey:h})):p.status!=="uninitialized"&&l.dispatch(r(p,h)))}})}return s},SI=new Error("Promise never resolved before cacheEntryRemoved."),Lce=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o})=>{const s=g5(r),a=g5(i),l=bl(r,i),c={},u=(h,p,m)=>{const _=d(h);if(r.pending.match(h)){const v=m[t].queries[_],y=p.getState()[t].queries[_];!v&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(i.pending.match(h))p.getState()[t].mutations[_]&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId);else if(l(h)){const v=c[_];v!=null&&v.valueResolved&&(v.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete v.valueResolved)}else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h)){const v=c[_];v&&(delete c[_],v.cacheEntryRemoved())}else if(e.util.resetApiState.match(h))for(const[v,y]of Object.entries(c))delete c[v],y.cacheEntryRemoved()};function d(h){return s(h)?h.meta.arg.queryCacheKey:a(h)?h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?bg(h.payload):""}function f(h,p,m,_,v){const y=n.endpointDefinitions[h],g=y==null?void 0:y.onCacheEntryAdded;if(!g)return;let b={};const S=new Promise(R=>{b.cacheEntryRemoved=R}),w=Promise.race([new Promise(R=>{b.valueResolved=R}),S.then(()=>{throw SI})]);w.catch(()=>{}),c[m]=b;const C=e.endpoints[h].select(y.type==="query"?p:m),x=_.dispatch((R,L,M)=>M),k={..._,getCacheEntry:()=>C(_.getState()),requestId:v,extra:x,updateCachedData:y.type==="query"?R=>_.dispatch(e.util.updateQueryData(h,p,R)):void 0,cacheDataLoaded:w,cacheEntryRemoved:S},A=g(p,k);Promise.resolve(A).catch(R=>{if(R!==SI)throw R})}return u},Bce=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=v4(n,r),o=sf(n,r),s=bl(n,r),a={};return(c,u)=>{var d,f;if(i(c)){const{requestId:h,arg:{endpointName:p,originalArgs:m}}=c.meta,_=t.endpointDefinitions[p],v=_==null?void 0:_.onQueryStarted;if(v){const y={},g=new Promise((C,x)=>{y.resolve=C,y.reject=x});g.catch(()=>{}),a[h]=y;const b=e.endpoints[p].select(_.type==="query"?m:h),S=u.dispatch((C,x,k)=>k),w={...u,getCacheEntry:()=>b(u.getState()),requestId:h,extra:S,updateCachedData:_.type==="query"?C=>u.dispatch(e.util.updateQueryData(p,m,C)):void 0,queryFulfilled:g};v(m,w)}}else if(s(c)){const{requestId:h,baseQueryMeta:p}=c.meta;(d=a[h])==null||d.resolve({data:c.payload,meta:p}),delete a[h]}else if(o(c)){const{requestId:h,rejectedWithValue:p,baseQueryMeta:m}=c.meta;(f=a[h])==null||f.reject({error:c.payload??c.error,isUnhandledError:!p,meta:m}),delete a[h]}}},zce=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},jce=({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:s,unsubscribeQueryResult:a}=e.internalActions,l=(h,p)=>{var _,v,y;if(s.match(p)){const{queryCacheKey:g,requestId:b,options:S}=p.payload;return(_=h==null?void 0:h[g])!=null&&_[b]&&(h[g][b]=S),!0}if(a.match(p)){const{queryCacheKey:g,requestId:b}=p.payload;return h[g]&&delete h[g][b],!0}if(e.internalActions.removeQueryResult.match(p))return delete h[p.payload.queryCacheKey],!0;if(t.pending.match(p)){const{meta:{arg:g,requestId:b}}=p,S=h[v=g.queryCacheKey]??(h[v]={});return S[`${b}_running`]={},g.subscribe&&(S[b]=g.subscriptionOptions??S[b]??{}),!0}let m=!1;if(t.fulfilled.match(p)||t.rejected.match(p)){const g=h[p.meta.arg.queryCacheKey]||{},b=`${p.meta.requestId}_running`;m||(m=!!g[b]),delete g[b]}if(t.rejected.match(p)){const{meta:{condition:g,arg:b,requestId:S}}=p;if(g&&b.subscribe){const w=h[y=b.queryCacheKey]??(h[y]={});w[S]=b.subscriptionOptions??w[S]??{},m=!0}}return m},c=()=>n.currentSubscriptions,f={getSubscriptions:c,getSubscriptionCount:h=>{const m=c()[h]??{};return Od(m)},isRequestSubscribed:(h,p)=>{var _;const m=c();return!!((_=m==null?void 0:m[h])!=null&&_[p])}};return(h,p)=>{if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.util.resetApiState.match(h))return i=n.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,f];const m=l(n.currentSubscriptions,h);let _=!0;if(m){o||(o=setTimeout(()=>{const g=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,b]=dN(i,()=>g);p.next(e.internalActions.subscriptionsUpdated(b)),i=g,o=null},500));const v=typeof h.type=="string"&&!!h.type.startsWith(r),y=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;_=!v&&!y}return[_,!1]}};function Vce(e){const{reducerPath:t,queryThunk:n,api:r,context:i}=e,{apiUid:o}=i,s={invalidateTags:he(`${t}/invalidateTags`)},a=d=>d.type.startsWith(`${t}/`),l=[zce,$ce,Nce,Fce,Lce,Bce];return{middleware:d=>{let f=!1;const p={...e,internalState:{currentSubscriptions:{}},refetchQuery:u,isThisApiSliceAction:a},m=l.map(y=>y(p)),_=jce(p),v=Dce(p);return y=>g=>{if(!Ub(g))return y(g);f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));const b={...d,next:y},S=d.getState(),[w,C]=_(g,b,S);let x;if(w?x=y(g):x=C,d.getState()[t]&&(v(g,b,S),a(g)||i.hasRehydrationInfo(g)))for(let k of m)k(g,b,S);return x}},actions:s};function u(d,f,h={}){return n({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f,...h})}}function ka(e,...t){return Object.assign(e,...t)}var xI=Symbol(),Uce=()=>({name:xI,init(e,{baseQuery:t,tagTypes:n,reducerPath:r,serializeQueryArgs:i,keepUnusedDataFor:o,refetchOnMountOrArgChange:s,refetchOnFocus:a,refetchOnReconnect:l,invalidationBehavior:c},u){bQ();const d=F=>(typeof process<"u",F);Object.assign(e,{reducerPath:r,endpoints:{},internalActions:{onOnline:cT,onOffline:yL,onFocus:lT,onFocusLost:mL},util:{}});const{queryThunk:f,mutationThunk:h,patchQueryData:p,updateQueryData:m,upsertQueryData:_,prefetch:v,buildMatchThunkActions:y}=kce({baseQuery:t,reducerPath:r,context:u,api:e,serializeQueryArgs:i,assertTagType:d}),{reducer:g,actions:b}=Pce({context:u,queryThunk:f,mutationThunk:h,reducerPath:r,assertTagType:d,config:{refetchOnFocus:a,refetchOnReconnect:l,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:r,invalidationBehavior:c}});ka(e.util,{patchQueryData:p,updateQueryData:m,upsertQueryData:_,prefetch:v,resetApiState:b.resetApiState}),ka(e.internalActions,b);const{middleware:S,actions:w}=Vce({reducerPath:r,context:u,queryThunk:f,mutationThunk:h,api:e,assertTagType:d});ka(e.util,w),ka(e,{reducer:g,middleware:S});const{buildQuerySelector:C,buildMutationSelector:x,selectInvalidatedBy:k,selectCachedArgsForQuery:A}=Ice({serializeQueryArgs:i,reducerPath:r});ka(e.util,{selectInvalidatedBy:k,selectCachedArgsForQuery:A});const{buildInitiateQuery:R,buildInitiateMutation:L,getRunningMutationThunk:M,getRunningMutationsThunk:E,getRunningQueriesThunk:P,getRunningQueryThunk:O}=Ace({queryThunk:f,mutationThunk:h,api:e,serializeQueryArgs:i,context:u});return ka(e.util,{getRunningMutationThunk:M,getRunningMutationsThunk:E,getRunningQueryThunk:O,getRunningQueriesThunk:P}),{name:xI,injectEndpoint(F,$){var N;const D=e;(N=D.endpoints)[F]??(N[F]={}),vL($)?ka(D.endpoints[F],{name:F,select:C(F,$),initiate:R(F,$)},y(f,F)):Ece($)&&ka(D.endpoints[F],{name:F,select:x(),initiate:L(F)},y(h,F))}}}});function wI(e,t,n,r){const i=I.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}),[e,t,n,r]),o=I.useRef(i);return I.useEffect(()=>{o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var Kx=Symbol();function Xx(e){const t=I.useRef(e);return I.useEffect(()=>{Jv(t.current,e)||(t.current=e)},[e]),Jv(t.current,e)?t.current:e}var Ru=WeakMap?new WeakMap:void 0,Gce=({endpointName:e,queryArgs:t})=>{let n="";const r=Ru==null?void 0:Ru.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,s)=>_s(s)?Object.keys(s).sort().reduce((a,l)=>(a[l]=s[l],a),{}):s);_s(t)&&(Ru==null||Ru.set(t,i)),n=i}return`${e}(${n})`},Hce=typeof window<"u"&&window.document&&window.document.createElement?I.useLayoutEffect:I.useEffect,Wce=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:pL.pending}:e;function qce({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o},serializeQueryArgs:s,context:a}){const l=o?h=>h():I.useEffect;return{buildQueryHooks:d,buildMutationHook:f,usePrefetch:u};function c(h,p,m){if(p!=null&&p.endpointName&&h.isUninitialized){const{endpointName:S}=p,w=a.endpointDefinitions[S];s({queryArgs:p.originalArgs,endpointDefinition:w,endpointName:S})===s({queryArgs:m,endpointDefinition:w,endpointName:S})&&(p=void 0)}let _=h.isSuccess?h.data:p==null?void 0:p.data;_===void 0&&(_=h.data);const v=_!==void 0,y=h.isLoading,g=!v&&y,b=h.isSuccess||y&&v;return{...h,data:_,currentData:h.data,isFetching:y,isLoading:g,isSuccess:b}}function u(h,p){const m=n(),_=Xx(p);return I.useCallback((v,y)=>m(e.util.prefetch(h,v,{..._,...y})),[h,m,_])}function d(h){const p=(v,{refetchOnReconnect:y,refetchOnFocus:g,refetchOnMountOrArgChange:b,skip:S=!1,pollingInterval:w=0}={})=>{const{initiate:C}=e.endpoints[h],x=n(),k=I.useRef();if(!k.current){const $=x(e.internalActions.internal_getRTKQSubscriptions());k.current=$}const A=wI(S?Sc:v,Gce,a.endpointDefinitions[h],h),R=Xx({refetchOnReconnect:y,refetchOnFocus:g,pollingInterval:w}),L=I.useRef(!1),M=I.useRef();let{queryCacheKey:E,requestId:P}=M.current||{},O=!1;E&&P&&(O=k.current.isRequestSubscribed(E,P));const F=!O&&L.current;return l(()=>{L.current=O}),l(()=>{F&&(M.current=void 0)},[F]),l(()=>{var N;const $=M.current;if(typeof process<"u",A===Sc){$==null||$.unsubscribe(),M.current=void 0;return}const D=(N=M.current)==null?void 0:N.subscriptionOptions;if(!$||$.arg!==A){$==null||$.unsubscribe();const z=x(C(A,{subscriptionOptions:R,forceRefetch:b}));M.current=z}else R!==D&&$.updateSubscriptionOptions(R)},[x,C,b,A,R,F]),I.useEffect(()=>()=>{var $;($=M.current)==null||$.unsubscribe(),M.current=void 0},[]),I.useMemo(()=>({refetch:()=>{var $;if(!M.current)throw new Error(yr(38));return($=M.current)==null?void 0:$.refetch()}}),[])},m=({refetchOnReconnect:v,refetchOnFocus:y,pollingInterval:g=0}={})=>{const{initiate:b}=e.endpoints[h],S=n(),[w,C]=I.useState(Kx),x=I.useRef(),k=Xx({refetchOnReconnect:v,refetchOnFocus:y,pollingInterval:g});l(()=>{var M,E;const L=(M=x.current)==null?void 0:M.subscriptionOptions;k!==L&&((E=x.current)==null||E.updateSubscriptionOptions(k))},[k]);const A=I.useRef(k);l(()=>{A.current=k},[k]);const R=I.useCallback(function(L,M=!1){let E;return t(()=>{var P;(P=x.current)==null||P.unsubscribe(),x.current=E=S(b(L,{subscriptionOptions:A.current,forceRefetch:!M})),C(L)}),E},[S,b]);return I.useEffect(()=>()=>{var L;(L=x==null?void 0:x.current)==null||L.unsubscribe()},[]),I.useEffect(()=>{w!==Kx&&!x.current&&R(w,!0)},[w,R]),I.useMemo(()=>[R,w],[R,w])},_=(v,{skip:y=!1,selectFromResult:g}={})=>{const{select:b}=e.endpoints[h],S=wI(y?Sc:v,s,a.endpointDefinitions[h],h),w=I.useRef(),C=I.useMemo(()=>fp([b(S),(L,M)=>M,L=>S],c),[b,S]),x=I.useMemo(()=>g?fp([C],g,{devModeChecks:{identityFunctionCheck:"never"}}):C,[C,g]),k=r(L=>x(L,w.current),Jv),A=i(),R=C(A.getState(),w.current);return Hce(()=>{w.current=R},[R]),k};return{useQueryState:_,useQuerySubscription:p,useLazyQuerySubscription:m,useLazyQuery(v){const[y,g]=m(v),b=_(g,{...v,skip:g===Kx}),S=I.useMemo(()=>({lastArg:g}),[g]);return I.useMemo(()=>[y,b,S],[y,b,S])},useQuery(v,y){const g=p(v,y),b=_(v,{selectFromResult:v===Sc||y!=null&&y.skip?void 0:Wce,...y}),{data:S,status:w,isLoading:C,isSuccess:x,isError:k,error:A}=b;return I.useDebugValue({data:S,status:w,isLoading:C,isSuccess:x,isError:k,error:A}),I.useMemo(()=>({...b,...g}),[b,g])}}}function f(h){return({selectFromResult:p,fixedCacheKey:m}={})=>{const{select:_,initiate:v}=e.endpoints[h],y=n(),[g,b]=I.useState();I.useEffect(()=>()=>{g!=null&&g.arg.fixedCacheKey||g==null||g.reset()},[g]);const S=I.useCallback(function(N){const z=y(v(N,{fixedCacheKey:m}));return b(z),z},[y,v,m]),{requestId:w}=g||{},C=I.useMemo(()=>_({fixedCacheKey:m,requestId:g==null?void 0:g.requestId}),[m,g,_]),x=I.useMemo(()=>p?fp([C],p):C,[p,C]),k=r(x,Jv),A=m==null?g==null?void 0:g.arg.originalArgs:void 0,R=I.useCallback(()=>{t(()=>{g&&b(void 0),m&&y(e.internalActions.removeMutationResult({requestId:w,fixedCacheKey:m}))})},[y,m,g,w]),{endpointName:L,data:M,status:E,isLoading:P,isSuccess:O,isError:F,error:$}=k;I.useDebugValue({endpointName:L,data:M,status:E,isLoading:P,isSuccess:O,isError:F,error:$});const D=I.useMemo(()=>({...k,originalArgs:A,reset:R}),[k,A,R]);return I.useMemo(()=>[S,D],[S,D])}}}function Kce(e){return e.type==="query"}function Xce(e){return e.type==="mutation"}function Qx(e){return e.replace(e[0],e[0].toUpperCase())}function W0(e,...t){return Object.assign(e,...t)}var Qce=Symbol(),Yce=({batch:e=iQ,hooks:t={useDispatch:eN,useSelector:Y$,useStore:J$},unstable__sideEffectsInRender:n=!1,...r}={})=>({name:Qce,init(i,{serializeQueryArgs:o},s){const a=i,{buildQueryHooks:l,buildMutationHook:c,usePrefetch:u}=qce({api:i,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n},serializeQueryArgs:o,context:s});return W0(a,{usePrefetch:u}),W0(s,{batch:e}),{injectEndpoint(d,f){if(Kce(f)){const{useQuery:h,useLazyQuery:p,useLazyQuerySubscription:m,useQueryState:_,useQuerySubscription:v}=l(d);W0(a.endpoints[d],{useQuery:h,useLazyQuery:p,useLazyQuerySubscription:m,useQueryState:_,useQuerySubscription:v}),i[`use${Qx(d)}Query`]=h,i[`useLazy${Qx(d)}Query`]=p}else if(Xce(f)){const h=c(d);W0(a.endpoints[d],{useMutation:h}),i[`use${Qx(d)}Mutation`]=h}}}}}),Zce=Mce(Uce(),Yce());const Jce=["AppVersion","AppConfig","Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageWorkflow","ImageMetadataFromFile","IntermediatesCount","SessionQueueItem","SessionQueueStatus","SessionProcessorStatus","CurrentSessionQueueItem","NextSessionQueueItem","BatchStatus","InvocationCacheStatus","Model","T2IAdapterModel","MainModel","OnnxModel","VaeModel","IPAdapterModel","TextualInversionModel","ControlNetModel","LoRAModel","SDXLRefinerModel","Workflow","WorkflowsRecent"],Ir="LIST",eue=async(e,t,n)=>{const r=Yv.get(),i=Qv.get(),o=F5.get();return Cce({baseUrl:`${r??""}/api/v1`,prepareHeaders:a=>(i&&a.set("Authorization",`Bearer ${i}`),o&&a.set("project-id",o),a)})(e,t,n)},Lo=Zce({baseQuery:eue,reducerPath:"api",tagTypes:Jce,endpoints:()=>({})}),tue=e=>{const t=e?yp.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${In.get()}/list?${t}`:`queue/${In.get()}/list`},pc=jo({selectId:e=>String(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}),en=Lo.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${In.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,q0(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${In.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${In.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${In.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,q0(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${In.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,q0(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${In.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/${In.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/${In.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${In.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${In.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${In.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(en.util.updateQueryData("listQueueItems",void 0,o=>{pc.updateOne(o,{id:String(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/${In.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,q0(r)}catch{}},invalidatesTags:["SessionQueueStatus","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:tue(t),method:"GET"}),serializeQueryArgs:()=>`queue/${In.get()}/list`,transformResponse:t=>pc.addMany(pc.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{pc.addMany(t,pc.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:sVe,useEnqueueBatchMutation:aVe,usePauseProcessorMutation:lVe,useResumeProcessorMutation:cVe,useClearQueueMutation:uVe,usePruneQueueMutation:dVe,useGetCurrentQueueItemQuery:fVe,useGetQueueStatusQuery:hVe,useGetQueueItemQuery:pVe,useGetNextQueueItemQuery:gVe,useListQueueItemsQuery:mVe,useCancelQueueItemMutation:yVe,useGetBatchStatusQuery:vVe}=en,q0=e=>{e(en.util.updateQueryData("listQueueItems",void 0,t=>{pc.removeAll(t),t.has_more=!1})),e(rce()),e(en.endpoints.listQueueItems.initiate(void 0))},Uh={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},SL={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:Uh,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:[]},xL=jt({name:"canvas",initialState:SL,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(Ge(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!rL(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{width:r,height:i}=n,{stageDimensions:o}=e,s={width:B0(el(r,64,512),64),height:B0(el(i,64,512),64)},a={x:Or(r/2-s.width/2,64),y:Or(i/2-s.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const u=Iu(s);e.scaledBoundingBoxDimensions=u}e.boundingBoxDimensions=s,e.boundingBoxCoordinates=a,e.pastLayerStates.push(Ge(e.layerState)),e.layerState={...Ge(Uh),objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.batchIds=[];const l=U0(o.width,o.height,r,i,G0),c=V0(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=c},setBoundingBoxDimensions:(e,t)=>{const n=Zle(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Iu(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=Yle(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(Ge(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(Ge(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=Ge(Ge(Uh)).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Ge(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(Ge(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:s}=e;if(n==="move"||n==="colorPicker")return;const a=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Ge(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:a,points:t.payload,...l};s&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(ece);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Ge(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Ge(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(Ge(e.layerState)),e.layerState=Ge(Uh),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(Jle)){const o=U0(i.width,i.height,512,512,G0),s=V0(i.width,i.height,0,0,512,512,o),a={width:512,height:512};if(e.stageScale=o,e.stageCoordinates=s,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const l=Iu(a);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:s,y:a,width:l,height:c}=n;if(l!==0&&c!==0){const u=r?1:U0(i,o,l,c,G0),d=V0(i,o,s,a,l,c,u);e.stageScale=u,e.stageCoordinates=d}else{const u=U0(i,o,512,512,G0),d=V0(i,o,0,0,512,512,u),f={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=Iu(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(Ge(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea=Ge(Uh).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,s=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>s){const a={width:B0(el(o,64,512),64),height:B0(el(s,64,512),64)},l={x:Or(o/2-a.width/2,64),y:Or(s/2-a.height/2,64)};if(e.boundingBoxDimensions=a,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const c=Iu(a);e.scaledBoundingBoxDimensions=c}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Iu(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(Ge(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(d_,(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(Xle,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Or(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Or(t.scaledBoundingBoxDimensions.width/r,64))}),e.addMatcher(en.endpoints.clearQueue.matchFulfilled,t=>{t.batchIds=[]}),e.addMatcher(en.endpoints.cancelByBatchIds.matchFulfilled,(t,n)=>{t.batchIds=t.batchIds.filter(r=>!n.meta.arg.originalArgs.batch_ids.includes(r))})}}),{addEraseRect:bVe,addFillRect:_Ve,addImageToStagingArea:nue,addLine:SVe,addPointToCurrentLine:xVe,clearCanvasHistory:wVe,clearMask:CVe,commitColorPickerColor:EVe,commitStagingAreaImage:rue,discardStagedImages:iue,fitBoundingBoxToStage:TVe,mouseLeftCanvas:AVe,nextStagingAreaImage:kVe,prevStagingAreaImage:PVe,redo:IVe,resetCanvas:dT,resetCanvasInteractionState:MVe,resetCanvasView:RVe,setBoundingBoxCoordinates:OVe,setBoundingBoxDimensions:CI,setBoundingBoxPreviewFill:$Ve,setBoundingBoxScaleMethod:NVe,flipBoundingBoxAxes:FVe,setBrushColor:DVe,setBrushSize:LVe,setColorPickerColor:BVe,setCursorPosition:zVe,setInitialCanvasImage:wL,setIsDrawing:jVe,setIsMaskEnabled:VVe,setIsMouseOverBoundingBox:UVe,setIsMoveBoundingBoxKeyHeld:GVe,setIsMoveStageKeyHeld:HVe,setIsMovingBoundingBox:WVe,setIsMovingStage:qVe,setIsTransformingBoundingBox:KVe,setLayer:XVe,setMaskColor:QVe,setMergedCanvas:oue,setShouldAutoSave:YVe,setShouldCropToBoundingBoxOnSave:ZVe,setShouldDarkenOutsideBoundingBox:JVe,setShouldLockBoundingBox:eUe,setShouldPreserveMaskedArea:tUe,setShouldShowBoundingBox:nUe,setShouldShowBrush:rUe,setShouldShowBrushPreview:iUe,setShouldShowCanvasDebugInfo:oUe,setShouldShowCheckboardTransparency:sUe,setShouldShowGrid:aUe,setShouldShowIntermediates:lUe,setShouldShowStagingImage:cUe,setShouldShowStagingOutline:uUe,setShouldSnapToGrid:dUe,setStageCoordinates:fUe,setStageScale:hUe,setTool:pUe,toggleShouldLockBoundingBox:gUe,toggleTool:mUe,undo:yUe,setScaledBoundingBoxDimensions:vUe,setShouldRestrictStrokesToBox:bUe,stagingAreaInitialized:sue,setShouldAntialias:_Ue,canvasResized:SUe,canvasBatchIdAdded:aue,canvasBatchIdsReset:lue}=xL.actions,cue=xL.reducer,uue={isModalOpen:!1,imagesToChange:[]},CL=jt({name:"changeBoardModal",initialState:uue,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:xUe,imagesToChangeSelected:wUe,changeBoardReset:CUe}=CL.actions,due=CL.reducer,fue={imagesToDelete:[],isModalOpen:!1},EL=jt({name:"deleteImageModal",initialState:fue,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:fT,imagesToDeleteSelected:hue,imageDeletionCanceled:EUe}=EL.actions,pue=EL.reducer,hT={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},gue=hT,TL=jt({name:"dynamicPrompts",initialState:gue,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=hT.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:mue,maxPromptsReset:yue,combinatorialToggled:vue,promptsChanged:bue,parsingErrorChanged:_ue,isErrorChanged:EI,isLoadingChanged:Yx,seedBehaviourChanged:TUe}=TL.actions,Sue=TL.reducer,Rn=["general"],Pr=["control","mask","user","other"],xue=100,K0=20,wue=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},Xl=(e,t)=>{if(!e)return!1;const n=_g.selectAll(e);if(n.length<=1)return!0;const r=[],i=[];for(let o=0;o<n.length;o++){const s=n[o];s!=null&&s.starred&&r.push(s),s!=null&&s.starred||i.push(s)}if(t.starred){const o=r[r.length-1];if(!o)return!0;const s=new Date(t.created_at),a=new Date(o.created_at);return s>=a}else{const o=i[i.length-1];if(!o)return!1;const s=new Date(t.created_at),a=new Date(o.created_at);return s>=a}},Fi=e=>Rn.includes(e.image_category)?Rn:Pr,Ot=jo({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:wue(t.created_at,e.created_at)}),_g=Ot.getSelectors(),Vi=e=>`images/?${yp.stringify(e,{arrayFormat:"none"})}`,Qe=Lo.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:Ir}];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:Ir}];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:Rn,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:Ir}]}),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:AUe,useListAllBoardsQuery:kUe,useGetBoardImagesTotalQuery:PUe,useGetBoardAssetsTotalQuery:IUe,useCreateBoardMutation:MUe,useUpdateBoardMutation:RUe,useListAllImageNamesForBoardQuery:OUe}=Qe;var AL={},y_={},v_={};Object.defineProperty(v_,"__esModule",{value:!0});v_.createLogMethods=void 0;var Cue=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)}};v_.createLogMethods=Cue;var pT={},b_={};Object.defineProperty(b_,"__esModule",{value:!0});b_.boolean=void 0;const Eue=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}};b_.boolean=Eue;var __={};Object.defineProperty(__,"__esModule",{value:!0});__.isBooleanable=void 0;const Tue=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}};__.isBooleanable=Tue;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=b_;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=__;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(pT);var TI=Object.prototype.toString,kL=function(t){var n=TI.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&TI.call(t.callee)==="[object Function]"),r},Zx,AI;function Aue(){if(AI)return Zx;AI=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=kL,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var h=f.constructor;return h&&h.prototype===f},c={$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},u=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!c["$"+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"||!u)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",_=r(h),v=p&&n.call(h)==="[object String]",y=[];if(!p&&!m&&!_)throw new TypeError("Object.keys called on a non-object");var g=s&&m;if(v&&h.length>0&&!t.call(h,0))for(var b=0;b<h.length;++b)y.push(String(b));if(_&&h.length>0)for(var S=0;S<h.length;++S)y.push(String(S));else for(var w in h)!(g&&w==="prototype")&&t.call(h,w)&&y.push(String(w));if(o)for(var C=d(h),x=0;x<a.length;++x)!(C&&a[x]==="constructor")&&t.call(h,a[x])&&y.push(a[x]);return y}}return Zx=e,Zx}var kue=Array.prototype.slice,Pue=kL,kI=Object.keys,Jy=kI?function(t){return kI(t)}:Aue(),PI=Object.keys;Jy.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 Pue(r)?PI(kue.call(r)):PI(r)})}else Object.keys=Jy;return Object.keys||Jy};var Iue=Jy,Mue=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},II=typeof Symbol<"u"&&Symbol,Rue=Mue,Oue=function(){return typeof II!="function"||typeof Symbol!="function"||typeof II("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Rue()},MI={foo:{}},$ue=Object,Nue=function(){return{__proto__:MI}.foo===MI.foo&&!({__proto__:null}instanceof $ue)},Fue="Function.prototype.bind called on incompatible ",Due=Object.prototype.toString,Lue=Math.max,Bue="[object Function]",RI=function(t,n){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var o=0;o<n.length;o+=1)r[o+t.length]=n[o];return r},zue=function(t,n){for(var r=[],i=n||0,o=0;i<t.length;i+=1,o+=1)r[o]=t[i];return r},jue=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},Vue=function(t){var n=this;if(typeof n!="function"||Due.apply(n)!==Bue)throw new TypeError(Fue+n);for(var r=zue(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,RI(r,arguments));return Object(u)===u?u:this}return n.apply(t,RI(r,arguments))},s=Lue(0,n.length-r.length),a=[],l=0;l<s;l++)a[l]="$"+l;if(i=Function("binder","return function ("+jue(a,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i},Uue=Vue,PL=Function.prototype.bind||Uue,Gue=Function.prototype.call,Hue=Object.prototype.hasOwnProperty,Wue=PL,que=Wue.call(Gue,Hue),qe,ff=SyntaxError,IL=Function,$d=TypeError,Jx=function(e){try{return IL('"use strict"; return ('+e+").constructor;")()}catch{}},$c=Object.getOwnPropertyDescriptor;if($c)try{$c({},"")}catch{$c=null}var ew=function(){throw new $d},Kue=$c?function(){try{return arguments.callee,ew}catch{try{return $c(arguments,"callee").get}catch{return ew}}}():ew,Ou=Oue(),Xue=Nue(),On=Object.getPrototypeOf||(Xue?function(e){return e.__proto__}:null),qu={},Que=typeof Uint8Array>"u"||!On?qe:On(Uint8Array),Nc={"%AggregateError%":typeof AggregateError>"u"?qe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?qe:ArrayBuffer,"%ArrayIteratorPrototype%":Ou&&On?On([][Symbol.iterator]()):qe,"%AsyncFromSyncIteratorPrototype%":qe,"%AsyncFunction%":qu,"%AsyncGenerator%":qu,"%AsyncGeneratorFunction%":qu,"%AsyncIteratorPrototype%":qu,"%Atomics%":typeof Atomics>"u"?qe:Atomics,"%BigInt%":typeof BigInt>"u"?qe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?qe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?qe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?qe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?qe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?qe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?qe:FinalizationRegistry,"%Function%":IL,"%GeneratorFunction%":qu,"%Int8Array%":typeof Int8Array>"u"?qe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?qe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?qe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ou&&On?On(On([][Symbol.iterator]())):qe,"%JSON%":typeof JSON=="object"?JSON:qe,"%Map%":typeof Map>"u"?qe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ou||!On?qe:On(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?qe:Promise,"%Proxy%":typeof Proxy>"u"?qe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?qe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?qe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ou||!On?qe:On(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?qe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ou&&On?On(""[Symbol.iterator]()):qe,"%Symbol%":Ou?Symbol:qe,"%SyntaxError%":ff,"%ThrowTypeError%":Kue,"%TypedArray%":Que,"%TypeError%":$d,"%Uint8Array%":typeof Uint8Array>"u"?qe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?qe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?qe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?qe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?qe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?qe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?qe:WeakSet};if(On)try{null.error}catch(e){var Yue=On(On(e));Nc["%Error.prototype%"]=Yue}var Zue=function e(t){var n;if(t==="%AsyncFunction%")n=Jx("async function () {}");else if(t==="%GeneratorFunction%")n=Jx("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Jx("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&On&&(n=On(i.prototype))}return Nc[t]=n,n},OI={"%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"]},ym=PL,E1=que,Jue=ym.call(Function.call,Array.prototype.concat),ede=ym.call(Function.apply,Array.prototype.splice),$I=ym.call(Function.call,String.prototype.replace),T1=ym.call(Function.call,String.prototype.slice),tde=ym.call(Function.call,RegExp.prototype.exec),nde=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rde=/\\(\\)?/g,ide=function(t){var n=T1(t,0,1),r=T1(t,-1);if(n==="%"&&r!=="%")throw new ff("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new ff("invalid intrinsic syntax, expected opening `%`");var i=[];return $I(t,nde,function(o,s,a,l){i[i.length]=a?$I(l,rde,"$1"):s||o}),i},ode=function(t,n){var r=t,i;if(E1(OI,r)&&(i=OI[r],r="%"+i[0]+"%"),E1(Nc,r)){var o=Nc[r];if(o===qu&&(o=Zue(r)),typeof o>"u"&&!n)throw new $d("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new ff("intrinsic "+t+" does not exist!")},sde=function(t,n){if(typeof t!="string"||t.length===0)throw new $d("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new $d('"allowMissing" argument must be a boolean');if(tde(/^%?[^%]*%?$/,t)===null)throw new ff("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=ide(t),i=r.length>0?r[0]:"",o=ode("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],ede(r,Jue([0,1],c)));for(var u=1,d=!0;u<r.length;u+=1){var f=r[u],h=T1(f,0,1),p=T1(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new ff("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,s="%"+i+"%",E1(Nc,s))a=Nc[s];else if(a!=null){if(!(f in a)){if(!n)throw new $d("base intrinsic for "+t+" exists, but the property is not available.");return}if($c&&u+1>=r.length){var m=$c(a,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[f]}else d=E1(a,f),a=a[f];d&&!l&&(Nc[s]=a)}}return a},ade=sde,W5=ade("%Object.defineProperty%",!0),q5=function(){if(W5)try{return W5({},"a",{value:1}),!0}catch{return!1}return!1};q5.hasArrayLengthDefineBug=function(){if(!q5())return null;try{return W5([],"length",{value:1}).length!==1}catch{return!0}};var lde=q5,cde=Iue,ude=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dde=Object.prototype.toString,fde=Array.prototype.concat,ML=Object.defineProperty,hde=function(e){return typeof e=="function"&&dde.call(e)==="[object Function]"},pde=lde(),RL=ML&&pde,gde=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!hde(r)||!r())return}RL?ML(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},OL=function(e,t){var n=arguments.length>2?arguments[2]:{},r=cde(t);ude&&(r=fde.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)gde(e,r[i],t[r[i]],n[r[i]])};OL.supportsDescriptors=!!RL;var $L=OL,ev={exports:{}};typeof self<"u"?ev.exports=self:typeof window<"u"?ev.exports=window:ev.exports=Function("return this")();var NL=ev.exports,mde=NL,FL=function(){return typeof He!="object"||!He||He.Math!==Math||He.Array!==Array?mde:He},yde=$L,vde=FL,bde=function(){var t=vde();if(yde.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},_de=$L,Sde=NL,DL=FL,xde=bde,wde=DL(),LL=function(){return wde};_de(LL,{getPolyfill:DL,implementation:Sde,shim:xde});var Cde=LL,BL={},vm={},gT={},S_={},x_={};Object.defineProperty(x_,"__esModule",{value:!0});x_.convertWildcardToRegex=void 0;var Ede=/\*+/g,Tde=function(e){return new RegExp(e.replace(Ede,"(.+?)"))};x_.convertWildcardToRegex=Tde;var bm={};Object.defineProperty(bm,"__esModule",{value:!0});bm.escapeRegexString=void 0;var Ade=/[$()*+.?[\\\]^{|}]/g,kde=/-/g,Pde=function(e){return e.replace(Ade,"\\$&").replace(kde,"\\x2d")};bm.escapeRegexString=Pde;var w_={};Object.defineProperty(w_,"__esModule",{value:!0});w_.parseRegex=void 0;var Ide=/(\/?)(.+)\1([a-z]*)/,Mde=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,Rde=function(e){var t=Ide.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!Mde.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};w_.parseRegex=Rde;Object.defineProperty(S_,"__esModule",{value:!0});S_.createStringTest=void 0;var Ode=x_,$de=bm,Nde=w_,tw=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,Nde.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}},Fde=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 tw(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?tw(e,String((0,Ode.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):tw(e,"/("+(0,$de.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};S_.createStringTest=Fde;var C_={};Object.defineProperty(C_,"__esModule",{value:!0});C_.testComparisonRange=void 0;var Dde=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))}};C_.testComparisonRange=Dde;var E_={};Object.defineProperty(E_,"__esModule",{value:!0});E_.testRange=void 0;var Lde=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};E_.testRange=Lde;(function(e){var t=He&&He.__assign||function(){return t=Object.assign||function(u){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)&&(u[p]=d[p])}return u},t.apply(this,arguments)},n=He&&He.__spreadArray||function(u,d,f){if(f||arguments.length===2)for(var h=0,p=d.length,m;h<p;h++)(m||!(h in d))&&(m||(m=Array.prototype.slice.call(d,0,h)),m[h]=d[h]);return u.concat(m||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=S_,i=C_,o=E_,s=function(u){if(u.type!=="Tag")throw new Error("Expected a tag expression.");var d=u.expression;if(d.type==="RangeExpression")return function(m){return(0,o.testRange)(m,d.range)};if(d.type==="EmptyExpression")return function(){return!1};var f=d.value;if(u.operator&&u.operator.operator!==":"){var h=u.operator;if(typeof f!="number")throw new TypeError("Expected a number.");return function(m){return typeof m!="number"?!1:(0,i.testComparisonRange)(f,m,h.operator)}}else{if(typeof f=="boolean")return function(m){return m===f};if(f===null)return function(m){return m===null};var p=(0,r.createStringTest)({},u);return function(m){return p(String(m))}}},a=function(u,d,f,h,p){if(Array.isArray(d)){for(var m=!1,_=0,v=0,y=d;v<y.length;v++){var g=y[v];if(a(u,g,f,n(n([],h,!0),[String(_++)],!1),p)){if(f)return!0;m=!0}}return m}else if(typeof d=="object"&&d!==null){var m=!1;for(var b in d)if(a(u,d[b],f,n(n([],h,!0),[b],!1),p)){if(f)return!0;m=!0}return m}if(u.type!=="Tag")throw new Error("Expected a tag expression.");if(!u.test)throw new Error("Expected test to be defined.");var S=u.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(u,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=s(d)),d.field.type==="ImplicitField"){var m=!1;for(var _ in u)if(a(t(t({},d),{field:{location:{end:-1,start:-1},name:_,quoted:!0,quotes:"double",type:"Field"}}),u[_],f,n(n([],h,!0),[_],!1),p)){if(f)return!0;m=!0}return m}if(d.field.name in u)return a(d,u[d.field.name],f,h,p);if(d.getValue&&d.field.path)return a(d,d.getValue(u),f,d.field.path,p);if(d.field.path){for(var v=u,y=0,g=d.field.path;y<g.length;y++){var b=g[y];if(typeof v!="object"||v===null)return!1;if(b in v)v=v[b];else return!1}return a(d,v,f,d.field.path,p)}else return!1},c=function(u,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),u.type==="Tag")return d.filter(function(y){return l(y,u,f,u.field.type==="ImplicitField"?h:n(n([],h,!0),[u.field.name],!1),p)});if(u.type==="UnaryOperator"){var m=(0,e.internalFilter)(u.operand,d,f,h,[]);return d.filter(function(y){return!m.includes(y)})}if(!u.left)throw new Error("Expected left to be defined.");var _=(0,e.internalFilter)(u.left,d,f,h,p);if(!u.right)throw new Error("Expected right to be defined.");if(u.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(u.operator.operator==="OR"){var v=(0,e.internalFilter)(u.right,d,f,h,p);return Array.from(new Set(n(n([],_,!0),v,!0)))}else if(u.operator.operator==="AND")return(0,e.internalFilter)(u.right,_,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=c})(gT);Object.defineProperty(vm,"__esModule",{value:!0});vm.filter=void 0;var Bde=gT,zde=function(e,t){return(0,Bde.internalFilter)(e,t)};vm.filter=zde;var T_={};Object.defineProperty(T_,"__esModule",{value:!0});T_.highlight=void 0;var jde=bm,Vde=gT,Ude=function(e,t){var n=[];(0,Vde.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var c=r.find(function(u){return u.path===l.path});c||(c={keywords:[],path:l.path},r.push(c)),l.keyword&&c.keywords.push(l.keyword)},o=0,s=n;o<s.length;o++){var a=s[o];i(a)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(c){return(0,jde.escapeRegexString)(c.trim())}).join("|")+")")}:{path:l.path}})};T_.highlight=Ude;var A_={},zL={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(He,function(){function t(c,u,d){return this.id=++t.highestId,this.name=c,this.symbols=u,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(c){var u=typeof c>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,c).map(l).join(" ")+" ● "+this.symbols.slice(c).map(l).join(" ");return this.name+" → "+u};function n(c,u,d,f){this.rule=c,this.dot=u,this.reference=d,this.data=[],this.wantedBy=f,this.isComplete=this.dot===c.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(c){var u=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return u.left=this,u.right=c,u.isComplete&&(u.data=u.build(),u.right=void 0),u},n.prototype.build=function(){var c=[],u=this;do c.push(u.right.data),u=u.left;while(u.left);return c.reverse(),c},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function r(c,u){this.grammar=c,this.index=u,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(c){for(var u=this.states,d=this.wants,f=this.completed,h=0;h<u.length;h++){var p=u[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var m=p.wantedBy,_=m.length;_--;){var v=m[_];this.complete(v,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 g=f[y],_=0;_<g.length;_++){var b=g[_];this.complete(p,b)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(c){for(var u=this.grammar.byName[c]||[],d=0;d<u.length;d++){var f=u[d],h=this.wants[c],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(c,u){var d=c.nextState(u);this.states.push(d)};function i(c,u){this.rules=c,this.start=u||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,u){var d=f.Lexer;f.ParserStart&&(u=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,u);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(c,u){this.buffer=c,this.index=0,this.line=u?u.line:1,this.lastLineBreak=u?-u.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var c=this.buffer[this.index++];return c===`
`&&(this.line+=1,this.lastLineBreak=this.index),{value:c}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(c,u){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,m=String(this.line).length;return u+=" at line "+this.line+" col "+p+`:
`,u+=f.map(function(v,y){return _(this.line-f.length+y+1,m)+" "+v},this).join(`
`),u+=`
`+_("",m+p)+`^
`,u}else return u+" at index "+(this.index-1);function _(v,y){var g=String(v);return Array(y-g.length+1).join(" ")+g}};function s(c,u,d){if(c instanceof i)var f=c,d=u;else var f=i.fromCompiled(c,u);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}s.fail={},s.prototype.feed=function(c){var u=this.lexer;u.reset(c,this.lexerState);for(var d;;){try{if(d=u.next(),!d)break}catch(C){var m=new r(this.grammar,this.current+1);this.table.push(m);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,m=new r(this.grammar,p);this.table.push(m);for(var _=d.text!==void 0?d.text:d.value,v=u.constructor===o?d.value:d,y=h.scannable,g=y.length;g--;){var b=y[g],S=b.rule.symbols[b.dot];if(S.test?S.test(v):S.type?S.type===d.type:S.literal===_){var w=b.nextState({data:v,token:d,isToken:!0,reference:p-1});m.states.push(w)}}if(m.process(),m.states.length===0){var f=new Error(this.reportError(d));throw f.offset=this.current,f.token=d,f}this.options.keepHistory&&(h.lexerState=u.save()),this.current++}return h&&(this.lexerState=u.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(c){var u,d,f=c.token;return f?(u="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(u="input (lexer error)",d=c.message),this.reportErrorCommon(d,u)},s.prototype.reportError=function(c){var u=(c.type?c.type+" token: ":"")+JSON.stringify(c.value!==void 0?c.value:c),d=this.lexer.formatError(c,"Syntax error");return this.reportErrorCommon(d,u)},s.prototype.reportErrorCommon=function(c,u){var d=[];d.push(c);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(_){var v=_.rule.symbols[_.dot];return v&&typeof v!="string"});if(p.length===0)d.push("Unexpected "+u+`. I did not expect any more input. Here is the state of my parse table:
`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+u+`. Instead, I was expecting to see one of the following:
`);var m=p.map(function(_){return this.buildFirstStateStack(_,[])||[_]},this);m.forEach(function(_){var v=_[0],y=v.rule.symbols[v.dot],g=this.getSymbolDisplay(y);d.push("A "+g+" based on:"),this.displayStateStack(_,d)},this)}return d.push(""),d.join(`
`)},s.prototype.displayStateStack=function(c,u){for(var d,f=0,h=0;h<c.length;h++){var p=c[h],m=p.rule.toString(p.dot);m===d?f++:(f>0&&u.push(" ^ "+f+" more lines identical to this"),f=0,u.push(" "+m)),d=m}},s.prototype.getSymbolDisplay=function(c){return a(c)},s.prototype.buildFirstStateStack=function(c,u){if(u.indexOf(c)!==-1)return null;if(c.wantedBy.length===0)return[c];var d=c.wantedBy[0],f=[c].concat(u),h=this.buildFirstStateStack(d,f);return h===null?null:[c].concat(h)},s.prototype.save=function(){var c=this.table[this.current];return c.lexerState=this.lexerState,c},s.prototype.restore=function(c){var u=c.index;this.current=u,this.table[u]=c,this.table.splice(u+1),this.lexerState=c.lexerState,this.results=this.finish()},s.prototype.rewind=function(c){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[c])},s.prototype.finish=function(){var c=[],u=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===u&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==s.fail&&c.push(f)}),c.map(function(f){return f.data})};function a(c){var u=typeof c;if(u==="string")return c;if(u==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return"character matching "+c;if(c.type)return c.type+" token";if(c.test)return"token matching "+String(c.test);throw new Error("Unknown symbol type: "+c)}}function l(c){var u=typeof c;if(u==="string")return c;if(u==="object"){if(c.literal)return JSON.stringify(c.literal);if(c instanceof RegExp)return c.toString();if(c.type)return"%"+c.type;if(c.test)return"<"+String(c.test)+">";throw new Error("Unknown symbol type: "+c)}}return{Parser:s,Grammar:i,Rule:t}})})(zL);var Gde=zL.exports,tu={},jL={},Fl={};Fl.__esModule=void 0;Fl.__esModule=!0;var Hde=typeof Object.setPrototypeOf=="function",Wde=typeof Object.getPrototypeOf=="function",qde=typeof Object.defineProperty=="function",Kde=typeof Object.create=="function",Xde=typeof Object.prototype.hasOwnProperty=="function",Qde=function(t,n){Hde?Object.setPrototypeOf(t,n):t.__proto__=n};Fl.setPrototypeOf=Qde;var Yde=function(t){return Wde?Object.getPrototypeOf(t):t.__proto__||t.prototype};Fl.getPrototypeOf=Yde;var NI=!1,Zde=function e(t,n,r){if(qde&&!NI)try{Object.defineProperty(t,n,r)}catch{NI=!0,e(t,n,r)}else t[n]=r.value};Fl.defineProperty=Zde;var VL=function(t,n){return Xde?t.hasOwnProperty(t,n):t[n]===void 0};Fl.hasOwnProperty=VL;var Jde=function(t,n){if(Kde)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)VL(n,o)&&(i[o]=n[o].value);return i};Fl.objectCreate=Jde;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=Fl,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,s=new Error().toString()==="[object Error]",a="";function l(c){var u=this.constructor,d=u.name||function(){var _=u.toString().match(/^function\s*([^\s(]+)/);return _===null?a||"Error":_[1]}(),f=d==="Error",h=f?a:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof u)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:c,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:u),p.stack===void 0){var m=new Error(c);m.name=p.name,p.stack=m.stack}return s&&i(p,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),p}a=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(jL);var UL=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(tu,"__esModule",{value:!0});tu.SyntaxError=tu.LiqeError=void 0;var efe=jL,GL=function(e){UL(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(efe.ExtendableError);tu.LiqeError=GL;var tfe=function(e){UL(t,e);function t(n,r,i,o){var s=e.call(this,n)||this;return s.message=n,s.offset=r,s.line=i,s.column=o,s}return t}(GL);tu.SyntaxError=tfe;var mT={},A1=He&&He.__assign||function(){return A1=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},A1.apply(this,arguments)};Object.defineProperty(mT,"__esModule",{value:!0});function Os(e){return e[0]}var nfe={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:Os},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:Os},{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:Os},{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:Os},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:Os},{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:Os},{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:Os},{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:Os},{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,A1({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 A1({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:Os},{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"};mT.default=nfe;var HL={},k_={},_m={};Object.defineProperty(_m,"__esModule",{value:!0});_m.isSafePath=void 0;var rfe=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,ife=function(e){return rfe.test(e)};_m.isSafePath=ife;Object.defineProperty(k_,"__esModule",{value:!0});k_.createGetValueFunctionBody=void 0;var ofe=_m,sfe=function(e){if(!(0,ofe.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};k_.createGetValueFunctionBody=sfe;(function(e){var t=He&&He.__assign||function(){return t=Object.assign||function(o){for(var s,a=1,l=arguments.length;a<l;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(o[c]=s[c])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=k_,r=_m,i=function(o){var s=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(s.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(s.left=(0,e.hydrateAst)(o.left)),"right"in o&&(s.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(s.operand=(0,e.hydrateAst)(o.operand)),s};e.hydrateAst=i})(HL);var WL=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A_,"__esModule",{value:!0});A_.parse=void 0;var qL=WL(Gde),afe=tu,lfe=WL(mT),cfe=HL,ufe=qL.default.Grammar.fromCompiled(lfe.default),dfe=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,ffe=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new qL.default.Parser(ufe),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(dfe);throw r?new afe.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,cfe.hydrateAst)(n[0]);return i};A_.parse=ffe;var P_={};Object.defineProperty(P_,"__esModule",{value:!0});P_.test=void 0;var hfe=vm,pfe=function(e,t){return(0,hfe.filter)(e,[t]).length===1};P_.test=pfe;var KL={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,s){return s==="double"?'"'.concat(o,'"'):s==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var s=o.range,a=s.min,l=s.max,c=s.minInclusive,u=s.maxInclusive;return"".concat(c?"[":"{").concat(a," TO ").concat(l).concat(u?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var s=o.field,a=o.expression,l=o.operator;if(s.type==="ImplicitField")return n(a);var c=s.quoted?t(s.name,s.quotes):s.name,u=" ".repeat(a.location.start-l.location.end);return c+l.operator+u+n(a)},i=function(o){if(o.type==="ParenthesizedExpression"){if(!("location"in o.expression))throw new Error("Expected location in expression.");if(!o.location.end)throw new Error("Expected location end.");var s=" ".repeat(o.expression.location.start-(o.location.start+1)),a=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(s).concat((0,e.serialize)(o.expression)).concat(a,")")}if(o.type==="Tag")return r(o);if(o.type==="LogicalExpression"){var l="";return o.operator.type==="BooleanOperator"?(l+=" ".repeat(o.operator.location.start-o.left.location.end),l+=o.operator.operator,l+=" ".repeat(o.right.location.start-o.operator.location.end)):l=" ".repeat(o.right.location.start-o.left.location.end),"".concat((0,e.serialize)(o.left)).concat(l).concat((0,e.serialize)(o.right))}if(o.type==="UnaryOperator")return(o.operator==="NOT"?"NOT ":o.operator)+(0,e.serialize)(o.operand);if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")};e.serialize=i})(KL);var I_={};Object.defineProperty(I_,"__esModule",{value:!0});I_.isSafeUnquotedExpression=void 0;var gfe=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};I_.isSafeUnquotedExpression=gfe;(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=vm;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=T_;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=A_;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=P_;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=tu;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var s=KL;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return s.serialize}});var a=I_;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return a.isSafeUnquotedExpression}})})(BL);var Sm={},XL={},nu={};Object.defineProperty(nu,"__esModule",{value:!0});nu.ROARR_LOG_FORMAT_VERSION=nu.ROARR_VERSION=void 0;nu.ROARR_VERSION="5.0.0";nu.ROARR_LOG_FORMAT_VERSION="2.0.0";var Ff={};Object.defineProperty(Ff,"__esModule",{value:!0});Ff.logLevels=void 0;Ff.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var QL={},M_={};Object.defineProperty(M_,"__esModule",{value:!0});M_.hasOwnProperty=void 0;const mfe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);M_.hasOwnProperty=mfe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=M_;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(QL);var R_={};Object.defineProperty(R_,"__esModule",{value:!0});R_.isBrowser=void 0;const yfe=()=>typeof window<"u";R_.isBrowser=yfe;var O_={};Object.defineProperty(O_,"__esModule",{value:!0});O_.isTruthy=void 0;const vfe=e=>["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());O_.isTruthy=vfe;var YL={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMockLogger=void 0;const t=Ff,n=(i,o)=>(s,a,l,c,u,d,f,h,p,m)=>{i.child({logLevel:o})(s,a,l,c,u,d,f,h,p,m)},r=(i,o)=>{const s=()=>{};return s.adopt=async a=>a(),s.child=()=>(0,e.createMockLogger)(i,o),s.getContext=()=>({}),s.debug=n(s,t.logLevels.debug),s.debugOnce=n(s,t.logLevels.debug),s.error=n(s,t.logLevels.error),s.errorOnce=n(s,t.logLevels.error),s.fatal=n(s,t.logLevels.fatal),s.fatalOnce=n(s,t.logLevels.fatal),s.info=n(s,t.logLevels.info),s.infoOnce=n(s,t.logLevels.info),s.trace=n(s,t.logLevels.trace),s.traceOnce=n(s,t.logLevels.trace),s.warn=n(s,t.logLevels.warn),s.warnOnce=n(s,t.logLevels.warn),s};e.createMockLogger=r})(YL);var ZL={},$_={},N_={};Object.defineProperty(N_,"__esModule",{value:!0});N_.tokenize=void 0;const bfe=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,_fe=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=bfe.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const s=t[0];i=t.index+s.length,s==="\\%"||s==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):t.groups&&(o={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:s,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(o))}return i<=e.length-1&&(o&&o.type==="literal"?o.literal+=e.slice(i):n.push({literal:e.slice(i),type:"literal"})),n};N_.tokenize=_fe;Object.defineProperty($_,"__esModule",{value:!0});$_.createPrintf=void 0;const FI=pT,Sfe=N_,xfe=(e,t)=>t.placeholder,wfe=e=>{var t;const n=(o,s,a)=>a==="-"?o.padEnd(s," "):a==="-+"?((Number(o)>=0?"+":"")+o).padEnd(s," "):a==="+"?((Number(o)>=0?"+":"")+o).padStart(s," "):a==="0"?o.padStart(s,"0"):o.padStart(s," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:xfe,i={};return(o,...s)=>{let a=i[o];a||(a=i[o]=Sfe.tokenize(o));let l="";for(const c of a)if(c.type==="literal")l+=c.literal;else{let u=s[c.position];if(u===void 0)l+=r(o,c,s);else if(c.conversion==="b")l+=FI.boolean(u)?"true":"false";else if(c.conversion==="B")l+=FI.boolean(u)?"TRUE":"FALSE";else if(c.conversion==="c")l+=u;else if(c.conversion==="C")l+=String(u).toUpperCase();else if(c.conversion==="i"||c.conversion==="d")u=String(Math.trunc(u)),c.width!==null&&(u=n(u,c.width,c.flag)),l+=u;else if(c.conversion==="e")l+=Number(u).toExponential();else if(c.conversion==="E")l+=Number(u).toExponential().toUpperCase();else if(c.conversion==="f")c.precision!==null&&(u=Number(u).toFixed(c.precision)),c.width!==null&&(u=n(String(u),c.width,c.flag)),l+=u;else if(c.conversion==="o")l+=(Number.parseInt(String(u),10)>>>0).toString(8);else if(c.conversion==="s")c.width!==null&&(u=n(String(u),c.width,c.flag)),l+=u;else if(c.conversion==="S")c.width!==null&&(u=n(String(u),c.width,c.flag)),l+=String(u).toUpperCase();else if(c.conversion==="u")l+=Number.parseInt(String(u),10)>>>0;else if(c.conversion==="x")u=(Number.parseInt(String(u),10)>>>0).toString(16),c.width!==null&&(u=n(String(u),c.width,c.flag)),l+=u;else throw new Error("Unknown format specifier.")}return l}};$_.createPrintf=wfe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=$_;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(ZL);var K5={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(v){return v.length<5e3&&!i.test(v)?`"${v}"`:JSON.stringify(v)}function s(v){if(v.length>200)return v.sort();for(let y=1;y<v.length;y++){const g=v[y];let b=y;for(;b!==0&&v[b-1]>g;)v[b]=v[b-1],b--;v[b]=g}return v}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(v){return a.call(v)!==void 0&&v.length!==0}function c(v,y,g){v.length<g&&(g=v.length);const b=y===","?"":" ";let S=`"0":${b}${v[0]}`;for(let w=1;w<g;w++)S+=`${y}"${w}":${b}${v[w]}`;return S}function u(v){if(n.call(v,"circularValue")){const y=v.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(v,y){let g;if(n.call(v,y)&&(g=v[y],typeof g!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return g===void 0?!0:g}function f(v,y){let g;if(n.call(v,y)){if(g=v[y],typeof g!="number")throw new TypeError(`The "${y}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${y}" argument must be an integer`);if(g<1)throw new RangeError(`The "${y}" argument must be >= 1`)}return g===void 0?1/0:g}function h(v){return v===1?"1 item":`${v} items`}function p(v){const y=new Set;for(const g of v)(typeof g=="string"||typeof g=="number")&&y.add(String(g));return y}function m(v){if(n.call(v,"strict")){const y=v.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return g=>{let b=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(b+=` (${g.toString()})`),new Error(b)}}}function _(v){v={...v};const y=m(v);y&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const g=u(v),b=d(v,"bigint"),S=d(v,"deterministic"),w=f(v,"maximumDepth"),C=f(v,"maximumBreadth");function x(M,E,P,O,F,$){let D=E[M];switch(typeof D=="object"&&D!==null&&typeof D.toJSON=="function"&&(D=D.toJSON(M)),D=O.call(E,M,D),typeof D){case"string":return o(D);case"object":{if(D===null)return"null";if(P.indexOf(D)!==-1)return g;let N="",z=",";const V=$;if(Array.isArray(D)){if(D.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(D),F!==""&&($+=F,N+=`
${$}`,z=`,
${$}`);const q=Math.min(D.length,C);let Z=0;for(;Z<q-1;Z++){const be=x(String(Z),D,P,O,F,$);N+=be!==void 0?be:"null",N+=z}const oe=x(String(Z),D,P,O,F,$);if(N+=oe!==void 0?oe:"null",D.length-1>C){const be=D.length-C-1;N+=`${z}"... ${h(be)} not stringified"`}return F!==""&&(N+=`
${V}`),P.pop(),`[${N}]`}let H=Object.keys(D);const X=H.length;if(X===0)return"{}";if(w<P.length+1)return'"[Object]"';let te="",ee="";F!==""&&($+=F,z=`,
${$}`,te=" ");const j=Math.min(X,C);S&&!l(D)&&(H=s(H)),P.push(D);for(let q=0;q<j;q++){const Z=H[q],oe=x(Z,D,P,O,F,$);oe!==void 0&&(N+=`${ee}${o(Z)}:${te}${oe}`,ee=z)}if(X>C){const q=X-C;N+=`${ee}"...":${te}"${h(q)} not stringified"`,ee=z}return F!==""&&ee.length>1&&(N=`
${$}${N}
${V}`),P.pop(),`{${N}}`}case"number":return isFinite(D)?String(D):y?y(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(D);default:return y?y(D):void 0}}function k(M,E,P,O,F,$){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(M)),typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(P.indexOf(E)!==-1)return g;const D=$;let N="",z=",";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E),F!==""&&($+=F,N+=`
${$}`,z=`,
${$}`);const X=Math.min(E.length,C);let te=0;for(;te<X-1;te++){const j=k(String(te),E[te],P,O,F,$);N+=j!==void 0?j:"null",N+=z}const ee=k(String(te),E[te],P,O,F,$);if(N+=ee!==void 0?ee:"null",E.length-1>C){const j=E.length-C-1;N+=`${z}"... ${h(j)} not stringified"`}return F!==""&&(N+=`
${D}`),P.pop(),`[${N}]`}P.push(E);let V="";F!==""&&($+=F,z=`,
${$}`,V=" ");let H="";for(const X of O){const te=k(X,E[X],P,O,F,$);te!==void 0&&(N+=`${H}${o(X)}:${V}${te}`,H=z)}return F!==""&&H.length>1&&(N=`
${$}${N}
${D}`),P.pop(),`{${N}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(E);default:return y?y(E):void 0}}function A(M,E,P,O,F){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(M),typeof E!="object")return A(M,E,P,O,F);if(E===null)return"null"}if(P.indexOf(E)!==-1)return g;const $=F;if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E),F+=O;let te=`
${F}`;const ee=`,
${F}`,j=Math.min(E.length,C);let q=0;for(;q<j-1;q++){const oe=A(String(q),E[q],P,O,F);te+=oe!==void 0?oe:"null",te+=ee}const Z=A(String(q),E[q],P,O,F);if(te+=Z!==void 0?Z:"null",E.length-1>C){const oe=E.length-C-1;te+=`${ee}"... ${h(oe)} not stringified"`}return te+=`
${$}`,P.pop(),`[${te}]`}let D=Object.keys(E);const N=D.length;if(N===0)return"{}";if(w<P.length+1)return'"[Object]"';F+=O;const z=`,
${F}`;let V="",H="",X=Math.min(N,C);l(E)&&(V+=c(E,z,C),D=D.slice(E.length),X-=E.length,H=z),S&&(D=s(D)),P.push(E);for(let te=0;te<X;te++){const ee=D[te],j=A(ee,E[ee],P,O,F);j!==void 0&&(V+=`${H}${o(ee)}: ${j}`,H=z)}if(N>C){const te=N-C;V+=`${H}"...": "${h(te)} not stringified"`,H=z}return H!==""&&(V=`
${F}${V}
${$}`),P.pop(),`{${V}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(E);default:return y?y(E):void 0}}function R(M,E,P){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(M),typeof E!="object")return R(M,E,P);if(E===null)return"null"}if(P.indexOf(E)!==-1)return g;let O="";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E);const z=Math.min(E.length,C);let V=0;for(;V<z-1;V++){const X=R(String(V),E[V],P);O+=X!==void 0?X:"null",O+=","}const H=R(String(V),E[V],P);if(O+=H!==void 0?H:"null",E.length-1>C){const X=E.length-C-1;O+=`,"... ${h(X)} not stringified"`}return P.pop(),`[${O}]`}let F=Object.keys(E);const $=F.length;if($===0)return"{}";if(w<P.length+1)return'"[Object]"';let D="",N=Math.min($,C);l(E)&&(O+=c(E,",",C),F=F.slice(E.length),N-=E.length,D=","),S&&(F=s(F)),P.push(E);for(let z=0;z<N;z++){const V=F[z],H=R(V,E[V],P);H!==void 0&&(O+=`${D}${o(V)}:${H}`,D=",")}if($>C){const z=$-C;O+=`${D}"...":"${h(z)} not stringified"`}return P.pop(),`{${O}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(E);default:return y?y(E):void 0}}function L(M,E,P){if(arguments.length>1){let O="";if(typeof P=="number"?O=" ".repeat(Math.min(P,10)):typeof P=="string"&&(O=P.slice(0,10)),E!=null){if(typeof E=="function")return x("",{"":M},[],E,O,"");if(Array.isArray(E))return k("",M,[],p(E),O,"")}if(O.length!==0)return A("",M,[],O,"")}return R("",M,[])}return L}})(K5,K5.exports);var JL=K5.exports;(function(e){var t=He&&He.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=nu,r=Ff,i=QL,o=R_,s=O_,a=YL,l=ZL,c=t(JL);let u=!1;const d=()=>globalThis.ROARR,f=()=>({messageContext:{},transforms:[]}),h=()=>{const b=d().asyncLocalStorage;if(!b)throw new Error("AsyncLocalContext is unavailable.");const S=b.getStore();return S||f()},p=()=>!!d().asyncLocalStorage,m=()=>{if(p()){const b=h();return(0,i.hasOwnProperty)(b,"sequenceRoot")&&(0,i.hasOwnProperty)(b,"sequence")&&typeof b.sequence=="number"?String(b.sequenceRoot)+"."+String(b.sequence++):String(d().sequence++)}return String(d().sequence++)},_=(b,S)=>(w,C,x,k,A,R,L,M,E,P)=>{b.child({logLevel:S})(w,C,x,k,A,R,L,M,E,P)},v=1e3,y=(b,S)=>(w,C,x,k,A,R,L,M,E,P)=>{const O=(0,c.default)({a:w,b:C,c:x,d:k,e:A,f:R,g:L,h:M,i:E,j:P,logLevel:S});if(!O)throw new Error("Expected key to be a string");const F=d().onceLog;F.has(O)||(F.add(O),F.size>v&&F.clear(),b.child({logLevel:S})(w,C,x,k,A,R,L,M,E,P))},g=(b,S={},w=[])=>{var C;if(!(0,o.isBrowser)()&&typeof process<"u"&&!(0,s.isTruthy)((C={}.ROARR_LOG)!==null&&C!==void 0?C:""))return(0,a.createMockLogger)(b,S);const x=(k,A,R,L,M,E,P,O,F,$)=>{const D=Date.now(),N=m();let z;p()?z=h():z=f();let V,H;if(typeof k=="string"?V={...z.messageContext,...S}:V={...z.messageContext,...S,...k},typeof k=="string"&&A===void 0)H=k;else if(typeof k=="string"){if(!k.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.");H=(0,l.printf)(k,A,R,L,M,E,P,O,F,$)}else{let te=A;if(typeof A!="string")if(A===void 0)te="";else throw new TypeError("Message must be a string. Received "+typeof A+".");H=(0,l.printf)(te,R,L,M,E,P,O,F,$)}let X={context:V,message:H,sequence:N,time:D,version:n.ROARR_LOG_FORMAT_VERSION};for(const te of[...z.transforms,...w])if(X=te(X),typeof X!="object"||X===null)throw new Error("Message transform function must return a message object.");b(X)};return x.child=k=>{let A;return p()?A=h():A=f(),typeof k=="function"?(0,e.createLogger)(b,{...A.messageContext,...S,...k},[k,...w]):(0,e.createLogger)(b,{...A.messageContext,...S,...k},w)},x.getContext=()=>{let k;return p()?k=h():k=f(),{...k.messageContext,...S}},x.adopt=async(k,A)=>{if(!p())return u===!1&&(u=!0,b({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:m(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),k();const R=h();let L;(0,i.hasOwnProperty)(R,"sequenceRoot")&&(0,i.hasOwnProperty)(R,"sequence")&&typeof R.sequence=="number"?L=R.sequenceRoot+"."+String(R.sequence++):L=String(d().sequence++);let M={...R.messageContext};const E=[...R.transforms];typeof A=="function"?E.push(A):M={...M,...A};const P=d().asyncLocalStorage;if(!P)throw new Error("Async local context unavailable.");return P.run({messageContext:M,sequence:0,sequenceRoot:L,transforms:E},()=>k())},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=g})(XL);var F_={},Cfe=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var s=Number(r[o]),a=Number(i[o]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return 0},Efe=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(F_,"__esModule",{value:!0});F_.createRoarrInitialGlobalStateBrowser=void 0;const DI=nu,LI=Efe(Cfe),Tfe=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(LI.default),t.includes(DI.ROARR_VERSION)||t.push(DI.ROARR_VERSION),t.sort(LI.default),{sequence:0,...e,versions:t}};F_.createRoarrInitialGlobalStateBrowser=Tfe;var D_={};Object.defineProperty(D_,"__esModule",{value:!0});D_.stringify=void 0;const Afe=JL,kfe=(0,Afe.configure)({deterministic:!1,maximumBreadth:10,maximumDepth:10,strict:!1}),Pfe=e=>{var t;try{return(t=kfe(e))!==null&&t!==void 0?t:""}catch(n){throw console.error("[roarr] could not serialize value",e),n}};D_.stringify=Pfe;var L_={};Object.defineProperty(L_,"__esModule",{value:!0});L_.getLogLevelName=void 0;const Ife=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";L_.getLogLevelName=Ife;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const t=XL,n=F_,r=D_,i=(0,n.createRoarrInitialGlobalStateBrowser)(globalThis.ROARR||{});e.ROARR=i,globalThis.ROARR=i;const o=c=>(0,r.stringify)(c),s=(0,t.createLogger)(c=>{var u;i.write&&i.write(((u=i.serializeMessage)!==null&&u!==void 0?u:o)(c))});e.Roarr=s;var a=Ff;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return a.logLevels}});var l=L_;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return l.getLogLevelName}})})(Sm);var BI=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},Mfe=He&&He.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(y_,"__esModule",{value:!0});y_.createLogWriter=void 0;var Rfe=v_,Ofe=pT,$fe=Mfe(Cde),X5=BL,zI=Sm,jI=(0,$fe.default)(),Nfe={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"}},Ffe={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},Dfe=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,X5.parse)(t):null},Lfe=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:jI.localStorage,s=(r=e==null?void 0:e.logMethods)!==null&&r!==void 0?r:(0,Rfe.createLogMethods)();if(!o&&!jI.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,Ofe.boolean)(o.getItem("ROARR_LOG")))return function(){};var a=Dfe(o);return i?function(l){var c=JSON.parse(l),u=c.context,d=u.logLevel,f=u.namespace,h=BI(u,["logLevel","namespace"]);if(!(a&&!(0,X5.test)(a,c))){var p=(0,zI.getLogLevelName)(Number(d)),m=s[p],_=Nfe[p],v=`
background-color: `.concat(_.backgroundColor,`;
color: `).concat(_.color,`;
font-weight: bold;
`),y=`
color: `.concat(Ffe[p].color,`;
`),g=`
color: inherit;
`;Object.keys(h).length>0?m("%c ".concat(p," %c").concat(f?" [".concat(String(f),"]:"):"","%c ").concat(c.message," %O"),v,y,g,h):m("%c ".concat(p," %c").concat(f?" [".concat(String(f),"]:"):"","%c ").concat(c.message),v,y,g)}}:function(l){var c=JSON.parse(l),u=c.context,d=u.logLevel,f=u.namespace,h=BI(u,["logLevel","namespace"]);if(!(a&&!(0,X5.test)(a,c))){var p=(0,zI.getLogLevelName)(Number(d)),m=s[p];Object.keys(h).length>0?m("".concat(p," ").concat(f?" [".concat(String(f),"]:"):""," ").concat(c.message),h):m("".concat(p," ").concat(f?" [".concat(String(f),"]:"):""," ").concat(c.message))}}};y_.createLogWriter=Lfe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=y_;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(AL);Sm.ROARR.write=AL.createLogWriter();const eB={};Sm.Roarr.child(eB);const B_=to(Sm.Roarr.child(eB)),ue=e=>B_.get().child({namespace:e}),$Ue=["trace","debug","info","warn","error","fatal"],NUe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},tB=T.object({lora:eT.deepPartial(),weight:T.number()}),Bfe=xle.deepPartial(),zfe=wle.deepPartial(),jfe=Cle.deepPartial(),Vfe=KD.deepPartial(),Ufe=T.union([HD.deepPartial(),WD.deepPartial()]),Gfe=J4.deepPartial(),Hfe=T.object({app_version:T.string().nullish().catch(null),generation_mode:T.string().nullish().catch(null),created_by:T.string().nullish().catch(null),positive_prompt:T.string().nullish().catch(null),negative_prompt:T.string().nullish().catch(null),width:T.number().int().nullish().catch(null),height:T.number().int().nullish().catch(null),seed:T.number().int().nullish().catch(null),rand_device:T.string().nullish().catch(null),cfg_scale:T.number().nullish().catch(null),cfg_rescale_multiplier:T.number().nullish().catch(null),steps:T.number().int().nullish().catch(null),scheduler:T.string().nullish().catch(null),clip_skip:T.number().int().nullish().catch(null),model:Ufe.nullish().catch(null),controlnets:T.array(Bfe).nullish().catch(null),ipAdapters:T.array(zfe).nullish().catch(null),t2iAdapters:T.array(jfe).nullish().catch(null),loras:T.array(tB).nullish().catch(null),vae:Gfe.nullish().catch(null),strength:T.number().nullish().catch(null),hrf_enabled:T.boolean().nullish().catch(null),hrf_strength:T.number().nullish().catch(null),hrf_method:T.string().nullish().catch(null),init_image:T.string().nullish().catch(null),positive_style_prompt:T.string().nullish().catch(null),negative_style_prompt:T.string().nullish().catch(null),refiner_model:Vfe.nullish().catch(null),refiner_cfg_scale:T.number().nullish().catch(null),refiner_steps:T.number().int().nullish().catch(null),refiner_scheduler:T.string().nullish().catch(null),refiner_positive_aesthetic_score:T.number().nullish().catch(null),refiner_negative_aesthetic_score:T.number().nullish().catch(null),refiner_start:T.number().nullish().catch(null)}).passthrough(),ce=Lo.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 Ot.addMany(Ot.getInitialState(),n)},merge:(t,n)=>{Ot.addMany(t,_g.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;_g.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=Hfe.safeParse(t);if(n.success)return n.data;ue("images").warn("Problem parsing metadata")}},keepUnusedDataFor:86400}),getImageWorkflow:e.query({query:t=>({url:`images/i/${t}/workflow`}),providesTags:(t,n,r)=>[{type:"ImageWorkflow",id:r}],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,s=Pr.includes(t.image_category),a={board_id:o??"none",categories:Fi(t)},l=[];l.push(n(ce.util.updateQueryData("listImages",a,c=>{Ot.removeOne(c,i)}))),l.push(n(Qe.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",c=>{c.total=Math.max(c.total-1,0)})));try{await r}catch{l.forEach(c=>{c.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;i.deleted_images.length<t.length&&n(Ve({title:J("gallery.problemDeletingImages"),description:J("gallery.problemDeletingImagesDesc"),status:"warning"}));const o=VF(t,"image_name");i.deleted_images.forEach(s=>{const a=o[s];if(a){const l={board_id:a.board_id??"none",categories:Fi(a)};n(ce.util.updateQueryData("listImages",l,u=>{Ot.removeOne(u,s)}));const c=Pr.includes(a.image_category);n(Qe.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal",a.board_id??"none",u=>{u.total=Math.max(u.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 s=[];s.push(r(ce.util.updateQueryData("getImageDTO",t.image_name,c=>{Object.assign(c,{is_intermediate:n})})));const a=Fi(t),l=Pr.includes(t.image_category);if(n)s.push(r(ce.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:a},c=>{Ot.removeOne(c,t.image_name)}))),s.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",c=>{c.total=Math.max(c.total-1,0)})));else{s.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",p=>{p.total+=1})));const c={board_id:t.board_id??"none",categories:a},u=ce.endpoints.listImages.select(c)(o()),{data:d}=Rn.includes(t.image_category)?Qe.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=u.data&&u.data.ids.length>=((d==null?void 0:d.total)??0),h=Xl(u.data,t);(f||h)&&s.push(r(ce.util.updateQueryData("listImages",c,p=>{Ot.upsertOne(p,t)})))}try{await i}catch{s.forEach(c=>c.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,s=>{Object.assign(s,{session_id:n})})));try{await i}catch{o.forEach(s=>s.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=Fi(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,s=t.filter(c=>o.updated_image_names.includes(c.image_name));if(!s[0])return;const a=Fi(s[0]),l=s[0].board_id;s.forEach(c=>{const{image_name:u}=c;n(ce.util.updateQueryData("getImageDTO",u,_=>{_.starred=!0}));const d={board_id:l??"none",categories:a},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Rn.includes(c.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),m=((h==null?void 0:h.total)??0)>=K0?Xl(f.data,c):!0;(p||m)&&n(ce.util.updateQueryData("listImages",d,_=>{Ot.upsertOne(_,{...c,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=Fi(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,s=t.filter(c=>o.updated_image_names.includes(c.image_name));if(!s[0])return;const a=Fi(s[0]),l=s[0].board_id;s.forEach(c=>{const{image_name:u}=c;n(ce.util.updateQueryData("getImageDTO",u,_=>{_.starred=!1}));const d={board_id:l??"none",categories:a},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Rn.includes(c.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),m=((h==null?void 0:h.total)??0)>=K0?Xl(f.data,c):!0;(p||m)&&n(ce.util.updateQueryData("listImages",d,_=>{Ot.upsertOne(_,{...c,starred:!1})}))})}catch{}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:s})=>{const a=new FormData;return a.append("file",t),{url:"images/upload",method:"POST",body:a,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:s}}},async onQueryStarted(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=Fi(i);n(ce.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},s=>{Ot.addOne(s,i)})),n(Qe.util.updateQueryData("getBoardAssetsTotal",i.board_id??"none",s=>{s.total+=1}))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:Ir},{type:"ImageList",id:Vi({board_id:"none",categories:Rn})},{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,c=>{c.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 s=[{categories:Rn},{categories:Pr}],a=o.map(l=>({id:l,changes:{board_id:void 0}}));s.forEach(l=>{n(ce.util.updateQueryData("listImages",l,c=>{Ot.updateMany(c,a)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:Ir},{type:"ImageList",id:Vi({board_id:"none",categories:Rn})},{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:Rn},{categories:Pr}].forEach(a=>{n(ce.util.updateQueryData("listImages",a,l=>{Ot.removeMany(l,o)}))}),n(Qe.util.updateQueryData("getBoardAssetsTotal",t,a=>{a.total=0})),n(Qe.util.updateQueryData("getBoardImagesTotal",t,a=>{a.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 s=[],a=Fi(n),l=Pr.includes(n.image_category);if(s.push(r(ce.util.updateQueryData("getImageDTO",n.image_name,c=>{c.board_id=t}))),!n.is_intermediate){s.push(r(ce.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:a},p=>{Ot.removeOne(p,n.image_name)}))),s.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",n.board_id??"none",p=>{p.total=Math.max(p.total-1,0)}))),s.push(r(Qe.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",p=>{p.total+=1})));const c={board_id:t??"none",categories:a},u=ce.endpoints.listImages.select(c)(o()),{data:d}=Rn.includes(n.image_category)?Qe.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=u.data&&u.data.ids.length>=((d==null?void 0:d.total)??0),h=Xl(u.data,n);(f||h)&&s.push(r(ce.util.updateQueryData("listImages",c,p=>{Ot.addOne(p,n)})))}try{await i}catch{s.forEach(c=>c.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=Fi(t),s=[],a=Pr.includes(t.image_category);s.push(n(ce.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),s.push(n(ce.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Ot.removeOne(h,t.image_name)}))),s.push(n(Qe.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",h=>{h.total=Math.max(h.total-1,0)}))),s.push(n(Qe.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal","none",h=>{h.total+=1})));const l={board_id:"none",categories:o},c=ce.endpoints.listImages.select(l)(i()),{data:u}=Rn.includes(t.image_category)?Qe.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Qe.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=c.data&&c.data.ids.length>=((u==null?void 0:u.total)??0),f=Xl(c.data,t);(d||f)&&s.push(n(ce.util.updateQueryData("listImages",l,h=>{Ot.upsertOne(h,t)})));try{await r}catch{s.forEach(h=>h.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r??"none"}],async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:s}=await i,{added_image_names:a}=s;a.forEach(l=>{r(ce.util.updateQueryData("getImageDTO",l,y=>{y.board_id=t==="none"?void 0:t}));const c=n.find(y=>y.image_name===l);if(!c)return;const u=Fi(c),d=c.board_id,f=Pr.includes(c.image_category);r(ce.util.updateQueryData("listImages",{board_id:d??"none",categories:u},y=>{Ot.removeOne(y,c.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:u},p=ce.endpoints.listImages.select(h)(o()),{data:m}=Rn.includes(c.image_category)?Qe.endpoints.getBoardImagesTotal.select(t??"none")(o()):Qe.endpoints.getBoardAssetsTotal.select(t??"none")(o()),_=p.data&&p.data.ids.length>=((m==null?void 0:m.total)??0),v=((m==null?void 0:m.total)??0)>=K0?Xl(p.data,c):!0;(_||v)&&r(ce.util.updateQueryData("listImages",h,y=>{Ot.upsertOne(y,{...c,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(s=>{var l;const a=(l=r.find(c=>c.image_name===s))==null?void 0:l.board_id;!a||i.includes(a)||o.push({type:"Board",id:a})}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:s}=o;s.forEach(a=>{n(ce.util.updateQueryData("getImageDTO",a,_=>{_.board_id=void 0}));const l=t.find(_=>_.image_name===a);if(!l)return;const c=Fi(l),u=Pr.includes(l.image_category);n(ce.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:c},_=>{Ot.removeOne(_,l.image_name)})),n(Qe.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal",l.board_id??"none",_=>{_.total=Math.max(_.total-1,0)})),n(Qe.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal","none",_=>{_.total+=1}));const d={board_id:"none",categories:c},f=ce.endpoints.listImages.select(d)(i()),{data:h}=Rn.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),m=((h==null?void 0:h.total)??0)>=K0?Xl(f.data,l):!0;(p||m)&&n(ce.util.updateQueryData("listImages",d,_=>{Ot.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:FUe,useListImagesQuery:DUe,useLazyListImagesQuery:LUe,useGetImageDTOQuery:BUe,useGetImageMetadataQuery:zUe,useGetImageWorkflowQuery:jUe,useLazyGetImageWorkflowQuery:VUe,useDeleteImageMutation:UUe,useDeleteImagesMutation:GUe,useUploadImageMutation:HUe,useClearIntermediatesMutation:WUe,useAddImagesToBoardMutation:qUe,useRemoveImagesFromBoardMutation:KUe,useAddImageToBoardMutation:XUe,useRemoveImageFromBoardMutation:QUe,useChangeImageIsIntermediateMutation:YUe,useChangeImageSessionIdMutation:ZUe,useDeleteBoardAndImagesMutation:JUe,useDeleteBoardMutation:eGe,useStarImagesMutation:tGe,useUnstarImagesMutation:nGe,useBulkDownloadImagesMutation:rGe}=ce,nB={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},rB=jt({name:"gallery",initialState:nB,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=YF(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(qfe,(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:ps,shouldAutoSwitchChanged:iGe,autoAssignBoardOnClickChanged:oGe,setGalleryImageMinimumWidth:sGe,boardIdSelected:vp,autoAddBoardIdChanged:aGe,galleryViewChanged:Q5,selectionChanged:iB,boardSearchTextChanged:lGe}=rB.actions,Wfe=rB.reducer,qfe=br(ce.endpoints.deleteBoard.matchFulfilled,ce.endpoints.deleteBoardAndImages.matchFulfilled),VI={weight:.75},Kfe={loras:{}},oB=jt({name:"lora",initialState:Kfe,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,...VI}},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=VI.weight)}}}),{loraAdded:cGe,loraRemoved:sB,loraWeightChanged:uGe,loraWeightReset:dGe,lorasCleared:fGe,loraRecalled:hGe}=oB.actions,Xfe=oB.reducer,Qfe={searchFolder:null,advancedAddScanModel:null},aB=jt({name:"modelmanager",initialState:Qfe,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:pGe,setAdvancedAddScanModel:gGe}=aB.actions,Yfe=aB.reducer,Zfe=he("nodes/textToImageGraphBuilt"),Jfe=he("nodes/imageToImageGraphBuilt"),lB=he("nodes/canvasGraphBuilt"),ehe=he("nodes/nodesGraphBuilt"),the=br(Zfe,Jfe,lB,ehe),nhe=he("nodes/workflowLoadRequested"),rhe=he("nodes/updateAllNodesRequested"),yT=he("workflow/workflowLoaded"),mGe=500,yGe=320,ihe="node-drag-handle",cB={dragHandle:`.${ihe}`},vGe={input:"inputs",output:"outputs"},bGe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField","T2IAdapterModelField","IPAdapterModelField"],_Ge={BoardField:"purple.500",BooleanField:"green.500",ClipField:"green.500",ColorField:"pink.300",ConditioningField:"cyan.500",ControlField:"teal.500",ControlNetModelField:"teal.500",EnumField:"blue.500",FloatField:"orange.500",ImageField:"purple.500",IntegerField:"red.500",IPAdapterField:"teal.500",IPAdapterModelField:"teal.500",LatentsField:"pink.500",LoRAModelField:"teal.500",MainModelField:"teal.500",ONNXModelField:"teal.500",SDXLMainModelField:"teal.500",SDXLRefinerModelField:"teal.500",StringField:"yellow.500",T2IAdapterField:"teal.500",T2IAdapterModelField:"teal.500",UNetField:"red.500",VaeField:"blue.500",VaeModelField:"teal.500"},ohe=T.enum(["connection","direct","any"]),she=T.enum(["none","textarea","slider"]),uB=T.object({id:T.string().trim().min(1),name:T.string().trim().min(1)}),Bn=uB.extend({fieldKind:T.literal("input"),label:T.string().nullish()}),zn=uB.extend({fieldKind:T.literal("output")}),dB=T.object({name:T.string().min(1),title:T.string().min(1),description:T.string().nullish(),ui_hidden:T.boolean(),ui_type:T.string().nullish(),ui_order:T.number().int().nullish()}),jn=dB.extend({fieldKind:T.literal("input"),input:ohe,required:T.boolean(),ui_component:she.nullish(),ui_choice_labels:T.record(T.string()).nullish()}),Vn=dB.extend({fieldKind:T.literal("output")}),Un=T.object({isCollection:T.boolean(),isCollectionOrScalar:T.boolean()}),ahe=T.object({nodeId:T.string().trim().min(1),fieldName:T.string().trim().min(1)}),xm=Un.extend({name:T.literal("IntegerField")}),z_=T.number().int(),fB=Bn.extend({type:xm,value:z_}),lhe=zn.extend({type:xm}),hB=jn.extend({type:xm,default:z_,multipleOf:T.number().int().optional(),maximum:T.number().int().optional(),exclusiveMaximum:T.number().int().optional(),minimum:T.number().int().optional(),exclusiveMinimum:T.number().int().optional()}),che=Vn.extend({type:xm}),SGe=e=>fB.safeParse(e).success,xGe=e=>hB.safeParse(e).success,wm=Un.extend({name:T.literal("FloatField")}),j_=T.number(),pB=Bn.extend({type:wm,value:j_}),uhe=zn.extend({type:wm}),gB=jn.extend({type:wm,default:j_,multipleOf:T.number().optional(),maximum:T.number().optional(),exclusiveMaximum:T.number().optional(),minimum:T.number().optional(),exclusiveMinimum:T.number().optional()}),dhe=Vn.extend({type:wm}),wGe=e=>pB.safeParse(e).success,CGe=e=>gB.safeParse(e).success,Cm=Un.extend({name:T.literal("StringField")}),V_=T.string(),mB=Bn.extend({type:Cm,value:V_}),fhe=zn.extend({type:Cm}),yB=jn.extend({type:Cm,default:V_,maxLength:T.number().int().optional(),minLength:T.number().int().optional()}),hhe=Vn.extend({type:Cm}),EGe=e=>mB.safeParse(e).success,TGe=e=>yB.safeParse(e).success,Em=Un.extend({name:T.literal("BooleanField")}),U_=T.boolean(),vB=Bn.extend({type:Em,value:U_}),phe=zn.extend({type:Em}),bB=jn.extend({type:Em,default:U_}),ghe=Vn.extend({type:Em}),AGe=e=>vB.safeParse(e).success,kGe=e=>bB.safeParse(e).success,Tm=Un.extend({name:T.literal("EnumField")}),G_=T.string(),_B=Bn.extend({type:Tm,value:G_}),mhe=zn.extend({type:Tm}),SB=jn.extend({type:Tm,default:G_,options:T.array(T.string()),labels:T.record(T.string()).optional()}),yhe=Vn.extend({type:Tm}),PGe=e=>_B.safeParse(e).success,IGe=e=>SB.safeParse(e).success,Am=Un.extend({name:T.literal("ImageField")}),H_=mm.optional(),xB=Bn.extend({type:Am,value:H_}),vhe=zn.extend({type:Am}),wB=jn.extend({type:Am,default:H_}),bhe=Vn.extend({type:Am}),vT=e=>xB.safeParse(e).success,MGe=e=>wB.safeParse(e).success,km=Un.extend({name:T.literal("BoardField")}),W_=yle.optional(),CB=Bn.extend({type:km,value:W_}),_he=zn.extend({type:km}),EB=jn.extend({type:km,default:W_}),She=Vn.extend({type:km}),RGe=e=>CB.safeParse(e).success,OGe=e=>EB.safeParse(e).success,Pm=Un.extend({name:T.literal("ColorField")}),q_=vle.optional(),TB=Bn.extend({type:Pm,value:q_}),xhe=zn.extend({type:Pm}),AB=jn.extend({type:Pm,default:q_}),whe=Vn.extend({type:Pm}),Che=e=>TB.safeParse(e).success,$Ge=e=>AB.safeParse(e).success,Im=Un.extend({name:T.literal("MainModelField")}),Df=qD.optional(),kB=Bn.extend({type:Im,value:Df}),Ehe=zn.extend({type:Im}),PB=jn.extend({type:Im,default:Df}),The=Vn.extend({type:Im}),NGe=e=>kB.safeParse(e).success,FGe=e=>PB.safeParse(e).success,Mm=Un.extend({name:T.literal("SDXLMainModelField")}),bT=Df,IB=Bn.extend({type:Mm,value:bT}),Ahe=zn.extend({type:Mm}),MB=jn.extend({type:Mm,default:bT}),khe=Vn.extend({type:Mm}),DGe=e=>IB.safeParse(e).success,LGe=e=>MB.safeParse(e).success,Rm=Un.extend({name:T.literal("SDXLRefinerModelField")}),K_=Df,RB=Bn.extend({type:Rm,value:K_}),Phe=zn.extend({type:Rm}),OB=jn.extend({type:Rm,default:K_}),Ihe=Vn.extend({type:Rm}),BGe=e=>RB.safeParse(e).success,zGe=e=>OB.safeParse(e).success,Om=Un.extend({name:T.literal("VAEModelField")}),X_=J4.optional(),$B=Bn.extend({type:Om,value:X_}),Mhe=zn.extend({type:Om}),NB=jn.extend({type:Om,default:X_}),Rhe=Vn.extend({type:Om}),jGe=e=>$B.safeParse(e).success,VGe=e=>NB.safeParse(e).success,$m=Un.extend({name:T.literal("LoRAModelField")}),Q_=eT.optional(),FB=Bn.extend({type:$m,value:Q_}),Ohe=zn.extend({type:$m}),DB=jn.extend({type:$m,default:Q_}),$he=Vn.extend({type:$m}),UGe=e=>FB.safeParse(e).success,GGe=e=>DB.safeParse(e).success,Nm=Un.extend({name:T.literal("ControlNetModelField")}),Y_=tT.optional(),LB=Bn.extend({type:Nm,value:Y_}),Nhe=zn.extend({type:Nm}),BB=jn.extend({type:Nm,default:Y_}),Fhe=Vn.extend({type:Nm}),HGe=e=>LB.safeParse(e).success,WGe=e=>BB.safeParse(e).success,Fm=Un.extend({name:T.literal("IPAdapterModelField")}),Z_=nT.optional(),zB=Bn.extend({type:Fm,value:Z_}),Dhe=zn.extend({type:Fm}),jB=jn.extend({type:Fm,default:Z_}),Lhe=Vn.extend({type:Fm}),qGe=e=>zB.safeParse(e).success,KGe=e=>jB.safeParse(e).success,Dm=Un.extend({name:T.literal("T2IAdapterModelField")}),J_=rT.optional(),VB=Bn.extend({type:Dm,value:J_}),Bhe=zn.extend({type:Dm}),UB=jn.extend({type:Dm,default:J_}),zhe=Vn.extend({type:Dm}),XGe=e=>VB.safeParse(e).success,QGe=e=>UB.safeParse(e).success,Lm=Un.extend({name:T.literal("SchedulerField")}),eS=GD.optional(),GB=Bn.extend({type:Lm,value:eS}),jhe=zn.extend({type:Lm}),HB=jn.extend({type:Lm,default:eS}),Vhe=Vn.extend({type:Lm}),YGe=e=>GB.safeParse(e).success,ZGe=e=>HB.safeParse(e).success,Bm=Un.extend({name:T.string().min(1)}),_T=T.undefined().catch(void 0),Uhe=Bn.extend({type:Bm,value:_T}),Ghe=zn.extend({type:Bm}),WB=jn.extend({type:Bm,default:_T,input:T.literal("connection")}),Hhe=Vn.extend({type:Bm}),qB=T.union([xm,wm,Cm,Em,Tm,Am,km,Im,Mm,Rm,Om,$m,Nm,Fm,Dm,Pm,Lm]),Whe=e=>qB.safeParse(e).success;T.union([qB,Bm]);const qhe=T.union([z_,j_,V_,U_,G_,H_,W_,Df,bT,K_,X_,Q_,Y_,Z_,J_,q_,eS]);T.union([qhe,_T]);const Khe=T.union([fB,pB,mB,vB,_B,xB,CB,kB,IB,RB,$B,FB,LB,zB,VB,TB,GB]),KB=T.union([Khe,Uhe]),JGe=e=>KB.safeParse(e).success,Xhe=T.union([lhe,uhe,fhe,phe,mhe,vhe,_he,Ehe,Ahe,Phe,Mhe,Ohe,Nhe,Dhe,Bhe,xhe,jhe]),Qhe=T.union([Xhe,Ghe]),Yhe=T.union([hB,gB,yB,bB,SB,wB,EB,PB,MB,OB,NB,DB,BB,jB,UB,AB,HB,WB]),XB=T.union([Yhe,WB]),eHe=e=>XB.safeParse(e).success,Zhe=T.union([che,dhe,hhe,ghe,yhe,bhe,She,The,khe,Ihe,Rhe,$he,Fhe,Lhe,zhe,whe,Vhe]),Jhe=T.union([Zhe,Hhe]),nw=T.coerce.number().int().min(0),tS=T.string().refine(e=>{const[t,n,r]=e.split(".");return nw.safeParse(t).success&&nw.safeParse(n).success&&nw.safeParse(r).success}),epe=tS.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});T.object({type:T.string(),title:T.string(),description:T.string(),tags:T.array(T.string().min(1)),inputs:T.record(XB),outputs:T.record(Jhe),outputType:T.string().min(1),version:tS,useCache:T.boolean(),nodePack:T.string().min(1).nullish(),classification:ble});const QB=T.object({id:T.string().trim().min(1),type:T.string().trim().min(1),label:T.string(),isOpen:T.boolean(),notes:T.string(),isIntermediate:T.boolean(),useCache:T.boolean(),version:tS,nodePack:T.string().min(1).nullish(),inputs:T.record(KB),outputs:T.record(Qhe)}),YB=T.object({id:T.string().trim().min(1),type:T.literal("notes"),label:T.string(),isOpen:T.boolean(),notes:T.string()}),tpe=T.object({id:T.string().trim().min(1),type:T.literal("current_image"),label:T.string(),isOpen:T.boolean()});T.union([QB,YB,tpe]);const Sn=e=>!!(e&&e.type==="invocation"),Y5=e=>!!(e&&e.type==="notes"),tHe=e=>!!(e&&!["notes","current_image"].includes(e.type)),gc=T.enum(["PENDING","IN_PROGRESS","COMPLETED","FAILED"]);T.object({nodeId:T.string().trim().min(1),status:gc,progress:T.number().nullable(),progressImage:Ele.nullable(),error:T.string().nullable(),outputs:T.array(T.any())});T.object({type:T.union([T.literal("default"),T.literal("collapsed")])});function no(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=no(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ZB={exports:{}},JB={},ez={exports:{}},tz={};/**
* @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 hf=I;function npe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rpe=typeof Object.is=="function"?Object.is:npe,ipe=hf.useState,ope=hf.useEffect,spe=hf.useLayoutEffect,ape=hf.useDebugValue;function lpe(e,t){var n=t(),r=ipe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return spe(function(){i.value=n,i.getSnapshot=t,rw(i)&&o({inst:i})},[e,n,t]),ope(function(){return rw(i)&&o({inst:i}),e(function(){rw(i)&&o({inst:i})})},[e]),ape(n),n}function rw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rpe(e,n)}catch{return!0}}function cpe(e,t){return t()}var upe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cpe:lpe;tz.useSyncExternalStore=hf.useSyncExternalStore!==void 0?hf.useSyncExternalStore:upe;ez.exports=tz;var dpe=ez.exports;/**
* @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 nS=I,fpe=dpe;function hpe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ppe=typeof Object.is=="function"?Object.is:hpe,gpe=fpe.useSyncExternalStore,mpe=nS.useRef,ype=nS.useEffect,vpe=nS.useMemo,bpe=nS.useDebugValue;JB.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=mpe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=vpe(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return d=p}return d=h}if(p=d,ppe(u,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(u=h,d=m)}var c=!1,u,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 a=gpe(e,o[0],o[1]);return ype(function(){s.hasValue=!0,s.value=a},[a]),bpe(a),a};ZB.exports=JB;var _pe=ZB.exports;const Spe=Ml(_pe),UI=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},xpe=e=>e?UI(e):UI,{useSyncExternalStoreWithSelector:wpe}=Spe;function nz(e,t=e.getState,n){const r=wpe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return I.useDebugValue(r),r}const GI=(e,t)=>{const n=xpe(e),r=(i,o=t)=>nz(n,i,o);return Object.assign(r,n),r},Cpe=(e,t)=>e?GI(e,t):GI;function ti(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 Epe={value:()=>{}};function rS(){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 tv(n)}function tv(e){this._=e}function Tpe(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}})}tv.prototype=rS.prototype={constructor:tv,on:function(e,t){var n=this._,r=Tpe(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Ape(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=HI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=HI(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 tv(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 Ape(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function HI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Epe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Z5="http://www.w3.org/1999/xhtml";const WI={svg:"http://www.w3.org/2000/svg",xhtml:Z5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function iS(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),WI.hasOwnProperty(t)?{space:WI[t],local:e}:e}function kpe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Z5&&t.documentElement.namespaceURI===Z5?t.createElement(e):t.createElementNS(n,e)}}function Ppe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rz(e){var t=iS(e);return(t.local?Ppe:kpe)(t)}function Ipe(){}function ST(e){return e==null?Ipe:function(){return this.querySelector(e)}}function Mpe(e){typeof e!="function"&&(e=ST(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=o[u])&&(c=e.call(l,l.__data__,u,o))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new Ti(r,this._parents)}function Rpe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ope(){return[]}function iz(e){return e==null?Ope:function(){return this.querySelectorAll(e)}}function $pe(e){return function(){return Rpe(e.apply(this,arguments))}}function Npe(e){typeof e=="function"?e=$pe(e):e=iz(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new Ti(r,i)}function oz(e){return function(){return this.matches(e)}}function sz(e){return function(t){return t.matches(e)}}var Fpe=Array.prototype.find;function Dpe(e){return function(){return Fpe.call(this.children,e)}}function Lpe(){return this.firstElementChild}function Bpe(e){return this.select(e==null?Lpe:Dpe(typeof e=="function"?e:sz(e)))}var zpe=Array.prototype.filter;function jpe(){return Array.from(this.children)}function Vpe(e){return function(){return zpe.call(this.children,e)}}function Upe(e){return this.selectAll(e==null?jpe:Vpe(typeof e=="function"?e:sz(e)))}function Gpe(e){typeof e!="function"&&(e=oz(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&a.push(l);return new Ti(r,this._parents)}function az(e){return new Array(e.length)}function Hpe(){return new Ti(this._enter||this._groups.map(az),this._parents)}function k1(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}k1.prototype={constructor:k1,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 Wpe(e){return function(){return e}}function qpe(e,t,n,r,i,o){for(var s=0,a,l=t.length,c=o.length;s<c;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new k1(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Kpe(e,t,n,r,i,o,s){var a,l,c=new Map,u=t.length,d=o.length,f=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?i[a]=l:c.set(h,l));for(a=0;a<d;++a)h=s.call(e,o[a],a,o)+"",(l=c.get(h))?(r[a]=l,l.__data__=o[a],c.delete(h)):n[a]=new k1(e,o[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(i[a]=l)}function Xpe(e){return e.__data__}function Qpe(e,t){if(!arguments.length)return Array.from(this,Xpe);var n=t?Kpe:qpe,r=this._parents,i=this._groups;typeof e!="function"&&(e=Wpe(e));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],d=i[c],f=d.length,h=Ype(e.call(u,u&&u.__data__,c,r)),p=h.length,m=a[c]=new Array(p),_=s[c]=new Array(p),v=l[c]=new Array(f);n(u,d,m,_,v,h,t);for(var y=0,g=0,b,S;y<p;++y)if(b=m[y]){for(y>=g&&(g=y+1);!(S=_[g])&&++g<p;);b._next=S||null}}return s=new Ti(s,r),s._enter=a,s._exit=l,s}function Ype(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zpe(){return new Ti(this._exit||this._groups.map(az),this._parents)}function Jpe(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 ege(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=n[l],u=r[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<i;++l)a[l]=n[l];return new Ti(a,this._parents)}function tge(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function nge(e){e||(e=rge);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 s=n[o],a=s.length,l=i[o]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Ti(i,this._parents).order()}function rge(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ige(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oge(){return Array.from(this)}function sge(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function age(){let e=0;for(const t of this)++e;return e}function lge(){return!this.node()}function cge(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function uge(e){return function(){this.removeAttribute(e)}}function dge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fge(e,t){return function(){this.setAttribute(e,t)}}function hge(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pge(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gge(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 mge(e,t){var n=iS(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?dge:uge:typeof t=="function"?n.local?gge:pge:n.local?hge:fge)(n,t))}function lz(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yge(e){return function(){this.style.removeProperty(e)}}function vge(e,t,n){return function(){this.style.setProperty(e,t,n)}}function bge(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function _ge(e,t,n){return arguments.length>1?this.each((t==null?yge:typeof t=="function"?bge:vge)(e,t,n??"")):pf(this.node(),e)}function pf(e,t){return e.style.getPropertyValue(t)||lz(e).getComputedStyle(e,null).getPropertyValue(t)}function Sge(e){return function(){delete this[e]}}function xge(e,t){return function(){this[e]=t}}function wge(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Cge(e,t){return arguments.length>1?this.each((t==null?Sge:typeof t=="function"?wge:xge)(e,t)):this.node()[e]}function cz(e){return e.trim().split(/^|\s+/)}function xT(e){return e.classList||new uz(e)}function uz(e){this._node=e,this._names=cz(e.getAttribute("class")||"")}uz.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 dz(e,t){for(var n=xT(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function fz(e,t){for(var n=xT(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ege(e){return function(){dz(this,e)}}function Tge(e){return function(){fz(this,e)}}function Age(e,t){return function(){(t.apply(this,arguments)?dz:fz)(this,e)}}function kge(e,t){var n=cz(e+"");if(arguments.length<2){for(var r=xT(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Age:t?Ege:Tge)(n,t))}function Pge(){this.textContent=""}function Ige(e){return function(){this.textContent=e}}function Mge(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Rge(e){return arguments.length?this.each(e==null?Pge:(typeof e=="function"?Mge:Ige)(e)):this.node().textContent}function Oge(){this.innerHTML=""}function $ge(e){return function(){this.innerHTML=e}}function Nge(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Fge(e){return arguments.length?this.each(e==null?Oge:(typeof e=="function"?Nge:$ge)(e)):this.node().innerHTML}function Dge(){this.nextSibling&&this.parentNode.appendChild(this)}function Lge(){return this.each(Dge)}function Bge(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zge(){return this.each(Bge)}function jge(e){var t=typeof e=="function"?e:rz(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vge(){return null}function Uge(e,t){var n=typeof e=="function"?e:rz(e),r=t==null?Vge:typeof t=="function"?t:ST(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Gge(){var e=this.parentNode;e&&e.removeChild(this)}function Hge(){return this.each(Gge)}function Wge(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qge(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kge(e){return this.select(e?qge:Wge)}function Xge(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qge(e){return function(t){e.call(this,t,this.__data__)}}function Yge(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 Zge(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 Jge(e,t,n){return function(){var r=this.__on,i,o=Qge(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function eme(e,t,n){var r=Yge(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(i=0,u=a[l];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Jge:Zge,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function hz(e,t,n){var r=lz(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 tme(e,t){return function(){return hz(this,e,t)}}function nme(e,t){return function(){return hz(this,e,t.apply(this,arguments))}}function rme(e,t){return this.each((typeof t=="function"?nme:tme)(e,t))}function*ime(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var pz=[null];function Ti(e,t){this._groups=e,this._parents=t}function zm(){return new Ti([[document.documentElement]],pz)}function ome(){return this}Ti.prototype=zm.prototype={constructor:Ti,select:Mpe,selectAll:Npe,selectChild:Bpe,selectChildren:Upe,filter:Gpe,data:Qpe,enter:Hpe,exit:Zpe,join:Jpe,merge:ege,selection:ome,order:tge,sort:nge,call:ige,nodes:oge,node:sge,size:age,empty:lge,each:cge,attr:mge,style:_ge,property:Cge,classed:kge,text:Rge,html:Fge,raise:Lge,lower:zge,append:jge,insert:Uge,remove:Hge,clone:Kge,datum:Xge,on:eme,dispatch:rme,[Symbol.iterator]:ime};function xo(e){return typeof e=="string"?new Ti([[document.querySelector(e)]],[document.documentElement]):new Ti([[e]],pz)}function sme(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Jo(e,t){if(e=sme(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 ame={passive:!1},Sg={capture:!0,passive:!1};function iw(e){e.stopImmediatePropagation()}function Nd(e){e.preventDefault(),e.stopImmediatePropagation()}function gz(e){var t=e.document.documentElement,n=xo(e).on("dragstart.drag",Nd,Sg);"onselectstart"in t?n.on("selectstart.drag",Nd,Sg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mz(e,t){var n=e.document.documentElement,r=xo(e).on("dragstart.drag",null);t&&(r.on("click.drag",Nd,Sg),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 X0=e=>()=>e;function J5(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}J5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lme(e){return!e.ctrlKey&&!e.button}function cme(){return this.parentNode}function ume(e,t){return t??{x:e.x,y:e.y}}function dme(){return navigator.maxTouchPoints||"ontouchstart"in this}function fme(){var e=lme,t=cme,n=ume,r=dme,i={},o=rS("start","drag","end"),s=0,a,l,c,u,d=0;function f(b){b.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",v,ame).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(b,S){if(!(u||!e.call(this,b,S))){var w=g(this,t.call(this,b,S),b,S,"mouse");w&&(xo(b.view).on("mousemove.drag",p,Sg).on("mouseup.drag",m,Sg),gz(b.view),iw(b),c=!1,a=b.clientX,l=b.clientY,w("start",b))}}function p(b){if(Nd(b),!c){var S=b.clientX-a,w=b.clientY-l;c=S*S+w*w>d}i.mouse("drag",b)}function m(b){xo(b.view).on("mousemove.drag mouseup.drag",null),mz(b.view,c),Nd(b),i.mouse("end",b)}function _(b,S){if(e.call(this,b,S)){var w=b.changedTouches,C=t.call(this,b,S),x=w.length,k,A;for(k=0;k<x;++k)(A=g(this,C,b,S,w[k].identifier,w[k]))&&(iw(b),A("start",b,w[k]))}}function v(b){var S=b.changedTouches,w=S.length,C,x;for(C=0;C<w;++C)(x=i[S[C].identifier])&&(Nd(b),x("drag",b,S[C]))}function y(b){var S=b.changedTouches,w=S.length,C,x;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<w;++C)(x=i[S[C].identifier])&&(iw(b),x("end",b,S[C]))}function g(b,S,w,C,x,k){var A=o.copy(),R=Jo(k||w,S),L,M,E;if((E=n.call(b,new J5("beforestart",{sourceEvent:w,target:f,identifier:x,active:s,x:R[0],y:R[1],dx:0,dy:0,dispatch:A}),C))!=null)return L=E.x-R[0]||0,M=E.y-R[1]||0,function P(O,F,$){var D=R,N;switch(O){case"start":i[x]=P,N=s++;break;case"end":delete i[x],--s;case"drag":R=Jo($||F,S),N=s;break}A.call(O,b,new J5(O,{sourceEvent:F,subject:E,target:f,identifier:x,active:N,x:R[0]+L,y:R[1]+M,dx:R[0]-D[0],dy:R[1]-D[1],dispatch:A}),C)}}return f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:X0(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:X0(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:X0(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:X0(!!b),f):r},f.on=function(){var b=o.on.apply(o,arguments);return b===o?f:b},f.clickDistance=function(b){return arguments.length?(d=(b=+b)*b,f):Math.sqrt(d)},f}function wT(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yz(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jm(){}var xg=.7,P1=1/xg,Fd="\\s*([+-]?\\d+)\\s*",wg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hme=/^#([0-9a-f]{3,8})$/,pme=new RegExp(`^rgb\\(${Fd},${Fd},${Fd}\\)$`),gme=new RegExp(`^rgb\\(${gs},${gs},${gs}\\)$`),mme=new RegExp(`^rgba\\(${Fd},${Fd},${Fd},${wg}\\)$`),yme=new RegExp(`^rgba\\(${gs},${gs},${gs},${wg}\\)$`),vme=new RegExp(`^hsl\\(${wg},${gs},${gs}\\)$`),bme=new RegExp(`^hsla\\(${wg},${gs},${gs},${wg}\\)$`),qI={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};wT(jm,Cg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:KI,formatHex:KI,formatHex8:_me,formatHsl:Sme,formatRgb:XI,toString:XI});function KI(){return this.rgb().formatHex()}function _me(){return this.rgb().formatHex8()}function Sme(){return vz(this).formatHsl()}function XI(){return this.rgb().formatRgb()}function Cg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hme.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?QI(t):n===3?new Qr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Q0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Q0(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=pme.exec(e))?new Qr(t[1],t[2],t[3],1):(t=gme.exec(e))?new Qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mme.exec(e))?Q0(t[1],t[2],t[3],t[4]):(t=yme.exec(e))?Q0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vme.exec(e))?JI(t[1],t[2]/100,t[3]/100,1):(t=bme.exec(e))?JI(t[1],t[2]/100,t[3]/100,t[4]):qI.hasOwnProperty(e)?QI(qI[e]):e==="transparent"?new Qr(NaN,NaN,NaN,0):null}function QI(e){return new Qr(e>>16&255,e>>8&255,e&255,1)}function Q0(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qr(e,t,n,r)}function xme(e){return e instanceof jm||(e=Cg(e)),e?(e=e.rgb(),new Qr(e.r,e.g,e.b,e.opacity)):new Qr}function e3(e,t,n,r){return arguments.length===1?xme(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}wT(Qr,e3,yz(jm,{brighter(e){return e=e==null?P1:Math.pow(P1,e),new Qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xg:Math.pow(xg,e),new Qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qr(Fc(this.r),Fc(this.g),Fc(this.b),I1(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:YI,formatHex:YI,formatHex8:wme,formatRgb:ZI,toString:ZI}));function YI(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}`}function wme(){return`#${xc(this.r)}${xc(this.g)}${xc(this.b)}${xc((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZI(){const e=I1(this.opacity);return`${e===1?"rgb(":"rgba("}${Fc(this.r)}, ${Fc(this.g)}, ${Fc(this.b)}${e===1?")":`, ${e})`}`}function I1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xc(e){return e=Fc(e),(e<16?"0":"")+e.toString(16)}function JI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wo(e,t,n,r)}function vz(e){if(e instanceof wo)return new wo(e.h,e.s,e.l,e.opacity);if(e instanceof jm||(e=Cg(e)),!e)return new wo;if(e instanceof wo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new wo(s,a,l,e.opacity)}function Cme(e,t,n,r){return arguments.length===1?vz(e):new wo(e,t,n,r??1)}function wo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}wT(wo,Cme,yz(jm,{brighter(e){return e=e==null?P1:Math.pow(P1,e),new wo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xg:Math.pow(xg,e),new wo(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 Qr(ow(e>=240?e-240:e+120,i,r),ow(e,i,r),ow(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new wo(e8(this.h),Y0(this.s),Y0(this.l),I1(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=I1(this.opacity);return`${e===1?"hsl(":"hsla("}${e8(this.h)}, ${Y0(this.s)*100}%, ${Y0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function e8(e){return e=(e||0)%360,e<0?e+360:e}function Y0(e){return Math.max(0,Math.min(1,e||0))}function ow(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 bz=e=>()=>e;function Eme(e,t){return function(n){return e+n*t}}function Tme(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 Ame(e){return(e=+e)==1?_z:function(t,n){return n-t?Tme(t,n,e):bz(isNaN(t)?n:t)}}function _z(e,t){var n=t-e;return n?Eme(e,n):bz(isNaN(e)?t:e)}const t8=function e(t){var n=Ame(t);function r(i,o){var s=n((i=e3(i)).r,(o=e3(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=_z(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function za(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var t3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sw=new RegExp(t3.source,"g");function kme(e){return function(){return e}}function Pme(e){return function(t){return e(t)+""}}function Ime(e,t){var n=t3.lastIndex=sw.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=t3.exec(e))&&(i=sw.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:za(r,i)})),n=sw.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Pme(l[0].x):kme(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var n8=180/Math.PI,n3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sz(e,t,n,r,i,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*n8,skewX:Math.atan(l)*n8,scaleX:s,scaleY:a}}var Z0;function Mme(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?n3:Sz(t.a,t.b,t.c,t.d,t.e,t.f)}function Rme(e){return e==null||(Z0||(Z0=document.createElementNS("http://www.w3.org/2000/svg","g")),Z0.setAttribute("transform",e),!(e=Z0.transform.baseVal.consolidate()))?n3:(e=e.matrix,Sz(e.a,e.b,e.c,e.d,e.e,e.f))}function xz(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,u,d,f,h,p){if(c!==d||u!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:za(c,d)},{i:m-2,x:za(u,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:za(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function a(c,u,d,f){c!==u?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:za(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,f,h,p){if(c!==d||u!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:za(c,d)},{i:m-2,x:za(u,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(h){for(var p=-1,m=f.length,_;++p<m;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var Ome=xz(Mme,"px, ","px)","deg)"),$me=xz(Rme,", ",")",")"),Nme=1e-12;function r8(e){return((e=Math.exp(e))+1/e)/2}function Fme(e){return((e=Math.exp(e))-1/e)/2}function Dme(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lme=function e(t,n,r){function i(o,s){var a=o[0],l=o[1],c=o[2],u=s[0],d=s[1],f=s[2],h=u-a,p=d-l,m=h*h+p*p,_,v;if(m<Nme)v=Math.log(f/c)/t,_=function(C){return[a+C*h,l+C*p,c*Math.exp(t*C*v)]};else{var y=Math.sqrt(m),g=(f*f-c*c+r*m)/(2*c*n*y),b=(f*f-c*c-r*m)/(2*f*n*y),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(b*b+1)-b);v=(w-S)/t,_=function(C){var x=C*v,k=r8(S),A=c/(n*y)*(k*Dme(t*x+S)-Fme(S));return[a+A*h,l+A*p,c*k/r8(t*x+S)]}}return _.duration=v*1e3*t/Math.SQRT2,_}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var gf=0,Gh=0,gh=0,wz=1e3,M1,Hh,R1=0,ru=0,oS=0,Eg=typeof performance=="object"&&performance.now?performance:Date,Cz=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function CT(){return ru||(Cz(Bme),ru=Eg.now()+oS)}function Bme(){ru=0}function O1(){this._call=this._time=this._next=null}O1.prototype=Ez.prototype={constructor:O1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?CT():+n)+(t==null?0:+t),!this._next&&Hh!==this&&(Hh?Hh._next=this:M1=this,Hh=this),this._call=e,this._time=n,r3()},stop:function(){this._call&&(this._call=null,this._time=1/0,r3())}};function Ez(e,t,n){var r=new O1;return r.restart(e,t,n),r}function zme(){CT(),++gf;for(var e=M1,t;e;)(t=ru-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gf}function i8(){ru=(R1=Eg.now())+oS,gf=Gh=0;try{zme()}finally{gf=0,Vme(),ru=0}}function jme(){var e=Eg.now(),t=e-R1;t>wz&&(oS-=t,R1=e)}function Vme(){for(var e,t=M1,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:M1=n);Hh=e,r3(r)}function r3(e){if(!gf){Gh&&(Gh=clearTimeout(Gh));var t=e-ru;t>24?(e<1/0&&(Gh=setTimeout(i8,e-Eg.now()-oS)),gh&&(gh=clearInterval(gh))):(gh||(R1=Eg.now(),gh=setInterval(jme,wz)),gf=1,Cz(i8))}}function o8(e,t,n){var r=new O1;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ume=rS("start","end","cancel","interrupt"),Gme=[],Tz=0,s8=1,i3=2,nv=3,a8=4,o3=5,rv=6;function sS(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Hme(e,n,{name:t,index:r,group:i,on:Ume,tween:Gme,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Tz})}function ET(e,t){var n=Vo(e,t);if(n.state>Tz)throw new Error("too late; already scheduled");return n}function ks(e,t){var n=Vo(e,t);if(n.state>nv)throw new Error("too late; already running");return n}function Vo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hme(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ez(o,0,n.time);function o(c){n.state=s8,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,h;if(n.state!==s8)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===nv)return o8(s);h.state===a8?(h.state=rv,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=rv,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(o8(function(){n.state===nv&&(n.state=a8,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=i3,n.on.call("start",e,e.__data__,n.index,n.group),n.state===i3){for(n.state=nv,i=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=o3,1),d=-1,f=i.length;++d<f;)i[d].call(e,u);n.state===o3&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=rv,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function iv(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>i3&&r.state<o3,r.state=rv,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function Wme(e){return this.each(function(){iv(this,e)})}function qme(e,t){var n,r;return function(){var i=ks(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Kme(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ks(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function Xme(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Vo(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?qme:Kme)(n,e,t))}function TT(e,t,n){var r=e._id;return e.each(function(){var i=ks(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Vo(i,r).value[t]}}function Az(e,t){var n;return(typeof t=="number"?za:t instanceof Cg?t8:(n=Cg(t))?(t=n,t8):Ime)(e,t)}function Qme(e){return function(){this.removeAttribute(e)}}function Yme(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zme(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function Jme(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function e0e(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function t0e(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function n0e(e,t){var n=iS(e),r=n==="transform"?$me:Az;return this.attrTween(e,typeof t=="function"?(n.local?t0e:e0e)(n,r,TT(this,"attr."+e,t)):t==null?(n.local?Yme:Qme)(n):(n.local?Jme:Zme)(n,r,t))}function r0e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function i0e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function o0e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&i0e(e,o)),n}return i._value=t,i}function s0e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&r0e(e,o)),n}return i._value=t,i}function a0e(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=iS(e);return this.tween(n,(r.local?o0e:s0e)(r,t))}function l0e(e,t){return function(){ET(this,e).delay=+t.apply(this,arguments)}}function c0e(e,t){return t=+t,function(){ET(this,e).delay=t}}function u0e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l0e:c0e)(t,e)):Vo(this.node(),t).delay}function d0e(e,t){return function(){ks(this,e).duration=+t.apply(this,arguments)}}function f0e(e,t){return t=+t,function(){ks(this,e).duration=t}}function h0e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?d0e:f0e)(t,e)):Vo(this.node(),t).duration}function p0e(e,t){if(typeof t!="function")throw new Error;return function(){ks(this,e).ease=t}}function g0e(e){var t=this._id;return arguments.length?this.each(p0e(t,e)):Vo(this.node(),t).ease}function m0e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ks(this,e).ease=n}}function y0e(e){if(typeof e!="function")throw new Error;return this.each(m0e(this._id,e))}function v0e(e){typeof e!="function"&&(e=oz(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&a.push(l);return new da(r,this._parents,this._name,this._id)}function b0e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||c[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new da(s,this._parents,this._name,this._id)}function _0e(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 S0e(e,t,n){var r,i,o=_0e(t)?ET:ks;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function x0e(e,t){var n=this._id;return arguments.length<2?Vo(this.node(),n).on.on(e):this.each(S0e(n,e,t))}function w0e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function C0e(){return this.on("end.remove",w0e(this._id))}function E0e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ST(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,c=o[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,sS(c[f],t,n,f,c,Vo(u,n)));return new da(o,this._parents,t,n)}function T0e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=iz(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=e.call(u,u.__data__,d,l),h,p=Vo(u,n),m=0,_=f.length;m<_;++m)(h=f[m])&&sS(h,t,n,m,f,p);o.push(f),s.push(u)}return new da(o,s,t,n)}var A0e=zm.prototype.constructor;function k0e(){return new A0e(this._groups,this._parents)}function P0e(e,t){var n,r,i;return function(){var o=pf(this,e),s=(this.style.removeProperty(e),pf(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function kz(e){return function(){this.style.removeProperty(e)}}function I0e(e,t,n){var r,i=n+"",o;return function(){var s=pf(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function M0e(e,t,n){var r,i,o;return function(){var s=pf(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),pf(this,e))),s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a))}}function R0e(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=ks(this,e),c=l.on,u=l.value[o]==null?a||(a=kz(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(s,i=u),l.on=r}}function O0e(e,t,n){var r=(e+="")=="transform"?Ome:Az;return t==null?this.styleTween(e,P0e(e,r)).on("end.style."+e,kz(e)):typeof t=="function"?this.styleTween(e,M0e(e,r,TT(this,"style."+e,t))).each(R0e(this._id,e)):this.styleTween(e,I0e(e,r,t),n).on("end.style."+e,null)}function $0e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function N0e(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&$0e(e,s,n)),r}return o._value=t,o}function F0e(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,N0e(e,t,n??""))}function D0e(e){return function(){this.textContent=e}}function L0e(e){return function(){var t=e(this);this.textContent=t??""}}function B0e(e){return this.tween("text",typeof e=="function"?L0e(TT(this,"text",e)):D0e(e==null?"":e+""))}function z0e(e){return function(t){this.textContent=e.call(this,t)}}function j0e(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&z0e(i)),t}return r._value=e,r}function V0e(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,j0e(e))}function U0e(){for(var e=this._name,t=this._id,n=Pz(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Vo(l,t);sS(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new da(r,this._parents,e,n)}function G0e(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};n.each(function(){var c=ks(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),i===0&&o()})}var H0e=0;function da(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Pz(){return++H0e}var $s=zm.prototype;da.prototype={constructor:da,select:E0e,selectAll:T0e,selectChild:$s.selectChild,selectChildren:$s.selectChildren,filter:v0e,merge:b0e,selection:k0e,transition:U0e,call:$s.call,nodes:$s.nodes,node:$s.node,size:$s.size,empty:$s.empty,each:$s.each,on:x0e,attr:n0e,attrTween:a0e,style:O0e,styleTween:F0e,text:B0e,textTween:V0e,remove:C0e,tween:Xme,delay:u0e,duration:h0e,ease:g0e,easeVarying:y0e,end:G0e,[Symbol.iterator]:$s[Symbol.iterator]};function W0e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var q0e={time:null,delay:0,duration:250,ease:W0e};function K0e(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 X0e(e){var t,n;e instanceof da?(t=e._id,e=e._name):(t=Pz(),(n=q0e).time=CT(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&sS(l,e,t,c,s,n||K0e(l,t));return new da(r,this._parents,e,t)}zm.prototype.interrupt=Wme;zm.prototype.transition=X0e;const J0=e=>()=>e;function Q0e(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 Xs(e,t,n){this.k=e,this.x=t,this.y=n}Xs.prototype={constructor:Xs,scale:function(e){return e===1?this:new Xs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xs(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 dl=new Xs(1,0,0);Xs.prototype;function aw(e){e.stopImmediatePropagation()}function mh(e){e.preventDefault(),e.stopImmediatePropagation()}function Y0e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Z0e(){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 l8(){return this.__zoom||dl}function J0e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eye(){return navigator.maxTouchPoints||"ontouchstart"in this}function tye(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function nye(){var e=Y0e,t=Z0e,n=tye,r=J0e,i=eye,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Lme,c=rS("start","zoom","end"),u,d,f,h=500,p=150,m=0,_=10;function v(E){E.property("__zoom",l8).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",R).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(E,P,O,F){var $=E.selection?E.selection():E;$.property("__zoom",l8),E!==$?S(E,P,O,F):$.interrupt().each(function(){w(this,arguments).event(F).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},v.scaleBy=function(E,P,O,F){v.scaleTo(E,function(){var $=this.__zoom.k,D=typeof P=="function"?P.apply(this,arguments):P;return $*D},O,F)},v.scaleTo=function(E,P,O,F){v.transform(E,function(){var $=t.apply(this,arguments),D=this.__zoom,N=O==null?b($):typeof O=="function"?O.apply(this,arguments):O,z=D.invert(N),V=typeof P=="function"?P.apply(this,arguments):P;return n(g(y(D,V),N,z),$,s)},O,F)},v.translateBy=function(E,P,O,F){v.transform(E,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),s)},null,F)},v.translateTo=function(E,P,O,F,$){v.transform(E,function(){var D=t.apply(this,arguments),N=this.__zoom,z=F==null?b(D):typeof F=="function"?F.apply(this,arguments):F;return n(dl.translate(z[0],z[1]).scale(N.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof O=="function"?-O.apply(this,arguments):-O),D,s)},F,$)};function y(E,P){return P=Math.max(o[0],Math.min(o[1],P)),P===E.k?E:new Xs(P,E.x,E.y)}function g(E,P,O){var F=P[0]-O[0]*E.k,$=P[1]-O[1]*E.k;return F===E.x&&$===E.y?E:new Xs(E.k,F,$)}function b(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,P,O,F){E.on("start.zoom",function(){w(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(F).end()}).tween("zoom",function(){var $=this,D=arguments,N=w($,D).event(F),z=t.apply($,D),V=O==null?b(z):typeof O=="function"?O.apply($,D):O,H=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),X=$.__zoom,te=typeof P=="function"?P.apply($,D):P,ee=l(X.invert(V).concat(H/X.k),te.invert(V).concat(H/te.k));return function(j){if(j===1)j=te;else{var q=ee(j),Z=H/q[2];j=new Xs(Z,V[0]-q[0]*Z,V[1]-q[1]*Z)}N.zoom(null,j)}})}function w(E,P,O){return!O&&E.__zooming||new C(E,P)}function C(E,P){this.that=E,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,P),this.taps=0}C.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,P){return this.mouse&&E!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var P=xo(this.that).datum();c.call(E,this.that,new Q0e(E,{sourceEvent:this.sourceEvent,target:v,type:E,transform:this.that.__zoom,dispatch:c}),P)}};function x(E,...P){if(!e.apply(this,arguments))return;var O=w(this,P).event(E),F=this.__zoom,$=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),D=Jo(E);if(O.wheel)(O.mouse[0][0]!==D[0]||O.mouse[0][1]!==D[1])&&(O.mouse[1]=F.invert(O.mouse[0]=D)),clearTimeout(O.wheel);else{if(F.k===$)return;O.mouse=[D,F.invert(D)],iv(this),O.start()}mh(E),O.wheel=setTimeout(N,p),O.zoom("mouse",n(g(y(F,$),O.mouse[0],O.mouse[1]),O.extent,s));function N(){O.wheel=null,O.end()}}function k(E,...P){if(f||!e.apply(this,arguments))return;var O=E.currentTarget,F=w(this,P,!0).event(E),$=xo(E.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",H,!0),D=Jo(E,O),N=E.clientX,z=E.clientY;gz(E.view),aw(E),F.mouse=[D,this.__zoom.invert(D)],iv(this),F.start();function V(X){if(mh(X),!F.moved){var te=X.clientX-N,ee=X.clientY-z;F.moved=te*te+ee*ee>m}F.event(X).zoom("mouse",n(g(F.that.__zoom,F.mouse[0]=Jo(X,O),F.mouse[1]),F.extent,s))}function H(X){$.on("mousemove.zoom mouseup.zoom",null),mz(X.view,F.moved),mh(X),F.event(X).end()}}function A(E,...P){if(e.apply(this,arguments)){var O=this.__zoom,F=Jo(E.changedTouches?E.changedTouches[0]:E,this),$=O.invert(F),D=O.k*(E.shiftKey?.5:2),N=n(g(y(O,D),F,$),t.apply(this,P),s);mh(E),a>0?xo(this).transition().duration(a).call(S,N,F,E):xo(this).call(v.transform,N,F,E)}}function R(E,...P){if(e.apply(this,arguments)){var O=E.touches,F=O.length,$=w(this,P,E.changedTouches.length===F).event(E),D,N,z,V;for(aw(E),N=0;N<F;++N)z=O[N],V=Jo(z,this),V=[V,this.__zoom.invert(V),z.identifier],$.touch0?!$.touch1&&$.touch0[2]!==V[2]&&($.touch1=V,$.taps=0):($.touch0=V,D=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),D&&($.taps<2&&(d=V[0],u=setTimeout(function(){u=null},h)),iv(this),$.start())}}function L(E,...P){if(this.__zooming){var O=w(this,P).event(E),F=E.changedTouches,$=F.length,D,N,z,V;for(mh(E),D=0;D<$;++D)N=F[D],z=Jo(N,this),O.touch0&&O.touch0[2]===N.identifier?O.touch0[0]=z:O.touch1&&O.touch1[2]===N.identifier&&(O.touch1[0]=z);if(N=O.that.__zoom,O.touch1){var H=O.touch0[0],X=O.touch0[1],te=O.touch1[0],ee=O.touch1[1],j=(j=te[0]-H[0])*j+(j=te[1]-H[1])*j,q=(q=ee[0]-X[0])*q+(q=ee[1]-X[1])*q;N=y(N,Math.sqrt(j/q)),z=[(H[0]+te[0])/2,(H[1]+te[1])/2],V=[(X[0]+ee[0])/2,(X[1]+ee[1])/2]}else if(O.touch0)z=O.touch0[0],V=O.touch0[1];else return;O.zoom("touch",n(g(N,z,V),O.extent,s))}}function M(E,...P){if(this.__zooming){var O=w(this,P).event(E),F=E.changedTouches,$=F.length,D,N;for(aw(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),D=0;D<$;++D)N=F[D],O.touch0&&O.touch0[2]===N.identifier?delete O.touch0:O.touch1&&O.touch1[2]===N.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(N=Jo(N,this),Math.hypot(d[0]-N[0],d[1]-N[1])<_)){var z=xo(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return v.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:J0(+E),v):r},v.filter=function(E){return arguments.length?(e=typeof E=="function"?E:J0(!!E),v):e},v.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:J0(!!E),v):i},v.extent=function(E){return arguments.length?(t=typeof E=="function"?E:J0([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),v):t},v.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],v):[o[0],o[1]]},v.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],v):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},v.constrain=function(E){return arguments.length?(n=E,v):n},v.duration=function(E){return arguments.length?(a=+E,v):a},v.interpolate=function(E){return arguments.length?(l=E,v):l},v.on=function(){var E=c.on.apply(c,arguments);return E===c?v:E},v.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,v):Math.sqrt(m)},v.tapDistance=function(E){return arguments.length?(_=+E,v):_},v}const aS=I.createContext(null),rye=aS.Provider,fa={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.`},Iz=fa.error001();function rn(e,t){const n=I.useContext(aS);if(n===null)throw new Error(Iz);return nz(n,e,t)}const Gn=()=>{const e=I.useContext(aS);if(e===null)throw new Error(Iz);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},iye=e=>e.userSelectionActive?"none":"all";function oye({position:e,children:t,className:n,style:r,...i}){const o=rn(iye),s=`${e}`.split("-");return Q.createElement("div",{className:no(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i},t)}function sye({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:Q.createElement(oye,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},Q.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const aye=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u})=>{const d=I.useRef(null),[f,h]=I.useState({x:0,y:0,width:0,height:0}),p=no(["react-flow__edge-textwrapper",c]);return I.useEffect(()=>{if(d.current){const m=d.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:Q.createElement("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...u},i&&Q.createElement("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),Q.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r},n),l)};var lye=I.memo(aye);const AT=e=>({width:e.offsetWidth,height:e.offsetHeight}),mf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kT=(e={x:0,y:0},t)=>({x:mf(e.x,t[0][0],t[1][0]),y:mf(e.y,t[0][1],t[1][1])}),c8=(e,t,n)=>e<t?mf(Math.abs(e-t),1,50)/50:e>n?-mf(Math.abs(e-n),1,50)/50:0,Mz=(e,t)=>{const n=c8(e.x,35,t.width-35)*20,r=c8(e.y,35,t.height-35)*20;return[n,r]},Rz=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Oz=(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)}),Tg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),$z=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),u8=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),nHe=(e,t)=>$z(Oz(Tg(e),Tg(t))),s3=(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)},cye=e=>Xi(e.width)&&Xi(e.height)&&Xi(e.x)&&Xi(e.y),Xi=e=>!isNaN(e)&&isFinite(e),Tn=Symbol.for("internals"),Nz=["Enter"," ","Escape"],uye=(e,t)=>{},dye=e=>"nativeEvent"in e;function a3(e){var i,o;const t=dye(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 Fz=e=>"clientX"in e,fl=(e,t)=>{var o,s;const n=Fz(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},$1=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Vm=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:f,interactionWidth:h=20})=>Q.createElement(Q.Fragment,null,Q.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&Q.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Xi(n)&&Xi(r)?Q.createElement(lye,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);Vm.displayName="BaseEdge";function yh(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function Dz({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function Lz({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}var iu;(function(e){e.Strict="strict",e.Loose="loose"})(iu||(iu={}));var wc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wc||(wc={}));var Cl;(function(e){e.Partial="partial",e.Full="full"})(Cl||(Cl={}));var qa;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(qa||(qa={}));var N1;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(N1||(N1={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));function d8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Te.Left||e===Te.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Bz({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:i,targetPosition:o=Te.Top}){const[s,a]=d8({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,c]=d8({pos:o,x1:r,y1:i,x2:e,y2:t}),[u,d,f,h]=Lz({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${r},${i}`,u,d,f,h]}const PT=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Te.Bottom,targetPosition:o=Te.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[_,v,y]=Bz({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return Q.createElement(Vm,{path:_,labelX:v,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});PT.displayName="SimpleBezierEdge";const f8={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},fye=({source:e,sourcePosition:t=Te.Bottom,target:n})=>t===Te.Left||t===Te.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},h8=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hye({source:e,sourcePosition:t=Te.Bottom,target:n,targetPosition:r=Te.Top,center:i,offset:o}){const s=f8[t],a=f8[r],l={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},u=fye({source:l,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",f=u[d];let h=[],p,m;const _={x:0,y:0},v={x:0,y:0},[y,g,b,S]=Dz({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){p=i.x||y,m=i.y||g;const C=[{x:p,y:l.y},{x:p,y:c.y}],x=[{x:l.x,y:m},{x:c.x,y:m}];s[d]===f?h=d==="x"?C:x:h=d==="x"?x:C}else{const C=[{x:l.x,y:c.y}],x=[{x:c.x,y:l.y}];if(d==="x"?h=s.x===f?x:C:h=s.y===f?C:x,t===r){const M=Math.abs(e[d]-n[d]);if(M<=o){const E=Math.min(o-1,o-M);s[d]===f?_[d]=(l[d]>e[d]?-1:1)*E:v[d]=(c[d]>n[d]?-1:1)*E}}if(t!==r){const M=d==="x"?"y":"x",E=s[d]===a[M],P=l[M]>c[M],O=l[M]<c[M];(s[d]===1&&(!E&&P||E&&O)||s[d]!==1&&(!E&&O||E&&P))&&(h=d==="x"?C:x)}const k={x:l.x+_.x,y:l.y+_.y},A={x:c.x+v.x,y:c.y+v.y},R=Math.max(Math.abs(k.x-h[0].x),Math.abs(A.x-h[0].x)),L=Math.max(Math.abs(k.y-h[0].y),Math.abs(A.y-h[0].y));R>=L?(p=(k.x+A.x)/2,m=h[0].y):(p=h[0].x,m=(k.y+A.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:c.x+v.x,y:c.y+v.y},n],p,m,b,S]}function pye(e,t,n,r){const i=Math.min(h8(e,t)/2,h8(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+i*c},${s}Q ${o},${s} ${o},${s+i*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function l3({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:i,targetPosition:o=Te.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[u,d,f,h,p]=hye({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:c});return[u.reduce((_,v,y)=>{let g="";return y>0&&y<u.length-1?g=pye(u[y-1],v,u[y+1],s):g=`${y===0?"M":"L"}${v.x} ${v.y}`,_+=g,_},""),d,f,h,p]}const lS=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,sourcePosition:d=Te.Bottom,targetPosition:f=Te.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[v,y,g]=l3({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return Q.createElement(Vm,{path:v,labelX:y,labelY:g,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:h,markerStart:p,interactionWidth:_})});lS.displayName="SmoothStepEdge";const IT=I.memo(e=>{var t;return Q.createElement(lS,{...e,pathOptions:I.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});IT.displayName="StepEdge";function gye({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=Dz({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const MT=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,m,_]=gye({sourceX:e,sourceY:t,targetX:n,targetY:r});return Q.createElement(Vm,{path:p,labelX:m,labelY:_,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:d,markerStart:f,interactionWidth:h})});MT.displayName="StraightEdge";function ey(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function p8({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case Te.Left:return[t-ey(t-r,o),n];case Te.Right:return[t+ey(r-t,o),n];case Te.Top:return[t,n-ey(n-i,o)];case Te.Bottom:return[t,n+ey(i-n,o)]}}function zz({sourceX:e,sourceY:t,sourcePosition:n=Te.Bottom,targetX:r,targetY:i,targetPosition:o=Te.Top,curvature:s=.25}){const[a,l]=p8({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,u]=p8({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,p]=Lz({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${i}`,d,f,h,p]}const F1=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Te.Bottom,targetPosition:o=Te.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[v,y,g]=zz({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return Q.createElement(Vm,{path:v,labelX:y,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:_})});F1.displayName="BezierEdge";const RT=I.createContext(null),mye=RT.Provider;RT.Consumer;const yye=()=>I.useContext(RT),vye=e=>"id"in e&&"source"in e&&"target"in e,jz=e=>"id"in e&&!("source"in e)&&!("target"in e),bye=(e,t,n)=>{if(!jz(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},_ye=(e,t,n)=>{if(!jz(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},Vz=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,c3=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Sye=(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)),Wh=(e,t)=>{if(!e.source||!e.target)return t;let n;return vye(e)?n={...e}:n={...e,id:Vz(e)},Sye(n,t)?t:t.concat(n)},xye=(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 a={...o,id:r.shouldReplaceId?Vz(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==i).concat(a)},u3=({x:e,y:t},[n,r,i],o,[s,a])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},Uz=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Dd=(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}},OT=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:s}=Dd(i,t).positionAbsolute;return Oz(r,Tg({x:o,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $z(n)},Gz=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},c=[];return e.forEach(u=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=u;if(s&&!h||p)return!1;const{positionAbsolute:m}=Dd(u,a),_={x:m.x,y:m.y,width:d||0,height:f||0},v=s3(l,_),y=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&v>0,b=(d||0)*(f||0);(y||g||v>=b||u.dragging)&&c.push(u)}),c},$T=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Hz=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),l=Math.min(s,a),c=mf(l,r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*c,h=n/2-d*c;return{x:f,y:h,zoom:c}},ac=(e,t=0)=>e.transition().duration(t);function g8(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var s,a;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+o.x+o.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+o.y+o.height/2}),i},[])}function wye(e,t,n,r,i,o){const{x:s,y:a}=fl(e),c=t.elementsFromPoint(s,a).find(p=>p.classList.contains("react-flow__handle"));if(c){const p=c.getAttribute("data-nodeid");if(p){const m=NT(void 0,c),_=c.getAttribute("data-handleid"),v=o({nodeId:p,id:_,type:m});if(v){const y=i.find(g=>g.nodeId===p&&g.type===m&&g.id===_);return{handle:{id:_,type:m,nodeId:p,x:(y==null?void 0:y.x)||n.x,y:(y==null?void 0:y.y)||n.y},validHandleResult:v}}}}let u=[],d=1/0;if(i.forEach(p=>{const m=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(m<=r){const _=o(p);m<=d&&(m<d?u=[{handle:p,validHandleResult:_}]:m===d&&u.push({handle:p,validHandleResult:_}),d=m)}}),!u.length)return{handle:null,validHandleResult:Wz()};if(u.length===1)return u[0];const f=u.some(({validHandleResult:p})=>p.isValid),h=u.some(({handle:p})=>p.type==="target");return u.find(({handle:p,validHandleResult:m})=>h?p.type==="target":f?m.isValid:!0)||u[0]}const Cye={source:null,target:null,sourceHandle:null,targetHandle:null},Wz=()=>({handleDomNode:null,isValid:!1,connection:Cye,endHandle:null});function qz(e,t,n,r,i,o,s){const a=i==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...Wz(),handleDomNode:l};if(l){const u=NT(void 0,l),d=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),m={source:a?d:n,sourceHandle:a?f:r,target:a?n:d,targetHandle:a?r:f};c.connection=m,h&&p&&(t===iu.Strict?a&&u==="source"||!a&&u==="target":d!==n||f!==r)&&(c.endHandle={nodeId:d,handleId:f,type:u},c.isValid=o(m))}return c}function Eye({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[Tn]){const{handleBounds:s}=o[Tn];let a=[],l=[];s&&(a=g8(o,s,"source",`${t}-${n}-${r}`),l=g8(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...l)}return i},[])}function NT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function lw(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Tye(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Kz({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const u=Rz(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:_,getNodes:v,cancelConnection:y}=o();let g=0,b;const{x:S,y:w}=fl(e),C=u==null?void 0:u.elementFromPoint(S,w),x=NT(l,C),k=f==null?void 0:f.getBoundingClientRect();if(!k||!x)return;let A,R=fl(e,k),L=!1,M=null,E=!1,P=null;const O=Eye({nodes:v(),nodeId:n,handleId:t,handleType:x}),F=()=>{if(!h)return;const[N,z]=Mz(R,k);_({x:N,y:z}),g=requestAnimationFrame(F)};s({connectionPosition:R,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:x,connectionStartHandle:{nodeId:n,handleId:t,type:x},connectionEndHandle:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:x});function $(N){const{transform:z}=o();R=fl(N,k);const{handle:V,validHandleResult:H}=wye(N,u,u3(R,z,!1,[1,1]),p,O,X=>qz(X,d,n,t,i?"target":"source",a,u));if(b=V,L||(F(),L=!0),P=H.handleDomNode,M=H.connection,E=H.isValid,s({connectionPosition:b&&E?Uz({x:b.x,y:b.y},z):R,connectionStatus:Tye(!!b,E),connectionEndHandle:H.endHandle}),!b&&!E&&!P)return lw(A);M.source!==M.target&&P&&(lw(A),A=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",E),P.classList.toggle("react-flow__handle-valid",E))}function D(N){var z,V;(b||P)&&M&&E&&(r==null||r(M)),(V=(z=o()).onConnectEnd)==null||V.call(z,N),l&&(c==null||c(N)),lw(A),y(),cancelAnimationFrame(g),L=!1,E=!1,M=null,P=null,u.removeEventListener("mousemove",$),u.removeEventListener("mouseup",D),u.removeEventListener("touchmove",$),u.removeEventListener("touchend",D)}u.addEventListener("mousemove",$),u.addEventListener("mouseup",D),u.addEventListener("touchmove",$),u.addEventListener("touchend",D)}const m8=()=>!0,Aye=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),kye=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:s}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},Xz=I.forwardRef(({type:e="source",position:t=Te.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},h)=>{var k,A;const p=s||null,m=e==="target",_=Gn(),v=yye(),{connectOnClick:y,noPanClassName:g}=rn(Aye,ti),{connecting:b,clickConnecting:S}=rn(kye(v,p,e),ti);v||(A=(k=_.getState()).onError)==null||A.call(k,"010",fa.error010());const w=R=>{const{defaultEdgeOptions:L,onConnect:M,hasDefaultEdges:E}=_.getState(),P={...L,...R};if(E){const{edges:O,setEdges:F}=_.getState();F(Wh(P,O))}M==null||M(P),a==null||a(P)},C=R=>{if(!v)return;const L=Fz(R);i&&(L&&R.button===0||!L)&&Kz({event:R,handleId:p,nodeId:v,onConnect:w,isTarget:m,getState:_.getState,setState:_.setState,isValidConnection:n||_.getState().isValidConnection||m8}),L?u==null||u(R):d==null||d(R)},x=R=>{const{onClickConnectStart:L,onClickConnectEnd:M,connectionClickStartHandle:E,connectionMode:P,isValidConnection:O}=_.getState();if(!v||!E&&!i)return;if(!E){L==null||L(R,{nodeId:v,handleId:p,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:v,type:e,handleId:p}});return}const F=Rz(R.target),$=n||O||m8,{connection:D,isValid:N}=qz({nodeId:v,id:p,type:e},P,E.nodeId,E.handleId||null,E.type,$,F);N&&w(D),M==null||M(R),_.setState({connectionClickStartHandle:null})};return Q.createElement("div",{"data-handleid":p,"data-nodeid":v,"data-handlepos":t,"data-id":`${v}-${p}-${e}`,className:no(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!b||o&&b)}]),onMouseDown:C,onTouchStart:C,onClick:y?x:void 0,ref:h,...f},l)});Xz.displayName="Handle";var D1=I.memo(Xz);const Qz=({data:e,isConnectable:t,targetPosition:n=Te.Top,sourcePosition:r=Te.Bottom})=>Q.createElement(Q.Fragment,null,Q.createElement(D1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,Q.createElement(D1,{type:"source",position:r,isConnectable:t}));Qz.displayName="DefaultNode";var d3=I.memo(Qz);const Yz=({data:e,isConnectable:t,sourcePosition:n=Te.Bottom})=>Q.createElement(Q.Fragment,null,e==null?void 0:e.label,Q.createElement(D1,{type:"source",position:n,isConnectable:t}));Yz.displayName="InputNode";var Zz=I.memo(Yz);const Jz=({data:e,isConnectable:t,targetPosition:n=Te.Top})=>Q.createElement(Q.Fragment,null,Q.createElement(D1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Jz.displayName="OutputNode";var ej=I.memo(Jz);const FT=()=>null;FT.displayName="GroupNode";const Pye=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),ty=e=>e.id;function Iye(e,t){return ti(e.selectedNodes.map(ty),t.selectedNodes.map(ty))&&ti(e.selectedEdges.map(ty),t.selectedEdges.map(ty))}const tj=I.memo(({onSelectionChange:e})=>{const t=Gn(),{selectedNodes:n,selectedEdges:r}=rn(Pye,Iye);return I.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});tj.displayName="SelectionListener";const Mye=e=>!!e.onSelectionChange;function Rye({onSelectionChange:e}){const t=rn(Mye);return e||t?Q.createElement(tj,{onSelectionChange:e}):null}const Oye=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 $u(e,t){I.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function je(e,t,n){I.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const $ye=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:u,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:_,nodeExtent:v,onNodesChange:y,onEdgesChange:g,elementsSelectable:b,connectionMode:S,snapGrid:w,snapToGrid:C,translateExtent:x,connectOnClick:k,defaultEdgeOptions:A,fitView:R,fitViewOptions:L,onNodesDelete:M,onEdgesDelete:E,onNodeDrag:P,onNodeDragStart:O,onNodeDragStop:F,onSelectionDrag:$,onSelectionDragStart:D,onSelectionDragStop:N,noPanClassName:z,nodeOrigin:V,rfId:H,autoPanOnConnect:X,autoPanOnNodeDrag:te,onError:ee,connectionRadius:j,isValidConnection:q,nodeDragThreshold:Z})=>{const{setNodes:oe,setEdges:be,setDefaultNodesAndEdges:Me,setMinZoom:lt,setMaxZoom:Le,setTranslateExtent:we,setNodeExtent:pt,reset:vt}=rn(Oye,ti),Ce=Gn();return I.useEffect(()=>{const ii=r==null?void 0:r.map(sn=>({...sn,...A}));return Me(n,ii),()=>{vt()}},[]),je("defaultEdgeOptions",A,Ce.setState),je("connectionMode",S,Ce.setState),je("onConnect",i,Ce.setState),je("onConnectStart",o,Ce.setState),je("onConnectEnd",s,Ce.setState),je("onClickConnectStart",a,Ce.setState),je("onClickConnectEnd",l,Ce.setState),je("nodesDraggable",c,Ce.setState),je("nodesConnectable",u,Ce.setState),je("nodesFocusable",d,Ce.setState),je("edgesFocusable",f,Ce.setState),je("edgesUpdatable",h,Ce.setState),je("elementsSelectable",b,Ce.setState),je("elevateNodesOnSelect",p,Ce.setState),je("snapToGrid",C,Ce.setState),je("snapGrid",w,Ce.setState),je("onNodesChange",y,Ce.setState),je("onEdgesChange",g,Ce.setState),je("connectOnClick",k,Ce.setState),je("fitViewOnInit",R,Ce.setState),je("fitViewOnInitOptions",L,Ce.setState),je("onNodesDelete",M,Ce.setState),je("onEdgesDelete",E,Ce.setState),je("onNodeDrag",P,Ce.setState),je("onNodeDragStart",O,Ce.setState),je("onNodeDragStop",F,Ce.setState),je("onSelectionDrag",$,Ce.setState),je("onSelectionDragStart",D,Ce.setState),je("onSelectionDragStop",N,Ce.setState),je("noPanClassName",z,Ce.setState),je("nodeOrigin",V,Ce.setState),je("rfId",H,Ce.setState),je("autoPanOnConnect",X,Ce.setState),je("autoPanOnNodeDrag",te,Ce.setState),je("onError",ee,Ce.setState),je("connectionRadius",j,Ce.setState),je("isValidConnection",q,Ce.setState),je("nodeDragThreshold",Z,Ce.setState),$u(e,oe),$u(t,be),$u(m,lt),$u(_,Le),$u(x,we),$u(v,pt),null},y8={display:"none"},Nye={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nj="react-flow__node-desc",rj="react-flow__edge-desc",Fye="react-flow__aria-live",Dye=e=>e.ariaLiveMessage;function Lye({rfId:e}){const t=rn(Dye);return Q.createElement("div",{id:`${Fye}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Nye},t)}function Bye({rfId:e,disableKeyboardA11y:t}){return Q.createElement(Q.Fragment,null,Q.createElement("div",{id:`${nj}-${e}`,style:y8},"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."," "),Q.createElement("div",{id:`${rj}-${e}`,style:y8},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&Q.createElement(Lye,{rfId:e}))}var Ag=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=I.useState(!1),i=I.useRef(!1),o=I.useRef(new Set([])),[s,a]=I.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return I.useEffect(()=>{const l=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||l;if(e!==null){const u=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&a3(h))return!1;const m=b8(h.code,a);o.current.add(h[m]),v8(s,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&a3(h))return!1;const m=b8(h.code,a);v8(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[m]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function v8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function b8(e,t){return t.includes(e)?"code":"key"}function ij(e,t,n,r){var s,a;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=Dd(i,r);return ij(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((s=i[Tn])==null?void 0:s.z)??0)>(n.z??0)?((a=i[Tn])==null?void 0:a.z)??0:n.z??0},r)}function oj(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:s,z:a}=ij(r,e,{...r.position,z:((i=r[Tn])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:s},r[Tn].z=a,n!=null&&n[r.id]&&(r[Tn].isParent=!0)}})}function cw(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(Xi(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),u={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(u.parentNode=a.parentNode,o[a.parentNode]=!0),Object.defineProperty(u,Tn,{enumerable:!1,value:{handleBounds:(d=c==null?void 0:c[Tn])==null?void 0:d.handleBounds,z:l}}),i.set(a.id,u)}),oj(i,n,o),i}function sj(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(a&&l&&(f||!t.initial)){const p=n().filter(_=>{var y;const v=t.includeHiddenNodes?_.width&&_.height:!_.hidden;return(y=t.nodes)!=null&&y.length?v&&t.nodes.some(g=>g.id===_.id):v}),m=p.every(_=>_.width&&_.height);if(p.length>0&&m){const _=OT(p,d),{x:v,y,zoom:g}=Hz(_,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),b=dl.translate(v,y).scale(g);return typeof t.duration=="number"&&t.duration>0?a.transform(ac(l,t.duration),b):a.transform(l,b),!0}}return!1}function zye(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Tn]:r[Tn],selected:n.selected})}),new Map(t)}function jye(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function ny({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();e!=null&&e.length&&(l&&r({nodeInternals:zye(e,i)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:jye(t,o)}),a==null||a(t))}const Nu=()=>{},Vye={zoomIn:Nu,zoomOut:Nu,zoomTo:Nu,getZoom:()=>1,setViewport:Nu,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Nu,fitBounds:Nu,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Uye=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Gye=()=>{const e=Gn(),{d3Zoom:t,d3Selection:n}=rn(Uye,ti);return I.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(ac(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(ac(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(ac(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,l]=e.getState().transform,c=dl.translate(i.x??s,i.y??a).scale(i.zoom??l);t.transform(ac(n,o==null?void 0:o.duration),c)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>sj(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),u=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,d=a/2-i*u,f=l/2-o*u,h=dl.translate(d,f).scale(u);t.transform(ac(n,s==null?void 0:s.duration),h)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),{x:u,y:d,zoom:f}=Hz(i,s,a,l,c,(o==null?void 0:o.padding)??.1),h=dl.translate(u,d).scale(f);t.transform(ac(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),u3(i,o,s,a)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:s,snapGrid:a,domNode:l}=e.getState();if(!l)return i;const{x:c,y:u}=l.getBoundingClientRect(),d={x:i.x-c,y:i.y-u};return u3(d,o,s,a)},flowToScreenPosition:i=>{const{transform:o,domNode:s}=e.getState();if(!s)return i;const{x:a,y:l}=s.getBoundingClientRect(),c=Uz(i,o);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:Vye,[t,n])};function aj(){const e=Gye(),t=Gn(),n=I.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=I.useCallback(m=>t.getState().nodeInternals.get(m),[]),i=I.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(_=>({..._}))},[]),o=I.useCallback(m=>{const{edges:_=[]}=t.getState();return _.find(v=>v.id===m)},[]),s=I.useCallback(m=>{const{getNodes:_,setNodes:v,hasDefaultNodes:y,onNodesChange:g}=t.getState(),b=_(),S=typeof m=="function"?m(b):m;if(y)v(S);else if(g){const w=S.length===0?b.map(C=>({type:"remove",id:C.id})):S.map(C=>({item:C,type:"reset"}));g(w)}},[]),a=I.useCallback(m=>{const{edges:_=[],setEdges:v,hasDefaultEdges:y,onEdgesChange:g}=t.getState(),b=typeof m=="function"?m(_):m;if(y)v(b);else if(g){const S=b.length===0?_.map(w=>({type:"remove",id:w.id})):b.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{getNodes:v,setNodes:y,hasDefaultNodes:g,onNodesChange:b}=t.getState();if(g){const w=[...v(),..._];y(w)}else if(b){const S=_.map(w=>({item:w,type:"add"}));b(S)}},[]),c=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{edges:v=[],setEdges:y,hasDefaultEdges:g,onEdgesChange:b}=t.getState();if(g)y([...v,..._]);else if(b){const S=_.map(w=>({item:w,type:"add"}));b(S)}},[]),u=I.useCallback(()=>{const{getNodes:m,edges:_=[],transform:v}=t.getState(),[y,g,b]=v;return{nodes:m().map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:y,y:g,zoom:b}}},[]),d=I.useCallback(({nodes:m,edges:_})=>{const{nodeInternals:v,getNodes:y,edges:g,hasDefaultNodes:b,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:C,onNodesChange:x,onEdgesChange:k}=t.getState(),A=(m||[]).map(P=>P.id),R=(_||[]).map(P=>P.id),L=y().reduce((P,O)=>{const F=!A.includes(O.id)&&O.parentNode&&P.find(D=>D.id===O.parentNode);return(typeof O.deletable=="boolean"?O.deletable:!0)&&(A.includes(O.id)||F)&&P.push(O),P},[]),M=g.filter(P=>typeof P.deletable=="boolean"?P.deletable:!0),E=M.filter(P=>R.includes(P.id));if(L||E){const P=$T(L,M),O=[...E,...P],F=O.reduce(($,D)=>($.includes(D.id)||$.push(D.id),$),[]);if((S||b)&&(S&&t.setState({edges:g.filter($=>!F.includes($.id))}),b&&(L.forEach($=>{v.delete($.id)}),t.setState({nodeInternals:new Map(v)}))),F.length>0&&(C==null||C(O),k&&k(F.map($=>({id:$,type:"remove"})))),L.length>0&&(w==null||w(L),x)){const $=L.map(D=>({id:D.id,type:"remove"}));x($)}}},[]),f=I.useCallback(m=>{const _=cye(m),v=_?null:t.getState().nodeInternals.get(m.id);return[_?m:u8(v),v,_]},[]),h=I.useCallback((m,_=!0,v)=>{const[y,g,b]=f(m);return y?(v||t.getState().getNodes()).filter(S=>{if(!b&&(S.id===g.id||!S.positionAbsolute))return!1;const w=u8(S),C=s3(w,y);return _&&C>0||C>=y.width*y.height}):[]},[]),p=I.useCallback((m,_,v=!0)=>{const[y]=f(m);if(!y)return!1;const g=s3(y,_);return v&&g>0||g>=y.width*y.height},[]);return I.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:u,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,s,a,l,c,u,d,h,p])}const Hye={actInsideInputWithModifier:!1};var Wye=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Gn(),{deleteElements:r}=aj(),i=Ag(e,Hye),o=Ag(t);I.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),l=a().filter(u=>u.selected),c=s.filter(u=>u.selected);r({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[i]),I.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function qye(e){const t=Gn();I.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=AT(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",fa.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 DT={position:"absolute",width:"100%",height:"100%",top:0,left:0},Kye=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ry=e=>({x:e.x,y:e.y,zoom:e.k}),Fu=(e,t)=>e.target.closest(`.${t}`),_8=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),S8=e=>{const t=e.ctrlKey&&$1()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Xye=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Qye=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=wc.Free,zoomOnDoubleClick:c=!0,elementsSelectable:u,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:v=!0,children:y,noWheelClassName:g,noPanClassName:b})=>{const S=I.useRef(),w=Gn(),C=I.useRef(!1),x=I.useRef(!1),k=I.useRef(null),A=I.useRef({x:0,y:0,zoom:0}),{d3Zoom:R,d3Selection:L,d3ZoomHandler:M,userSelectionActive:E}=rn(Xye,ti),P=Ag(_),O=I.useRef(0),F=I.useRef(!1),$=I.useRef();return qye(k),I.useEffect(()=>{if(k.current){const D=k.current.getBoundingClientRect(),N=nye().scaleExtent([p,m]).translateExtent(h),z=xo(k.current).call(N),V=dl.translate(f.x,f.y).scale(mf(f.zoom,p,m)),H=[[0,0],[D.width,D.height]],X=N.constrain()(V,H,h);N.transform(z,X),N.wheelDelta(S8),w.setState({d3Zoom:N,d3Selection:z,d3ZoomHandler:z.on("wheel.zoom"),transform:[X.x,X.y,X.k],domNode:k.current.closest(".react-flow")})}},[]),I.useEffect(()=>{L&&R&&(s&&!P&&!E?L.on("wheel.zoom",D=>{if(Fu(D,g))return!1;D.preventDefault(),D.stopImmediatePropagation();const N=L.property("__zoom").k||1,z=$1();if(D.ctrlKey&&o&&z){const Z=Jo(D),oe=S8(D),be=N*Math.pow(2,oe);R.scaleTo(L,be,Z,D);return}const V=D.deltaMode===1?20:1;let H=l===wc.Vertical?0:D.deltaX*V,X=l===wc.Horizontal?0:D.deltaY*V;!z&&D.shiftKey&&l!==wc.Vertical&&(H=D.deltaY*V,X=0),R.translateBy(L,-(H/N)*a,-(X/N)*a,{internal:!0});const te=ry(L.property("__zoom")),{onViewportChangeStart:ee,onViewportChange:j,onViewportChangeEnd:q}=w.getState();clearTimeout($.current),F.current||(F.current=!0,t==null||t(D,te),ee==null||ee(te)),F.current&&(e==null||e(D,te),j==null||j(te),$.current=setTimeout(()=>{n==null||n(D,te),q==null||q(te),F.current=!1},150))},{passive:!1}):typeof M<"u"&&L.on("wheel.zoom",function(D,N){if(!v||Fu(D,g))return null;D.preventDefault(),M.call(this,D,N)},{passive:!1}))},[E,s,l,L,R,M,P,o,v,g,t,e,n]),I.useEffect(()=>{R&&R.on("start",D=>{var V,H;if(!D.sourceEvent||D.sourceEvent.internal)return null;O.current=(V=D.sourceEvent)==null?void 0:V.button;const{onViewportChangeStart:N}=w.getState(),z=ry(D.transform);C.current=!0,A.current=z,((H=D.sourceEvent)==null?void 0:H.type)==="mousedown"&&w.setState({paneDragging:!0}),N==null||N(z),t==null||t(D.sourceEvent,z)})},[R,t]),I.useEffect(()=>{R&&(E&&!C.current?R.on("zoom",null):E||R.on("zoom",D=>{var z;const{onViewportChange:N}=w.getState();if(w.setState({transform:[D.transform.x,D.transform.y,D.transform.k]}),x.current=!!(r&&_8(d,O.current??0)),(e||N)&&!((z=D.sourceEvent)!=null&&z.internal)){const V=ry(D.transform);N==null||N(V),e==null||e(D.sourceEvent,V)}}))},[E,R,e,d,r]),I.useEffect(()=>{R&&R.on("end",D=>{if(!D.sourceEvent||D.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=w.getState();if(C.current=!1,w.setState({paneDragging:!1}),r&&_8(d,O.current??0)&&!x.current&&r(D.sourceEvent),x.current=!1,(n||N)&&Kye(A.current,D.transform)){const z=ry(D.transform);A.current=z,clearTimeout(S.current),S.current=setTimeout(()=>{N==null||N(z),n==null||n(D.sourceEvent,z)},s?150:0)}})},[R,s,d,n,r]),I.useEffect(()=>{R&&R.filter(D=>{const N=P||i,z=o&&D.ctrlKey;if((d===!0||Array.isArray(d)&&d.includes(1))&&D.button===1&&D.type==="mousedown"&&(Fu(D,"react-flow__node")||Fu(D,"react-flow__edge")))return!0;if(!d&&!N&&!s&&!c&&!o||E||!c&&D.type==="dblclick"||Fu(D,g)&&D.type==="wheel"||Fu(D,b)&&(D.type!=="wheel"||s&&D.type==="wheel"&&!P)||!o&&D.ctrlKey&&D.type==="wheel"||!N&&!s&&!z&&D.type==="wheel"||!d&&(D.type==="mousedown"||D.type==="touchstart")||Array.isArray(d)&&!d.includes(D.button)&&(D.type==="mousedown"||D.type==="touchstart"))return!1;const V=Array.isArray(d)&&d.includes(D.button)||!D.button||D.button<=1;return(!D.ctrlKey||D.type==="wheel")&&V})},[E,R,i,o,s,c,d,u,P]),Q.createElement("div",{className:"react-flow__renderer",ref:k,style:DT},y)},Yye=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zye(){const{userSelectionActive:e,userSelectionRect:t}=rn(Yye,ti);return e&&t?Q.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 x8(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 lj(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(a=>a.id===i.id);if(o.length===0)return r.push(i),r;const s={...i};for(const a of o)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&x8(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&x8(r,s);break}case"remove":return r}return r.push(s),r},n)}function lc(e,t){return lj(e,t)}function Ql(e,t){return lj(e,t)}const ja=(e,t)=>({id:e,type:"select",selected:t});function cd(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(ja(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(ja(r.id,!1))),n},[])}const uw=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Jye=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),cj=I.memo(({isSelecting:e,selectionMode:t=Cl.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:u,children:d})=>{const f=I.useRef(null),h=Gn(),p=I.useRef(0),m=I.useRef(0),_=I.useRef(),{userSelectionActive:v,elementsSelectable:y,dragging:g}=rn(Jye,ti),b=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.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}s==null||s(M)},C=a?M=>a(M):void 0,x=M=>{const{resetSelectedElements:E,domNode:P}=h.getState();if(_.current=P==null?void 0:P.getBoundingClientRect(),!y||!e||M.button!==0||M.target!==f.current||!_.current)return;const{x:O,y:F}=fl(M,_.current);E(),h.setState({userSelectionRect:{width:0,height:0,startX:O,startY:F,x:O,y:F}}),r==null||r(M)},k=M=>{const{userSelectionRect:E,nodeInternals:P,edges:O,transform:F,onNodesChange:$,onEdgesChange:D,nodeOrigin:N,getNodes:z}=h.getState();if(!e||!_.current||!E)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=fl(M,_.current),H=E.startX??0,X=E.startY??0,te={...E,x:V.x<H?V.x:H,y:V.y<X?V.y:X,width:Math.abs(V.x-H),height:Math.abs(V.y-X)},ee=z(),j=Gz(P,te,F,t===Cl.Partial,!0,N),q=$T(j,O).map(oe=>oe.id),Z=j.map(oe=>oe.id);if(p.current!==Z.length){p.current=Z.length;const oe=cd(ee,Z);oe.length&&($==null||$(oe))}if(m.current!==q.length){m.current=q.length;const oe=cd(O,q);oe.length&&(D==null||D(oe))}h.setState({userSelectionRect:te})},A=M=>{if(M.button!==0)return;const{userSelectionRect:E}=h.getState();!v&&E&&M.target===f.current&&(S==null||S(M)),h.setState({nodesSelectionActive:p.current>0}),b(),i==null||i(M)},R=M=>{v&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(M)),b()},L=y&&(e||v);return Q.createElement("div",{className:no(["react-flow__pane",{dragging:g,selection:e}]),onClick:L?void 0:uw(S,f),onContextMenu:uw(w,f),onWheel:uw(C,f),onMouseEnter:L?void 0:l,onMouseDown:L?x:void 0,onMouseMove:L?k:c,onMouseUp:L?A:void 0,onMouseLeave:L?R:u,ref:f,style:DT},d,Q.createElement(Zye,null))});cj.displayName="Pane";function uj(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:uj(n,t):!1}function w8(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 eve(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!uj(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height,expandParent:i.expandParent}})}function tve(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function dj(e,t,n,r,i=[0,0],o){const s=tve(e,e.extent||r);let a=s;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:d,y:f}=Dd(u,i).positionAbsolute;a=u&&Xi(d)&&Xi(f)&&Xi(u.width)&&Xi(u.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+u.width-e.width+e.width*i[0],f+u.height-e.height+e.height*i[1]]]:a}else o==null||o("005",fa.error005()),a=s;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const u=n.get(e.parentNode),{x:d,y:f}=Dd(u,i).positionAbsolute;a=[[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 u=n.get(e.parentNode);l=Dd(u,i).positionAbsolute}const c=a&&a!=="parent"?kT(t,a):t;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function dw({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 C8=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...AT(l)}})};function vh(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function f3({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l==null||l("012",fa.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([e])}function nve(){const e=Gn();return I.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function fw(e){return(t,n,r)=>e==null?void 0:e(t,r)}function fj({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=Gn(),[l,c]=I.useState(!1),u=I.useRef([]),d=I.useRef({x:null,y:null}),f=I.useRef(0),h=I.useRef(null),p=I.useRef({x:0,y:0}),m=I.useRef(null),_=I.useRef(!1),v=I.useRef(!1),y=nve();return I.useEffect(()=>{if(e!=null&&e.current){const g=xo(e.current),b=({x:C,y:x})=>{const{nodeInternals:k,onNodeDrag:A,onSelectionDrag:R,updateNodePositions:L,nodeExtent:M,snapGrid:E,snapToGrid:P,nodeOrigin:O,onError:F}=a.getState();d.current={x:C,y:x};let $=!1,D={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&M){const z=OT(u.current,O);D=Tg(z)}if(u.current=u.current.map(z=>{const V={x:C-z.distance.x,y:x-z.distance.y};P&&(V.x=E[0]*Math.round(V.x/E[0]),V.y=E[1]*Math.round(V.y/E[1]));const H=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];u.current.length>1&&M&&!z.extent&&(H[0][0]=z.positionAbsolute.x-D.x+M[0][0],H[1][0]=z.positionAbsolute.x+(z.width??0)-D.x2+M[1][0],H[0][1]=z.positionAbsolute.y-D.y+M[0][1],H[1][1]=z.positionAbsolute.y+(z.height??0)-D.y2+M[1][1]);const X=dj(z,V,k,H,O,F);return $=$||z.position.x!==X.position.x||z.position.y!==X.position.y,z.position=X.position,z.positionAbsolute=X.positionAbsolute,z}),!$)return;L(u.current,!0,!0),c(!0);const N=i?A:fw(R);if(N&&m.current){const[z,V]=dw({nodeId:i,dragItems:u.current,nodeInternals:k});N(m.current,z,V)}},S=()=>{if(!h.current)return;const[C,x]=Mz(p.current,h.current);if(C!==0||x!==0){const{transform:k,panBy:A}=a.getState();d.current.x=(d.current.x??0)-C/k[2],d.current.y=(d.current.y??0)-x/k[2],A({x:C,y:x})&&b(d.current)}f.current=requestAnimationFrame(S)},w=C=>{var O;const{nodeInternals:x,multiSelectionActive:k,nodesDraggable:A,unselectNodesAndEdges:R,onNodeDragStart:L,onSelectionDragStart:M}=a.getState();v.current=!0;const E=i?L:fw(M);(!s||!o)&&!k&&i&&((O=x.get(i))!=null&&O.selected||R()),i&&o&&s&&f3({id:i,store:a,nodeRef:e});const P=y(C);if(d.current=P,u.current=eve(x,A,P,i),E&&u.current){const[F,$]=dw({nodeId:i,dragItems:u.current,nodeInternals:x});E(C.sourceEvent,F,$)}};if(t)g.on(".drag",null);else{const C=fme().on("start",x=>{const{domNode:k,nodeDragThreshold:A}=a.getState();A===0&&w(x);const R=y(x);d.current=R,h.current=(k==null?void 0:k.getBoundingClientRect())||null,p.current=fl(x.sourceEvent,h.current)}).on("drag",x=>{var L,M;const k=y(x),{autoPanOnNodeDrag:A,nodeDragThreshold:R}=a.getState();if(!_.current&&v.current&&A&&(_.current=!0,S()),!v.current){const E=k.xSnapped-(((L=d==null?void 0:d.current)==null?void 0:L.x)??0),P=k.ySnapped-(((M=d==null?void 0:d.current)==null?void 0:M.y)??0);Math.sqrt(E*E+P*P)>R&&w(x)}(d.current.x!==k.xSnapped||d.current.y!==k.ySnapped)&&u.current&&v.current&&(m.current=x.sourceEvent,p.current=fl(x.sourceEvent,h.current),b(k))}).on("end",x=>{if(v.current&&(c(!1),_.current=!1,v.current=!1,cancelAnimationFrame(f.current),u.current)){const{updateNodePositions:k,nodeInternals:A,onNodeDragStop:R,onSelectionDragStop:L}=a.getState(),M=i?R:fw(L);if(k(u.current,!1,!1),M){const[E,P]=dw({nodeId:i,dragItems:u.current,nodeInternals:A});M(x.sourceEvent,E,P)}}}).filter(x=>{const k=x.target;return!x.button&&(!n||!w8(k,`.${n}`,e))&&(!r||w8(k,r,e))});return g.call(C),()=>{g.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,y]),l}function hj(){const e=Gn();return I.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:u}=e.getState(),d=s().filter(y=>y.selected&&(y.draggable||u&&typeof y.draggable>"u")),f=a?l[0]:5,h=a?l[1]:5,p=n.isShiftPressed?4:1,m=n.x*f*p,_=n.y*h*p,v=d.map(y=>{if(y.positionAbsolute){const g={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+_};a&&(g.x=l[0]*Math.round(g.x/l[0]),g.y=l[1]*Math.round(g.y/l[1]));const{positionAbsolute:b,position:S}=dj(y,g,r,i,void 0,c);y.position=S,y.positionAbsolute=b}return y});o(v,!0,!1)},[])}const Ld={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var bh=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:_,className:v,isDraggable:y,isSelectable:g,isConnectable:b,isFocusable:S,selectNodesOnDrag:w,sourcePosition:C,targetPosition:x,hidden:k,resizeObserver:A,dragHandle:R,zIndex:L,isParent:M,noDragClassName:E,noPanClassName:P,initialized:O,disableKeyboardA11y:F,ariaLabel:$,rfId:D})=>{const N=Gn(),z=I.useRef(null),V=I.useRef(C),H=I.useRef(x),X=I.useRef(r),te=g||y||u||d||f||h,ee=hj(),j=vh(n,N.getState,d),q=vh(n,N.getState,f),Z=vh(n,N.getState,h),oe=vh(n,N.getState,p),be=vh(n,N.getState,m),Me=we=>{const{nodeDragThreshold:pt}=N.getState();if(g&&(!w||!y||pt>0)&&f3({id:n,store:N,nodeRef:z}),u){const vt=N.getState().nodeInternals.get(n);vt&&u(we,{...vt})}},lt=we=>{if(!a3(we))if(Nz.includes(we.key)&&g){const pt=we.key==="Escape";f3({id:n,store:N,unselect:pt,nodeRef:z})}else!F&&y&&c&&Object.prototype.hasOwnProperty.call(Ld,we.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${we.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),ee({x:Ld[we.key].x,y:Ld[we.key].y,isShiftPressed:we.shiftKey}))};I.useEffect(()=>{if(z.current&&!k){const we=z.current;return A==null||A.observe(we),()=>A==null?void 0:A.unobserve(we)}},[k]),I.useEffect(()=>{const we=X.current!==r,pt=V.current!==C,vt=H.current!==x;z.current&&(we||pt||vt)&&(we&&(X.current=r),pt&&(V.current=C),vt&&(H.current=x),N.getState().updateNodeDimensions([{id:n,nodeElement:z.current,forceUpdate:!0}]))},[n,r,C,x]);const Le=fj({nodeRef:z,disabled:k||!y,noDragClassName:E,handleSelector:R,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return k?null:Q.createElement("div",{className:no(["react-flow__node",`react-flow__node-${r}`,{[P]:y},v,{selected:c,selectable:g,parent:M,dragging:Le}]),ref:z,style:{zIndex:L,transform:`translate(${a}px,${l}px)`,pointerEvents:te?"all":"none",visibility:O?"visible":"hidden",..._},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:q,onMouseLeave:Z,onContextMenu:oe,onClick:Me,onDoubleClick:be,onKeyDown:S?lt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":F?void 0:`${nj}-${D}`,"aria-label":$},Q.createElement(mye,{value:n},Q.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:c,isConnectable:b,sourcePosition:C,targetPosition:x,dragging:Le,dragHandle:R,zIndex:L})))};return t.displayName="NodeWrapper",I.memo(t)};const rve=e=>{const t=e.getNodes().filter(n=>n.selected);return{...OT(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function ive({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Gn(),{width:i,height:o,x:s,y:a,transformString:l,userSelectionActive:c}=rn(rve,ti),u=hj(),d=I.useRef(null);if(I.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),fj({nodeRef:d}),c||!i||!o)return null;const f=e?p=>{const m=r.getState().getNodes().filter(_=>_.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Ld,p.key)&&u({x:Ld[p.key].x,y:Ld[p.key].y,isShiftPressed:p.shiftKey})};return Q.createElement("div",{className:no(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},Q.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:a,left:s}}))}var ove=I.memo(ive);const sve=e=>e.nodesSelectionActive,pj=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:_,panActivationKeyCode:v,zoomActivationKeyCode:y,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:x,zoomOnDoubleClick:k,panOnDrag:A,defaultViewport:R,translateExtent:L,minZoom:M,maxZoom:E,preventScrolling:P,onSelectionContextMenu:O,noWheelClassName:F,noPanClassName:$,disableKeyboardA11y:D})=>{const N=rn(sve),z=Ag(d),V=Ag(v),H=V||A,X=V||w,te=z||f&&H!==!0;return Wye({deleteKeyCode:a,multiSelectionKeyCode:_}),Q.createElement(Qye,{onMove:l,onMoveStart:c,onMoveEnd:u,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:S,panOnScroll:X,panOnScrollSpeed:C,panOnScrollMode:x,zoomOnDoubleClick:k,panOnDrag:!z&&H,defaultViewport:R,translateExtent:L,minZoom:M,maxZoom:E,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:F,noPanClassName:$},Q.createElement(cj,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:H,isSelecting:!!te,selectionMode:h},e,N&&Q.createElement(ove,{onSelectionContextMenu:O,noPanClassName:$,disableKeyboardA11y:D})))};pj.displayName="FlowRenderer";var ave=I.memo(pj);function lve(e){return rn(I.useCallback(n=>e?Gz(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function cve(e){const t={input:bh(e.input||Zz),default:bh(e.default||d3),output:bh(e.output||ej),group:bh(e.group||FT)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=bh(e[o]||d3),i),n);return{...t,...r}}const uve=({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]},dve=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),gj=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=rn(dve,ti),a=lve(e.onlyRenderVisibleElements),l=I.useRef(),c=I.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=u,u},[]);return I.useEffect(()=>()=>{var u;(u=l==null?void 0:l.current)==null||u.disconnect()},[]),Q.createElement("div",{className:"react-flow__nodes",style:DT},a.map(u=>{var S,w;let d=u.type||"default";e.nodeTypes[d]||(s==null||s("003",fa.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),p=!!(u.selectable||i&&typeof u.selectable>"u"),m=!!(u.connectable||n&&typeof u.connectable>"u"),_=!!(u.focusable||r&&typeof u.focusable>"u"),v=e.nodeExtent?kT(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,y=(v==null?void 0:v.x)??0,g=(v==null?void 0:v.y)??0,b=uve({x:y,y:g,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return Q.createElement(f,{key:u.id,id:u.id,className:u.className,style:u.style,type:d,data:u.data,sourcePosition:u.sourcePosition||Te.Bottom,targetPosition:u.targetPosition||Te.Top,hidden:u.hidden,xPos:y,yPos:g,xPosOrigin:b.x,yPosOrigin:b.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:p,isConnectable:m,isFocusable:_,resizeObserver:c,dragHandle:u.dragHandle,zIndex:((S=u[Tn])==null?void 0:S.z)??0,isParent:!!((w=u[Tn])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel})}))};gj.displayName="NodeRenderer";var fve=I.memo(gj);const hve=(e,t,n)=>n===Te.Left?e-t:n===Te.Right?e+t:e,pve=(e,t,n)=>n===Te.Top?e-t:n===Te.Bottom?e+t:e,E8="react-flow__edgeupdater",T8=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>Q.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:no([E8,`${E8}-${a}`]),cx:hve(t,r,e),cy:pve(n,r,e),r,stroke:"transparent",fill:"transparent"}),gve=()=>!0;var Du=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:_,source:v,target:y,sourceX:g,sourceY:b,targetX:S,targetY:w,sourcePosition:C,targetPosition:x,elementsSelectable:k,hidden:A,sourceHandleId:R,targetHandleId:L,onContextMenu:M,onMouseEnter:E,onMouseMove:P,onMouseLeave:O,edgeUpdaterRadius:F,onEdgeUpdate:$,onEdgeUpdateStart:D,onEdgeUpdateEnd:N,markerEnd:z,markerStart:V,rfId:H,ariaLabel:X,isFocusable:te,isUpdatable:ee,pathOptions:j,interactionWidth:q})=>{const Z=I.useRef(null),[oe,be]=I.useState(!1),[Me,lt]=I.useState(!1),Le=Gn(),we=I.useMemo(()=>`url(#${c3(V,H)})`,[V,H]),pt=I.useMemo(()=>`url(#${c3(z,H)})`,[z,H]);if(A)return null;const vt=Yt=>{var hn;const{edges:It,addSelectedEdges:oi,unselectNodesAndEdges:Oi,multiSelectionActive:ho}=Le.getState(),Ur=It.find(si=>si.id===n);Ur&&(k&&(Le.setState({nodesSelectionActive:!1}),Ur.selected&&ho?(Oi({nodes:[],edges:[Ur]}),(hn=Z.current)==null||hn.blur()):oi([n])),s&&s(Yt,Ur))},Ce=yh(n,Le.getState,a),ii=yh(n,Le.getState,M),sn=yh(n,Le.getState,E),jr=yh(n,Le.getState,P),sr=yh(n,Le.getState,O),fn=(Yt,It)=>{if(Yt.button!==0)return;const{edges:oi,isValidConnection:Oi}=Le.getState(),ho=It?y:v,Ur=(It?L:R)||null,hn=It?"target":"source",si=Oi||gve,Gl=It,Go=oi.find(_t=>_t.id===n);lt(!0),D==null||D(Yt,Go,hn);const Hl=_t=>{lt(!1),N==null||N(_t,Go,hn)};Kz({event:Yt,handleId:Ur,nodeId:ho,onConnect:_t=>$==null?void 0:$(Go,_t),isTarget:Gl,getState:Le.getState,setState:Le.setState,isValidConnection:si,edgeUpdaterType:hn,onEdgeUpdateEnd:Hl})},Vr=Yt=>fn(Yt,!0),fo=Yt=>fn(Yt,!1),Ri=()=>be(!0),ar=()=>be(!1),Wn=!k&&!s,wr=Yt=>{var It;if(Nz.includes(Yt.key)&&k){const{unselectNodesAndEdges:oi,addSelectedEdges:Oi,edges:ho}=Le.getState();Yt.key==="Escape"?((It=Z.current)==null||It.blur(),oi({edges:[ho.find(hn=>hn.id===n)]})):Oi([n])}};return Q.createElement("g",{className:no(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:c,inactive:Wn,updating:oe}]),onClick:vt,onDoubleClick:Ce,onContextMenu:ii,onMouseEnter:sn,onMouseMove:jr,onMouseLeave:sr,onKeyDown:te?wr:void 0,tabIndex:te?0:void 0,role:te?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":X===null?void 0:X||`Edge from ${v} to ${y}`,"aria-describedby":te?`${rj}-${H}`:void 0,ref:Z},!Me&&Q.createElement(e,{id:n,source:v,target:y,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:_,sourceX:g,sourceY:b,targetX:S,targetY:w,sourcePosition:C,targetPosition:x,sourceHandleId:R,targetHandleId:L,markerStart:we,markerEnd:pt,pathOptions:j,interactionWidth:q}),ee&&Q.createElement(Q.Fragment,null,(ee==="source"||ee===!0)&&Q.createElement(T8,{position:C,centerX:g,centerY:b,radius:F,onMouseDown:Vr,onMouseEnter:Ri,onMouseOut:ar,type:"source"}),(ee==="target"||ee===!0)&&Q.createElement(T8,{position:x,centerX:S,centerY:w,radius:F,onMouseDown:fo,onMouseEnter:Ri,onMouseOut:ar,type:"target"})))};return t.displayName="EdgeWrapper",I.memo(t)};function mve(e){const t={default:Du(e.default||F1),straight:Du(e.bezier||MT),step:Du(e.step||IT),smoothstep:Du(e.step||lS),simplebezier:Du(e.simplebezier||PT)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=Du(e[o]||F1),i),n);return{...t,...r}}function A8(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case Te.Top:return{x:r+o/2,y:i};case Te.Right:return{x:r+o,y:i+s/2};case Te.Bottom:return{x:r+o/2,y:i+s};case Te.Left:return{x:r,y:i+s/2}}}function k8(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const yve=(e,t,n,r,i,o)=>{const s=A8(n,e,t),a=A8(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function vve({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:s,height:a,transform:l}){const c={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)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Tg({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}function P8(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[Tn])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const bve=[{level:0,isMaxLevel:!0,edges:[]}];function _ve(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var u,d;const l=Xi(a.zIndex);let c=l?a.zIndex:0;if(n){const f=t.get(a.target),h=t.get(a.source),p=a.selected||(f==null?void 0:f.selected)||(h==null?void 0:h.selected),m=Math.max(((u=h==null?void 0:h[Tn])==null?void 0:u.z)||0,((d=f==null?void 0:f[Tn])==null?void 0:d.z)||0,1e3);c=(l?a.zIndex:0)+(p?m:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),o=Object.entries(i).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return o.length===0?bve:o}function Sve(e,t,n){const r=rn(I.useCallback(i=>e?i.edges.filter(o=>{const s=t.get(o.source),a=t.get(o.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&vve({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return _ve(r,t,n)}const xve=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),wve=({color:e="none",strokeWidth:t=1})=>Q.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),I8={[N1.Arrow]:xve,[N1.ArrowClosed]:wve};function Cve(e){const t=Gn();return I.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(I8,e)?I8[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",fa.error009(e)),null)},[e])}const Eve=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Cve(t);return l?Q.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0"},Q.createElement(l,{color:n,strokeWidth:s})):null},Tve=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=c3(s,t);r.includes(a)||(i.push({id:a,color:s.color||e,...s}),r.push(a))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},mj=({defaultColor:e,rfId:t})=>{const n=rn(I.useCallback(Tve({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return Q.createElement("defs",null,n.map(r=>Q.createElement(Eve,{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})))};mj.displayName="MarkerDefinitions";var Ave=I.memo(mj);const kve=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}),yj=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,children:_})=>{const{edgesFocusable:v,edgesUpdatable:y,elementsSelectable:g,width:b,height:S,connectionMode:w,nodeInternals:C,onError:x}=rn(kve,ti),k=Sve(t,C,n);return b?Q.createElement(Q.Fragment,null,k.map(({level:A,edges:R,isMaxLevel:L})=>Q.createElement("svg",{key:A,style:{zIndex:A},width:b,height:S,className:"react-flow__edges react-flow__container"},L&&Q.createElement(Ave,{defaultColor:e,rfId:r}),Q.createElement("g",null,R.map(M=>{const[E,P,O]=P8(C.get(M.source)),[F,$,D]=P8(C.get(M.target));if(!O||!D)return null;let N=M.type||"default";i[N]||(x==null||x("011",fa.error011(N)),N="default");const z=i[N]||i.default,V=w===iu.Strict?$.target:($.target??[]).concat($.source??[]),H=k8(P.source,M.sourceHandle),X=k8(V,M.targetHandle),te=(H==null?void 0:H.position)||Te.Bottom,ee=(X==null?void 0:X.position)||Te.Top,j=!!(M.focusable||v&&typeof M.focusable>"u"),q=typeof s<"u"&&(M.updatable||y&&typeof M.updatable>"u");if(!H||!X)return x==null||x("008",fa.error008(H,M)),null;const{sourceX:Z,sourceY:oe,targetX:be,targetY:Me}=yve(E,H,te,F,X,ee);return Q.createElement(z,{key:M.id,id:M.id,className:no([M.className,o]),type:N,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:Z,sourceY:oe,targetX:be,targetY:Me,sourcePosition:te,targetPosition:ee,elementsSelectable:g,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,rfId:r,ariaLabel:M.ariaLabel,isFocusable:j,isUpdatable:q,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth})})))),_):null};yj.displayName="EdgeRenderer";var Pve=I.memo(yj);const Ive=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Mve({children:e}){const t=rn(Ive);return Q.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function Rve(e){const t=aj(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ove={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top},vj=({nodeId:e,handleType:t,style:n,type:r=qa.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,C,x;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:u}=rn(I.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),ti),d=(w=s==null?void 0:s[Tn])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(u===iu.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const h=a?f.find(k=>k.id===a):f[0],p=h?h.x+h.width/2:(s.width??0)/2,m=h?h.y+h.height/2:s.height??0,_=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+p,v=(((x=s.positionAbsolute)==null?void 0:x.y)??0)+m,y=h==null?void 0:h.position,g=y?Ove[y]:null;if(!y||!g)return null;if(i)return Q.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:_,fromY:v,toX:l,toY:c,fromPosition:y,toPosition:g,connectionStatus:o});let b="";const S={sourceX:_,sourceY:v,sourcePosition:y,targetX:l,targetY:c,targetPosition:g};return r===qa.Bezier?[b]=zz(S):r===qa.Step?[b]=l3({...S,borderRadius:0}):r===qa.SmoothStep?[b]=l3(S):r===qa.SimpleBezier?[b]=Bz(S):b=`M${_},${v} ${l},${c}`,Q.createElement("path",{d:b,fill:"none",className:"react-flow__connection-path",style:n})};vj.displayName="ConnectionLine";const $ve=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Nve({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:l,connectionStatus:c}=rn($ve,ti);return!(i&&o&&a&&s)?null:Q.createElement("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},Q.createElement("g",{className:no(["react-flow__connection",c])},Q.createElement(vj,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function M8(e,t){return I.useRef(null),Gn(),I.useMemo(()=>t(e),[e])}const bj=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:_,connectionLineType:v,connectionLineStyle:y,connectionLineComponent:g,connectionLineContainerStyle:b,selectionKeyCode:S,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:A,deleteKeyCode:R,onlyRenderVisibleElements:L,elementsSelectable:M,selectNodesOnDrag:E,defaultViewport:P,translateExtent:O,minZoom:F,maxZoom:$,preventScrolling:D,defaultMarkerColor:N,zoomOnScroll:z,zoomOnPinch:V,panOnScroll:H,panOnScrollSpeed:X,panOnScrollMode:te,zoomOnDoubleClick:ee,panOnDrag:j,onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:oe,onPaneMouseLeave:be,onPaneScroll:Me,onPaneContextMenu:lt,onEdgeUpdate:Le,onEdgeContextMenu:we,onEdgeMouseEnter:pt,onEdgeMouseMove:vt,onEdgeMouseLeave:Ce,edgeUpdaterRadius:ii,onEdgeUpdateStart:sn,onEdgeUpdateEnd:jr,noDragClassName:sr,noWheelClassName:fn,noPanClassName:Vr,elevateEdgesOnSelect:fo,disableKeyboardA11y:Ri,nodeOrigin:ar,nodeExtent:Wn,rfId:wr})=>{const Yt=M8(e,cve),It=M8(t,mve);return Rve(o),Q.createElement(ave,{onPaneClick:q,onPaneMouseEnter:Z,onPaneMouseMove:oe,onPaneMouseLeave:be,onPaneContextMenu:lt,onPaneScroll:Me,deleteKeyCode:R,selectionKeyCode:S,selectionOnDrag:w,selectionMode:C,onSelectionStart:m,onSelectionEnd:_,multiSelectionKeyCode:x,panActivationKeyCode:k,zoomActivationKeyCode:A,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:z,zoomOnPinch:V,zoomOnDoubleClick:ee,panOnScroll:H,panOnScrollSpeed:X,panOnScrollMode:te,panOnDrag:j,defaultViewport:P,translateExtent:O,minZoom:F,maxZoom:$,onSelectionContextMenu:p,preventScrolling:D,noDragClassName:sr,noWheelClassName:fn,noPanClassName:Vr,disableKeyboardA11y:Ri},Q.createElement(Mve,null,Q.createElement(Pve,{edgeTypes:It,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:Le,onlyRenderVisibleElements:L,onEdgeContextMenu:we,onEdgeMouseEnter:pt,onEdgeMouseMove:vt,onEdgeMouseLeave:Ce,onEdgeUpdateStart:sn,onEdgeUpdateEnd:jr,edgeUpdaterRadius:ii,defaultMarkerColor:N,noPanClassName:Vr,elevateEdgesOnSelect:!!fo,disableKeyboardA11y:Ri,rfId:wr},Q.createElement(Nve,{style:y,type:v,component:g,containerStyle:b})),Q.createElement("div",{className:"react-flow__edgelabel-renderer"}),Q.createElement(fve,{nodeTypes:Yt,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:E,onlyRenderVisibleElements:L,noPanClassName:Vr,noDragClassName:sr,disableKeyboardA11y:Ri,nodeOrigin:ar,nodeExtent:Wn,rfId:wr})))};bj.displayName="GraphView";var Fve=I.memo(bj);const h3=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pa={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:h3,nodeExtent:h3,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:iu.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,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uye,isValidConnection:void 0},Dve=()=>Cpe((e,t)=>({...Pa,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:cw(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",s=i?cw(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=t(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,_)=>{const v=i.get(_.id);if(v){const y=AT(_.nodeElement);!!(y.width&&y.height&&(v.width!==y.width||v.height!==y.height||_.forceUpdate))&&(i.set(v.id,{...v,[Tn]:{...v[Tn],handleBounds:{source:C8(".source",_.nodeElement,f,c),target:C8(".target",_.nodeElement,f,c)}},...y}),m.push({id:v.id,type:"dimensions",dimensions:y}))}return m},[]);oj(i,c);const p=s||o&&!s&&sj(t,{initial:!0,...a});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(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:i};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});o(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const c=lc(n,a()),u=cw(c,i,s,l);e({nodeInternals:u})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>ja(l,!0)):(s=cd(o(),n),a=cd(i,[])),ny({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>ja(l,!0)):(s=cd(i,n),a=cd(o(),[])),ny({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),s=n||o(),a=r||i,l=s.map(u=>(u.selected=!1,ja(u.id,!1))),c=a.map(u=>ja(u.id,!1));ny({changedNodes:l,changedEdges:c,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(a=>a.selected).map(a=>ja(a.id,!1)),s=n.filter(a=>a.selected).map(a=>ja(a.id,!1));ny({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=kT(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=dl.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),u=[[0,0],[i,o]],d=s==null?void 0:s.constrain()(c,u,l);return s.transform(a,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:Pa.connectionNodeId,connectionHandleId:Pa.connectionHandleId,connectionHandleType:Pa.connectionHandleType,connectionStatus:Pa.connectionStatus,connectionStartHandle:Pa.connectionStartHandle,connectionEndHandle:Pa.connectionEndHandle}),reset:()=>e({...Pa})}),Object.is),_j=({children:e})=>{const t=I.useRef(null);return t.current||(t.current=Dve()),Q.createElement(rye,{value:t.current},e)};_j.displayName="ReactFlowProvider";const Sj=({children:e})=>I.useContext(aS)?Q.createElement(Q.Fragment,null,e):Q.createElement(_j,null,e);Sj.displayName="ReactFlowWrapper";const Lve={input:Zz,default:d3,output:ej,group:FT},Bve={default:F1,straight:MT,step:IT,smoothstep:lS,simplebezier:PT},zve=[0,0],jve=[15,15],Vve={x:0,y:0,zoom:1},Uve={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gve=I.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=Lve,edgeTypes:s=Bve,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:C,onNodeDrag:x,onNodeDragStop:k,onNodesDelete:A,onEdgesDelete:R,onSelectionChange:L,onSelectionDragStart:M,onSelectionDrag:E,onSelectionDragStop:P,onSelectionContextMenu:O,onSelectionStart:F,onSelectionEnd:$,connectionMode:D=iu.Strict,connectionLineType:N=qa.Bezier,connectionLineStyle:z,connectionLineComponent:V,connectionLineContainerStyle:H,deleteKeyCode:X="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ee=!1,selectionMode:j=Cl.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:Z=$1()?"Meta":"Control",zoomActivationKeyCode:oe=$1()?"Meta":"Control",snapToGrid:be=!1,snapGrid:Me=jve,onlyRenderVisibleElements:lt=!1,selectNodesOnDrag:Le=!0,nodesDraggable:we,nodesConnectable:pt,nodesFocusable:vt,nodeOrigin:Ce=zve,edgesFocusable:ii,edgesUpdatable:sn,elementsSelectable:jr,defaultViewport:sr=Vve,minZoom:fn=.5,maxZoom:Vr=2,translateExtent:fo=h3,preventScrolling:Ri=!0,nodeExtent:ar,defaultMarkerColor:Wn="#b1b1b7",zoomOnScroll:wr=!0,zoomOnPinch:Yt=!0,panOnScroll:It=!1,panOnScrollSpeed:oi=.5,panOnScrollMode:Oi=wc.Free,zoomOnDoubleClick:ho=!0,panOnDrag:Ur=!0,onPaneClick:hn,onPaneMouseEnter:si,onPaneMouseMove:Gl,onPaneMouseLeave:Go,onPaneScroll:Hl,onPaneContextMenu:Ut,children:_t,onEdgeUpdate:qn,onEdgeContextMenu:Pn,onEdgeDoubleClick:lr,onEdgeMouseEnter:Cr,onEdgeMouseMove:Gr,onEdgeMouseLeave:Ho,onEdgeUpdateStart:Er,onEdgeUpdateEnd:Kn,edgeUpdaterRadius:Ms=10,onNodesChange:Ca,onEdgesChange:Ea,noDragClassName:wu="nodrag",noWheelClassName:Rs="nowheel",noPanClassName:Tr="nopan",fitView:Wl=!1,fitViewOptions:j2,connectOnClick:V2=!0,attributionPosition:U2,proOptions:G2,defaultEdgeOptions:Ta,elevateNodesOnSelect:H2=!0,elevateEdgesOnSelect:W2=!1,disableKeyboardA11y:u0=!1,autoPanOnConnect:q2=!0,autoPanOnNodeDrag:K2=!0,connectionRadius:X2=20,isValidConnection:Yf,onError:Q2,style:Cu,id:Eu,nodeDragThreshold:Y2,...Tu},d0)=>{const Zf=Eu||"1";return Q.createElement("div",{...Tu,style:{...Cu,...Uve},ref:d0,className:no(["react-flow",i]),"data-testid":"rf__wrapper",id:Eu},Q.createElement(Sj,null,Q.createElement(Fve,{onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:b,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:s,connectionLineType:N,connectionLineStyle:z,connectionLineComponent:V,connectionLineContainerStyle:H,selectionKeyCode:te,selectionOnDrag:ee,selectionMode:j,deleteKeyCode:X,multiSelectionKeyCode:Z,panActivationKeyCode:q,zoomActivationKeyCode:oe,onlyRenderVisibleElements:lt,selectNodesOnDrag:Le,defaultViewport:sr,translateExtent:fo,minZoom:fn,maxZoom:Vr,preventScrolling:Ri,zoomOnScroll:wr,zoomOnPinch:Yt,zoomOnDoubleClick:ho,panOnScroll:It,panOnScrollSpeed:oi,panOnScrollMode:Oi,panOnDrag:Ur,onPaneClick:hn,onPaneMouseEnter:si,onPaneMouseMove:Gl,onPaneMouseLeave:Go,onPaneScroll:Hl,onPaneContextMenu:Ut,onSelectionContextMenu:O,onSelectionStart:F,onSelectionEnd:$,onEdgeUpdate:qn,onEdgeContextMenu:Pn,onEdgeDoubleClick:lr,onEdgeMouseEnter:Cr,onEdgeMouseMove:Gr,onEdgeMouseLeave:Ho,onEdgeUpdateStart:Er,onEdgeUpdateEnd:Kn,edgeUpdaterRadius:Ms,defaultMarkerColor:Wn,noDragClassName:wu,noWheelClassName:Rs,noPanClassName:Tr,elevateEdgesOnSelect:W2,rfId:Zf,disableKeyboardA11y:u0,nodeOrigin:Ce,nodeExtent:ar}),Q.createElement($ye,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:v,nodesDraggable:we,nodesConnectable:pt,nodesFocusable:vt,edgesFocusable:ii,edgesUpdatable:sn,elementsSelectable:jr,elevateNodesOnSelect:H2,minZoom:fn,maxZoom:Vr,nodeExtent:ar,onNodesChange:Ca,onEdgesChange:Ea,snapToGrid:be,snapGrid:Me,connectionMode:D,translateExtent:fo,connectOnClick:V2,defaultEdgeOptions:Ta,fitView:Wl,fitViewOptions:j2,onNodesDelete:A,onEdgesDelete:R,onNodeDragStart:C,onNodeDrag:x,onNodeDragStop:k,onSelectionDrag:E,onSelectionDragStart:M,onSelectionDragStop:P,noPanClassName:Tr,nodeOrigin:Ce,rfId:Zf,autoPanOnConnect:q2,autoPanOnNodeDrag:K2,onError:Q2,connectionRadius:X2,isValidConnection:Yf,nodeDragThreshold:Y2}),Q.createElement(Rye,{onSelectionChange:L}),_t,Q.createElement(sye,{proOptions:G2,position:U2}),Q.createElement(Bye,{rfId:Zf,disableKeyboardA11y:u0})))});Gve.displayName="ReactFlow";const Hve=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function rHe({children:e}){const t=rn(Hve);return t?gi.createPortal(e,t):null}function iHe(){const e=Gn();return I.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(o))},[])}function Wve(){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 kg=m5("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,Wve()))}catch(n){return t({error:n})}});var qve="\0",Yl="\0",R8="",Wr,Ac,di,Jg,Wd,qd,Ui,ts,Qa,ns,Ya,js,Vs,Kd,Xd,Us,vo,em,p3,PO;let Kve=(PO=class{constructor(t){Bt(this,em);Bt(this,Wr,!0);Bt(this,Ac,!1);Bt(this,di,!1);Bt(this,Jg,void 0);Bt(this,Wd,()=>{});Bt(this,qd,()=>{});Bt(this,Ui,{});Bt(this,ts,{});Bt(this,Qa,{});Bt(this,ns,{});Bt(this,Ya,{});Bt(this,js,{});Bt(this,Vs,{});Bt(this,Kd,0);Bt(this,Xd,0);Bt(this,Us,void 0);Bt(this,vo,void 0);t&&(Ni(this,Wr,t.hasOwnProperty("directed")?t.directed:!0),Ni(this,Ac,t.hasOwnProperty("multigraph")?t.multigraph:!1),Ni(this,di,t.hasOwnProperty("compound")?t.compound:!1)),Y(this,di)&&(Ni(this,Us,{}),Ni(this,vo,{}),Y(this,vo)[Yl]={})}isDirected(){return Y(this,Wr)}isMultigraph(){return Y(this,Ac)}isCompound(){return Y(this,di)}setGraph(t){return Ni(this,Jg,t),this}graph(){return Y(this,Jg)}setDefaultNodeLabel(t){return Ni(this,Wd,t),typeof t!="function"&&Ni(this,Wd,()=>t),this}nodeCount(){return Y(this,Kd)}nodes(){return Object.keys(Y(this,Ui))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(Y(t,ts)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(Y(t,ns)[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 Y(this,Ui).hasOwnProperty(t)?(arguments.length>1&&(Y(this,Ui)[t]=n),this):(Y(this,Ui)[t]=arguments.length>1?n:Y(this,Wd).call(this,t),Y(this,di)&&(Y(this,Us)[t]=Yl,Y(this,vo)[t]={},Y(this,vo)[Yl][t]=!0),Y(this,ts)[t]={},Y(this,Qa)[t]={},Y(this,ns)[t]={},Y(this,Ya)[t]={},++th(this,Kd)._,this)}node(t){return Y(this,Ui)[t]}hasNode(t){return Y(this,Ui).hasOwnProperty(t)}removeNode(t){var n=this;if(Y(this,Ui).hasOwnProperty(t)){var r=i=>n.removeEdge(Y(n,js)[i]);delete Y(this,Ui)[t],Y(this,di)&&(Wo(this,em,p3).call(this,t),delete Y(this,Us)[t],this.children(t).forEach(function(i){n.setParent(i)}),delete Y(this,vo)[t]),Object.keys(Y(this,ts)[t]).forEach(r),delete Y(this,ts)[t],delete Y(this,Qa)[t],Object.keys(Y(this,ns)[t]).forEach(r),delete Y(this,ns)[t],delete Y(this,Ya)[t],--th(this,Kd)._}return this}setParent(t,n){if(!Y(this,di))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=Yl;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),Wo(this,em,p3).call(this,t),Y(this,Us)[t]=n,Y(this,vo)[n][t]=!0,this}parent(t){if(Y(this,di)){var n=Y(this,Us)[t];if(n!==Yl)return n}}children(t=Yl){if(Y(this,di)){var n=Y(this,vo)[t];if(n)return Object.keys(n)}else{if(t===Yl)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=Y(this,Qa)[t];if(n)return Object.keys(n)}successors(t){var n=Y(this,Ya)[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:Y(this,Wr),multigraph:Y(this,Ac),compound:Y(this,di)});n.setGraph(this.graph());var r=this;Object.entries(Y(this,Ui)).forEach(function([s,a]){t(s)&&n.setNode(s,a)}),Object.values(Y(this,js)).forEach(function(s){n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,r.edge(s))});var i={};function o(s){var a=r.parent(s);return a===void 0||n.hasNode(a)?(i[s]=a,a):a in i?i[a]:o(a)}return Y(this,di)&&n.nodes().forEach(s=>n.setParent(s,o(s))),n}setDefaultEdgeLabel(t){return Ni(this,qd,t),typeof t!="function"&&Ni(this,qd,()=>t),this}edgeCount(){return Y(this,Xd)}edges(){return Object.values(Y(this,js))}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,s){return i.length>1?r.setEdge(o,s,n):r.setEdge(o,s),s}),this}setEdge(){var t,n,r,i,o=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,n=s.w,r=s.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=s,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var a=qh(Y(this,Wr),t,n,r);if(Y(this,Vs).hasOwnProperty(a))return o&&(Y(this,Vs)[a]=i),this;if(r!==void 0&&!Y(this,Ac))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),Y(this,Vs)[a]=o?i:Y(this,qd).call(this,t,n,r);var l=Xve(Y(this,Wr),t,n,r);return t=l.v,n=l.w,Object.freeze(l),Y(this,js)[a]=l,O8(Y(this,Qa)[n],t),O8(Y(this,Ya)[t],n),Y(this,ts)[n][a]=l,Y(this,ns)[t][a]=l,th(this,Xd)._++,this}edge(t,n,r){var i=arguments.length===1?hw(Y(this,Wr),arguments[0]):qh(Y(this,Wr),t,n,r);return Y(this,Vs)[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?hw(Y(this,Wr),arguments[0]):qh(Y(this,Wr),t,n,r);return Y(this,Vs).hasOwnProperty(i)}removeEdge(t,n,r){var i=arguments.length===1?hw(Y(this,Wr),arguments[0]):qh(Y(this,Wr),t,n,r),o=Y(this,js)[i];return o&&(t=o.v,n=o.w,delete Y(this,Vs)[i],delete Y(this,js)[i],$8(Y(this,Qa)[n],t),$8(Y(this,Ya)[t],n),delete Y(this,ts)[n][i],delete Y(this,ns)[t][i],th(this,Xd)._--),this}inEdges(t,n){var r=Y(this,ts)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=Y(this,ns)[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))}},Wr=new WeakMap,Ac=new WeakMap,di=new WeakMap,Jg=new WeakMap,Wd=new WeakMap,qd=new WeakMap,Ui=new WeakMap,ts=new WeakMap,Qa=new WeakMap,ns=new WeakMap,Ya=new WeakMap,js=new WeakMap,Vs=new WeakMap,Kd=new WeakMap,Xd=new WeakMap,Us=new WeakMap,vo=new WeakMap,em=new WeakSet,p3=function(t){delete Y(this,vo)[Y(this,Us)[t]][t]},PO);function O8(e,t){e[t]?e[t]++:e[t]=1}function $8(e,t){--e[t]||delete e[t]}function qh(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}return i+R8+o+R8+(r===void 0?qve:r)}function Xve(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return r&&(a.name=r),a}function hw(e,t){return qh(e,t.v,t.w,t.name)}var LT=Kve,Qve="2.1.13",Yve={Graph:LT,version:Qve},Zve=LT,Jve={write:e1e,read:r1e};function e1e(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t1e(e),edges:n1e(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function t1e(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 n1e(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 r1e(e){var t=new Zve(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 i1e=o1e;function o1e(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 fr,Gs,tm,g3,nm,m3,Qd,ov,IO;let s1e=(IO=class{constructor(){Bt(this,tm);Bt(this,nm);Bt(this,Qd);Bt(this,fr,[]);Bt(this,Gs,{})}size(){return Y(this,fr).length}keys(){return Y(this,fr).map(function(t){return t.key})}has(t){return Y(this,Gs).hasOwnProperty(t)}priority(t){var n=Y(this,Gs)[t];if(n!==void 0)return Y(this,fr)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return Y(this,fr)[0].key}add(t,n){var r=Y(this,Gs);if(t=String(t),!r.hasOwnProperty(t)){var i=Y(this,fr),o=i.length;return r[t]=o,i.push({key:t,priority:n}),Wo(this,nm,m3).call(this,o),!0}return!1}removeMin(){Wo(this,Qd,ov).call(this,0,Y(this,fr).length-1);var t=Y(this,fr).pop();return delete Y(this,Gs)[t.key],Wo(this,tm,g3).call(this,0),t.key}decrease(t,n){var r=Y(this,Gs)[t];if(n>Y(this,fr)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+Y(this,fr)[r].priority+" New: "+n);Y(this,fr)[r].priority=n,Wo(this,nm,m3).call(this,r)}},fr=new WeakMap,Gs=new WeakMap,tm=new WeakSet,g3=function(t){var n=Y(this,fr),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&&(Wo(this,Qd,ov).call(this,t,o),Wo(this,tm,g3).call(this,o)))},nm=new WeakSet,m3=function(t){for(var n=Y(this,fr),r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)Wo(this,Qd,ov).call(this,t,i),t=i},Qd=new WeakSet,ov=function(t,n){var r=Y(this,fr),i=Y(this,Gs),o=r[t],s=r[n];r[t]=s,r[n]=o,i[s.key]=t,i[o.key]=n},IO);var xj=s1e,a1e=xj,wj=c1e,l1e=()=>1;function c1e(e,t,n,r){return u1e(e,String(t),n||l1e,r||function(i){return e.outEdges(i)})}function u1e(e,t,n,r){var i={},o=new a1e,s,a,l=function(c){var u=c.v!==s?c.v:c.w,d=i[u],f=n(c),h=a.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=s,o.decrease(u,h))};for(e.nodes().forEach(function(c){var u=c===t?0:Number.POSITIVE_INFINITY;i[c]={distance:u},o.add(c,u)});o.size()>0&&(s=o.removeMin(),a=i[s],a.distance!==Number.POSITIVE_INFINITY);)r(s).forEach(l);return i}var d1e=wj,f1e=h1e;function h1e(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=d1e(e,i,t,n),r},{})}var Cj=p1e;function p1e(e){var t=0,n=[],r={},i=[];function o(s){var a=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(u){r.hasOwnProperty(u)?r[u].onStack&&(a.lowlink=Math.min(a.lowlink,r[u].index)):(o(u),a.lowlink=Math.min(a.lowlink,r[u].lowlink))}),a.lowlink===a.index){var l=[],c;do c=n.pop(),r[c].onStack=!1,l.push(c);while(s!==c);i.push(l)}}return e.nodes().forEach(function(s){r.hasOwnProperty(s)||o(s)}),i}var g1e=Cj,m1e=y1e;function y1e(e){return g1e(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var v1e=_1e,b1e=()=>1;function _1e(e,t,n){return S1e(e,t||b1e,n||function(r){return e.outEdges(r)})}function S1e(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(s){o!==s&&(r[o][s]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(s){var a=s.v===o?s.w:s.v,l=t(s);r[o][a]={distance:l,predecessor:o}})}),i.forEach(function(o){var s=r[o];i.forEach(function(a){var l=r[a];i.forEach(function(c){var u=l[o],d=s[c],f=l[c],h=u.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function Ej(e){var t={},n={},r=[];function i(o){if(n.hasOwnProperty(o))throw new y3;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 y3;return r}class y3 extends Error{constructor(){super(...arguments)}}var Tj=Ej;Ej.CycleException=y3;var N8=Tj,x1e=w1e;function w1e(e){try{N8(e)}catch(t){if(t instanceof N8.CycleException)return!1;throw t}return!0}var Aj=C1e;function C1e(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?a=>e.successors(a):a=>e.neighbors(a),i=n==="post"?E1e:T1e,o=[],s={};return t.forEach(a=>{if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);i(a,r,s,o)}),o}function E1e(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]),kj(t(o[0]),s=>i.push([s,!1])))}}function T1e(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();n.hasOwnProperty(o)||(n[o]=!0,r.push(o),kj(t(o),s=>i.push(s)))}}function kj(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var A1e=Aj,k1e=P1e;function P1e(e,t){return A1e(e,t,"post")}var I1e=Aj,M1e=R1e;function R1e(e,t){return I1e(e,t,"pre")}var O1e=LT,$1e=xj,N1e=F1e;function F1e(e,t){var n=new O1e,r={},i=new $1e,o;function s(l){var c=l.v===o?l.w:l.v,u=i.priority(c);if(u!==void 0){var d=t(l);d<u&&(r[c]=o,i.decrease(c,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 a=!1;i.size()>0;){if(o=i.removeMin(),r.hasOwnProperty(o))n.setEdge(o,r[o]);else{if(a)throw new Error("Input graph is not connected: "+e);a=!0}e.nodeEdges(o).forEach(s)}return n}var D1e={components:i1e,dijkstra:wj,dijkstraAll:f1e,findCycles:m1e,floydWarshall:v1e,isAcyclic:x1e,postorder:k1e,preorder:M1e,prim:N1e,tarjan:Cj,topsort:Tj},F8=Yve,L1e={Graph:F8.Graph,json:Jve,alg:D1e,version:F8.version};const D8=Ml(L1e),L8=(e,t,n,r)=>{const i=new D8.Graph;return n.forEach(o=>{i.setNode(o.id)}),r.forEach(o=>{i.setEdge(o.source,o.target)}),i.setEdge(e,t),D8.alg.isAcyclic(i)},B1e=(e,t)=>{if(e.name==="CollectionField"&&t.name==="CollectionField")return!1;if($4(e,t))return!0;const n=e.name==="CollectionItemField"&&!t.isCollection,r=t.name==="CollectionItemField"&&!e.isCollection&&!e.isCollectionOrScalar,i=t.isCollectionOrScalar&&e.name===t.name,o=e.name==="CollectionField"&&(t.isCollection||t.isCollectionOrScalar),s=t.name==="CollectionField"&&e.isCollection,a=!e.isCollection&&!e.isCollectionOrScalar&&!t.isCollection&&!t.isCollectionOrScalar,l=a&&e.name==="IntegerField"&&t.name==="FloatField",c=a&&(e.name==="IntegerField"||e.name==="FloatField")&&t.name==="StringField",u=t.name==="AnyField";return n||r||i||o||s||l||c||u},B8=(e,t,n,r,i)=>{let o=!0;return t==="source"?e.find(s=>s.target===r.id&&s.targetHandle===i.name)&&(o=!1):e.find(s=>s.source===r.id&&s.sourceHandle===i.name)&&(o=!1),B1e(n,i.type)||(o=!1),o},z8=(e,t,n,r,i,o,s)=>{if(e.id===r)return null;const a=o=="source"?e.data.inputs:e.data.outputs;if(a[i]){const l=a[i],c=o=="source"?r:e.id,u=o=="source"?e.id:r,d=o=="source"?i:l.name,f=o=="source"?l.name:i,h=L8(c,u,t,n),p=B8(n,o,s,e,l);if(h&&p)return{source:c,sourceHandle:d,target:u,targetHandle:f}}for(const l in a){const c=a[l],u=o=="source"?r:e.id,d=o=="source"?e.id:r,f=o=="source"?i:c.name,h=o=="source"?c.name:i,p=L8(u,d,t,n),m=B8(n,o,s,e,c);if(p&&m)return{source:u,sourceHandle:f,target:d,targetHandle:h}}return null},j8=(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}},pw={status:gc.enum.PENDING,error:null,progress:null,progressImage:null,outputs:[]},Pj={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,connectionStartFieldType:null,connectionMade:!1,modifyingEdge:!1,addNewNodePosition:null,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:Cl.Partial},kr=(e,t,n)=>{var c,u;const{nodeId:r,fieldName:i,value:o}=t.payload,s=e.nodes.findIndex(d=>d.id===r),a=(c=e.nodes)==null?void 0:c[s];if(!Sn(a))return;const l=(u=a.data)==null?void 0:u.inputs[i];!l||s<0||!n.safeParse(o).success||(l.value=o)},Ij=jt({name:"nodes",initialState:Pj,reducers:{nodesChanged:(e,t)=>{e.nodes=lc(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=j8(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=lc(e.nodes.map(s=>({id:s.id,type:"select",selected:!1})),e.nodes),e.edges=Ql(e.edges.map(s=>({id:s.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),!!Sn(n)){if(e.nodeExecutionStates[n.id]={nodeId:n.id,...pw},e.connectionStartParams){const{nodeId:s,handleId:a,handleType:l}=e.connectionStartParams;if(s&&a&&l&&e.connectionStartFieldType){const c=z8(n,e.nodes,e.edges,s,a,l,e.connectionStartFieldType);c&&(e.edges=Wh({...c,type:"default"},e.edges))}}e.connectionStartParams=null,e.connectionStartFieldType=null}},edgeChangeStarted:e=>{e.modifyingEdge=!0},edgesChanged:(e,t)=>{e.edges=Ql(t.payload,e.edges)},edgeAdded:(e,t)=>{e.edges=Wh(t.payload,e.edges)},edgeUpdated:(e,t)=>{const{oldEdge:n,newConnection:r}=t.payload;e.edges=xye(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(c=>c.id===n),s=(l=e.nodes)==null?void 0:l[o];if(!Sn(s))return;const a=i==="source"?s.data.outputs[r]:s.data.inputs[r];e.connectionStartFieldType=(a==null?void 0:a.type)??null},connectionMade:(e,t)=>{e.connectionStartFieldType&&(e.edges=Wh({...t.payload,type:"default"},e.edges),e.connectionMade=!0)},connectionEnded:(e,t)=>{var n;if(e.connectionMade)e.connectionStartParams=null,e.connectionStartFieldType=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:s,handleType:a}=e.connectionStartParams;if(o&&s&&a&&e.connectionStartFieldType){const l=z8(i,e.nodes,e.edges,o,s,a,e.connectionStartFieldType);l&&(e.edges=Wh({...l,type:"default"},e.edges))}}e.connectionStartParams=null,e.connectionStartFieldType=null}else e.addNewNodePosition=t.payload.cursorPosition,e.isAddNodePopoverOpen=!0;e.modifyingEdge=!1},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(a=>a.id===n);if(!Sn(o))return;const s=o.data.inputs[r];s&&(s.label=i)},nodeUseCacheChanged:(e,t)=>{var s;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Sn(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var s;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Sn(o)&&(o.data.isIntermediate=r)},nodeIsOpenChanged:(e,t)=>{var a;const{nodeId:n,isOpen:r}=t.payload,i=e.nodes.findIndex(l=>l.id===n),o=(a=e.nodes)==null?void 0:a[i];if(!Sn(o)&&!Y5(o)||(o.data.isOpen=r,!Sn(o)))return;const s=$T([o],e.edges);if(r)s.forEach(l=>{delete l.hidden}),s.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(c=>c.id!==l.id))});else{const l=_ye(o,e.nodes,e.edges).filter(d=>Sn(d)&&d.data.isOpen===!1),c=bye(o,e.nodes,e.edges).filter(d=>Sn(d)&&d.data.isOpen===!1),u=[];s.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=u.find(m=>m.source===d.source&&m.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:u.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}if(d.source===n&&c.find(p=>p.id===d.target)){const p=u.find(m=>m.source===d.source&&m.target===d.target);d.hidden=!0,p?p.data={count:(((h=p.data)==null?void 0:h.count)??0)+1}:u.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}}),u.length&&(e.edges=Ql(u.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(s=>{s.source===o.source&&s.target===o.target&&i.push({id:s.id,type:"remove"})})}),e.edges=Ql(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{Sn(n)&&delete e.nodeExecutionStates[n.id]})},nodeLabelChanged:(e,t)=>{var s;const{nodeId:n,label:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Sn(o)&&(o.data.label=r)},nodeNotesChanged:(e,t)=>{var s;const{nodeId:n,notes:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Sn(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=lc(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)=>{kr(e,t,V_)},fieldNumberValueChanged:(e,t)=>{kr(e,t,z_.or(j_))},fieldBooleanValueChanged:(e,t)=>{kr(e,t,U_)},fieldBoardValueChanged:(e,t)=>{kr(e,t,W_)},fieldImageValueChanged:(e,t)=>{kr(e,t,H_)},fieldColorValueChanged:(e,t)=>{kr(e,t,q_)},fieldMainModelValueChanged:(e,t)=>{kr(e,t,Df)},fieldRefinerModelValueChanged:(e,t)=>{kr(e,t,K_)},fieldVaeModelValueChanged:(e,t)=>{kr(e,t,X_)},fieldLoRAModelValueChanged:(e,t)=>{kr(e,t,Q_)},fieldControlNetModelValueChanged:(e,t)=>{kr(e,t,Y_)},fieldIPAdapterModelValueChanged:(e,t)=>{kr(e,t,Z_)},fieldT2IAdapterModelValueChanged:(e,t)=>{kr(e,t,J_)},fieldEnumModelValueChanged:(e,t)=>{kr(e,t,G_)},fieldSchedulerValueChanged:(e,t)=>{kr(e,t,eS)},notesNodeValueChanged:(e,t)=>{var s;const{nodeId:n,value:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Y5(o)&&(o.data.notes=r)},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[]},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},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=lc(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=Ql(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(Ge),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Ge),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(Ge),i=r.map(u=>u.data.id),o=e.edgesToCopy.filter(u=>i.includes(u.source)&&i.includes(u.target)).map(Ge);o.forEach(u=>u.selected=!0),r.forEach(u=>{const d=ul();o.forEach(h=>{h.source===u.data.id&&(h.source=d,h.id=h.id.replace(u.data.id,d)),h.target===u.data.id&&(h.target=d,h.id=h.id.replace(u.data.id,d))}),u.selected=!0,u.id=d,u.data.id=d;const f=j8(e.nodes,u.position.x+((n==null?void 0:n.x)??0),u.position.y+((n==null?void 0:n.y)??0));u.position=f});const s=r.map(u=>({item:u,type:"add"})),a=e.nodes.map(u=>({id:u.data.id,type:"select",selected:!1})),l=o.map(u=>({item:u,type:"add"})),c=e.edges.map(u=>({id:u.id,type:"select",selected:!1}));e.nodes=lc(s.concat(a),e.nodes),e.edges=Ql(l.concat(c),e.edges),r.forEach(u=>{e.nodeExecutionStates[u.id]={nodeId:u.id,...pw}})},addNodePopoverOpened:e=>{e.addNewNodePosition=null,e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1,e.connectionStartParams=null,e.connectionStartFieldType=null},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?Cl.Full:Cl.Partial}},extraReducers:e=>{e.addCase(kg.pending,t=>{t.isReady=!1}),e.addCase(yT,(t,n)=>{const{nodes:r,edges:i}=n.payload;t.nodes=lc(r.map(o=>({item:{...o,...cB},type:"add"})),[]),t.edges=Ql(i.map(o=>({item:o,type:"add"})),[]),t.nodeExecutionStates=r.reduce((o,s)=>(o[s.id]={nodeId:s.id,...pw},o),{})}),e.addCase(D4,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=gc.enum.IN_PROGRESS)}),e.addCase(B4,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=gc.enum.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(u_,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=gc.enum.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(z4,(t,n)=>{const{source_node_id:r,step:i,total_steps:o,progress_image:s}=n.payload.data,a=t.nodeExecutionStates[r];a&&(a.status=gc.enum.IN_PROGRESS,a.progress=(i+1)/o,a.progressImage=s??null)}),e.addCase(d_,(t,n)=>{["in_progress"].includes(n.payload.data.queue_item.status)&&Fo(t.nodeExecutionStates,r=>{r.status=gc.enum.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{addNodePopoverClosed:aHe,addNodePopoverOpened:lHe,addNodePopoverToggled:cHe,connectionEnded:z1e,connectionMade:j1e,connectionStarted:uHe,edgeDeleted:V1e,edgeChangeStarted:dHe,edgesChanged:U1e,edgesDeleted:G1e,edgeUpdated:H1e,fieldBoardValueChanged:W1e,fieldBooleanValueChanged:q1e,fieldColorValueChanged:K1e,fieldControlNetModelValueChanged:X1e,fieldEnumModelValueChanged:Q1e,fieldImageValueChanged:Um,fieldIPAdapterModelValueChanged:Y1e,fieldT2IAdapterModelValueChanged:Z1e,fieldLabelChanged:J1e,fieldLoRAModelValueChanged:ebe,fieldMainModelValueChanged:tbe,fieldNumberValueChanged:nbe,fieldRefinerModelValueChanged:rbe,fieldSchedulerValueChanged:ibe,fieldStringValueChanged:obe,fieldVaeModelValueChanged:sbe,mouseOverFieldChanged:fHe,mouseOverNodeChanged:hHe,nodeAdded:abe,nodeReplaced:Mj,nodeEditorReset:Rj,nodeExclusivelySelected:pHe,nodeIsIntermediateChanged:lbe,nodeIsOpenChanged:cbe,nodeLabelChanged:ube,nodeNotesChanged:dbe,nodeOpacityChanged:gHe,nodesChanged:fbe,nodesDeleted:Oj,nodeTemplatesBuilt:$j,nodeUseCacheChanged:hbe,notesNodeValueChanged:pbe,selectedAll:mHe,selectedEdgesChanged:yHe,selectedNodesChanged:vHe,selectionCopied:bHe,selectionModeChanged:_He,selectionPasted:gbe,shouldAnimateEdgesChanged:SHe,shouldColorEdgesChanged:xHe,shouldShowMinimapPanelChanged:wHe,shouldSnapToGridChanged:CHe,shouldValidateGraphChanged:EHe,viewportChanged:THe,edgeAdded:mbe}=Ij.actions,ybe=br(z1e,j1e,V1e,U1e,G1e,H1e,W1e,q1e,K1e,X1e,Q1e,Um,Y1e,Z1e,J1e,ebe,tbe,nbe,rbe,ibe,obe,sbe,abe,Mj,lbe,cbe,ube,dbe,fbe,Oj,hbe,pbe,gbe,mbe),vbe=Ij.reducer,gw={name:"",author:"",description:"",version:"",contact:"",tags:"",notes:"",exposedFields:[],meta:{version:"2.0.0",category:"user"},isTouched:!0},Nj=jt({name:"workflow",initialState:gw,reducers:{workflowExposedFieldAdded:(e,t)=>{e.exposedFields=YF(e.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`),e.isTouched=!0},workflowExposedFieldRemoved:(e,t)=>{e.exposedFields=e.exposedFields.filter(n=>!$4(n,t.payload)),e.isTouched=!0},workflowNameChanged:(e,t)=>{e.name=t.payload,e.isTouched=!0},workflowDescriptionChanged:(e,t)=>{e.description=t.payload,e.isTouched=!0},workflowTagsChanged:(e,t)=>{e.tags=t.payload,e.isTouched=!0},workflowAuthorChanged:(e,t)=>{e.author=t.payload,e.isTouched=!0},workflowNotesChanged:(e,t)=>{e.notes=t.payload,e.isTouched=!0},workflowVersionChanged:(e,t)=>{e.version=t.payload,e.isTouched=!0},workflowContactChanged:(e,t)=>{e.contact=t.payload,e.isTouched=!0},workflowIDChanged:(e,t)=>{e.id=t.payload},workflowReset:()=>Ge(gw),workflowSaved:e=>{e.isTouched=!1}},extraReducers:e=>{e.addCase(yT,(t,n)=>{const{nodes:r,edges:i,...o}=n.payload;return{...Ge(o),isTouched:!0}}),e.addCase(Oj,(t,n)=>{n.payload.forEach(r=>{t.exposedFields=t.exposedFields.filter(i=>i.nodeId!==r.id)})}),e.addCase(Rj,()=>Ge(gw)),e.addMatcher(ybe,t=>{t.isTouched=!0})}}),{workflowExposedFieldAdded:bbe,workflowExposedFieldRemoved:AHe,workflowNameChanged:kHe,workflowDescriptionChanged:PHe,workflowTagsChanged:IHe,workflowAuthorChanged:MHe,workflowNotesChanged:RHe,workflowVersionChanged:OHe,workflowContactChanged:$He,workflowIDChanged:NHe,workflowReset:FHe,workflowSaved:DHe}=Nj.actions,_be=Nj.reducer,Fj={esrganModelName:"RealESRGAN_x4plus.pth"},Dj=jt({name:"postprocessing",initialState:Fj,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:LHe}=Dj.actions,Sbe=Dj.reducer,Lj={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},Bj=jt({name:"sdxl",initialState:Lj,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:BHe,setNegativeStylePromptSDXL:zHe,setShouldConcatSDXLStylePrompt:jHe,setShouldUseSDXLRefiner:xbe,setSDXLImg2ImgDenoisingStrength:VHe,refinerModelChanged:V8,setRefinerSteps:UHe,setRefinerCFGScale:GHe,setRefinerScheduler:HHe,setRefinerPositiveAestheticScore:WHe,setRefinerNegativeAestheticScore:qHe,setRefinerStart:KHe}=Bj.actions,wbe=Bj.reducer,zj={shift:!1,ctrl:!1,meta:!1},jj=jt({name:"hotkeys",initialState:zj,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:XHe,ctrlKeyPressed:QHe,metaKeyPressed:YHe}=jj.actions,Cbe=jj.reducer,Vj={activeTab:"txt2img",shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalMenuCloseTrigger:0,panels:{}},Uj=jt({name:"ui",initialState:Vj,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},bumpGlobalMenuCloseTrigger:e=>{e.globalMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(m_,t=>{t.activeTab="img2img"})}}),{setActiveTab:Gj,setShouldShowImageDetails:ZHe,setShouldUseCanvasBetaLayout:JHe,setShouldShowExistingModelsInSearch:eWe,setShouldUseSliders:tWe,setShouldHidePreview:nWe,setShouldShowProgressInViewer:rWe,favoriteSchedulersChanged:iWe,toggleEmbeddingPicker:oWe,setShouldAutoChangeDimensions:sWe,bumpGlobalMenuCloseTrigger:aWe,panelsChanged:lWe}=Uj.actions,Ebe=Uj.reducer;function cS(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Hj(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=cS(n);return(i,o)=>r.then(s=>o(s.transaction(t,i).objectStore(t)))}let mw;function BT(){return mw||(mw=Hj("keyval-store","keyval")),mw}function Tbe(e,t=BT()){return t("readonly",n=>cS(n.get(e)))}function Abe(e,t,n=BT()){return n("readwrite",r=>(r.put(t,e),cS(r.transaction)))}function cWe(e=BT()){return e("readwrite",t=>(t.clear(),cS(t.transaction)))}var zT=Object.defineProperty,kbe=Object.getOwnPropertyDescriptor,Pbe=Object.getOwnPropertyNames,Ibe=Object.prototype.hasOwnProperty,Mbe=(e,t)=>{for(var n in t)zT(e,n,{get:t[n],enumerable:!0})},Rbe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pbe(t))!Ibe.call(e,i)&&i!==n&&zT(e,i,{get:()=>t[i],enumerable:!(r=kbe(t,i))||r.enumerable});return e},Obe=e=>Rbe(zT({},"__esModule",{value:!0}),e),Wj={};Mbe(Wj,{__DO_NOT_USE__ActionTypes:()=>Pg,applyMiddleware:()=>jbe,bindActionCreators:()=>zbe,combineReducers:()=>Bbe,compose:()=>qj,createStore:()=>VT,isAction:()=>Vbe,isPlainObject:()=>jT,legacy_createStore:()=>Dbe});var $be=Obe(Wj);function Mn(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 Nbe=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),U8=Nbe,yw=()=>Math.random().toString(36).substring(7).split("").join("."),Fbe={INIT:`@@redux/INIT${yw()}`,REPLACE:`@@redux/REPLACE${yw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yw()}`},Pg=Fbe;function jT(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function VT(e,t,n){if(typeof e!="function")throw new Error(Mn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Mn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Mn(1));return n(VT)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach((_,v)=>{s.set(v,_)}))}function u(){if(l)throw new Error(Mn(3));return i}function d(_){if(typeof _!="function")throw new Error(Mn(4));if(l)throw new Error(Mn(5));let v=!0;c();const y=a++;return s.set(y,_),function(){if(v){if(l)throw new Error(Mn(6));v=!1,c(),s.delete(y),o=null}}}function f(_){if(!jT(_))throw new Error(Mn(7));if(typeof _.type>"u")throw new Error(Mn(8));if(typeof _.type!="string")throw new Error(Mn(17));if(l)throw new Error(Mn(9));try{l=!0,i=r(i,_)}finally{l=!1}return(o=s).forEach(y=>{y()}),_}function h(_){if(typeof _!="function")throw new Error(Mn(10));r=_,f({type:Pg.REPLACE})}function p(){const _=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Mn(11));function y(){const b=v;b.next&&b.next(u())}return y(),{unsubscribe:_(y)}},[U8](){return this}}}return f({type:Pg.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[U8]:p}}function Dbe(e,t,n){return VT(e,t,n)}function Lbe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Pg.INIT})>"u")throw new Error(Mn(12));if(typeof n(void 0,{type:Pg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Mn(13))})}function Bbe(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{Lbe(n)}catch(o){i=o}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const d=r[u],f=n[d],h=s[d],p=f(h,a);if(typeof p>"u")throw a&&a.type,new Error(Mn(14));c[d]=p,l=l||p!==h}return l=l||r.length!==Object.keys(s).length,l?c:s}}function G8(e,t){return function(...n){return t(e.apply(this,n))}}function zbe(e,t){if(typeof e=="function")return G8(e,t);if(typeof e!="object"||e===null)throw new Error(Mn(16));const n={};for(const r in e){const i=e[r];typeof i=="function"&&(n[r]=G8(i,t))}return n}function qj(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function jbe(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(Mn(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=qj(...a)(i.dispatch),{...i,dispatch:o}}}function Vbe(e){return jT(e)&&"type"in e&&typeof e.type=="string"}Xj=Kj=void 0;var Ube=$be,Gbe=function(){var t=[],n=[],r=void 0,i=function(c){return r=c,function(u){return function(d){return Ube.compose.apply(void 0,n)(u)(d)}}},o=function(){for(var c,u,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(c=n).push.apply(c,f.map(function(p){return p(r)})),(u=t).push.apply(u,f)},s=function(c){var u=t.findIndex(function(d){return d===c});if(u===-1){console.error("Middleware does not exist!",c);return}t=t.filter(function(d,f){return f!==u}),n=n.filter(function(d,f){return f!==u})},a=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:s,resetMiddlewares:a}},uS=Gbe(),Hbe=uS.enhancer,Wbe=uS.addMiddleware;uS.removeMiddleware;var qbe=uS.resetMiddlewares,Kj=Wbe,Xj=qbe,v3="@@REMEMBER_REHYDRATED",Kbe="@@REMEMBER_PERSISTED";function b3(e){"@babel/helpers - typeof";return b3=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},b3(e)}var Qj=function(t,n){if(t===null||b3(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];t.hasOwnProperty(o)&&(i[o]=t[o])}return i},Xbe=function(t,n){var r=0,i;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=+new Date,c=(r||l)-l;if(c<=0&&!i){r=l+n,t.apply(void 0,s);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,s),clearTimeout(i),i=null},c)}},Qbe=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function Ig(e){"@babel/helpers - typeof";return Ig=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},Ig(e)}function H8(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 W8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H8(Object(n),!0).forEach(function(r){Ybe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ybe(e,t,n){return t=Zbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zbe(e){var t=Jbe(e,"string");return Ig(t)==="symbol"?t:String(t)}function Jbe(e,t){if(Ig(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ig(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,i)}function UT(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){q8(o,r,i,s,a,"next",l)}function a(l){q8(o,r,i,s,a,"throw",l)}s(void 0)})}}var e_e=function(){var e=UT(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,s=yield r.getItem("".concat(i,"rootState"));return s==null?{}:Qj(o(s,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),t_e=function(){var e=UT(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,s=yield Promise.all(n.map(function(a){return r.getItem("".concat(i).concat(a))}));return n.reduce(function(a,l,c){return s[c]!==null&&s[c]!==void 0&&(a[l]=o(s[c],l)),a},{})});return function(n){return e.apply(this,arguments)}}(),n_e=function(){var e=UT(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.unserialize,l=t.getState();try{var c=s?e_e:t_e;l=W8(W8({},l),yield c({rememberedKeys:n,driver:o,prefix:i,unserialize:a}))}catch(u){console.warn("redux-remember: rehydrate error",u)}t.dispatch({type:v3,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function vw(e,t){return o_e(e)||i_e(e,t)||Yj(e,t)||r_e()}function r_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i_e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function o_e(e){if(Array.isArray(e))return e}function bw(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Yj(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(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function Yj(e,t){if(e){if(typeof e=="string")return K8(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 K8(e,t)}}function K8(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 L1(e){"@babel/helpers - typeof";return L1=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},L1(e)}var X8=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},Q8=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},s_e=function e(t,n){if(t===n)return!0;if(L1(t)!=="object"||L1(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(Q8(t)&&Q8(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=X8(t),s=X8(n);if(o==="DataView"&&s==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&s==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&s==="Map"){if(t.size!==n.size)return!1;var a=bw(t.entries()),l;try{for(a.s();!(l=a.n()).done;){var c=vw(l.value,1),u=c[0];if(!n.has(u))return!1}}catch(x){a.e(x)}finally{a.f()}var d=bw(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=vw(f.value,2),p=h[0],m=h[1];if(!e(m,n.get(p)))return!1}}catch(x){d.e(x)}finally{d.f()}return!0}if(o==="Set"&&s==="Set"){if(t.size!==n.size)return!1;var _=bw(t.entries()),v;try{for(_.s();!(v=_.n()).done;){var y=vw(v.value,1),g=y[0];if(!n.has(g))return!1}}catch(x){_.e(x)}finally{_.f()}return!0}if(o==="Date"&&s==="Date")return+t==+n;var b=Object.keys(t);if(b.length!==Object.keys(n).length)return!1;for(var S=b.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,b[S]))return!1;for(var w=b.length;w--!==0;){var C=b[w];if(!e(t[C],n[C]))return!1}return o!=="Object"&&s!=="Object"?t===n:!0};const GT=s_e;function Y8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,i)}function Zj(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){Y8(o,r,i,s,a,"next",l)}function a(l){Y8(o,r,i,s,a,"throw",l)}s(void 0)})}}var a_e=function(){var e=Zj(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;if(!GT(t,n))return o.setItem("".concat(i,"rootState"),s(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),l_e=function(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;return Promise.all(Object.keys(t).map(function(a){return GT(t[a],n[a])?Promise.resolve():o.setItem("".concat(i).concat(a),s(t[a],a))}))},c_e=function(){var e=Zj(function*(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.serialize;try{var l=s?a_e:l_e;yield l(t,n,{prefix:i,driver:o,serialize:a})}catch(c){console.warn("redux-remember: persist error",c)}});return function(){return e.apply(this,arguments)}}();function Z8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,i)}function J8(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){Z8(o,r,i,s,a,"next",l)}function a(l){Z8(o,r,i,s,a,"throw",l)}s(void 0)})}}var u_e=function(){var e=J8(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize,a=r.unserialize,l=r.persistThrottle,c=r.persistDebounce,u=r.persistWholeStore;yield n_e(t,n,{prefix:i,driver:o,unserialize:a,persistWholeStore:u});var d={},f=function(){var h=J8(function*(){var p=Qj(t.getState(),n);yield c_e(p,d,{prefix:i,driver:o,serialize:s,persistWholeStore:u}),GT(p,d)||t.dispatch({type:Kbe,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();c&&c>0?t.subscribe(Qbe(f,c)):t.subscribe(Xbe(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const d_e=u_e;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 eM(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 _w(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){f_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f_e(e,t,n){return t=h_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_e(e){var t=p_e(e,"string");return Mg(t)==="symbol"?t:String(t)}function p_e(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 g_e=function(t){var n={state:{}};return function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,o=arguments.length>1?arguments[1]:void 0;o.type&&((o==null?void 0:o.type)==="@@INIT"||o!=null&&(r=o.type)!==null&&r!==void 0&&r.startsWith("@@redux/INIT"))&&(n.state=_w({},i));var s=typeof t=="function"?t:Vb(t);switch(o.type){case v3:{var a=_w(_w({},n.state),(o==null?void 0:o.payload)||{});return n.state=s(a,{type:v3,payload:a}),n.state}default:return s(i,o)}}},m_e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,s=r.serialize,a=s===void 0?function(v,y){return JSON.stringify(v)}:s,l=r.unserialize,c=l===void 0?function(v,y){return JSON.parse(v)}:l,u=r.persistThrottle,d=u===void 0?100:u,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h,m=r.initActionType;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 _=function(y){return function(g,b,S){var w=!1,C=function(A){return d_e(A,n,{driver:t,prefix:o,serialize:a,unserialize:c,persistThrottle:d,persistDebounce:f,persistWholeStore:p})},x=y(function(k,A){return!w&&m&&A.type===m&&(w=!0,setTimeout(function(){return C(x)},0)),g(k,A)},b,S);return m||(w=!0,C(x)),x}};return _};const tM="@@invokeai-",y_e=["cursorPosition"],v_e=["pendingControlImages"],b_e=["prompts"],__e=["selection","selectedBoardId","galleryView"],S_e=["nodeTemplates","connectionStartParams","connectionStartFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy","connectionMade","modifyingEdge","addNewNodePosition"],x_e=[],w_e=[],C_e=["isInitialized","isConnected","denoiseProgress","status"],E_e=["shouldShowImageDetails","globalMenuCloseTrigger","panels"],T_e={canvas:y_e,gallery:__e,generation:x_e,nodes:S_e,postprocessing:w_e,system:C_e,ui:E_e,controlNet:v_e,dynamicPrompts:b_e},A_e=(e,t)=>{const n=uu(e,T_e[t]??[]);return JSON.stringify(n)},k_e={canvas:SL,gallery:nB,generation:iT,nodes:Pj,postprocessing:Fj,system:gD,config:RD,ui:Vj,hotkeys:zj,controlAdapters:D5,dynamicPrompts:hT,sdxl:Lj},P_e=(e,t)=>zF(JSON.parse(e),k_e[t]),I_e=e=>{if(the(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return kg.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:$j.match(e)?{...e,payload:"<Node templates omitted>"}:e},M_e=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],R_e=e=>e,O_e=br(rue,iue),$_e=()=>{fe({matcher:O_e,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("canvas"),i=n(),{batchIds:o}=i.canvas;try{const s=t(en.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:a}=await s.unwrap();s.reset(),a>0&&(r.debug(`Canceled ${a} canvas batches`),t(Ve({title:J("queue.cancelBatchSucceeded"),status:"success"}))),t(lue())}catch{r.error("Failed to cancel canvas batches"),t(Ve({title:J("queue.cancelBatchFailed"),status:"error"}))}}})};he("app/appStarted");const N_e=()=>{fe({matcher:ce.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==Vi({board_id:"none",categories:Rn}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Ot.getSelectors().selectAll(i)[0];t(ps(o??null))}}})},F_e=()=>{fe({matcher:en.endpoints.enqueueBatch.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=en.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(en.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},Jj=Lo.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:uWe,useGetAppConfigQuery:dWe,useClearInvocationCacheMutation:fWe,useDisableInvocationCacheMutation:hWe,useEnableInvocationCacheMutation:pWe,useGetInvocationCacheStatusQuery:gWe}=Jj,D_e=()=>{fe({matcher:Jj.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,s=t().generation.infillMethod;r.includes(s)||n(qle(r[0])),i.includes("nsfw_checker")||n(Zoe(!1)),o.includes("invisible_watermark")||n(Joe(!1))}})},L_e=he("app/appStarted"),B_e=()=>{fe({actionCreator:L_e,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})};function z_e(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 j_e(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 V_e=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(j_e(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=z_e(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}(),dr="-ms-",B1="-moz-",ut="-webkit-",eV="comm",HT="rule",WT="decl",U_e="@import",tV="@keyframes",G_e="@layer",H_e=Math.abs,dS=String.fromCharCode,W_e=Object.assign;function q_e(e,t){return er(e,0)^45?(((t<<2^er(e,0))<<2^er(e,1))<<2^er(e,2))<<2^er(e,3):0}function nV(e){return e.trim()}function K_e(e,t){return(e=t.exec(e))?e[0]:e}function dt(e,t,n){return e.replace(t,n)}function _3(e,t){return e.indexOf(t)}function er(e,t){return e.charCodeAt(t)|0}function Rg(e,t,n){return e.slice(t,n)}function rs(e){return e.length}function qT(e){return e.length}function iy(e,t){return t.push(e),e}function X_e(e,t){return e.map(t).join("")}var fS=1,yf=1,rV=0,ni=0,mn=0,Lf="";function hS(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:fS,column:yf,length:s,return:""}}function _h(e,t){return W_e(hS("",null,null,"",null,null,0),e,{length:-e.length},t)}function Q_e(){return mn}function Y_e(){return mn=ni>0?er(Lf,--ni):0,yf--,mn===10&&(yf=1,fS--),mn}function Si(){return mn=ni<rV?er(Lf,ni++):0,yf++,mn===10&&(yf=1,fS++),mn}function ms(){return er(Lf,ni)}function sv(){return ni}function Gm(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 iV(e){return fS=yf=1,rV=rs(Lf=e),ni=0,[]}function oV(e){return Lf="",e}function av(e){return nV(Gm(ni-1,S3(e===91?e+2:e===40?e+1:e)))}function Z_e(e){for(;(mn=ms())&&mn<33;)Si();return Og(e)>2||Og(mn)>3?"":" "}function J_e(e,t){for(;--t&&Si()&&!(mn<48||mn>102||mn>57&&mn<65||mn>70&&mn<97););return Gm(e,sv()+(t<6&&ms()==32&&Si()==32))}function S3(e){for(;Si();)switch(mn){case e:return ni;case 34:case 39:e!==34&&e!==39&&S3(mn);break;case 40:e===41&&S3(e);break;case 92:Si();break}return ni}function eSe(e,t){for(;Si()&&e+mn!==47+10;)if(e+mn===42+42&&ms()===47)break;return"/*"+Gm(t,ni-1)+"*"+dS(e===47?e:Si())}function tSe(e){for(;!Og(ms());)Si();return Gm(e,ni)}function nSe(e){return oV(lv("",null,null,null,[""],e=iV(e),0,[0],e))}function lv(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,m=1,_=1,v=1,y=0,g="",b=i,S=o,w=r,C=g;_;)switch(p=y,y=Si()){case 40:if(p!=108&&er(C,d-1)==58){_3(C+=dt(av(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:C+=av(y);break;case 9:case 10:case 13:case 32:C+=Z_e(p);break;case 92:C+=J_e(sv()-1,7);continue;case 47:switch(ms()){case 42:case 47:iy(rSe(eSe(Si(),sv()),t,n),l);break;default:C+="/"}break;case 123*m:a[c++]=rs(C)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+u:v==-1&&(C=dt(C,/\f/g,"")),h>0&&rs(C)-d&&iy(h>32?rM(C+";",r,n,d-1):rM(dt(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(iy(w=nM(C,t,n,c,u,i,a,g,b=[],S=[],d),o),y===123)if(u===0)lv(C,t,w,w,b,o,d,a,S);else switch(f===99&&er(C,3)===110?100:f){case 100:case 108:case 109:case 115:lv(e,w,w,r&&iy(nM(e,w,w,0,0,i,a,g,i,b=[],d),S),i,S,d,a,r?b:S);break;default:lv(C,w,w,w,[""],S,0,a,S)}}c=u=h=0,m=v=1,g=C="",d=s;break;case 58:d=1+rs(C),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&Y_e()==125)continue}switch(C+=dS(y),y*m){case 38:v=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(rs(C)-1)*v,v=1;break;case 64:ms()===45&&(C+=av(Si())),f=ms(),u=d=rs(g=C+=tSe(sv())),y++;break;case 45:p===45&&rs(C)==2&&(m=0)}}return o}function nM(e,t,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=i===0?o:[""],h=qT(f),p=0,m=0,_=0;p<r;++p)for(var v=0,y=Rg(e,d+1,d=H_e(m=s[p])),g=e;v<h;++v)(g=nV(m>0?f[v]+" "+y:dt(y,/&\f/g,f[v])))&&(l[_++]=g);return hS(e,t,n,i===0?HT:a,l,c,u)}function rSe(e,t,n){return hS(e,t,n,eV,dS(Q_e()),Rg(e,2,-2),0)}function rM(e,t,n,r){return hS(e,t,n,WT,Rg(e,0,r),Rg(e,r+1,-1),r)}function Bd(e,t){for(var n="",r=qT(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function iSe(e,t,n,r){switch(e.type){case G_e:if(e.children.length)break;case U_e:case WT:return e.return=e.return||e.value;case eV:return"";case tV:return e.return=e.value+"{"+Bd(e.children,r)+"}";case HT:e.value=e.props.join(",")}return rs(n=Bd(e.children,r))?e.return=e.value+"{"+n+"}":""}function oSe(e){var t=qT(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}function sSe(e){return function(t){t.root||(t=t.return)&&e(t)}}var iM=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 sV(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var aSe=function(t,n,r){for(var i=0,o=0;i=o,o=ms(),i===38&&o===12&&(n[r]=1),!Og(o);)Si();return Gm(t,ni)},lSe=function(t,n){var r=-1,i=44;do switch(Og(i)){case 0:i===38&&ms()===12&&(n[r]=1),t[r]+=aSe(ni-1,n,r);break;case 2:t[r]+=av(i);break;case 4:if(i===44){t[++r]=ms()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=dS(i)}while(i=Si());return t},cSe=function(t,n){return oV(lSe(iV(t),n))},oM=new WeakMap,uSe=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&&!oM.get(r))&&!i){oM.set(t,!0);for(var o=[],s=cSe(n,o),a=r.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)t.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},dSe=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(q_e(e,t)){case 5103:return ut+"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 ut+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+B1+e+dr+e+e;case 6828:case 4268:return ut+e+dr+e+e;case 6165:return ut+e+dr+"flex-"+e+e;case 5187:return ut+e+dt(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+dr+"flex-$1$2")+e;case 5443:return ut+e+dr+"flex-item-"+dt(e,/flex-|-self/,"")+e;case 4675:return ut+e+dr+"flex-line-pack"+dt(e,/align-content|flex-|-self/,"")+e;case 5548:return ut+e+dr+dt(e,"shrink","negative")+e;case 5292:return ut+e+dr+dt(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+dt(e,"-grow","")+ut+e+dr+dt(e,"grow","positive")+e;case 4554:return ut+dt(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return dt(dt(dt(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return dt(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return dt(dt(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+dr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4095:case 3583:case 4068:case 2532:return dt(e,/(.+)-inline(.+)/,ut+"$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(rs(e)-1-t>6)switch(er(e,t+1)){case 109:if(er(e,t+4)!==45)break;case 102:return dt(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+B1+(er(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_3(e,"stretch")?aV(dt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(er(e,t+1)!==115)break;case 6444:switch(er(e,rs(e)-3-(~_3(e,"!important")&&10))){case 107:return dt(e,":",":"+ut)+e;case 101:return dt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ut+(er(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+dr+"$2box$3")+e}break;case 5936:switch(er(e,t+11)){case 114:return ut+e+dr+dt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+dr+dt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+dr+dt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ut+e+dr+e+e}return e}var fSe=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 tV:return Bd([_h(t,{value:dt(t.value,"@","@"+ut)})],i);case HT:if(t.length)return X_e(t.props,function(o){switch(K_e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Bd([_h(t,{props:[dt(o,/:(read-\w+)/,":"+B1+"$1")]})],i);case"::placeholder":return Bd([_h(t,{props:[dt(o,/:(plac\w+)/,":"+ut+"input-$1")]}),_h(t,{props:[dt(o,/:(plac\w+)/,":"+B1+"$1")]}),_h(t,{props:[dt(o,/:(plac\w+)/,dr+"input-$1")]})],i)}return""})}},hSe=[fSe],pSe=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(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||hSe,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),v=1;v<_.length;v++)o[_[v]]=!0;a.push(m)});var l,c=[uSe,dSe];{var u,d=[iSe,sSe(function(m){u.insert(m)})],f=oSe(c.concat(i,d)),h=function(_){return Bd(nSe(_),f)};l=function(_,v,y,g){u=y,h(_?_+"{"+v.styles+"}":v.styles),g&&(p.inserted[v.name]=!0)}}var p={key:n,sheet:new V_e({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(a),p};function z1(){return z1=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},z1.apply(this,arguments)}var lV={exports:{}},yt={};/** @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 Hn=typeof Symbol=="function"&&Symbol.for,KT=Hn?Symbol.for("react.element"):60103,XT=Hn?Symbol.for("react.portal"):60106,pS=Hn?Symbol.for("react.fragment"):60107,gS=Hn?Symbol.for("react.strict_mode"):60108,mS=Hn?Symbol.for("react.profiler"):60114,yS=Hn?Symbol.for("react.provider"):60109,vS=Hn?Symbol.for("react.context"):60110,QT=Hn?Symbol.for("react.async_mode"):60111,bS=Hn?Symbol.for("react.concurrent_mode"):60111,_S=Hn?Symbol.for("react.forward_ref"):60112,SS=Hn?Symbol.for("react.suspense"):60113,gSe=Hn?Symbol.for("react.suspense_list"):60120,xS=Hn?Symbol.for("react.memo"):60115,wS=Hn?Symbol.for("react.lazy"):60116,mSe=Hn?Symbol.for("react.block"):60121,ySe=Hn?Symbol.for("react.fundamental"):60117,vSe=Hn?Symbol.for("react.responder"):60118,bSe=Hn?Symbol.for("react.scope"):60119;function Ii(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case KT:switch(e=e.type,e){case QT:case bS:case pS:case mS:case gS:case SS:return e;default:switch(e=e&&e.$$typeof,e){case vS:case _S:case wS:case xS:case yS:return e;default:return t}}case XT:return t}}}function cV(e){return Ii(e)===bS}yt.AsyncMode=QT;yt.ConcurrentMode=bS;yt.ContextConsumer=vS;yt.ContextProvider=yS;yt.Element=KT;yt.ForwardRef=_S;yt.Fragment=pS;yt.Lazy=wS;yt.Memo=xS;yt.Portal=XT;yt.Profiler=mS;yt.StrictMode=gS;yt.Suspense=SS;yt.isAsyncMode=function(e){return cV(e)||Ii(e)===QT};yt.isConcurrentMode=cV;yt.isContextConsumer=function(e){return Ii(e)===vS};yt.isContextProvider=function(e){return Ii(e)===yS};yt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===KT};yt.isForwardRef=function(e){return Ii(e)===_S};yt.isFragment=function(e){return Ii(e)===pS};yt.isLazy=function(e){return Ii(e)===wS};yt.isMemo=function(e){return Ii(e)===xS};yt.isPortal=function(e){return Ii(e)===XT};yt.isProfiler=function(e){return Ii(e)===mS};yt.isStrictMode=function(e){return Ii(e)===gS};yt.isSuspense=function(e){return Ii(e)===SS};yt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===pS||e===bS||e===mS||e===gS||e===SS||e===gSe||typeof e=="object"&&e!==null&&(e.$$typeof===wS||e.$$typeof===xS||e.$$typeof===yS||e.$$typeof===vS||e.$$typeof===_S||e.$$typeof===ySe||e.$$typeof===vSe||e.$$typeof===bSe||e.$$typeof===mSe)};yt.typeOf=Ii;lV.exports=yt;var _Se=lV.exports,uV=_Se,SSe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},xSe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},dV={};dV[uV.ForwardRef]=SSe;dV[uV.Memo]=xSe;var wSe=!0;function CSe(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var fV=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||wSe===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},hV=function(t,n,r){fV(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 ESe(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 TSe={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},ASe=/[A-Z]|^ms/g,kSe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,pV=function(t){return t.charCodeAt(1)===45},sM=function(t){return t!=null&&typeof t!="boolean"},Sw=sV(function(e){return pV(e)?e:e.replace(ASe,"-$&").toLowerCase()}),aM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(kSe,function(r,i,o){return is={name:i,styles:o,next:is},i})}return TSe[t]!==1&&!pV(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 is={name:n.name,styles:n.styles,next:is},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)is={name:r.name,styles:r.styles,next:is},r=r.next;var i=n.styles+";";return i}return PSe(e,t,n)}case"function":{if(e!==void 0){var o=is,s=n(e);return is=o,$g(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function PSe(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 s=n[o];if(typeof s!="object")t!=null&&t[s]!==void 0?r+=o+"{"+t[s]+"}":sM(s)&&(r+=Sw(o)+":"+aM(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var a=0;a<s.length;a++)sM(s[a])&&(r+=Sw(o)+":"+aM(o,s[a])+";");else{var l=$g(e,t,s);switch(o){case"animation":case"animationName":{r+=Sw(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var lM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,is,YT=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="";is=void 0;var s=t[0];s==null||s.raw===void 0?(i=!1,o+=$g(r,n,s)):o+=s[0];for(var a=1;a<t.length;a++)o+=$g(r,n,t[a]),i&&(o+=s[a]);lM.lastIndex=0;for(var l="",c;(c=lM.exec(o))!==null;)l+="-"+c[1];var u=ESe(o)+l;return{name:u,styles:o,next:is}},ISe=function(t){return t()},gV=Ev["useInsertionEffect"]?Ev["useInsertionEffect"]:!1,MSe=gV||ISe,cM=gV||I.useLayoutEffect,mV=I.createContext(typeof HTMLElement<"u"?pSe({key:"css"}):null);mV.Provider;var yV=function(t){return I.forwardRef(function(n,r){var i=I.useContext(mV);return t(n,i,r)})},Ng=I.createContext({}),RSe=function(t,n){if(typeof n=="function"){var r=n(t);return r}return z1({},t,n)},OSe=iM(function(e){return iM(function(t){return RSe(e,t)})}),$Se=function(t){var n=I.useContext(Ng);return t.theme!==n&&(n=OSe(n)(t.theme)),I.createElement(Ng.Provider,{value:n},t.children)},vV=yV(function(e,t){var n=e.styles,r=YT([n],void 0,I.useContext(Ng)),i=I.useRef();return cM(function(){var o=t.key+"-global",s=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(s.before=t.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[t]),cM(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&hV(t,r.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}t.insert("",r,s,!1)},[t,r.name]),null});function NSe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return YT(t)}var FSe=function(){var t=NSe.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 DSe(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Hm(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=e,a=I.createContext(s);a.displayName=t;function l(){var c;const u=I.useContext(a);if(!u&&n){const d=new Error(o??DSe(r,i));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[a.Provider,l,a]}var[LSe,BSe]=Hm({strict:!1,name:"PortalManagerContext"});function zSe(e){const{children:t,zIndex:n}=e;return ie.jsx(LSe,{value:{zIndex:n},children:t})}zSe.displayName="PortalManager";var j1=globalThis!=null&&globalThis.document?I.useLayoutEffect:I.useEffect,[bV,jSe]=Hm({strict:!1,name:"PortalContext"}),ZT="chakra-portal",VSe=".chakra-portal",USe=e=>ie.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),GSe=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=I.useState(null),o=I.useRef(null),[,s]=I.useState({});I.useEffect(()=>s({}),[]);const a=jSe(),l=BSe();j1(()=>{if(!r)return;const u=r.ownerDocument,d=t?a??u.body:u.body;if(!d)return;o.current=u.createElement("div"),o.current.className=ZT,d.appendChild(o.current),s({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const c=l!=null&&l.zIndex?ie.jsx(USe,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?gi.createPortal(ie.jsx(bV,{value:o.current,children:c}),o.current):ie.jsx("span",{ref:u=>{u&&i(u)}})},HSe=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),s=I.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=ZT),l},[i]),[,a]=I.useState({});return j1(()=>a({}),[]),j1(()=>{if(!(!s||!o))return o.appendChild(s),()=>{o.removeChild(s)}},[s,o]),o&&s?gi.createPortal(ie.jsx(bV,{value:r?s:null,children:t}),s):null};function CS(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?ie.jsx(HSe,{containerRef:n,...r}):ie.jsx(GSe,{...r})}CS.className=ZT;CS.selector=VSe;CS.displayName="Portal";function _V(){const e=I.useContext(Ng);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var JT=I.createContext({});JT.displayName="ColorModeContext";function ES(){const e=I.useContext(JT);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function mWe(e,t){const{colorMode:n}=ES();return n==="dark"?t:e}function WSe(){const e=ES(),t=_V();return{...e,theme:t}}function qSe(e,t,n){var r,i;if(t==null)return t;const o=s=>{var a,l;return(l=(a=e.__breakpoints)==null?void 0:a.asArray)==null?void 0:l[s]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function KSe(e,t,n){var r,i;if(t==null)return t;const o=s=>{var a,l;return(l=(a=e.__cssMap)==null?void 0:a[s])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function yWe(e,t,n){const r=_V();return XSe(e,t,n)(r)}function XSe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const s=i.filter(Boolean),a=r.map((l,c)=>{var u,d;if(e==="breakpoints")return qSe(o,l,(u=s[c])!=null?u:l);const f=`${e}.${l}`;return KSe(o,f,(d=s[c])!=null?d:l)});return Array.isArray(t)?a:a[0]}}var Dl=(...e)=>e.filter(Boolean).join(" ");function QSe(){return!1}function ys(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var vWe=e=>{const{condition:t,message:n}=e;t&&QSe()&&console.warn(n)};function us(e,...t){return YSe(e)?e(...t):e}var YSe=e=>typeof e=="function",bWe=e=>e?"":void 0,_We=e=>e?!0:void 0;function SWe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function xWe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var V1={exports:{}};V1.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",v="[object Null]",y="[object Object]",g="[object Proxy]",b="[object RegExp]",S="[object Set]",w="[object String]",C="[object Undefined]",x="[object WeakMap]",k="[object ArrayBuffer]",A="[object DataView]",R="[object Float32Array]",L="[object Float64Array]",M="[object Int8Array]",E="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",F="[object Uint8ClampedArray]",$="[object Uint16Array]",D="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,H={};H[R]=H[L]=H[M]=H[E]=H[P]=H[O]=H[F]=H[$]=H[D]=!0,H[a]=H[l]=H[k]=H[u]=H[A]=H[d]=H[f]=H[h]=H[m]=H[_]=H[y]=H[b]=H[S]=H[w]=H[x]=!1;var X=typeof He=="object"&&He&&He.Object===Object&&He,te=typeof self=="object"&&self&&self.Object===Object&&self,ee=X||te||Function("return this")(),j=t&&!t.nodeType&&t,q=j&&!0&&e&&!e.nodeType&&e,Z=q&&q.exports===j,oe=Z&&X.process,be=function(){try{var B=q&&q.require&&q.require("util").types;return B||oe&&oe.binding&&oe.binding("util")}catch{}}(),Me=be&&be.isTypedArray;function lt(B,U,K){switch(K.length){case 0:return B.call(U);case 1:return B.call(U,K[0]);case 2:return B.call(U,K[0],K[1]);case 3:return B.call(U,K[0],K[1],K[2])}return B.apply(U,K)}function Le(B,U){for(var K=-1,pe=Array(B);++K<B;)pe[K]=U(K);return pe}function we(B){return function(U){return B(U)}}function pt(B,U){return B==null?void 0:B[U]}function vt(B,U){return function(K){return B(U(K))}}var Ce=Array.prototype,ii=Function.prototype,sn=Object.prototype,jr=ee["__core-js_shared__"],sr=ii.toString,fn=sn.hasOwnProperty,Vr=function(){var B=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return B?"Symbol(src)_1."+B:""}(),fo=sn.toString,Ri=sr.call(Object),ar=RegExp("^"+sr.call(fn).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wn=Z?ee.Buffer:void 0,wr=ee.Symbol,Yt=ee.Uint8Array,It=Wn?Wn.allocUnsafe:void 0,oi=vt(Object.getPrototypeOf,Object),Oi=Object.create,ho=sn.propertyIsEnumerable,Ur=Ce.splice,hn=wr?wr.toStringTag:void 0,si=function(){try{var B=Z2(Object,"defineProperty");return B({},"",{}),B}catch{}}(),Gl=Wn?Wn.isBuffer:void 0,Go=Math.max,Hl=Date.now,Ut=Z2(ee,"Map"),_t=Z2(Object,"create"),qn=function(){function B(){}return function(U){if(!ql(U))return{};if(Oi)return Oi(U);B.prototype=U;var K=new B;return B.prototype=void 0,K}}();function Pn(B){var U=-1,K=B==null?0:B.length;for(this.clear();++U<K;){var pe=B[U];this.set(pe[0],pe[1])}}function lr(){this.__data__=_t?_t(null):{},this.size=0}function Cr(B){var U=this.has(B)&&delete this.__data__[B];return this.size-=U?1:0,U}function Gr(B){var U=this.__data__;if(_t){var K=U[B];return K===r?void 0:K}return fn.call(U,B)?U[B]:void 0}function Ho(B){var U=this.__data__;return _t?U[B]!==void 0:fn.call(U,B)}function Er(B,U){var K=this.__data__;return this.size+=this.has(B)?0:1,K[B]=_t&&U===void 0?r:U,this}Pn.prototype.clear=lr,Pn.prototype.delete=Cr,Pn.prototype.get=Gr,Pn.prototype.has=Ho,Pn.prototype.set=Er;function Kn(B){var U=-1,K=B==null?0:B.length;for(this.clear();++U<K;){var pe=B[U];this.set(pe[0],pe[1])}}function Ms(){this.__data__=[],this.size=0}function Ca(B){var U=this.__data__,K=Cu(U,B);if(K<0)return!1;var pe=U.length-1;return K==pe?U.pop():Ur.call(U,K,1),--this.size,!0}function Ea(B){var U=this.__data__,K=Cu(U,B);return K<0?void 0:U[K][1]}function wu(B){return Cu(this.__data__,B)>-1}function Rs(B,U){var K=this.__data__,pe=Cu(K,B);return pe<0?(++this.size,K.push([B,U])):K[pe][1]=U,this}Kn.prototype.clear=Ms,Kn.prototype.delete=Ca,Kn.prototype.get=Ea,Kn.prototype.has=wu,Kn.prototype.set=Rs;function Tr(B){var U=-1,K=B==null?0:B.length;for(this.clear();++U<K;){var pe=B[U];this.set(pe[0],pe[1])}}function Wl(){this.size=0,this.__data__={hash:new Pn,map:new(Ut||Kn),string:new Pn}}function j2(B){var U=f0(this,B).delete(B);return this.size-=U?1:0,U}function V2(B){return f0(this,B).get(B)}function U2(B){return f0(this,B).has(B)}function G2(B,U){var K=f0(this,B),pe=K.size;return K.set(B,U),this.size+=K.size==pe?0:1,this}Tr.prototype.clear=Wl,Tr.prototype.delete=j2,Tr.prototype.get=V2,Tr.prototype.has=U2,Tr.prototype.set=G2;function Ta(B){var U=this.__data__=new Kn(B);this.size=U.size}function H2(){this.__data__=new Kn,this.size=0}function W2(B){var U=this.__data__,K=U.delete(B);return this.size=U.size,K}function u0(B){return this.__data__.get(B)}function q2(B){return this.__data__.has(B)}function K2(B,U){var K=this.__data__;if(K instanceof Kn){var pe=K.__data__;if(!Ut||pe.length<n-1)return pe.push([B,U]),this.size=++K.size,this;K=this.__data__=new Tr(pe)}return K.set(B,U),this.size=K.size,this}Ta.prototype.clear=H2,Ta.prototype.delete=W2,Ta.prototype.get=u0,Ta.prototype.has=q2,Ta.prototype.set=K2;function X2(B,U){var K=tx(B),pe=!K&&ex(B),et=!K&&!pe&&pk(B),St=!K&&!pe&&!et&&mk(B),Dt=K||pe||et||St,Xe=Dt?Le(B.length,String):[],Lt=Xe.length;for(var $i in B)(U||fn.call(B,$i))&&!(Dt&&($i=="length"||et&&($i=="offset"||$i=="parent")||St&&($i=="buffer"||$i=="byteLength"||$i=="byteOffset")||fk($i,Lt)))&&Xe.push($i);return Xe}function Yf(B,U,K){(K!==void 0&&!h0(B[U],K)||K===void 0&&!(U in B))&&Eu(B,U,K)}function Q2(B,U,K){var pe=B[U];(!(fn.call(B,U)&&h0(pe,K))||K===void 0&&!(U in B))&&Eu(B,U,K)}function Cu(B,U){for(var K=B.length;K--;)if(h0(B[K][0],U))return K;return-1}function Eu(B,U,K){U=="__proto__"&&si?si(B,U,{configurable:!0,enumerable:!0,value:K,writable:!0}):B[U]=K}var Y2=jW();function Tu(B){return B==null?B===void 0?C:v:hn&&hn in Object(B)?VW(B):KW(B)}function d0(B){return Jf(B)&&Tu(B)==a}function Zf(B){if(!ql(B)||WW(B))return!1;var U=rx(B)?ar:z;return U.test(ZW(B))}function IW(B){return Jf(B)&&gk(B.length)&&!!H[Tu(B)]}function MW(B){if(!ql(B))return qW(B);var U=hk(B),K=[];for(var pe in B)pe=="constructor"&&(U||!fn.call(B,pe))||K.push(pe);return K}function dk(B,U,K,pe,et){B!==U&&Y2(U,function(St,Dt){if(et||(et=new Ta),ql(St))RW(B,U,Dt,K,dk,pe,et);else{var Xe=pe?pe(J2(B,Dt),St,Dt+"",B,U,et):void 0;Xe===void 0&&(Xe=St),Yf(B,Dt,Xe)}},yk)}function RW(B,U,K,pe,et,St,Dt){var Xe=J2(B,K),Lt=J2(U,K),$i=Dt.get(Lt);if($i){Yf(B,K,$i);return}var ai=St?St(Xe,Lt,K+"",B,U,Dt):void 0,eh=ai===void 0;if(eh){var ix=tx(Lt),ox=!ix&&pk(Lt),bk=!ix&&!ox&&mk(Lt);ai=Lt,ix||ox||bk?tx(Xe)?ai=Xe:JW(Xe)?ai=LW(Xe):ox?(eh=!1,ai=NW(Lt,!0)):bk?(eh=!1,ai=DW(Lt,!0)):ai=[]:eq(Lt)||ex(Lt)?(ai=Xe,ex(Xe)?ai=tq(Xe):(!ql(Xe)||rx(Xe))&&(ai=UW(Lt))):eh=!1}eh&&(Dt.set(Lt,ai),et(ai,Lt,pe,St,Dt),Dt.delete(Lt)),Yf(B,K,ai)}function OW(B,U){return QW(XW(B,U,vk),B+"")}var $W=si?function(B,U){return si(B,"toString",{configurable:!0,enumerable:!1,value:rq(U),writable:!0})}:vk;function NW(B,U){if(U)return B.slice();var K=B.length,pe=It?It(K):new B.constructor(K);return B.copy(pe),pe}function FW(B){var U=new B.constructor(B.byteLength);return new Yt(U).set(new Yt(B)),U}function DW(B,U){var K=U?FW(B.buffer):B.buffer;return new B.constructor(K,B.byteOffset,B.length)}function LW(B,U){var K=-1,pe=B.length;for(U||(U=Array(pe));++K<pe;)U[K]=B[K];return U}function BW(B,U,K,pe){var et=!K;K||(K={});for(var St=-1,Dt=U.length;++St<Dt;){var Xe=U[St],Lt=pe?pe(K[Xe],B[Xe],Xe,K,B):void 0;Lt===void 0&&(Lt=B[Xe]),et?Eu(K,Xe,Lt):Q2(K,Xe,Lt)}return K}function zW(B){return OW(function(U,K){var pe=-1,et=K.length,St=et>1?K[et-1]:void 0,Dt=et>2?K[2]:void 0;for(St=B.length>3&&typeof St=="function"?(et--,St):void 0,Dt&&GW(K[0],K[1],Dt)&&(St=et<3?void 0:St,et=1),U=Object(U);++pe<et;){var Xe=K[pe];Xe&&B(U,Xe,pe,St)}return U})}function jW(B){return function(U,K,pe){for(var et=-1,St=Object(U),Dt=pe(U),Xe=Dt.length;Xe--;){var Lt=Dt[B?Xe:++et];if(K(St[Lt],Lt,St)===!1)break}return U}}function f0(B,U){var K=B.__data__;return HW(U)?K[typeof U=="string"?"string":"hash"]:K.map}function Z2(B,U){var K=pt(B,U);return Zf(K)?K:void 0}function VW(B){var U=fn.call(B,hn),K=B[hn];try{B[hn]=void 0;var pe=!0}catch{}var et=fo.call(B);return pe&&(U?B[hn]=K:delete B[hn]),et}function UW(B){return typeof B.constructor=="function"&&!hk(B)?qn(oi(B)):{}}function fk(B,U){var K=typeof B;return U=U??s,!!U&&(K=="number"||K!="symbol"&&V.test(B))&&B>-1&&B%1==0&&B<U}function GW(B,U,K){if(!ql(K))return!1;var pe=typeof U;return(pe=="number"?nx(K)&&fk(U,K.length):pe=="string"&&U in K)?h0(K[U],B):!1}function HW(B){var U=typeof B;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?B!=="__proto__":B===null}function WW(B){return!!Vr&&Vr in B}function hk(B){var U=B&&B.constructor,K=typeof U=="function"&&U.prototype||sn;return B===K}function qW(B){var U=[];if(B!=null)for(var K in Object(B))U.push(K);return U}function KW(B){return fo.call(B)}function XW(B,U,K){return U=Go(U===void 0?B.length-1:U,0),function(){for(var pe=arguments,et=-1,St=Go(pe.length-U,0),Dt=Array(St);++et<St;)Dt[et]=pe[U+et];et=-1;for(var Xe=Array(U+1);++et<U;)Xe[et]=pe[et];return Xe[U]=K(Dt),lt(B,this,Xe)}}function J2(B,U){if(!(U==="constructor"&&typeof B[U]=="function")&&U!="__proto__")return B[U]}var QW=YW($W);function YW(B){var U=0,K=0;return function(){var pe=Hl(),et=o-(pe-K);if(K=pe,et>0){if(++U>=i)return arguments[0]}else U=0;return B.apply(void 0,arguments)}}function ZW(B){if(B!=null){try{return sr.call(B)}catch{}try{return B+""}catch{}}return""}function h0(B,U){return B===U||B!==B&&U!==U}var ex=d0(function(){return arguments}())?d0:function(B){return Jf(B)&&fn.call(B,"callee")&&!ho.call(B,"callee")},tx=Array.isArray;function nx(B){return B!=null&&gk(B.length)&&!rx(B)}function JW(B){return Jf(B)&&nx(B)}var pk=Gl||iq;function rx(B){if(!ql(B))return!1;var U=Tu(B);return U==h||U==p||U==c||U==g}function gk(B){return typeof B=="number"&&B>-1&&B%1==0&&B<=s}function ql(B){var U=typeof B;return B!=null&&(U=="object"||U=="function")}function Jf(B){return B!=null&&typeof B=="object"}function eq(B){if(!Jf(B)||Tu(B)!=y)return!1;var U=oi(B);if(U===null)return!0;var K=fn.call(U,"constructor")&&U.constructor;return typeof K=="function"&&K instanceof K&&sr.call(K)==Ri}var mk=Me?we(Me):IW;function tq(B){return BW(B,yk(B))}function yk(B){return nx(B)?X2(B,!0):MW(B)}var nq=zW(function(B,U,K,pe){dk(B,U,K,pe)});function rq(B){return function(){return B}}function vk(B){return B}function iq(){return!1}e.exports=nq})(V1,V1.exports);var ZSe=V1.exports;const ds=Ml(ZSe);var JSe=e=>/!(important)?$/.test(e),uM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,e2e=(e,t)=>n=>{const r=String(t),i=JSe(r),o=uM(r),s=e?`${e}.${o}`:o;let a=ys(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=uM(a),i?`${a} !important`:a};function eA(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{var a;const l=e2e(t,o)(s);let c=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(c=r(c,s)),c}}var oy=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Di(e,t){return n=>{const r={property:n,scale:e};return r.transform=eA({scale:e,transform:t}),r}}var t2e=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function n2e(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:t2e(t),transform:n?eA({scale:n,compose:r}):r}}var SV=["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 r2e(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...SV].join(" ")}function i2e(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...SV].join(" ")}var o2e={"--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(" ")},s2e={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 a2e(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 l2e={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},x3={"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"},c2e=new Set(Object.values(x3)),w3=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),u2e=e=>e.trim();function d2e(e,t){if(e==null||w3.has(e))return e;if(!(C3(e)||w3.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!o||!s)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...c]=s.split(",").map(u2e).filter(Boolean);if((c==null?void 0:c.length)===0)return e;const u=l in x3?x3[l]:l;c.unshift(u);const d=c.map(f=>{if(c2e.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],_=C3(m)?m:m&&m.split(" "),v=`colors.${p}`,y=v in t.__cssMap?t.__cssMap[v].varRef:p;return _?[y,...Array.isArray(_)?_:[_]].join(" "):y});return`${a}(${d.join(", ")})`}var C3=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),f2e=(e,t)=>d2e(e,t??{});function h2e(e){return/^var\(--.+\)$/.test(e)}var p2e=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Ko=e=>t=>`${e}(${t})`,Ze={filter(e){return e!=="auto"?e:o2e},backdropFilter(e){return e!=="auto"?e:s2e},ring(e){return a2e(Ze.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?r2e():e==="auto-gpu"?i2e():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=p2e(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(h2e(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:f2e,blur:Ko("blur"),opacity:Ko("opacity"),brightness:Ko("brightness"),contrast:Ko("contrast"),dropShadow:Ko("drop-shadow"),grayscale:Ko("grayscale"),hueRotate:e=>Ko("hue-rotate")(Ze.degree(e)),invert:Ko("invert"),saturate:Ko("saturate"),sepia:Ko("sepia"),bgImage(e){return e==null||C3(e)||w3.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=l2e[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},G={borderWidths:Di("borderWidths"),borderStyles:Di("borderStyles"),colors:Di("colors"),borders:Di("borders"),gradients:Di("gradients",Ze.gradient),radii:Di("radii",Ze.px),space:Di("space",oy(Ze.vh,Ze.px)),spaceT:Di("space",oy(Ze.vh,Ze.px)),degreeT(e){return{property:e,transform:Ze.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:eA({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Di("sizes",oy(Ze.vh,Ze.px)),sizesT:Di("sizes",oy(Ze.vh,Ze.fraction)),shadows:Di("shadows"),logical:n2e,blur:Di("blur",Ze.blur)},cv={background:G.colors("background"),backgroundColor:G.colors("backgroundColor"),backgroundImage:G.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ze.bgClip},bgSize:G.prop("backgroundSize"),bgPosition:G.prop("backgroundPosition"),bg:G.colors("background"),bgColor:G.colors("backgroundColor"),bgPos:G.prop("backgroundPosition"),bgRepeat:G.prop("backgroundRepeat"),bgAttachment:G.prop("backgroundAttachment"),bgGradient:G.gradients("backgroundImage"),bgClip:{transform:Ze.bgClip}};Object.assign(cv,{bgImage:cv.backgroundImage,bgImg:cv.backgroundImage});var ct={border:G.borders("border"),borderWidth:G.borderWidths("borderWidth"),borderStyle:G.borderStyles("borderStyle"),borderColor:G.colors("borderColor"),borderRadius:G.radii("borderRadius"),borderTop:G.borders("borderTop"),borderBlockStart:G.borders("borderBlockStart"),borderTopLeftRadius:G.radii("borderTopLeftRadius"),borderStartStartRadius:G.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:G.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:G.radii("borderTopRightRadius"),borderStartEndRadius:G.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:G.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:G.borders("borderRight"),borderInlineEnd:G.borders("borderInlineEnd"),borderBottom:G.borders("borderBottom"),borderBlockEnd:G.borders("borderBlockEnd"),borderBottomLeftRadius:G.radii("borderBottomLeftRadius"),borderBottomRightRadius:G.radii("borderBottomRightRadius"),borderLeft:G.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:G.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:G.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:G.borders(["borderLeft","borderRight"]),borderInline:G.borders("borderInline"),borderY:G.borders(["borderTop","borderBottom"]),borderBlock:G.borders("borderBlock"),borderTopWidth:G.borderWidths("borderTopWidth"),borderBlockStartWidth:G.borderWidths("borderBlockStartWidth"),borderTopColor:G.colors("borderTopColor"),borderBlockStartColor:G.colors("borderBlockStartColor"),borderTopStyle:G.borderStyles("borderTopStyle"),borderBlockStartStyle:G.borderStyles("borderBlockStartStyle"),borderBottomWidth:G.borderWidths("borderBottomWidth"),borderBlockEndWidth:G.borderWidths("borderBlockEndWidth"),borderBottomColor:G.colors("borderBottomColor"),borderBlockEndColor:G.colors("borderBlockEndColor"),borderBottomStyle:G.borderStyles("borderBottomStyle"),borderBlockEndStyle:G.borderStyles("borderBlockEndStyle"),borderLeftWidth:G.borderWidths("borderLeftWidth"),borderInlineStartWidth:G.borderWidths("borderInlineStartWidth"),borderLeftColor:G.colors("borderLeftColor"),borderInlineStartColor:G.colors("borderInlineStartColor"),borderLeftStyle:G.borderStyles("borderLeftStyle"),borderInlineStartStyle:G.borderStyles("borderInlineStartStyle"),borderRightWidth:G.borderWidths("borderRightWidth"),borderInlineEndWidth:G.borderWidths("borderInlineEndWidth"),borderRightColor:G.colors("borderRightColor"),borderInlineEndColor:G.colors("borderInlineEndColor"),borderRightStyle:G.borderStyles("borderRightStyle"),borderInlineEndStyle:G.borderStyles("borderInlineEndStyle"),borderTopRadius:G.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:G.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:G.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:G.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(ct,{rounded:ct.borderRadius,roundedTop:ct.borderTopRadius,roundedTopLeft:ct.borderTopLeftRadius,roundedTopRight:ct.borderTopRightRadius,roundedTopStart:ct.borderStartStartRadius,roundedTopEnd:ct.borderStartEndRadius,roundedBottom:ct.borderBottomRadius,roundedBottomLeft:ct.borderBottomLeftRadius,roundedBottomRight:ct.borderBottomRightRadius,roundedBottomStart:ct.borderEndStartRadius,roundedBottomEnd:ct.borderEndEndRadius,roundedLeft:ct.borderLeftRadius,roundedRight:ct.borderRightRadius,roundedStart:ct.borderInlineStartRadius,roundedEnd:ct.borderInlineEndRadius,borderStart:ct.borderInlineStart,borderEnd:ct.borderInlineEnd,borderTopStartRadius:ct.borderStartStartRadius,borderTopEndRadius:ct.borderStartEndRadius,borderBottomStartRadius:ct.borderEndStartRadius,borderBottomEndRadius:ct.borderEndEndRadius,borderStartRadius:ct.borderInlineStartRadius,borderEndRadius:ct.borderInlineEndRadius,borderStartWidth:ct.borderInlineStartWidth,borderEndWidth:ct.borderInlineEndWidth,borderStartColor:ct.borderInlineStartColor,borderEndColor:ct.borderInlineEndColor,borderStartStyle:ct.borderInlineStartStyle,borderEndStyle:ct.borderInlineEndStyle});var g2e={color:G.colors("color"),textColor:G.colors("color"),fill:G.colors("fill"),stroke:G.colors("stroke")},E3={boxShadow:G.shadows("boxShadow"),mixBlendMode:!0,blendMode:G.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:G.prop("backgroundBlendMode"),opacity:!0};Object.assign(E3,{shadow:E3.boxShadow});var m2e={filter:{transform:Ze.filter},blur:G.blur("--chakra-blur"),brightness:G.propT("--chakra-brightness",Ze.brightness),contrast:G.propT("--chakra-contrast",Ze.contrast),hueRotate:G.propT("--chakra-hue-rotate",Ze.hueRotate),invert:G.propT("--chakra-invert",Ze.invert),saturate:G.propT("--chakra-saturate",Ze.saturate),dropShadow:G.propT("--chakra-drop-shadow",Ze.dropShadow),backdropFilter:{transform:Ze.backdropFilter},backdropBlur:G.blur("--chakra-backdrop-blur"),backdropBrightness:G.propT("--chakra-backdrop-brightness",Ze.brightness),backdropContrast:G.propT("--chakra-backdrop-contrast",Ze.contrast),backdropHueRotate:G.propT("--chakra-backdrop-hue-rotate",Ze.hueRotate),backdropInvert:G.propT("--chakra-backdrop-invert",Ze.invert),backdropSaturate:G.propT("--chakra-backdrop-saturate",Ze.saturate)},U1={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ze.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:G.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:G.space("gap"),rowGap:G.space("rowGap"),columnGap:G.space("columnGap")};Object.assign(U1,{flexDir:U1.flexDirection});var xV={gridGap:G.space("gridGap"),gridColumnGap:G.space("gridColumnGap"),gridRowGap:G.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},y2e={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ze.outline},outlineOffset:!0,outlineColor:G.colors("outlineColor")},zi={width:G.sizesT("width"),inlineSize:G.sizesT("inlineSize"),height:G.sizes("height"),blockSize:G.sizes("blockSize"),boxSize:G.sizes(["width","height"]),minWidth:G.sizes("minWidth"),minInlineSize:G.sizes("minInlineSize"),minHeight:G.sizes("minHeight"),minBlockSize:G.sizes("minBlockSize"),maxWidth:G.sizes("maxWidth"),maxInlineSize:G.sizes("maxInlineSize"),maxHeight:G.sizes("maxHeight"),maxBlockSize:G.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:G.propT("float",Ze.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(zi,{w:zi.width,h:zi.height,minW:zi.minWidth,maxW:zi.maxWidth,minH:zi.minHeight,maxH:zi.maxHeight,overscroll:zi.overscrollBehavior,overscrollX:zi.overscrollBehaviorX,overscrollY:zi.overscrollBehaviorY});var v2e={listStyleType:!0,listStylePosition:!0,listStylePos:G.prop("listStylePosition"),listStyleImage:!0,listStyleImg:G.prop("listStyleImage")};function b2e(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 _2e=e=>{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},S2e=_2e(b2e),x2e={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},w2e={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},xw=(e,t,n)=>{const r={},i=S2e(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},C2e={srOnly:{transform(e){return e===!0?x2e:e==="focusable"?w2e:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>xw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>xw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>xw(t,e,n)}},bp={position:!0,pos:G.prop("position"),zIndex:G.prop("zIndex","zIndices"),inset:G.spaceT("inset"),insetX:G.spaceT(["left","right"]),insetInline:G.spaceT("insetInline"),insetY:G.spaceT(["top","bottom"]),insetBlock:G.spaceT("insetBlock"),top:G.spaceT("top"),insetBlockStart:G.spaceT("insetBlockStart"),bottom:G.spaceT("bottom"),insetBlockEnd:G.spaceT("insetBlockEnd"),left:G.spaceT("left"),insetInlineStart:G.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:G.spaceT("right"),insetInlineEnd:G.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(bp,{insetStart:bp.insetInlineStart,insetEnd:bp.insetInlineEnd});var E2e={ring:{transform:Ze.ring},ringColor:G.colors("--chakra-ring-color"),ringOffset:G.prop("--chakra-ring-offset-width"),ringOffsetColor:G.colors("--chakra-ring-offset-color"),ringInset:G.prop("--chakra-ring-inset")},Rt={margin:G.spaceT("margin"),marginTop:G.spaceT("marginTop"),marginBlockStart:G.spaceT("marginBlockStart"),marginRight:G.spaceT("marginRight"),marginInlineEnd:G.spaceT("marginInlineEnd"),marginBottom:G.spaceT("marginBottom"),marginBlockEnd:G.spaceT("marginBlockEnd"),marginLeft:G.spaceT("marginLeft"),marginInlineStart:G.spaceT("marginInlineStart"),marginX:G.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:G.spaceT("marginInline"),marginY:G.spaceT(["marginTop","marginBottom"]),marginBlock:G.spaceT("marginBlock"),padding:G.space("padding"),paddingTop:G.space("paddingTop"),paddingBlockStart:G.space("paddingBlockStart"),paddingRight:G.space("paddingRight"),paddingBottom:G.space("paddingBottom"),paddingBlockEnd:G.space("paddingBlockEnd"),paddingLeft:G.space("paddingLeft"),paddingInlineStart:G.space("paddingInlineStart"),paddingInlineEnd:G.space("paddingInlineEnd"),paddingX:G.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:G.space("paddingInline"),paddingY:G.space(["paddingTop","paddingBottom"]),paddingBlock:G.space("paddingBlock")};Object.assign(Rt,{m:Rt.margin,mt:Rt.marginTop,mr:Rt.marginRight,me:Rt.marginInlineEnd,marginEnd:Rt.marginInlineEnd,mb:Rt.marginBottom,ml:Rt.marginLeft,ms:Rt.marginInlineStart,marginStart:Rt.marginInlineStart,mx:Rt.marginX,my:Rt.marginY,p:Rt.padding,pt:Rt.paddingTop,py:Rt.paddingY,px:Rt.paddingX,pb:Rt.paddingBottom,pl:Rt.paddingLeft,ps:Rt.paddingInlineStart,paddingStart:Rt.paddingInlineStart,pr:Rt.paddingRight,pe:Rt.paddingInlineEnd,paddingEnd:Rt.paddingInlineEnd});var T2e={textDecorationColor:G.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:G.shadows("textShadow")},A2e={clipPath:!0,transform:G.propT("transform",Ze.transform),transformOrigin:!0,translateX:G.spaceT("--chakra-translate-x"),translateY:G.spaceT("--chakra-translate-y"),skewX:G.degreeT("--chakra-skew-x"),skewY:G.degreeT("--chakra-skew-y"),scaleX:G.prop("--chakra-scale-x"),scaleY:G.prop("--chakra-scale-y"),scale:G.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:G.degreeT("--chakra-rotate")},k2e={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:G.prop("transitionDuration","transition.duration"),transitionProperty:G.prop("transitionProperty","transition.property"),transitionTimingFunction:G.prop("transitionTimingFunction","transition.easing")},P2e={fontFamily:G.prop("fontFamily","fonts"),fontSize:G.prop("fontSize","fontSizes",Ze.px),fontWeight:G.prop("fontWeight","fontWeights"),lineHeight:G.prop("lineHeight","lineHeights"),letterSpacing:G.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"}},I2e={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:G.spaceT("scrollMargin"),scrollMarginTop:G.spaceT("scrollMarginTop"),scrollMarginBottom:G.spaceT("scrollMarginBottom"),scrollMarginLeft:G.spaceT("scrollMarginLeft"),scrollMarginRight:G.spaceT("scrollMarginRight"),scrollMarginX:G.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:G.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:G.spaceT("scrollPadding"),scrollPaddingTop:G.spaceT("scrollPaddingTop"),scrollPaddingBottom:G.spaceT("scrollPaddingBottom"),scrollPaddingLeft:G.spaceT("scrollPaddingLeft"),scrollPaddingRight:G.spaceT("scrollPaddingRight"),scrollPaddingX:G.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:G.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function wV(e){return ys(e)&&e.reference?e.reference:String(e)}var TS=(e,...t)=>t.map(wV).join(` ${e} `).replace(/calc/g,""),dM=(...e)=>`calc(${TS("+",...e)})`,fM=(...e)=>`calc(${TS("-",...e)})`,T3=(...e)=>`calc(${TS("*",...e)})`,hM=(...e)=>`calc(${TS("/",...e)})`,pM=e=>{const t=wV(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:T3(t,-1)},mc=Object.assign(e=>({add:(...t)=>mc(dM(e,...t)),subtract:(...t)=>mc(fM(e,...t)),multiply:(...t)=>mc(T3(e,...t)),divide:(...t)=>mc(hM(e,...t)),negate:()=>mc(pM(e)),toString:()=>e.toString()}),{add:dM,subtract:fM,multiply:T3,divide:hM,negate:pM});function M2e(e,t="-"){return e.replace(/\s+/g,t)}function R2e(e){const t=M2e(e.toString());return $2e(O2e(t))}function O2e(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function $2e(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function N2e(e,t=""){return[t,e].filter(Boolean).join("-")}function F2e(e,t){return`var(${e}${t?`, ${t}`:""})`}function D2e(e,t=""){return R2e(`--${N2e(e,t)}`)}function Ae(e,t,n){const r=D2e(e,n);return{variable:r,reference:F2e(r,t)}}function L2e(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=Ae(`${e}-${i}`,o);continue}n[r]=Ae(`${e}-${r}`)}return n}function B2e(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function z2e(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function A3(e){if(e==null)return e;const{unitless:t}=z2e(e);return t||typeof e=="number"?`${e}px`:e}var CV=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,tA=e=>Object.fromEntries(Object.entries(e).sort(CV));function gM(e){const t=tA(e);return Object.assign(Object.values(t),t)}function j2e(e){const t=Object.keys(tA(e));return new Set(t)}function mM(e){var t;if(!e)return e;e=(t=A3(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Kh(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${A3(e)})`),t&&n.push("and",`(max-width: ${A3(t)})`),n.join(" ")}function V2e(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=gM(e),r=Object.entries(e).sort(CV).map(([s,a],l,c)=>{var u;let[,d]=(u=c[l+1])!=null?u:[];return d=parseFloat(d)>0?mM(d):void 0,{_minW:mM(a),breakpoint:s,minW:a,maxW:d,maxWQuery:Kh(null,d),minWQuery:Kh(a),minMaxQuery:Kh(a,d)}}),i=j2e(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(s){const a=Object.keys(s);return a.length>0&&a.every(l=>i.has(l))},asObject:tA(e),asArray:gM(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>Kh(s)).slice(1)],toArrayValue(s){if(!ys(s))throw new Error("toArrayValue: value must be an object");const a=o.map(l=>{var c;return(c=s[l])!=null?c:null});for(;B2e(a)===null;)a.pop();return a},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((a,l,c)=>{const u=o[c];return u!=null&&l!=null&&(a[u]=l),a},{})}}}var Xn={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}`},Ia=e=>EV(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Ns=e=>EV(t=>e(t,"~ &"),"[data-peer]",".peer"),EV=(e,...t)=>t.map(e).join(", "),AS={_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:Ia(Xn.hover),_peerHover:Ns(Xn.hover),_groupFocus:Ia(Xn.focus),_peerFocus:Ns(Xn.focus),_groupFocusVisible:Ia(Xn.focusVisible),_peerFocusVisible:Ns(Xn.focusVisible),_groupActive:Ia(Xn.active),_peerActive:Ns(Xn.active),_groupDisabled:Ia(Xn.disabled),_peerDisabled:Ns(Xn.disabled),_groupInvalid:Ia(Xn.invalid),_peerInvalid:Ns(Xn.invalid),_groupChecked:Ia(Xn.checked),_peerChecked:Ns(Xn.checked),_groupFocusWithin:Ia(Xn.focusWithin),_peerFocusWithin:Ns(Xn.focusWithin),_peerPlaceholderShown:Ns(Xn.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]"},TV=Object.keys(AS);function yM(e,t){return Ae(String(e).replace(/\./g,"-"),void 0,t)}function U2e(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:s,value:a}=o,{variable:l,reference:c}=yM(i,t==null?void 0:t.cssVarPrefix);if(!s){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,m=`${h}.-${p.join(".")}`,_=mc.negate(a),v=mc.negate(c);r[m]={value:_,var:l,varRef:v}}n[l]=a,r[i]={value:a,var:l,varRef:c};continue}const u=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:_}=yM(p,t==null?void 0:t.cssVarPrefix);return _},d=ys(a)?a:{default:a};n=ds(n,Object.entries(d).reduce((f,[h,p])=>{var m,_;if(!p)return f;const v=u(`${p}`);if(h==="default")return f[l]=v,f;const y=(_=(m=AS)==null?void 0:m[h])!=null?_:h;return f[y]={[l]:v},f},{})),r[i]={value:c,var:l,varRef:c}}return{cssVars:n,cssMap:r}}function G2e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function H2e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function W2e(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function vM(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){var l;if(W2e(s)||Array.isArray(s)){const c={};for(const[u,d]of Object.entries(s)){const f=(l=i==null?void 0:i(u))!=null?l:u,h=[...a,f];if(r!=null&&r(s,h))return t(s,a);c[f]=o(d,h)}return c}return t(s,a)}return o(e)}var q2e=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function K2e(e){return H2e(e,q2e)}function X2e(e){return e.semanticTokens}function Q2e(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var Y2e=e=>TV.includes(e)||e==="default";function Z2e({tokens:e,semanticTokens:t}){const n={};return vM(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),vM(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(Y2e)}),n}function J2e(e){var t;const n=Q2e(e),r=K2e(n),i=X2e(n),o=Z2e({tokens:r,semanticTokens:i}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=U2e(o,{cssVarPrefix:s});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:a,__breakpoints:V2e(n.breakpoints)}),n}var nA=ds({},cv,ct,g2e,U1,zi,m2e,E2e,y2e,xV,C2e,bp,E3,Rt,I2e,P2e,T2e,A2e,v2e,k2e),exe=Object.assign({},Rt,zi,U1,xV,bp),wWe=Object.keys(exe),txe=[...Object.keys(nA),...TV],nxe={...nA,...AS},rxe=e=>e in nxe,ixe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=us(e[s],t);if(a==null)continue;if(a=ys(a)&&n(a)?r(a):a,!Array.isArray(a)){o[s]=a;continue}const l=a.slice(0,i.length).length;for(let c=0;c<l;c+=1){const u=i==null?void 0:i[c];if(!u){o[s]=a[c];continue}o[u]=o[u]||{},a[c]!=null&&(o[u][s]=a[c])}}return o};function oxe(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 sxe(e){return/^var\(--.+\)$/.test(e)}var axe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!sxe(t),lxe=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var c,u;return(u=(c=e.__cssMap)==null?void 0:c[l])==null?void 0:u.varRef},o=l=>{var c;return(c=i(l))!=null?c:l},[s,a]=oxe(t);return t=(r=(n=i(s))!=null?n:o(a))!=null?r:o(t),t};function cxe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var a,l,c;const u=us(o,r),d=ixe(u)(r);let f={};for(let h in d){const p=d[h];let m=us(p,r);h in n&&(h=n[h]),axe(h,m)&&(m=lxe(r,m));let _=t[h];if(_===!0&&(_={property:h}),ys(m)){f[h]=(a=f[h])!=null?a:{},f[h]=ds({},f[h],i(m,!0));continue}let v=(c=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,u))!=null?c:m;v=_!=null&&_.processResult?i(v,!0):v;const y=us(_==null?void 0:_.property,r);if(!s&&(_!=null&&_.static)){const g=us(_.static,r);f=ds({},f,g)}if(y&&Array.isArray(y)){for(const g of y)f[g]=v;continue}if(y){y==="&"&&ys(v)?f=ds({},f,v):f[y]=v;continue}if(ys(v)){f=ds({},f,v);continue}f[h]=v}return f};return i}var AV=e=>t=>cxe({theme:t,pseudos:AS,configs:nA})(e);function Be(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function uxe(e,t){if(Array.isArray(e))return e;if(ys(e))return t(e);if(e!=null)return[e]}function dxe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function fxe(e){const t=e.__breakpoints;return function(r,i,o,s){var a,l;if(!t)return;const c={},u=uxe(o,t.toArrayValue);if(!u)return c;const d=u.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const m=t.details[p],_=t.details[dxe(u,p)],v=Kh(m.minW,_==null?void 0:_._minW),y=us((a=r[i])==null?void 0:a[u[p]],s);if(y){if(h){(l=r.parts)==null||l.forEach(g=>{ds(c,{[g]:f?y[g]:{[v]:y[g]}})});continue}if(!h){f?ds(c,y):c[v]=y;continue}c[v]=y}}return c}}function hxe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,s=fxe(o);return ds({},us((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",i,t),s(e,"variants",r,t))}}function CWe(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 Wm(e){return G2e(e,["styleConfig","size","variant","colorScheme"])}var pxe={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"},gxe={"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)"},mxe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},yxe={property:pxe,easing:gxe,duration:mxe},vxe=yxe,bxe={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},_xe=bxe,Sxe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},xxe=Sxe,wxe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Cxe=wxe,Exe={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"}},Txe=Exe,Axe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},kxe=Axe,Pxe={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"},Ixe=Pxe,Mxe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Rxe=Mxe,Oxe={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"}},kV=Oxe,PV={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"},$xe={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"},Nxe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Fxe={...PV,...$xe,container:Nxe},IV=Fxe,Dxe={breakpoints:Cxe,zIndices:_xe,radii:kxe,blur:Rxe,colors:Txe,...kV,sizes:IV,shadows:Ixe,space:PV,borders:xxe,transition:vxe},{defineMultiStyleConfig:Lxe,definePartsStyle:Xh}=Be(["stepper","step","title","description","indicator","separator","icon","number"]),Hs=Ae("stepper-indicator-size"),ud=Ae("stepper-icon-size"),dd=Ae("stepper-title-font-size"),Qh=Ae("stepper-description-font-size"),Sh=Ae("stepper-accent-color"),Bxe=Xh(({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"},[Sh.variable]:`colors.${e}.500`,_dark:{[Sh.variable]:`colors.${e}.200`}},title:{fontSize:dd.reference,fontWeight:"medium"},description:{fontSize:Qh.reference,color:"chakra-subtle-text"},number:{fontSize:dd.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:Hs.reference,height:Hs.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:Sh.reference},"&[data-status=complete]":{bg:Sh.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:Sh.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Hs.reference} - 8px)`,top:`calc(${Hs.reference} + 4px)`,insetStart:`calc(${Hs.reference} / 2 - 1px)`}}})),zxe=Lxe({baseStyle:Bxe,sizes:{xs:Xh({stepper:{[Hs.variable]:"sizes.4",[ud.variable]:"sizes.3",[dd.variable]:"fontSizes.xs",[Qh.variable]:"fontSizes.xs"}}),sm:Xh({stepper:{[Hs.variable]:"sizes.6",[ud.variable]:"sizes.4",[dd.variable]:"fontSizes.sm",[Qh.variable]:"fontSizes.xs"}}),md:Xh({stepper:{[Hs.variable]:"sizes.8",[ud.variable]:"sizes.5",[dd.variable]:"fontSizes.md",[Qh.variable]:"fontSizes.sm"}}),lg:Xh({stepper:{[Hs.variable]:"sizes.10",[ud.variable]:"sizes.6",[dd.variable]:"fontSizes.lg",[Qh.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function ht(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(...u){r();for(const d of u)t[d]=l(d);return ht(e,t)}function o(...u){for(const d of u)d in t||(t[d]=l(d));return ht(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(u){const h=`chakra-${(["container","root"].includes(u??"")?[e]:[e,u]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>u}}return{parts:i,toPart:l,extend:o,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}var MV=ht("accordion").parts("root","container","button","panel").extend("icon"),jxe=ht("alert").parts("title","description","container").extend("icon","spinner"),Vxe=ht("avatar").parts("label","badge","container").extend("excessLabel","group"),Uxe=ht("breadcrumb").parts("link","item","container").extend("separator");ht("button").parts();var RV=ht("checkbox").parts("control","icon","container").extend("label");ht("progress").parts("track","filledTrack").extend("label");var Gxe=ht("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),OV=ht("editable").parts("preview","input","textarea"),Hxe=ht("form").parts("container","requiredIndicator","helperText"),Wxe=ht("formError").parts("text","icon"),$V=ht("input").parts("addon","field","element","group"),qxe=ht("list").parts("container","item","icon"),NV=ht("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),FV=ht("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),DV=ht("numberinput").parts("root","field","stepperGroup","stepper");ht("pininput").parts("field");var LV=ht("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),BV=ht("progress").parts("label","filledTrack","track"),Kxe=ht("radio").parts("container","control","label"),zV=ht("select").parts("field","icon"),jV=ht("slider").parts("container","track","thumb","filledTrack","mark"),Xxe=ht("stat").parts("container","label","helpText","number","icon"),VV=ht("switch").parts("container","track","thumb","label"),Qxe=ht("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),UV=ht("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Yxe=ht("tag").parts("container","label","closeButton"),Zxe=ht("card").parts("container","header","body","footer");ht("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");function Cc(e,t,n){return Math.min(Math.max(e,n),t)}class Jxe extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Yh=Jxe;function rA(e){if(typeof e!="string")throw new Yh(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=awe.test(e)?nwe(e):e;const n=rwe.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Fg(a,2),16)),parseInt(Fg(s[3]||"f",2),16)/255]}const r=iwe.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const i=owe.exec(t);if(i){const s=Array.from(i).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const o=swe.exec(t);if(o){const[s,a,l,c]=Array.from(o).slice(1).map(parseFloat);if(Cc(0,100,a)!==a)throw new Yh(e);if(Cc(0,100,l)!==l)throw new Yh(e);return[...lwe(s,a,l),Number.isNaN(c)?1:c]}throw new Yh(e)}function ewe(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const bM=e=>parseInt(e.replace(/_/g,""),36),twe="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=bM(t.substring(0,3)),r=bM(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 nwe(e){const t=e.toLowerCase().trim(),n=twe[ewe(t)];if(!n)throw new Yh(e);return`#${n}`}const Fg=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),rwe=new RegExp(`^#${Fg("([a-f0-9])",3)}([a-f0-9])?$`,"i"),iwe=new RegExp(`^#${Fg("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),owe=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Fg(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),swe=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,awe=/^[a-z]+$/i,_M=e=>Math.round(e*255),lwe=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(_M);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),s=o*(1-Math.abs(i%2-1));let a=0,l=0,c=0;i>=0&&i<1?(a=o,l=s):i>=1&&i<2?(a=s,l=o):i>=2&&i<3?(l=o,c=s):i>=3&&i<4?(l=s,c=o):i>=4&&i<5?(a=s,c=o):i>=5&&i<6&&(a=o,c=s);const u=r-o/2,d=a+u,f=l+u,h=c+u;return[d,f,h].map(_M)};function cwe(e,t,n,r){return`rgba(${Cc(0,255,e).toFixed()}, ${Cc(0,255,t).toFixed()}, ${Cc(0,255,n).toFixed()}, ${parseFloat(Cc(0,1,r).toFixed(3))})`}function uwe(e,t){const[n,r,i,o]=rA(e);return cwe(n,r,i,o-t)}function dwe(e){const[t,n,r,i]=rA(e);let o=s=>{const a=Cc(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function fwe(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 hwe=e=>Object.keys(e).length===0,$r=(e,t,n)=>{const r=fwe(e,`colors.${t}`,t);try{return dwe(r),r}catch{return n??"#000000"}},pwe=e=>{const[t,n,r]=rA(e);return(t*299+n*587+r*114)/1e3},gwe=e=>t=>{const n=$r(t,e);return pwe(n)<128?"dark":"light"},mwe=e=>t=>gwe(e)(t)==="dark",vf=(e,t)=>n=>{const r=$r(n,e);return uwe(r,1-t)};function SM(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 ywe=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function vwe(e){const t=ywe();return!e||hwe(e)?t:e.string&&e.colors?_we(e.string,e.colors):e.string&&!e.colors?bwe(e.string):e.colors&&!e.string?Swe(e.colors):t}function bwe(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 _we(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 Swe(e){return e[Math.floor(Math.random()*e.length)]}function W(e,t){return n=>n.colorMode==="dark"?t:e}function iA(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function GV(e){return ys(e)&&e.reference?e.reference:String(e)}var kS=(e,...t)=>t.map(GV).join(` ${e} `).replace(/calc/g,""),xM=(...e)=>`calc(${kS("+",...e)})`,wM=(...e)=>`calc(${kS("-",...e)})`,k3=(...e)=>`calc(${kS("*",...e)})`,CM=(...e)=>`calc(${kS("/",...e)})`,EM=e=>{const t=GV(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:k3(t,-1)},Ws=Object.assign(e=>({add:(...t)=>Ws(xM(e,...t)),subtract:(...t)=>Ws(wM(e,...t)),multiply:(...t)=>Ws(k3(e,...t)),divide:(...t)=>Ws(CM(e,...t)),negate:()=>Ws(EM(e)),toString:()=>e.toString()}),{add:xM,subtract:wM,multiply:k3,divide:CM,negate:EM});function xwe(e){return!Number.isInteger(parseFloat(e.toString()))}function wwe(e,t="-"){return e.replace(/\s+/g,t)}function HV(e){const t=wwe(e.toString());return t.includes("\\.")?e:xwe(e)?t.replace(".","\\."):e}function Cwe(e,t=""){return[t,HV(e)].filter(Boolean).join("-")}function Ewe(e,t){return`var(${HV(e)}${t?`, ${t}`:""})`}function Twe(e,t=""){return`--${Cwe(e,t)}`}function Xt(e,t){const n=Twe(e,t==null?void 0:t.prefix);return{variable:n,reference:Ewe(n,Awe(t==null?void 0:t.fallback))}}function Awe(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:kwe,definePartsStyle:uv}=Be(VV.keys),_p=Xt("switch-track-width"),Dc=Xt("switch-track-height"),ww=Xt("switch-track-diff"),Pwe=Ws.subtract(_p,Dc),P3=Xt("switch-thumb-x"),xh=Xt("switch-bg"),Iwe=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[_p.reference],height:[Dc.reference],transitionProperty:"common",transitionDuration:"fast",[xh.variable]:"colors.gray.300",_dark:{[xh.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[xh.variable]:`colors.${t}.500`,_dark:{[xh.variable]:`colors.${t}.200`}},bg:xh.reference}},Mwe={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Dc.reference],height:[Dc.reference],_checked:{transform:`translateX(${P3.reference})`}},Rwe=uv(e=>({container:{[ww.variable]:Pwe,[P3.variable]:ww.reference,_rtl:{[P3.variable]:Ws(ww).negate().toString()}},track:Iwe(e),thumb:Mwe})),Owe={sm:uv({container:{[_p.variable]:"1.375rem",[Dc.variable]:"sizes.3"}}),md:uv({container:{[_p.variable]:"1.875rem",[Dc.variable]:"sizes.4"}}),lg:uv({container:{[_p.variable]:"2.875rem",[Dc.variable]:"sizes.6"}})},$we=kwe({baseStyle:Rwe,sizes:Owe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Nwe,definePartsStyle:zd}=Be(Qxe.keys),Fwe=zd({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"}}),G1={"&[data-is-numeric=true]":{textAlign:"end"}},Dwe=zd(e=>{const{colorScheme:t}=e;return{th:{color:W("gray.600","gray.400")(e),borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...G1},td:{borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...G1},caption:{color:W("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Lwe=zd(e=>{const{colorScheme:t}=e;return{th:{color:W("gray.600","gray.400")(e),borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...G1},td:{borderBottom:"1px",borderColor:W(`${t}.100`,`${t}.700`)(e),...G1},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}}}}}}),Bwe={simple:Dwe,striped:Lwe,unstyled:{}},zwe={sm:zd({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:zd({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:zd({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},jwe=Nwe({baseStyle:Fwe,variants:Bwe,sizes:zwe,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Kr=Ae("tabs-color"),Co=Ae("tabs-bg"),sy=Ae("tabs-border-color"),{defineMultiStyleConfig:Vwe,definePartsStyle:vs}=Be(UV.keys),Uwe=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Gwe=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}}},Hwe=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Wwe={p:4},qwe=vs(e=>({root:Uwe(e),tab:Gwe(e),tablist:Hwe(e),tabpanel:Wwe})),Kwe={sm:vs({tab:{py:1,px:4,fontSize:"sm"}}),md:vs({tab:{fontSize:"md",py:2,px:4}}),lg:vs({tab:{fontSize:"lg",py:3,px:4}})},Xwe=vs(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:{[Co.variable]:"colors.gray.200",_dark:{[Co.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Kr.reference,bg:Co.reference}}}),Qwe=vs(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[sy.variable]:"transparent",_selected:{[Kr.variable]:`colors.${t}.600`,[sy.variable]:"colors.white",_dark:{[Kr.variable]:`colors.${t}.300`,[sy.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:sy.reference},color:Kr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Ywe=vs(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Co.variable]:"colors.gray.50",_dark:{[Co.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Co.variable]:"colors.white",[Kr.variable]:`colors.${t}.600`,_dark:{[Co.variable]:"colors.gray.800",[Kr.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Kr.reference,bg:Co.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Zwe=vs(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:$r(n,`${t}.700`),bg:$r(n,`${t}.100`)}}}}),Jwe=vs(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",[Co.variable]:`colors.${t}.600`,_dark:{[Kr.variable]:"colors.gray.800",[Co.variable]:`colors.${t}.300`}},color:Kr.reference,bg:Co.reference}}}),eCe=vs({}),tCe={line:Xwe,enclosed:Qwe,"enclosed-colored":Ywe,"soft-rounded":Zwe,"solid-rounded":Jwe,unstyled:eCe},nCe=Vwe({baseStyle:qwe,sizes:Kwe,variants:tCe,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),un=L2e("badge",["bg","color","shadow"]),rCe={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:un.bg.reference,color:un.color.reference,boxShadow:un.shadow.reference},iCe=e=>{const{colorScheme:t,theme:n}=e,r=vf(`${t}.500`,.6)(n);return{[un.bg.variable]:`colors.${t}.500`,[un.color.variable]:"colors.white",_dark:{[un.bg.variable]:r,[un.color.variable]:"colors.whiteAlpha.800"}}},oCe=e=>{const{colorScheme:t,theme:n}=e,r=vf(`${t}.200`,.16)(n);return{[un.bg.variable]:`colors.${t}.100`,[un.color.variable]:`colors.${t}.800`,_dark:{[un.bg.variable]:r,[un.color.variable]:`colors.${t}.200`}}},sCe=e=>{const{colorScheme:t,theme:n}=e,r=vf(`${t}.200`,.8)(n);return{[un.color.variable]:`colors.${t}.500`,_dark:{[un.color.variable]:r},[un.shadow.variable]:`inset 0 0 0px 1px ${un.color.reference}`}},aCe={solid:iCe,subtle:oCe,outline:sCe},Sp={baseStyle:rCe,variants:aCe,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:lCe,definePartsStyle:Lc}=Be(Yxe.keys),TM=Ae("tag-bg"),AM=Ae("tag-color"),Cw=Ae("tag-shadow"),dv=Ae("tag-min-height"),fv=Ae("tag-min-width"),hv=Ae("tag-font-size"),pv=Ae("tag-padding-inline"),cCe={fontWeight:"medium",lineHeight:1.2,outline:0,[AM.variable]:un.color.reference,[TM.variable]:un.bg.reference,[Cw.variable]:un.shadow.reference,color:AM.reference,bg:TM.reference,boxShadow:Cw.reference,borderRadius:"md",minH:dv.reference,minW:fv.reference,fontSize:hv.reference,px:pv.reference,_focusVisible:{[Cw.variable]:"shadows.outline"}},uCe={lineHeight:1.2,overflow:"visible"},dCe={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}},fCe=Lc({container:cCe,label:uCe,closeButton:dCe}),hCe={sm:Lc({container:{[dv.variable]:"sizes.5",[fv.variable]:"sizes.5",[hv.variable]:"fontSizes.xs",[pv.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Lc({container:{[dv.variable]:"sizes.6",[fv.variable]:"sizes.6",[hv.variable]:"fontSizes.sm",[pv.variable]:"space.2"}}),lg:Lc({container:{[dv.variable]:"sizes.8",[fv.variable]:"sizes.8",[hv.variable]:"fontSizes.md",[pv.variable]:"space.3"}})},pCe={subtle:Lc(e=>{var t;return{container:(t=Sp.variants)==null?void 0:t.subtle(e)}}),solid:Lc(e=>{var t;return{container:(t=Sp.variants)==null?void 0:t.solid(e)}}),outline:Lc(e=>{var t;return{container:(t=Sp.variants)==null?void 0:t.outline(e)}})},gCe=lCe({variants:pCe,baseStyle:fCe,sizes:hCe,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Qs,defineMultiStyleConfig:mCe}=Be($V.keys),fd=Ae("input-height"),hd=Ae("input-font-size"),pd=Ae("input-padding"),gd=Ae("input-border-radius"),yCe=Qs({addon:{height:fd.reference,fontSize:hd.reference,px:pd.reference,borderRadius:gd.reference},field:{width:"100%",height:fd.reference,fontSize:hd.reference,px:pd.reference,borderRadius:gd.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Ma={lg:{[hd.variable]:"fontSizes.lg",[pd.variable]:"space.4",[gd.variable]:"radii.md",[fd.variable]:"sizes.12"},md:{[hd.variable]:"fontSizes.md",[pd.variable]:"space.4",[gd.variable]:"radii.md",[fd.variable]:"sizes.10"},sm:{[hd.variable]:"fontSizes.sm",[pd.variable]:"space.3",[gd.variable]:"radii.sm",[fd.variable]:"sizes.8"},xs:{[hd.variable]:"fontSizes.xs",[pd.variable]:"space.2",[gd.variable]:"radii.sm",[fd.variable]:"sizes.6"}},vCe={lg:Qs({field:Ma.lg,group:Ma.lg}),md:Qs({field:Ma.md,group:Ma.md}),sm:Qs({field:Ma.sm,group:Ma.sm}),xs:Qs({field:Ma.xs,group:Ma.xs})};function oA(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 bCe=Qs(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=oA(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:$r(t,r),boxShadow:`0 0 0 1px ${$r(t,r)}`},_focusVisible:{zIndex:1,borderColor:$r(t,n),boxShadow:`0 0 0 1px ${$r(t,n)}`}},addon:{border:"1px solid",borderColor:W("inherit","whiteAlpha.50")(e),bg:W("gray.100","whiteAlpha.300")(e)}}}),_Ce=Qs(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=oA(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:$r(t,r)},_focusVisible:{bg:"transparent",borderColor:$r(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:W("gray.100","whiteAlpha.50")(e)}}}),SCe=Qs(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=oA(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:$r(t,r),boxShadow:`0px 1px 0px 0px ${$r(t,r)}`},_focusVisible:{borderColor:$r(t,n),boxShadow:`0px 1px 0px 0px ${$r(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),xCe=Qs({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),wCe={outline:bCe,filled:_Ce,flushed:SCe,unstyled:xCe},ft=mCe({baseStyle:yCe,sizes:vCe,variants:wCe,defaultProps:{size:"md",variant:"outline"}}),kM,CCe={...(kM=ft.baseStyle)==null?void 0:kM.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},PM,IM,ECe={outline:e=>{var t,n;return(n=(t=ft.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=ft.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=ft.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(IM=(PM=ft.variants)==null?void 0:PM.unstyled.field)!=null?IM:{}},MM,RM,OM,$M,NM,FM,DM,LM,TCe={xs:(RM=(MM=ft.sizes)==null?void 0:MM.xs.field)!=null?RM:{},sm:($M=(OM=ft.sizes)==null?void 0:OM.sm.field)!=null?$M:{},md:(FM=(NM=ft.sizes)==null?void 0:NM.md.field)!=null?FM:{},lg:(LM=(DM=ft.sizes)==null?void 0:DM.lg.field)!=null?LM:{}},ACe={baseStyle:CCe,sizes:TCe,variants:ECe,defaultProps:{size:"md",variant:"outline"}},ay=Xt("tooltip-bg"),Ew=Xt("tooltip-fg"),kCe=Xt("popper-arrow-bg"),PCe={bg:ay.reference,color:Ew.reference,[ay.variable]:"colors.gray.700",[Ew.variable]:"colors.whiteAlpha.900",_dark:{[ay.variable]:"colors.gray.300",[Ew.variable]:"colors.gray.900"},[kCe.variable]:ay.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},ICe={baseStyle:PCe},{defineMultiStyleConfig:MCe,definePartsStyle:Zh}=Be(BV.keys),RCe=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=W(SM(),SM("1rem","rgba(0,0,0,0.1)"))(e),s=W(`${t}.500`,`${t}.200`)(e),a=`linear-gradient(
to right,
transparent 0%,
${$r(n,s)} 50%,
transparent 100%
)`;return{...!r&&i&&o,...r?{bgImage:a}:{bgColor:s}}},OCe={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},$Ce=e=>({bg:W("gray.100","whiteAlpha.300")(e)}),NCe=e=>({transitionProperty:"common",transitionDuration:"slow",...RCe(e)}),FCe=Zh(e=>({label:OCe,filledTrack:NCe(e),track:$Ce(e)})),DCe={xs:Zh({track:{h:"1"}}),sm:Zh({track:{h:"2"}}),md:Zh({track:{h:"3"}}),lg:Zh({track:{h:"4"}})},LCe=MCe({sizes:DCe,baseStyle:FCe,defaultProps:{size:"md",colorScheme:"blue"}}),BCe=e=>typeof e=="function";function Fr(e,...t){return BCe(e)?e(...t):e}var{definePartsStyle:gv,defineMultiStyleConfig:zCe}=Be(RV.keys),xp=Ae("checkbox-size"),jCe=e=>{const{colorScheme:t}=e;return{w:xp.reference,h:xp.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)}}},VCe={_disabled:{cursor:"not-allowed"}},UCe={userSelect:"none",_disabled:{opacity:.4}},GCe={transitionProperty:"transform",transitionDuration:"normal"},HCe=gv(e=>({icon:GCe,container:VCe,control:Fr(jCe,e),label:UCe})),WCe={sm:gv({control:{[xp.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:gv({control:{[xp.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:gv({control:{[xp.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},H1=zCe({baseStyle:HCe,sizes:WCe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:qCe,definePartsStyle:mv}=Be(Kxe.keys),KCe=e=>{var t;const n=(t=Fr(H1.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"}}}},XCe=mv(e=>{var t,n,r,i;return{label:(n=(t=H1).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=H1).baseStyle)==null?void 0:i.call(r,e).container,control:KCe(e)}}),QCe={md:mv({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:mv({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:mv({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},YCe=qCe({baseStyle:XCe,sizes:QCe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:ZCe,definePartsStyle:JCe}=Be(zV.keys),ly=Ae("select-bg"),BM,e5e={...(BM=ft.baseStyle)==null?void 0:BM.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:ly.reference,[ly.variable]:"colors.white",_dark:{[ly.variable]:"colors.gray.700"},"> option, > optgroup":{bg:ly.reference}},t5e={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},n5e=JCe({field:e5e,icon:t5e}),cy={paddingInlineEnd:"8"},zM,jM,VM,UM,GM,HM,WM,qM,r5e={lg:{...(zM=ft.sizes)==null?void 0:zM.lg,field:{...(jM=ft.sizes)==null?void 0:jM.lg.field,...cy}},md:{...(VM=ft.sizes)==null?void 0:VM.md,field:{...(UM=ft.sizes)==null?void 0:UM.md.field,...cy}},sm:{...(GM=ft.sizes)==null?void 0:GM.sm,field:{...(HM=ft.sizes)==null?void 0:HM.sm.field,...cy}},xs:{...(WM=ft.sizes)==null?void 0:WM.xs,field:{...(qM=ft.sizes)==null?void 0:qM.xs.field,...cy},icon:{insetEnd:"1"}}},i5e=ZCe({baseStyle:n5e,sizes:r5e,variants:ft.variants,defaultProps:ft.defaultProps}),Tw=Ae("skeleton-start-color"),Aw=Ae("skeleton-end-color"),o5e={[Tw.variable]:"colors.gray.100",[Aw.variable]:"colors.gray.400",_dark:{[Tw.variable]:"colors.gray.800",[Aw.variable]:"colors.gray.600"},background:Tw.reference,borderColor:Aw.reference,opacity:.7,borderRadius:"sm"},s5e={baseStyle:o5e},kw=Ae("skip-link-bg"),a5e={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[kw.variable]:"colors.white",_dark:{[kw.variable]:"colors.gray.700"},bg:kw.reference}},l5e={baseStyle:a5e},{defineMultiStyleConfig:c5e,definePartsStyle:PS}=Be(jV.keys),Dg=Ae("slider-thumb-size"),Lg=Ae("slider-track-size"),Ka=Ae("slider-bg"),u5e=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...iA({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},d5e=e=>({...iA({orientation:e.orientation,horizontal:{h:Lg.reference},vertical:{w:Lg.reference}}),overflow:"hidden",borderRadius:"sm",[Ka.variable]:"colors.gray.200",_dark:{[Ka.variable]:"colors.whiteAlpha.200"},_disabled:{[Ka.variable]:"colors.gray.300",_dark:{[Ka.variable]:"colors.whiteAlpha.300"}},bg:Ka.reference}),f5e=e=>{const{orientation:t}=e;return{...iA({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:Dg.reference,h:Dg.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"}}},h5e=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Ka.variable]:`colors.${t}.500`,_dark:{[Ka.variable]:`colors.${t}.200`},bg:Ka.reference}},p5e=PS(e=>({container:u5e(e),track:d5e(e),thumb:f5e(e),filledTrack:h5e(e)})),g5e=PS({container:{[Dg.variable]:"sizes.4",[Lg.variable]:"sizes.1"}}),m5e=PS({container:{[Dg.variable]:"sizes.3.5",[Lg.variable]:"sizes.1"}}),y5e=PS({container:{[Dg.variable]:"sizes.2.5",[Lg.variable]:"sizes.0.5"}}),v5e={lg:g5e,md:m5e,sm:y5e},b5e=c5e({baseStyle:p5e,sizes:v5e,defaultProps:{size:"md",colorScheme:"blue"}}),yc=Xt("spinner-size"),_5e={width:[yc.reference],height:[yc.reference]},S5e={xs:{[yc.variable]:"sizes.3"},sm:{[yc.variable]:"sizes.4"},md:{[yc.variable]:"sizes.6"},lg:{[yc.variable]:"sizes.8"},xl:{[yc.variable]:"sizes.12"}},x5e={baseStyle:_5e,sizes:S5e,defaultProps:{size:"md"}},{defineMultiStyleConfig:w5e,definePartsStyle:WV}=Be(Xxe.keys),C5e={fontWeight:"medium"},E5e={opacity:.8,marginBottom:"2"},T5e={verticalAlign:"baseline",fontWeight:"semibold"},A5e={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},k5e=WV({container:{},label:C5e,helpText:E5e,number:T5e,icon:A5e}),P5e={md:WV({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},I5e=w5e({baseStyle:k5e,sizes:P5e,defaultProps:{size:"md"}}),Pw=Ae("kbd-bg"),M5e={[Pw.variable]:"colors.gray.100",_dark:{[Pw.variable]:"colors.whiteAlpha.100"},bg:Pw.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},R5e={baseStyle:M5e},O5e={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},$5e={baseStyle:O5e},{defineMultiStyleConfig:N5e,definePartsStyle:F5e}=Be(qxe.keys),D5e={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},L5e=F5e({icon:D5e}),B5e=N5e({baseStyle:L5e}),{defineMultiStyleConfig:z5e,definePartsStyle:j5e}=Be(NV.keys),es=Ae("menu-bg"),Iw=Ae("menu-shadow"),V5e={[es.variable]:"#fff",[Iw.variable]:"shadows.sm",_dark:{[es.variable]:"colors.gray.700",[Iw.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:es.reference,boxShadow:Iw.reference},U5e={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[es.variable]:"colors.gray.100",_dark:{[es.variable]:"colors.whiteAlpha.100"}},_active:{[es.variable]:"colors.gray.200",_dark:{[es.variable]:"colors.whiteAlpha.200"}},_expanded:{[es.variable]:"colors.gray.100",_dark:{[es.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:es.reference},G5e={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},H5e={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},W5e={opacity:.6},q5e={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},K5e={transitionProperty:"common",transitionDuration:"normal"},X5e=j5e({button:K5e,list:V5e,item:U5e,groupTitle:G5e,icon:H5e,command:W5e,divider:q5e}),Q5e=z5e({baseStyle:X5e}),{defineMultiStyleConfig:Y5e,definePartsStyle:I3}=Be(FV.keys),Mw=Ae("modal-bg"),Rw=Ae("modal-shadow"),Z5e={bg:"blackAlpha.600",zIndex:"modal"},J5e=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"}},e3e=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,[Mw.variable]:"colors.white",[Rw.variable]:"shadows.lg",_dark:{[Mw.variable]:"colors.gray.700",[Rw.variable]:"shadows.dark-lg"},bg:Mw.reference,boxShadow:Rw.reference}},t3e={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},n3e={position:"absolute",top:"2",insetEnd:"3"},r3e=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},i3e={px:"6",py:"4"},o3e=I3(e=>({overlay:Z5e,dialogContainer:Fr(J5e,e),dialog:Fr(e3e,e),header:t3e,closeButton:n3e,body:Fr(r3e,e),footer:i3e}));function go(e){return I3(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var s3e={xs:go("xs"),sm:go("sm"),md:go("md"),lg:go("lg"),xl:go("xl"),"2xl":go("2xl"),"3xl":go("3xl"),"4xl":go("4xl"),"5xl":go("5xl"),"6xl":go("6xl"),full:go("full")},a3e=Y5e({baseStyle:o3e,sizes:s3e,defaultProps:{size:"md"}}),{defineMultiStyleConfig:l3e,definePartsStyle:qV}=Be(DV.keys),sA=Xt("number-input-stepper-width"),KV=Xt("number-input-input-padding"),c3e=Ws(sA).add("0.5rem").toString(),Ow=Xt("number-input-bg"),$w=Xt("number-input-color"),Nw=Xt("number-input-border-color"),u3e={[sA.variable]:"sizes.6",[KV.variable]:c3e},d3e=e=>{var t,n;return(n=(t=Fr(ft.baseStyle,e))==null?void 0:t.field)!=null?n:{}},f3e={width:sA.reference},h3e={borderStart:"1px solid",borderStartColor:Nw.reference,color:$w.reference,bg:Ow.reference,[$w.variable]:"colors.chakra-body-text",[Nw.variable]:"colors.chakra-border-color",_dark:{[$w.variable]:"colors.whiteAlpha.800",[Nw.variable]:"colors.whiteAlpha.300"},_active:{[Ow.variable]:"colors.gray.200",_dark:{[Ow.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},p3e=qV(e=>{var t;return{root:u3e,field:(t=Fr(d3e,e))!=null?t:{},stepperGroup:f3e,stepper:h3e}});function uy(e){var t,n,r;const i=(t=ft.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},s=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",a=kV.fontSizes[s];return qV({field:{...i.field,paddingInlineEnd:KV.reference,verticalAlign:"top"},stepper:{fontSize:Ws(a).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var g3e={xs:uy("xs"),sm:uy("sm"),md:uy("md"),lg:uy("lg")},m3e=l3e({baseStyle:p3e,sizes:g3e,variants:ft.variants,defaultProps:ft.defaultProps}),KM,y3e={...(KM=ft.baseStyle)==null?void 0:KM.field,textAlign:"center"},v3e={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"}},XM,QM,b3e={outline:e=>{var t,n,r;return(r=(n=Fr((t=ft.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Fr((t=ft.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Fr((t=ft.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(QM=(XM=ft.variants)==null?void 0:XM.unstyled.field)!=null?QM:{}},_3e={baseStyle:y3e,sizes:v3e,variants:b3e,defaultProps:ft.defaultProps},{defineMultiStyleConfig:S3e,definePartsStyle:x3e}=Be(LV.keys),dy=Xt("popper-bg"),w3e=Xt("popper-arrow-bg"),YM=Xt("popper-arrow-shadow-color"),C3e={zIndex:10},E3e={[dy.variable]:"colors.white",bg:dy.reference,[w3e.variable]:dy.reference,[YM.variable]:"colors.gray.200",_dark:{[dy.variable]:"colors.gray.700",[YM.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},T3e={px:3,py:2,borderBottomWidth:"1px"},A3e={px:3,py:2},k3e={px:3,py:2,borderTopWidth:"1px"},P3e={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},I3e=x3e({popper:C3e,content:E3e,header:T3e,body:A3e,footer:k3e,closeButton:P3e}),M3e=S3e({baseStyle:I3e}),{definePartsStyle:M3,defineMultiStyleConfig:R3e}=Be(Gxe.keys),Fw=Ae("drawer-bg"),Dw=Ae("drawer-box-shadow");function Lu(e){return M3(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var O3e={bg:"blackAlpha.600",zIndex:"modal"},$3e={display:"flex",zIndex:"modal",justifyContent:"center"},N3e=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Fw.variable]:"colors.white",[Dw.variable]:"shadows.lg",_dark:{[Fw.variable]:"colors.gray.700",[Dw.variable]:"shadows.dark-lg"},bg:Fw.reference,boxShadow:Dw.reference}},F3e={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},D3e={position:"absolute",top:"2",insetEnd:"3"},L3e={px:"6",py:"2",flex:"1",overflow:"auto"},B3e={px:"6",py:"4"},z3e=M3(e=>({overlay:O3e,dialogContainer:$3e,dialog:Fr(N3e,e),header:F3e,closeButton:D3e,body:L3e,footer:B3e})),j3e={xs:Lu("xs"),sm:Lu("md"),md:Lu("lg"),lg:Lu("2xl"),xl:Lu("4xl"),full:Lu("full")},V3e=R3e({baseStyle:z3e,sizes:j3e,defaultProps:{size:"xs"}}),{definePartsStyle:U3e,defineMultiStyleConfig:G3e}=Be(OV.keys),H3e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},W3e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},q3e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},K3e=U3e({preview:H3e,input:W3e,textarea:q3e}),X3e=G3e({baseStyle:K3e}),{definePartsStyle:Q3e,defineMultiStyleConfig:Y3e}=Be(Hxe.keys),jd=Ae("form-control-color"),Z3e={marginStart:"1",[jd.variable]:"colors.red.500",_dark:{[jd.variable]:"colors.red.300"},color:jd.reference},J3e={mt:"2",[jd.variable]:"colors.gray.600",_dark:{[jd.variable]:"colors.whiteAlpha.600"},color:jd.reference,lineHeight:"normal",fontSize:"sm"},eEe=Q3e({container:{width:"100%",position:"relative"},requiredIndicator:Z3e,helperText:J3e}),tEe=Y3e({baseStyle:eEe}),{definePartsStyle:nEe,defineMultiStyleConfig:rEe}=Be(Wxe.keys),Vd=Ae("form-error-color"),iEe={[Vd.variable]:"colors.red.500",_dark:{[Vd.variable]:"colors.red.300"},color:Vd.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},oEe={marginEnd:"0.5em",[Vd.variable]:"colors.red.500",_dark:{[Vd.variable]:"colors.red.300"},color:Vd.reference},sEe=nEe({text:iEe,icon:oEe}),aEe=rEe({baseStyle:sEe}),lEe={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},cEe={baseStyle:lEe},uEe={fontFamily:"heading",fontWeight:"bold"},dEe={"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}},fEe={baseStyle:uEe,sizes:dEe,defaultProps:{size:"xl"}},{defineMultiStyleConfig:hEe,definePartsStyle:pEe}=Be(Uxe.keys),Lw=Ae("breadcrumb-link-decor"),gEe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Lw.reference,[Lw.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Lw.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},mEe=pEe({link:gEe}),yEe=hEe({baseStyle:mEe}),vEe={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"}}},XV=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=vf(`${t}.200`,.12)(n),i=vf(`${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)}}},bEe=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"},...Fr(XV,e)}},_Ee={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},SEe=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:s=`${n}.700`}=(t=_Ee[n])!=null?t:{},a=W(r,`${n}.200`)(e);return{bg:a,color:W(i,"gray.800")(e),_hover:{bg:W(o,`${n}.300`)(e),_disabled:{bg:a}},_active:{bg:W(s,`${n}.400`)(e)}}},xEe=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)}}},wEe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},CEe={ghost:XV,outline:bEe,solid:SEe,link:xEe,unstyled:wEe},EEe={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"}},TEe={baseStyle:vEe,variants:CEe,sizes:EEe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Bc,defineMultiStyleConfig:AEe}=Be(Zxe.keys),W1=Ae("card-bg"),ta=Ae("card-padding"),QV=Ae("card-shadow"),yv=Ae("card-radius"),YV=Ae("card-border-width","0"),ZV=Ae("card-border-color"),kEe=Bc({container:{[W1.variable]:"colors.chakra-body-bg",backgroundColor:W1.reference,boxShadow:QV.reference,borderRadius:yv.reference,color:"chakra-body-text",borderWidth:YV.reference,borderColor:ZV.reference},body:{padding:ta.reference,flex:"1 1 0%"},header:{padding:ta.reference},footer:{padding:ta.reference}}),PEe={sm:Bc({container:{[yv.variable]:"radii.base",[ta.variable]:"space.3"}}),md:Bc({container:{[yv.variable]:"radii.md",[ta.variable]:"space.5"}}),lg:Bc({container:{[yv.variable]:"radii.xl",[ta.variable]:"space.7"}})},IEe={elevated:Bc({container:{[QV.variable]:"shadows.base",_dark:{[W1.variable]:"colors.gray.700"}}}),outline:Bc({container:{[YV.variable]:"1px",[ZV.variable]:"colors.chakra-border-color"}}),filled:Bc({container:{[W1.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[ta.variable]:0},header:{[ta.variable]:0},footer:{[ta.variable]:0}}},MEe=AEe({baseStyle:kEe,variants:IEe,sizes:PEe,defaultProps:{variant:"elevated",size:"md"}}),wp=Xt("close-button-size"),wh=Xt("close-button-bg"),REe={w:[wp.reference],h:[wp.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[wh.variable]:"colors.blackAlpha.100",_dark:{[wh.variable]:"colors.whiteAlpha.100"}},_active:{[wh.variable]:"colors.blackAlpha.200",_dark:{[wh.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:wh.reference},OEe={lg:{[wp.variable]:"sizes.10",fontSize:"md"},md:{[wp.variable]:"sizes.8",fontSize:"xs"},sm:{[wp.variable]:"sizes.6",fontSize:"2xs"}},$Ee={baseStyle:REe,sizes:OEe,defaultProps:{size:"md"}},{variants:NEe,defaultProps:FEe}=Sp,DEe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:un.bg.reference,color:un.color.reference,boxShadow:un.shadow.reference},LEe={baseStyle:DEe,variants:NEe,defaultProps:FEe},BEe={w:"100%",mx:"auto",maxW:"prose",px:"4"},zEe={baseStyle:BEe},jEe={opacity:.6,borderColor:"inherit"},VEe={borderStyle:"solid"},UEe={borderStyle:"dashed"},GEe={solid:VEe,dashed:UEe},HEe={baseStyle:jEe,variants:GEe,defaultProps:{variant:"solid"}},{definePartsStyle:WEe,defineMultiStyleConfig:qEe}=Be(MV.keys),KEe={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},XEe={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},QEe={pt:"2",px:"4",pb:"5"},YEe={fontSize:"1.25em"},ZEe=WEe({container:KEe,button:XEe,panel:QEe,icon:YEe}),JEe=qEe({baseStyle:ZEe}),{definePartsStyle:qm,defineMultiStyleConfig:e4e}=Be(jxe.keys),xi=Ae("alert-fg"),ha=Ae("alert-bg"),t4e=qm({container:{bg:ha.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 aA(e){const{theme:t,colorScheme:n}=e,r=vf(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var n4e=qm(e=>{const{colorScheme:t}=e,n=aA(e);return{container:{[xi.variable]:`colors.${t}.600`,[ha.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[ha.variable]:n.dark}}}}),r4e=qm(e=>{const{colorScheme:t}=e,n=aA(e);return{container:{[xi.variable]:`colors.${t}.600`,[ha.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[ha.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:xi.reference}}}),i4e=qm(e=>{const{colorScheme:t}=e,n=aA(e);return{container:{[xi.variable]:`colors.${t}.600`,[ha.variable]:n.light,_dark:{[xi.variable]:`colors.${t}.200`,[ha.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:xi.reference}}}),o4e=qm(e=>{const{colorScheme:t}=e;return{container:{[xi.variable]:"colors.white",[ha.variable]:`colors.${t}.600`,_dark:{[xi.variable]:"colors.gray.900",[ha.variable]:`colors.${t}.200`},color:xi.reference}}}),s4e={subtle:n4e,"left-accent":r4e,"top-accent":i4e,solid:o4e},a4e=e4e({baseStyle:t4e,variants:s4e,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:JV,defineMultiStyleConfig:l4e}=Be(Vxe.keys),Ud=Ae("avatar-border-color"),Cp=Ae("avatar-bg"),Bg=Ae("avatar-font-size"),bf=Ae("avatar-size"),c4e={borderRadius:"full",border:"0.2em solid",borderColor:Ud.reference,[Ud.variable]:"white",_dark:{[Ud.variable]:"colors.gray.800"}},u4e={bg:Cp.reference,fontSize:Bg.reference,width:bf.reference,height:bf.reference,lineHeight:"1",[Cp.variable]:"colors.gray.200",_dark:{[Cp.variable]:"colors.whiteAlpha.400"}},d4e=e=>{const{name:t,theme:n}=e,r=t?vwe({string:t}):"colors.gray.400",i=mwe(r)(n);let o="white";return i||(o="gray.800"),{bg:Cp.reference,fontSize:Bg.reference,color:o,borderColor:Ud.reference,verticalAlign:"top",width:bf.reference,height:bf.reference,"&:not([data-loaded])":{[Cp.variable]:r},[Ud.variable]:"colors.white",_dark:{[Ud.variable]:"colors.gray.800"}}},f4e={fontSize:Bg.reference,lineHeight:"1"},h4e=JV(e=>({badge:Fr(c4e,e),excessLabel:Fr(u4e,e),container:Fr(d4e,e),label:f4e}));function Ra(e){const t=e!=="100%"?IV[e]:void 0;return JV({container:{[bf.variable]:t??e,[Bg.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[bf.variable]:t??e,[Bg.variable]:`calc(${t??e} / 2.5)`}})}var p4e={"2xs":Ra(4),xs:Ra(6),sm:Ra(8),md:Ra(12),lg:Ra(16),xl:Ra(24),"2xl":Ra(32),full:Ra("100%")},g4e=l4e({baseStyle:h4e,sizes:p4e,defaultProps:{size:"md"}}),m4e={Accordion:JEe,Alert:a4e,Avatar:g4e,Badge:Sp,Breadcrumb:yEe,Button:TEe,Checkbox:H1,CloseButton:$Ee,Code:LEe,Container:zEe,Divider:HEe,Drawer:V3e,Editable:X3e,Form:tEe,FormError:aEe,FormLabel:cEe,Heading:fEe,Input:ft,Kbd:R5e,Link:$5e,List:B5e,Menu:Q5e,Modal:a3e,NumberInput:m3e,PinInput:_3e,Popover:M3e,Progress:LCe,Radio:YCe,Select:i5e,Skeleton:s5e,SkipLink:l5e,Slider:b5e,Spinner:x5e,Stat:I5e,Switch:$we,Table:jwe,Tabs:nCe,Tag:gCe,Textarea:ACe,Tooltip:ICe,Card:MEe,Stepper:zxe},y4e={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"}}},v4e={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"}}},b4e="ltr",_4e={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},S4e={semanticTokens:y4e,direction:b4e,...Dxe,components:m4e,styles:v4e,config:_4e};function x4e(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function w4e(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 C4e=e=>{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},eU=C4e(w4e);function tU(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var nU=e=>tU(e,t=>t!=null);function E4e(e){return typeof e=="function"}function rU(e,...t){return E4e(e)?e(...t):e}function EWe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var T4e=typeof Element<"u",A4e=typeof Map=="function",k4e=typeof Set=="function",P4e=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function vv(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!vv(e[r],t[r]))return!1;return!0}var o;if(A4e&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!vv(r.value[1],t.get(r.value[0])))return!1;return!0}if(k4e&&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(P4e&&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(T4e&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!vv(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var I4e=function(t,n){try{return vv(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const M4e=Ml(I4e);function iU(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:s}=WSe(),a=e?eU(o,`components.${e}`):void 0,l=r||a,c=ds({theme:o,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},nU(x4e(i,["children"]))),u=I.useRef({});if(l){const f=hxe(l)(c);M4e(u.current,f)||(u.current=f)}return u.current}function Km(e,t={}){return iU(e,t)}function R4e(e,t={}){return iU(e,t)}var O4e=new Set([...txe,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),$4e=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function N4e(e){return $4e.has(e)||!O4e.has(e)}function F4e(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 D4e(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var L4e=/^((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)-.*))$/,B4e=sV(function(e){return L4e.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),z4e=B4e,j4e=function(t){return t!=="theme"},ZM=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?z4e:j4e},JM=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},V4e=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return fV(n,r,i),MSe(function(){return hV(n,r,i)}),null},U4e=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=JM(t,n,r),l=a||ZM(i),c=!l("as");return function(){var u=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,h=1;h<f;h++)d.push(u[h],u[0][h])}var p=yV(function(m,_,v){var y=c&&m.as||i,g="",b=[],S=m;if(m.theme==null){S={};for(var w in m)S[w]=m[w];S.theme=I.useContext(Ng)}typeof m.className=="string"?g=CSe(_.registered,b,m.className):m.className!=null&&(g=m.className+" ");var C=YT(d.concat(b),_.registered,S);g+=_.key+"-"+C.name,s!==void 0&&(g+=" "+s);var x=c&&a===void 0?ZM(y):l,k={};for(var A in m)c&&A==="as"||x(A)&&(k[A]=m[A]);return k.className=g,k.ref=v,I.createElement(I.Fragment,null,I.createElement(V4e,{cache:_,serialized:C,isStringTag:typeof y=="string"}),I.createElement(y,k))});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=a,Object.defineProperty(p,"toString",{value:function(){return"."+s}}),p.withComponent=function(m,_){return e(m,z1({},n,_,{shouldForwardProp:JM(p,_,!0)})).apply(void 0,d)},p}},G4e=["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=U4e.bind();G4e.forEach(function(e){q1[e]=q1(e)});var e9,H4e=(e9=q1.default)!=null?e9:q1,W4e=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=tU(s,(d,f)=>rxe(f)),l=rU(e,t),c=F4e({},i,l,nU(a),o),u=AV(c)(t.theme);return r?[u,r]:u};function Bw(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=N4e);const i=W4e({baseStyle:n}),o=H4e(e,r)(i);return Q.forwardRef(function(l,c){const{colorMode:u,forced:d}=ES();return Q.createElement(o,{ref:c,"data-theme":d?u:void 0,...l})})}function q4e(){const e=new Map;return new Proxy(Bw,{apply(t,n,r){return Bw(...r)},get(t,n){return e.has(n)||e.set(n,Bw(n)),e.get(n)}})}var or=q4e();function Mi(e){return I.forwardRef(e)}function K4e(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=I.createContext(void 0);i.displayName=r;function o(){var s;const a=I.useContext(i);if(!a&&t){const l=new Error(n);throw l.name="ContextError",(s=Error.captureStackTrace)==null||s.call(Error,l,o),l}return a}return[i.Provider,o,i]}function X4e(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=I.useMemo(()=>J2e(n),[n]);return ie.jsxs($Se,{theme:i,children:[ie.jsx(Q4e,{root:t}),r]})}function Q4e({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return ie.jsx(vV,{styles:n=>({[t]:n.__cssVars})})}K4e({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function TWe(){const{colorMode:e}=ES();return ie.jsx(vV,{styles:t=>{const n=eU(t,"styles.global"),r=rU(n,{theme:t,colorMode:e});return r?AV(r)(t):void 0}})}var Y4e=(e,t)=>e.find(n=>n.id===t);function t9(e,t){const n=oU(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function oU(e,t){for(const[n,r]of Object.entries(e))if(Y4e(r,t))return n}function Z4e(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 J4e(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)",s=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:s}}function eTe(e,t=[]){const n=I.useRef(e);return I.useEffect(()=>{n.current=e}),I.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function tTe(e,t){const n=eTe(e);I.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function n9(e,t){const n=I.useRef(!1),r=I.useRef(!1);I.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const sU=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),IS=I.createContext({}),Xm=I.createContext(null),MS=typeof document<"u",lA=MS?I.useLayoutEffect:I.useEffect,aU=I.createContext({strict:!1}),cA=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),nTe="framerAppearId",lU="data-"+cA(nTe);function rTe(e,t,n,r){const{visualElement:i}=I.useContext(IS),o=I.useContext(aU),s=I.useContext(Xm),a=I.useContext(sU).reducedMotion,l=I.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;I.useInsertionEffect(()=>{c&&c.update(n,s)});const u=I.useRef(!!(n[lU]&&!window.HandoffComplete));return lA(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),I.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function md(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iTe(e,t,n){return I.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):md(n)&&(n.current=r))},[t])}function zg(e){return typeof e=="string"||Array.isArray(e)}function RS(e){return typeof e=="object"&&typeof e.start=="function"}const uA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dA=["initial",...uA];function OS(e){return RS(e.animate)||dA.some(t=>zg(e[t]))}function cU(e){return!!(OS(e)||e.variants)}function oTe(e,t){if(OS(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 sTe(e){const{initial:t,animate:n}=oTe(e,I.useContext(IS));return I.useMemo(()=>({initial:t,animate:n}),[r9(t),r9(n)])}function r9(e){return Array.isArray(e)?e.join(" "):e}const i9={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"]},jg={};for(const e in i9)jg[e]={isEnabled:t=>i9[e].some(n=>!!t[n])};function aTe(e){for(const t in e)jg[t]={...jg[t],...e[t]}}const fA=I.createContext({}),uU=I.createContext({}),lTe=Symbol.for("motionComponentSymbol");function cTe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&aTe(e);function o(a,l){let c;const u={...I.useContext(sU),...a,layoutId:uTe(a)},{isStatic:d}=u,f=sTe(a),h=r(a,d);if(!d&&MS){f.visualElement=rTe(i,h,u,t);const p=I.useContext(uU),m=I.useContext(aU).strict;f.visualElement&&(c=f.visualElement.loadFeatures(u,m,e,p))}return I.createElement(IS.Provider,{value:f},c&&f.visualElement?I.createElement(c,{visualElement:f.visualElement,...u}):null,n(i,a,iTe(h,f.visualElement,l),h,d,f.visualElement))}const s=I.forwardRef(o);return s[lTe]=i,s}function uTe({layoutId:e}){const t=I.useContext(fA).id;return t&&e!==void 0?t+"-"+e:e}function dTe(e){function t(r,i={}){return cTe(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 fTe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hA(e){return typeof e!="string"||e.includes("-")?!1:!!(fTe.indexOf(e)>-1||/[A-Z]/.test(e))}const K1={};function hTe(e){Object.assign(K1,e)}const Qm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],du=new Set(Qm);function dU(e,{layout:t,layoutId:n}){return du.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!K1[e]||e==="opacity")}const ri=e=>!!(e&&e.getVelocity),pTe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gTe=Qm.length;function mTe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let s=0;s<gTe;s++){const a=Qm[s];if(e[a]!==void 0){const l=pTe[a]||a;o+=`${l}(${e[a]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const fU=e=>t=>typeof t=="string"&&t.startsWith(e),hU=fU("--"),R3=fU("var(--"),yTe=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,vTe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,El=(e,t,n)=>Math.min(Math.max(n,e),t),fu={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ep={...fu,transform:e=>El(0,1,e)},fy={...fu,default:1},Tp=e=>Math.round(e*1e5)/1e5,$S=/(-)?([\d]*\.?[\d])+/g,pU=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,bTe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ym(e){return typeof e=="string"}const Zm=e=>({test:t=>Ym(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Na=Zm("deg"),bs=Zm("%"),Pe=Zm("px"),_Te=Zm("vh"),STe=Zm("vw"),o9={...bs,parse:e=>bs.parse(e)/100,transform:e=>bs.transform(e*100)},s9={...fu,transform:Math.round},gU={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:Na,rotateX:Na,rotateY:Na,rotateZ:Na,scale:fy,scaleX:fy,scaleY:fy,scaleZ:fy,skew:Na,skewX:Na,skewY:Na,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:Ep,originX:o9,originY:o9,originZ:Pe,zIndex:s9,fillOpacity:Ep,strokeOpacity:Ep,numOctaves:s9};function pA(e,t,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const f=t[d];if(hU(d)){o[d]=f;continue}const h=gU[d],p=vTe(f,h);if(du.has(d)){if(l=!0,s[d]=p,!u)continue;f!==(h.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=mTe(e.transform,n,u,r):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:h=0}=a;i.transformOrigin=`${d} ${f} ${h}`}}const gA=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mU(e,t,n){for(const r in t)!ri(t[r])&&!dU(r,n)&&(e[r]=t[r])}function xTe({transformTemplate:e},t,n){return I.useMemo(()=>{const r=gA();return pA(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function wTe(e,t,n){const r=e.style||{},i={};return mU(i,r,e),Object.assign(i,xTe(e,t,n)),e.transformValues?e.transformValues(i):i}function CTe(e,t,n){const r={},i=wTe(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 ETe=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 X1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||ETe.has(e)}let yU=e=>!X1(e);function TTe(e){e&&(yU=t=>t.startsWith("on")?!X1(t):e(t))}try{TTe(require("@emotion/is-prop-valid").default)}catch{}function ATe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(yU(i)||n===!0&&X1(i)||!t&&!X1(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function a9(e,t,n){return typeof e=="string"?e:Pe.transform(t+n*e)}function kTe(e,t,n){const r=a9(t,e.x,e.width),i=a9(n,e.y,e.height);return`${r} ${i}`}const PTe={offset:"stroke-dashoffset",array:"stroke-dasharray"},ITe={offset:"strokeDashoffset",array:"strokeDasharray"};function MTe(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?PTe:ITe;e[o.offset]=Pe.transform(-r);const s=Pe.transform(t),a=Pe.transform(n);e[o.array]=`${s} ${a}`}function mA(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,f){if(pA(e,c,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=kTe(m,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),s!==void 0&&MTe(h,s,a,l,!1)}const vU=()=>({...gA(),attrs:{}}),yA=e=>typeof e=="string"&&e.toLowerCase()==="svg";function RTe(e,t,n,r){const i=I.useMemo(()=>{const o=vU();return mA(o,t,{enableHardwareAcceleration:!1},yA(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};mU(o,e.style,e),i.style={...o,...i.style}}return i}function OTe(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(hA(n)?RTe:CTe)(r,o,s,n),u={...ATe(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=I.useMemo(()=>ri(d)?d.get():d,[d]);return I.createElement(n,{...u,children:f})}}function bU(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 _U=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 SU(e,t,n,r){bU(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(_U.has(i)?i:cA(i),t.attrs[i])}function vA(e,t){const{style:n}=e,r={};for(const i in n)(ri(n[i])||t.style&&ri(t.style[i])||dU(i,e))&&(r[i]=n[i]);return r}function xU(e,t){const n=vA(e,t);for(const r in e)if(ri(e[r])||ri(t[r])){const i=Qm.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function bA(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function wU(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const Q1=e=>Array.isArray(e),$Te=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),NTe=e=>Q1(e)?e[e.length-1]||0:e;function bv(e){const t=ri(e)?e.get():e;return $Te(t)?t.toValue():t}function FTe({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:DTe(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const CU=e=>(t,n)=>{const r=I.useContext(IS),i=I.useContext(Xm),o=()=>FTe(e,t,r,i);return n?o():wU(o)};function DTe(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=bv(o[f]);let{initial:s,animate:a}=e;const l=OS(e),c=cU(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;return d&&typeof d!="boolean"&&!RS(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=bA(e,h);if(!p)return;const{transitionEnd:m,transition:_,...v}=p;for(const y in v){let g=v[y];if(Array.isArray(g)){const b=u?g.length-1:0;g=g[b]}g!==null&&(i[y]=g)}for(const y in m)i[y]=m[y]}),i}const tn=e=>e;class l9{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 LTe(e){let t=new l9,n=new l9,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&i,f=d?t:n;return c&&s.add(l),f.add(l)&&d&&i&&(r=t.order.length),l},cancel:l=>{n.remove(l),s.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 c=0;c<r;c++){const u=t.order[c];u(l),s.has(u)&&(a.schedule(u),e())}i=!1,o&&(o=!1,a.process(l))}};return a}const hy=["prepare","read","update","preRender","render","postRender"],BTe=40;function zTe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=hy.reduce((d,f)=>(d[f]=LTe(()=>n=!0),d),{}),s=d=>o[d].process(i),a=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,BTe),1),i.timestamp=d,i.isProcessing=!0,hy.forEach(s),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:hy.reduce((d,f)=>{const h=o[f];return d[f]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),d},{}),cancel:d=>hy.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Pt,cancel:pa,state:$n,steps:zw}=zTe(typeof requestAnimationFrame<"u"?requestAnimationFrame:tn,!0),jTe={useVisualState:CU({scrapeMotionValuesFromProps:xU,createRenderState:vU,onMount:(e,t,{renderState:n,latestValues:r})=>{Pt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Pt.render(()=>{mA(n,r,{enableHardwareAcceleration:!1},yA(t.tagName),e.transformTemplate),SU(t,n)})}})},VTe={useVisualState:CU({scrapeMotionValuesFromProps:vA,createRenderState:gA})};function UTe(e,{forwardMotionProps:t=!1},n,r){return{...hA(e)?jTe:VTe,preloadedFeatures:n,useRender:OTe(t),createVisualElement:r,Component:e}}function Ys(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const EU=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function NS(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const GTe=e=>t=>EU(t)&&e(t,NS(t));function na(e,t,n,r){return Ys(e,t,GTe(n),r)}const HTe=(e,t)=>n=>t(e(n)),hl=(...e)=>e.reduce(HTe);function TU(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const c9=TU("dragHorizontal"),u9=TU("dragVertical");function AU(e){let t=!1;if(e==="y")t=u9();else if(e==="x")t=c9();else{const n=c9(),r=u9();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function kU(){const e=AU(!0);return e?(e(),!1):!0}class Ll{constructor(t){this.isMounted=!1,this.node=t}update(){}}function d9(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,s)=>{if(o.type==="touch"||kU())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Pt.update(()=>a[r](o,s))};return na(e.current,n,i,{passive:!e.getProps()[r]})}class WTe extends Ll{mount(){this.unmount=hl(d9(this.node,!0),d9(this.node,!1))}unmount(){}}class qTe extends Ll{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=hl(Ys(this.node.current,"focus",()=>this.onFocus()),Ys(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const PU=(e,t)=>t?e===t?!0:PU(e,t.parentElement):!1;function jw(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,NS(n))}class KTe extends Ll{constructor(){super(...arguments),this.removeStartListeners=tn,this.removeEndListeners=tn,this.removeAccessibleListeners=tn,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=na(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u}=this.node.getProps();Pt.update(()=>{PU(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=na(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=hl(o,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||jw("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&Pt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Ys(this.node.current,"keyup",s),jw("down",(a,l)=>{this.startPress(a,l)})},n=Ys(this.node.current,"keydown",t),r=()=>{this.isPressing&&jw("cancel",(o,s)=>this.cancelPress(o,s))},i=Ys(this.node.current,"blur",r);this.removeAccessibleListeners=hl(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&&Pt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!kU()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Pt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=na(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ys(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=hl(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const O3=new WeakMap,Vw=new WeakMap,XTe=e=>{const t=O3.get(e.target);t&&t(e)},QTe=e=>{e.forEach(XTe)};function YTe({root:e,...t}){const n=e||document;Vw.has(n)||Vw.set(n,{});const r=Vw.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(QTe,{root:e,...t})),r[i]}function ZTe(e,t,n){const r=YTe(t);return O3.set(e,n),r.observe(e),()=>{O3.delete(e),r.unobserve(e)}}const JTe={some:0,all:1};class eAe extends Ll{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:JTe[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return ZTe(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(tAe(t,n))&&this.startObserver()}unmount(){}}function tAe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const nAe={inView:{Feature:eAe},tap:{Feature:KTe},focus:{Feature:qTe},hover:{Feature:WTe}};function IU(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 rAe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function iAe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function FS(e,t,n){const r=e.getProps();return bA(r,t,n!==void 0?n:r.custom,rAe(e),iAe(e))}let oAe=tn,_A=tn;const pl=e=>e*1e3,ra=e=>e/1e3,sAe={current:!1},MU=e=>Array.isArray(e)&&typeof e[0]=="number";function RU(e){return!!(!e||typeof e=="string"&&OU[e]||MU(e)||Array.isArray(e)&&e.every(RU))}const Jh=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,OU={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jh([0,.65,.55,1]),circOut:Jh([.55,0,1,.45]),backIn:Jh([.31,.01,.66,-.59]),backOut:Jh([.33,1.53,.69,.99])};function $U(e){if(e)return MU(e)?Jh(e):Array.isArray(e)?e.map($U):OU[e]}function aAe(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=$U(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function lAe(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const NU=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cAe=1e-7,uAe=12;function dAe(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=NU(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>cAe&&++a<uAe);return s}function Jm(e,t,n,r){if(e===t&&n===r)return tn;const i=o=>dAe(o,0,1,e,n);return o=>o===0||o===1?o:NU(i(o),t,r)}const fAe=Jm(.42,0,1,1),hAe=Jm(0,0,.58,1),FU=Jm(.42,0,.58,1),pAe=e=>Array.isArray(e)&&typeof e[0]!="number",DU=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LU=e=>t=>1-e(1-t),BU=e=>1-Math.sin(Math.acos(e)),SA=LU(BU),gAe=DU(SA),zU=Jm(.33,1.53,.69,.99),xA=LU(zU),mAe=DU(xA),yAe=e=>(e*=2)<1?.5*xA(e):.5*(2-Math.pow(2,-10*(e-1))),vAe={linear:tn,easeIn:fAe,easeInOut:FU,easeOut:hAe,circIn:BU,circInOut:gAe,circOut:SA,backIn:xA,backInOut:mAe,backOut:zU,anticipate:yAe},f9=e=>{if(Array.isArray(e)){_A(e.length===4);const[t,n,r,i]=e;return Jm(t,n,r,i)}else if(typeof e=="string")return vAe[e];return e},wA=(e,t)=>n=>!!(Ym(n)&&bTe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),jU=(e,t,n)=>r=>{if(!Ym(r))return r;const[i,o,s,a]=r.match($S);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},bAe=e=>El(0,255,e),Uw={...fu,transform:e=>Math.round(bAe(e))},Ec={test:wA("rgb","red"),parse:jU("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Uw.transform(e)+", "+Uw.transform(t)+", "+Uw.transform(n)+", "+Tp(Ep.transform(r))+")"};function _Ae(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 $3={test:wA("#"),parse:_Ae,transform:Ec.transform},yd={test:wA("hsl","hue"),parse:jU("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+bs.transform(Tp(t))+", "+bs.transform(Tp(n))+", "+Tp(Ep.transform(r))+")"},Mr={test:e=>Ec.test(e)||$3.test(e)||yd.test(e),parse:e=>Ec.test(e)?Ec.parse(e):yd.test(e)?yd.parse(e):$3.parse(e),transform:e=>Ym(e)?e:e.hasOwnProperty("red")?Ec.transform(e):yd.transform(e)},Wt=(e,t,n)=>-n*e+n*t+e;function Gw(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 SAe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Gw(l,a,e+1/3),o=Gw(l,a,e),s=Gw(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}const Hw=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},xAe=[$3,Ec,yd],wAe=e=>xAe.find(t=>t.test(e));function h9(e){const t=wAe(e);let n=t.parse(e);return t===yd&&(n=SAe(n)),n}const VU=(e,t)=>{const n=h9(e),r=h9(t),i={...n};return o=>(i.red=Hw(n.red,r.red,o),i.green=Hw(n.green,r.green,o),i.blue=Hw(n.blue,r.blue,o),i.alpha=Wt(n.alpha,r.alpha,o),Ec.transform(i))};function CAe(e){var t,n;return isNaN(e)&&Ym(e)&&(((t=e.match($S))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(pU))===null||n===void 0?void 0:n.length)||0)>0}const UU={regex:yTe,countKey:"Vars",token:"${v}",parse:tn},GU={regex:pU,countKey:"Colors",token:"${c}",parse:Mr.parse},HU={regex:$S,countKey:"Numbers",token:"${n}",parse:fu.parse};function Ww(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 Y1(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ww(n,UU),Ww(n,GU),Ww(n,HU),n}function WU(e){return Y1(e).values}function qU(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Y1(e),o=t.length;return s=>{let a=i;for(let l=0;l<o;l++)l<r?a=a.replace(UU.token,s[l]):l<r+n?a=a.replace(GU.token,Mr.transform(s[l])):a=a.replace(HU.token,Tp(s[l]));return a}}const EAe=e=>typeof e=="number"?0:e;function TAe(e){const t=WU(e);return qU(e)(t.map(EAe))}const Tl={test:CAe,parse:WU,createTransformer:qU,getAnimatableNone:TAe},KU=(e,t)=>n=>`${n>0?t:e}`;function XU(e,t){return typeof e=="number"?n=>Wt(e,t,n):Mr.test(e)?VU(e,t):e.startsWith("var(")?KU(e,t):YU(e,t)}const QU=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,s)=>XU(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}},AAe=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=XU(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},YU=(e,t)=>{const n=Tl.createTransformer(t),r=Y1(e),i=Y1(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?hl(QU(r.values,i.values),n):KU(e,t)},Vg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},p9=(e,t)=>n=>Wt(e,t,n);function kAe(e){return typeof e=="number"?p9:typeof e=="string"?Mr.test(e)?VU:YU:Array.isArray(e)?QU:typeof e=="object"?AAe:p9}function PAe(e,t,n){const r=[],i=n||kAe(e[0]),o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||tn:t;a=hl(l,a)}r.push(a)}return r}function ZU(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(_A(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=PAe(t,r,i),a=s.length,l=c=>{let u=0;if(a>1)for(;u<e.length-2&&!(c<e[u+1]);u++);const d=Vg(e[u],e[u+1],c);return s[u](d)};return n?c=>l(El(e[0],e[o-1],c)):l}function IAe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Vg(0,t,r);e.push(Wt(n,1,i))}}function MAe(e){const t=[0];return IAe(t,e.length-1),t}function RAe(e,t){return e.map(n=>n*t)}function OAe(e,t){return e.map(()=>t||FU).splice(0,e.length-1)}function Z1({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=pAe(r)?r.map(f9):f9(r),o={done:!1,value:t[0]},s=RAe(n&&n.length===t.length?n:MAe(t),e),a=ZU(s,t,{ease:Array.isArray(i)?i:OAe(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}function JU(e,t){return t?e*(1e3/t):0}const $Ae=5;function eG(e,t,n){const r=Math.max(t-$Ae,0);return JU(n-e(r),t-r)}const qw=.001,NAe=.01,g9=10,FAe=.05,DAe=1;function LAe({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;oAe(e<=pl(g9));let s=1-t;s=El(FAe,DAe,s),e=El(NAe,g9,ra(e)),s<1?(i=c=>{const u=c*s,d=u*e,f=u-n,h=N3(c,s),p=Math.exp(-d);return qw-f/h*p},o=c=>{const d=c*s*e,f=d*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=N3(Math.pow(c,2),s);return(-i(c)+qw>0?-1:1)*((f-h)*p)/m}):(i=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-qw+u*d},o=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=zAe(i,o,a);if(e=pl(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const BAe=12;function zAe(e,t,n){let r=n;for(let i=1;i<BAe;i++)r=r-e(r)/t(r);return r}function N3(e,t){return e*Math.sqrt(1-t*t)}const jAe=["duration","bounce"],VAe=["stiffness","damping","mass"];function m9(e,t){return t.some(n=>e[n]!==void 0)}function UAe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!m9(e,VAe)&&m9(e,jAe)){const n=LAe(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function tG({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=UAe(r),h=u?-ra(u):0,p=l/(2*Math.sqrt(a*c)),m=o-i,_=ra(Math.sqrt(a/c)),v=Math.abs(m)<5;n||(n=v?.01:2),t||(t=v?.005:.5);let y;if(p<1){const g=N3(_,p);y=b=>{const S=Math.exp(-p*_*b);return o-S*((h+p*_*m)/g*Math.sin(g*b)+m*Math.cos(g*b))}}else if(p===1)y=g=>o-Math.exp(-_*g)*(m+(h+_*m)*g);else{const g=_*Math.sqrt(p*p-1);y=b=>{const S=Math.exp(-p*_*b),w=Math.min(g*b,300);return o-S*((h+p*_*m)*Math.sinh(w)+g*m*Math.cosh(w))/g}}return{calculatedDuration:f&&d||null,next:g=>{const b=y(g);if(f)s.done=g>=d;else{let S=h;g!==0&&(p<1?S=eG(y,g,b):S=0);const w=Math.abs(S)<=n,C=Math.abs(o-b)<=t;s.done=w&&C}return s.value=s.done?o:b,s}}}function y9({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=x=>a!==void 0&&x<a||l!==void 0&&x>l,p=x=>a===void 0?l:l===void 0||Math.abs(a-x)<Math.abs(l-x)?a:l;let m=n*t;const _=d+m,v=s===void 0?_:s(_);v!==_&&(m=v-d);const y=x=>-m*Math.exp(-x/r),g=x=>v+y(x),b=x=>{const k=y(x),A=g(x);f.done=Math.abs(k)<=c,f.value=f.done?v:A};let S,w;const C=x=>{h(f.value)&&(S=x,w=tG({keyframes:[f.value,p(f.value)],velocity:eG(g,x,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:x=>{let k=!1;return!w&&S===void 0&&(k=!0,b(x),C(x)),S!==void 0&&x>S?w.next(x-S):(!k&&b(x),f)}}}const GAe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Pt.update(t,!0),stop:()=>pa(t),now:()=>$n.isProcessing?$n.timestamp:performance.now()}},v9=2e4;function b9(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<v9;)t+=n,r=e.next(t);return t>=v9?1/0:t}const HAe={decay:y9,inertia:y9,tween:Z1,keyframes:Z1,spring:tG};function J1({autoplay:e=!0,delay:t=0,driver:n=GAe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...f}){let h=1,p=!1,m,_;const v=()=>{_=new Promise(z=>{m=z})};v();let y;const g=HAe[i]||Z1;let b;g!==Z1&&typeof r[0]!="number"&&(b=ZU([0,100],r,{clamp:!1}),r=[0,100]);const S=g({...f,keyframes:r});let w;a==="mirror"&&(w=g({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let C="idle",x=null,k=null,A=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=b9(S));const{calculatedDuration:R}=S;let L=1/0,M=1/0;R!==null&&(L=R+s,M=L*(o+1)-s);let E=0;const P=z=>{if(k===null)return;h>0&&(k=Math.min(k,z)),h<0&&(k=Math.min(z-M/h,k)),x!==null?E=x:E=Math.round(z-k)*h;const V=E-t*(h>=0?1:-1),H=h>=0?V<0:V>M;E=Math.max(V,0),C==="finished"&&x===null&&(E=M);let X=E,te=S;if(o){const Z=E/L;let oe=Math.floor(Z),be=Z%1;!be&&Z>=1&&(be=1),be===1&&oe--,oe=Math.min(oe,o+1);const Me=!!(oe%2);Me&&(a==="reverse"?(be=1-be,s&&(be-=s/L)):a==="mirror"&&(te=w));let lt=El(0,1,be);E>M&&(lt=a==="reverse"&&Me?1:0),X=lt*L}const ee=H?{done:!1,value:r[0]}:te.next(X);b&&(ee.value=b(ee.value));let{done:j}=ee;!H&&R!==null&&(j=h>=0?E>=M:E<=0);const q=x===null&&(C==="finished"||C==="running"&&j);return d&&d(ee.value),q&&$(),ee},O=()=>{y&&y.stop(),y=void 0},F=()=>{C="idle",O(),m(),v(),k=A=null},$=()=>{C="finished",u&&u(),O(),m()},D=()=>{if(p)return;y||(y=n(P));const z=y.now();l&&l(),x!==null?k=z-x:(!k||C==="finished")&&(k=z),C==="finished"&&v(),A=k,x=null,C="running",y.start()};e&&D();const N={then(z,V){return _.then(z,V)},get time(){return ra(E)},set time(z){z=pl(z),E=z,x!==null||!y||h===0?x=z:k=y.now()-z/h},get duration(){const z=S.calculatedDuration===null?b9(S):S.calculatedDuration;return ra(z)},get speed(){return h},set speed(z){z===h||!y||(h=z,N.time=ra(E))},get state(){return C},play:D,pause:()=>{C="paused",x=E},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),F())},cancel:()=>{A!==null&&P(A),F()},complete:()=>{C="finished"},sample:z=>(k=0,P(z))};return N}function WAe(e){let t;return()=>(t===void 0&&(t=e()),t)}const qAe=WAe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),KAe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),py=10,XAe=2e4,QAe=(e,t)=>t.type==="spring"||e==="backgroundColor"||!RU(t.ease);function YAe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(qAe()&&KAe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let s=!1,a,l;const c=()=>{l=new Promise(y=>{a=y})};c();let{keyframes:u,duration:d=300,ease:f,times:h}=i;if(QAe(t,i)){const y=J1({...i,repeat:0,delay:0});let g={done:!1,value:u[0]};const b=[];let S=0;for(;!g.done&&S<XAe;)g=y.sample(S),b.push(g.value),S+=py;h=void 0,u=b,d=S-py,f="linear"}const p=aAe(e.owner.current,t,u,{...i,duration:d,ease:f,times:h});i.syncStart&&(p.startTime=$n.isProcessing?$n.timestamp:document.timeline?document.timeline.currentTime:performance.now());const m=()=>p.cancel(),_=()=>{Pt.update(m),a(),c()};return p.onfinish=()=>{e.set(lAe(u,i)),r&&r(),_()},{then(y,g){return l.then(y,g)},attachTimeline(y){return p.timeline=y,p.onfinish=null,tn},get time(){return ra(p.currentTime||0)},set time(y){p.currentTime=pl(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return ra(d)},play:()=>{s||(p.play(),pa(m))},pause:()=>p.pause(),stop:()=>{if(s=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const g=J1({...i,autoplay:!1});e.setWithVelocity(g.sample(y-py).value,g.sample(y).value,py)}_()},complete:()=>p.finish(),cancel:_}}function ZAe({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:tn,pause:tn,stop:tn,then:o=>(o(),Promise.resolve()),cancel:tn,complete:tn});return t?J1({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const JAe={type:"spring",stiffness:500,damping:25,restSpeed:10},eke=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tke={type:"keyframes",duration:.8},nke={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rke=(e,{keyframes:t})=>t.length>2?tke:du.has(e)?e.startsWith("scale")?eke(t[1]):JAe:nke,F3=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Tl.test(t)||t==="0")&&!t.startsWith("url(")),ike=new Set(["brightness","contrast","saturate","opacity"]);function oke(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($S)||[];if(!r)return e;const i=n.replace(r,"");let o=ike.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const ske=/([a-z-]*)\(.*?\)/g,D3={...Tl,getAnimatableNone:e=>{const t=e.match(ske);return t?t.map(oke).join(" "):e}},ake={...gU,color:Mr,backgroundColor:Mr,outlineColor:Mr,fill:Mr,stroke:Mr,borderColor:Mr,borderTopColor:Mr,borderRightColor:Mr,borderBottomColor:Mr,borderLeftColor:Mr,filter:D3,WebkitFilter:D3},CA=e=>ake[e];function nG(e,t){let n=CA(e);return n!==D3&&(n=Tl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const rG=e=>/^0[^.\s]+$/.test(e);function lke(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||rG(e)}function cke(e,t,n,r){const i=F3(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const s=r.from!==void 0?r.from:e.get();let a;const l=[];for(let c=0;c<o.length;c++)o[c]===null&&(o[c]=c===0?s:o[c-1]),lke(o[c])&&l.push(c),typeof o[c]=="string"&&o[c]!=="none"&&o[c]!=="0"&&(a=o[c]);if(i&&l.length&&a)for(let c=0;c<l.length;c++){const u=l[c];o[u]=nG(t,a)}return o}function uke({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}function EA(e,t){return e[t]||e.default||e}const TA=(e,t,n,r={})=>i=>{const o=EA(r,e)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a=a-pl(s);const l=cke(t,e,n,o),c=l[0],u=l[l.length-1],d=F3(e,c),f=F3(e,u);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(uke(o)||(h={...h,...rke(e,h)}),h.duration&&(h.duration=pl(h.duration)),h.repeatDelay&&(h.repeatDelay=pl(h.repeatDelay)),!d||!f||sAe.current||o.type===!1)return ZAe(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=YAe(t,e,h);if(p)return p}return J1(h)};function eb(e){return!!(ri(e)&&e.add)}const iG=e=>/^\-?\d*\.?\d+$/.test(e);function AA(e,t){e.indexOf(t)===-1&&e.push(t)}function kA(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class PA{constructor(){this.subscriptions=[]}add(t){return AA(this.subscriptions,t),()=>kA(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const dke=e=>!isNaN(parseFloat(e));class fke{constructor(t,n={}){this.version="10.16.15",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:s}=$n;this.lastUpdated!==s&&(this.timeDelta=o,this.lastUpdated=s,Pt.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=()=>Pt.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=dke(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new PA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Pt.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?JU(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 _f(e,t){return new fke(e,t)}const oG=e=>t=>t.test(e),hke={test:e=>e==="auto",parse:e=>e},sG=[fu,Pe,bs,Na,STe,_Te,hke],Ch=e=>sG.find(oG(e)),pke=[...sG,Mr,Tl],gke=e=>pke.find(oG(e));function mke(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_f(n))}function yke(e,t){const n=FS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const s in o){const a=NTe(o[s]);mke(e,s,a)}}function vke(e,t,n){var r,i;const o=Object.keys(t).filter(a=>!e.hasValue(a)),s=o.length;if(s)for(let a=0;a<s;a++){const l=o[a],c=t[l];let u=null;Array.isArray(c)&&(u=c[0]),u===null&&(u=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),u!=null&&(typeof u=="string"&&(iG(u)||rG(u))?u=parseFloat(u):!gke(u)&&Tl.test(c)&&(u=nG(l,c)),e.addValue(l,_f(u,{owner:e})),n[l]===void 0&&(n[l]=u),u!==null&&e.setBaseTarget(l,u))}}function bke(e,t){return t?(t[e]||t.default||t).from:void 0}function _ke(e,t,n){const r={};for(const i in e){const o=bke(i,t);if(o!==void 0)r[i]=o;else{const s=n.getValue(i);s&&(r[i]=s.get())}}return r}function Ske({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function xke(e,t){const n=e.get();if(Array.isArray(t)){for(let r=0;r<t.length;r++)if(t[r]!==n)return!0}else return n!==t}function aG(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const f=e.getValue(d),h=a[d];if(!f||h===void 0||u&&Ske(u,d))continue;const p={delay:n,elapsed:0,...EA(o||{},d)};let m=!0;if(window.HandoffAppearAnimations&&!f.hasAnimated){const y=e.getProps()[lU];if(y){const g=window.HandoffAppearAnimations(y,d,f,Pt);g&&(m=!1,p.elapsed=g,p.syncStart=!0)}}let _=m&&!xke(f,h);if(p.type==="spring"&&(f.getVelocity()||p.velocity)&&(_=!1),f.animation&&(_=!1),_)continue;f.start(TA(d,f,h,e.shouldReduceMotion&&du.has(d)?{type:!1}:p));const v=f.animation;eb(l)&&(l.add(d),v.then(()=>l.remove(d))),c.push(v)}return s&&Promise.all(c).then(()=>{s&&yke(e,s)}),c}function L3(e,t,n={}){const r=FS(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(aG(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=i;return wke(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,c]=a==="beforeChildren"?[o,s]:[s,o];return l().then(()=>c())}else return Promise.all([o(),s(n.delay)])}function wke(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(Cke).forEach((c,u)=>{c.notify("AnimationStart",t),s.push(L3(c,t,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function Cke(e,t){return e.sortNodePosition(t)}function Eke(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>L3(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=L3(e,t,n);else{const i=typeof t=="function"?FS(e,t,n.custom):t;r=Promise.all(aG(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const Tke=[...uA].reverse(),Ake=uA.length;function kke(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Eke(e,n,r)))}function Pke(e){let t=kke(e);const n=Mke();let r=!0;const i=(l,c)=>{const u=FS(e,c);if(u){const{transition:d,transitionEnd:f,...h}=u;l={...l,...h,...f}}return l};function o(l){t=l(e)}function s(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},m=1/0;for(let v=0;v<Ake;v++){const y=Tke[v],g=n[y],b=u[y]!==void 0?u[y]:d[y],S=zg(b),w=y===c?g.isActive:null;w===!1&&(m=v);let C=b===d[y]&&b!==u[y]&&S;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),g.protectedKeys={...p},!g.isActive&&w===null||!b&&!g.prevProp||RS(b)||typeof b=="boolean")continue;const x=Ike(g.prevProp,b);let k=x||y===c&&g.isActive&&!C&&S||v>m&&S;const A=Array.isArray(b)?b:[b];let R=A.reduce(i,{});w===!1&&(R={});const{prevResolvedValues:L={}}=g,M={...L,...R},E=P=>{k=!0,h.delete(P),g.needsAnimating[P]=!0};for(const P in M){const O=R[P],F=L[P];p.hasOwnProperty(P)||(O!==F?Q1(O)&&Q1(F)?!IU(O,F)||x?E(P):g.protectedKeys[P]=!0:O!==void 0?E(P):h.add(P):O!==void 0&&h.has(P)?E(P):g.protectedKeys[P]=!0)}g.prevProp=b,g.prevResolvedValues=R,g.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(k=!1),k&&!C&&f.push(...A.map(P=>({animation:P,options:{type:y,...l}})))}if(h.size){const v={};h.forEach(y=>{const g=e.getBaseTarget(y);g!==void 0&&(v[y]=g)}),f.push({animation:v})}let _=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(f):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)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,c)}),n[l].isActive=c;const f=s(u,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n}}function Ike(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!IU(t,e):!1}function Zl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Mke(){return{animate:Zl(!0),whileInView:Zl(),whileHover:Zl(),whileTap:Zl(),whileDrag:Zl(),whileFocus:Zl(),exit:Zl()}}class Rke extends Ll{constructor(t){super(t),t.animationState||(t.animationState=Pke(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),RS(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 Oke=0;class $ke extends Ll{constructor(){super(...arguments),this.id=Oke++}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 Nke={animation:{Feature:Rke},exit:{Feature:$ke}},_9=(e,t)=>Math.abs(e-t);function Fke(e,t){const n=_9(e.x,t.x),r=_9(e.y,t.y);return Math.sqrt(n**2+r**2)}class lG{constructor(t,n,{transformPagePoint:r,contextWindow:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Xw(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=Fke(u.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:h}=u,{timestamp:p}=$n;this.history.push({...h,timestamp:p});const{onStart:m,onMove:_}=this.handlers;d||(m&&m(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Kw(d,this.transformPagePoint),Pt.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:h}=this.handlers,p=Xw(u.type==="pointercancel"?this.lastMoveEventInfo:Kw(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,p),h&&h(u,p)},!EU(t))return;this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=NS(t),s=Kw(o,this.transformPagePoint),{point:a}=s,{timestamp:l}=$n;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,Xw(s,this.history)),this.removeListeners=hl(na(this.contextWindow,"pointermove",this.handlePointerMove),na(this.contextWindow,"pointerup",this.handlePointerUp),na(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pa(this.updatePoint)}}function Kw(e,t){return t?{point:t(e.point)}:e}function S9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xw({point:e},t){return{point:e,delta:S9(e,cG(t)),offset:S9(e,Dke(t)),velocity:Lke(t,.1)}}function Dke(e){return e[0]}function cG(e){return e[e.length-1]}function Lke(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=cG(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>pl(t)));)n--;if(!r)return{x:0,y:0};const o=ra(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ai(e){return e.max-e.min}function B3(e,t=0,n=.01){return Math.abs(e-t)<=n}function x9(e,t,n,r=.5){e.origin=r,e.originPoint=Wt(t.min,t.max,e.origin),e.scale=Ai(n)/Ai(t),(B3(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Wt(n.min,n.max,e.origin)-e.originPoint,(B3(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Ap(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 w9(e,t,n){e.min=n.min+t.min,e.max=e.min+Ai(t)}function Bke(e,t,n){w9(e.x,t.x,n.x),w9(e.y,t.y,n.y)}function C9(e,t,n){e.min=t.min-n.min,e.max=e.min+Ai(t)}function kp(e,t,n){C9(e.x,t.x,n.x),C9(e.y,t.y,n.y)}function zke(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Wt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Wt(n,e,r.max):Math.min(e,n)),e}function E9(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 jke(e,{top:t,left:n,bottom:r,right:i}){return{x:E9(e.x,n,i),y:E9(e.y,t,r)}}function T9(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 Vke(e,t){return{x:T9(e.x,t.x),y:T9(e.y,t.y)}}function Uke(e,t){let n=.5;const r=Ai(e),i=Ai(t);return i>r?n=Vg(t.min,t.max-r,e.min):r>i&&(n=Vg(e.min,e.max-i,t.min)),El(0,1,n)}function Gke(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 z3=.35;function Hke(e=z3){return e===!1?e=0:e===!0&&(e=z3),{x:A9(e,"left","right"),y:A9(e,"top","bottom")}}function A9(e,t,n){return{min:k9(e,t),max:k9(e,n)}}function k9(e,t){return typeof e=="number"?e:e[t]||0}const P9=()=>({translate:0,scale:1,origin:0,originPoint:0}),vd=()=>({x:P9(),y:P9()}),I9=()=>({min:0,max:0}),gn=()=>({x:I9(),y:I9()});function Yo(e){return[e("x"),e("y")]}function uG({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wke({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qke(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 Qw(e){return e===void 0||e===1}function j3({scale:e,scaleX:t,scaleY:n}){return!Qw(e)||!Qw(t)||!Qw(n)}function cc(e){return j3(e)||dG(e)||e.z||e.rotate||e.rotateX||e.rotateY}function dG(e){return M9(e.x)||M9(e.y)}function M9(e){return e&&e!=="0%"}function tb(e,t,n){const r=e-n,i=t*r;return n+i}function R9(e,t,n,r,i){return i!==void 0&&(e=tb(e,i,r)),tb(e,n,r)+t}function V3(e,t=0,n=1,r,i){e.min=R9(e.min,t,n,r,i),e.max=R9(e.max,t,n,r,i)}function fG(e,{x:t,y:n}){V3(e.x,t.translate,t.scale,t.originPoint),V3(e.y,n.translate,n.scale,n.originPoint)}function Kke(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&bd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,fG(e,s)),r&&cc(o.latestValues)&&bd(e,o.latestValues))}t.x=O9(t.x),t.y=O9(t.y)}function O9(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Va(e,t){e.min=e.min+t,e.max=e.max+t}function $9(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,s=Wt(e.min,e.max,o);V3(e,t[n],t[r],s,t.scale)}const Xke=["x","scaleX","originX"],Qke=["y","scaleY","originY"];function bd(e,t){$9(e.x,t,Xke),$9(e.y,t,Qke)}function hG(e,t){return uG(qke(e.getBoundingClientRect(),t))}function Yke(e,t,n){const r=hG(e,n),{scroll:i}=t;return i&&(Va(r.x,i.offset.x),Va(r.y,i.offset.y)),r}const pG=({current:e})=>e?e.ownerDocument.defaultView:null,Zke=new WeakMap;class Jke{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=gn(),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(NS(l,"page").point)},o=(l,c)=>{const{drag:u,dragPropagation:d,onDragStart:f}=this.getProps();if(u&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=AU(u),!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),Yo(p=>{let m=this.getAxisMotionValue(p).get()||0;if(bs.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const v=_.layout.layoutBox[p];v&&(m=Ai(v)*(parseFloat(m)/100))}}this.originPoint[p]=m}),f&&Pt.update(()=>f(l,c),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},s=(l,c)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:p}=c;if(d&&this.currentDirection===null){this.currentDirection=ePe(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",c.point,p),this.updateAxis("y",c.point,p),this.visualElement.render(),h&&h(l,c)},a=(l,c)=>this.stop(l,c);this.panSession=new lG(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),contextWindow:pG(this.visualElement)})}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&&Pt.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||!gy(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=zke(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&md(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=jke(i.layoutBox,n):this.constraints=!1,this.elastic=Hke(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Yo(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=Gke(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!md(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Yke(r,i.root,this.visualElement.getTransformPagePoint());let s=Vke(i.layout.layoutBox,o);if(n){const a=n(Wke(s));this.hasMutatedConstraints=!!a,a&&(s=uG(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Yo(u=>{if(!gy(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(TA(t,r,0,n))}stopAnimation(){Yo(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){Yo(n=>{const{drag:r}=this.getProps();if(!gy(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-Wt(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!md(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Yo(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();i[s]=Uke({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yo(s=>{if(!gy(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Wt(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;Zke.set(this.visualElement,this);const t=this.visualElement.current,n=na(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();md(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const s=Ys(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Yo(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=z3,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function gy(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ePe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tPe extends Ll{constructor(t){super(t),this.removeGroupControls=tn,this.removeListeners=tn,this.controls=new Jke(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tn}unmount(){this.removeGroupControls(),this.removeListeners()}}const N9=e=>(t,n)=>{e&&Pt.update(()=>e(t,n))};class nPe extends Ll{constructor(){super(...arguments),this.removePointerDownListener=tn}onPointerDown(t){this.session=new lG(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pG(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:N9(t),onStart:N9(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Pt.update(()=>i(o,s))}}}mount(){this.removePointerDownListener=na(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 rPe(){const e=I.useContext(Xm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=I.useId();return I.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function iPe(){return oPe(I.useContext(Xm))}function oPe(e){return e===null?!0:e.isPresent}const _v={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function F9(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Eh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pe.test(e))e=parseFloat(e);else return e;const n=F9(e,t.target.x),r=F9(e,t.target.y);return`${n}% ${r}%`}},sPe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Tl.parse(e);if(i.length>5)return r;const o=Tl.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=Wt(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};class aPe extends Q.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;hTe(lPe),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()})),_v.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Pt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function gG(e){const[t,n]=rPe(),r=I.useContext(fA);return Q.createElement(aPe,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(uU),isPresent:t,safeToRemove:n})}const lPe={borderRadius:{...Eh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Eh,borderTopRightRadius:Eh,borderBottomLeftRadius:Eh,borderBottomRightRadius:Eh,boxShadow:sPe},mG=["TopLeft","TopRight","BottomLeft","BottomRight"],cPe=mG.length,D9=e=>typeof e=="string"?parseFloat(e):e,L9=e=>typeof e=="number"||Pe.test(e);function uPe(e,t,n,r,i,o){i?(e.opacity=Wt(0,n.opacity!==void 0?n.opacity:1,dPe(r)),e.opacityExit=Wt(t.opacity!==void 0?t.opacity:1,0,fPe(r))):o&&(e.opacity=Wt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<cPe;s++){const a=`border${mG[s]}Radius`;let l=B9(t,a),c=B9(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||L9(l)===L9(c)?(e[a]=Math.max(Wt(D9(l),D9(c),r),0),(bs.test(c)||bs.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Wt(t.rotate||0,n.rotate||0,r))}function B9(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const dPe=yG(0,.5,SA),fPe=yG(.5,.95,tn);function yG(e,t,n){return r=>r<e?0:r>t?1:n(Vg(e,t,r))}function z9(e,t){e.min=t.min,e.max=t.max}function Li(e,t){z9(e.x,t.x),z9(e.y,t.y)}function j9(e,t,n,r,i){return e-=t,e=tb(e,1/n,r),i!==void 0&&(e=tb(e,1/i,r)),e}function hPe(e,t=0,n=1,r=.5,i,o=e,s=e){if(bs.test(t)&&(t=parseFloat(t),t=Wt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Wt(o.min,o.max,r);e===o&&(a-=t),e.min=j9(e.min,t,n,a,i),e.max=j9(e.max,t,n,a,i)}function V9(e,t,[n,r,i],o,s){hPe(e,t[n],t[r],t[i],t.scale,o,s)}const pPe=["x","scaleX","originX"],gPe=["y","scaleY","originY"];function U9(e,t,n,r){V9(e.x,t,pPe,n?n.x:void 0,r?r.x:void 0),V9(e.y,t,gPe,n?n.y:void 0,r?r.y:void 0)}function G9(e){return e.translate===0&&e.scale===1}function vG(e){return G9(e.x)&&G9(e.y)}function mPe(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 bG(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 H9(e){return Ai(e.x)/Ai(e.y)}class yPe{constructor(){this.members=[]}add(t){AA(this.members,t),t.scheduleRender()}remove(t){if(kA(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 W9(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:c,rotateY:u}=n;l&&(r+=`rotate(${l}deg) `),c&&(r+=`rotateX(${c}deg) `),u&&(r+=`rotateY(${u}deg) `)}const s=e.x.scale*t.x,a=e.y.scale*t.y;return(s!==1||a!==1)&&(r+=`scale(${s}, ${a})`),r||"none"}const vPe=(e,t)=>e.depth-t.depth;class bPe{constructor(){this.children=[],this.isDirty=!1}add(t){AA(this.children,t),this.isDirty=!0}remove(t){kA(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(vPe),this.isDirty=!1,this.children.forEach(t)}}function _Pe(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(pa(r),e(o-t))};return Pt.read(r,!0),()=>pa(r)}function SPe(e){window.MotionDebug&&window.MotionDebug.record(e)}function xPe(e){return e instanceof SVGElement&&e.tagName!=="svg"}function wPe(e,t,n){const r=ri(e)?e:_f(e);return r.start(TA("",r,t,n)),r.animation}const q9=["","X","Y","Z"],CPe={visibility:"hidden"},K9=1e3;let EPe=0;const uc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function _G({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=EPe++,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.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,uc.totalNodes=uc.resolvedTargetDeltas=uc.recalculatedProjection=0,this.nodes.forEach(kPe),this.nodes.forEach(OPe),this.nodes.forEach($Pe),this.nodes.forEach(PPe),SPe(uc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new bPe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new PA),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=xPe(s),this.instance=s;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=_Pe(f,250),_v.hasAnimatedSinceResize&&(_v.hasAnimatedSinceResize=!1,this.nodes.forEach(Q9))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||BPe,{onLayoutAnimationStart:_,onLayoutAnimationComplete:v}=u.getProps(),y=!this.targetLayout||!bG(this.targetLayout,p)||h,g=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const b={...EA(m,"layout"),onPlay:_,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||Q9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pa(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(NPe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(X9);return}this.isUpdating||this.nodes.forEach(MPe),this.isUpdating=!1,this.nodes.forEach(RPe),this.nodes.forEach(TPe),this.nodes.forEach(APe),this.clearAllSnapshots();const a=performance.now();$n.delta=El(0,1e3/60,a-$n.timestamp),$n.timestamp=a,$n.isProcessing=!0,zw.update.process($n),zw.preRender.process($n),zw.render.process($n),$n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(IPe),this.sharedNodes.forEach(FPe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=gn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:s,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!vG(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&(a||cc(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),zPe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return gn();const a=s.measureViewportBox(),{scroll:l}=this.root;return l&&(Va(a.x,l.offset.x),Va(a.y,l.offset.y)),a}removeElementScroll(s){const a=gn();Li(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:d}=c;if(c!==this.root&&u&&d.layoutScroll){if(u.isRoot){Li(a,s);const{scroll:f}=this.root;f&&(Va(a.x,-f.offset.x),Va(a.y,-f.offset.y))}Va(a.x,u.offset.x),Va(a.y,u.offset.y)}}return a}applyTransform(s,a=!1){const l=gn();Li(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&bd(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),cc(u.latestValues)&&bd(l,u.latestValues)}return cc(this.latestValues)&&bd(l,this.latestValues),l}removeTransform(s){const a=gn();Li(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!cc(c.latestValues))continue;j3(c.latestValues)&&c.updateSnapshot();const u=gn(),d=c.measurePageBox();Li(u,d),U9(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return cc(this.latestValues)&&U9(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==$n.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=$n.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gn(),this.relativeTargetOrigin=gn(),kp(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=gn(),this.targetWithTransforms=gn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bke(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Li(this.target,this.layout.layoutBox),fG(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=gn(),this.relativeTargetOrigin=gn(),kp(this.relativeTargetOrigin,this.target,h.target),Li(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}uc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||j3(this.parent.latestValues)||dG(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===$n.timestamp&&(c=!1),c)return;const{layout:u,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||!(u||d))return;Li(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Kke(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox);const{target:p}=a;if(!p){this.projectionTransform&&(this.projectionDelta=vd(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=vd(),this.projectionDeltaWithTransform=vd());const m=this.projectionTransform;Ap(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=W9(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),uc.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=vd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=gn(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,_=this.getStack(),v=!_||_.members.length<=1,y=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(LPe));this.animationProgress=0;let g;this.mixTargetDelta=b=>{const S=b/1e3;Y9(d.x,s.x,S),Y9(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kp(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),DPe(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&mPe(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=gn()),Li(g,this.relativeTarget)),m&&(this.animationValues=u,uPe(u,c,this.latestValues,S,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{_v.hasAnimatedSinceResize=!0,this.currentAnimation=wPe(0,K9,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(K9),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&SG(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||gn();const d=Ai(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Ai(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Li(a,l),bd(a,u),Ap(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new yPe),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u<q9.length;u++){const d="rotate"+q9[u];l[d]&&(c[d]=l[d],s.setStaticValue(d,0))}s.render();for(const u in c)s.setStaticValue(u,c[u]);s.scheduleRender()}getProjectionStyles(s){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return CPe;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=bv(s==null?void 0:s.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=bv(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!cc(this.latestValues)&&(m.transform=u?u({},""):"none",this.hasProjected=!1),m}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=W9(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:h,y:p}=this.projectionDelta;c.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in K1){if(f[m]===void 0)continue;const{correct:_,applyTo:v}=K1[m],y=c.transform==="none"?f[m]:_(f[m],d);if(v){const g=v.length;for(let b=0;b<g;b++)c[v[b]]=y}else c[m]=y}return this.options.layoutId&&(c.pointerEvents=d===this?bv(s==null?void 0:s.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(X9),this.root.sharedNodes.clear()}}}function TPe(e){e.updateLayout()}function APe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Yo(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=Ai(f);f.min=r[d].min,f.max=f.min+h}):SG(o,n.layoutBox,r)&&Yo(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=Ai(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=vd();Ap(a,r,n.layoutBox);const l=vd();s?Ap(l,e.applyTransform(i,!0),n.measuredBox):Ap(l,r,n.layoutBox);const c=!vG(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=gn();kp(p,n.layoutBox,f.layoutBox);const m=gn();kp(m,r,h.layoutBox),bG(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function kPe(e){uc.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 PPe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IPe(e){e.clearSnapshot()}function X9(e){e.clearMeasurements()}function MPe(e){e.isLayoutDirty=!1}function RPe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Q9(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function OPe(e){e.resolveTargetDelta()}function $Pe(e){e.calcProjection()}function NPe(e){e.resetRotation()}function FPe(e){e.removeLeadSnapshot()}function Y9(e,t,n){e.translate=Wt(t.translate,0,n),e.scale=Wt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Z9(e,t,n,r){e.min=Wt(t.min,n.min,r),e.max=Wt(t.max,n.max,r)}function DPe(e,t,n,r){Z9(e.x,t.x,n.x,r),Z9(e.y,t.y,n.y,r)}function LPe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const BPe={duration:.45,ease:[.4,0,.1,1]},J9=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),eR=J9("applewebkit/")&&!J9("chrome/")?Math.round:tn;function tR(e){e.min=eR(e.min),e.max=eR(e.max)}function zPe(e){tR(e.x),tR(e.y)}function SG(e,t,n){return e==="position"||e==="preserve-aspect"&&!B3(H9(t),H9(n),.2)}const jPe=_G({attachResizeListener:(e,t)=>Ys(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Yw={current:void 0},xG=_G({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yw.current){const e=new jPe({});e.mount(window),e.setOptions({layoutScroll:!0}),Yw.current=e}return Yw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),VPe={pan:{Feature:nPe},drag:{Feature:tPe,ProjectionNode:xG,MeasureLayout:gG}},UPe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function GPe(e){const t=UPe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function U3(e,t,n=1){const[r,i]=GPe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return iG(s)?parseFloat(s):s}else return R3(i)?U3(i,t,n+1):i}function HPe(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(!R3(o))return;const s=U3(o,r);s&&i.set(s)});for(const i in t){const o=t[i];if(!R3(o))continue;const s=U3(o,r);s&&(t[i]=s,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const WPe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),wG=e=>WPe.has(e),qPe=e=>Object.keys(e).some(wG),nR=e=>e===fu||e===Pe,rR=(e,t)=>parseFloat(e.split(", ")[t]),iR=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return rR(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?rR(o[1],e):0}},KPe=new Set(["x","y","z"]),XPe=Qm.filter(e=>!KPe.has(e));function QPe(e){const t=[];return XPe.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 Sf={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:iR(4,13),y:iR(5,14)};Sf.translateX=Sf.x;Sf.translateY=Sf.y;const YPe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:s}=o,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Sf[c](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Sf[c](l,o)}),e},ZPe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(wG);let o=[],s=!1;const a=[];if(i.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ch(u);const f=t[l];let h;if(Q1(f)){const p=f.length,m=f[0]===null?1:0;u=f[m],d=Ch(u);for(let _=m;_<p&&f[_]!==null;_++)h?_A(Ch(f[_])===h):h=Ch(f[_])}else h=Ch(f);if(d!==h)if(nR(d)&&nR(h)){const p=c.get();typeof p=="string"&&c.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===Pe&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(u===0||f===0)?u===0?c.set(h.transform(u)):t[l]=d.transform(f):(s||(o=QPe(e),s=!0),a.push(l),r[l]=r[l]!==void 0?r[l]:t[l],c.jump(f))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,c=YPe(t,e,a);return o.length&&o.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),MS&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:r}}else return{target:t,transitionEnd:r}};function JPe(e,t,n,r){return qPe(t)?ZPe(e,t,n,r):{target:t,transitionEnd:r}}const e6e=(e,t,n,r)=>{const i=HPe(e,t,r);return t=i.target,r=i.transitionEnd,JPe(e,t,n,r)},G3={current:null},CG={current:!1};function t6e(){if(CG.current=!0,!!MS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>G3.current=e.matches;e.addListener(t),t()}else G3.current=!1}function n6e(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],s=n[i];if(ri(o))e.addValue(i,o),eb(r)&&r.add(i);else if(ri(s))e.addValue(i,_f(o,{owner:e})),eb(r)&&r.remove(i);else if(s!==o)if(e.hasValue(i)){const a=e.getValue(i);!a.hasAnimated&&a.set(o)}else{const a=e.getStaticValue(i);e.addValue(i,_f(a!==void 0?a:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const oR=new WeakMap,EG=Object.keys(jg),r6e=EG.length,sR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],i6e=dA.length;class o6e{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Pt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=OS(n),this.isVariantNode=cU(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const f=u[d];a[d]!==void 0&&ri(f)&&(f.set(a[d],!1),eb(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,oR.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)),CG.current||t6e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:G3.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){oR.delete(this.current),this.projection&&this.projection.unmount(),pa(this.notifyUpdate),pa(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=du.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Pt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o){let s,a;for(let l=0;l<r6e;l++){const c=EG[l],{isEnabled:u,Feature:d,ProjectionNode:f,MeasureLayout:h}=jg[c];f&&(s=f),u(n)&&(!this.features[c]&&d&&(this.features[c]=new d(this)),h&&(a=h))}if(!this.projection&&s){this.projection=new s(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:c,drag:u,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:c,alwaysMeasureLayout:!!u||d&&md(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gn()}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<sR.length;r++){const i=sR[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=n6e(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<i6e;r++){const i=dA[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=_f(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=bA(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ri(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 PA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class TG extends o6e{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let s=_ke(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),s&&(s=i(s))),o){vke(this,r,s);const a=e6e(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function s6e(e){return window.getComputedStyle(e)}class a6e extends TG{readValueFromInstance(t,n){if(du.has(n)){const r=CA(n);return r&&r.default||0}else{const r=s6e(t),i=(hU(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return hG(t,n)}build(t,n,r,i){pA(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return vA(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ri(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){bU(t,n,r,i)}}class l6e extends TG{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(du.has(n)){const r=CA(n);return r&&r.default||0}return n=_U.has(n)?n:cA(n),t.getAttribute(n)}measureInstanceViewportBox(){return gn()}scrapeMotionValuesFromProps(t,n){return xU(t,n)}build(t,n,r,i){mA(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){SU(t,n,r,i)}mount(t){this.isSVGTag=yA(t.tagName),super.mount(t)}}const c6e=(e,t)=>hA(e)?new l6e(t,{enableHardwareAcceleration:!1}):new a6e(t,{enableHardwareAcceleration:!0}),u6e={layout:{ProjectionNode:xG,MeasureLayout:gG}},d6e={...Nke,...nAe,...VPe,...u6e},AG=dTe((e,t)=>UTe(e,t,d6e,c6e));function kG(){const e=I.useRef(!1);return lA(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function f6e(){const e=kG(),[t,n]=I.useState(0),r=I.useCallback(()=>{e.current&&n(t+1)},[t]);return[I.useCallback(()=>Pt.postRender(r),[r]),t]}class h6e extends I.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 p6e({children:e,isPresent:t}){const n=I.useId(),r=I.useRef(null),i=I.useRef({width:0,height:0,top:0,left:0});return I.useInsertionEffect(()=>{const{width:o,height:s,top:a,left:l}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
[data-motion-pop-id="${n}"] {
position: absolute !important;
width: ${o}px !important;
height: ${s}px !important;
top: ${a}px !important;
left: ${l}px !important;
}
`),()=>{document.head.removeChild(c)}},[t]),I.createElement(h6e,{isPresent:t,childRef:r,sizeRef:i},I.cloneElement(e,{ref:r}))}const Zw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=wU(g6e),l=I.useId(),c=I.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;r&&r()},register:u=>(a.set(u,!1),()=>a.delete(u))}),o?void 0:[n]);return I.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),I.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=I.createElement(p6e,{isPresent:n},e)),I.createElement(Xm.Provider,{value:c},e)};function g6e(){return new Map}function m6e(e){return I.useEffect(()=>()=>e(),[])}const dc=e=>e.key||"";function y6e(e,t){e.forEach(n=>{const r=dc(n);t.set(r,n)})}function v6e(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const PG=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=I.useContext(fA).forceRender||f6e()[0],l=kG(),c=v6e(e);let u=c;const d=I.useRef(new Map).current,f=I.useRef(u),h=I.useRef(new Map).current,p=I.useRef(!0);if(lA(()=>{p.current=!1,y6e(c,h),f.current=u}),m6e(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return I.createElement(I.Fragment,null,u.map(y=>I.createElement(Zw,{key:dc(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:s},y)));u=[...u];const m=f.current.map(dc),_=c.map(dc),v=m.length;for(let y=0;y<v;y++){const g=m[y];_.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return s==="wait"&&d.size&&(u=[]),d.forEach((y,g)=>{if(_.indexOf(g)!==-1)return;const b=h.get(g);if(!b)return;const S=m.indexOf(g);let w=y;if(!w){const C=()=>{d.delete(g);const x=Array.from(h.keys()).filter(k=>!_.includes(k));if(x.forEach(k=>h.delete(k)),f.current=c.filter(k=>{const A=dc(k);return A===g||x.includes(A)}),!d.size){if(l.current===!1)return;a(),r&&r()}};w=I.createElement(Zw,{key:dc(b),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:o,mode:s},b),d.set(g,w)}u.splice(S,0,w)}),u=u.map(y=>{const g=y.key;return d.has(g)?y:I.createElement(Zw,{key:dc(y),isPresent:!0,presenceAffectsLayout:o,mode:s},y)}),I.createElement(I.Fragment,null,d.size?u:u.map(y=>I.cloneElement(y)))};var b6e={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]}}},IG=I.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:s="bottom",duration:a=5e3,containerStyle:l,motionVariants:c=b6e,toastSpacing:u="0.5rem"}=e,[d,f]=I.useState(a),h=iPe();n9(()=>{h||r==null||r()},[h]),n9(()=>{f(a)},[a]);const p=()=>f(null),m=()=>f(a),_=()=>{h&&i()};I.useEffect(()=>{h&&o&&i()},[h,o,i]),tTe(_,d);const v=I.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:u,...l}),[l,u]),y=I.useMemo(()=>Z4e(s),[s]);return ie.jsx(AG.div,{layout:!0,className:"chakra-toast",variants:c,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:s},style:y,children:ie.jsx(or.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:v,children:us(n,{id:t,onClose:_})})})});IG.displayName="ToastComponent";function _6e(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 aR={path:ie.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[ie.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"}),ie.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"}),ie.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},e0=Mi((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:s,className:a,__css:l,...c}=e,u=Dl("chakra-icon",a),d=Km("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},h={ref:t,focusable:o,className:u,__css:f},p=r??aR.viewBox;if(n&&typeof n!="string")return ie.jsx(or.svg,{as:n,...h,...c});const m=s??aR.path;return ie.jsx(or.svg,{verticalAlign:"middle",viewBox:p,...h,...c,children:m})});e0.displayName="Icon";function S6e(e){return ie.jsx(e0,{viewBox:"0 0 24 24",...e,children:ie.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 x6e(e){return ie.jsx(e0,{viewBox:"0 0 24 24",...e,children:ie.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 lR(e){return ie.jsx(e0,{viewBox:"0 0 24 24",...e,children:ie.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 w6e=FSe({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),IA=Mi((e,t)=>{const n=Km("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=Wm(e),c=Dl("chakra-spinner",a),u={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${w6e} ${o} linear infinite`,...n};return ie.jsx(or.div,{ref:t,__css:u,className:c,...l,children:r&&ie.jsx(or.span,{srOnly:!0,children:r})})});IA.displayName="Spinner";var[C6e,MA]=Hm({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[E6e,RA]=Hm({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),MG={info:{icon:x6e,colorScheme:"blue"},warning:{icon:lR,colorScheme:"orange"},success:{icon:S6e,colorScheme:"green"},error:{icon:lR,colorScheme:"red"},loading:{icon:IA,colorScheme:"blue"}};function T6e(e){return MG[e].colorScheme}function A6e(e){return MG[e].icon}var RG=Mi(function(t,n){const r=RA(),{status:i}=MA(),o={display:"inline",...r.description};return ie.jsx(or.div,{ref:n,"data-status":i,...t,className:Dl("chakra-alert__desc",t.className),__css:o})});RG.displayName="AlertDescription";function OG(e){const{status:t}=MA(),n=A6e(t),r=RA(),i=t==="loading"?r.spinner:r.icon;return ie.jsx(or.span,{display:"inherit","data-status":t,...e,className:Dl("chakra-alert__icon",e.className),__css:i,children:e.children||ie.jsx(n,{h:"100%",w:"100%"})})}OG.displayName="AlertIcon";var $G=Mi(function(t,n){const r=RA(),{status:i}=MA();return ie.jsx(or.div,{ref:n,"data-status":i,...t,className:Dl("chakra-alert__title",t.className),__css:r.title})});$G.displayName="AlertTitle";var NG=Mi(function(t,n){var r;const{status:i="info",addRole:o=!0,...s}=Wm(t),a=(r=t.colorScheme)!=null?r:T6e(i),l=R4e("Alert",{...t,colorScheme:a}),c={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return ie.jsx(C6e,{value:{status:i},children:ie.jsx(E6e,{value:l,children:ie.jsx(or.div,{"data-status":i,role:o?"alert":void 0,ref:n,...s,className:Dl("chakra-alert",t.className),__css:c})})})});NG.displayName="Alert";function k6e(e){return ie.jsx(e0,{focusable:"false","aria-hidden":!0,...e,children:ie.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 FG=Mi(function(t,n){const r=Km("CloseButton",t),{children:i,isDisabled:o,__css:s,...a}=Wm(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return ie.jsx(or.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...s},...a,children:i||ie.jsx(k6e,{width:"1em",height:"1em"})})});FG.displayName="CloseButton";var P6e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ss=I6e(P6e);function I6e(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(s=>({...s,[o]:s[o].filter(a=>a.id!=i)}))},notify:(i,o)=>{const s=M6e(i,o),{position:a,id:l}=s;return r(c=>{var u,d;const h=a.includes("top")?[s,...(u=c[a])!=null?u:[]]:[...(d=c[a])!=null?d:[],s];return{...c,[a]:h}}),l},update:(i,o)=>{i&&r(s=>{const a={...s},{position:l,index:c}=t9(a,i);return l&&c!==-1&&(a[l][c]={...a[l][c],...o,message:DG(o)}),a})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,c)=>(l[c]=o[c].map(u=>({...u,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const s=oU(o,i);return s?{...o,[s]:o[s].map(a=>a.id==i?{...a,requestClose:!0}:a)}:o})},isActive:i=>!!t9(ss.getState(),i).position}}var cR=0;function M6e(e,t={}){var n,r;cR+=1;const i=(n=t.id)!=null?n:cR,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ss.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var R6e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:s,description:a,colorScheme:l,icon:c}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return ie.jsxs(NG,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[ie.jsx(OG,{children:c}),ie.jsxs(or.div,{flex:"1",maxWidth:"100%",children:[i&&ie.jsx($G,{id:u==null?void 0:u.title,children:i}),a&&ie.jsx(RG,{id:u==null?void 0:u.description,display:"block",children:a})]}),o&&ie.jsx(FG,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function DG(e={}){const{render:t,toastComponent:n=R6e}=e;return i=>typeof t=="function"?t({...i,...e}):ie.jsx(n,{...i,...e})}function O6e(e,t){const n=i=>{var o;return{...t,...i,position:_6e((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),s=DG(o);return ss.notify(s,o)};return r.update=(i,o)=>{ss.update(i,n(o))},r.promise=(i,o)=>{const s=r({...o.loading,status:"loading",duration:null});i.then(a=>r.update(s,{status:"success",duration:5e3,...us(o.success,a)})).catch(a=>r.update(s,{status:"error",duration:5e3,...us(o.error,a)}))},r.closeAll=ss.closeAll,r.close=ss.close,r.isActive=ss.isActive,r}var[kWe,PWe]=Hm({name:"ToastOptionsContext",strict:!1}),$6e=e=>{const t=I.useSyncExternalStore(ss.subscribe,ss.getState,ss.getState),{motionVariants:n,component:r=IG,portalProps:i}=e,s=Object.keys(t).map(a=>{const l=t[a];return ie.jsx("div",{role:"region","aria-live":"polite","aria-label":`Notifications-${a}`,id:`chakra-toast-manager-${a}`,style:J4e(a),children:ie.jsx(PG,{initial:!1,children:l.map(c=>ie.jsx(r,{motionVariants:n,...c},c.id))})},a)});return ie.jsx(CS,{...i,children:s})},N6e={duration:5e3,variant:"solid"},Bu={theme:S4e,colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{},defaultOptions:N6e,forced:!1};function F6e({theme:e=Bu.theme,colorMode:t=Bu.colorMode,toggleColorMode:n=Bu.toggleColorMode,setColorMode:r=Bu.setColorMode,defaultOptions:i=Bu.defaultOptions,motionVariants:o,toastSpacing:s,component:a,forced:l}=Bu){const c={colorMode:t,setColorMode:r,toggleColorMode:n,forced:l};return{ToastContainer:()=>ie.jsx(X4e,{theme:e,children:ie.jsx(JT.Provider,{value:c,children:ie.jsx($6e,{defaultOptions:i,motionVariants:o,toastSpacing:s,component:a})})}),toast:O6e(e.direction,i)}}var H3=Mi(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...s}=t;return ie.jsx("img",{width:r,height:i,ref:n,alt:o,...s})});H3.displayName="NativeImage";function D6e(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:s,sizes:a,ignoreFallback:l}=e,[c,u]=I.useState("pending");I.useEffect(()=>{u(n?"loading":"pending")},[n]);const d=I.useRef(),f=I.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,s&&(p.crossOrigin=s),r&&(p.srcset=r),a&&(p.sizes=a),t&&(p.loading=t),p.onload=m=>{h(),u("loaded"),i==null||i(m)},p.onerror=m=>{h(),u("failed"),o==null||o(m)},d.current=p},[n,s,r,a,i,o,t]),h=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return j1(()=>{if(!l)return c==="loading"&&f(),()=>{h()}},[c,f,l]),l?"loaded":c}var L6e=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function B6e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var OA=Mi(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:s,align:a,fit:l,loading:c,ignoreFallback:u,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||i!==void 0,_=c!=null||u||!m,v=D6e({...t,crossOrigin:d,ignoreFallback:_}),y=L6e(v,f),g={ref:n,objectFit:l,objectPosition:a,..._?p:B6e(p,["onError","onLoad"])};return y?i||ie.jsx(or.img,{as:H3,className:"chakra-image__placeholder",src:r,...g}):ie.jsx(or.img,{as:H3,src:o,srcSet:s,crossOrigin:d,loading:c,referrerPolicy:h,className:"chakra-image",...g})});OA.displayName="Image";var LG=Mi(function(t,n){const r=Km("Text",t),{className:i,align:o,decoration:s,casing:a,...l}=Wm(t),c=D4e({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return ie.jsx(or.p,{ref:n,className:Dl("chakra-text",t.className),...c,...l,__css:r})});LG.displayName="Text";var W3=Mi(function(t,n){const r=Km("Heading",t),{className:i,...o}=Wm(t);return ie.jsx(or.h2,{ref:n,className:Dl("chakra-heading",t.className),...o,__css:r})});W3.displayName="Heading";var nb=or("div");nb.displayName="Box";var BG=Mi(function(t,n){const{size:r,centerContent:i=!0,...o}=t,s=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return ie.jsx(nb,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});BG.displayName="Square";var z6e=Mi(function(t,n){const{size:r,...i}=t;return ie.jsx(BG,{size:r,ref:n,borderRadius:"9999px",...i})});z6e.displayName="Circle";var $A=Mi(function(t,n){const{direction:r,align:i,justify:o,wrap:s,basis:a,grow:l,shrink:c,...u}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:c};return ie.jsx(or.div,{ref:n,__css:d,...u})});$A.displayName="Flex";const tt=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},j6e=T.object({status:T.literal(422),data:T.object({detail:T.array(T.object({loc:T.array(T.string()),msg:T.string(),type:T.string()}))})});function Hr(e,t,n=!1){e=String(e),t=String(t);const r=Array.from({length:21},(s,a)=>a*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((s,a,l)=>{const c=n?i[l]/100:1,u=n?50:i[r.length-1-l];return s[a]=`hsl(${e} ${t}% ${u}% / ${c})`,s},{})}const my={H:220,S:16},yy={H:250,S:42},vy={H:47,S:42},by={H:40,S:70},_y={H:28,S:42},Sy={H:113,S:42},xy={H:0,S:42},V6e={base:Hr(my.H,my.S),baseAlpha:Hr(my.H,my.S,!0),accent:Hr(yy.H,yy.S),accentAlpha:Hr(yy.H,yy.S,!0),working:Hr(vy.H,vy.S),workingAlpha:Hr(vy.H,vy.S,!0),gold:Hr(by.H,by.S),goldAlpha:Hr(by.H,by.S,!0),warning:Hr(_y.H,_y.S),warningAlpha:Hr(_y.H,_y.S,!0),ok:Hr(Sy.H,Sy.S),okAlpha:Hr(Sy.H,Sy.S,!0),error:Hr(xy.H,xy.S),errorAlpha:Hr(xy.H,xy.S,!0)},{definePartsStyle:U6e,defineMultiStyleConfig:G6e}=Be(MV.keys),H6e={border:"none"},W6e=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)}}}},q6e=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.100`,`${t}.800`)(e),borderRadius:"base",borderTopRadius:"none"}},K6e={},X6e=U6e(e=>({container:H6e,button:W6e(e),panel:q6e(e),icon:K6e})),Q6e=G6e({variants:{invokeAI:X6e},defaultProps:{variant:"invokeAI",colorScheme:"base"}}),Y6e=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}}},Z6e=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"}}},J6e={variants:{invokeAI:Y6e,invokeAIOutline:Z6e},defaultProps:{variant:"invokeAI",colorScheme:"base"}},{definePartsStyle:eIe,defineMultiStyleConfig:tIe}=Be(RV.keys),nIe=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)}}},rIe=eIe(e=>({control:nIe(e)})),iIe=tIe({variants:{invokeAI:rIe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{definePartsStyle:oIe,defineMultiStyleConfig:sIe}=Be(OV.keys),aIe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},lIe=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)}}),cIe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},uIe=oIe(e=>({preview:aIe,input:lIe(e),textarea:cIe})),dIe=sIe({variants:{invokeAI:uIe},defaultProps:{size:"sm",variant:"invokeAI"}}),fIe=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)}}),hIe={variants:{invokeAI:fIe},defaultProps:{variant:"invokeAI"}},DS=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:pIe,defineMultiStyleConfig:gIe}=Be($V.keys),mIe=pIe(e=>({field:DS(e)})),yIe=gIe({variants:{invokeAI:mIe},defaultProps:{size:"sm",variant:"invokeAI"}}),{definePartsStyle:vIe,defineMultiStyleConfig:bIe}=Be(NV.keys),_Ie=vIe(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}},divider:{borderColor:W("base.400","base.700")(e)}})),SIe=bIe({variants:{invokeAI:_Ie},defaultProps:{variant:"invokeAI"}}),IWe={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:xIe,definePartsStyle:wIe}=Be(FV.keys),CIe=e=>({bg:W("blackAlpha.700","blackAlpha.700")(e)}),EIe={},TIe=()=>({layerStyle:"first",maxH:"80vh"}),AIe=()=>({fontWeight:"600",fontSize:"lg",layerStyle:"first",borderTopRadius:"base",borderInlineEndRadius:"base"}),kIe={},PIe={overflowY:"scroll"},IIe={},MIe=wIe(e=>({overlay:CIe(e),dialogContainer:EIe,dialog:TIe(),header:AIe(),closeButton:kIe,body:PIe,footer:IIe})),RIe=xIe({variants:{invokeAI:MIe},defaultProps:{variant:"invokeAI",size:"lg"}}),{defineMultiStyleConfig:OIe,definePartsStyle:$Ie}=Be(DV.keys),NIe=e=>({height:8}),FIe=e=>({border:"none",fontWeight:"600",height:"auto",py:1,ps:2,pe:6,...DS(e)}),DIe=e=>({display:"flex"}),LIe=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)}}}),BIe=$Ie(e=>({root:NIe(e),field:FIe(e),stepperGroup:DIe(e),stepper:LIe(e)})),zIe=OIe({variants:{invokeAI:BIe},defaultProps:{size:"sm",variant:"invokeAI"}}),{defineMultiStyleConfig:jIe,definePartsStyle:zG}=Be(LV.keys),jG=Xt("popper-bg"),VG=Xt("popper-arrow-bg"),UG=Xt("popper-arrow-shadow-color"),VIe=e=>({[VG.variable]:W("colors.base.100","colors.base.800")(e),[jG.variable]:W("colors.base.100","colors.base.800")(e),[UG.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"}),UIe=e=>({[VG.variable]:W("colors.base.100","colors.base.700")(e),[jG.variable]:W("colors.base.100","colors.base.700")(e),[UG.variable]:W("colors.base.400","colors.base.400")(e),p:4,bg:W("base.100","base.700")(e),border:"none",shadow:"dark-lg"}),GIe=zG(e=>({content:VIe(e),body:{padding:0}})),HIe=zG(e=>({content:UIe(e),body:{padding:0}})),WIe=jIe({variants:{invokeAI:GIe,informational:HIe},defaultProps:{variant:"invokeAI"}}),{defineMultiStyleConfig:qIe,definePartsStyle:KIe}=Be(BV.keys),XIe=e=>({bg:"accentAlpha.700"}),QIe=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.200`,`${t}.700`)(e)}},YIe=KIe(e=>({filledTrack:XIe(e),track:QIe(e)})),ZIe=qIe({variants:{invokeAI:YIe},defaultProps:{variant:"invokeAI"}}),JIe={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},{definePartsStyle:e8e,defineMultiStyleConfig:t8e}=Be(zV.keys),n8e=e=>({color:W("base.200","base.300")(e)}),r8e=e=>({fontWeight:"600",...DS(e)}),i8e=e8e(e=>({field:r8e(e),icon:n8e(e)})),o8e=t8e({variants:{invokeAI:i8e},defaultProps:{size:"sm",variant:"invokeAI"}}),uR=Ae("skeleton-start-color"),dR=Ae("skeleton-end-color"),s8e={borderRadius:"base",maxW:"full",maxH:"full",_light:{[uR.variable]:"colors.base.250",[dR.variable]:"colors.base.450"},_dark:{[uR.variable]:"colors.base.700",[dR.variable]:"colors.base.500"}},a8e={variants:{invokeAI:s8e},defaultProps:{variant:"invokeAI"}},{definePartsStyle:l8e,defineMultiStyleConfig:c8e}=Be(jV.keys),u8e=e=>({bg:W("base.400","base.600")(e),h:1.5}),d8e=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.400`,`${t}.600`)(e),h:1.5}},f8e=e=>({w:e.orientation==="horizontal"?2:4,h:e.orientation==="horizontal"?4:2,bg:W("base.50","base.100")(e)}),h8e=e=>({fontSize:"2xs",fontWeight:"500",color:W("base.700","base.400")(e),mt:2,insetInlineStart:"unset"}),p8e=l8e(e=>({container:{_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},track:u8e(e),filledTrack:d8e(e),thumb:f8e(e),mark:h8e(e)})),g8e=c8e({variants:{invokeAI:p8e},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:m8e,definePartsStyle:y8e}=Be(VV.keys),v8e=e=>{const{colorScheme:t}=e;return{bg:W("base.300","base.600")(e),_focusVisible:{boxShadow:"none"},_checked:{bg:W(`${t}.400`,`${t}.500`)(e)}}},b8e=e=>{const{colorScheme:t}=e;return{bg:W(`${t}.50`,`${t}.50`)(e)}},_8e=y8e(e=>({container:{},track:v8e(e),thumb:b8e(e)})),S8e=m8e({variants:{invokeAI:_8e},defaultProps:{size:"md",variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:x8e,definePartsStyle:GG}=Be(UV.keys),w8e=e=>({display:"flex",columnGap:4}),C8e=e=>({}),E8e=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)}}}}},T8e=e=>({padding:0,height:"100%"}),A8e=GG(e=>({root:w8e(e),tab:C8e(e),tablist:E8e(e),tabpanel:T8e(e)})),k8e=GG(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"}})),P8e=x8e({variants:{line:k8e,appTabs:A8e},defaultProps:{variant:"appTabs",colorScheme:"accent"}}),I8e=e=>({color:W("error.500","error.400")(e)}),M8e=e=>({color:W("base.500","base.400")(e)}),R8e={variants:{subtext:M8e,error:I8e}},O8e=e=>({...DS(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}),$8e={variants:{invokeAI:O8e},defaultProps:{size:"md",variant:"invokeAI"}},N8e=Xt("popper-arrow-bg"),F8e=e=>({borderRadius:"base",shadow:"dark-lg",bg:W("base.700","base.200")(e),[N8e.variable]:W("colors.base.700","colors.base.200")(e),pb:1.5}),D8e={baseStyle:F8e},fR={backgroundColor:"accentAlpha.150 !important",borderColor:"accentAlpha.700 !important",borderRadius:"base !important",borderStyle:"dashed !important",_dark:{borderColor:"accent.400 !important"}},L8e={".react-flow__nodesselection-rect":{...fR,padding:"1rem !important",boxSizing:"content-box !important",transform:"translate(-1rem, -1rem) !important"},".react-flow__selection":fR},B8e=e=>({color:W("accent.500","accent.300")(e)}),z8e={variants:{accent:B8e}},j8e={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","*":{...JIe},...L8e})},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:V6e,components:{Button:J6e,Input:yIe,Editable:dIe,Textarea:$8e,Tabs:P8e,Progress:ZIe,Accordion:Q6e,FormLabel:hIe,Switch:S8e,NumberInput:zIe,Select:o8e,Skeleton:a8e,Slider:g8e,Popover:WIe,Modal:RIe,Checkbox:iIe,Menu:SIe,Text:R8e,Tooltip:D8e,Heading:z8e}},V8e={defaultOptions:{isClosable:!0,position:"bottom-right"}},{toast:Th}=F6e({theme:j8e,defaultOptions:V8e.defaultOptions}),U8e=()=>{fe({matcher:en.endpoints.enqueueBatch.matchFulfilled,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;ue("queue").debug({enqueueResult:tt(t)},"Batch enqueued"),Th.isActive("batch-queued")||Th({id:"batch-queued",title:J("queue.batchQueued"),description:J("queue.batchQueuedDesc",{count:t.enqueued,direction:n.prepend?J("queue.front"):J("queue.back")}),duration:1e3,status:"success"})}}),fe({matcher:en.endpoints.enqueueBatch.matchRejected,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;if(!t){Th({title:J("queue.batchFailedToQueue"),status:"error",description:"Unknown Error"}),ue("queue").error({batchConfig:tt(n),error:tt(t)},J("queue.batchFailedToQueue"));return}const r=j6e.safeParse(t);r.success?r.data.data.detail.map(i=>{Th({id:"batch-failed-to-queue",title:z6(oF(i.msg),{length:128}),status:"error",description:z6(`Path:
${i.loc.join(".")}`,{length:128})})}):t.status!==403&&Th({title:J("queue.batchFailedToQueue"),description:J("common.unknownError"),status:"error"}),ue("queue").error({batchConfig:tt(n),error:tt(t)},J("queue.batchFailedToQueue"))}})},hu=m4({memoize:kQ,memoizeOptions:{resultEqualityCheck:$4}}),HG=(e,t)=>{var d;const{generation:n,canvas:r,nodes:i,controlAdapters:o}=e,s=((d=n.initialImage)==null?void 0:d.imageName)===t,a=r.layerState.objects.some(f=>f.kind==="image"&&f.imageName===t),l=i.nodes.filter(Sn).some(f=>Gu(f.data.inputs,h=>{var p;return vT(h)&&((p=h.value)==null?void 0:p.image_name)===t})),c=As(o).some(f=>f.controlImage===t||hi(f)&&f.processedControlImage===t);return{isInitialImage:s,isCanvasImage:a,isNodesImage:l,isControlImage:c}},G8e=hu([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>HG(e,r.image_name)):[]}),H8e=()=>{fe({matcher:ce.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,s=!1,a=!1;const l=n();r.forEach(c=>{const u=HG(l,c);u.isInitialImage&&!i&&(t(oT()),i=!0),u.isCanvasImage&&!o&&(t(dT()),o=!0),u.isNodesImage&&!s&&(t(Rj()),s=!0),u.isControlImage&&!a&&(t(hae()),a=!0)})}})},W8e=()=>{fe({matcher:br(vp,Q5),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),s=vp.match(e)?e.payload.boardId:o.gallery.selectedBoardId,l=(Q5.match(e)?e.payload:o.gallery.galleryView)==="images"?Rn:Pr,c={board_id:s??"none",categories:l};if(await r(()=>ce.endpoints.listImages.select(c)(t()).isSuccess,5e3)){const{data:d}=ce.endpoints.listImages.select(c)(t());if(d&&vp.match(e)&&e.payload.selectedImageName){const f=_g.selectAll(d)[0],h=_g.selectById(d,e.payload.selectedImageName);n(ps(h||f||null))}else n(ps(null))}else n(ps(null))}})},q8e=he("canvas/canvasSavedToGallery"),K8e=he("canvas/canvasMaskSavedToGallery"),X8e=he("canvas/canvasCopiedToClipboard"),Q8e=he("canvas/canvasDownloadedAsImage"),Y8e=he("canvas/canvasMerged"),Z8e=he("canvas/stagingAreaImageSaved"),J8e=he("canvas/canvasMaskToControlAdapter"),eMe=he("canvas/canvasImageToControlAdapter");let WG=null,qG=null;const MWe=e=>{WG=e},LS=()=>WG,RWe=e=>{qG=e},tMe=()=>qG,nMe=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),rb=async(e,t)=>await nMe(e.toCanvas(t)),BS=async(e,t=!1)=>{const n=LS();if(!n)throw new Error("Problem getting base layer blob");const{shouldCropToBoundingBoxOnSave:r,boundingBoxCoordinates:i,boundingBoxDimensions:o}=e.canvas,s=n.clone();s.scale({x:1,y:1});const a=s.getAbsolutePosition(),l=r||t?{x:i.x+a.x,y:i.y+a.y,width:o.width,height:o.height}:s.getClientRect();return rb(s,l)},rMe=(e,t="image/png")=>{navigator.clipboard.write([new ClipboardItem({[t]:e})])},iMe=()=>{fe({actionCreator:X8e,effect:async(e,{dispatch:t,getState:n})=>{const r=B_.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n();try{const o=BS(i);rMe(o)}catch(o){r.error(String(o)),t(Ve({title:J("toast.problemCopyingCanvas"),description:J("toast.problemCopyingCanvasDesc"),status:"error"}));return}t(Ve({title:J("toast.canvasCopiedClipboard"),status:"success"}))}})},oMe=(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()},sMe=()=>{fe({actionCreator:Q8e,effect:async(e,{dispatch:t,getState:n})=>{const r=B_.get().child({namespace:"canvasSavedToGalleryListener"}),i=n();let o;try{o=await BS(i)}catch(s){r.error(String(s)),t(Ve({title:J("toast.problemDownloadingCanvas"),description:J("toast.problemDownloadingCanvasDesc"),status:"error"}));return}oMe(o,"canvas.png"),t(Ve({title:J("toast.canvasDownloaded"),status:"success"}))}})},aMe=()=>{fe({actionCreator:eMe,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("canvas"),i=n(),{id:o}=e.payload;let s;try{s=await BS(i,!0)}catch(u){r.error(String(u)),t(Ve({title:J("toast.problemSavingCanvas"),description:J("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery,l=await t(ce.endpoints.uploadImage.initiate({file:new File([s],"savedCanvas.png",{type:"image/png"}),image_category:"control",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:J("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:c}=l;t(Nl({id:o,controlImage:c}))}})};var NA={exports:{}},zS={},KG={},Ue={};(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)})(Ue);var Qt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Ue;class n{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.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(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){var S=this.m;return{x:S[0]*b.x+S[2]*b.y+S[4],y:S[1]*b.x+S[3]*b.y+S[5]}}translate(b,S){return this.m[4]+=this.m[0]*b+this.m[2]*S,this.m[5]+=this.m[1]*b+this.m[3]*S,this}scale(b,S){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=S,this.m[3]*=S,this}rotate(b){var S=Math.cos(b),w=Math.sin(b),C=this.m[0]*S+this.m[2]*w,x=this.m[1]*S+this.m[3]*w,k=this.m[0]*-w+this.m[2]*S,A=this.m[1]*-w+this.m[3]*S;return this.m[0]=C,this.m[1]=x,this.m[2]=k,this.m[3]=A,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,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]*b,k=this.m[3]+this.m[1]*b;return this.m[0]=w,this.m[1]=C,this.m[2]=x,this.m[3]=k,this}multiply(b){var S=this.m[0]*b.m[0]+this.m[2]*b.m[1],w=this.m[1]*b.m[0]+this.m[3]*b.m[1],C=this.m[0]*b.m[2]+this.m[2]*b.m[3],x=this.m[1]*b.m[2]+this.m[3]*b.m[3],k=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],A=this.m[1]*b.m[4]+this.m[3]*b.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]=k,this.m[5]=A,this}invert(){var b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*b,w=-this.m[1]*b,C=-this.m[2]*b,x=this.m[0]*b,k=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),A=b*(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]=k,this.m[5]=A,this}getMatrix(){return this.m}decompose(){var b=this.m[0],S=this.m[1],w=this.m[2],C=this.m[3],x=this.m[4],k=this.m[5],A=b*C-S*w;let R={x,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||S!=0){var L=Math.sqrt(b*b+S*S);R.rotation=S>0?Math.acos(b/L):-Math.acos(b/L),R.scaleX=L,R.scaleY=A/L,R.skewX=(b*w+S*C)/A,R.skewY=0}else if(w!=0||C!=0){var M=Math.sqrt(w*w+C*C);R.rotation=Math.PI/2-(C>0?Math.acos(-w/M):-Math.acos(w/M)),R.scaleX=A/M,R.scaleY=M,R.skewX=0,R.skewY=(b*w+S*C)/A}return R.rotation=e.Util._getRotation(R.rotation),R}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",s="[object Boolean]",a=Math.PI/180,l=180/Math.PI,c="#",u="",d="0",f="Konva warning: ",h="Konva error: ",p="rgb(",m={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})\)/,v=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===r},_isNumber(g){return Object.prototype.toString.call(g)===i&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===o},_isBoolean(g){return Object.prototype.toString.call(g)===s},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;var b=g[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){v.push(g),v.length===1&&y(function(){const b=v;v=[],b.forEach(function(S){S()})})},createCanvasElement(){var g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,b){var S=e.Util.createImageElement();S.onload=function(){b(S)},S.src=g},_rgbToHex(g,b,S){return((1<<24)+(g<<16)+(b<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(c,u);var b=parseInt(g,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return c+g},getRGB(g){var b;return g in m?(b=m[g],{r:b[0],g:b[1],b:b[2]}):g[0]===c?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(b=_.exec(g.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){var b=m[g.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var b=g.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var b=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:b[0],g:b[1],b:b[2],a:b[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[b,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),w=Number(S[0])/360,C=Number(S[1])/100,x=Number(S[2])/100;let k,A,R;if(C===0)return R=x*255,{r:Math.round(R),g:Math.round(R),b:Math.round(R),a:1};x<.5?k=x*(1+C):k=x+C-x*C;const L=2*x-k,M=[0,0,0];for(let E=0;E<3;E++)A=w+1/3*-(E-1),A<0&&A++,A>1&&A--,6*A<1?R=L+(k-L)*6*A:2*A<1?R=k:3*A<2?R=L+(k-L)*(2/3-A)*6:R=L,M[E]=R*255;return{r:Math.round(M[0]),g:Math.round(M[1]),b:Math.round(M[2]),a:1}}},haveIntersection(g,b){return!(b.x>g.x+g.width||b.x+b.width<g.x||b.y>g.y+g.height||b.y+b.height<g.y)},cloneObject(g){var b={};for(var S in g)this._isPlainObject(g[S])?b[S]=this.cloneObject(g[S]):this._isArray(g[S])?b[S]=this.cloneArray(g[S]):b[S]=g[S];return b},cloneArray(g){return g.slice(0)},degToRad(g){return g*a},radToDeg(g){return g*l},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return t.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(h+g)},error(g){console.error(h+g)},warn(g){t.Konva.showWarnings&&console.warn(f+g)},each(g,b){for(var S in g)b(S,g[S])},_inRange(g,b,S){return b<=g&&g<S},_getProjectionToSegment(g,b,S,w,C,x){var k,A,R,L=(g-S)*(g-S)+(b-w)*(b-w);if(L==0)k=g,A=b,R=(C-S)*(C-S)+(x-w)*(x-w);else{var M=((C-g)*(S-g)+(x-b)*(w-b))/L;M<0?(k=g,A=b,R=(g-C)*(g-C)+(b-x)*(b-x)):M>1?(k=S,A=w,R=(S-C)*(S-C)+(w-x)*(w-x)):(k=g+M*(S-g),A=b+M*(w-b),R=(k-C)*(k-C)+(A-x)*(A-x))}return[k,A,R]},_getProjectionToLine(g,b,S){var w=e.Util.cloneObject(g),C=Number.MAX_VALUE;return b.forEach(function(x,k){if(!(!S&&k===b.length-1)){var A=b[(k+1)%b.length],R=e.Util._getProjectionToSegment(x.x,x.y,A.x,A.y,g.x,g.y),L=R[0],M=R[1],E=R[2];E<C&&(w.x=L,w.y=M,C=E)}}),w},_prepareArrayForTween(g,b,S){var w,C=[],x=[];if(g.length>b.length){var k=b;b=g,g=k}for(w=0;w<g.length;w+=2)C.push({x:g[w],y:g[w+1]});for(w=0;w<b.length;w+=2)x.push({x:b[w],y:b[w+1]});var A=[];return x.forEach(function(R){var L=e.Util._getProjectionToLine(R,C,S);A.push(L.x),A.push(L.y)}),A},_prepareToStringify(g){var b;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(b=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(b.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(b.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,b){for(var S in b)g[S]=b[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(g,b,S,w){let C=0,x=0,k=0,A=0;typeof w=="number"?C=x=k=A=Math.min(w,b/2,S/2):(C=Math.min(w[0]||0,b/2,S/2),x=Math.min(w[1]||0,b/2,S/2),A=Math.min(w[2]||0,b/2,S/2),k=Math.min(w[3]||0,b/2,S/2)),g.moveTo(C,0),g.lineTo(b-x,0),g.arc(b-x,x,x,Math.PI*3/2,0,!1),g.lineTo(b,S-A),g.arc(b-A,S-A,A,0,Math.PI/2,!1),g.lineTo(k,S),g.arc(k,S-k,k,Math.PI/2,Math.PI,!1),g.lineTo(0,C),g.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(Qt);var Vt={},ze={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.getComponentValidator=xe.getBooleanValidator=xe.getNumberArrayValidator=xe.getFunctionValidator=xe.getStringOrGradientValidator=xe.getStringValidator=xe.getNumberOrAutoValidator=xe.getNumberOrArrayOfNumbersValidator=xe.getNumberValidator=xe.alphaComponent=xe.RGBComponent=void 0;const va=Ue,nn=Qt;function ba(e){return nn.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||nn.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function lMe(e){return e>255?255:e<0?0:Math.round(e)}xe.RGBComponent=lMe;function cMe(e){return e>1?1:e<1e-4?1e-4:e}xe.alphaComponent=cMe;function uMe(){if(va.Konva.isUnminified)return function(e,t){return nn.Util._isNumber(e)||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}xe.getNumberValidator=uMe;function dMe(e){if(va.Konva.isUnminified)return function(t,n){let r=nn.Util._isNumber(t),i=nn.Util._isArray(t)&&t.length==e;return!r&&!i&&nn.Util.warn(ba(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}xe.getNumberOrArrayOfNumbersValidator=dMe;function fMe(){if(va.Konva.isUnminified)return function(e,t){var n=nn.Util._isNumber(e),r=e==="auto";return n||r||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}xe.getNumberOrAutoValidator=fMe;function hMe(){if(va.Konva.isUnminified)return function(e,t){return nn.Util._isString(e)||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}xe.getStringValidator=hMe;function pMe(){if(va.Konva.isUnminified)return function(e,t){const n=nn.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}xe.getStringOrGradientValidator=pMe;function gMe(){if(va.Konva.isUnminified)return function(e,t){return nn.Util._isFunction(e)||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}xe.getFunctionValidator=gMe;function mMe(){if(va.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(nn.Util._isArray(e)?e.forEach(function(r){nn.Util._isNumber(r)||nn.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}xe.getNumberArrayValidator=mMe;function yMe(){if(va.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||nn.Util.warn(ba(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}xe.getBooleanValidator=yMe;function vMe(e){if(va.Konva.isUnminified)return function(t,n){return t==null||nn.Util.isObject(t)||nn.Util.warn(ba(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}xe.getComponentValidator=vMe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Qt,n=xe;var r="get",i="set";e.Factory={addGetterSetter(o,s,a,l,c){e.Factory.addGetter(o,s,a),e.Factory.addSetter(o,s,l,c),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,a){var l=r+t.Util._capitalize(s);o.prototype[l]=o.prototype[l]||function(){var c=this.attrs[s];return c===void 0?a:c}},addSetter(o,s,a,l){var c=i+t.Util._capitalize(s);o.prototype[c]||e.Factory.overWriteSetter(o,s,a,l)},overWriteSetter(o,s,a,l){var c=i+t.Util._capitalize(s);o.prototype[c]=function(u){return a&&u!==void 0&&u!==null&&(u=a.call(this,u,s)),this._setAttr(s,u),l&&l.call(this),this}},addComponentsGetterSetter(o,s,a,l,c){var u=a.length,d=t.Util._capitalize,f=r+d(s),h=i+d(s),p,m;o.prototype[f]=function(){var v={};for(p=0;p<u;p++)m=a[p],v[m]=this.getAttr(s+d(m));return v};var _=(0,n.getComponentValidator)(a);o.prototype[h]=function(v){var y=this.attrs[s],g;l&&(v=l.call(this,v)),_&&_.call(this,v,s);for(g in v)v.hasOwnProperty(g)&&this._setAttr(s+d(g),v[g]);return v||a.forEach(b=>{this._setAttr(s+d(b),void 0)}),this._fireChangeEvent(s,y,v),c&&c.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var a=t.Util._capitalize(s),l=i+a,c=r+a;o.prototype[s]=function(){return arguments.length?(this[l](arguments[0]),this):this[c]()}},addDeprecatedGetterSetter(o,s,a,l){t.Util.error("Adding deprecated "+s);var c=r+t.Util._capitalize(s),u=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[c]=function(){t.Util.error(u);var d=this.attrs[s];return d===void 0?a:d},e.Factory.addSetter(o,s,l,function(){t.Util.error(u)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){t.Util.each(s,function(a,l){var c=o.prototype[l],u=r+t.Util._capitalize(a),d=i+t.Util._capitalize(a);function f(){c.apply(this,arguments),t.Util.error('"'+a+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[a]=f,o.prototype[u]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(ze);var Ro={},ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.HitContext=ia.SceneContext=ia.Context=void 0;const XG=Qt,bMe=Ue;function _Me(e){var t=[],n=e.length,r=XG.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 hR=",",SMe="(",xMe=")",wMe="([",CMe="])",EMe=";",TMe="()",AMe="=",pR=["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"],kMe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const PMe=100;class jS{constructor(t){this.canvas=t,bMe.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",s,a,l,c;for(s=0;s<i;s++)a=r[s],l=a.method,l?(c=a.args,o+=l,t?o+=TMe:XG.Util._isArray(c[0])?o+=wMe+c.join(hR)+CMe:(n&&(c=c.map(u=>typeof u=="number"?Math.floor(u):u)),o+=SMe+c.join(hR)+xMe)):(o+=a.property,t||(o+=AMe+a.val)),o+=EMe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=PMe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,s){this._context.arc(t,n,r,i,o,s)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,s){this._context.bezierCurveTo(t,n,r,i,o,s)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,s){return this._context.createRadialGradient(t,n,r,i,o,s)}drawImage(t,n,r,i,o,s,a,l,c){var u=arguments,d=this._context;u.length===3?d.drawImage(t,n,r):u.length===5?d.drawImage(t,n,r,i,o):u.length===9&&d.drawImage(t,n,r,i,o,s,a,l,c)}ellipse(t,n,r,i,o,s,a,l){this._context.ellipse(t,n,r,i,o,s,a,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,s){this._context.setTransform(t,n,r,i,o,s)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,s){this._context.transform(t,n,r,i,o,s)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=pR.length,r=this.setAttr,i,o,s=function(a){var l=t[a],c;t[a]=function(){return o=_Me(Array.prototype.slice.call(arguments,0)),c=l.apply(t,arguments),t._trace({method:a,args:o}),c}};for(i=0;i<n;i++)s(pR[i]);t.setAttr=function(){r.apply(t,arguments);var a=arguments[0],l=arguments[1];(a==="shadowOffsetX"||a==="shadowOffsetY"||a==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:a,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}ia.Context=jS;kMe.forEach(function(e){Object.defineProperty(jS.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class IMe extends jS{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const s=t.getFillRadialGradientColorStops();if(s&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):s&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var s=0;s<i.length;s+=2)o.addColorStop(i[s],i[s+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",s=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,a=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),c=this.canvas.getPixelRatio(),u=l.x*c,d=l.y*c;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",s*Math.min(Math.abs(u),Math.abs(d))),this.setAttr("shadowOffsetX",a.x*u),this.setAttr("shadowOffsetY",a.y*d)}}ia.SceneContext=IMe;class MMe extends jS{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()}}}ia.HitContext=MMe;Object.defineProperty(Ro,"__esModule",{value:!0});Ro.HitCanvas=Ro.SceneCanvas=Ro.Canvas=void 0;const ib=Qt,QG=ia,YG=Ue,RMe=ze,OMe=xe;var wy;function $Me(){if(wy)return wy;var e=ib.Util.createCanvasElement(),t=e.getContext("2d");return wy=function(){var n=YG.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),ib.Util.releaseCanvas(e),wy}class VS{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||YG.Konva.pixelRatio||$Me();this.pixelRatio=r,this._canvas=ib.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 ib.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Ro.Canvas=VS;RMe.Factory.addGetterSetter(VS,"pixelRatio",void 0,(0,OMe.getNumberValidator)());class NMe extends VS{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new QG.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}Ro.SceneCanvas=NMe;class FMe extends VS{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new QG.HitContext(this),this.setSize(t.width,t.height)}}Ro.HitCanvas=FMe;var US={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Ue,n=Qt;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,s)=>{const{node:a}=o,l=a.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const c=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(c){if(o.dragStatus!=="dragging"){var u=a.dragDistance(),d=Math.max(Math.abs(c.x-o.startPointerPos.x),Math.abs(c.y-o.startPointerPos.y));if(d<u||(a.startDrag({evt:r}),!a.isDragging()))return}a._setDragPosition(r,o),i.push(a)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:s}=o,a=s.getStage();if(r&&a.setPointersPositions(r),!a._changedPointerPositions.find(u=>u.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 c=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;c&&i.indexOf(c)===-1&&i.push(c)}),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))})(US);Object.defineProperty(Vt,"__esModule",{value:!0});Vt.Node=void 0;const We=Qt,t0=ze,Cy=Ro,Jl=Ue,Bi=US,dn=xe;var Sv="absoluteOpacity",Ey="allEventListeners",Ds="absoluteTransform",gR="absoluteScale",ec="canvas",DMe="Change",LMe="children",BMe="konva",q3="listening",mR="mouseenter",yR="mouseleave",vR="set",bR="Shape",xv=" ",_R="stage",Fa="transform",zMe="Stage",K3="visible",jMe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(xv);let VMe=1;class $e{constructor(t){this._id=VMe++,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===Fa||t===Ds)&&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===Fa||t===Ds,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(xv);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(ec)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Ds&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ec)){const{scene:t,filter:n,hit:r}=this._cache.get(ec);We.Util.releaseCanvas(t,n,r),this._cache.delete(ec)}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),s=n.pixelRatio,a=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,c=n.offset||0,u=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){We.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=c*2+1,o+=c*2+1,a-=c,l-=c;var f=new Cy.SceneCanvas({pixelRatio:s,width:i,height:o}),h=new Cy.SceneCanvas({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),p=new Cy.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),_=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(ec),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),m.save(),_.save(),m.translate(-a,-l),_.translate(-a,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Sv),this._clearSelfAndDescendantCache(gR),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,m.restore(),_.restore(),u&&(m.save(),m.beginPath(),m.rect(0,0,i,o),m.closePath(),m.setAttr("strokeStyle","red"),m.setAttr("lineWidth",5),m.stroke(),m.restore()),this._cache.set(ec,{scene:f,filter:h,hit:p,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ec)}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,s=-1/0,a=-1/0,l=this.getAbsoluteTransform(n);return r.forEach(function(c){var u=l.point(c);i===void 0&&(i=s=u.x,o=a=u.y),i=Math.min(i,u.x),o=Math.min(o,u.y),s=Math.max(s,u.x),a=Math.max(a,u.y)}),{x:i,y:o,width:s-i,height:a-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),s,a,l,c;if(t){if(!this._filterUpToDate){var u=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(s=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/u,r.getHeight()/u),a=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<s;l++){if(c=t[l],typeof c!="function"){We.Util.error("Filter should be type of function, but got "+typeof c+" instead. Please check correct filters");continue}c.call(this,a),o.putImageData(a,0,0)}}catch(d){We.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(Ey),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(xv),i=r.length,o,s,a,l,c;for(o=0;o<i;o++)s=r[o],a=s.split("."),l=a[0],c=a[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:c,handler:n});return this}off(t,n){var r=(t||"").split(xv),i=r.length,o,s,a,l,c,u;if(this._cache&&this._cache.delete(Ey),!t)for(s in this.eventListeners)this._off(s);for(o=0;o<i;o++)if(a=r[o],l=a.split("."),c=l[0],u=l[1],c)this.eventListeners[c]&&this._off(c,u,n);else for(s in this.eventListeners)this._off(s,u,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var s=o.target.findAncestors(n,!0,i),a=0;a<s.length;a++)o=We.Util.cloneObject(o),o.currentTarget=s[a],r.call(s[a],o)})}remove(){return this.isDragging()&&this.stopDrag(),Bi.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Ds),this._clearSelfAndDescendantCache(Sv),this._clearSelfAndDescendantCache(gR),this._clearSelfAndDescendantCache(_R),this._clearSelfAndDescendantCache(K3),this._clearSelfAndDescendantCache(q3)}_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"+We.Util._capitalize(t);return We.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!==LMe&&(r=vR+We.Util._capitalize(n),We.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(q3,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;Bi.DD._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(s.node.nodeType==="Stage"||s.node.getLayer()===r)&&(i=!0)});var o=!n&&!Jl.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,s,a;function l(u){for(i=[],o=u.length,s=0;s<o;s++)a=u[s],r++,a.nodeType!==bR&&(i=i.concat(a.getChildren().slice())),a._id===n._id&&(s=o);i.length>0&&i[0].getDepth()<=t&&l(i)}const c=this.getStage();return n.nodeType!==zMe&&c&&l(c.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(Fa),this._clearSelfAndDescendantCache(Ds)),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 We.Transform,s=this.offset();return o.m=i.slice(),o.translate(s.x,s.y),o.getTranslation()}setAbsolutePosition(t){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Fa);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(Fa),this._clearSelfAndDescendantCache(Ds),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,s;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,s=0;s<o;s++)t(r[s])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return We.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 We.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 We.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 We.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 We.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&We.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(Sv,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,s,a;t.attrs={};for(r in n)i=n[r],a=We.Util.isObject(i)&&!We.Util._isPlainObject(i)&&!We.Util._isArray(i),!a&&(o=typeof this[r]=="function"&&this[r],delete n[r],s=o?o.call(this):null,n[r]=i,s!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),We.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],We.Util.isValidSelector(o)||(We.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),We.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),We.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(_R,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(Ds,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new We.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(Ds)||new We.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,s=this.attrs.offsetX||0,a=this.attrs.offsetY||0;n.translate(i-s,o-a)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Fa,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(Fa)||new We.Transform;r.reset();var i=this.x(),o=this.y(),s=Jl.Konva.getAngle(this.rotation()),a=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,c=this.attrs.skewX||0,u=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),s!==0&&r.rotate(s),(c!==0||u!==0)&&r.skew(c,u),(a!==1||l!==1)&&r.scale(a,l),(d!==0||f!==0)&&r.translate(-1*d,-1*f),r.dirty=!1,r}clone(t){var n=We.Util.cloneObject(this.attrs),r,i,o,s,a;for(r in t)n[r]=t[r];var l=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,s=0;s<o;s++)a=i[s],a.name.indexOf(BMe)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(a));return l}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),s=t.pixelRatio||1,a=new Cy.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:s}),l=a.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(a),l.restore(),a}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,We.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():Jl.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,s,a;for(o=0;o<i.length;o++)if(s=i[o].name,a=i[o].handler,(s!=="konva"||n==="konva")&&(!n||s===n)&&(!r||r===a)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+DMe,{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[vR+We.Util._capitalize(t)];return We.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(Jl.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!We.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===bR&&(n.target=this);var i=(t===mR||t===yR)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===mR||t===yR)&&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(Ey))!==null&&n!==void 0?n:{};let s=o==null?void 0:o[t];if(s===void 0){s=[];let a=Object.getPrototypeOf(this);for(;a;){const l=(i=(r=a.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];s.push(...l),a=Object.getPrototypeOf(a)}o[t]=s,this._cache.set(Ey,o)}return s}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(r){var o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Bi.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){Bi.DD._dragElements.has(this._id)||this._createDragElement(t);const r=Bi.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const s=o.call(this,i,t);s?i=s:We.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=Bi.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Bi.DD._endDragBefore(t),Bi.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Bi.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||Jl.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;Bi.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=Bi.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Bi.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 We.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return We.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=$e.prototype.getClassName.call(t),i=t.children,o,s,a;n&&(t.attrs.container=n),Jl.Konva[r]||(We.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Jl.Konva[r];if(o=new l(t.attrs),i)for(s=i.length,a=0;a<s;a++)o.add($e._createNode(i[a]));return o}}Vt.Node=$e;$e.prototype.nodeType="Node";$e.prototype._attrsAffectingSize=[];$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,jMe,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Fa),this._clearSelfAndDescendantCache(Ds)});$e.prototype.on.call($e.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(K3)});$e.prototype.on.call($e.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(q3)});$e.prototype.on.call($e.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Sv)});const xt=t0.Factory.addGetterSetter;xt($e,"zIndex");xt($e,"absolutePosition");xt($e,"position");xt($e,"x",0,(0,dn.getNumberValidator)());xt($e,"y",0,(0,dn.getNumberValidator)());xt($e,"globalCompositeOperation","source-over",(0,dn.getStringValidator)());xt($e,"opacity",1,(0,dn.getNumberValidator)());xt($e,"name","",(0,dn.getStringValidator)());xt($e,"id","",(0,dn.getStringValidator)());xt($e,"rotation",0,(0,dn.getNumberValidator)());t0.Factory.addComponentsGetterSetter($e,"scale",["x","y"]);xt($e,"scaleX",1,(0,dn.getNumberValidator)());xt($e,"scaleY",1,(0,dn.getNumberValidator)());t0.Factory.addComponentsGetterSetter($e,"skew",["x","y"]);xt($e,"skewX",0,(0,dn.getNumberValidator)());xt($e,"skewY",0,(0,dn.getNumberValidator)());t0.Factory.addComponentsGetterSetter($e,"offset",["x","y"]);xt($e,"offsetX",0,(0,dn.getNumberValidator)());xt($e,"offsetY",0,(0,dn.getNumberValidator)());xt($e,"dragDistance",null,(0,dn.getNumberValidator)());xt($e,"width",0,(0,dn.getNumberValidator)());xt($e,"height",0,(0,dn.getNumberValidator)());xt($e,"listening",!0,(0,dn.getBooleanValidator)());xt($e,"preventDefault",!0,(0,dn.getBooleanValidator)());xt($e,"filters",null,function(e){return this._filterUpToDate=!1,e});xt($e,"visible",!0,(0,dn.getBooleanValidator)());xt($e,"transformsEnabled","all",(0,dn.getStringValidator)());xt($e,"size");xt($e,"dragBoundFunc");xt($e,"draggable",!1,(0,dn.getBooleanValidator)());t0.Factory.backCompat($e,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var pu={};Object.defineProperty(pu,"__esModule",{value:!0});pu.Container=void 0;const Bf=ze,Jw=Vt,GS=xe;class gu extends Jw.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=Jw.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=Jw.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(),s=this._getCanvasCache(),a=s&&s.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(a){o.save();var c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),s=this._getCanvasCache(),a=s&&s.hit;if(a){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),s=this.clipWidth(),a=this.clipHeight(),l=this.clipFunc(),c=s&&a||l;const u=r===this;if(c){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,s,a)}o.clip.apply(o,_),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var m=!u&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),m&&o.restore(),c&&o.restore()}getClientRect(t={}){var n,r=t.skipTransform,i=t.relativeTo,o,s,a,l,c={x:1/0,y:1/0,width:0,height:0},u=this;(n=this.children)===null||n===void 0||n.forEach(function(m){if(m.visible()){var _=m.getClientRect({relativeTo:u,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,s=_.y,a=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),s=Math.min(s,_.y),a=Math.max(a,_.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?c={x:o,y:s,width:a-o,height:l-s}:c={x:0,y:0,width:0,height:0},r?c:this._transformedRect(c,i)}}pu.Container=gu;Bf.Factory.addComponentsGetterSetter(gu,"clip",["x","y","width","height"]);Bf.Factory.addGetterSetter(gu,"clipX",void 0,(0,GS.getNumberValidator)());Bf.Factory.addGetterSetter(gu,"clipY",void 0,(0,GS.getNumberValidator)());Bf.Factory.addGetterSetter(gu,"clipWidth",void 0,(0,GS.getNumberValidator)());Bf.Factory.addGetterSetter(gu,"clipHeight",void 0,(0,GS.getNumberValidator)());Bf.Factory.addGetterSetter(gu,"clipFunc");var ZG={},mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.releaseCapture=mi.setPointerCapture=mi.hasPointerCapture=mi.createEvent=mi.getCapturedShape=void 0;const UMe=Ue,Ug=new Map,JG=UMe.Konva._global.PointerEvent!==void 0;function GMe(e){return Ug.get(e)}mi.getCapturedShape=GMe;function FA(e){return{evt:e,pointerId:e.pointerId}}mi.createEvent=FA;function HMe(e,t){return Ug.get(e)===t}mi.hasPointerCapture=HMe;function WMe(e,t){eH(e),t.getStage()&&(Ug.set(e,t),JG&&t._fire("gotpointercapture",FA(new PointerEvent("gotpointercapture"))))}mi.setPointerCapture=WMe;function eH(e,t){const n=Ug.get(e);if(!n)return;const r=n.getStage();r&&r.content,Ug.delete(e),JG&&n._fire("lostpointercapture",FA(new PointerEvent("lostpointercapture")))}mi.releaseCapture=eH;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Qt,n=ze,r=pu,i=Ue,o=Ro,s=US,a=Ue,l=mi;var c="Stage",u="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",_="mousemove",v="mousedown",y="mouseup",g="pointermove",b="pointerdown",S="pointerup",w="pointercancel",C="lostpointercapture",x="pointerout",k="pointerleave",A="pointerover",R="pointerenter",L="contextmenu",M="touchstart",E="touchend",P="touchmove",O="touchcancel",F="wheel",$=5,D=[[m,"_pointerenter"],[v,"_pointerdown"],[_,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[M,"_pointerdown"],[P,"_pointermove"],[E,"_pointerup"],[O,"_pointercancel"],[p,"_pointerover"],[F,"_wheel"],[L,"_contextmenu"],[b,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[C,"_lostpointercapture"]];const N={mouse:{[x]:f,[k]:h,[A]:p,[R]:m,[g]:_,[b]:v,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[x]:"touchout",[k]:"touchleave",[A]:"touchover",[R]:"touchenter",[g]:P,[b]:M,[S]:E,[w]:O,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[x]:x,[k]:k,[A]:A,[R]:R,[g]:g,[b]:b,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},z=ee=>ee.indexOf("pointer")>=0?"pointer":ee.indexOf("touch")>=0?"touch":"mouse",V=ee=>{const j=z(ee);if(j==="pointer")return i.Konva.pointerEventsEnabled&&N.pointer;if(j==="touch")return N.touch;if(j==="mouse")return N.mouse};function H(ee={}){return(ee.clipFunc||ee.clipWidth||ee.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),ee}const X="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 te extends r.Container{constructor(j){super(H(j)),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",()=>{H(this.attrs)}),this._checkVisibility()}_validateAdd(j){const q=j.getType()==="Layer",Z=j.getType()==="FastLayer";q||Z||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const j=this.visible()?"":"none";this.content.style.display=j}setContainer(j){if(typeof j===u){if(j.charAt(0)==="."){var q=j.slice(1);j=document.getElementsByClassName(q)[0]}else{var Z;j.charAt(0)!=="#"?Z=j:Z=j.slice(1),j=document.getElementById(Z)}if(!j)throw"Can not find container in document with id "+Z}return this._setAttr("container",j),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),j.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var j=this.children,q=j.length,Z;for(Z=0;Z<q;Z++)j[Z].clear();return this}clone(j){return j||(j={}),j.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,j)}destroy(){super.destroy();var j=this.content;j&&t.Util._isInDocument(j)&&this.container().removeChild(j);var q=e.stages.indexOf(this);return q>-1&&e.stages.splice(q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const j=this._pointerPositions[0]||this._changedPointerPositions[0];return j?{x:j.x,y:j.y}:(t.Util.warn(X),null)}_getPointerById(j){return this._pointerPositions.find(q=>q.id===j)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(j){j=j||{},j.x=j.x||0,j.y=j.y||0,j.width=j.width||this.width(),j.height=j.height||this.height();var q=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),Z=q.getContext()._context,oe=this.children;return(j.x||j.y)&&Z.translate(-1*j.x,-1*j.y),oe.forEach(function(be){if(be.isVisible()){var Me=be._toKonvaCanvas(j);Z.drawImage(Me._canvas,j.x,j.y,Me.getWidth()/Me.getPixelRatio(),Me.getHeight()/Me.getPixelRatio())}}),q}getIntersection(j){if(!j)return null;var q=this.children,Z=q.length,oe=Z-1,be;for(be=oe;be>=0;be--){const Me=q[be].getIntersection(j);if(Me)return Me}return null}_resizeDOM(){var j=this.width(),q=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=q+d),this.bufferCanvas.setSize(j,q),this.bufferHitCanvas.setSize(j,q),this.children.forEach(Z=>{Z.setSize({width:j,height:q}),Z.draw()})}add(j,...q){if(arguments.length>1){for(var Z=0;Z<arguments.length;Z++)this.add(arguments[Z]);return this}super.add(j);var oe=this.children.length;return oe>$&&t.Util.warn("The stage has "+oe+" 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."),j.setSize({width:this.width(),height:this.height()}),j.draw(),i.Konva.isBrowser&&this.content.appendChild(j.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(j){return l.hasPointerCapture(j,this)}setPointerCapture(j){l.setPointerCapture(j,this)}releaseCapture(j){l.releaseCapture(j,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&D.forEach(([j,q])=>{this.content.addEventListener(j,Z=>{this[q](Z)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const q=V(j.type);q&&this._fire(q.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const q=V(j.type);q&&this._fire(q.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let q=this[j+"targetShape"];return q&&!q.getStage()&&(q=null),q}_pointerleave(j){const q=V(j.type),Z=z(j.type);if(q){this.setPointersPositions(j);var oe=this._getTargetShape(Z),be=!s.DD.isDragging||i.Konva.hitOnDragEnabled;oe&&be?(oe._fireAndBubble(q.pointerout,{evt:j}),oe._fireAndBubble(q.pointerleave,{evt:j}),this._fire(q.pointerleave,{evt:j,target:this,currentTarget:this}),this[Z+"targetShape"]=null):be&&(this._fire(q.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(q.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(j){const q=V(j.type),Z=z(j.type);if(q){this.setPointersPositions(j);var oe=!1;this._changedPointerPositions.forEach(be=>{var Me=this.getIntersection(be);if(s.DD.justDragged=!1,i.Konva["_"+Z+"ListenClick"]=!0,!Me||!Me.isListening())return;i.Konva.capturePointerEventsEnabled&&Me.setPointerCapture(be.id),this[Z+"ClickStartShape"]=Me,Me._fireAndBubble(q.pointerdown,{evt:j,pointerId:be.id}),oe=!0;const lt=j.type.indexOf("touch")>=0;Me.preventDefault()&&j.cancelable&&lt&&j.preventDefault()}),oe||this._fire(q.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const q=V(j.type),Z=z(j.type);if(!q)return;s.DD.isDragging&&s.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var oe=!s.DD.isDragging||i.Konva.hitOnDragEnabled;if(!oe)return;var be={};let Me=!1;var lt=this._getTargetShape(Z);this._changedPointerPositions.forEach(Le=>{const we=l.getCapturedShape(Le.id)||this.getIntersection(Le),pt=Le.id,vt={evt:j,pointerId:pt};var Ce=lt!==we;if(Ce&&lt&&(lt._fireAndBubble(q.pointerout,{...vt},we),lt._fireAndBubble(q.pointerleave,{...vt},we)),we){if(be[we._id])return;be[we._id]=!0}we&&we.isListening()?(Me=!0,Ce&&(we._fireAndBubble(q.pointerover,{...vt},lt),we._fireAndBubble(q.pointerenter,{...vt},lt),this[Z+"targetShape"]=we),we._fireAndBubble(q.pointermove,{...vt})):lt&&(this._fire(q.pointerover,{evt:j,target:this,currentTarget:this,pointerId:pt}),this[Z+"targetShape"]=null)}),Me||this._fire(q.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const q=V(j.type),Z=z(j.type);if(!q)return;this.setPointersPositions(j);const oe=this[Z+"ClickStartShape"],be=this[Z+"ClickEndShape"];var Me={};let lt=!1;this._changedPointerPositions.forEach(Le=>{const we=l.getCapturedShape(Le.id)||this.getIntersection(Le);if(we){if(we.releaseCapture(Le.id),Me[we._id])return;Me[we._id]=!0}const pt=Le.id,vt={evt:j,pointerId:pt};let Ce=!1;i.Konva["_"+Z+"InDblClickWindow"]?(Ce=!0,clearTimeout(this[Z+"DblTimeout"])):s.DD.justDragged||(i.Konva["_"+Z+"InDblClickWindow"]=!0,clearTimeout(this[Z+"DblTimeout"])),this[Z+"DblTimeout"]=setTimeout(function(){i.Konva["_"+Z+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),we&&we.isListening()?(lt=!0,this[Z+"ClickEndShape"]=we,we._fireAndBubble(q.pointerup,{...vt}),i.Konva["_"+Z+"ListenClick"]&&oe&&oe===we&&(we._fireAndBubble(q.pointerclick,{...vt}),Ce&&be&&be===we&&we._fireAndBubble(q.pointerdblclick,{...vt}))):(this[Z+"ClickEndShape"]=null,i.Konva["_"+Z+"ListenClick"]&&this._fire(q.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:pt}),Ce&&this._fire(q.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:pt}))}),lt||this._fire(q.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+Z+"ListenClick"]=!1,j.cancelable&&Z!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var q=this.getIntersection(this.getPointerPosition());q&&q.isListening()?q._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var q=this.getIntersection(this.getPointerPosition());q&&q.isListening()?q._fireAndBubble(F,{evt:j}):this._fire(F,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const q=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());q&&q._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var q=this._getContentPosition(),Z=null,oe=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,be=>{this._pointerPositions.push({id:be.identifier,x:(be.clientX-q.left)/q.scaleX,y:(be.clientY-q.top)/q.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,be=>{this._changedPointerPositions.push({id:be.identifier,x:(be.clientX-q.left)/q.scaleX,y:(be.clientY-q.top)/q.scaleY})})):(Z=(j.clientX-q.left)/q.scaleX,oe=(j.clientY-q.top)/q.scaleY,this.pointerPos={x:Z,y:oe},this._pointerPositions=[{x:Z,y:oe,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:Z,y:oe,id:t.Util._getFirstPointerId(j)}])}_setPointerPosition(j){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(j)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var j=this.content.getBoundingClientRect();return{top:j.top,left:j.left,scaleX:j.width/this.content.clientWidth||1,scaleY:j.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 j=this.container();if(!j)throw"Stage has no container. A container is required.";j.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"),j.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(j){j.batchDraw()}),this}}e.Stage=te,te.prototype.nodeType=c,(0,a._registerNode)(te),n.Factory.addGetterSetter(te,"container")})(ZG);var n0={},An={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Ue,n=Qt,r=ze,i=Vt,o=xe,s=Ue,a=mi;var l="hasShadow",c="shadowRGBA",u="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(k){const A=this.attrs.fillRule;A?k.fill(A):k.fill()}function _(k){k.stroke()}function v(k){k.fill()}function y(k){k.stroke()}function g(){this._clearCache(l)}function b(){this._clearCache(c)}function S(){this._clearCache(u)}function w(){this._clearCache(d)}function C(){this._clearCache(f)}class x extends i.Node{constructor(A){super(A);let R;for(;R=n.Util.getRandomColor(),!(R&&!(R in e.shapes)););this.colorKey=R,e.shapes[R]=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(u,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var A=p();const R=A.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(R&&R.setTransform){const L=new n.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(t.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const M=L.getMatrix(),E=typeof DOMMatrix>"u"?{a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]}:new DOMMatrix(M);R.setTransform(E)}return R}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var A=this.fillLinearGradientColorStops();if(A){for(var R=p(),L=this.fillLinearGradientStartPoint(),M=this.fillLinearGradientEndPoint(),E=R.createLinearGradient(L.x,L.y,M.x,M.y),P=0;P<A.length;P+=2)E.addColorStop(A[P],A[P+1]);return E}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var A=this.fillRadialGradientColorStops();if(A){for(var R=p(),L=this.fillRadialGradientStartPoint(),M=this.fillRadialGradientEndPoint(),E=R.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),M.x,M.y,this.fillRadialGradientEndRadius()),P=0;P<A.length;P+=2)E.addColorStop(A[P],A[P+1]);return E}}getShadowRGBA(){return this._getCache(c,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var A=n.Util.colorToRGBA(this.shadowColor());if(A)return"rgba("+A.r+","+A.g+","+A.b+","+A.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 A=this.hitStrokeWidth();return A==="auto"?this.hasStroke():this.strokeEnabled()&&!!A}intersects(A){var R=this.getStage();if(!R)return!1;const L=R.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(A.x),Math.round(A.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(A){var R;if(!this.getStage()||!((R=this.attrs.perfectDrawEnabled)!==null&&R!==void 0?R:!0))return!1;const M=A||this.hasFill(),E=this.hasStroke(),P=this.getAbsoluteOpacity()!==1;if(M&&E&&P)return!0;const O=this.hasShadow(),F=this.shadowForStrokeEnabled();return!!(M&&E&&O&&F)}setStrokeHitEnabled(A){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),A?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var A=this.size();return{x:this._centroid?-A.width/2:0,y:this._centroid?-A.height/2:0,width:A.width,height:A.height}}getClientRect(A={}){const R=A.skipTransform,L=A.relativeTo,M=this.getSelfRect(),P=!A.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,O=M.width+P,F=M.height+P,$=!A.skipShadow&&this.hasShadow(),D=$?this.shadowOffsetX():0,N=$?this.shadowOffsetY():0,z=O+Math.abs(D),V=F+Math.abs(N),H=$&&this.shadowBlur()||0,X=z+H*2,te=V+H*2,ee={width:X,height:te,x:-(P/2+H)+Math.min(D,0)+M.x,y:-(P/2+H)+Math.min(N,0)+M.y};return R?ee:this._transformedRect(ee,L)}drawScene(A,R){var L=this.getLayer(),M=A||L.getCanvas(),E=M.getContext(),P=this._getCanvasCache(),O=this.getSceneFunc(),F=this.hasShadow(),$,D,N,z=M.isCache,V=R===this;if(!this.isVisible()&&!V)return this;if(P){E.save();var H=this.getAbsoluteTransform(R).getMatrix();return E.transform(H[0],H[1],H[2],H[3],H[4],H[5]),this._drawCachedSceneCanvas(E),E.restore(),this}if(!O)return this;if(E.save(),this._useBufferCanvas()&&!z){$=this.getStage(),D=$.bufferCanvas,N=D.getContext(),N.clear(),N.save(),N._applyLineJoin(this);var X=this.getAbsoluteTransform(R).getMatrix();N.transform(X[0],X[1],X[2],X[3],X[4],X[5]),O.call(this,N,this),N.restore();var te=D.pixelRatio;F&&E._applyShadow(this),E._applyOpacity(this),E._applyGlobalCompositeOperation(this),E.drawImage(D._canvas,0,0,D.width/te,D.height/te)}else{if(E._applyLineJoin(this),!V){var X=this.getAbsoluteTransform(R).getMatrix();E.transform(X[0],X[1],X[2],X[3],X[4],X[5]),E._applyOpacity(this),E._applyGlobalCompositeOperation(this)}F&&E._applyShadow(this),O.call(this,E,this)}return E.restore(),this}drawHit(A,R,L=!1){if(!this.shouldDrawHit(R,L))return this;var M=this.getLayer(),E=A||M.hitCanvas,P=E&&E.getContext(),O=this.hitFunc()||this.sceneFunc(),F=this._getCanvasCache(),$=F&&F.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()"),$){P.save();var D=this.getAbsoluteTransform(R).getMatrix();return P.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedHitCanvas(P),P.restore(),this}if(!O)return this;if(P.save(),P._applyLineJoin(this),!(this===R)){var z=this.getAbsoluteTransform(R).getMatrix();P.transform(z[0],z[1],z[2],z[3],z[4],z[5])}return O.call(this,P,this),P.restore(),this}drawHitFromCache(A=0){var R=this._getCanvasCache(),L=this._getCachedSceneCanvas(),M=R.hit,E=M.getContext(),P=M.getWidth(),O=M.getHeight(),F,$,D,N,z,V;E.clear(),E.drawImage(L._canvas,0,0,P,O);try{for(F=E.getImageData(0,0,P,O),$=F.data,D=$.length,N=n.Util._hexToRgb(this.colorKey),z=0;z<D;z+=4)V=$[z+3],V>A?($[z]=N.r,$[z+1]=N.g,$[z+2]=N.b,$[z+3]=255):$[z+3]=0;E.putImageData(F,0,0)}catch(H){n.Util.error("Unable to draw hit graph from cached scene canvas. "+H.message)}return this}hasPointerCapture(A){return a.hasPointerCapture(A,this)}setPointerCapture(A){a.setPointerCapture(A,this)}releaseCapture(A){a.releaseCapture(A,this)}}e.Shape=x,x.prototype._fillFunc=m,x.prototype._strokeFunc=_,x.prototype._fillFuncHit=v,x.prototype._strokeFuncHit=y,x.prototype._centroid=!1,x.prototype.nodeType="Shape",(0,s._registerNode)(x),x.prototype.eventListeners={},x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),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"})})(An);Object.defineProperty(n0,"__esModule",{value:!0});n0.Layer=void 0;const Fs=Qt,eC=pu,zu=Vt,DA=ze,SR=Ro,qMe=xe,KMe=An,XMe=Ue;var QMe="#",YMe="beforeDraw",ZMe="draw",tH=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],JMe=tH.length;class zf extends eC.Container{constructor(t){super(t),this.canvas=new SR.SceneCanvas,this.hitCanvas=new SR.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(){zu.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=zu.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(zu.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(zu.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 zu.Node.prototype.remove.call(this),t&&t.parentNode&&Fs.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"&&Fs.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(),zu.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(){Fs.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Fs.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Fs.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<JMe;i++){const o=tH[i],s=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),a=s.shape;if(a)return a;if(r=!!s.antialiased,!s.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=Fs.Util._rgbToHex(r[0],r[1],r[2]),s=KMe.shapes[QMe+o];return s?{shape:s}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(YMe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),eC.Container.prototype.drawScene.call(this,i,n),this._fire(ZMe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),eC.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Fs.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Fs.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 Fs.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}n0.Layer=zf;zf.prototype.nodeType="Layer";(0,XMe._registerNode)(zf);DA.Factory.addGetterSetter(zf,"imageSmoothingEnabled",!0);DA.Factory.addGetterSetter(zf,"clearBeforeDraw",!0);DA.Factory.addGetterSetter(zf,"hitGraphEnabled",!0,(0,qMe.getBooleanValidator)());var HS={};Object.defineProperty(HS,"__esModule",{value:!0});HS.FastLayer=void 0;const e9e=Qt,t9e=n0,n9e=Ue;class LA extends t9e.Layer{constructor(t){super(t),this.listening(!1),e9e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}HS.FastLayer=LA;LA.prototype.nodeType="FastLayer";(0,n9e._registerNode)(LA);var jf={};Object.defineProperty(jf,"__esModule",{value:!0});jf.Group=void 0;const r9e=Qt,i9e=pu,o9e=Ue;class BA extends i9e.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&r9e.Util.throw("You may only add groups and shapes to groups.")}}jf.Group=BA;BA.prototype.nodeType="Group";(0,o9e._registerNode)(BA);var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.Animation=void 0;const tC=Ue,xR=Qt,nC=function(){return tC.glob.performance&&tC.glob.performance.now?function(){return tC.glob.performance.now()}:function(){return new Date().getTime()}}();class as{constructor(t,n){this.id=as.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:nC(),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=as.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=nC(),as._addAnimation(this),this}stop(){return as._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,s=i.func;i._updateFrameObject(nC());const a=o.length;let l;if(s?l=s.call(i,i.frame)!==!1:l=!0,!!l)for(let c=0;c<a;c++){const u=o[c];u._id!==void 0&&(t[u._id]=u)}}for(let r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=as;t.animations.length?(t._runFrames(),xR.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,xR.Util.requestAnimFrame(this._animationLoop))}}Vf.Animation=as;as.animations=[];as.animIdCounter=0;as.animRunning=!1;var nH={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Qt,n=Vf,r=Vt,i=Ue;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,a=2,l=3,c=0,u=["fill","stroke","shadowColor"];class d{constructor(p,m,_,v,y,g,b){this.prop=p,this.propFunc=m,this.begin=v,this._pos=v,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=y-this.begin,this.pause()}fire(p){var m=this[p];m&&m()}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=a,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(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===a?this.setTime(p):this.state===l&&this.setTime(this.duration-p)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(p){var m=this,_=p.node,v=_._id,y,g=p.easing||e.Easings.Linear,b=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=_,this._id=c++;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(){m.tween.onEnterFrame()},w),this.tween=new d(S,function(C){m._tweenFunc(C)},g,0,1,y*1e3,b),this._addListeners(),f.attrs[v]||(f.attrs[v]={}),f.attrs[v][this._id]||(f.attrs[v][this._id]={}),f.tweens[v]||(f.tweens[v]={});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,m){var _=this.node,v=_._id,y,g,b,S,w,C,x,k;if(b=f.tweens[v][p],b&&delete f.attrs[v][b][p],y=_.getAttr(p),t.Util._isArray(m))if(g=[],w=Math.max(m.length,y.length),p==="points"&&m.length!==y.length&&(m.length>y.length?(x=y,y=t.Util._prepareArrayForTween(y,m,_.closed())):(C=m,m=t.Util._prepareArrayForTween(m,y,_.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-y[S]);else{var A=t.Util.colorToRGBA(y[S]);k=t.Util.colorToRGBA(m[S]),y[S]=A,g.push({r:k.r-A.r,g:k.g-A.g,b:k.b-A.b,a:k.a-A.a})}else for(S=0;S<w;S++)g.push(m[S]-y[S]);else u.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),k=t.Util.colorToRGBA(m),g={r:k.r-y.r,g:k.g-y.g,b:k.b-y.b,a:k.a-y.a}):g=m-y;f.attrs[v][this._id][p]={start:y,diff:g,end:m,trueEnd:C,trueStart:x},f.tweens[v][p]=this._id}_tweenFunc(p){var m=this.node,_=f.attrs[m._id][this._id],v,y,g,b,S,w,C,x;for(v in _){if(y=_[v],g=y.start,b=y.diff,x=y.end,t.Util._isArray(g))if(S=[],C=Math.max(g.length,x.length),v.indexOf("fill")===0)for(w=0;w<C;w++)w%2===0?S.push((g[w]||0)+b[w]*p):S.push("rgba("+Math.round(g[w].r+b[w].r*p)+","+Math.round(g[w].g+b[w].g*p)+","+Math.round(g[w].b+b[w].b*p)+","+(g[w].a+b[w].a*p)+")");else for(w=0;w<C;w++)S.push((g[w]||0)+b[w]*p);else u.indexOf(v)!==-1?S="rgba("+Math.round(g.r+b.r*p)+","+Math.round(g.g+b.g*p)+","+Math.round(g.b+b.b*p)+","+(g.a+b.a*p)+")":S=g+b*p;m.setAttr(v,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,m=f.attrs[p._id][this._id];m.points&&m.points.trueEnd&&p.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueStart&&p.points(m.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,m=this._id,_=f.tweens[p],v;this.pause();for(v in _)delete f.tweens[p][v];delete f.attrs[p][m]}}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 m=new f(h);m.play()},e.Easings={BackEaseIn(h,p,m,_){var v=1.70158;return m*(h/=_)*h*((v+1)*h-v)+p},BackEaseOut(h,p,m,_){var v=1.70158;return m*((h=h/_-1)*h*((v+1)*h+v)+1)+p},BackEaseInOut(h,p,m,_){var v=1.70158;return(h/=_/2)<1?m/2*(h*h*(((v*=1.525)+1)*h-v))+p:m/2*((h-=2)*h*(((v*=1.525)+1)*h+v)+2)+p},ElasticEaseIn(h,p,m,_,v,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!v||v<Math.abs(m)?(v=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/v),-(v*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,m,_,v,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!v||v<Math.abs(m)?(v=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/v),v*Math.pow(2,-10*h)*Math.sin((h*_-g)*(2*Math.PI)/y)+m+p)},ElasticEaseInOut(h,p,m,_,v,y){var g=0;return h===0?p:(h/=_/2)===2?p+m:(y||(y=_*(.3*1.5)),!v||v<Math.abs(m)?(v=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/v),h<1?-.5*(v*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p:v*Math.pow(2,-10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y)*.5+m+p)},BounceEaseOut(h,p,m,_){return(h/=_)<1/2.75?m*(7.5625*h*h)+p:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+p:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+p:m*(7.5625*(h-=2.625/2.75)*h+.984375)+p},BounceEaseIn(h,p,m,_){return m-e.Easings.BounceEaseOut(_-h,0,m,_)+p},BounceEaseInOut(h,p,m,_){return h<_/2?e.Easings.BounceEaseIn(h*2,0,m,_)*.5+p:e.Easings.BounceEaseOut(h*2-_,0,m,_)*.5+m*.5+p},EaseIn(h,p,m,_){return m*(h/=_)*h+p},EaseOut(h,p,m,_){return-m*(h/=_)*(h-2)+p},EaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h+p:-m/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,m,_){return m*(h/=_)*h*h*h*h+p},StrongEaseOut(h,p,m,_){return m*((h=h/_-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h*h*h*h+p:m/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,m,_){return m*h/_+p}}})(nH);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Ue,n=Qt,r=Vt,i=pu,o=ZG,s=n0,a=HS,l=jf,c=US,u=An,d=Vf,f=nH,h=ia,p=Ro;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:a.FastLayer,Group:l.Group,DD:c.DD,Shape:u.Shape,shapes:u.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(KG);var WS={};Object.defineProperty(WS,"__esModule",{value:!0});WS.Arc=void 0;const qS=ze,s9e=An,wR=Ue,KS=xe,a9e=Ue;class _a extends s9e.Shape{_sceneFunc(t){var n=wR.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=wR.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),s=1,a=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),c=o*(o>0?t:n),u=s*n,d=a*(a>0?t:n),f=l*(l>0?n:t);return{x:c,y:r?-1*f:d,width:u-c,height:f-d}}}WS.Arc=_a;_a.prototype._centroid=!0;_a.prototype.className="Arc";_a.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,a9e._registerNode)(_a);qS.Factory.addGetterSetter(_a,"innerRadius",0,(0,KS.getNumberValidator)());qS.Factory.addGetterSetter(_a,"outerRadius",0,(0,KS.getNumberValidator)());qS.Factory.addGetterSetter(_a,"angle",0,(0,KS.getNumberValidator)());qS.Factory.addGetterSetter(_a,"clockwise",!1,(0,KS.getBooleanValidator)());var XS={},r0={};Object.defineProperty(r0,"__esModule",{value:!0});r0.Line=void 0;const QS=ze,l9e=An,rH=xe,c9e=Ue;function X3(e,t,n,r,i,o,s){var a=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),c=s*a/(a+l),u=s*l/(a+l),d=n-c*(i-e),f=r-c*(o-t),h=n+u*(i-e),p=r+u*(o-t);return[d,f,h,p]}function CR(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=X3(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 Bl extends l9e.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),s=this.bezier(),a,l,c;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(a=this.getTensionPoints(),l=a.length,c=o?0:4,o||t.quadraticCurveTo(a[0],a[1],a[2],a[3]);c<l-2;)t.bezierCurveTo(a[c++],a[c++],a[c++],a[c++],a[c++],a[c++]);o||t.quadraticCurveTo(a[l-2],a[l-1],n[r-2],n[r-1])}else if(s)for(c=2;c<r;)t.bezierCurveTo(n[c++],n[c++],n[c++],n[c++],n[c++],n[c++]);else for(c=2;c<r;c+=2)t.lineTo(n[c],n[c+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():CR(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=X3(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=X3(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),s=CR(t,r),a=[i[2],i[3]].concat(s).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return a}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],i=t[1],o=t[1],s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,a),o=Math.max(o,a);return{x:n,y:i,width:r-n,height:o-i}}}r0.Line=Bl;Bl.prototype.className="Line";Bl.prototype._attrsAffectingSize=["points","bezier","tension"];(0,c9e._registerNode)(Bl);QS.Factory.addGetterSetter(Bl,"closed",!1);QS.Factory.addGetterSetter(Bl,"bezier",!1);QS.Factory.addGetterSetter(Bl,"tension",0,(0,rH.getNumberValidator)());QS.Factory.addGetterSetter(Bl,"points",[],(0,rH.getNumberArrayValidator)());var Uf={},iH={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(s,a,l)=>{let c,u,d;c=l/2,u=0;for(let h=0;h<20;h++)d=c*e.tValues[20][h]+c,u+=e.cValues[20][h]*r(s,a,d);return c*u};e.getCubicArcLength=t;const n=(s,a,l)=>{l===void 0&&(l=1);const c=s[0]-2*s[1]+s[2],u=a[0]-2*a[1]+a[2],d=2*s[1]-2*s[0],f=2*a[1]-2*a[0],h=4*(c*c+u*u),p=4*(c*d+u*f),m=d*d+f*f;if(h===0)return l*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(a[2]-a[0],2));const _=p/(2*h),v=m/h,y=l+_,g=v-_*_,b=y*y+g>0?Math.sqrt(y*y+g):0,S=_*_+g>0?Math.sqrt(_*_+g):0,w=_+Math.sqrt(_*_+g)!==0?g*Math.log(Math.abs((y+b)/(_+S))):0;return Math.sqrt(h)/2*(y*b-_*S+w)};e.getQuadraticArcLength=n;function r(s,a,l){const c=i(1,l,s),u=i(1,l,a),d=c*c+u*u;return Math.sqrt(d)}const i=(s,a,l)=>{const c=l.length-1;let u,d;if(c===0)return 0;if(s===0){d=0;for(let f=0;f<=c;f++)d+=e.binomialCoefficients[c][f]*Math.pow(1-a,c-f)*Math.pow(a,f)*l[f];return d}else{u=new Array(c);for(let f=0;f<c;f++)u[f]=c*(l[f+1]-l[f]);return i(s-1,a,u)}},o=(s,a,l)=>{let c=1,u=s/a,d=(s-l(u))/a,f=0;for(;c>.001;){const h=l(u+d),p=Math.abs(s-h)/a;if(p<c)c=p,u+=d;else{const m=l(u-d),_=Math.abs(s-m)/a;_<c?(c=_,u-=d):d/=2}if(f++,f>500)break}return u};e.t2length=o})(iH);Object.defineProperty(Uf,"__esModule",{value:!0});Uf.Path=void 0;const u9e=ze,d9e=An,f9e=Ue,ju=iH;class _n extends d9e.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=_n.parsePathData(this.data()),this.pathLength=_n.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,s=n[i].points;switch(o){case"L":t.lineTo(s[0],s[1]);break;case"M":t.moveTo(s[0],s[1]);break;case"C":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"Q":t.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case"A":var a=s[0],l=s[1],c=s[2],u=s[3],d=s[4],f=s[5],h=s[6],p=s[7],m=c>u?c:u,_=c>u?1:c/u,v=c>u?u/c:1;t.translate(a,l),t.rotate(h),t.scale(_,v),t.arc(0,0,m,d,d+f,1-p),t.scale(1/_,1/v),t.rotate(-h),t.translate(-a,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(c){if(c.command==="A"){var u=c.points[4],d=c.points[5],f=c.points[4]+d,h=Math.PI/180;if(Math.abs(u-f)<h&&(h=Math.abs(u-f)),d<0)for(let p=u-h;p>f;p-=h){const m=_n.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],p,0);t.push(m.x,m.y)}else for(let p=u+h;p<f;p+=h){const m=_n.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],p,0);t.push(m.x,m.y)}}else if(c.command==="C")for(let p=0;p<=1;p+=.01){const m=_n.getPointOnCubicBezier(p,c.start.x,c.start.y,c.points[0],c.points[1],c.points[2],c.points[3],c.points[4],c.points[5]);t.push(m.x,m.y)}else t=t.concat(c.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],isNaN(s)||(n=Math.min(n,s),r=Math.max(r,s)),isNaN(a)||(i=Math.min(i,a),o=Math.max(o,a));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return _n.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};var s=n[i],a=s.points;switch(s.command){case"L":return _n.getPointOnLine(t,s.start.x,s.start.y,a[0],a[1]);case"C":return _n.getPointOnCubicBezier((0,ju.t2length)(t,_n.getPathLength(n),m=>(0,ju.getCubicArcLength)([s.start.x,a[0],a[2],a[4]],[s.start.y,a[1],a[3],a[5]],m)),s.start.x,s.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return _n.getPointOnQuadraticBezier((0,ju.t2length)(t,_n.getPathLength(n),m=>(0,ju.getQuadraticArcLength)([s.start.x,a[0],a[2]],[s.start.y,a[1],a[3]],m)),s.start.x,s.start.y,a[0],a[1],a[2],a[3]);case"A":var l=a[0],c=a[1],u=a[2],d=a[3],f=a[4],h=a[5],p=a[6];return f+=h*t/s.pathLength,_n.getPointOnEllipticalArc(l,c,u,d,f,p)}return null}static getPointOnLine(t,n,r,i,o,s,a){s===void 0&&(s=n),a===void 0&&(a=r);var l=(o-r)/(i-n+1e-8),c=Math.sqrt(t*t/(1+l*l));i<n&&(c*=-1);var u=l*c,d;if(i===n)d={x:s,y:a+u};else if((a-r)/(s-n+1e-8)===l)d={x:s+c,y:a+u};else{var f,h,p=this.getLineLength(n,r,i,o),m=(s-n)*(i-n)+(a-r)*(o-r);m=m/(p*p),f=n+m*(i-n),h=r+m*(o-r);var _=this.getLineLength(s,a,f,h),v=Math.sqrt(t*t-_*_);c=Math.sqrt(v*v/(1+l*l)),i<n&&(c*=-1),u=l*c,d={x:f+c,y:h+u}}return d}static getPointOnCubicBezier(t,n,r,i,o,s,a,l,c){function u(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function h(_){return(1-_)*(1-_)*(1-_)}var p=l*u(t)+s*d(t)+i*f(t)+n*h(t),m=c*u(t)+a*d(t)+o*f(t)+r*h(t);return{x:p,y:m}}static getPointOnQuadraticBezier(t,n,r,i,o,s,a){function l(h){return h*h}function c(h){return 2*h*(1-h)}function u(h){return(1-h)*(1-h)}var d=s*l(t)+i*c(t)+n*u(t),f=a*l(t)+o*c(t)+r*u(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,s){var a=Math.cos(s),l=Math.sin(s),c={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(c.x*a-c.y*l),y:n+(c.x*l+c.y*a)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var o=n.split("|"),s=[],a=[],l=0,c=0,u=/([-+]?((\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),a.length=0;d=u.exec(f);)a.push(d[0]);for(var p=[],m=0,_=a.length;m<_;m++){if(a[m]==="00"){p.push(0,0);continue}var v=parseFloat(a[m]);isNaN(v)?p.push(0):p.push(v)}for(;p.length>0&&!isNaN(p[0]);){var y="",g=[],b=l,S=c,w,C,x,k,A,R,L,M,E,P;switch(h){case"l":l+=p.shift(),c+=p.shift(),y="L",g.push(l,c);break;case"L":l=p.shift(),c=p.shift(),g.push(l,c);break;case"m":var O=p.shift(),F=p.shift();if(l+=O,c+=F,y="M",s.length>2&&s[s.length-1].command==="z"){for(var $=s.length-2;$>=0;$--)if(s[$].command==="M"){l=s[$].points[0]+O,c=s[$].points[1]+F;break}}g.push(l,c),h="l";break;case"M":l=p.shift(),c=p.shift(),y="M",g.push(l,c),h="L";break;case"h":l+=p.shift(),y="L",g.push(l,c);break;case"H":l=p.shift(),y="L",g.push(l,c);break;case"v":c+=p.shift(),y="L",g.push(l,c);break;case"V":c=p.shift(),y="L",g.push(l,c);break;case"C":g.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),c=p.shift(),g.push(l,c);break;case"c":g.push(l+p.shift(),c+p.shift(),l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),y="C",g.push(l,c);break;case"S":C=l,x=c,w=s[s.length-1],w.command==="C"&&(C=l+(l-w.points[2]),x=c+(c-w.points[3])),g.push(C,x,p.shift(),p.shift()),l=p.shift(),c=p.shift(),y="C",g.push(l,c);break;case"s":C=l,x=c,w=s[s.length-1],w.command==="C"&&(C=l+(l-w.points[2]),x=c+(c-w.points[3])),g.push(C,x,l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),y="C",g.push(l,c);break;case"Q":g.push(p.shift(),p.shift()),l=p.shift(),c=p.shift(),g.push(l,c);break;case"q":g.push(l+p.shift(),c+p.shift()),l+=p.shift(),c+=p.shift(),y="Q",g.push(l,c);break;case"T":C=l,x=c,w=s[s.length-1],w.command==="Q"&&(C=l+(l-w.points[0]),x=c+(c-w.points[1])),l=p.shift(),c=p.shift(),y="Q",g.push(C,x,l,c);break;case"t":C=l,x=c,w=s[s.length-1],w.command==="Q"&&(C=l+(l-w.points[0]),x=c+(c-w.points[1])),l+=p.shift(),c+=p.shift(),y="Q",g.push(C,x,l,c);break;case"A":k=p.shift(),A=p.shift(),R=p.shift(),L=p.shift(),M=p.shift(),E=l,P=c,l=p.shift(),c=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,P,l,c,L,M,k,A,R);break;case"a":k=p.shift(),A=p.shift(),R=p.shift(),L=p.shift(),M=p.shift(),E=l,P=c,l+=p.shift(),c+=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,P,l,c,L,M,k,A,R);break}s.push({command:y||h,points:g,start:{x:b,y:S},pathLength:this.calcLength(b,S,y||h,g)})}(h==="z"||h==="Z")&&s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(t,n,r,i){var o,s,a,l,c=_n;switch(r){case"L":return c.getLineLength(t,n,i[0],i[1]);case"C":return(0,ju.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,ju.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var u=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(u-f)<h&&(h=Math.abs(u-f)),s=c.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),d<0)for(l=u-h;l>f;l-=h)a=c.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=c.getLineLength(s.x,s.y,a.x,a.y),s=a;else for(l=u+h;l<f;l+=h)a=c.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=c.getLineLength(s.x,s.y,a.x,a.y),s=a;return a=c.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=c.getLineLength(s.x,s.y,a.x,a.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,s,a,l,c){var u=c*(Math.PI/180),d=Math.cos(u)*(t-r)/2+Math.sin(u)*(n-i)/2,f=-1*Math.sin(u)*(t-r)/2+Math.cos(u)*(n-i)/2,h=d*d/(a*a)+f*f/(l*l);h>1&&(a*=Math.sqrt(h),l*=Math.sqrt(h));var p=Math.sqrt((a*a*(l*l)-a*a*(f*f)-l*l*(d*d))/(a*a*(f*f)+l*l*(d*d)));o===s&&(p*=-1),isNaN(p)&&(p=0);var m=p*a*f/l,_=p*-l*d/a,v=(t+r)/2+Math.cos(u)*m-Math.sin(u)*_,y=(n+i)/2+Math.sin(u)*m+Math.cos(u)*_,g=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1])},b=function(A,R){return(A[0]*R[0]+A[1]*R[1])/(g(A)*g(R))},S=function(A,R){return(A[0]*R[1]<A[1]*R[0]?-1:1)*Math.acos(b(A,R))},w=S([1,0],[(d-m)/a,(f-_)/l]),C=[(d-m)/a,(f-_)/l],x=[(-1*d-m)/a,(-1*f-_)/l],k=S(C,x);return b(C,x)<=-1&&(k=Math.PI),b(C,x)>=1&&(k=0),s===0&&k>0&&(k=k-2*Math.PI),s===1&&k<0&&(k=k+2*Math.PI),[v,y,a,l,w,k,u,s]}}Uf.Path=_n;_n.prototype.className="Path";_n.prototype._attrsAffectingSize=["data"];(0,f9e._registerNode)(_n);u9e.Factory.addGetterSetter(_n,"data");Object.defineProperty(XS,"__esModule",{value:!0});XS.Arrow=void 0;const YS=ze,h9e=r0,oH=xe,p9e=Ue,ER=Uf;class mu extends h9e.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var s=this.pointerLength(),a=r.length,l,c;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[a-2],r[a-1]],h=ER.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=ER.Path.getPointOnQuadraticBezier(Math.min(1,1-s/h),f[0],f[1],f[2],f[3],f[4],f[5]);l=r[a-2]-p.x,c=r[a-1]-p.y}else l=r[a-2]-r[a-4],c=r[a-1]-r[a-3];var u=(Math.atan2(c,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[a-2],r[a-1]),t.rotate(u),t.moveTo(0,0),t.lineTo(-s,d/2),t.lineTo(-s,-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],c=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],c=r[3]-r[1]),t.rotate((Math.atan2(-c,-l)+n)%n),t.moveTo(0,0),t.lineTo(-s,d/2),t.lineTo(-s,-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}}}XS.Arrow=mu;mu.prototype.className="Arrow";(0,p9e._registerNode)(mu);YS.Factory.addGetterSetter(mu,"pointerLength",10,(0,oH.getNumberValidator)());YS.Factory.addGetterSetter(mu,"pointerWidth",10,(0,oH.getNumberValidator)());YS.Factory.addGetterSetter(mu,"pointerAtBeginning",!1);YS.Factory.addGetterSetter(mu,"pointerAtEnding",!0);var ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});ZS.Circle=void 0;const g9e=ze,m9e=An,y9e=xe,v9e=Ue;class Gf extends m9e.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)}}ZS.Circle=Gf;Gf.prototype._centroid=!0;Gf.prototype.className="Circle";Gf.prototype._attrsAffectingSize=["radius"];(0,v9e._registerNode)(Gf);g9e.Factory.addGetterSetter(Gf,"radius",0,(0,y9e.getNumberValidator)());var JS={};Object.defineProperty(JS,"__esModule",{value:!0});JS.Ellipse=void 0;const zA=ze,b9e=An,sH=xe,_9e=Ue;class zl extends b9e.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)}}JS.Ellipse=zl;zl.prototype.className="Ellipse";zl.prototype._centroid=!0;zl.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,_9e._registerNode)(zl);zA.Factory.addComponentsGetterSetter(zl,"radius",["x","y"]);zA.Factory.addGetterSetter(zl,"radiusX",0,(0,sH.getNumberValidator)());zA.Factory.addGetterSetter(zl,"radiusY",0,(0,sH.getNumberValidator)());var e2={};Object.defineProperty(e2,"__esModule",{value:!0});e2.Image=void 0;const rC=Qt,yu=ze,S9e=An,x9e=Ue,i0=xe;let Ps=class aH extends S9e.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let s;if(o){const a=this.attrs.cropWidth,l=this.attrs.cropHeight;a&&l?s=[o,this.cropX(),this.cropY(),a,l,0,0,n,r]:s=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?rC.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,s))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?rC.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=rC.Util.createImageElement();i.onload=function(){var o=new aH({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};e2.Image=Ps;Ps.prototype.className="Image";(0,x9e._registerNode)(Ps);yu.Factory.addGetterSetter(Ps,"cornerRadius",0,(0,i0.getNumberOrArrayOfNumbersValidator)(4));yu.Factory.addGetterSetter(Ps,"image");yu.Factory.addComponentsGetterSetter(Ps,"crop",["x","y","width","height"]);yu.Factory.addGetterSetter(Ps,"cropX",0,(0,i0.getNumberValidator)());yu.Factory.addGetterSetter(Ps,"cropY",0,(0,i0.getNumberValidator)());yu.Factory.addGetterSetter(Ps,"cropWidth",0,(0,i0.getNumberValidator)());yu.Factory.addGetterSetter(Ps,"cropHeight",0,(0,i0.getNumberValidator)());var xf={};Object.defineProperty(xf,"__esModule",{value:!0});xf.Tag=xf.Label=void 0;const t2=ze,w9e=An,C9e=jf,jA=xe,lH=Ue;var cH=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],E9e="Change.konva",T9e="none",Q3="up",Y3="right",Z3="down",J3="left",A9e=cH.length;class VA extends C9e.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<A9e;r++)t.on(cH[r]+E9e,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,s,a,l,c;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),s=n.pointerWidth(),c=n.pointerHeight(),a=0,l=0,o){case Q3:a=r/2,l=-1*c;break;case Y3:a=r+s,l=i/2;break;case Z3:a=r/2,l=i+c;break;case J3:a=-1*s,l=i/2;break}n.setAttrs({x:-1*a,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*a,y:-1*l})}}}xf.Label=VA;VA.prototype.className="Label";(0,lH._registerNode)(VA);class vu extends w9e.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),s=this.pointerHeight(),a=this.cornerRadius();let l=0,c=0,u=0,d=0;typeof a=="number"?l=c=u=d=Math.min(a,n/2,r/2):(l=Math.min(a[0]||0,n/2,r/2),c=Math.min(a[1]||0,n/2,r/2),d=Math.min(a[2]||0,n/2,r/2),u=Math.min(a[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===Q3&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*s),t.lineTo((n+o)/2,0)),t.lineTo(n-c,0),t.arc(n-c,c,c,Math.PI*3/2,0,!1),i===Y3&&(t.lineTo(n,(r-s)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+s)/2)),t.lineTo(n,r-d),t.arc(n-d,r-d,d,0,Math.PI/2,!1),i===Z3&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+s),t.lineTo((n-o)/2,r)),t.lineTo(u,r),t.arc(u,r-u,u,Math.PI/2,Math.PI,!1),i===J3&&(t.lineTo(0,(r+s)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-s)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),s=this.width(),a=this.height();return o===Q3?(n-=i,a+=i):o===Z3?a+=i:o===J3?(t-=r*1.5,s+=r):o===Y3&&(s+=r*1.5),{x:t,y:n,width:s,height:a}}}xf.Tag=vu;vu.prototype.className="Tag";(0,lH._registerNode)(vu);t2.Factory.addGetterSetter(vu,"pointerDirection",T9e);t2.Factory.addGetterSetter(vu,"pointerWidth",0,(0,jA.getNumberValidator)());t2.Factory.addGetterSetter(vu,"pointerHeight",0,(0,jA.getNumberValidator)());t2.Factory.addGetterSetter(vu,"cornerRadius",0,(0,jA.getNumberOrArrayOfNumbersValidator)(4));var o0={};Object.defineProperty(o0,"__esModule",{value:!0});o0.Rect=void 0;const k9e=ze,P9e=An,I9e=Ue,M9e=Qt,R9e=xe;let n2=class extends P9e.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?M9e.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};o0.Rect=n2;n2.prototype.className="Rect";(0,I9e._registerNode)(n2);k9e.Factory.addGetterSetter(n2,"cornerRadius",0,(0,R9e.getNumberOrArrayOfNumbersValidator)(4));var r2={};Object.defineProperty(r2,"__esModule",{value:!0});r2.RegularPolygon=void 0;const uH=ze,O9e=An,dH=xe,$9e=Ue;class bu extends O9e.Shape{_sceneFunc(t){const n=this._getPoints();t.beginPath(),t.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)t.lineTo(n[r].x,n[r].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(var i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();var n=t[0].x,r=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(s=>{n=Math.min(n,s.x),r=Math.max(r,s.x),i=Math.min(i,s.y),o=Math.max(o,s.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}r2.RegularPolygon=bu;bu.prototype.className="RegularPolygon";bu.prototype._centroid=!0;bu.prototype._attrsAffectingSize=["radius"];(0,$9e._registerNode)(bu);uH.Factory.addGetterSetter(bu,"radius",0,(0,dH.getNumberValidator)());uH.Factory.addGetterSetter(bu,"sides",0,(0,dH.getNumberValidator)());var i2={};Object.defineProperty(i2,"__esModule",{value:!0});i2.Ring=void 0;const fH=ze,N9e=An,hH=xe,F9e=Ue;var TR=Math.PI*2;class _u extends N9e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,TR,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),TR,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)}}i2.Ring=_u;_u.prototype.className="Ring";_u.prototype._centroid=!0;_u.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,F9e._registerNode)(_u);fH.Factory.addGetterSetter(_u,"innerRadius",0,(0,hH.getNumberValidator)());fH.Factory.addGetterSetter(_u,"outerRadius",0,(0,hH.getNumberValidator)());var o2={};Object.defineProperty(o2,"__esModule",{value:!0});o2.Sprite=void 0;const Su=ze,D9e=An,L9e=Vf,pH=xe,B9e=Ue;class Is extends D9e.Shape{constructor(t){super(t),this._updated=!0,this.anim=new L9e.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+0],l=o[i+1],c=o[i+2],u=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,c,u),t.closePath(),t.fillStrokeShape(this)),d)if(s){var f=s[n],h=r*2;t.drawImage(d,a,l,c,u,f[h+0],f[h+1],c,u)}else t.drawImage(d,a,l,c,u,0,0,c,u)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+2],l=o[i+3];if(t.beginPath(),s){var c=s[n],u=r*2;t.rect(c[u+0],c[u+1],a,l)}else t.rect(0,0,a,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t<o-1?this.frameIndex(t+1):this.frameIndex(0)}}o2.Sprite=Is;Is.prototype.className="Sprite";(0,B9e._registerNode)(Is);Su.Factory.addGetterSetter(Is,"animation");Su.Factory.addGetterSetter(Is,"animations");Su.Factory.addGetterSetter(Is,"frameOffsets");Su.Factory.addGetterSetter(Is,"image");Su.Factory.addGetterSetter(Is,"frameIndex",0,(0,pH.getNumberValidator)());Su.Factory.addGetterSetter(Is,"frameRate",17,(0,pH.getNumberValidator)());Su.Factory.backCompat(Is,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var s2={};Object.defineProperty(s2,"__esModule",{value:!0});s2.Star=void 0;const UA=ze,z9e=An,GA=xe,j9e=Ue;class jl extends z9e.Shape{_sceneFunc(t){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(var o=1;o<i*2;o++){var s=o%2===0?r:n,a=s*Math.sin(o*Math.PI/i),l=-1*s*Math.cos(o*Math.PI/i);t.lineTo(a,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}s2.Star=jl;jl.prototype.className="Star";jl.prototype._centroid=!0;jl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,j9e._registerNode)(jl);UA.Factory.addGetterSetter(jl,"numPoints",5,(0,GA.getNumberValidator)());UA.Factory.addGetterSetter(jl,"innerRadius",0,(0,GA.getNumberValidator)());UA.Factory.addGetterSetter(jl,"outerRadius",0,(0,GA.getNumberValidator)());var ou={};Object.defineProperty(ou,"__esModule",{value:!0});ou.Text=ou.stringToArray=void 0;const eE=Qt,xr=ze,V9e=An,Vl=xe,U9e=Ue;function gH(e){return Array.from(e)}ou.stringToArray=gH;var Vu="auto",G9e="center",mH="inherit",Ah="justify",H9e="Change.konva",W9e="2d",AR="-",yH="left",q9e="text",K9e="Text",X9e="top",Q9e="bottom",kR="middle",vH="normal",Y9e="px ",Ty=" ",Z9e="right",PR="rtl",J9e="word",eRe="char",IR="none",iC="…",bH=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],tRe=bH.length;function nRe(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 Ay;function oC(){return Ay||(Ay=eE.Util.createCanvasElement().getContext(W9e),Ay)}function rRe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function iRe(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function oRe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class on extends V9e.Shape{constructor(t){super(oRe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<tRe;n++)this.on(bH[n]+H9e,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),s=this.lineHeight()*o,a=this.verticalAlign(),l=this.direction(),c=0,u=this.align(),d=this.getWidth(),f=this.letterSpacing(),h=this.fill(),p=this.textDecoration(),m=p.indexOf("underline")!==-1,_=p.indexOf("line-through")!==-1,v;l=l===mH?t.direction:l;var y=0,y=s/2,g=0,b=0;for(l===PR&&t.setAttr("direction",l),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",kR),t.setAttr("textAlign",yH),a===kR?c=(this.getHeight()-r*s-i*2)/2:a===Q9e&&(c=this.getHeight()-r*s-i*2),t.translate(i,c+i),v=0;v<r;v++){var g=0,b=0,S=n[v],w=S.text,C=S.width,x=S.lastInParagraph,k,A,R;if(t.save(),u===Z9e?g+=d-C-i*2:u===G9e&&(g+=(d-C-i*2)/2),m){t.save(),t.beginPath(),t.moveTo(g,y+b+Math.round(o/2)),k=w.split(" ").length-1,A=k===0,R=u===Ah&&!x?d-i*2:C,t.lineTo(g+Math.round(R),y+b+Math.round(o/2)),t.lineWidth=o/15;const F=this._getLinearGradient();t.strokeStyle=F||h,t.stroke(),t.restore()}if(_){t.save(),t.beginPath(),t.moveTo(g,y+b),k=w.split(" ").length-1,A=k===0,R=u===Ah&&x&&!A?d-i*2:C,t.lineTo(g+Math.round(R),y+b),t.lineWidth=o/15;const F=this._getLinearGradient();t.strokeStyle=F||h,t.stroke(),t.restore()}if(l!==PR&&(f!==0||u===Ah)){k=w.split(" ").length-1;for(var L=gH(w),M=0;M<L.length;M++){var E=L[M];E===" "&&!x&&u===Ah&&(g+=(d-i*2-C)/k),this._partialTextX=g,this._partialTextY=y+b,this._partialText=E,t.fillStrokeShape(this),g+=this.measureSize(E).width+f}}else f!==0&&t.setAttr("letterSpacing",`${f}px`),this._partialTextX=g,this._partialTextY=y+b,this._partialText=w,t.fillStrokeShape(this);t.restore(),r>1&&(y+=s)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=eE.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(q9e,n),this}getWidth(){var t=this.attrs.width===Vu||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Vu||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 eE.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=oC(),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()+Ty+this.fontVariant()+Ty+(this.fontSize()+Y9e)+nRe(this.fontFamily())}_addTextLine(t){this.align()===Ah&&(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 oC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,s=this.attrs.height,a=o!==Vu&&o!==void 0,l=s!==Vu&&s!==void 0,c=this.padding(),u=o-c*2,d=s-c*2,f=0,h=this.wrap(),p=h!==IR,m=h!==eRe&&p,_=this.ellipsis();this.textArr=[],oC().font=this._getContextFont();for(var v=_?this._getTextWidth(iC):0,y=0,g=t.length;y<g;++y){var b=t[y],S=this._getTextWidth(b);if(a&&S>u)for(;b.length>0;){for(var w=0,C=b.length,x="",k=0;w<C;){var A=w+C>>>1,R=b.slice(0,A+1),L=this._getTextWidth(R)+v;L<=u?(w=A+1,x=R,k=L):C=A}if(x){if(m){var M,E=b[x.length],P=E===Ty||E===AR;P&&k<=u?M=x.length:M=Math.max(x.lastIndexOf(Ty),x.lastIndexOf(AR))+1,M>0&&(w=M,x=x.slice(0,w),k=this._getTextWidth(x))}x=x.trimRight(),this._addTextLine(x),r=Math.max(r,k),f+=i;var O=this._shouldHandleEllipsis(f);if(O){this._tryToAddEllipsisToLastLine();break}if(b=b.slice(w),b=b.trimLeft(),b.length>0&&(S=this._getTextWidth(b),S<=u)){this._addTextLine(b),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(b),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<g-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!==Vu&&i!==void 0,s=this.padding(),a=i-s*2,l=this.wrap(),c=l!==IR;return!c||o&&t+r>a}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Vu&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),s=this.textArr[this.textArr.length-1];if(!(!s||!o)){if(n){var a=this._getTextWidth(s.text+iC)<i;a||(s.text=s.text.slice(0,s.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(s.text+iC)}}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()}}ou.Text=on;on.prototype._fillFunc=rRe;on.prototype._strokeFunc=iRe;on.prototype.className=K9e;on.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,U9e._registerNode)(on);xr.Factory.overWriteSetter(on,"width",(0,Vl.getNumberOrAutoValidator)());xr.Factory.overWriteSetter(on,"height",(0,Vl.getNumberOrAutoValidator)());xr.Factory.addGetterSetter(on,"direction",mH);xr.Factory.addGetterSetter(on,"fontFamily","Arial");xr.Factory.addGetterSetter(on,"fontSize",12,(0,Vl.getNumberValidator)());xr.Factory.addGetterSetter(on,"fontStyle",vH);xr.Factory.addGetterSetter(on,"fontVariant",vH);xr.Factory.addGetterSetter(on,"padding",0,(0,Vl.getNumberValidator)());xr.Factory.addGetterSetter(on,"align",yH);xr.Factory.addGetterSetter(on,"verticalAlign",X9e);xr.Factory.addGetterSetter(on,"lineHeight",1,(0,Vl.getNumberValidator)());xr.Factory.addGetterSetter(on,"wrap",J9e);xr.Factory.addGetterSetter(on,"ellipsis",!1,(0,Vl.getBooleanValidator)());xr.Factory.addGetterSetter(on,"letterSpacing",0,(0,Vl.getNumberValidator)());xr.Factory.addGetterSetter(on,"text","",(0,Vl.getStringValidator)());xr.Factory.addGetterSetter(on,"textDecoration","");var a2={};Object.defineProperty(a2,"__esModule",{value:!0});a2.TextPath=void 0;const sC=Qt,Uo=ze,sRe=An,kh=Uf,aC=ou,_H=xe,aRe=Ue;var lRe="",SH="normal";function xH(e){e.fillText(this.partialText,0,0)}function wH(e){e.strokeText(this.partialText,0,0)}class kn extends sRe.Shape{constructor(t){super(t),this.dummyCanvas=sC.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 kh.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:kh.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=kh.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&t.beginPath();for(var s=0;s<o.length;s++){t.save();var a=o[s].p0;t.translate(a.x,a.y),t.rotate(o[s].rotation),this.partialText=o[s].text,t.fillStrokeShape(this),n==="underline"&&(s===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}n==="underline"&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var o=n[i].p1;t.lineTo(o.x,o.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return sC.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 aC.Text.prototype.setText.call(this,t)}_getContextFont(){return aC.Text.prototype._getContextFont.call(this)}_getTextSize(t){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),s=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let a=0;i==="center"&&(a=Math.max(0,this.pathLength/2-s/2)),i==="right"&&(a=Math.max(0,this.pathLength-s));const l=(0,aC.stringToArray)(this.text());let c=a;for(var u=0;u<l.length;u++){const d=this._getPointAtLength(c);if(!d)return;let f=this._getTextSize(l[u]).width+r;if(l[u]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-s)/y}const h=this._getPointAtLength(c+f);if(!h)return;const p=kh.Path.getLineLength(d.x,d.y,h.x,h.y);let m=0;if(o)try{m=o(l[u-1],l[u])*this.fontSize()}catch{m=0}d.x+=m,h.x+=m,this.textWidth+=m;const _=kh.Path.getPointOnLine(m+p/2,d.x,d.y,h.x,h.y),v=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:l[u],rotation:v,p0:d,p1:h}),c+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(u){t.push(u.p0.x),t.push(u.p0.y),t.push(u.p1.x),t.push(u.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,a),o=Math.max(o,a);var c=this.fontSize();return{x:n-c/2,y:i-c/2,width:r-n+c,height:o-i+c}}destroy(){return sC.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}a2.TextPath=kn;kn.prototype._fillFunc=xH;kn.prototype._strokeFunc=wH;kn.prototype._fillFuncHit=xH;kn.prototype._strokeFuncHit=wH;kn.prototype.className="TextPath";kn.prototype._attrsAffectingSize=["text","fontSize","data"];(0,aRe._registerNode)(kn);Uo.Factory.addGetterSetter(kn,"data");Uo.Factory.addGetterSetter(kn,"fontFamily","Arial");Uo.Factory.addGetterSetter(kn,"fontSize",12,(0,_H.getNumberValidator)());Uo.Factory.addGetterSetter(kn,"fontStyle",SH);Uo.Factory.addGetterSetter(kn,"align","left");Uo.Factory.addGetterSetter(kn,"letterSpacing",0,(0,_H.getNumberValidator)());Uo.Factory.addGetterSetter(kn,"textBaseline","middle");Uo.Factory.addGetterSetter(kn,"fontVariant",SH);Uo.Factory.addGetterSetter(kn,"text",lRe);Uo.Factory.addGetterSetter(kn,"textDecoration",null);Uo.Factory.addGetterSetter(kn,"kerningFunc",null);var l2={};Object.defineProperty(l2,"__esModule",{value:!0});l2.Transformer=void 0;const bt=Qt,gt=ze,MR=Vt,cRe=An,uRe=o0,RR=jf,mo=Ue,Ul=xe,dRe=Ue;var CH="tr-konva",fRe=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${CH}`).join(" "),OR="nodesRect",hRe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],pRe={"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 gRe="ontouchstart"in mo.Konva._global;function mRe(e,t,n){if(e==="rotater")return n;t+=bt.Util.degToRad(pRe[e]||0);var r=(bt.Util.radToDeg(t)%360+360)%360;return bt.Util._inRange(r,315+22.5,360)||bt.Util._inRange(r,0,22.5)?"ns-resize":bt.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":bt.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":bt.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":bt.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":bt.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":bt.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":bt.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(bt.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var ob=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],$R=1e8;function yRe(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 EH(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 vRe(e,t){const n=yRe(e);return EH(e,t,n)}function bRe(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=mo.Konva.getAngle(e[i]),s=Math.abs(o-t)%(Math.PI*2);Math.min(s,Math.PI*2-s)<n&&(r=o)}return r}class ot extends RR.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(fRe,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return bt.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 CH+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(bt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},s=i._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");i.on(s,o),i.on(hRe.map(a=>a+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache();var r=!!this.findOne(".top-left");return r&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,s=i.y-n.y;this.nodes().forEach(a=>{if(a===t||a.isDragging())return;const l=a.getAbsolutePosition();a.setAbsolutePosition({x:l.x+o,y:l.y+s}),a.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(OR),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(OR,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),s=t.getAbsolutePosition(r),a=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const c=(mo.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),u={x:s.x+a*Math.cos(c)+l*Math.sin(-c),y:s.y+l*Math.cos(c)+a*Math.sin(c),width:i.width*o.x,height:i.height*o.y,rotation:c};return EH(u,-mo.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-$R,y:-$R,width:0,height:0,rotation:0};const n=[];this.nodes().map(c=>{const u=c.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],f=c.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new bt.Transform;r.rotate(-mo.Konva.getAngle(this.rotation()));var i=1/0,o=1/0,s=-1/0,a=-1/0;n.forEach(function(c){var u=r.point(c);i===void 0&&(i=s=u.x,o=a=u.y),i=Math.min(i,u.x),o=Math.min(o,u.y),s=Math.max(s,u.x),a=Math.max(a,u.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:s-i,height:a-o,rotation:mo.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(),ob.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var n=new uRe.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:gRe?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=mo.Konva.getAngle(this.rotation()),o=this.rotateAnchorCursor(),s=mRe(t,i,o);n.getStage().content&&(n.getStage().content.style.cursor=s),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new cRe.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()*bt.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 s=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-s.x,y:a.y-s.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),s=o.getStage();s.setPointersPositions(t);const a=s.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const c=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(c,l,t)),o.setAbsolutePosition(l);const u=o.getAbsolutePosition();if(!(c.x===u.x&&c.y===u.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=mo.Konva.getAngle(this.rotation());const E=f+M,P=mo.Konva.getAngle(this.rotationSnapTolerance()),F=bRe(this.rotationSnaps(),E,P)-d.rotation,$=vRe(d,F);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 g=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(p){var m=g?{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(m.x-o.x(),2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-left").x()>m.x?-1:1,v=this.findOne(".top-left").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*v,this.findOne(".top-left").x(m.x-n),this.findOne(".top-left").y(m.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(p){var m=g?{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()-m.x,2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-right").x()<m.x?-1:1,v=this.findOne(".top-right").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*v,this.findOne(".top-right").x(m.x+n),this.findOne(".top-right").y(m.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 m=g?{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(m.x-o.x(),2)+Math.pow(o.y()-m.y,2));var _=m.x<o.x()?-1:1,v=o.y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*v,o.x(m.x-n),o.y(m.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 m=g?{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()-m.x,2)+Math.pow(o.y()-m.y,2));var _=this.findOne(".bottom-right").x()<m.x?-1:1,v=this.findOne(".bottom-right").y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*v,this.findOne(".bottom-right").x(m.x+n),this.findOne(".bottom-right").y(m.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var g=this.centeredScaling()||t.altKey;if(g){var b=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=b.x(),C=b.y(),x=this.getWidth()-S.x(),k=this.getHeight()-S.y();S.move({x:-w,y:-C}),b.move({x,y:k})}var A=this.findOne(".top-left").getAbsolutePosition();n=A.x,r=A.y;var R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),L=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:R,height:L,rotation:mo.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(bt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(bt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var o=new bt.Transform;if(o.rotate(mo.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:bt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,a=new bt.Transform;a.translate(r.x,r.y),a.rotate(r.rotation),a.scale(r.width/s,r.height/s);const l=new bt.Transform,c=t.width/s,u=t.height/s;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(c),Math.abs(u))):(l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(c,u));const d=l.multiply(a.invert());this._nodes.forEach(f=>{var h;const p=f.getParent().getAbsoluteTransform(),m=f.getTransform().copy();m.translate(f.offsetX(),f.offsetY());const _=new bt.Transform;_.multiply(p.copy().invert()).multiply(d).multiply(p).multiply(m);const v=_.decompose();f.setAttrs(v),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(bt.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(bt.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),s=this.resizeEnabled(),a=this.padding(),l=this.anchorSize();const c=this.find("._anchor");c.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+a,offsetY:l/2+a,visible:s&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+a,visible:s&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-a,offsetY:l/2+a,visible:s&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+a,visible:s&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-a,visible:s&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+a,offsetY:l/2-a,visible:s&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-a,visible:s&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-a,offsetY:l/2-a,visible:s&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*bt.Util._sign(i)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const u=this.anchorStyleFunc();u&&c.forEach(d=>{u(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=""),RR.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return MR.Node.prototype.toObject.call(this)}clone(t){var n=MR.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}l2.Transformer=ot;function _Re(e){return e instanceof Array||bt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){ob.indexOf(t)===-1&&bt.Util.warn("Unknown anchor name: "+t+". Available names are: "+ob.join(", "))}),e||[]}ot.prototype.className="Transformer";(0,dRe._registerNode)(ot);gt.Factory.addGetterSetter(ot,"enabledAnchors",ob,_Re);gt.Factory.addGetterSetter(ot,"flipEnabled",!0,(0,Ul.getBooleanValidator)());gt.Factory.addGetterSetter(ot,"resizeEnabled",!0);gt.Factory.addGetterSetter(ot,"anchorSize",10,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"rotateEnabled",!0);gt.Factory.addGetterSetter(ot,"rotationSnaps",[]);gt.Factory.addGetterSetter(ot,"rotateAnchorOffset",50,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"rotateAnchorCursor","crosshair");gt.Factory.addGetterSetter(ot,"rotationSnapTolerance",5,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"borderEnabled",!0);gt.Factory.addGetterSetter(ot,"anchorStroke","rgb(0, 161, 255)");gt.Factory.addGetterSetter(ot,"anchorStrokeWidth",1,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"anchorFill","white");gt.Factory.addGetterSetter(ot,"anchorCornerRadius",0,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"borderStroke","rgb(0, 161, 255)");gt.Factory.addGetterSetter(ot,"borderStrokeWidth",1,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"borderDash");gt.Factory.addGetterSetter(ot,"keepRatio",!0);gt.Factory.addGetterSetter(ot,"shiftBehavior","default");gt.Factory.addGetterSetter(ot,"centeredScaling",!1);gt.Factory.addGetterSetter(ot,"ignoreStroke",!1);gt.Factory.addGetterSetter(ot,"padding",0,(0,Ul.getNumberValidator)());gt.Factory.addGetterSetter(ot,"node");gt.Factory.addGetterSetter(ot,"nodes");gt.Factory.addGetterSetter(ot,"boundBoxFunc");gt.Factory.addGetterSetter(ot,"anchorDragBoundFunc");gt.Factory.addGetterSetter(ot,"anchorStyleFunc");gt.Factory.addGetterSetter(ot,"shouldOverdrawWholeArea",!1);gt.Factory.addGetterSetter(ot,"useSingleNodeRotation",!0);gt.Factory.backCompat(ot,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var c2={};Object.defineProperty(c2,"__esModule",{value:!0});c2.Wedge=void 0;const u2=ze,SRe=An,xRe=Ue,TH=xe,wRe=Ue;class Sa extends SRe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,xRe.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)}}c2.Wedge=Sa;Sa.prototype.className="Wedge";Sa.prototype._centroid=!0;Sa.prototype._attrsAffectingSize=["radius"];(0,wRe._registerNode)(Sa);u2.Factory.addGetterSetter(Sa,"radius",0,(0,TH.getNumberValidator)());u2.Factory.addGetterSetter(Sa,"angle",0,(0,TH.getNumberValidator)());u2.Factory.addGetterSetter(Sa,"clockwise",!1);u2.Factory.backCompat(Sa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var d2={};Object.defineProperty(d2,"__esModule",{value:!0});d2.Blur=void 0;const NR=ze,CRe=Vt,ERe=xe;function FR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var TRe=[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],ARe=[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 kRe(e,t){var n=e.data,r=e.width,i=e.height,o,s,a,l,c,u,d,f,h,p,m,_,v,y,g,b,S,w,C,x,k,A,R,L,M=t+t+1,E=r-1,P=i-1,O=t+1,F=O*(O+1)/2,$=new FR,D=null,N=$,z=null,V=null,H=TRe[t],X=ARe[t];for(a=1;a<M;a++)N=N.next=new FR,a===O&&(D=N);for(N.next=$,d=u=0,s=0;s<i;s++){for(b=S=w=C=f=h=p=m=0,_=O*(x=n[u]),v=O*(k=n[u+1]),y=O*(A=n[u+2]),g=O*(R=n[u+3]),f+=F*x,h+=F*k,p+=F*A,m+=F*R,N=$,a=0;a<O;a++)N.r=x,N.g=k,N.b=A,N.a=R,N=N.next;for(a=1;a<O;a++)l=u+((E<a?E:a)<<2),f+=(N.r=x=n[l])*(L=O-a),h+=(N.g=k=n[l+1])*L,p+=(N.b=A=n[l+2])*L,m+=(N.a=R=n[l+3])*L,b+=x,S+=k,w+=A,C+=R,N=N.next;for(z=$,V=D,o=0;o<r;o++)n[u+3]=R=m*H>>X,R!==0?(R=255/R,n[u]=(f*H>>X)*R,n[u+1]=(h*H>>X)*R,n[u+2]=(p*H>>X)*R):n[u]=n[u+1]=n[u+2]=0,f-=_,h-=v,p-=y,m-=g,_-=z.r,v-=z.g,y-=z.b,g-=z.a,l=d+((l=o+t+1)<E?l:E)<<2,b+=z.r=n[l],S+=z.g=n[l+1],w+=z.b=n[l+2],C+=z.a=n[l+3],f+=b,h+=S,p+=w,m+=C,z=z.next,_+=x=V.r,v+=k=V.g,y+=A=V.b,g+=R=V.a,b-=x,S-=k,w-=A,C-=R,V=V.next,u+=4;d+=r}for(o=0;o<r;o++){for(S=w=C=b=h=p=m=f=0,u=o<<2,_=O*(x=n[u]),v=O*(k=n[u+1]),y=O*(A=n[u+2]),g=O*(R=n[u+3]),f+=F*x,h+=F*k,p+=F*A,m+=F*R,N=$,a=0;a<O;a++)N.r=x,N.g=k,N.b=A,N.a=R,N=N.next;for(c=r,a=1;a<=t;a++)u=c+o<<2,f+=(N.r=x=n[u])*(L=O-a),h+=(N.g=k=n[u+1])*L,p+=(N.b=A=n[u+2])*L,m+=(N.a=R=n[u+3])*L,b+=x,S+=k,w+=A,C+=R,N=N.next,a<P&&(c+=r);for(u=o,z=$,V=D,s=0;s<i;s++)l=u<<2,n[l+3]=R=m*H>>X,R>0?(R=255/R,n[l]=(f*H>>X)*R,n[l+1]=(h*H>>X)*R,n[l+2]=(p*H>>X)*R):n[l]=n[l+1]=n[l+2]=0,f-=_,h-=v,p-=y,m-=g,_-=z.r,v-=z.g,y-=z.b,g-=z.a,l=o+((l=s+O)<P?l:P)*r<<2,f+=b+=z.r=n[l],h+=S+=z.g=n[l+1],p+=w+=z.b=n[l+2],m+=C+=z.a=n[l+3],z=z.next,_+=x=V.r,v+=k=V.g,y+=A=V.b,g+=R=V.a,b-=x,S-=k,w-=A,C-=R,V=V.next,u+=r}}const PRe=function(t){var n=Math.round(this.blurRadius());n>0&&kRe(t,n)};d2.Blur=PRe;NR.Factory.addGetterSetter(CRe.Node,"blurRadius",0,(0,ERe.getNumberValidator)(),NR.Factory.afterSetFilter);var f2={};Object.defineProperty(f2,"__esModule",{value:!0});f2.Brighten=void 0;const DR=ze,IRe=Vt,MRe=xe,RRe=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};f2.Brighten=RRe;DR.Factory.addGetterSetter(IRe.Node,"brightness",0,(0,MRe.getNumberValidator)(),DR.Factory.afterSetFilter);var h2={};Object.defineProperty(h2,"__esModule",{value:!0});h2.Contrast=void 0;const LR=ze,ORe=Vt,$Re=xe,NRe=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,s=150,a;for(a=0;a<r;a+=4)i=n[a],o=n[a+1],s=n[a+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,s=s<0?0:s>255?255:s,n[a]=i,n[a+1]=o,n[a+2]=s};h2.Contrast=NRe;LR.Factory.addGetterSetter(ORe.Node,"contrast",0,(0,$Re.getNumberValidator)(),LR.Factory.afterSetFilter);var p2={};Object.defineProperty(p2,"__esModule",{value:!0});p2.Emboss=void 0;const Al=ze,g2=Vt,FRe=Qt,AH=xe,DRe=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,s=0,a=e.data,l=e.width,c=e.height,u=l*4,d=c;switch(r){case"top-left":o=-1,s=-1;break;case"top":o=-1,s=0;break;case"top-right":o=-1,s=1;break;case"right":o=0,s=1;break;case"bottom-right":o=1,s=1;break;case"bottom":o=1,s=0;break;case"bottom-left":o=1,s=-1;break;case"left":o=0,s=-1;break;default:FRe.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*u,h=o;d+h<1&&(h=0),d+h>c&&(h=0);var p=(d-1+h)*l*4,m=l;do{var _=f+(m-1)*4,v=s;m+v<1&&(v=0),m+v>l&&(v=0);var y=p+(m-1+v)*4,g=a[_]-a[y],b=a[_+1]-a[y+1],S=a[_+2]-a[y+2],w=g,C=w>0?w:-w,x=b>0?b:-b,k=S>0?S:-S;if(x>C&&(w=b),k>C&&(w=S),w*=t,i){var A=a[_]+w,R=a[_+1]+w,L=a[_+2]+w;a[_]=A>255?255:A<0?0:A,a[_+1]=R>255?255:R<0?0:R,a[_+2]=L>255?255:L<0?0:L}else{var M=n-w;M<0?M=0:M>255&&(M=255),a[_]=a[_+1]=a[_+2]=M}}while(--m)}while(--d)};p2.Emboss=DRe;Al.Factory.addGetterSetter(g2.Node,"embossStrength",.5,(0,AH.getNumberValidator)(),Al.Factory.afterSetFilter);Al.Factory.addGetterSetter(g2.Node,"embossWhiteLevel",.5,(0,AH.getNumberValidator)(),Al.Factory.afterSetFilter);Al.Factory.addGetterSetter(g2.Node,"embossDirection","top-left",null,Al.Factory.afterSetFilter);Al.Factory.addGetterSetter(g2.Node,"embossBlend",!1,null,Al.Factory.afterSetFilter);var m2={};Object.defineProperty(m2,"__esModule",{value:!0});m2.Enhance=void 0;const BR=ze,LRe=Vt,BRe=xe;function lC(e,t,n,r,i){var o=n-t,s=i-r,a;return o===0?r+s/2:s===0?r:(a=(e-t)/o,a=s*a+r,a)}const zRe=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,s=t[1],a=s,l,c=t[2],u=c,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<s?s=l:l>a&&(a=l),d=t[f+2],d<c?c=d:d>u&&(u=d);i===r&&(i=255,r=0),a===s&&(a=255,s=0),u===c&&(u=255,c=0);var p,m,_,v,y,g,b,S,w;for(h>0?(m=i+h*(255-i),_=r-h*(r-0),y=a+h*(255-a),g=s-h*(s-0),S=u+h*(255-u),w=c-h*(c-0)):(p=(i+r)*.5,m=i+h*(i-p),_=r+h*(r-p),v=(a+s)*.5,y=a+h*(a-v),g=s+h*(s-v),b=(u+c)*.5,S=u+h*(u-b),w=c+h*(c-b)),f=0;f<n;f+=4)t[f+0]=lC(t[f+0],r,i,_,m),t[f+1]=lC(t[f+1],s,a,g,y),t[f+2]=lC(t[f+2],c,u,w,S)}};m2.Enhance=zRe;BR.Factory.addGetterSetter(LRe.Node,"enhance",0,(0,BRe.getNumberValidator)(),BR.Factory.afterSetFilter);var y2={};Object.defineProperty(y2,"__esModule",{value:!0});y2.Grayscale=void 0;const jRe=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};y2.Grayscale=jRe;var v2={};Object.defineProperty(v2,"__esModule",{value:!0});v2.HSL=void 0;const wf=ze,HA=Vt,WA=xe;wf.Factory.addGetterSetter(HA.Node,"hue",0,(0,WA.getNumberValidator)(),wf.Factory.afterSetFilter);wf.Factory.addGetterSetter(HA.Node,"saturation",0,(0,WA.getNumberValidator)(),wf.Factory.afterSetFilter);wf.Factory.addGetterSetter(HA.Node,"luminance",0,(0,WA.getNumberValidator)(),wf.Factory.afterSetFilter);const VRe=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s=this.luminance()*127,a,l=r*i*Math.cos(o*Math.PI/180),c=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*l+.167*c,d=.587*r-.587*l+.33*c,f=.114*r-.114*l-.497*c,h=.299*r-.299*l-.328*c,p=.587*r+.413*l+.035*c,m=.114*r-.114*l+.293*c,_=.299*r-.3*l+1.25*c,v=.587*r-.586*l-1.05*c,y=.114*r+.886*l-.2*c,g,b,S,w;for(a=0;a<n;a+=4)g=t[a+0],b=t[a+1],S=t[a+2],w=t[a+3],t[a+0]=u*g+d*b+f*S+s,t[a+1]=h*g+p*b+m*S+s,t[a+2]=_*g+v*b+y*S+s,t[a+3]=w};v2.HSL=VRe;var b2={};Object.defineProperty(b2,"__esModule",{value:!0});b2.HSV=void 0;const Cf=ze,qA=Vt,KA=xe,URe=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s,a=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*a+.167*l,u=.587*r-.587*a+.33*l,d=.114*r-.114*a-.497*l,f=.299*r-.299*a-.328*l,h=.587*r+.413*a+.035*l,p=.114*r-.114*a+.293*l,m=.299*r-.3*a+1.25*l,_=.587*r-.586*a-1.05*l,v=.114*r+.886*a-.2*l,y,g,b,S;for(s=0;s<n;s+=4)y=t[s+0],g=t[s+1],b=t[s+2],S=t[s+3],t[s+0]=c*y+u*g+d*b,t[s+1]=f*y+h*g+p*b,t[s+2]=m*y+_*g+v*b,t[s+3]=S};b2.HSV=URe;Cf.Factory.addGetterSetter(qA.Node,"hue",0,(0,KA.getNumberValidator)(),Cf.Factory.afterSetFilter);Cf.Factory.addGetterSetter(qA.Node,"saturation",0,(0,KA.getNumberValidator)(),Cf.Factory.afterSetFilter);Cf.Factory.addGetterSetter(qA.Node,"value",0,(0,KA.getNumberValidator)(),Cf.Factory.afterSetFilter);var _2={};Object.defineProperty(_2,"__esModule",{value:!0});_2.Invert=void 0;const GRe=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]};_2.Invert=GRe;var S2={};Object.defineProperty(S2,"__esModule",{value:!0});S2.Kaleidoscope=void 0;const sb=ze,kH=Vt,zR=Qt,PH=xe;var HRe=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,c,u,d,f=0,h=0,p=0,m=0,_,v=Math.sqrt(a*a+l*l);u=o-a,d=s-l,_=Math.sqrt(u*u+d*d),v=_>v?_:v;var y=s,g=o,b,S,w=360/g*Math.PI/180,C,x;for(S=0;S<g;S+=1)for(C=Math.sin(S*w),x=Math.cos(S*w),b=0;b<y;b+=1)u=Math.floor(a+v*b/y*x),d=Math.floor(l+v*b/y*C),c=(d*o+u)*4,f=r[c+0],h=r[c+1],p=r[c+2],m=r[c+3],c=(S+b*o)*4,i[c+0]=f,i[c+1]=h,i[c+2]=p,i[c+3]=m},WRe=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,c,u,d,f,h,p=0,m=0,_=0,v=0,y,g=Math.sqrt(a*a+l*l);u=o-a,d=s-l,y=Math.sqrt(u*u+d*d),g=y>g?y:g;var b=s,S=o,w,C,x=n.polarRotation||0,k,A;for(u=0;u<o;u+=1)for(d=0;d<s;d+=1)f=u-a,h=d-l,w=Math.sqrt(f*f+h*h)*b/g,C=(Math.atan2(h,f)*180/Math.PI+360+x)%360,C=C*S/360,k=Math.floor(C),A=Math.floor(w),c=(A*o+k)*4,p=r[c+0],m=r[c+1],_=r[c+2],v=r[c+3],c=(d*o+u)*4,i[c+0]=p,i[c+1]=m,i[c+2]=_,i[c+3]=v};const qRe=function(e){var t=e.width,n=e.height,r,i,o,s,a,l,c,u,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(p%360)/360);if(!(h<1)){var _=zR.Util.createCanvasElement();_.width=t,_.height=n;var v=_.getContext("2d").getImageData(0,0,t,n);zR.Util.releaseCanvas(_),HRe(e,v,{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 g=y,b=0,S=g,w=1;for(m+y>t&&(b=g,S=0,w=-1),i=0;i<n;i+=1)for(r=b;r!==S;r+=w)o=Math.round(r+m)%t,d=(t*i+o)*4,a=v.data[d+0],l=v.data[d+1],c=v.data[d+2],u=v.data[d+3],f=(t*i+r)*4,v.data[f+0]=a,v.data[f+1]=l,v.data[f+2]=c,v.data[f+3]=u;for(i=0;i<n;i+=1)for(g=Math.floor(y),s=0;s<h;s+=1){for(r=0;r<g+1;r+=1)d=(t*i+r)*4,a=v.data[d+0],l=v.data[d+1],c=v.data[d+2],u=v.data[d+3],f=(t*i+g*2-r-1)*4,v.data[f+0]=a,v.data[f+1]=l,v.data[f+2]=c,v.data[f+3]=u;g*=2}WRe(v,e,{polarRotation:0})}};S2.Kaleidoscope=qRe;sb.Factory.addGetterSetter(kH.Node,"kaleidoscopePower",2,(0,PH.getNumberValidator)(),sb.Factory.afterSetFilter);sb.Factory.addGetterSetter(kH.Node,"kaleidoscopeAngle",0,(0,PH.getNumberValidator)(),sb.Factory.afterSetFilter);var x2={};Object.defineProperty(x2,"__esModule",{value:!0});x2.Mask=void 0;const jR=ze,KRe=Vt,XRe=xe;function ky(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 Ph(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 QRe(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 YRe(e,t){var n=ky(e,0,0),r=ky(e,e.width-1,0),i=ky(e,0,e.height-1),o=ky(e,e.width-1,e.height-1),s=t||10;if(Ph(n,r)<s&&Ph(r,o)<s&&Ph(o,i)<s&&Ph(i,n)<s){for(var a=QRe([r,n,o,i]),l=[],c=0;c<e.width*e.height;c++){var u=Ph(a,[e.data[c*4],e.data[c*4+1],e.data[c*4+2]]);l[c]=u<s?0:255}return l}}function ZRe(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function JRe(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var c=a*t+l,u=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=a+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];u+=e[m]*_}}s[c]=u===255*8?255:0}return s}function eOe(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var c=a*t+l,u=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=a+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];u+=e[m]*_}}s[c]=u>=255*4?255:0}return s}function tOe(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var c=a*t+l,u=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=a+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];u+=e[m]*_}}s[c]=u}return s}const nOe=function(e){var t=this.threshold(),n=YRe(e,t);return n&&(n=JRe(n,e.width,e.height),n=eOe(n,e.width,e.height),n=tOe(n,e.width,e.height),ZRe(e,n)),e};x2.Mask=nOe;jR.Factory.addGetterSetter(KRe.Node,"threshold",0,(0,XRe.getNumberValidator)(),jR.Factory.afterSetFilter);var w2={};Object.defineProperty(w2,"__esModule",{value:!0});w2.Noise=void 0;const VR=ze,rOe=Vt,iOe=xe,oOe=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()};w2.Noise=oOe;VR.Factory.addGetterSetter(rOe.Node,"noise",.2,(0,iOe.getNumberValidator)(),VR.Factory.afterSetFilter);var C2={};Object.defineProperty(C2,"__esModule",{value:!0});C2.Pixelate=void 0;const UR=ze,sOe=Qt,aOe=Vt,lOe=xe,cOe=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,s,a,l,c,u,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,m,_,v,y,g,b=e.data;if(t<=0){sOe.Util.error("pixelSize value can not be <= 0");return}for(v=0;v<d;v+=1)for(y=0;y<f;y+=1){for(a=0,l=0,c=0,u=0,h=v*t,p=h+t,m=y*t,_=m+t,g=0,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(s=(n*o+i)*4,a+=b[s+0],l+=b[s+1],c+=b[s+2],u+=b[s+3],g+=1);for(a=a/g,l=l/g,c=c/g,u=u/g,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(s=(n*o+i)*4,b[s+0]=a,b[s+1]=l,b[s+2]=c,b[s+3]=u)}};C2.Pixelate=cOe;UR.Factory.addGetterSetter(aOe.Node,"pixelSize",8,(0,lOe.getNumberValidator)(),UR.Factory.afterSetFilter);var E2={};Object.defineProperty(E2,"__esModule",{value:!0});E2.Posterize=void 0;const GR=ze,uOe=Vt,dOe=xe,fOe=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};E2.Posterize=fOe;GR.Factory.addGetterSetter(uOe.Node,"levels",.5,(0,dOe.getNumberValidator)(),GR.Factory.afterSetFilter);var T2={};Object.defineProperty(T2,"__esModule",{value:!0});T2.RGB=void 0;const ab=ze,XA=Vt,hOe=xe,pOe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),s,a;for(s=0;s<n;s+=4)a=(.34*t[s]+.5*t[s+1]+.16*t[s+2])/255,t[s]=a*r,t[s+1]=a*i,t[s+2]=a*o,t[s+3]=t[s+3]};T2.RGB=pOe;ab.Factory.addGetterSetter(XA.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ab.Factory.addGetterSetter(XA.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ab.Factory.addGetterSetter(XA.Node,"blue",0,hOe.RGBComponent,ab.Factory.afterSetFilter);var A2={};Object.defineProperty(A2,"__esModule",{value:!0});A2.RGBA=void 0;const Gg=ze,k2=Vt,gOe=xe,mOe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),s=this.alpha(),a,l;for(a=0;a<n;a+=4)l=1-s,t[a]=r*s+t[a]*l,t[a+1]=i*s+t[a+1]*l,t[a+2]=o*s+t[a+2]*l};A2.RGBA=mOe;Gg.Factory.addGetterSetter(k2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gg.Factory.addGetterSetter(k2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gg.Factory.addGetterSetter(k2.Node,"blue",0,gOe.RGBComponent,Gg.Factory.afterSetFilter);Gg.Factory.addGetterSetter(k2.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var P2={};Object.defineProperty(P2,"__esModule",{value:!0});P2.Sepia=void 0;const yOe=function(e){var t=e.data,n=t.length,r,i,o,s;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],s=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+s*.189),t[r+1]=Math.min(255,i*.349+o*.686+s*.168),t[r+2]=Math.min(255,i*.272+o*.534+s*.131)};P2.Sepia=yOe;var I2={};Object.defineProperty(I2,"__esModule",{value:!0});I2.Solarize=void 0;const vOe=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var s=(o-1)*i,a=n;do{var l=s+(a-1)*4,c=t[l],u=t[l+1],d=t[l+2];c>127&&(c=255-c),u>127&&(u=255-u),d>127&&(d=255-d),t[l]=c,t[l+1]=u,t[l+2]=d}while(--a)}while(--o)};I2.Solarize=vOe;var M2={};Object.defineProperty(M2,"__esModule",{value:!0});M2.Threshold=void 0;const HR=ze,bOe=Vt,_Oe=xe,SOe=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};M2.Threshold=SOe;HR.Factory.addGetterSetter(bOe.Node,"threshold",.5,(0,_Oe.getNumberValidator)(),HR.Factory.afterSetFilter);Object.defineProperty(zS,"__esModule",{value:!0});zS.Konva=void 0;const WR=KG,xOe=WS,wOe=XS,COe=ZS,EOe=JS,TOe=e2,qR=xf,AOe=r0,kOe=Uf,POe=o0,IOe=r2,MOe=i2,ROe=o2,OOe=s2,$Oe=ou,NOe=a2,FOe=l2,DOe=c2,LOe=d2,BOe=f2,zOe=h2,jOe=p2,VOe=m2,UOe=y2,GOe=v2,HOe=b2,WOe=_2,qOe=S2,KOe=x2,XOe=w2,QOe=C2,YOe=E2,ZOe=T2,JOe=A2,e7e=P2,t7e=I2,n7e=M2;zS.Konva=WR.Konva.Util._assign(WR.Konva,{Arc:xOe.Arc,Arrow:wOe.Arrow,Circle:COe.Circle,Ellipse:EOe.Ellipse,Image:TOe.Image,Label:qR.Label,Tag:qR.Tag,Line:AOe.Line,Path:kOe.Path,Rect:POe.Rect,RegularPolygon:IOe.RegularPolygon,Ring:MOe.Ring,Sprite:ROe.Sprite,Star:OOe.Star,Text:$Oe.Text,TextPath:NOe.TextPath,Transformer:FOe.Transformer,Wedge:DOe.Wedge,Filters:{Blur:LOe.Blur,Brighten:BOe.Brighten,Contrast:zOe.Contrast,Emboss:jOe.Emboss,Enhance:VOe.Enhance,Grayscale:UOe.Grayscale,HSL:GOe.HSL,HSV:HOe.HSV,Invert:WOe.Invert,Kaleidoscope:qOe.Kaleidoscope,Mask:KOe.Mask,Noise:XOe.Noise,Pixelate:QOe.Pixelate,Posterize:YOe.Posterize,RGB:ZOe.RGB,RGBA:JOe.RGBA,Sepia:e7e.Sepia,Solarize:t7e.Solarize,Threshold:n7e.Threshold}});var r7e=NA.exports;Object.defineProperty(r7e,"__esModule",{value:!0});const i7e=zS;NA.exports=i7e.Konva;var o7e=NA.exports;const Ih=Ml(o7e),s7e=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),s=new Ih.Stage({container:o,width:r,height:i}),a=new Ih.Layer,l=new Ih.Layer;return a.add(new Ih.Rect({...t,fill:n?"black":"white"})),e.forEach(c=>l.add(new Ih.Line({points:c.points,stroke:n?"white":"black",strokeWidth:c.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:c.tool==="brush"?"source-over":"destination-out"}))),s.add(a),s.add(l),o.remove(),s},a7e=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const s=o.getContext("2d"),a=new Image;if(!s){o.remove(),i("Unable to get context");return}a.onload=function(){s.drawImage(a,0,0),o.remove(),r(s.getImageData(0,0,t,n))},a.src=e}),KR=async(e,t)=>{const n=e.toDataURL(t);return await a7e(n,t.width,t.height)},QA=async(e,t,n,r,i)=>{const o=ue("canvas"),s=LS(),a=tMe();if(!s||!a){o.error("Unable to find canvas / stage");return}const l={...t,...n},c=s.clone();c.scale({x:1,y:1});const u=c.getAbsolutePosition(),d={x:l.x+u.x,y:l.y+u.y,width:l.width,height:l.height},f=await rb(c,d),h=await KR(c,d),p=await s7e(r?e.objects.filter(rL):[],l,i),m=await rb(p,l),_=await KR(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:_}},l7e=()=>{fe({actionCreator:K8e,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("canvas"),i=n(),o=await QA(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:s}=o;if(!s){r.error("Problem getting mask layer blob"),t(Ve({title:J("toast.problemSavingMask"),description:J("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(ce.endpoints.uploadImage.initiate({file:new File([s],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:J("toast.maskSavedAssets")}}}))}})},c7e=()=>{fe({actionCreator:J8e,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("canvas"),i=n(),{id:o}=e.payload,s=await QA(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!s)return;const{maskBlob:a}=s;if(!a){r.error("Problem getting mask layer blob"),t(Ve({title:J("toast.problemImportingMask"),description:J("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:l}=i.gallery,c=await t(ce.endpoints.uploadImage.initiate({file:new File([a],"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:J("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:u}=c;t(Nl({id:o,controlImage:u}))}})},u7e=async()=>{const e=LS();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),rb(t,t.getClientRect())},d7e=()=>{fe({actionCreator:Y8e,effect:async(e,{dispatch:t})=>{const n=B_.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await u7e();if(!r){n.error("Problem getting base layer blob"),t(Ve({title:J("toast.problemMergingCanvas"),description:J("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=LS();if(!i){n.error("Problem getting canvas base layer"),t(Ve({title:J("toast.problemMergingCanvas"),description:J("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()??void 0}),s=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:J("toast.canvasMerged")}}})).unwrap(),{image_name:a}=s;t(oue({kind:"image",layer:"base",imageName:a,...o}))}})},f7e=()=>{fe({actionCreator:q8e,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("canvas"),i=n();let o;try{o=await BS(i)}catch(a){r.error(String(a)),t(Ve({title:J("toast.problemSavingCanvas"),description:J("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(ce.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:J("toast.canvasSavedGallery")}}}))}})},h7e=(e,t,n)=>{if(!(dae.match(e)||tI.match(e)||Nl.match(e)||fae.match(e)||nI.match(e)))return!1;const{id:i}=e.payload,o=li(n.controlAdapters,i),s=li(t.controlAdapters,i);if(!o||!hi(o)||!s||!hi(s)||nI.match(e)&&o.shouldAutoConfig===!0)return!1;const{controlImage:a,processorType:l,shouldAutoConfig:c}=s;return tI.match(e)&&!c?!1:l!=="none"&&!!a},p7e=()=>{fe({predicate:h7e,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=ue("session"),{id:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(q4({id:o}))}})},g7e=()=>{fe({actionCreator:q4,effect:async(e,{dispatch:t,getState:n,take:r})=>{const i=ue("session"),{id:o}=e.payload,s=li(n().controlAdapters,o);if(!(s!=null&&s.controlImage)||!hi(s)){i.error("Unable to process ControlNet image");return}if(s.processorType==="none"||s.processorNode.type==="none")return;const a=s.processorNode.id,l={prepend:!0,batch:{graph:{nodes:{[s.processorNode.id]:{...s.processorNode,is_intermediate:!0,use_cache:!1,image:{image_name:s.controlImage}}}},runs:1}};try{const c=t(en.endpoints.enqueueBatch.initiate(l,{fixedCacheKey:"enqueueBatch"})),u=await c.unwrap();c.reset(),i.debug({enqueueResult:tt(u)},J("queue.graphQueued"));const[d]=await r(f=>L4.match(f)&&f.payload.data.queue_batch_id===u.batch.batch_id&&f.payload.data.source_node_id===a);if(QD(d.payload.data.result)){const{image_name:f}=d.payload.data.result.image,[{payload:h}]=await r(m=>ce.endpoints.getImageDTO.matchFulfilled(m)&&m.payload.image_name===f),p=h;i.debug({controlNetId:e.payload,processedControlImage:p},"ControlNet image processed"),t(X4({id:o,processedControlImage:p.image_name}))}}catch(c){if(i.error({enqueueBatchArg:tt(l)},J("queue.graphFailedToQueue")),c instanceof Object&&"data"in c&&"status"in c&&c.status===403){t(pae()),t(Nl({id:o,controlImage:null}));return}t(Ve({title:J("queue.graphFailedToQueue"),status:"error"}))}}})},YA=he("app/enqueueRequested");he("app/batchEnqueued");const m7e=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)}),y7e=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}},v7e=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},b7e=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=y7e(e.data),i=v7e(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},ve="positive_conditioning",Se="negative_conditioning",le="denoise_latents",Ku="denoise_latents_hrf",_e="latents_to_image",Xa="latents_to_image_hrf_hr",fc="latents_to_image_hrf_lr",Mh="image_to_latents_hrf",Da="resize_hrf",ep="esrgan_hrf",zc="linear_ui_output",gl="nsfw_checker",Tc="invisible_watermark",me="noise",Rh="noise_hrf",Oo="main_model_loader",R2="onnx_model_loader",ci="vae_loader",IH="lora_loader",at="clip_skip",Nt="image_to_latents",ls="resize_image",jc="img2img_resize",ae="canvas_output",At="inpaint_image",_7e="scaled_inpaint_image",Dn="inpaint_image_resize_up",nr="inpaint_image_resize_down",rt="inpaint_infill",Zs="inpaint_infill_resize_down",S7e="inpaint_final_image",Et="inpaint_create_mask",x7e="inpaint_mask",Re="canvas_coherence_denoise_latents",nt="canvas_coherence_noise",kl="canvas_coherence_noise_increment",Jt="canvas_coherence_mask_edge",Je="canvas_coherence_inpaint_create_mask",Gd="tomask",hr="mask_blur",Jn="mask_combine",Tt="mask_resize_up",mr="mask_resize_down",w7e="img_paste",Oh="control_net_collect",Py="ip_adapter_collect",$h="t2i_adapter_collect",yi="core_metadata",tp="esrgan",C7e="scale_image",pr="sdxl_model_loader",se="sdxl_denoise_latents",tc="sdxl_refiner_model_loader",Iy="sdxl_refiner_positive_conditioning",My="sdxl_refiner_negative_conditioning",Xo="sdxl_refiner_denoise_latents",ji="refiner_inpaint_create_mask",Cn="seamless",Eo="refiner_seamless",E7e=[ae,_e,Xa,gl,Tc,tp,ep,Da,fc,jc,At,_7e,Dn,nr,rt,Zs,S7e,Et,x7e,w7e,C7e],MH="text_to_image_graph",tE="image_to_image_graph",RH="canvas_text_to_image_graph",nE="canvas_image_to_image_graph",O2="canvas_inpaint_graph",$2="canvas_outpaint_graph",ZA="sdxl_text_to_image_graph",lb="sxdl_image_to_image_graph",N2="sdxl_canvas_text_to_image_graph",Hg="sdxl_canvas_image_to_image_graph",Pl="sdxl_canvas_inpaint_graph",Il="sdxl_canvas_outpaint_graph",xa=(e,t,n)=>{e.nodes[yi]={id:yi,type:"core_metadata",...t},e.edges.push({source:{node_id:yi,field:"metadata"},destination:{node_id:n,field:"metadata"}})},Bo=(e,t)=>{const n=e.nodes[yi];n&&Object.assign(n,t)},Nh=(e,t)=>{const n=e.nodes[yi];n&&delete n[t]},Fh=e=>!!e.nodes[yi],T7e=(e,t)=>{e.edges=e.edges.filter(n=>n.source.node_id!==yi),e.edges.push({source:{node_id:yi,field:"metadata"},destination:{node_id:t,field:"metadata"}})},ro=(e,t,n)=>{const r=rae(e.controlAdapters).filter(o=>{var s,a;return((s=o.model)==null?void 0:s.base_model)===((a=e.generation.model)==null?void 0:a.base_model)}),i=[];if(r.length){const o={id:Oh,type:"collect",is_intermediate:!0};t.nodes[Oh]=o,t.edges.push({source:{node_id:Oh,field:"collection"},destination:{node_id:n,field:"control"}}),Re in t.nodes&&t.edges.push({source:{node_id:Oh,field:"collection"},destination:{node_id:Re,field:"control"}}),r.forEach(s=>{if(!s.model)return;const{id:a,controlImage:l,processedControlImage:c,beginStepPct:u,endStepPct:d,controlMode:f,resizeMode:h,model:p,processorType:m,weight:_}=s,v={id:`control_net_${a}`,type:"controlnet",is_intermediate:!0,begin_step_percent:u,end_step_percent:d,control_mode:f,resize_mode:h,control_model:p,control_weight:_};if(c&&m!=="none")v.image={image_name:c};else if(l)v.image={image_name:l};else return;t.nodes[v.id]=v,i.push(uu(v,["id","type","is_intermediate"])),t.edges.push({source:{node_id:v.id,field:"control"},destination:{node_id:Oh,field:"item"}})}),Bo(t,{controlnets:i})}},io=(e,t,n)=>{const r=oae(e.controlAdapters).filter(i=>{var o,s;return((o=i.model)==null?void 0:o.base_model)===((s=e.generation.model)==null?void 0:s.base_model)});if(r.length){const i={id:Py,type:"collect",is_intermediate:!0};t.nodes[Py]=i,t.edges.push({source:{node_id:Py,field:"collection"},destination:{node_id:n,field:"ip_adapter"}}),Re in t.nodes&&t.edges.push({source:{node_id:Py,field:"collection"},destination:{node_id:Re,field:"ip_adapter"}});const o=[];r.forEach(s=>{if(!s.model)return;const{id:a,weight:l,model:c,beginStepPct:u,endStepPct:d}=s,f={id:`ip_adapter_${a}`,type:"ip_adapter",is_intermediate:!0,weight:l,ip_adapter_model:c,begin_step_percent:u,end_step_percent:d};if(s.controlImage)f.image={image_name:s.controlImage};else return;t.nodes[f.id]=f,o.push(uu(f,["id","type","is_intermediate"])),t.edges.push({source:{node_id:f.id,field:"ip_adapter"},destination:{node_id:i.id,field:"item"}})}),Bo(t,{ipAdapters:o})}},A7e=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],JA=hu(e=>e,({ui:e})=>jF(e.activeTab)?e.activeTab:"txt2img"),$We=hu(e=>e,({ui:e,config:t})=>{const r=A7e.filter(i=>!t.disabledTabs.includes(i)).indexOf(e.activeTab);return r===-1?0:r}),oo=(e,t)=>{const r=JA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,{autoAddBoardId:i}=e.gallery,o={id:zc,type:"linear_ui_output",is_intermediate:r,use_cache:!1,board:i==="none"?void 0:{board_id:i}};t.nodes[zc]=o;const s={node_id:zc,field:"image"};Tc in t.nodes?t.edges.push({source:{node_id:Tc,field:"image"},destination:s}):gl in t.nodes?t.edges.push({source:{node_id:gl,field:"image"},destination:s}):ae in t.nodes?t.edges.push({source:{node_id:ae,field:"image"},destination:s}):Xa in t.nodes?t.edges.push({source:{node_id:Xa,field:"image"},destination:s}):_e in t.nodes&&t.edges.push({source:{node_id:_e,field:"image"},destination:s})},Hf=(e,t,n,r=Oo)=>{const{loras:i}=e.lora,o=c_(i);if(o===0)return;t.edges=t.edges.filter(c=>!(c.source.node_id===r&&["unet"].includes(c.source.field))),t.edges=t.edges.filter(c=>!(c.source.node_id===at&&["clip"].includes(c.source.field)));let s="",a=0;const l=[];Fo(i,c=>{const{model_name:u,base_model:d,weight:f}=c,h=`${IH}_${u.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:u,base_model:d},weight:f};l.push({lora:{model_name:u,base_model:d},weight:f}),t.nodes[h]=p,a===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:at,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:s,field:"clip"},destination:{node_id:h,field:"clip"}})),a===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[O2,$2].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:Re,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:ve,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Se,field:"clip"}})),s=h,a+=1}),Bo(t,{loras:l})},so=(e,t,n=_e)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:gl,type:"img_nsfw",is_intermediate:!0};t.nodes[gl]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:gl,field:"image"}})},ao=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[Cn]={id:Cn,type:"seamless",seamless_x:r,seamless_y:i},r&&Bo(t,{seamless_x:r}),i&&Bo(t,{seamless_y:i});let o=le;(t.id===ZA||t.id===lb||t.id===N2||t.id===Hg||t.id===Pl||t.id===Il)&&(o=se),t.edges=t.edges.filter(s=>!(s.source.node_id===n&&["unet"].includes(s.source.field))&&!(s.source.node_id===n&&["vae"].includes(s.source.field))),t.edges.push({source:{node_id:n,field:"unet"},destination:{node_id:Cn,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:Cn,field:"vae"}},{source:{node_id:Cn,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==O2||t.id===$2||t.id===Pl||t.id===Il)&&t.edges.push({source:{node_id:Cn,field:"unet"},destination:{node_id:Re,field:"unet"}})},lo=(e,t,n)=>{const r=aae(e.controlAdapters).filter(i=>{var o,s;return((o=i.model)==null?void 0:o.base_model)===((s=e.generation.model)==null?void 0:s.base_model)});if(r.length){const i={id:$h,type:"collect",is_intermediate:!0};t.nodes[$h]=i,t.edges.push({source:{node_id:$h,field:"collection"},destination:{node_id:n,field:"t2i_adapter"}}),Re in t.nodes&&t.edges.push({source:{node_id:$h,field:"collection"},destination:{node_id:Re,field:"t2i_adapter"}});const o=[];r.forEach(s=>{if(!s.model)return;const{id:a,controlImage:l,processedControlImage:c,beginStepPct:u,endStepPct:d,resizeMode:f,model:h,processorType:p,weight:m}=s,_={id:`t2i_adapter_${a}`,type:"t2i_adapter",is_intermediate:!0,begin_step_percent:u,end_step_percent:d,resize_mode:f,t2i_adapter_model:h,weight:m};if(c&&p!=="none")_.image={image_name:c};else if(l)_.image={image_name:l};else return;t.nodes[_.id]=_,o.push(uu(_,["id","type","is_intermediate"])),t.edges.push({source:{node_id:_.id,field:"t2i_adapter"},destination:{node_id:$h,field:"item"}})}),Bo(t,{t2iAdapters:o})}},co=(e,t,n=Oo)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:s}=e.sdxl,a=["auto","manual"].includes(o),l=!r;l||(t.nodes[ci]={type:"vae_loader",id:ci,is_intermediate:!0,vae_model:r});const c=n==R2;(t.id===MH||t.id===tE||t.id===ZA||t.id===lb)&&t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:_e,field:"vae"}}),(t.id===RH||t.id===nE||t.id===N2||t.id==Hg)&&t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:a?_e:ae,field:"vae"}}),(t.id===tE||t.id===lb||t.id===nE||t.id===Hg)&&t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Nt,field:"vae"}}),(t.id===O2||t.id===$2||t.id===Pl||t.id===Il)&&(t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:At,field:"vae"}},{source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Et,field:"vae"}},{source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:_e,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Je,field:"vae"}})),s&&(t.id===Pl||t.id===Il)&&t.edges.push({source:{node_id:l?n:ci,field:l&&c?"vae_decoder":"vae"},destination:{node_id:ji,field:"vae"}}),r&&Bo(t,{vae:r})},uo=(e,t,n=_e)=>{const i=JA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[gl];if(!o)return;const a={id:Tc,type:"img_watermark",is_intermediate:i};t.nodes[Tc]=a,o.is_intermediate=!0,o.use_cache=!0,s?(s.is_intermediate=!0,t.edges.push({source:{node_id:gl,field:"image"},destination:{node_id:Tc,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Tc,field:"image"}})},k7e=(e,t)=>{const n=ue("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,cfgRescaleMultiplier:a,scheduler:l,seed:c,steps:u,img2imgStrength:d,vaePrecision:f,clipSkip:h,shouldUseCpuNoise:p,seamlessXAxis:m,seamlessYAxis:_}=e.generation,{width:v,height:y}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:g,boundingBoxScaleMethod:b}=e.canvas,S=f==="fp32",w=!0,C=["auto","manual"].includes(b);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=Oo;const k=p,A={id:nE,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:w,model:o},[at]:{type:"clip_skip",id:at,is_intermediate:w,skipped_layers:h},[ve]:{type:"compel",id:ve,is_intermediate:w,prompt:r},[Se]:{type:"compel",id:Se,is_intermediate:w,prompt:i},[me]:{type:"noise",id:me,is_intermediate:w,use_cpu:k,seed:c,width:C?g.width:v,height:C?g.height:y},[Nt]:{type:"i2l",id:Nt,is_intermediate:w},[le]:{type:"denoise_latents",id:le,is_intermediate:w,cfg_scale:s,scheduler:l,steps:u,denoising_start:1-d,denoising_end:1},[ae]:{type:"l2i",id:ae,is_intermediate:w,use_cache:!1}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}},{source:{node_id:Nt,field:"latents"},destination:{node_id:le,field:"latents"}}]};return C?(A.nodes[jc]={id:jc,type:"img_resize",is_intermediate:w,image:t,width:g.width,height:g.height},A.nodes[_e]={id:_e,type:"l2i",is_intermediate:w,fp32:S},A.nodes[ae]={id:ae,type:"img_resize",is_intermediate:w,width:v,height:y,use_cache:!1},A.edges.push({source:{node_id:jc,field:"image"},destination:{node_id:Nt,field:"image"}},{source:{node_id:le,field:"latents"},destination:{node_id:_e,field:"latents"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}})):(A.nodes[ae]={type:"l2i",id:ae,is_intermediate:w,fp32:S,use_cache:!1},A.nodes[Nt].image=t,A.edges.push({source:{node_id:le,field:"latents"},destination:{node_id:ae,field:"latents"}})),xa(A,{generation_mode:"img2img",cfg_scale:s,cfg_rescale_multiplier:a,width:C?g.width:v,height:C?g.height:y,positive_prompt:r,negative_prompt:i,model:o,seed:c,steps:u,rand_device:k?"cpu":"cuda",scheduler:l,clip_skip:h,strength:d,init_image:t.image_name},ae),(m||_)&&(ao(e,A,x),x=Cn),Hf(e,A,le),co(e,A,x),ro(e,A,le),io(e,A,le),lo(e,A,le),e.system.shouldUseNSFWChecker&&so(e,A,ae),e.system.shouldUseWatermarker&&uo(e,A,ae),oo(e,A),A},P7e=(e,t,n)=>{const r=ue("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:c,img2imgStrength:u,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:m,canvasCoherenceMode:_,canvasCoherenceSteps:v,canvasCoherenceStrength:y,clipSkip:g,seamlessXAxis:b,seamlessYAxis:S}=e.generation;if(!s)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:k}=e.canvas,A=!0,R=f==="fp32",L=["auto","manual"].includes(k);let M=Oo;const E=h,P={id:O2,nodes:{[M]:{type:"main_model_loader",id:M,is_intermediate:A,model:s},[at]:{type:"clip_skip",id:at,is_intermediate:A,skipped_layers:g},[ve]:{type:"compel",id:ve,is_intermediate:A,prompt:i},[Se]:{type:"compel",id:Se,is_intermediate:A,prompt:o},[hr]:{type:"img_blur",id:hr,is_intermediate:A,radius:p,blur_type:m},[At]:{type:"i2l",id:At,is_intermediate:A,fp32:R},[me]:{type:"noise",id:me,use_cpu:E,seed:d,is_intermediate:A},[Et]:{type:"create_denoise_mask",id:Et,is_intermediate:A,fp32:R},[le]:{type:"denoise_latents",id:le,is_intermediate:A,steps:c,cfg_scale:a,scheduler:l,denoising_start:1-u,denoising_end:1},[nt]:{type:"noise",id:nt,use_cpu:E,seed:d+1,is_intermediate:A},[kl]:{type:"add",id:kl,b:1,is_intermediate:A},[Re]:{type:"denoise_latents",id:Re,is_intermediate:A,steps:v,cfg_scale:a,scheduler:l,denoising_start:1-y,denoising_end:1},[_e]:{type:"l2i",id:_e,is_intermediate:A,fp32:R},[ae]:{type:"color_correct",id:ae,is_intermediate:A,reference:t,use_cache:!1}},edges:[{source:{node_id:M,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:M,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}},{source:{node_id:At,field:"latents"},destination:{node_id:le,field:"latents"}},{source:{node_id:hr,field:"image"},destination:{node_id:Et,field:"mask"}},{source:{node_id:Et,field:"denoise_mask"},destination:{node_id:le,field:"denoise_mask"}},{source:{node_id:M,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:nt,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:le,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Re,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(L){const O=x.width,F=x.height;P.nodes[Dn]={type:"img_resize",id:Dn,is_intermediate:A,width:O,height:F,image:t},P.nodes[Tt]={type:"img_resize",id:Tt,is_intermediate:A,width:O,height:F,image:n},P.nodes[nr]={type:"img_resize",id:nr,is_intermediate:A,width:w,height:C},P.nodes[mr]={type:"img_resize",id:mr,is_intermediate:A,width:w,height:C},P.nodes[me].width=O,P.nodes[me].height=F,P.nodes[nt].width=O,P.nodes[nt].height=F,P.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:At,field:"image"}},{source:{node_id:Tt,field:"image"},destination:{node_id:hr,field:"image"}},{source:{node_id:Dn,field:"image"},destination:{node_id:Et,field:"image"}},{source:{node_id:_e,field:"image"},destination:{node_id:nr,field:"image"}},{source:{node_id:nr,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:hr,field:"image"},destination:{node_id:mr,field:"image"}},{source:{node_id:mr,field:"image"},destination:{node_id:ae,field:"mask"}})}else P.nodes[me].width=w,P.nodes[me].height=C,P.nodes[nt].width=w,P.nodes[nt].height=C,P.nodes[At]={...P.nodes[At],image:t},P.nodes[hr]={...P.nodes[hr],image:n},P.nodes[Et]={...P.nodes[Et],image:t},P.edges.push({source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:hr,field:"image"},destination:{node_id:ae,field:"mask"}});return _!=="unmasked"&&(P.nodes[Je]={type:"create_denoise_mask",id:Je,is_intermediate:A,fp32:R},L?P.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:Je,field:"image"}}):P.nodes[Je]={...P.nodes[Je],image:t},_==="mask"&&(L?P.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Je,field:"mask"}}):P.nodes[Je]={...P.nodes[Je],mask:n}),_==="edge"&&(P.nodes[Jt]={type:"mask_edge",id:Jt,is_intermediate:A,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},L?P.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Jt,field:"image"}}):P.nodes[Jt]={...P.nodes[Jt],image:n},P.edges.push({source:{node_id:Jt,field:"image"},destination:{node_id:Je,field:"mask"}})),P.edges.push({source:{node_id:Je,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}})),(b||S)&&(ao(e,P,M),M=Cn),co(e,P,M),Hf(e,P,le,M),ro(e,P,le),io(e,P,le),lo(e,P,le),e.system.shouldUseNSFWChecker&&so(e,P,ae),e.system.shouldUseWatermarker&&uo(e,P,ae),oo(e,P),P},I7e=(e,t,n)=>{const r=ue("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:c,img2imgStrength:u,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:v,infillTileSize:y,infillPatchmatchDownscaleSize:g,infillMethod:b,clipSkip:S,seamlessXAxis:w,seamlessYAxis:C}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:k}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:A,boundingBoxScaleMethod:R}=e.canvas,L=f==="fp32",M=!0,E=["auto","manual"].includes(R);let P=Oo;const O=h,F={id:$2,nodes:{[P]:{type:"main_model_loader",id:P,is_intermediate:M,model:s},[at]:{type:"clip_skip",id:at,is_intermediate:M,skipped_layers:S},[ve]:{type:"compel",id:ve,is_intermediate:M,prompt:i},[Se]:{type:"compel",id:Se,is_intermediate:M,prompt:o},[Gd]:{type:"tomask",id:Gd,is_intermediate:M,image:t},[Jn]:{type:"mask_combine",id:Jn,is_intermediate:M,mask2:n},[At]:{type:"i2l",id:At,is_intermediate:M,fp32:L},[me]:{type:"noise",id:me,use_cpu:O,seed:d,is_intermediate:M},[Et]:{type:"create_denoise_mask",id:Et,is_intermediate:M,fp32:L},[le]:{type:"denoise_latents",id:le,is_intermediate:M,steps:c,cfg_scale:a,scheduler:l,denoising_start:1-u,denoising_end:1},[nt]:{type:"noise",id:nt,use_cpu:O,seed:d+1,is_intermediate:M},[kl]:{type:"add",id:kl,b:1,is_intermediate:M},[Re]:{type:"denoise_latents",id:Re,is_intermediate:M,steps:_,cfg_scale:a,scheduler:l,denoising_start:1-v,denoising_end:1},[_e]:{type:"l2i",id:_e,is_intermediate:M,fp32:L},[ae]:{type:"color_correct",id:ae,is_intermediate:M,use_cache:!1}},edges:[{source:{node_id:P,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:P,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:rt,field:"image"},destination:{node_id:At,field:"image"}},{source:{node_id:Gd,field:"image"},destination:{node_id:Jn,field:"mask1"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}},{source:{node_id:At,field:"latents"},destination:{node_id:le,field:"latents"}},{source:{node_id:E?Tt:Jn,field:"image"},destination:{node_id:Et,field:"mask"}},{source:{node_id:Et,field:"denoise_mask"},destination:{node_id:le,field:"denoise_mask"}},{source:{node_id:P,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:nt,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:le,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:rt,field:"image"},destination:{node_id:Et,field:"image"}},{source:{node_id:Re,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(b==="patchmatch"&&(F.nodes[rt]={type:"infill_patchmatch",id:rt,is_intermediate:M,downscale:g}),b==="lama"&&(F.nodes[rt]={type:"infill_lama",id:rt,is_intermediate:M}),b==="cv2"&&(F.nodes[rt]={type:"infill_cv2",id:rt,is_intermediate:M}),b==="tile"&&(F.nodes[rt]={type:"infill_tile",id:rt,is_intermediate:M,tile_size:y}),E){const $=A.width,D=A.height;F.nodes[Dn]={type:"img_resize",id:Dn,is_intermediate:M,width:$,height:D,image:t},F.nodes[Tt]={type:"img_resize",id:Tt,is_intermediate:M,width:$,height:D},F.nodes[nr]={type:"img_resize",id:nr,is_intermediate:M,width:x,height:k},F.nodes[Zs]={type:"img_resize",id:Zs,is_intermediate:M,width:x,height:k},F.nodes[mr]={type:"img_resize",id:mr,is_intermediate:M,width:x,height:k},F.nodes[me].width=$,F.nodes[me].height=D,F.nodes[nt].width=$,F.nodes[nt].height=D,F.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:rt,field:"image"}},{source:{node_id:Jn,field:"image"},destination:{node_id:Tt,field:"image"}},{source:{node_id:_e,field:"image"},destination:{node_id:nr,field:"image"}},{source:{node_id:Tt,field:"image"},destination:{node_id:mr,field:"image"}},{source:{node_id:rt,field:"image"},destination:{node_id:Zs,field:"image"}},{source:{node_id:Zs,field:"image"},destination:{node_id:ae,field:"reference"}},{source:{node_id:nr,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:mr,field:"image"},destination:{node_id:ae,field:"mask"}})}else F.nodes[rt]={...F.nodes[rt],image:t},F.nodes[me].width=x,F.nodes[me].height=k,F.nodes[nt].width=x,F.nodes[nt].height=k,F.nodes[At]={...F.nodes[At],image:t},F.edges.push({source:{node_id:rt,field:"image"},destination:{node_id:ae,field:"reference"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:Jn,field:"image"},destination:{node_id:ae,field:"mask"}});return m!=="unmasked"&&(F.nodes[Je]={type:"create_denoise_mask",id:Je,is_intermediate:M,fp32:L},F.edges.push({source:{node_id:rt,field:"image"},destination:{node_id:Je,field:"image"}}),m==="mask"&&(E?F.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Je,field:"mask"}}):F.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Je,field:"mask"}})),m==="edge"&&(F.nodes[Jt]={type:"mask_edge",id:Jt,is_intermediate:M,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},E?F.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Jt,field:"image"}}):F.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Jt,field:"image"}}),F.edges.push({source:{node_id:Jt,field:"image"},destination:{node_id:Je,field:"mask"}})),F.edges.push({source:{node_id:Je,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}})),(w||C)&&(ao(e,F,P),P=Cn),co(e,F,P),Hf(e,F,le,P),ro(e,F,le),io(e,F,le),lo(e,F,le),e.system.shouldUseNSFWChecker&&so(e,F,ae),e.system.shouldUseWatermarker&&uo(e,F,ae),oo(e,F),F},Wf=(e,t,n,r=pr)=>{const{loras:i}=e.lora,o=c_(i);if(o===0)return;const s=[],a=r;let l=r;[Cn,ji].includes(r)&&(l=pr),t.edges=t.edges.filter(d=>!(d.source.node_id===a&&["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 c="",u=0;Fo(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${IH}_${f.replace(".","_")}`,_={type:"sdxl_lora_loader",id:m,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};s.push(tB.parse({lora:{model_name:f,base_model:h},weight:p})),t.nodes[m]=_,u===0?(t.edges.push({source:{node_id:a,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:l,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:l,field:"clip2"},destination:{node_id:m,field:"clip2"}})):(t.edges.push({source:{node_id:c,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:c,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:c,field:"clip2"},destination:{node_id:m,field:"clip2"}})),u===o-1&&(t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[Pl,Il].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:Re,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:ve,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Se,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:ve,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Se,field:"clip2"}})),c=m,u+=1}),Bo(t,{loras:s})},xu=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:s}=e.sdxl,a=s||t?[n,i].join(" "):i,l=s||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:a,joinedNegativeStylePrompt:l}},qf=(e,t,n,r,i,o)=>{const{refinerModel:s,refinerPositiveAestheticScore:a,refinerNegativeAestheticScore:l,refinerSteps:c,refinerScheduler:u,refinerCFGScale:d,refinerStart:f}=e.sdxl,{seamlessXAxis:h,seamlessYAxis:p,vaePrecision:m}=e.generation,{boundingBoxScaleMethod:_}=e.canvas,v=m==="fp32",y=["auto","manual"].includes(_);if(!s)return;Bo(t,{refiner_model:s,refiner_positive_aesthetic_score:a,refiner_negative_aesthetic_score:l,refiner_cfg_scale:d,refiner_scheduler:u,refiner_start:f,refiner_steps:c});const g=r||pr,{joinedPositiveStylePrompt:b,joinedNegativeStylePrompt:S}=xu(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===g&&["vae"].includes(w.source.field))),t.nodes[tc]={type:"sdxl_refiner_model_loader",id:tc,model:s},t.nodes[Iy]={type:"sdxl_refiner_compel_prompt",id:Iy,style:b,aesthetic_score:a},t.nodes[My]={type:"sdxl_refiner_compel_prompt",id:My,style:S,aesthetic_score:l},t.nodes[Xo]={type:"denoise_latents",id:Xo,cfg_scale:d,steps:c,scheduler:u,denoising_start:f,denoising_end:1},h||p?(t.nodes[Eo]={id:Eo,type:"seamless",seamless_x:h,seamless_y:p},t.edges.push({source:{node_id:tc,field:"unet"},destination:{node_id:Eo,field:"unet"}},{source:{node_id:tc,field:"vae"},destination:{node_id:Eo,field:"vae"}},{source:{node_id:Eo,field:"unet"},destination:{node_id:Xo,field:"unet"}})):t.edges.push({source:{node_id:tc,field:"unet"},destination:{node_id:Xo,field:"unet"}}),t.edges.push({source:{node_id:tc,field:"clip2"},destination:{node_id:Iy,field:"clip2"}},{source:{node_id:tc,field:"clip2"},destination:{node_id:My,field:"clip2"}},{source:{node_id:Iy,field:"conditioning"},destination:{node_id:Xo,field:"positive_conditioning"}},{source:{node_id:My,field:"conditioning"},destination:{node_id:Xo,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:Xo,field:"latents"}}),(t.id===Pl||t.id===Il)&&(t.nodes[ji]={type:"create_denoise_mask",id:ji,is_intermediate:!0,fp32:v},y?t.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:ji,field:"image"}}):t.nodes[ji]={...t.nodes[ji],image:i},t.id===Pl&&(y?t.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:ji,field:"mask"}}):t.nodes[ji]={...t.nodes[ji],mask:o}),t.id===Il&&t.edges.push({source:{node_id:y?Tt:Jn,field:"image"},destination:{node_id:ji,field:"mask"}}),t.edges.push({source:{node_id:ji,field:"denoise_mask"},destination:{node_id:Xo,field:"denoise_mask"}})),t.id===N2||t.id===Hg?t.edges.push({source:{node_id:Xo,field:"latents"},destination:{node_id:y?_e:ae,field:"latents"}}):t.edges.push({source:{node_id:Xo,field:"latents"},destination:{node_id:_e,field:"latents"}})},M7e=(e,t)=>{const n=ue("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,cfgRescaleMultiplier:a,scheduler:l,seed:c,steps:u,vaePrecision:d,shouldUseCpuNoise:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{shouldUseSDXLRefiner:m,refinerStart:_,sdxlImg2ImgDenoisingStrength:v}=e.sdxl,{width:y,height:g}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:b,boundingBoxScaleMethod:S}=e.canvas,w=d==="fp32",C=!0,x=["auto","manual"].includes(S);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let k=pr;const A=f,{joinedPositiveStylePrompt:R,joinedNegativeStylePrompt:L}=xu(e),M={id:Hg,nodes:{[k]:{type:"sdxl_model_loader",id:k,model:o},[ve]:{type:"sdxl_compel_prompt",id:ve,prompt:r,style:R},[Se]:{type:"sdxl_compel_prompt",id:Se,prompt:i,style:L},[me]:{type:"noise",id:me,is_intermediate:C,use_cpu:A,seed:c,width:x?b.width:y,height:x?b.height:g},[Nt]:{type:"i2l",id:Nt,is_intermediate:C,fp32:w},[se]:{type:"denoise_latents",id:se,is_intermediate:C,cfg_scale:s,scheduler:l,steps:u,denoising_start:m?Math.min(_,1-v):1-v,denoising_end:m?_:1}},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:k,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}},{source:{node_id:Nt,field:"latents"},destination:{node_id:se,field:"latents"}}]};return x?(M.nodes[jc]={id:jc,type:"img_resize",is_intermediate:C,image:t,width:b.width,height:b.height},M.nodes[_e]={id:_e,type:"l2i",is_intermediate:C,fp32:w},M.nodes[ae]={id:ae,type:"img_resize",is_intermediate:C,width:y,height:g,use_cache:!1},M.edges.push({source:{node_id:jc,field:"image"},destination:{node_id:Nt,field:"image"}},{source:{node_id:se,field:"latents"},destination:{node_id:_e,field:"latents"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}})):(M.nodes[ae]={type:"l2i",id:ae,is_intermediate:C,fp32:w,use_cache:!1},M.nodes[Nt].image=t,M.edges.push({source:{node_id:se,field:"latents"},destination:{node_id:ae,field:"latents"}})),xa(M,{generation_mode:"img2img",cfg_scale:s,cfg_rescale_multiplier:a,width:x?b.width:y,height:x?b.height:g,positive_prompt:r,negative_prompt:i,model:o,seed:c,steps:u,rand_device:A?"cpu":"cuda",scheduler:l,strength:v,init_image:t.image_name},ae),(h||p)&&(ao(e,M,k),k=Cn),m&&(qf(e,M,se,k),(h||p)&&(k=Eo)),co(e,M,k),Wf(e,M,se,k),ro(e,M,se),io(e,M,se),lo(e,M,se),e.system.shouldUseNSFWChecker&&so(e,M,ae),e.system.shouldUseWatermarker&&uo(e,M,ae),oo(e,M),M},R7e=(e,t,n)=>{const r=ue("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:c,seed:u,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:v,seamlessXAxis:y,seamlessYAxis:g}=e.generation,{sdxlImg2ImgDenoisingStrength:b,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:k,boundingBoxScaleMethod:A}=e.canvas,R=d==="fp32",L=!0,M=["auto","manual"].includes(A);let E=pr;const P=f,{joinedPositiveStylePrompt:O,joinedNegativeStylePrompt:F}=xu(e),$={id:Pl,nodes:{[E]:{type:"sdxl_model_loader",id:E,model:s},[ve]:{type:"sdxl_compel_prompt",id:ve,prompt:i,style:O},[Se]:{type:"sdxl_compel_prompt",id:Se,prompt:o,style:F},[hr]:{type:"img_blur",id:hr,is_intermediate:L,radius:h,blur_type:p},[At]:{type:"i2l",id:At,is_intermediate:L,fp32:R},[me]:{type:"noise",id:me,use_cpu:P,seed:u,is_intermediate:L},[Et]:{type:"create_denoise_mask",id:Et,is_intermediate:L,fp32:R},[se]:{type:"denoise_latents",id:se,is_intermediate:L,steps:c,cfg_scale:a,scheduler:l,denoising_start:S?Math.min(w,1-b):1-b,denoising_end:S?w:1},[nt]:{type:"noise",id:nt,use_cpu:P,seed:u+1,is_intermediate:L},[kl]:{type:"add",id:kl,b:1,is_intermediate:L},[Re]:{type:"denoise_latents",id:Re,is_intermediate:L,steps:_,cfg_scale:a,scheduler:l,denoising_start:1-v,denoising_end:1},[_e]:{type:"l2i",id:_e,is_intermediate:L,fp32:R},[ae]:{type:"color_correct",id:ae,is_intermediate:L,reference:t,use_cache:!1}},edges:[{source:{node_id:E,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:E,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:E,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}},{source:{node_id:At,field:"latents"},destination:{node_id:se,field:"latents"}},{source:{node_id:hr,field:"image"},destination:{node_id:Et,field:"mask"}},{source:{node_id:Et,field:"denoise_mask"},destination:{node_id:se,field:"denoise_mask"}},{source:{node_id:E,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:nt,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:se,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Re,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(M){const D=k.width,N=k.height;$.nodes[Dn]={type:"img_resize",id:Dn,is_intermediate:L,width:D,height:N,image:t},$.nodes[Tt]={type:"img_resize",id:Tt,is_intermediate:L,width:D,height:N,image:n},$.nodes[nr]={type:"img_resize",id:nr,is_intermediate:L,width:C,height:x},$.nodes[mr]={type:"img_resize",id:mr,is_intermediate:L,width:C,height:x},$.nodes[me].width=D,$.nodes[me].height=N,$.nodes[nt].width=D,$.nodes[nt].height=N,$.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:At,field:"image"}},{source:{node_id:Tt,field:"image"},destination:{node_id:hr,field:"image"}},{source:{node_id:Dn,field:"image"},destination:{node_id:Et,field:"image"}},{source:{node_id:_e,field:"image"},destination:{node_id:nr,field:"image"}},{source:{node_id:nr,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:hr,field:"image"},destination:{node_id:mr,field:"image"}},{source:{node_id:mr,field:"image"},destination:{node_id:ae,field:"mask"}})}else $.nodes[me].width=C,$.nodes[me].height=x,$.nodes[nt].width=C,$.nodes[nt].height=x,$.nodes[At]={...$.nodes[At],image:t},$.nodes[hr]={...$.nodes[hr],image:n},$.nodes[Et]={...$.nodes[Et],image:t},$.edges.push({source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:hr,field:"image"},destination:{node_id:ae,field:"mask"}});return m!=="unmasked"&&($.nodes[Je]={type:"create_denoise_mask",id:Je,is_intermediate:L,fp32:R},M?$.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:Je,field:"image"}}):$.nodes[Je]={...$.nodes[Je],image:t},m==="mask"&&(M?$.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Je,field:"mask"}}):$.nodes[Je]={...$.nodes[Je],mask:n}),m==="edge"&&($.nodes[Jt]={type:"mask_edge",id:Jt,is_intermediate:L,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},M?$.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Jt,field:"image"}}):$.nodes[Jt]={...$.nodes[Jt],image:n},$.edges.push({source:{node_id:Jt,field:"image"},destination:{node_id:Je,field:"mask"}})),$.edges.push({source:{node_id:Je,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}})),(y||g)&&(ao(e,$,E),E=Cn),S&&(qf(e,$,Re,E,t,n),(y||g)&&(E=Eo)),co(e,$,E),Wf(e,$,se,E),ro(e,$,se),io(e,$,se),lo(e,$,se),e.system.shouldUseNSFWChecker&&so(e,$,ae),e.system.shouldUseWatermarker&&uo(e,$,ae),oo(e,$),$},O7e=(e,t,n)=>{const r=ue("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:c,seed:u,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:m,canvasCoherenceStrength:_,infillTileSize:v,infillPatchmatchDownscaleSize:y,infillMethod:g,seamlessXAxis:b,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:C,refinerStart:x}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:k,height:A}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:R,boundingBoxScaleMethod:L}=e.canvas,M=d==="fp32",E=!0,P=["auto","manual"].includes(L);let O=pr;const F=f,{joinedPositiveStylePrompt:$,joinedNegativeStylePrompt:D}=xu(e),N={id:Il,nodes:{[pr]:{type:"sdxl_model_loader",id:pr,model:s},[ve]:{type:"sdxl_compel_prompt",id:ve,prompt:i,style:$},[Se]:{type:"sdxl_compel_prompt",id:Se,prompt:o,style:D},[Gd]:{type:"tomask",id:Gd,is_intermediate:E,image:t},[Jn]:{type:"mask_combine",id:Jn,is_intermediate:E,mask2:n},[At]:{type:"i2l",id:At,is_intermediate:E,fp32:M},[me]:{type:"noise",id:me,use_cpu:F,seed:u,is_intermediate:E},[Et]:{type:"create_denoise_mask",id:Et,is_intermediate:E,fp32:M},[se]:{type:"denoise_latents",id:se,is_intermediate:E,steps:c,cfg_scale:a,scheduler:l,denoising_start:C?Math.min(x,1-w):1-w,denoising_end:C?x:1},[nt]:{type:"noise",id:nt,use_cpu:F,seed:u+1,is_intermediate:E},[kl]:{type:"add",id:kl,b:1,is_intermediate:E},[Re]:{type:"denoise_latents",id:Re,is_intermediate:E,steps:m,cfg_scale:a,scheduler:l,denoising_start:1-_,denoising_end:1},[_e]:{type:"l2i",id:_e,is_intermediate:E,fp32:M},[ae]:{type:"color_correct",id:ae,is_intermediate:E,use_cache:!1}},edges:[{source:{node_id:pr,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:pr,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:pr,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:pr,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:pr,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:rt,field:"image"},destination:{node_id:At,field:"image"}},{source:{node_id:Gd,field:"image"},destination:{node_id:Jn,field:"mask1"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}},{source:{node_id:At,field:"latents"},destination:{node_id:se,field:"latents"}},{source:{node_id:P?Tt:Jn,field:"image"},destination:{node_id:Et,field:"mask"}},{source:{node_id:Et,field:"denoise_mask"},destination:{node_id:se,field:"denoise_mask"}},{source:{node_id:O,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:nt,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:se,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:rt,field:"image"},destination:{node_id:Et,field:"image"}},{source:{node_id:Re,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(g==="patchmatch"&&(N.nodes[rt]={type:"infill_patchmatch",id:rt,is_intermediate:E,downscale:y}),g==="lama"&&(N.nodes[rt]={type:"infill_lama",id:rt,is_intermediate:E}),g==="cv2"&&(N.nodes[rt]={type:"infill_cv2",id:rt,is_intermediate:E}),g==="tile"&&(N.nodes[rt]={type:"infill_tile",id:rt,is_intermediate:E,tile_size:v}),P){const z=R.width,V=R.height;N.nodes[Dn]={type:"img_resize",id:Dn,is_intermediate:E,width:z,height:V,image:t},N.nodes[Tt]={type:"img_resize",id:Tt,is_intermediate:E,width:z,height:V},N.nodes[nr]={type:"img_resize",id:nr,is_intermediate:E,width:k,height:A},N.nodes[Zs]={type:"img_resize",id:Zs,is_intermediate:E,width:k,height:A},N.nodes[mr]={type:"img_resize",id:mr,is_intermediate:E,width:k,height:A},N.nodes[me].width=z,N.nodes[me].height=V,N.nodes[nt].width=z,N.nodes[nt].height=V,N.edges.push({source:{node_id:Dn,field:"image"},destination:{node_id:rt,field:"image"}},{source:{node_id:Jn,field:"image"},destination:{node_id:Tt,field:"image"}},{source:{node_id:_e,field:"image"},destination:{node_id:nr,field:"image"}},{source:{node_id:Tt,field:"image"},destination:{node_id:mr,field:"image"}},{source:{node_id:rt,field:"image"},destination:{node_id:Zs,field:"image"}},{source:{node_id:Zs,field:"image"},destination:{node_id:ae,field:"reference"}},{source:{node_id:nr,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:mr,field:"image"},destination:{node_id:ae,field:"mask"}})}else N.nodes[rt]={...N.nodes[rt],image:t},N.nodes[me].width=k,N.nodes[me].height=A,N.nodes[nt].width=k,N.nodes[nt].height=A,N.nodes[At]={...N.nodes[At],image:t},N.edges.push({source:{node_id:rt,field:"image"},destination:{node_id:ae,field:"reference"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}},{source:{node_id:Jn,field:"image"},destination:{node_id:ae,field:"mask"}});return p!=="unmasked"&&(N.nodes[Je]={type:"create_denoise_mask",id:Je,is_intermediate:E,fp32:M},N.edges.push({source:{node_id:rt,field:"image"},destination:{node_id:Je,field:"image"}}),p==="mask"&&(P?N.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Je,field:"mask"}}):N.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Je,field:"mask"}})),p==="edge"&&(N.nodes[Jt]={type:"mask_edge",id:Jt,is_intermediate:E,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},P?N.edges.push({source:{node_id:Tt,field:"image"},destination:{node_id:Jt,field:"image"}}):N.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Jt,field:"image"}}),N.edges.push({source:{node_id:Jt,field:"image"},destination:{node_id:Je,field:"mask"}})),N.edges.push({source:{node_id:Je,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}})),(b||S)&&(ao(e,N,O),O=Cn),C&&(qf(e,N,Re,O,t),(b||S)&&(O=Eo)),co(e,N,O),Wf(e,N,se,O),ro(e,N,se),io(e,N,se),lo(e,N,se),e.system.shouldUseNSFWChecker&&so(e,N,ae),e.system.shouldUseWatermarker&&uo(e,N,ae),oo(e,N),N},$7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,seed:l,steps:c,vaePrecision:u,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:_,boundingBoxScaleMethod:v}=e.canvas,y=u==="fp32",g=!0,b=["auto","manual"].includes(v),{shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const C=d,x=i.model_type==="onnx";let k=x?R2:pr;const A=x?"onnx_model_loader":"sdxl_model_loader",R=x?{type:"t2l_onnx",id:se,is_intermediate:g,cfg_scale:o,scheduler:a,steps:c}:{type:"denoise_latents",id:se,is_intermediate:g,cfg_scale:o,scheduler:a,steps:c,denoising_start:0,denoising_end:S?w:1},{joinedPositiveStylePrompt:L,joinedNegativeStylePrompt:M}=xu(e),E={id:N2,nodes:{[k]:{type:A,id:k,is_intermediate:g,model:i},[ve]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:ve,is_intermediate:g,prompt:n,style:L},[Se]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:Se,is_intermediate:g,prompt:r,style:M},[me]:{type:"noise",id:me,is_intermediate:g,seed:l,width:b?_.width:p,height:b?_.height:m,use_cpu:C},[R.id]:R},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:k,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}}]};return b?(E.nodes[_e]={id:_e,type:x?"l2i_onnx":"l2i",is_intermediate:g,fp32:y},E.nodes[ae]={id:ae,type:"img_resize",is_intermediate:g,width:p,height:m,use_cache:!1},E.edges.push({source:{node_id:se,field:"latents"},destination:{node_id:_e,field:"latents"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}})):(E.nodes[ae]={type:x?"l2i_onnx":"l2i",id:ae,is_intermediate:g,fp32:y,use_cache:!1},E.edges.push({source:{node_id:se,field:"latents"},destination:{node_id:ae,field:"latents"}})),xa(E,{generation_mode:"txt2img",cfg_scale:o,cfg_rescale_multiplier:s,width:b?_.width:p,height:b?_.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:l,steps:c,rand_device:C?"cpu":"cuda",scheduler:a},ae),(f||h)&&(ao(e,E,k),k=Cn),S&&(qf(e,E,se,k),(f||h)&&(k=Eo)),Wf(e,E,se,k),co(e,E,k),ro(e,E,se),io(e,E,se),lo(e,E,se),e.system.shouldUseNSFWChecker&&so(e,E,ae),e.system.shouldUseWatermarker&&uo(e,E,ae),oo(e,E),E},N7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,seed:l,steps:c,vaePrecision:u,clipSkip:d,shouldUseCpuNoise:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{width:m,height:_}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:v,boundingBoxScaleMethod:y}=e.canvas,g=u==="fp32",b=!0,S=["auto","manual"].includes(y);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=f,C=i.model_type==="onnx";let x=C?R2:Oo;const k=C?"onnx_model_loader":"main_model_loader",A=C?{type:"t2l_onnx",id:le,is_intermediate:b,cfg_scale:o,scheduler:a,steps:c}:{type:"denoise_latents",id:le,is_intermediate:b,cfg_scale:o,scheduler:a,steps:c,denoising_start:0,denoising_end:1},R={id:RH,nodes:{[x]:{type:k,id:x,is_intermediate:b,model:i},[at]:{type:"clip_skip",id:at,is_intermediate:b,skipped_layers:d},[ve]:{type:C?"prompt_onnx":"compel",id:ve,is_intermediate:b,prompt:n},[Se]:{type:C?"prompt_onnx":"compel",id:Se,is_intermediate:b,prompt:r},[me]:{type:"noise",id:me,is_intermediate:b,seed:l,width:S?v.width:m,height:S?v.height:_,use_cpu:w},[A.id]:A},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}}]};return S?(R.nodes[_e]={id:_e,type:C?"l2i_onnx":"l2i",is_intermediate:b,fp32:g},R.nodes[ae]={id:ae,type:"img_resize",is_intermediate:b,width:m,height:_,use_cache:!1},R.edges.push({source:{node_id:le,field:"latents"},destination:{node_id:_e,field:"latents"}},{source:{node_id:_e,field:"image"},destination:{node_id:ae,field:"image"}})):(R.nodes[ae]={type:C?"l2i_onnx":"l2i",id:ae,is_intermediate:b,fp32:g,use_cache:!1},R.edges.push({source:{node_id:le,field:"latents"},destination:{node_id:ae,field:"latents"}})),xa(R,{generation_mode:"txt2img",cfg_scale:o,cfg_rescale_multiplier:s,width:S?v.width:m,height:S?v.height:_,positive_prompt:n,negative_prompt:r,model:i,seed:l,steps:c,rand_device:w?"cpu":"cuda",scheduler:a,clip_skip:d},ae),(h||p)&&(ao(e,R,x),x=Cn),co(e,R,x),Hf(e,R,le,x),ro(e,R,le),io(e,R,le),lo(e,R,le),e.system.shouldUseNSFWChecker&&so(e,R,ae),e.system.shouldUseWatermarker&&uo(e,R,ae),oo(e,R),R},F7e=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=$7e(e):i=N7e(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=M7e(e,n):i=k7e(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=R7e(e,n,r):i=P7e(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=O7e(e,n,r):i=I7e(e,n,r)}return i},cC=({count:e,start:t,min:n=vae,max:r=mp})=>{const i=t??Aoe(n,r),o=[];for(let s=i;s<i+e;s++)o.push(s%r);return o},OH=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:s}=e.generation,{shouldConcatSDXLStylePrompt:a,positiveStylePrompt:l}=e.sdxl,{prompts:c,seedBehaviour:u}=e.dynamicPrompts,d=[];if(c.length===1){const h=cC({count:r,start:o?void 0:s}),p=[];t.nodes[me]&&p.push({node_path:me,field_name:"seed",items:h}),Fh(t)&&(Nh(t,"seed"),p.push({node_path:yi,field_name:"seed",items:h})),t.nodes[nt]&&p.push({node_path:nt,field_name:"seed",items:h.map(m=>(m+1)%mp)}),d.push(p)}else{const h=[],p=[];if(u==="PER_PROMPT"){const _=cC({count:c.length*r,start:o?void 0:s});t.nodes[me]&&h.push({node_path:me,field_name:"seed",items:_}),Fh(t)&&(Nh(t,"seed"),h.push({node_path:yi,field_name:"seed",items:_})),t.nodes[nt]&&h.push({node_path:nt,field_name:"seed",items:_.map(v=>(v+1)%mp)})}else{const _=cC({count:r,start:o?void 0:s});t.nodes[me]&&p.push({node_path:me,field_name:"seed",items:_}),Fh(t)&&(Nh(t,"seed"),p.push({node_path:yi,field_name:"seed",items:_})),t.nodes[nt]&&p.push({node_path:nt,field_name:"seed",items:_.map(v=>(v+1)%mp)}),d.push(p)}const m=u==="PER_PROMPT"?Ooe(r).flatMap(()=>c):c;if(t.nodes[ve]&&h.push({node_path:ve,field_name:"prompt",items:m}),Fh(t)&&(Nh(t,"positive_prompt"),h.push({node_path:yi,field_name:"positive_prompt",items:m})),a&&(i==null?void 0:i.base_model)==="sdxl"){const _=m.map(v=>[v,l].join(" "));t.nodes[ve]&&h.push({node_path:ve,field_name:"style",items:_}),Fh(t)&&(Nh(t,"positive_style_prompt"),h.push({node_path:yi,field_name:"positive_style_prompt",items:m}))}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},D7e=()=>{fe({predicate:e=>YA.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=ue("queue"),{prepend:i}=e.payload,o=t(),{layerState:s,boundingBoxCoordinates:a,boundingBoxDimensions:l,isMaskEnabled:c,shouldPreserveMaskedArea:u}=o.canvas,d=await QA(s,a,l,c,u);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,_=b7e(h,m);if(o.system.enableImageDebugging){const S=await XR(f),w=await XR(p);m7e([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${_}`);let v,y;["img2img","inpaint","outpaint"].includes(_)&&(v=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 g=F7e(o,_,v,y);r.debug({graph:tt(g)},"Canvas graph built"),n(lB(g));const b=OH(o,g,i);try{const S=n(en.endpoints.enqueueBatch.initiate(b,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset();const C=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(sue({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(aue(C))}catch{}}})},L7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,seed:l,steps:c,initialImage:u,img2imgStrength:d,shouldFitToWidthHeight:f,width:h,height:p,clipSkip:m,shouldUseCpuNoise:_,vaePrecision:v,seamlessXAxis:y,seamlessYAxis:g}=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 b=v==="fp32",S=!0;let w=Oo;const C=_,x={id:tE,nodes:{[w]:{type:"main_model_loader",id:w,model:i,is_intermediate:S},[at]:{type:"clip_skip",id:at,skipped_layers:m,is_intermediate:S},[ve]:{type:"compel",id:ve,prompt:n,is_intermediate:S},[Se]:{type:"compel",id:Se,prompt:r,is_intermediate:S},[me]:{type:"noise",id:me,use_cpu:C,seed:l,is_intermediate:S},[_e]:{type:"l2i",id:_e,fp32:b,is_intermediate:S},[le]:{type:"denoise_latents",id:le,cfg_scale:o,scheduler:a,steps:c,denoising_start:1-d,denoising_end:1,is_intermediate:S},[Nt]:{type:"i2l",id:Nt,fp32:b,is_intermediate:S,use_cache:!1}},edges:[{source:{node_id:w,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:w,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}},{source:{node_id:Nt,field:"latents"},destination:{node_id:le,field:"latents"}},{source:{node_id:le,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(f&&(u.width!==h||u.height!==p)){const k={id:ls,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:h,height:p};x.nodes[ls]=k,x.edges.push({source:{node_id:ls,field:"image"},destination:{node_id:Nt,field:"image"}}),x.edges.push({source:{node_id:ls,field:"width"},destination:{node_id:me,field:"width"}}),x.edges.push({source:{node_id:ls,field:"height"},destination:{node_id:me,field:"height"}})}else x.nodes[Nt].image={image_name:u.imageName},x.edges.push({source:{node_id:Nt,field:"width"},destination:{node_id:me,field:"width"}}),x.edges.push({source:{node_id:Nt,field:"height"},destination:{node_id:me,field:"height"}});return xa(x,{generation_mode:"img2img",cfg_scale:o,cfg_rescale_multiplier:s,height:p,width:h,positive_prompt:n,negative_prompt:r,model:i,seed:l,steps:c,rand_device:C?"cpu":"cuda",scheduler:a,clip_skip:m,strength:d,init_image:u.imageName},_e),(y||g)&&(ao(e,x,w),w=Cn),co(e,x,w),Hf(e,x,le,w),ro(e,x,le),io(e,x,le),lo(e,x,le),e.system.shouldUseNSFWChecker&&so(e,x),e.system.shouldUseWatermarker&&uo(e,x),oo(e,x),x},B7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,seed:l,steps:c,initialImage:u,shouldFitToWidthHeight:d,width:f,height:h,shouldUseCpuNoise:p,vaePrecision:m,seamlessXAxis:_,seamlessYAxis:v}=e.generation,{positiveStylePrompt:y,negativeStylePrompt:g,shouldUseSDXLRefiner:b,refinerStart:S,sdxlImg2ImgDenoisingStrength:w}=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 C=m==="fp32",x=!0;let k=pr;const A=p,{joinedPositiveStylePrompt:R,joinedNegativeStylePrompt:L}=xu(e),M={id:lb,nodes:{[k]:{type:"sdxl_model_loader",id:k,model:i,is_intermediate:x},[ve]:{type:"sdxl_compel_prompt",id:ve,prompt:n,style:R,is_intermediate:x},[Se]:{type:"sdxl_compel_prompt",id:Se,prompt:r,style:L,is_intermediate:x},[me]:{type:"noise",id:me,use_cpu:A,seed:l,is_intermediate:x},[_e]:{type:"l2i",id:_e,fp32:C,is_intermediate:x},[se]:{type:"denoise_latents",id:se,cfg_scale:o,scheduler:a,steps:c,denoising_start:b?Math.min(S,1-w):1-w,denoising_end:b?S:1,is_intermediate:x},[Nt]:{type:"i2l",id:Nt,fp32:C,is_intermediate:x,use_cache:!1}},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:k,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}},{source:{node_id:Nt,field:"latents"},destination:{node_id:se,field:"latents"}},{source:{node_id:se,field:"latents"},destination:{node_id:_e,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const E={id:ls,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};M.nodes[ls]=E,M.edges.push({source:{node_id:ls,field:"image"},destination:{node_id:Nt,field:"image"}}),M.edges.push({source:{node_id:ls,field:"width"},destination:{node_id:me,field:"width"}}),M.edges.push({source:{node_id:ls,field:"height"},destination:{node_id:me,field:"height"}})}else M.nodes[Nt].image={image_name:u.imageName},M.edges.push({source:{node_id:Nt,field:"width"},destination:{node_id:me,field:"width"}}),M.edges.push({source:{node_id:Nt,field:"height"},destination:{node_id:me,field:"height"}});return xa(M,{generation_mode:"sdxl_img2img",cfg_scale:o,cfg_rescale_multiplier:s,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:l,steps:c,rand_device:A?"cpu":"cuda",scheduler:a,strength:w,init_image:u.imageName,positive_style_prompt:y,negative_style_prompt:g},_e),(_||v)&&(ao(e,M,k),k=Cn),b&&(qf(e,M,se),(_||v)&&(k=Eo)),co(e,M,k),Wf(e,M,se,k),ro(e,M,se),io(e,M,se),lo(e,M,se),e.system.shouldUseNSFWChecker&&so(e,M),e.system.shouldUseWatermarker&&uo(e,M),oo(e,M),M},z7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,seed:l,steps:c,width:u,height:d,shouldUseCpuNoise:f,vaePrecision:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{positiveStylePrompt:_,negativeStylePrompt:v,shouldUseSDXLRefiner:y,refinerStart:g}=e.sdxl,b=f;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=h==="fp32",w=!0,{joinedPositiveStylePrompt:C,joinedNegativeStylePrompt:x}=xu(e);let k=pr;const A={id:ZA,nodes:{[k]:{type:"sdxl_model_loader",id:k,model:i,is_intermediate:w},[ve]:{type:"sdxl_compel_prompt",id:ve,prompt:n,style:C,is_intermediate:w},[Se]:{type:"sdxl_compel_prompt",id:Se,prompt:r,style:x,is_intermediate:w},[me]:{type:"noise",id:me,seed:l,width:u,height:d,use_cpu:b,is_intermediate:w},[se]:{type:"denoise_latents",id:se,cfg_scale:o,scheduler:a,steps:c,denoising_start:0,denoising_end:y?g:1,is_intermediate:w},[_e]:{type:"l2i",id:_e,fp32:S,is_intermediate:w,use_cache:!1}},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:se,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:ve,field:"clip2"}},{source:{node_id:k,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:k,field:"clip2"},destination:{node_id:Se,field:"clip2"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:se,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:se,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:se,field:"noise"}},{source:{node_id:se,field:"latents"},destination:{node_id:_e,field:"latents"}}]};return xa(A,{generation_mode:"sdxl_txt2img",cfg_scale:o,cfg_rescale_multiplier:s,height:d,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:l,steps:c,rand_device:b?"cpu":"cuda",scheduler:a,positive_style_prompt:_,negative_style_prompt:v},_e),(p||m)&&(ao(e,A,k),k=Cn),y&&(qf(e,A,se),(p||m)&&(k=Eo)),co(e,A,k),Wf(e,A,se,k),ro(e,A,se),io(e,A,se),lo(e,A,se),e.system.shouldUseNSFWChecker&&so(e,A),e.system.shouldUseWatermarker&&uo(e,A),oo(e,A),A};function j7e(e){const t=["vae","control","ip_adapter","metadata","unet","positive_conditioning","negative_conditioning"],n=[];e.edges.forEach(r=>{r.destination.node_id===le&&t.includes(r.destination.field)&&n.push({source:{node_id:r.source.node_id,field:r.source.field},destination:{node_id:Ku,field:r.destination.field}})}),e.edges=e.edges.concat(n)}function V7e(e,t,n){const r=t/n;let i;e=="sdxl"?i=1024:i=512;const o=Math.floor(i*.5),s=i*i;let a,l;r>1?(l=Math.max(o,Math.sqrt(s/r)),a=l*r):(a=Math.max(o,Math.sqrt(s*r)),l=a/r),a=Math.min(t,a),l=Math.min(n,l);const c=Or(Math.floor(a),8),u=Or(Math.floor(l),8);return{newWidth:c,newHeight:u}}const U7e=(e,t)=>{var _;if(!e.generation.hrfEnabled||e.config.disabledSDFeatures.includes("hrf")||((_=e.generation.model)==null?void 0:_.model_type)==="onnx")return;const n=ue("txt2img"),{vae:r,hrfStrength:i,hrfEnabled:o,hrfMethod:s}=e.generation,a=!r,l=e.generation.width,c=e.generation.height,u=e.generation.model?e.generation.model.base_model:"sd1",{newWidth:d,newHeight:f}=V7e(u,l,c),h=t.nodes[le],p=t.nodes[me],m=t.nodes[_e];if(!h){n.error("originalDenoiseLatentsNode is undefined");return}if(!p){n.error("originalNoiseNode is undefined");return}if(!m){n.error("originalLatentsToImageNode is undefined");return}if(p&&(p.width=d,p.height=f),t.nodes[fc]={type:"l2i",id:fc,fp32:m==null?void 0:m.fp32,is_intermediate:!0},t.edges.push({source:{node_id:le,field:"latents"},destination:{node_id:fc,field:"latents"}},{source:{node_id:a?Oo:ci,field:"vae"},destination:{node_id:fc,field:"vae"}}),t.nodes[Da]={id:Da,type:"img_resize",is_intermediate:!0,width:l,height:c},s=="ESRGAN"){let v="RealESRGAN_x2plus.pth";l*c/(d*f)>2&&(v="RealESRGAN_x4plus.pth"),t.nodes[ep]={id:ep,type:"esrgan",model_name:v,is_intermediate:!0},t.edges.push({source:{node_id:fc,field:"image"},destination:{node_id:ep,field:"image"}},{source:{node_id:ep,field:"image"},destination:{node_id:Da,field:"image"}})}else t.edges.push({source:{node_id:fc,field:"image"},destination:{node_id:Da,field:"image"}});t.nodes[Rh]={type:"noise",id:Rh,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:Da,field:"height"},destination:{node_id:Rh,field:"height"}},{source:{node_id:Da,field:"width"},destination:{node_id:Rh,field:"width"}}),t.nodes[Mh]={type:"i2l",id:Mh,is_intermediate:!0},t.edges.push({source:{node_id:a?Oo:ci,field:"vae"},destination:{node_id:Mh,field:"vae"}},{source:{node_id:Da,field:"image"},destination:{node_id:Mh,field:"image"}}),t.nodes[Ku]={type:"denoise_latents",id:Ku,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:Mh,field:"latents"},destination:{node_id:Ku,field:"latents"}},{source:{node_id:Rh,field:"noise"},destination:{node_id:Ku,field:"noise"}}),j7e(t),t.nodes[Xa]={type:"l2i",id:Xa,fp32:m==null?void 0:m.fp32,is_intermediate:!0},t.edges.push({source:{node_id:a?Oo:ci,field:"vae"},destination:{node_id:Xa,field:"vae"}},{source:{node_id:Ku,field:"latents"},destination:{node_id:Xa,field:"latents"}}),Bo(t,{hrf_strength:i,hrf_enabled:o,hrf_method:s}),T7e(t,Xa)},G7e=e=>{const t=ue("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,cfgRescaleMultiplier:s,scheduler:a,steps:l,width:c,height:u,clipSkip:d,shouldUseCpuNoise:f,vaePrecision:h,seamlessXAxis:p,seamlessYAxis:m,seed:_}=e.generation,v=f;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const y=h==="fp32",g=!0,b=i.model_type==="onnx";let S=b?R2:Oo;const w=b?"onnx_model_loader":"main_model_loader",C=b?{type:"t2l_onnx",id:le,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:le,is_intermediate:g,cfg_scale:o,cfg_rescale_multiplier:s,scheduler:a,steps:l,denoising_start:0,denoising_end:1},x={id:MH,nodes:{[S]:{type:w,id:S,is_intermediate:g,model:i},[at]:{type:"clip_skip",id:at,skipped_layers:d,is_intermediate:g},[ve]:{type:b?"prompt_onnx":"compel",id:ve,prompt:n,is_intermediate:g},[Se]:{type:b?"prompt_onnx":"compel",id:Se,prompt:r,is_intermediate:g},[me]:{type:"noise",id:me,seed:_,width:c,height:u,use_cpu:v,is_intermediate:g},[C.id]:C,[_e]:{type:b?"l2i_onnx":"l2i",id:_e,fp32:y,is_intermediate:g,use_cache:!1}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:le,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:at,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:ve,field:"clip"}},{source:{node_id:at,field:"clip"},destination:{node_id:Se,field:"clip"}},{source:{node_id:ve,field:"conditioning"},destination:{node_id:le,field:"positive_conditioning"}},{source:{node_id:Se,field:"conditioning"},destination:{node_id:le,field:"negative_conditioning"}},{source:{node_id:me,field:"noise"},destination:{node_id:le,field:"noise"}},{source:{node_id:le,field:"latents"},destination:{node_id:_e,field:"latents"}}]};return xa(x,{generation_mode:"txt2img",cfg_scale:o,cfg_rescale_multiplier:s,height:u,width:c,positive_prompt:n,negative_prompt:r,model:i,seed:_,steps:l,rand_device:v?"cpu":"cuda",scheduler:a,clip_skip:d},_e),(p||m)&&(ao(e,x,S),S=Cn),co(e,x,S),Hf(e,x,le,S),ro(e,x,le),io(e,x,le),lo(e,x,le),e.generation.hrfEnabled&&!b&&U7e(e,x),e.system.shouldUseNSFWChecker&&so(e,x),e.system.shouldUseWatermarker&&uo(e,x),oo(e,x),x},H7e=()=>{fe({predicate:e=>YA.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 s;i&&i.base_model==="sdxl"?e.payload.tabName==="txt2img"?s=z7e(r):s=B7e(r):e.payload.tabName==="txt2img"?s=G7e(r):s=L7e(r);const a=OH(r,s,o);n(en.endpoints.enqueueBatch.initiate(a,{fixedCacheKey:"enqueueBatch"})).reset()}})},W7e=e=>{if(Che(e)&&e.value){const t=Ge(e.value),{r:n,g:r,b:i,a:o}=e.value,s=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a:s}),t}return e.value},q7e=e=>{const{nodes:t,edges:n}=e,i=t.filter(Sn).reduce((l,c)=>{const{id:u,data:d}=c,{type:f,inputs:h,isIntermediate:p}=d,m=og(h,(v,y,g)=>{const b=W7e(y);return v[g]=b,v},{});m.use_cache=c.data.useCache;const _={type:f,id:u,...m,is_intermediate:p};return Object.assign(l,{[u]:_}),l},{}),s=n.filter(l=>l.type!=="collapsed").reduce((l,c)=>{const{source:u,target:d,sourceHandle:f,targetHandle:h}=c;return l.push({source:{node_id:u,field:f},destination:{node_id:d,field:h}}),l},[]);return s.forEach(l=>{const c=i[l.destination.node_id],u=l.destination.field;i[l.destination.node_id]=uu(c,u)}),{id:ul(),nodes:i,edges:s}},$H=T.object({x:T.number(),y:T.number()}).default({x:0,y:0}),cb=T.number().gt(0).nullish(),K7e=T.enum(["user","default"]),NH=T.object({id:T.string().trim().min(1),type:T.literal("invocation"),data:QB,width:cb,height:cb,position:$H}),X7e=T.object({id:T.string().trim().min(1),type:T.literal("notes"),data:YB,width:cb,height:cb,position:$H}),FH=T.union([NH,X7e]),Q7e=e=>NH.safeParse(e).success,DH=T.object({id:T.string().trim().min(1),source:T.string().trim().min(1),target:T.string().trim().min(1)}),Y7e=DH.extend({type:T.literal("default"),sourceHandle:T.string().trim().min(1),targetHandle:T.string().trim().min(1)}),Z7e=DH.extend({type:T.literal("collapsed")}),LH=T.union([Y7e,Z7e]),BH=T.object({id:T.string().min(1).optional(),name:T.string(),author:T.string(),description:T.string(),version:T.string(),contact:T.string(),tags:T.string(),notes:T.string(),nodes:T.array(FH),edges:T.array(LH),exposedFields:T.array(ahe),meta:T.object({category:K7e.default("user"),version:T.literal("2.0.0")})}),J7e=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function e$e(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+'["'+t$e(n)+'"]';if(!J7e.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function t$e(e){return e.replace(/"/g,'\\"')}function n$e(e){return e.length!==0}const r$e=99,i$e="; ",o$e=", or ",zH="Validation error",s$e=": ";class a$e extends Error{constructor(n,r=[]){super(n);Kl(this,"details");Kl(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function jH(e){const{issue:t,issueSeparator:n,unionSeparator:r,includePath:i}=e;if(t.code==="invalid_union")return t.unionErrors.reduce((o,s)=>{const a=s.issues.map(l=>jH({issue:l,issueSeparator:n,unionSeparator:r,includePath:i})).join(n);return o.includes(a)||o.push(a),o},[]).join(r);if(i&&n$e(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 "${e$e(t.path)}"`}return t.message}function l$e(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:zH}function rE(e,t={}){const{maxIssuesInMessage:n=r$e,issueSeparator:r=i$e,unionSeparator:i=o$e,prefixSeparator:o=s$e,prefix:s=zH,includePath:a=!0}=t,l=e.errors.slice(0,n).map(u=>jH({issue:u,issueSeparator:r,unionSeparator:i,includePath:a})).join(r),c=l$e(l,s,o);return new a$e(c,e.errors)}const c$e=({nodes:e,edges:t,workflow:n})=>{const r=uu(Ge(n),"isTouched"),i=Ge(e),o=Ge(t),s={...r,nodes:[],edges:[]};return i.filter(a=>Sn(a)||Y5(a)).forEach(a=>{const l=FH.safeParse(a);if(!l.success){const{message:c}=rE(l.error,{prefix:Oe.t("nodes.unableToParseNode")});ue("nodes").warn({node:tt(a)},c);return}s.nodes.push(l.data)}),o.forEach(a=>{const l=LH.safeParse(a);if(!l.success){const{message:c}=rE(l.error,{prefix:Oe.t("nodes.unableToParseEdge")});ue("nodes").warn({edge:tt(a)},c);return}s.edges.push(l.data)}),s},u$e=()=>{fe({predicate:e=>YA.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=t(),{nodes:i,edges:o}=r.nodes,s=r.workflow,a=q7e(r.nodes),l=c$e({nodes:i,edges:o,workflow:s});delete l.id;const c={batch:{graph:a,workflow:l,runs:r.generation.iterations},prepend:e.payload.prepend};n(en.endpoints.enqueueBatch.initiate(c,{fixedCacheKey:"enqueueBatch"})).reset()}})},d$e=()=>{fe({matcher:ce.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=ue("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},f$e=()=>{fe({matcher:ce.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=ue("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},ek=he("deleteImageModal/imageDeletionConfirmed"),NWe=hu(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1]),VH=hu([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?Rn:Pr,offset:0,limit:xue,is_intermediate:!1}}),h$e=()=>{fe({actionCreator:ek,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 s=i[0],a=o[0];if(!s||!a)return;t(fT(!1));const l=n(),c=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(s&&(s==null?void 0:s.image_name)===c){const{image_name:h}=s,p=VH(l),{data:m}=ce.endpoints.listImages.select(p)(l),_=m?Ot.getSelectors().selectAll(m):[],v=_.findIndex(S=>S.image_name===h),y=_.filter(S=>S.image_name!==h),g=el(v,0,y.length-1),b=y[g];t(ps(b||null))}a.isCanvasImage&&t(dT()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(oT()),Fo(As(n().controlAdapters),m=>{(m.controlImage===h.image_name||hi(m)&&m.processedControlImage===h.image_name)&&(t(Nl({id:m.id,controlImage:null})),t(X4({id:m.id,processedControlImage:null})))}),n().nodes.nodes.forEach(m=>{Sn(m)&&Fo(m.data.inputs,_=>{var v;vT(_)&&((v=_.value)==null?void 0:v.image_name)===h.image_name&&t(Um({nodeId:m.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:u}=t(ce.endpoints.deleteImage.initiate(s));await r(h=>ce.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===u,3e4)&&t(Lo.util.invalidateTags([{type:"Board",id:s.board_id??"none"}]))}})},p$e=()=>{fe({actionCreator:ek,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(),s=VH(o),{data:a}=ce.endpoints.listImages.select(s)(o),l=a?Ot.getSelectors().selectAll(a)[0]:void 0;t(ps(l||null)),t(fT(!1)),i.some(c=>c.isCanvasImage)&&t(dT()),r.forEach(c=>{var u;((u=n().generation.initialImage)==null?void 0:u.imageName)===c.image_name&&t(oT()),Fo(As(n().controlAdapters),d=>{(d.controlImage===c.image_name||hi(d)&&d.processedControlImage===c.image_name)&&(t(Nl({id:d.id,controlImage:null})),t(X4({id:d.id,processedControlImage:null})))}),n().nodes.nodes.forEach(d=>{Sn(d)&&Fo(d.data.inputs,f=>{var h;vT(f)&&((h=f.value)==null?void 0:h.image_name)===c.image_name&&t(Um({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},g$e=()=>{fe({matcher:ce.endpoints.deleteImage.matchPending,effect:()=>{}})},m$e=()=>{fe({matcher:ce.endpoints.deleteImage.matchFulfilled,effect:e=>{ue("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},y$e=()=>{fe({matcher:ce.endpoints.deleteImage.matchRejected,effect:e=>{ue("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},UH=he("dnd/dndDropped"),v$e=()=>{fe({actionCreator:UH,effect:async(e,{dispatch:t})=>{const n=ue("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:tt(r),overData:tt(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:s}=r.payload;t(bbe({nodeId:o,fieldName:s.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(ps(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(m_(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROL_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{id:o}=i.context;t(Nl({id:o,controlImage:r.payload.imageDTO.image_name})),t(Q4({id:o,isEnabled:!0}));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(wL(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:s}=i.context;t(Um({nodeId:s,fieldName:o,value:r.payload.imageDTO}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload,{boardId:s}=i.context;t(ce.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:s}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(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:s}=i.context;t(ce.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:s}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(ce.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},b$e=()=>{fe({matcher:ce.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=ue("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},_$e=()=>{fe({matcher:ce.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=ue("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},S$e=()=>{fe({actionCreator:hue,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,s=G8e(n()),a=s.some(l=>l.isCanvasImage)||s.some(l=>l.isInitialImage)||s.some(l=>l.isControlImage)||s.some(l=>l.isNodesImage);if(o||a){t(fT(!0));return}t(ek({imageDTOs:r,imagesUsage:s}))}})},x$e=()=>{fe({matcher:ce.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=ue("images"),i=e.payload,o=n(),{autoAddBoardId:s}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:a}=e.meta.arg.originalArgs;if(e.payload.is_intermediate&&!a)return;const l={title:J("toast.imageUploaded"),status:"success"};if((a==null?void 0:a.type)==="TOAST"){const{toastOptions:c}=a;if(!s||s==="none")t(Ve({...l,...c}));else{t(ce.endpoints.addImageToBoard.initiate({board_id:s,imageDTO:i}));const{data:u}=Qe.endpoints.listAllBoards.select()(o),d=u==null?void 0:u.find(h=>h.board_id===s),f=d?`${J("toast.addedToBoard")} ${d.board_name}`:`${J("toast.addedToBoard")} ${s}`;t(Ve({...l,description:f}))}return}if((a==null?void 0:a.type)==="SET_CANVAS_INITIAL_IMAGE"){t(wL(i)),t(Ve({...l,description:J("toast.setAsCanvasInitialImage")}));return}if((a==null?void 0:a.type)==="SET_CONTROL_ADAPTER_IMAGE"){const{id:c}=a;t(Q4({id:c,isEnabled:!0})),t(Nl({id:c,controlImage:i.image_name})),t(Ve({...l,description:J("toast.setControlImage")}));return}if((a==null?void 0:a.type)==="SET_INITIAL_IMAGE"){t(m_(i)),t(Ve({...l,description:J("toast.setInitialImage")}));return}if((a==null?void 0:a.type)==="SET_NODES_IMAGE"){const{nodeId:c,fieldName:u}=a;t(Um({nodeId:c,fieldName:u,value:i})),t(Ve({...l,description:`${J("toast.setNodeField")} ${u}`}));return}}})},w$e=()=>{fe({matcher:ce.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=ue("images"),r={arg:{...uu(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(Ve({title:J("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},C$e=()=>{fe({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,s=[];o.forEach(a=>{r.includes(a.image_name)?s.push({...a,starred:!0}):s.push(a)}),t(iB(s))}})},E$e=()=>{fe({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,s=[];o.forEach(a=>{r.includes(a.image_name)?s.push({...a,starred:!1}):s.push(a)}),t(iB(s))}})},T$e=he("generation/initialImageSelected"),A$e=he("generation/modelSelected"),k$e=()=>{fe({actionCreator:T$e,effect:(e,{dispatch:t})=>{if(!e.payload){t(Ve(pi({title:J("toast.imageNotLoadedDesc"),status:"error"})));return}t(m_(e.payload)),t(Ve(pi(J("toast.sentToImageToImage"))))}})},P$e=()=>{fe({actionCreator:A$e,effect:(e,{getState:t,dispatch:n})=>{var l,c;const r=ue("models"),i=t(),o=g_.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const s=o.data,{base_model:a}=s;if(((l=i.generation.model)==null?void 0:l.base_model)!==a){let u=0;Fo(i.lora.loras,(f,h)=>{f.base_model!==a&&(n(sB(h)),u+=1)});const{vae:d}=i.generation;d&&d.base_model!==a&&(n(nL(null)),u+=1),As(i.controlAdapters).forEach(f=>{var h;((h=f.model)==null?void 0:h.base_model)!==a&&(n(Q4({id:f.id,isEnabled:!1})),u+=1)}),u>0&&n(Ve(pi({title:J("toast.baseModelChangedCleared",{count:u}),status:"warning"})))}((c=i.generation.model)==null?void 0:c.base_model)!==s.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(s.base_model)?(n(oI(1024)),n(sI(1024)),n(CI({width:1024,height:1024}))):(n(oI(512)),n(sI(512)),n(CI({width:512,height:512})))),n(tl(s))}})},Wg=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),QR=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),YR=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),ZR=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),JR=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),eO=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),tO=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),iE=jo({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),I$e=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,Oa=e=>{const t=[];return e.forEach(n=>{const r={...Ge(n),id:I$e(n)};t.push(r)}),t},Zo=Lo.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${yp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return QR.setAll(QR.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${yp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return Wg.setAll(Wg.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:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return YR.setAll(YR.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:Ir}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:Ir}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return ZR.setAll(ZR.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return JR.setAll(JR.getInitialState(),n)}}),getT2IAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"t2i_adapter"}}),providesTags:t=>{const n=[{type:"T2IAdapterModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"T2IAdapterModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return eO.setAll(eO.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return iE.setAll(iE.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:Ir},"Model"];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=Oa(t.models);return tO.setAll(tO.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${yp.stringify(t,{})}`})}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:FWe,useGetOnnxModelsQuery:DWe,useGetControlNetModelsQuery:LWe,useGetIPAdapterModelsQuery:BWe,useGetT2IAdapterModelsQuery:zWe,useGetLoRAModelsQuery:jWe,useGetTextualInversionModelsQuery:VWe,useGetVaeModelsQuery:UWe,useUpdateMainModelsMutation:GWe,useDeleteMainModelsMutation:HWe,useImportMainModelsMutation:WWe,useAddMainModelsMutation:qWe,useConvertMainModelsMutation:KWe,useMergeMainModelsMutation:XWe,useDeleteLoRAModelsMutation:QWe,useUpdateLoRAModelsMutation:YWe,useSyncModelsMutation:ZWe,useGetModelsInFolderQuery:JWe,useGetCheckpointConfigsQuery:eqe}=Zo,M$e=()=>{fe({predicate:e=>Zo.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=ue("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=Wg.getSelectors().selectAll(e.payload);if(o.length===0){n(tl(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 a=g_.safeParse(o[0]);if(!a.success){r.error({error:a.error.format()},"Failed to parse main model");return}n(tl(a.data))}}),fe({predicate:e=>Zo.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=ue("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=Wg.getSelectors().selectAll(e.payload);if(o.length===0){n(V8(null)),n(xbe(!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 a=ZD.safeParse(o[0]);if(!a.success){r.error({error:a.error.format()},"Failed to parse SDXL Refiner Model");return}n(V8(a.data))}}),fe({matcher:Zo.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=ue("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||Gu(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const s=iE.getSelectors().selectAll(e.payload)[0];if(!s){n(tl(null));return}const a=JD.safeParse(s);if(!a.success){r.error({error:a.error.format()},"Failed to parse VAE model");return}n(nL(a.data))}}),fe({matcher:Zo.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ue("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;Fo(i,(o,s)=>{Gu(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(sB(s))})}}),fe({matcher:Zo.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ue("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),nae(t().controlAdapters).forEach(i=>{Gu(e.payload.entities,s=>{var a,l;return(s==null?void 0:s.model_name)===((a=i==null?void 0:i.model)==null?void 0:a.model_name)&&(s==null?void 0:s.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Wx({id:i.id}))})}}),fe({matcher:Zo.endpoints.getT2IAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ue("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`),sae(t().controlAdapters).forEach(i=>{Gu(e.payload.entities,s=>{var a,l;return(s==null?void 0:s.model_name)===((a=i==null?void 0:i.model)==null?void 0:a.model_name)&&(s==null?void 0:s.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Wx({id:i.id}))})}}),fe({matcher:Zo.endpoints.getIPAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ue("models").info({models:e.payload.entities},`IP Adapter models loaded (${e.payload.ids.length})`),iae(t().controlAdapters).forEach(i=>{Gu(e.payload.entities,s=>{var a,l;return(s==null?void 0:s.model_name)===((a=i==null?void 0:i.model)==null?void 0:a.model_name)&&(s==null?void 0:s.base_model)===((l=i==null?void 0:i.model)==null?void 0:l.base_model)})||n(Wx({id:i.id}))})}}),fe({matcher:Zo.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{ue("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},R$e=Lo.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),O$e=br(Kle,vue,mue,yue,F4),$$e=()=>{fe({matcher:O$e,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:s}=o.generation,{maxPrompts:a}=o.dynamicPrompts;t(Yx(!0));try{const l=t(R$e.endpoints.dynamicPrompts.initiate({prompt:s,max_prompts:a})),c=await l.unwrap();l.unsubscribe(),t(bue(c.prompts)),t(_ue(c.error)),t(EI(!1)),t(Yx(!1))}catch{t(EI(!0)),t(Yx(!1))}}})};class oE extends Error{constructor(t){super(t),this.name=this.constructor.name}}class sE extends Error{constructor(t){super(t),this.name=this.constructor.name}}class GH extends Error{constructor(t){super(t),this.name=this.constructor.name}}class ui extends Error{constructor(t){super(t),this.name=this.constructor.name}}const _d=e=>!!(e&&!("$ref"in e)),nO=e=>!!(e&&!("$ref"in e)&&e.type==="array"),Ry=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),nc=e=>!!(e&&"$ref"in e),N$e=e=>"class"in e&&e.class==="invocation",F$e=e=>"class"in e&&e.class==="output",aE=e=>!("$ref"in e),D$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>{const i={...t,type:{name:"IntegerField",isCollection:n,isCollectionOrScalar:r},default:e.default??0};return e.multipleOf!==void 0&&(i.multipleOf=e.multipleOf),e.maximum!==void 0&&(i.maximum=e.maximum),e.exclusiveMaximum!==void 0&&p1(e.exclusiveMaximum)&&(i.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(i.minimum=e.minimum),e.exclusiveMinimum!==void 0&&p1(e.exclusiveMinimum)&&(i.exclusiveMinimum=e.exclusiveMinimum),i},L$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>{const i={...t,type:{name:"FloatField",isCollection:n,isCollectionOrScalar:r},default:e.default??0};return e.multipleOf!==void 0&&(i.multipleOf=e.multipleOf),e.maximum!==void 0&&(i.maximum=e.maximum),e.exclusiveMaximum!==void 0&&p1(e.exclusiveMaximum)&&(i.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(i.minimum=e.minimum),e.exclusiveMinimum!==void 0&&p1(e.exclusiveMinimum)&&(i.exclusiveMinimum=e.exclusiveMinimum),i},B$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>{const i={...t,type:{name:"StringField",isCollection:n,isCollectionOrScalar:r},default:e.default??""};return e.minLength!==void 0&&(i.minLength=e.minLength),e.maxLength!==void 0&&(i.maxLength=e.maxLength),i},z$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"BooleanField",isCollection:n,isCollectionOrScalar:r},default:e.default??!1}),j$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"MainModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),V$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"SDXLMainModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),U$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"SDXLRefinerModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),G$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"VAEModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),H$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"LoRAModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),W$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"ControlNetModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),q$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"IPAdapterModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),K$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"T2IAdapterModelField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),X$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"BoardField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),Q$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"ImageField",isCollection:n,isCollectionOrScalar:r},default:e.default??void 0}),Y$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>{let i=[];if(e.anyOf){const s=e.anyOf.filter(l=>!(_d(l)&&l.type==="null")),a=s[0];s.length!==1||!_d(a)?i=[]:i=a.enum??[]}else i=e.enum??[];if(i.length===0)throw new ui(J("nodes.unableToExtractEnumOptions"));return{...t,type:{name:"EnumField",isCollection:n,isCollectionOrScalar:r},options:i,ui_choice_labels:e.ui_choice_labels,default:e.default??i[0]}},Z$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"ColorField",isCollection:n,isCollectionOrScalar:r},default:e.default??{r:127,g:127,b:127,a:255}}),J$e=({schemaObject:e,baseField:t,isCollection:n,isCollectionOrScalar:r})=>({...t,type:{name:"SchedulerField",isCollection:n,isCollectionOrScalar:r},default:e.default??"euler"}),eNe={BoardField:X$e,BooleanField:z$e,ColorField:Z$e,ControlNetModelField:W$e,EnumField:Y$e,FloatField:L$e,ImageField:Q$e,IntegerField:D$e,IPAdapterModelField:q$e,LoRAModelField:H$e,MainModelField:j$e,SchedulerField:J$e,SDXLMainModelField:V$e,SDXLRefinerModelField:U$e,StringField:B$e,T2IAdapterModelField:K$e,VAEModelField:G$e},tNe=(e,t,n)=>{const{input:r,ui_hidden:i,ui_component:o,ui_type:s,ui_order:a,ui_choice_labels:l,orig_required:c}=e,u={name:t,title:e.title??(t?N4(t):""),required:c,description:e.description??"",fieldKind:"input",input:r,ui_hidden:i,ui_component:o,ui_type:s,ui_order:a,ui_choice_labels:l};if(Whe(n)){const f=eNe[n.name];return f({schemaObject:e,baseField:u,isCollection:n.isCollection,isCollectionOrScalar:n.isCollectionOrScalar})}return{...u,input:"connection",type:n,default:void 0}},nNe=(e,t,n)=>{const{title:r,description:i,ui_hidden:o,ui_type:s,ui_order:a}=e;return{fieldKind:"output",name:t,title:r??(t?N4(t):""),description:i??"",type:n,ui_hidden:o,ui_type:s,ui_order:a}},$a=e=>e.$ref.split("/").slice(-1)[0],uC={integer:"IntegerField",number:"FloatField",string:"StringField",boolean:"BooleanField"},rNe=e=>e==="CollectionField",lE=e=>{if(aE(e)){const{ui_type:t}=e;if(t)return{name:t,isCollection:rNe(t),isCollectionOrScalar:!1}}if(_d(e)){if(e.type){if(e.enum)return{name:"EnumField",isCollection:!1,isCollectionOrScalar:!1};if(e.type){if(e.type==="array"){if(_d(e.items)){const n=e.items.type;if(!n||bn(n))throw new ui(J("nodes.unsupportedArrayItemType",{type:n}));const r=uC[n];if(!r)throw new ui(J("nodes.unsupportedArrayItemType",{type:n}));return{name:r,isCollection:!0,isCollectionOrScalar:!1}}const t=$a(e.items);if(!t)throw new ui(J("nodes.unableToExtractSchemaNameFromRef"));return{name:t,isCollection:!0,isCollectionOrScalar:!1}}else if(!bn(e.type)){const t=uC[e.type];if(!t)throw new ui(J("nodes.unsupportedArrayItemType",{type:e.type}));return{name:t,isCollection:!1,isCollectionOrScalar:!1}}}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&nc(t[0])){const n=$a(t[0]);if(!n)throw new ui(J("nodes.unableToExtractSchemaNameFromRef"));return{name:n,isCollection:!1,isCollectionOrScalar:!1}}}else if(e.anyOf){const t=e.anyOf.filter(i=>!(_d(i)&&i.type==="null"));if(t.length===1){if(nc(t[0])){const i=$a(t[0]);if(!i)throw new ui(J("nodes.unableToExtractSchemaNameFromRef"));return{name:i,isCollection:!1,isCollectionOrScalar:!1}}else if(_d(t[0]))return lE(t[0])}if(t.length!==2)throw new ui(J("nodes.unsupportedAnyOfLength",{count:t.length}));let n,r;if(nO(t[0])){const i=t[0].items,o=t[1];nc(i)&&nc(o)?(n=$a(i),r=$a(o)):Ry(i)&&Ry(o)&&(n=i.type,r=o.type)}else if(nO(t[1])){const i=t[0],o=t[1].items;nc(i)&&nc(o)?(n=$a(i),r=$a(o)):Ry(i)&&Ry(o)&&(n=i.type,r=o.type)}if(n&&n===r)return{name:uC[n]??n,isCollection:!1,isCollectionOrScalar:!0};throw new ui(J("nodes.unsupportedMismatchedUnion",{firstType:n,secondType:r}))}}else if(nc(e)){const t=$a(e);if(!t)throw new ui(J("nodes.unableToExtractSchemaNameFromRef"));return{name:t,isCollection:!1,isCollectionOrScalar:!1}}throw new ui(J("nodes.unableToParseFieldType"))},iNe=["id","type","use_cache"],oNe=["type"],sNe=["IsIntermediate"],aNe=["graph","linear_ui_output"],lNe=(e,t)=>!!(iNe.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),cNe=e=>!!sNe.includes(e),uNe=(e,t)=>!oNe.includes(t),dNe=e=>!aNe.includes(e.properties.type.default),fNe=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(N$e).filter(dNe).filter(s=>t?t.includes(s.properties.type.default):!0).filter(s=>n?!n.includes(s.properties.type.default):!0).reduce((s,a)=>{var w,C;const l=a.properties.type.default,c=a.title.replace("Invocation",""),u=a.tags??[],d=a.description??"",f=a.version,h=a.node_pack,p=a.classification,m=og(a.properties,(x,k,A)=>{if(lNe(l,A))return ue("nodes").trace({node:l,field:A,schema:tt(k)},"Skipped reserved input field"),x;if(!aE(k))return ue("nodes").warn({node:l,field:A,schema:tt(k)},"Unhandled input property"),x;try{const R=lE(k);if(cNe(R.name))return x;const L=tNe(k,A,R);x[A]=L}catch(R){R instanceof ui&&ue("nodes").warn({node:l,field:A,schema:tt(k)},J("nodes.inputFieldTypeParseError",{node:l,field:A,message:R.message}))}return x},{}),_=a.output.$ref.split("/").pop();if(!_)return ue("nodes").warn({outputRefObject:tt(a.output)},"No output schema name found in ref object"),s;const v=(C=(w=e.components)==null?void 0:w.schemas)==null?void 0:C[_];if(!v)return ue("nodes").warn({outputSchemaName:_},"Output schema not found"),s;if(!F$e(v))return ue("nodes").error({outputSchema:tt(v)},"Invalid output schema"),s;const y=v.properties.type.default,g=og(v.properties,(x,k,A)=>{if(!uNe(l,A))return ue("nodes").trace({node:l,field:A,schema:tt(k)},"Skipped reserved output field"),x;if(!aE(k))return ue("nodes").warn({node:l,field:A,schema:tt(k)},"Unhandled output property"),x;try{const R=lE(k);if(!R)return ue("nodes").warn({node:l,field:A,schema:tt(k)},"Missing output field type"),x;const L=nNe(k,A,R);x[A]=L}catch(R){R instanceof ui&&ue("nodes").warn({node:l,field:A,schema:tt(k)},J("nodes.outputFieldTypeParseError",{node:l,field:A,message:R.message}))}return x},{}),b=a.properties.use_cache.default,S={title:c,type:l,version:f,tags:u,description:d,outputType:y,inputs:m,outputs:g,useCache:b,nodePack:h,classification:p};return Object.assign(s,{[l]:S}),s},{})},hNe=()=>{fe({actionCreator:kg.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=ue("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:s}=n().config,a=fNe(i,o,s);r.debug({nodeTemplates:tt(a)},`Built ${c_(a)} node templates`),t($j(a))}}),fe({actionCreator:kg.rejected,effect:e=>{ue("system").error({error:tt(e.error)},"Problem retrieving OpenAPI Schema")}})},pNe=()=>{fe({actionCreator:ZF,effect:(e,{dispatch:t,getState:n})=>{ue("socketio").debug("Connected");const{nodes:i,config:o,system:s}=n(),{disabledTabs:a}=o;!c_(i.nodeTemplates)&&!a.includes("nodes")&&t(kg()),s.isInitialized?t(Lo.util.resetApiState()):t(ese(!0)),t(F4(e.payload))}})},gNe=()=>{fe({actionCreator:JF,effect:(e,{dispatch:t})=>{ue("socketio").debug("Disconnected"),t(eD(e.payload))}})},mNe=()=>{fe({actionCreator:oD,effect:(e,{dispatch:t})=>{ue("socketio").trace(e.payload,"Generator progress"),t(z4(e.payload))}})},yNe=()=>{fe({actionCreator:rD,effect:(e,{dispatch:t})=>{ue("socketio").debug(e.payload,"Session complete"),t(iD(e.payload))}})},vNe=["load_image","image"],bNe=()=>{fe({actionCreator:L4,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("socketio"),{data:i}=e.payload;r.debug({data:tt(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:s,queue_batch_id:a,source_node_id:l}=i;if(QD(o)&&!vNe.includes(s.type)&&!E7e.includes(l)){const{image_name:c}=o.image,{canvas:u,gallery:d}=n(),f=t(ce.endpoints.getImageDTO.initiate(c,{forceRefetch:!0})),h=await f.unwrap();if(f.unsubscribe(),u.batchIds.includes(a)&&[zc].includes(i.source_node_id)&&t(nue(h)),!h.is_intermediate){t(ce.util.updateQueryData("listImages",{board_id:h.board_id??"none",categories:Rn},m=>{Ot.addOne(m,h)})),t(Qe.util.updateQueryData("getBoardImagesTotal",h.board_id??"none",m=>{m.total+=1})),t(ce.util.invalidateTags([{type:"Board",id:h.board_id??"none"}]));const{shouldAutoSwitch:p}=d;p&&(d.galleryView!=="images"&&t(Q5("images")),h.board_id&&h.board_id!==d.selectedBoardId&&t(vp({boardId:h.board_id,selectedImageName:h.image_name})),!h.board_id&&d.selectedBoardId!=="none"&&t(vp({boardId:"none",selectedImageName:h.image_name})),t(ps(h)))}}t(B4(e.payload))}})},_Ne=()=>{fe({actionCreator:nD,effect:(e,{dispatch:t})=>{ue("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(u_(e.payload))}})},SNe=()=>{fe({actionCreator:fD,effect:(e,{dispatch:t})=>{ue("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(hD(e.payload))}})},xNe=()=>{fe({actionCreator:tD,effect:(e,{dispatch:t})=>{ue("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(D4(e.payload))}})},wNe=()=>{fe({actionCreator:sD,effect:(e,{dispatch:t})=>{const n=ue("socketio"),{base_model:r,model_name:i,model_type:o,submodel:s}=e.payload.data;let a=`Model load started: ${r}/${o}/${i}`;s&&(a=a.concat(`/${s}`)),n.debug(e.payload,a),t(aD(e.payload))}}),fe({actionCreator:lD,effect:(e,{dispatch:t})=>{const n=ue("socketio"),{base_model:r,model_name:i,model_type:o,submodel:s}=e.payload.data;let a=`Model load complete: ${r}/${o}/${i}`;s&&(a=a.concat(`/${s}`)),n.debug(e.payload,a),t(cD(e.payload))}})},CNe=()=>{fe({actionCreator:pD,effect:async(e,{dispatch:t})=>{const n=ue("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(en.util.updateQueryData("listQueueItems",void 0,s=>{pc.updateOne(s,{id:String(r.item_id),changes:r})})),t(en.util.updateQueryData("getQueueStatus",void 0,s=>{s&&Object.assign(s.queue,o)})),t(en.util.updateQueryData("getBatchStatus",{batch_id:i.batch_id},()=>i)),t(en.util.updateQueryData("getQueueItem",r.item_id,s=>{s&&Object.assign(s,r)})),t(en.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem","InvocationCacheStatus"])),t(d_(e.payload))}})},ENe=()=>{fe({actionCreator:uD,effect:(e,{dispatch:t})=>{ue("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(dD(e.payload))}})},TNe=()=>{fe({actionCreator:qoe,effect:(e,{dispatch:t})=>{ue("socketio").debug(e.payload,"Subscribed"),t(Koe(e.payload))}})},ANe=()=>{fe({actionCreator:Xoe,effect:(e,{dispatch:t})=>{ue("socketio").debug(e.payload,"Unsubscribed"),t(Qoe(e.payload))}})},kNe=()=>{fe({actionCreator:Z8e,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(Ve({title:J("toast.imageSaved"),status:"success"}))}catch(i){t(Ve({title:J("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},tqe=["sd-1","sd-2","sdxl","sdxl-refiner"],PNe=["sd-1","sd-2","sdxl"],nqe=["sdxl"],rqe=["sd-1","sd-2"],iqe=["sdxl-refiner"],INe=()=>{fe({actionCreator:Gj,effect:async(e,{getState:t,dispatch:n})=>{var i;if(e.payload==="unifiedCanvas"){const o=(i=t().generation.model)==null?void 0:i.base_model;if(o&&["sd-1","sd-2","sdxl"].includes(o))return;try{const s=n(Zo.endpoints.getMainModels.initiate(PNe)),a=await s.unwrap();if(s.unsubscribe(),!a.ids.length){n(tl(null));return}const c=Wg.getSelectors().selectAll(a).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!c){n(tl(null));return}const{base_model:u,model_name:d,model_type:f}=c;n(tl({base_model:u,model_name:d,model_type:f}))}catch{n(tl(null))}}}})},MNe=({image_name:e,esrganModelName:t,autoAddBoardId:n})=>{const r={id:tp,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},i={id:zc,type:"linear_ui_output",use_cache:!1,is_intermediate:!1,board:n==="none"?void 0:{board_id:n}},o={id:"adhoc-esrgan-graph",nodes:{[tp]:r,[zc]:i},edges:[{source:{node_id:tp,field:"image"},destination:{node_id:zc,field:"image"}}]};return xa(o,{},tp),Bo(o,{esrgan_model:t}),o};function RNe(){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 rO={};function cE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&rO[t[0]]||(typeof t[0]=="string"&&(rO[t[0]]=new Date),RNe(...t))}const HH=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function iO(e,t,n){e.loadNamespaces(t,HH(e,n))}function oO(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,HH(e,r))}function ONe(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 s=(a,l)=>{const c=t.services.backendConnector.state[`${a}|${l}`];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!i||s(o,e)))}function $Ne(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(cE("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}}):ONe(e,t,n)}const NNe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,FNe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},DNe=e=>FNe[e],LNe=e=>e.replace(NNe,DNe);let uE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:LNe};function BNe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uE={...uE,...e}}function zNe(){return uE}let WH;function jNe(e){WH=e}function VNe(){return WH}const UNe={type:"3rdParty",init(e){BNe(e.options.react),jNe(e)}},GNe=I.createContext();class HNe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const WNe=(e,t)=>{const n=I.useRef();return I.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function qH(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=I.useContext(GNe)||{},o=n||r||VNe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new HNe),!o){cE("You will need to pass in an i18next instance by using initReactI18next");const g=(S,w)=>typeof w=="string"?w:w&&typeof w=="object"&&typeof w.defaultValue=="string"?w.defaultValue:Array.isArray(S)?S[S.length-1]:S,b=[g,{},!1];return b.t=g,b.i18n={},b.ready=!1,b}o.options.react&&o.options.react.wait!==void 0&&cE("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...zNe(),...o.options.react,...t},{useSuspense:a,keyPrefix:l}=s;let c=e||i||o.options&&o.options.defaultNS;c=typeof c=="string"?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(g=>$Ne(g,o,s));function d(){return o.getFixedT(t.lng||null,s.nsMode==="fallback"?c:c[0],l)}const[f,h]=I.useState(d);let p=c.join();t.lng&&(p=`${t.lng}${p}`);const m=WNe(p),_=I.useRef(!0);I.useEffect(()=>{const{bindI18n:g,bindI18nStore:b}=s;_.current=!0,!u&&!a&&(t.lng?oO(o,t.lng,c,()=>{_.current&&h(d)}):iO(o,c,()=>{_.current&&h(d)})),u&&m&&m!==p&&_.current&&h(d);function S(){_.current&&h(d)}return g&&o&&o.on(g,S),b&&o&&o.store.on(b,S),()=>{_.current=!1,g&&o&&g.split(" ").forEach(w=>o.off(w,S)),b&&o&&b.split(" ").forEach(w=>o.store.off(w,S))}},[o,p]);const v=I.useRef(!0);I.useEffect(()=>{_.current&&!v.current&&h(d),v.current=!1},[o,l]);const y=[f,o,u];if(y.t=f,y.i18n=o,y.ready=u,u||!u&&!a)return y;throw new Promise(g=>{t.lng?oO(o,t.lng,c,()=>g()):iO(o,c,()=>g())})}const qNe=(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}},KNe=(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},XNe=(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"}},KH=e=>hu(tW,({postprocessing:t,config:n})=>{const{esrganModelName:r}=t,{maxUpscalePixels:i}=n,o=qNe(e,i),s=KNe(o,i),a=r.includes("x2")?2:4,l=XNe(s,a);return{isAllowedToUpscale:a===2?s.x2:s.x4,detailTKey:l}}),oqe=e=>{const{t}=qH(),n=I.useMemo(()=>KH(e),[e]),{isAllowedToUpscale:r,detailTKey:i}=nN(n);return{isAllowedToUpscale:r,detail:i?t(i):void 0}},QNe=he("upscale/upscaleRequested"),YNe=()=>{fe({actionCreator:QNe,effect:async(e,{dispatch:t,getState:n})=>{const r=ue("session"),{imageDTO:i}=e.payload,{image_name:o}=i,s=n(),{isAllowedToUpscale:a,detailTKey:l}=KH(i)(s);if(!a){r.error({imageDTO:i},J(l??"parameters.isAllowedToUpscale.tooLarge")),t(Ve({title:J(l??"parameters.isAllowedToUpscale.tooLarge"),status:"error"}));return}const{esrganModelName:c}=s.postprocessing,{autoAddBoardId:u}=s.gallery,d={prepend:!0,batch:{graph:MNe({image_name:o,esrganModelName:c,autoAddBoardId:u}),runs:1}};try{const f=t(en.endpoints.enqueueBatch.initiate(d,{fixedCacheKey:"enqueueBatch"})),h=await f.unwrap();f.reset(),r.debug({enqueueResult:tt(h)},J("queue.graphQueued"))}catch(f){if(r.error({enqueueBatchArg:tt(d)},J("queue.graphFailedToQueue")),f instanceof Object&&"status"in f&&f.status===403)return;t(Ve({title:J("queue.graphFailedToQueue"),status:"error"}))}}})},ZNe=to(null),JNe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ub=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(JNe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},sO=e=>e==="*"||e==="x"||e==="X",aO=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},eFe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],tFe=(e,t)=>{if(sO(e)||sO(t))return 0;const[n,r]=eFe(aO(e),aO(t));return n>r?1:n<r?-1:0},Sd=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=tFe(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},nFe=(e,t)=>{const n=ub(e),r=ub(t),i=n.pop(),o=r.pop(),s=Sd(n,r);return s!==0?s:i&&o?Sd(i.split("."),o.split(".")):i||o?i?-1:1:0},rFe=(e,t,n)=>{iFe(n);const r=nFe(e,t);return XH[n].includes(r)},XH={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},lO=Object.keys(XH),iFe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(lO.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${lO.join("|")}`)},wv=(e,t)=>{if(t=t.replace(/([><=]+)\s+/g,"$1"),t.includes("||"))return t.split("||").some(_=>wv(e,_));if(t.includes(" - ")){const[_,v]=t.split(" - ",2);return wv(e,`>=${_} <=${v}`)}else if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(_=>wv(e,_));const n=t.match(/^([<>=~^]+)/),r=n?n[1]:"=";if(r!=="^"&&r!=="~")return rFe(e,t,r);const[i,o,s,,a]=ub(e),[l,c,u,,d]=ub(t),f=[i,o,s],h=[l,c??"x",u??"x"];if(d&&(!a||Sd(f,h)!==0||Sd(a.split("."),d.split("."))===-1))return!1;const p=h.findIndex(_=>_!=="0")+1,m=r==="~"?2:p>1?p:1;return!(Sd(f.slice(0,m),h.slice(0,m))!==0||Sd(f.slice(m),h.slice(m))===-1)},oFe={EnumField:"",BoardField:void 0,BooleanField:!1,ColorField:{r:0,g:0,b:0,a:1},FloatField:0,ImageField:void 0,IntegerField:0,IPAdapterModelField:void 0,LoRAModelField:void 0,MainModelField:void 0,SchedulerField:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,StringField:"",T2IAdapterModelField:void 0,VAEModelField:void 0,ControlNetModelField:void 0},sFe=(e,t)=>({id:e,name:t.name,type:t.type,label:"",fieldKind:"input",value:t.default??HN(oFe,t.type.name)}),aFe=(e,t)=>{const n=ul(),{type:r}=t,i=og(t.inputs,(a,l,c)=>{const u=ul(),d=sFe(u,l);return a[c]=d,a},{}),o=og(t.outputs,(a,l,c)=>{const d={id:ul(),name:c,type:l.type,fieldKind:"output"};return a[c]=d,a},{});return{...cB,id:n,type:"invocation",position:e,data:{id:n,type:r,version:t.version,label:"",notes:"",isOpen:!0,isIntermediate:r!=="save_image",useCache:t.useCache,inputs:i,outputs:o}}},tk=(e,t)=>e.data.type!==t.type?!0:e.data.version!==t.version,lFe=(e,t)=>{if(!tk(e,t)||e.data.type!==t.type)return!1;const r=epe.parse(t.version).major;return wv(e.data.version,`^${r}`)},cFe=(e,t)=>{if(!lFe(e,t)||e.data.type!==t.type)throw new GH(`Unable to update node ${e.id}`);const r=aFe(e.position,t),i=Ge(e);return i.data.version=t.version,zF(i,r),i.data.inputs=B6(i.data.inputs,Qc(r.data.inputs)),i.data.outputs=B6(i.data.outputs,Qc(r.data.outputs)),i},uFe={BoardField:{name:"BoardField",isCollection:!1,isCollectionOrScalar:!1},boolean:{name:"BooleanField",isCollection:!1,isCollectionOrScalar:!1},BooleanCollection:{name:"BooleanField",isCollection:!0,isCollectionOrScalar:!1},BooleanPolymorphic:{name:"BooleanField",isCollection:!1,isCollectionOrScalar:!0},ColorField:{name:"ColorField",isCollection:!1,isCollectionOrScalar:!1},ColorCollection:{name:"ColorField",isCollection:!0,isCollectionOrScalar:!1},ColorPolymorphic:{name:"ColorField",isCollection:!1,isCollectionOrScalar:!0},ControlNetModelField:{name:"ControlNetModelField",isCollection:!1,isCollectionOrScalar:!1},enum:{name:"EnumField",isCollection:!1,isCollectionOrScalar:!1},float:{name:"FloatField",isCollection:!1,isCollectionOrScalar:!1},FloatCollection:{name:"FloatField",isCollection:!0,isCollectionOrScalar:!1},FloatPolymorphic:{name:"FloatField",isCollection:!1,isCollectionOrScalar:!0},ImageCollection:{name:"ImageField",isCollection:!0,isCollectionOrScalar:!1},ImageField:{name:"ImageField",isCollection:!1,isCollectionOrScalar:!1},ImagePolymorphic:{name:"ImageField",isCollection:!1,isCollectionOrScalar:!0},integer:{name:"IntegerField",isCollection:!1,isCollectionOrScalar:!1},IntegerCollection:{name:"IntegerField",isCollection:!0,isCollectionOrScalar:!1},IntegerPolymorphic:{name:"IntegerField",isCollection:!1,isCollectionOrScalar:!0},IPAdapterModelField:{name:"IPAdapterModelField",isCollection:!1,isCollectionOrScalar:!1},LoRAModelField:{name:"LoRAModelField",isCollection:!1,isCollectionOrScalar:!1},MainModelField:{name:"MainModelField",isCollection:!1,isCollectionOrScalar:!1},Scheduler:{name:"SchedulerField",isCollection:!1,isCollectionOrScalar:!1},SDXLMainModelField:{name:"SDXLMainModelField",isCollection:!1,isCollectionOrScalar:!1},SDXLRefinerModelField:{name:"SDXLRefinerModelField",isCollection:!1,isCollectionOrScalar:!1},string:{name:"StringField",isCollection:!1,isCollectionOrScalar:!1},StringCollection:{name:"StringField",isCollection:!0,isCollectionOrScalar:!1},StringPolymorphic:{name:"StringField",isCollection:!1,isCollectionOrScalar:!0},T2IAdapterModelField:{name:"T2IAdapterModelField",isCollection:!1,isCollectionOrScalar:!1},VaeModelField:{name:"VAEModelField",isCollection:!1,isCollectionOrScalar:!1}},dFe={Any:{name:"AnyField",isCollection:!1,isCollectionOrScalar:!1},ClipField:{name:"ClipField",isCollection:!1,isCollectionOrScalar:!1},Collection:{name:"CollectionField",isCollection:!0,isCollectionOrScalar:!1},CollectionItem:{name:"CollectionItemField",isCollection:!1,isCollectionOrScalar:!1},ConditioningCollection:{name:"ConditioningField",isCollection:!0,isCollectionOrScalar:!1},ConditioningField:{name:"ConditioningField",isCollection:!1,isCollectionOrScalar:!1},ConditioningPolymorphic:{name:"ConditioningField",isCollection:!1,isCollectionOrScalar:!0},ControlCollection:{name:"ControlField",isCollection:!0,isCollectionOrScalar:!1},ControlField:{name:"ControlField",isCollection:!1,isCollectionOrScalar:!1},ControlPolymorphic:{name:"ControlField",isCollection:!1,isCollectionOrScalar:!0},DenoiseMaskField:{name:"DenoiseMaskField",isCollection:!1,isCollectionOrScalar:!1},IPAdapterField:{name:"IPAdapterField",isCollection:!1,isCollectionOrScalar:!1},IPAdapterCollection:{name:"IPAdapterField",isCollection:!0,isCollectionOrScalar:!1},IPAdapterPolymorphic:{name:"IPAdapterField",isCollection:!1,isCollectionOrScalar:!0},LatentsField:{name:"LatentsField",isCollection:!1,isCollectionOrScalar:!1},LatentsCollection:{name:"LatentsField",isCollection:!0,isCollectionOrScalar:!1},LatentsPolymorphic:{name:"LatentsField",isCollection:!1,isCollectionOrScalar:!0},MetadataField:{name:"MetadataField",isCollection:!1,isCollectionOrScalar:!1},MetadataCollection:{name:"MetadataField",isCollection:!0,isCollectionOrScalar:!1},MetadataItemField:{name:"MetadataItemField",isCollection:!1,isCollectionOrScalar:!1},MetadataItemCollection:{name:"MetadataItemField",isCollection:!0,isCollectionOrScalar:!1},MetadataItemPolymorphic:{name:"MetadataItemField",isCollection:!1,isCollectionOrScalar:!0},ONNXModelField:{name:"ONNXModelField",isCollection:!1,isCollectionOrScalar:!1},T2IAdapterField:{name:"T2IAdapterField",isCollection:!1,isCollectionOrScalar:!1},T2IAdapterCollection:{name:"T2IAdapterField",isCollection:!0,isCollectionOrScalar:!1},T2IAdapterPolymorphic:{name:"T2IAdapterField",isCollection:!1,isCollectionOrScalar:!0},UNetField:{name:"UNetField",isCollection:!1,isCollectionOrScalar:!1},VaeField:{name:"VaeField",isCollection:!1,isCollectionOrScalar:!1}},cO={...uFe,...dFe},fFe=T.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"]),nk=T.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),hFe=T.object({model_name:T.string().min(1),base_model:nk,model_type:T.literal("main")}),pFe=T.object({model_name:T.string().min(1),base_model:nk,model_type:T.literal("onnx")}),rk=T.union([hFe,pFe]),gFe=T.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"]),QH=T.object({id:T.string().trim().min(1),name:T.string().trim().min(1),type:gFe}),mFe=QH.extend({fieldKind:T.literal("output")}),Ee=QH.extend({fieldKind:T.literal("input"),label:T.string()}),wa=T.object({model_name:T.string().trim().min(1),base_model:nk}),Kf=T.object({image_name:T.string().trim().min(1)}),yFe=T.object({board_id:T.string().trim().min(1)}),db=T.object({latents_name:T.string().trim().min(1),seed:T.number().int().optional()}),fb=T.object({conditioning_name:T.string().trim().min(1)}),vFe=T.object({mask_name:T.string().trim().min(1),masked_latents_name:T.string().trim().min(1).optional()}),bFe=Ee.extend({type:T.literal("integer"),value:T.number().int().optional()}),_Fe=Ee.extend({type:T.literal("IntegerCollection"),value:T.array(T.number().int()).optional()}),SFe=Ee.extend({type:T.literal("IntegerPolymorphic"),value:T.number().int().optional()}),xFe=Ee.extend({type:T.literal("float"),value:T.number().optional()}),wFe=Ee.extend({type:T.literal("FloatCollection"),value:T.array(T.number()).optional()}),CFe=Ee.extend({type:T.literal("FloatPolymorphic"),value:T.number().optional()}),EFe=Ee.extend({type:T.literal("string"),value:T.string().optional()}),TFe=Ee.extend({type:T.literal("StringCollection"),value:T.array(T.string()).optional()}),AFe=Ee.extend({type:T.literal("StringPolymorphic"),value:T.string().optional()}),kFe=Ee.extend({type:T.literal("boolean"),value:T.boolean().optional()}),PFe=Ee.extend({type:T.literal("BooleanCollection"),value:T.array(T.boolean()).optional()}),IFe=Ee.extend({type:T.literal("BooleanPolymorphic"),value:T.boolean().optional()}),MFe=Ee.extend({type:T.literal("enum"),value:T.string().optional()}),RFe=Ee.extend({type:T.literal("LatentsField"),value:db.optional()}),OFe=Ee.extend({type:T.literal("LatentsCollection"),value:T.array(db).optional()}),$Fe=Ee.extend({type:T.literal("LatentsPolymorphic"),value:T.union([db,T.array(db)]).optional()}),NFe=Ee.extend({type:T.literal("DenoiseMaskField"),value:vFe.optional()}),FFe=Ee.extend({type:T.literal("ConditioningField"),value:fb.optional()}),DFe=Ee.extend({type:T.literal("ConditioningCollection"),value:T.array(fb).optional()}),LFe=Ee.extend({type:T.literal("ConditioningPolymorphic"),value:T.union([fb,T.array(fb)]).optional()}),BFe=wa,hb=T.object({image:Kf,control_model:BFe,control_weight:T.union([T.number(),T.array(T.number())]).optional(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional(),control_mode:T.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:T.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),zFe=Ee.extend({type:T.literal("ControlField"),value:hb.optional()}),jFe=Ee.extend({type:T.literal("ControlPolymorphic"),value:T.union([hb,T.array(hb)]).optional()}),VFe=Ee.extend({type:T.literal("ControlCollection"),value:T.array(hb).optional()}),UFe=wa,pb=T.object({image:Kf,ip_adapter_model:UFe,weight:T.number(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional()}),GFe=Ee.extend({type:T.literal("IPAdapterField"),value:pb.optional()}),HFe=Ee.extend({type:T.literal("IPAdapterPolymorphic"),value:T.union([pb,T.array(pb)]).optional()}),WFe=Ee.extend({type:T.literal("IPAdapterCollection"),value:T.array(pb).optional()}),qFe=wa,gb=T.object({image:Kf,t2i_adapter_model:qFe,weight:T.union([T.number(),T.array(T.number())]).optional(),begin_step_percent:T.number().optional(),end_step_percent:T.number().optional(),resize_mode:T.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),KFe=Ee.extend({type:T.literal("T2IAdapterField"),value:gb.optional()}),XFe=Ee.extend({type:T.literal("T2IAdapterPolymorphic"),value:T.union([gb,T.array(gb)]).optional()}),QFe=Ee.extend({type:T.literal("T2IAdapterCollection"),value:T.array(gb).optional()}),YFe=T.enum(["onnx","main","vae","lora","controlnet","embedding"]),ZFe=T.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),Ef=wa.extend({model_type:YFe,submodel:ZFe.optional()}),YH=Ef.extend({weight:T.number().optional()}),JFe=T.object({unet:Ef,scheduler:Ef,loras:T.array(YH)}),eDe=Ee.extend({type:T.literal("UNetField"),value:JFe.optional()}),tDe=T.object({tokenizer:Ef,text_encoder:Ef,skipped_layers:T.number(),loras:T.array(YH)}),nDe=Ee.extend({type:T.literal("ClipField"),value:tDe.optional()}),rDe=T.object({vae:Ef}),iDe=Ee.extend({type:T.literal("VaeField"),value:rDe.optional()}),oDe=Ee.extend({type:T.literal("ImageField"),value:Kf.optional()}),sDe=Ee.extend({type:T.literal("BoardField"),value:yFe.optional()}),aDe=Ee.extend({type:T.literal("ImagePolymorphic"),value:Kf.optional()}),lDe=Ee.extend({type:T.literal("ImageCollection"),value:T.array(Kf).optional()}),cDe=Ee.extend({type:T.literal("MainModelField"),value:rk.optional()}),uDe=Ee.extend({type:T.literal("SDXLMainModelField"),value:rk.optional()}),dDe=Ee.extend({type:T.literal("SDXLRefinerModelField"),value:rk.optional()}),fDe=wa,hDe=Ee.extend({type:T.literal("VaeModelField"),value:fDe.optional()}),pDe=wa,gDe=Ee.extend({type:T.literal("LoRAModelField"),value:pDe.optional()}),mDe=wa,yDe=Ee.extend({type:T.literal("ControlNetModelField"),value:mDe.optional()}),vDe=wa,bDe=Ee.extend({type:T.literal("IPAdapterModelField"),value:vDe.optional()}),_De=wa,SDe=Ee.extend({type:T.literal("T2IAdapterModelField"),value:_De.optional()}),xDe=Ee.extend({type:T.literal("Collection"),value:T.array(T.any()).optional()}),wDe=Ee.extend({type:T.literal("CollectionItem"),value:T.any().optional()}),mb=T.object({label:T.string(),value:T.any()}),CDe=Ee.extend({type:T.literal("MetadataItemField"),value:mb.optional()}),EDe=Ee.extend({type:T.literal("MetadataItemCollection"),value:T.array(mb).optional()}),TDe=Ee.extend({type:T.literal("MetadataItemPolymorphic"),value:T.union([mb,T.array(mb)]).optional()}),ZH=T.record(T.any()),ADe=Ee.extend({type:T.literal("MetadataField"),value:ZH.optional()}),kDe=Ee.extend({type:T.literal("MetadataCollection"),value:T.array(ZH).optional()}),yb=T.object({r:T.number().int().min(0).max(255),g:T.number().int().min(0).max(255),b:T.number().int().min(0).max(255),a:T.number().int().min(0).max(255)}),PDe=Ee.extend({type:T.literal("ColorField"),value:yb.optional()}),IDe=Ee.extend({type:T.literal("ColorCollection"),value:T.array(yb).optional()}),MDe=Ee.extend({type:T.literal("ColorPolymorphic"),value:T.union([yb,T.array(yb)]).optional()}),RDe=Ee.extend({type:T.literal("Scheduler"),value:fFe.optional()}),ODe=Ee.extend({type:T.literal("Any"),value:T.any().optional()}),$De=T.discriminatedUnion("type",[ODe,sDe,PFe,kFe,IFe,nDe,xDe,wDe,PDe,IDe,MDe,FFe,DFe,LFe,zFe,yDe,VFe,jFe,NFe,MFe,wFe,xFe,CFe,lDe,aDe,oDe,_Fe,SFe,bFe,GFe,bDe,WFe,HFe,RFe,OFe,$Fe,gDe,cDe,RDe,uDe,dDe,TFe,AFe,EFe,KFe,SDe,QFe,XFe,eDe,iDe,hDe,CDe,EDe,TDe,ADe,kDe]),NDe=T.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))}),FDe=T.object({id:T.string().trim().min(1),type:T.string().trim().min(1),inputs:T.record($De),outputs:T.record(mFe),label:T.string(),isOpen:T.boolean(),notes:T.string(),embedWorkflow:T.boolean(),isIntermediate:T.boolean(),useCache:T.boolean().default(!0),version:NDe.optional()}),DDe=T.object({id:T.string().trim().min(1),type:T.literal("notes"),label:T.string(),isOpen:T.boolean(),notes:T.string()}),JH=T.object({x:T.number(),y:T.number()}).default({x:0,y:0}),vb=T.number().gt(0).nullish(),LDe=T.object({id:T.string().trim().min(1),type:T.literal("invocation"),data:FDe,width:vb,height:vb,position:JH}),BDe=T.object({id:T.string().trim().min(1),type:T.literal("notes"),data:DDe,width:vb,height:vb,position:JH}),zDe=T.discriminatedUnion("type",[LDe,BDe]),jDe=T.object({source:T.string().trim().min(1),sourceHandle:T.string().trim().min(1),target:T.string().trim().min(1),targetHandle:T.string().trim().min(1),id:T.string().trim().min(1),type:T.literal("default")}),VDe=T.object({source:T.string().trim().min(1),target:T.string().trim().min(1),id:T.string().trim().min(1),type:T.literal("collapsed")}),UDe=T.union([jDe,VDe]),GDe=T.object({nodeId:T.string().trim().min(1),fieldName:T.string().trim().min(1)}),HDe=T.object({name:T.string().default(""),author:T.string().default(""),description:T.string().default(""),version:T.string().default(""),contact:T.string().default(""),tags:T.string().default(""),notes:T.string().default(""),nodes:T.array(zDe).default([]),edges:T.array(UDe).default([]),exposedFields:T.array(GDe).default([]),meta:T.object({version:T.literal("1.0.0")})}),WDe=T.object({meta:T.object({version:tS})}),qDe=e=>{var n;const t=(n=MD.get())==null?void 0:n.getState().nodes.nodeTemplates;if(!t)throw new Error(J("app.storeNotInitialized"));return e.nodes.forEach(r=>{var i;if(r.type==="invocation"){Fo(r.data.inputs,a=>{const l=cO[a.type];if(!l)throw new sE(J("nodes.unknownFieldType",{type:a.type}));a.type=l}),Fo(r.data.outputs,a=>{const l=cO[a.type];if(!l)throw new sE(J("nodes.unknownFieldType",{type:a.type}));a.type=l});const o=t[r.data.type],s=o?o.nodePack:J("common.unknown");r.data.nodePack=s,(i=r.data).version||(i.version="1.0.0")}}),e.meta.version="2.0.0",e.meta.category="user",BH.parse(e)},KDe=e=>{const t=WDe.safeParse(e);if(!t.success)throw new oE(J("nodes.unableToGetWorkflowVersion"));const{version:n}=t.data.meta;if(n==="1.0.0"){const r=HDe.parse(e);return qDe(r)}if(n==="2.0.0")return BH.parse(e);throw new oE(J("nodes.unrecognizedWorkflowVersion",{version:n}))},XDe=(e,t)=>{const n=KDe(e);n.meta.category==="default"&&(n.meta.category="user",n.id=void 0);const{nodes:r,edges:i}=n,o=[],s=r.filter(Q7e),a=VF(s,"id");return s.forEach(l=>{const c=t[l.data.type];if(!c){const u=J("nodes.missingTemplate",{node:l.id,type:l.data.type});o.push({message:u,data:tt(l)});return}if(tk(l,c)){const u=J("nodes.mismatchedVersion",{node:l.id,type:l.data.type});o.push({message:u,data:tt({node:l,nodeTemplate:c})});return}}),i.forEach((l,c)=>{const u=a[l.source],d=a[l.target],f=u?t[u.data.type]:void 0,h=d?t[d.data.type]:void 0,p=[];if(u||p.push(J("nodes.sourceNodeDoesNotExist",{node:l.source})),f||p.push(J("nodes.missingTemplate",{node:l.source,type:u==null?void 0:u.data.type})),u&&f&&l.type==="default"&&!(l.sourceHandle in f.outputs)&&p.push(J("nodes.sourceNodeFieldDoesNotExist",{node:l.source,field:l.sourceHandle})),d||p.push(J("nodes.targetNodeDoesNotExist",{node:l.target})),h||p.push(J("nodes.missingTemplate",{node:l.target,type:d==null?void 0:d.data.type})),d&&h&&l.type==="default"&&!(l.targetHandle in h.inputs)&&p.push(J("nodes.targetNodeFieldDoesNotExist",{node:l.target,field:l.targetHandle})),p.length){delete i[c];const m=l.type==="default"?`${l.source}.${l.sourceHandle}`:l.source,_=l.type==="default"?`${l.source}.${l.targetHandle}`:l.target;o.push({message:J("nodes.deletedInvalidEdge",{source:m,target:_}),issues:p,data:l})}}),{workflow:n,warnings:o}},QDe=()=>{fe({actionCreator:nhe,effect:(e,{dispatch:t,getState:n})=>{const r=ue("nodes"),{workflow:i,asCopy:o}=e.payload,s=n().nodes.nodeTemplates;try{const{workflow:a,warnings:l}=XDe(i,s);o&&delete a.id,t(yT(a)),l.length?(t(Ve(pi({title:J("toast.loadedWithWarnings"),status:"warning"}))),l.forEach(({message:c,...u})=>{r.warn(u,c)})):t(Ve(pi({title:J("toast.workflowLoaded"),status:"success"}))),t(Gj("nodes")),requestAnimationFrame(()=>{var c;(c=ZNe.get())==null||c.fitView()})}catch(a){if(a instanceof oE)r.error({error:tt(a)},a.message),t(Ve(pi({title:J("nodes.unableToValidateWorkflow"),status:"error",description:a.message})));else if(a instanceof sE)r.error({error:tt(a)},a.message),t(Ve(pi({title:J("nodes.unableToValidateWorkflow"),status:"error",description:a.message})));else if(a instanceof T.ZodError){const{message:l}=rE(a,{prefix:J("nodes.workflowValidation")});r.error({error:tt(a)},l),t(Ve(pi({title:J("nodes.unableToValidateWorkflow"),status:"error",description:l})))}else r.error({error:tt(a)},J("nodes.unknownErrorValidatingWorkflow")),t(Ve(pi({title:J("nodes.unableToValidateWorkflow"),status:"error",description:J("nodes.unknownErrorValidatingWorkflow")})))}}})},YDe=()=>{fe({actionCreator:rhe,effect:(e,{dispatch:t,getState:n})=>{const r=ue("nodes"),i=n().nodes.nodes,o=n().nodes.nodeTemplates;let s=0;i.filter(Sn).forEach(a=>{const l=o[a.data.type];if(!l){s++;return}if(tk(a,l))try{const c=cFe(a,l);t(Mj({nodeId:c.id,node:c}))}catch(c){c instanceof GH&&s++}}),s?(r.warn(J("nodes.unableToUpdateNodes",{count:s})),t(Ve(pi({title:J("nodes.unableToUpdateNodes",{count:s})})))):t(Ve(pi({title:J("nodes.allNodesUpdated"),status:"success"})))}})},eW=kY(),fe=eW.startListening;x$e();w$e();k$e();h$e();p$e();g$e();m$e();y$e();H8e();S$e();C$e();E$e();D7e();u$e();H7e();F_e();U8e();f7e();l7e();aMe();c7e();sMe();iMe();d7e();kNe();$_e();mNe();yNe();bNe();_Ne();xNe();pNe();gNe();TNe();ANe();wNe();ENe();SNe();CNe();g7e();p7e();d$e();f$e();b$e();_$e();W8e();hNe();QDe();YDe();v$e();P$e();B_e();M$e();D_e();N_e();YNe();INe();$$e();const ZDe=T.object({payload:T.object({status:T.literal(403),data:T.object({detail:T.string()})})}),JDe=e=>t=>n=>{if(fm(n))try{const r=ZDe.parse(n),{dispatch:i}=e,o=r.payload.data.detail!=="Forbidden"?r.payload.data.detail:void 0;i(Ve({title:J("common.somethingWentWrong"),status:"error",description:o}))}catch{}return t(n)},eLe={canvas:cue,gallery:Wfe,generation:Qle,nodes:vbe,postprocessing:Sbe,system:tse,config:Kse,ui:Ebe,hotkeys:Cbe,controlAdapters:gae,dynamicPrompts:Sue,deleteImageModal:pue,changeBoardModal:due,lora:Xfe,modelmanager:Yfe,sdxl:wbe,queue:ice,workflow:_be,[Lo.reducerPath]:Lo.reducer},tLe=Vb(eLe),nLe=g_e(tLe),rLe=["canvas","gallery","generation","sdxl","nodes","workflow","postprocessing","system","ui","controlAdapters","dynamicPrompts","lora","modelmanager"],uO=Hj("invoke","invoke-store"),iLe={getItem:e=>Tbe(e,uO),setItem:(e,t)=>Abe(e,t,uO)},oLe=(e,t=!0)=>HQ({reducer:nLe,middleware:n=>n({serializableCheck:!1,immutableCheck:!1}).concat(Lo.middleware).concat(Hbe).concat(JDe).prepend(eW.middleware),enhancers:n=>{const r=n().concat(gN());return t&&r.push(m_e(iLe,rLe,{persistDebounce:300,serialize:A_e,unserialize:P_e,prefix:e?`${tM}${e}-`:tM})),r},devTools:{actionSanitizer:I_e,stateSanitizer:R_e,trace:!0,predicate:(n,r)=>!M_e.includes(r.type)}}),tW=e=>e,sLe=""+new URL("logo-13003d72.png",import.meta.url).href,aLe=()=>ie.jsxs($A,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[ie.jsx(OA,{src:sLe,w:"8rem",h:"8rem"}),ie.jsx(IA,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),lLe=I.memo(aLe),F2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xf(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ik(e){return"nodeType"in e}function zr(e){var t,n;return e?Xf(e)?e:ik(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ok(e){const{Document:t}=zr(e);return e instanceof t}function s0(e){return Xf(e)?!1:e instanceof zr(e).HTMLElement}function nW(e){return e instanceof zr(e).SVGElement}function Qf(e){return e?Xf(e)?e.document:ik(e)?ok(e)?e:s0(e)||nW(e)?e.ownerDocument:document:document:document}const Cs=F2?I.useLayoutEffect:I.useEffect;function D2(e){const t=I.useRef(e);return Cs(()=>{t.current=e}),I.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 cLe(){const e=I.useRef(null),t=I.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=I.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function qg(e,t){t===void 0&&(t=[e]);const n=I.useRef(e);return Cs(()=>{n.current!==e&&(n.current=e)},t),n}function a0(e,t){const n=I.useRef();return I.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bb(e){const t=D2(e),n=I.useRef(null),r=I.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function _b(e){const t=I.useRef();return I.useEffect(()=>{t.current=e},[e]),t.current}let dC={};function L2(e,t){return I.useMemo(()=>{if(t)return t;const n=dC[e]==null?0:dC[e]+1;return dC[e]=n,e+"-"+n},[e,t])}function rW(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=o[l];u!=null&&(o[l]=u+e*c)}return o},{...t})}}const Hd=rW(1),Sb=rW(-1);function uLe(e){return"clientX"in e&&"clientY"in e}function sk(e){if(!e)return!1;const{KeyboardEvent:t}=zr(e.target);return t&&e instanceof t}function dLe(e){if(!e)return!1;const{TouchEvent:t}=zr(e.target);return t&&e instanceof t}function Kg(e){if(dLe(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 uLe(e)?{x:e.clientX,y:e.clientY}:null}const Xg=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[Xg.Translate.toString(e),Xg.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),dO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function fLe(e){return e.matches(dO)?e:e.querySelector(dO)}const hLe={display:"none"};function pLe(e){let{id:t,value:n}=e;return Q.createElement("div",{id:t,style:hLe},n)}function gLe(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 Q.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function mLe(){const[e,t]=I.useState("");return{announce:I.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const iW=I.createContext(null);function yLe(e){const t=I.useContext(iW);I.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function vLe(){const[e]=I.useState(()=>new Set),t=I.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[I.useCallback(r=>{let{type:i,event:o}=r;e.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[e]),t]}const bLe={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.
`},_Le={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 SLe(e){let{announcements:t=_Le,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=bLe}=e;const{announce:o,announcement:s}=mLe(),a=L2("DndLiveRegion"),[l,c]=I.useState(!1);if(I.useEffect(()=>{c(!0)},[]),yLe(I.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 u=Q.createElement(Q.Fragment,null,Q.createElement(pLe,{id:r,value:i.draggable}),Q.createElement(gLe,{id:a,announcement:s}));return n?gi.createPortal(u,n):u}var wn;(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"})(wn||(wn={}));function xb(){}function fO(e,t){return I.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function xLe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return I.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const zo=Object.freeze({x:0,y:0});function wLe(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function CLe(e,t){const n=Kg(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 ELe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function TLe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ALe(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 kLe(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function PLe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const ILe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=PLe(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(TLe)};function MLe(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 RLe=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:s}=o,a=n.get(s);if(a&&MLe(r,a)){const c=ALe(a).reduce((d,f)=>d+wLe(r,f),0),u=Number((c/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:u}})}}return i.sort(ELe)};function OLe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function oW(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zo}function $Le(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const NLe=$Le(1);function sW(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 FLe(e,t,n){const r=sW(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const DLe={ignoreTransform:!1};function l0(e,t){t===void 0&&(t=DLe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=zr(e).getComputedStyle(e);c&&(n=FLe(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function hO(e){return l0(e,{ignoreTransform:!0})}function LLe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function BLe(e,t){return t===void 0&&(t=zr(e).getComputedStyle(e)),t.position==="fixed"}function zLe(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 ak(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(ok(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!s0(i)||nW(i)||n.includes(i))return n;const o=zr(e).getComputedStyle(i);return i!==e&&zLe(i,o)&&n.push(i),BLe(i,o)?n:r(i.parentNode)}return e?r(e):n}function aW(e){const[t]=ak(e,1);return t??null}function fC(e){return!F2||!e?null:Xf(e)?e:ik(e)?ok(e)||e===Qf(e).scrollingElement?window:s0(e)?e:null:null}function lW(e){return Xf(e)?e.scrollX:e.scrollLeft}function cW(e){return Xf(e)?e.scrollY:e.scrollTop}function dE(e){return{x:lW(e),y:cW(e)}}var Fn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Fn||(Fn={}));function uW(e){return!F2||!e?!1:e===document.scrollingElement}function dW(e){const t={x:0,y:0},n=uW(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const jLe={x:.2,y:.2};function VLe(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=jLe);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=dW(e),h={x:0,y:0},p={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+m.height?(h.y=Fn.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!u&&l>=t.bottom-m.height&&(h.y=Fn.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&a>=t.right-m.width?(h.x=Fn.Forward,p.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&s<=t.left+m.width&&(h.x=Fn.Backward,p.x=r*Math.abs((t.left+m.width-s)/m.width)),{direction:h,speed:p}}function ULe(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function fW(e){return e.reduce((t,n)=>Hd(t,dE(n)),zo)}function GLe(e){return e.reduce((t,n)=>t+lW(n),0)}function HLe(e){return e.reduce((t,n)=>t+cW(n),0)}function hW(e,t){if(t===void 0&&(t=l0),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);aW(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const WLe=[["x",["left","right"],GLe],["y",["top","bottom"],HLe]];class lk{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=ak(n),i=fW(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of WLe)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Pp{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 qLe(e){const{EventTarget:t}=zr(e);return e instanceof t?e:Qf(e)}function hC(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 Gi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Gi||(Gi={}));function pO(e){e.preventDefault()}function KLe(e){e.stopPropagation()}var Ct;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Ct||(Ct={}));const pW={start:[Ct.Space,Ct.Enter],cancel:[Ct.Esc],end:[Ct.Space,Ct.Enter]},XLe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ct.Right:return{...n,x:n.x+25};case Ct.Left:return{...n,x:n.x-25};case Ct.Down:return{...n,y:n.y+25};case Ct.Up:return{...n,y:n.y-25}}};class gW{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 Pp(Qf(n)),this.windowListeners=new Pp(zr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&hW(r),n(zo)}handleKeyDown(t){if(sk(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=pW,coordinateGetter:s=XLe,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:zo;this.referenceCoordinates||(this.referenceCoordinates=u);const d=s(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=Sb(d,u),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const _=t.code,{isTop:v,isRight:y,isLeft:g,isBottom:b,maxScroll:S,minScroll:w}=dW(m),C=ULe(m),x={x:Math.min(_===Ct.Right?C.right-C.width/2:C.right,Math.max(_===Ct.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(_===Ct.Down?C.bottom-C.height/2:C.bottom,Math.max(_===Ct.Down?C.top:C.top+C.height/2,d.y))},k=_===Ct.Right&&!y||_===Ct.Left&&!g,A=_===Ct.Down&&!b||_===Ct.Up&&!v;if(k&&x.x!==d.x){const R=m.scrollLeft+f.x,L=_===Ct.Right&&R<=S.x||_===Ct.Left&&R>=w.x;if(L&&!f.y){m.scrollTo({left:R,behavior:a});return}L?h.x=m.scrollLeft-R:h.x=_===Ct.Right?m.scrollLeft-S.x:m.scrollLeft-w.x,h.x&&m.scrollBy({left:-h.x,behavior:a});break}else if(A&&x.y!==d.y){const R=m.scrollTop+f.y,L=_===Ct.Down&&R<=S.y||_===Ct.Up&&R>=w.y;if(L&&!f.x){m.scrollTo({top:R,behavior:a});return}L?h.y=m.scrollTop-R:h.y=_===Ct.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Hd(Sb(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()}}gW.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pW,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function gO(e){return!!(e&&"distance"in e)}function mO(e){return!!(e&&"delay"in e)}class ck{constructor(t,n,r){var i;r===void 0&&(r=qLe(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=Qf(s),this.documentListeners=new Pp(this.document),this.listeners=new Pp(r),this.windowListeners=new Pp(zr(s)),this.initialCoordinates=(i=Kg(o))!=null?i:zo,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(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.DragStart,pO),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),this.windowListeners.add(Gi.ContextMenu,pO),this.documentListeners.add(Gi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mO(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(gO(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(Gi.Click,KLe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=Kg(t))!=null?n:zo,c=Sb(i,l);if(!r&&a){if(gO(a)){if(a.tolerance!=null&&hC(c,a.tolerance))return this.handleCancel();if(hC(c,a.distance))return this.handleStart()}return mO(a)&&hC(c,a.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Ct.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const QLe={move:{name:"pointermove"},end:{name:"pointerup"}};class mW extends ck{constructor(t){const{event:n}=t,r=Qf(n.target);super(t,QLe,r)}}mW.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 YLe={move:{name:"mousemove"},end:{name:"mouseup"}};var fE;(function(e){e[e.RightClick=2]="RightClick"})(fE||(fE={}));class yW extends ck{constructor(t){super(t,YLe,Qf(t.event.target))}}yW.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===fE.RightClick?!1:(r==null||r({event:n}),!0)}}];const pC={move:{name:"touchmove"},end:{name:"touchend"}};class vW extends ck{constructor(t){super(t,pC)}static setup(){return window.addEventListener(pC.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(pC.move.name,t)};function t(){}}}vW.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 Ip;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ip||(Ip={}));var wb;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(wb||(wb={}));function ZLe(e){let{acceleration:t,activator:n=Ip.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=wb.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=eBe({delta:d,disabled:!o}),[p,m]=cLe(),_=I.useRef({x:0,y:0}),v=I.useRef({x:0,y:0}),y=I.useMemo(()=>{switch(n){case Ip.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ip.DraggableRect:return i}},[n,i,l]),g=I.useRef(null),b=I.useCallback(()=>{const w=g.current;if(!w)return;const C=_.current.x*v.current.x,x=_.current.y*v.current.y;w.scrollBy(C,x)},[]),S=I.useMemo(()=>a===wb.TreeOrder?[...c].reverse():c,[a,c]);I.useEffect(()=>{if(!o||!c.length||!y){m();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const C=c.indexOf(w),x=u[C];if(!x)continue;const{direction:k,speed:A}=VLe(w,x,y,t,f);for(const R of["x","y"])h[R][k[R]]||(A[R]=0,k[R]=0);if(A.x>0||A.y>0){m(),g.current=w,p(b,s),_.current=A,v.current=k;return}}_.current={x:0,y:0},v.current={x:0,y:0},m()},[t,b,r,m,o,s,JSON.stringify(y),JSON.stringify(h),p,c,S,u,JSON.stringify(f)])}const JLe={x:{[Fn.Backward]:!1,[Fn.Forward]:!1},y:{[Fn.Backward]:!1,[Fn.Forward]:!1}};function eBe(e){let{delta:t,disabled:n}=e;const r=_b(t);return a0(i=>{if(n||!r||!i)return JLe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Fn.Backward]:i.x[Fn.Backward]||o.x===-1,[Fn.Forward]:i.x[Fn.Forward]||o.x===1},y:{[Fn.Backward]:i.y[Fn.Backward]||o.y===-1,[Fn.Forward]:i.y[Fn.Forward]||o.y===1}}},[n,t,r])}function tBe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return a0(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function nBe(e,t){return I.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var Qg;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Qg||(Qg={}));var hE;(function(e){e.Optimized="optimized"})(hE||(hE={}));const yO=new Map;function rBe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=I.useState(null),{frequency:a,measure:l,strategy:c}=i,u=I.useRef(e),d=_(),f=qg(d),h=I.useCallback(function(v){v===void 0&&(v=[]),!f.current&&s(y=>y===null?v:y.concat(v.filter(g=>!y.includes(g))))},[f]),p=I.useRef(null),m=a0(v=>{if(d&&!n)return yO;if(!v||v===yO||u.current!==e||o!=null){const y=new Map;for(let g of e){if(!g)continue;if(o&&o.length>0&&!o.includes(g.id)&&g.rect.current){y.set(g.id,g.rect.current);continue}const b=g.node.current,S=b?new lk(l(b),b):null;g.rect.current=S,S&&y.set(g.id,S)}return y}return v},[e,o,n,d,l]);return I.useEffect(()=>{u.current=e},[e]),I.useEffect(()=>{d||h()},[n,d]),I.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),I.useEffect(()=>{d||typeof a!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},a))},[a,d,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:o!=null};function _(){switch(c){case Qg.Always:return!1;case Qg.BeforeDragging:return n;default:return!n}}}function uk(e,t){return a0(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function iBe(e,t){return uk(e,t)}function oBe(e){let{callback:t,disabled:n}=e;const r=D2(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function B2(e){let{callback:t,disabled:n}=e;const r=D2(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function sBe(e){return new lk(l0(e),e)}function vO(e,t,n){t===void 0&&(t=sBe);const[r,i]=I.useReducer(a,null),o=oBe({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),s=B2({callback:i});return Cs(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u}}function aBe(e){const t=uk(e);return oW(e,t)}const bO=[];function lBe(e){const t=I.useRef(e),n=a0(r=>e?r&&r!==bO&&e&&t.current&&e.parentNode===t.current.parentNode?r:ak(e):bO,[e]);return I.useEffect(()=>{t.current=e},[e]),n}function cBe(e){const[t,n]=I.useState(null),r=I.useRef(e),i=I.useCallback(o=>{const s=fC(o.target);s&&n(a=>a?(a.set(s,dE(s)),new Map(a)):null)},[]);return I.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=fC(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,dE(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=fC(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),I.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>Hd(o,s),zo):fW(e):zo,[e,t])}function _O(e,t){t===void 0&&(t=[]);const n=I.useRef(null);return I.useEffect(()=>{n.current=null},t),I.useEffect(()=>{const r=e!==zo;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Sb(e,n.current):zo}function uBe(e){I.useEffect(()=>{if(!F2)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 dBe(e,t){return I.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function bW(e){return I.useMemo(()=>e?LLe(e):null,[e])}const gC=[];function fBe(e,t){t===void 0&&(t=l0);const[n]=e,r=bW(n?zr(n):null),[i,o]=I.useReducer(a,gC),s=B2({callback:o});return e.length>0&&i===gC&&o(),Cs(()=>{e.length?e.forEach(l=>s==null?void 0:s.observe(l)):(s==null||s.disconnect(),o())},[e]),i;function a(){return e.length?e.map(l=>uW(l)?r:new lk(t(l),l)):gC}}function _W(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return s0(t)?t:e}function hBe(e){let{measure:t}=e;const[n,r]=I.useState(null),i=I.useCallback(c=>{for(const{target:u}of c)if(s0(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=B2({callback:i}),s=I.useCallback(c=>{const u=_W(c);o==null||o.disconnect(),u&&(o==null||o.observe(u)),r(u?t(u):null)},[t,o]),[a,l]=bb(s);return I.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const pBe=[{sensor:mW,options:{}},{sensor:gW,options:{}}],gBe={current:{}},Cv={draggable:{measure:hO},droppable:{measure:hO,strategy:Qg.WhileDragging,frequency:hE.Optimized},dragOverlay:{measure:l0}};class Mp 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 mBe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:xb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cv,measureDroppableContainers:xb,windowRect:null,measuringScheduled:!1},SW={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:xb,draggableNodes:new Map,over:null,measureDroppableContainers:xb},c0=I.createContext(SW),xW=I.createContext(mBe);function yBe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mp}}}function vBe(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.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 wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Mp(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case wn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Mp(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case wn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Mp(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function bBe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=I.useContext(c0),o=_b(r),s=_b(n==null?void 0:n.id);return I.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!sk(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=fLe(u);if(d){d.focus();break}}})}},[r,t,i,s,o]),null}function wW(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function _Be(e){return I.useMemo(()=>({draggable:{...Cv.draggable,...e==null?void 0:e.draggable},droppable:{...Cv.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Cv.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 SBe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=I.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Cs(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=oW(u,r);if(s||(d.x=0),a||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=aW(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const z2=I.createContext({...zo,scaleX:1,scaleY:1});var Ua;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ua||(Ua={}));const xBe=I.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=pBe,collisionDetection:d=ILe,measuring:f,modifiers:h,...p}=t;const m=I.useReducer(vBe,void 0,yBe),[_,v]=m,[y,g]=vLe(),[b,S]=I.useState(Ua.Uninitialized),w=b===Ua.Initialized,{draggable:{active:C,nodes:x,translate:k},droppable:{containers:A}}=_,R=C?x.get(C):null,L=I.useRef({initial:null,translated:null}),M=I.useMemo(()=>{var Ut;return C!=null?{id:C,data:(Ut=R==null?void 0:R.data)!=null?Ut:gBe,rect:L}:null},[C,R]),E=I.useRef(null),[P,O]=I.useState(null),[F,$]=I.useState(null),D=qg(p,Object.values(p)),N=L2("DndDescribedBy",s),z=I.useMemo(()=>A.getEnabled(),[A]),V=_Be(f),{droppableRects:H,measureDroppableContainers:X,measuringScheduled:te}=rBe(z,{dragging:w,dependencies:[k.x,k.y],config:V.droppable}),ee=tBe(x,C),j=I.useMemo(()=>F?Kg(F):null,[F]),q=Hl(),Z=iBe(ee,V.draggable.measure);SBe({activeNode:C?x.get(C):null,config:q.layoutShiftCompensation,initialRect:Z,measure:V.draggable.measure});const oe=vO(ee,V.draggable.measure,Z),be=vO(ee?ee.parentElement:null),Me=I.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),lt=A.getNodeFor((n=Me.current.over)==null?void 0:n.id),Le=hBe({measure:V.dragOverlay.measure}),we=(r=Le.nodeRef.current)!=null?r:ee,pt=w?(i=Le.rect)!=null?i:oe:null,vt=!!(Le.nodeRef.current&&Le.rect),Ce=aBe(vt?null:oe),ii=bW(we?zr(we):null),sn=lBe(w?lt??ee:null),jr=fBe(sn),sr=wW(h,{transform:{x:k.x-Ce.x,y:k.y-Ce.y,scaleX:1,scaleY:1},activatorEvent:F,active:M,activeNodeRect:oe,containerNodeRect:be,draggingNodeRect:pt,over:Me.current.over,overlayNodeRect:Le.rect,scrollableAncestors:sn,scrollableAncestorRects:jr,windowRect:ii}),fn=j?Hd(j,k):null,Vr=cBe(sn),fo=_O(Vr),Ri=_O(Vr,[oe]),ar=Hd(sr,fo),Wn=pt?NLe(pt,sr):null,wr=M&&Wn?d({active:M,collisionRect:Wn,droppableRects:H,droppableContainers:z,pointerCoordinates:fn}):null,Yt=kLe(wr,"id"),[It,oi]=I.useState(null),Oi=vt?sr:Hd(sr,Ri),ho=OLe(Oi,(o=It==null?void 0:It.rect)!=null?o:null,oe),Ur=I.useCallback((Ut,_t)=>{let{sensor:qn,options:Pn}=_t;if(E.current==null)return;const lr=x.get(E.current);if(!lr)return;const Cr=Ut.nativeEvent,Gr=new qn({active:E.current,activeNode:lr,event:Cr,options:Pn,context:Me,onStart(Er){const Kn=E.current;if(Kn==null)return;const Ms=x.get(Kn);if(!Ms)return;const{onDragStart:Ca}=D.current,Ea={active:{id:Kn,data:Ms.data,rect:L}};gi.unstable_batchedUpdates(()=>{Ca==null||Ca(Ea),S(Ua.Initializing),v({type:wn.DragStart,initialCoordinates:Er,active:Kn}),y({type:"onDragStart",event:Ea})})},onMove(Er){v({type:wn.DragMove,coordinates:Er})},onEnd:Ho(wn.DragEnd),onCancel:Ho(wn.DragCancel)});gi.unstable_batchedUpdates(()=>{O(Gr),$(Ut.nativeEvent)});function Ho(Er){return async function(){const{active:Ms,collisions:Ca,over:Ea,scrollAdjustedTranslate:wu}=Me.current;let Rs=null;if(Ms&&wu){const{cancelDrop:Tr}=D.current;Rs={activatorEvent:Cr,active:Ms,collisions:Ca,delta:wu,over:Ea},Er===wn.DragEnd&&typeof Tr=="function"&&await Promise.resolve(Tr(Rs))&&(Er=wn.DragCancel)}E.current=null,gi.unstable_batchedUpdates(()=>{v({type:Er}),S(Ua.Uninitialized),oi(null),O(null),$(null);const Tr=Er===wn.DragEnd?"onDragEnd":"onDragCancel";if(Rs){const Wl=D.current[Tr];Wl==null||Wl(Rs),y({type:Tr,event:Rs})}})}}},[x]),hn=I.useCallback((Ut,_t)=>(qn,Pn)=>{const lr=qn.nativeEvent,Cr=x.get(Pn);if(E.current!==null||!Cr||lr.dndKit||lr.defaultPrevented)return;const Gr={active:Cr};Ut(qn,_t.options,Gr)===!0&&(lr.dndKit={capturedBy:_t.sensor},E.current=Pn,Ur(qn,_t))},[x,Ur]),si=nBe(u,hn);uBe(u),Cs(()=>{oe&&b===Ua.Initializing&&S(Ua.Initialized)},[oe,b]),I.useEffect(()=>{const{onDragMove:Ut}=D.current,{active:_t,activatorEvent:qn,collisions:Pn,over:lr}=Me.current;if(!_t||!qn)return;const Cr={active:_t,activatorEvent:qn,collisions:Pn,delta:{x:ar.x,y:ar.y},over:lr};gi.unstable_batchedUpdates(()=>{Ut==null||Ut(Cr),y({type:"onDragMove",event:Cr})})},[ar.x,ar.y]),I.useEffect(()=>{const{active:Ut,activatorEvent:_t,collisions:qn,droppableContainers:Pn,scrollAdjustedTranslate:lr}=Me.current;if(!Ut||E.current==null||!_t||!lr)return;const{onDragOver:Cr}=D.current,Gr=Pn.get(Yt),Ho=Gr&&Gr.rect.current?{id:Gr.id,rect:Gr.rect.current,data:Gr.data,disabled:Gr.disabled}:null,Er={active:Ut,activatorEvent:_t,collisions:qn,delta:{x:lr.x,y:lr.y},over:Ho};gi.unstable_batchedUpdates(()=>{oi(Ho),Cr==null||Cr(Er),y({type:"onDragOver",event:Er})})},[Yt]),Cs(()=>{Me.current={activatorEvent:F,active:M,activeNode:ee,collisionRect:Wn,collisions:wr,droppableRects:H,draggableNodes:x,draggingNode:we,draggingNodeRect:pt,droppableContainers:A,over:It,scrollableAncestors:sn,scrollAdjustedTranslate:ar},L.current={initial:pt,translated:Wn}},[M,ee,wr,Wn,x,we,pt,H,A,It,sn,ar]),ZLe({...q,delta:k,draggingRect:Wn,pointerCoordinates:fn,scrollableAncestors:sn,scrollableAncestorRects:jr});const Gl=I.useMemo(()=>({active:M,activeNode:ee,activeNodeRect:oe,activatorEvent:F,collisions:wr,containerNodeRect:be,dragOverlay:Le,draggableNodes:x,droppableContainers:A,droppableRects:H,over:It,measureDroppableContainers:X,scrollableAncestors:sn,scrollableAncestorRects:jr,measuringConfiguration:V,measuringScheduled:te,windowRect:ii}),[M,ee,oe,F,wr,be,Le,x,A,H,It,X,sn,jr,V,te,ii]),Go=I.useMemo(()=>({activatorEvent:F,activators:si,active:M,activeNodeRect:oe,ariaDescribedById:{draggable:N},dispatch:v,draggableNodes:x,over:It,measureDroppableContainers:X}),[F,si,M,oe,v,N,x,It,X]);return Q.createElement(iW.Provider,{value:g},Q.createElement(c0.Provider,{value:Go},Q.createElement(xW.Provider,{value:Gl},Q.createElement(z2.Provider,{value:ho},c)),Q.createElement(bBe,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Q.createElement(SLe,{...a,hiddenTextDescribedById:N}));function Hl(){const Ut=(P==null?void 0:P.autoScrollEnabled)===!1,_t=typeof l=="object"?l.enabled===!1:l===!1,qn=w&&!Ut&&!_t;return typeof l=="object"?{...l,enabled:qn}:{enabled:qn}}}),wBe=I.createContext(null),SO="button",CBe="Droppable";function sqe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=L2(CBe),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=I.useContext(c0),{role:h=SO,roleDescription:p="draggable",tabIndex:m=0}=i??{},_=(l==null?void 0:l.id)===t,v=I.useContext(_?z2:wBe),[y,g]=bb(),[b,S]=bb(),w=dBe(s,t),C=qg(n);Cs(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:b,data:C}),()=>{const k=d.get(t);k&&k.key===o&&d.delete(t)}),[d,t]);const x=I.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":_&&h===SO?!0:void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[r,h,m,_,p,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:x,isDragging:_,listeners:r?void 0:w,node:y,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:v}}function EBe(){return I.useContext(xW)}const TBe="Droppable",ABe={timeout:25};function aqe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=L2(TBe),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=I.useContext(c0),u=I.useRef({disabled:n}),d=I.useRef(!1),f=I.useRef(null),h=I.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:_}={...ABe,...i},v=qg(m??r),y=I.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},_)},[_]),g=B2({callback:y,disabled:p||!s}),b=I.useCallback((x,k)=>{g&&(k&&(g.unobserve(k),d.current=!1),x&&g.observe(x))},[g]),[S,w]=bb(b),C=qg(t);return I.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),Cs(()=>(a({type:wn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:C}}),()=>a({type:wn.UnregisterDroppable,key:o,id:r})),[r]),I.useEffect(()=>{n!==u.current.disabled&&(a({type:wn.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function kBe(e){let{animation:t,children:n}=e;const[r,i]=I.useState(null),[o,s]=I.useState(null),a=_b(n);return!n&&!r&&a&&i(a),Cs(()=>{if(!o)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){i(null);return}Promise.resolve(t(c,o)).then(()=>{i(null)})},[t,r,o]),Q.createElement(Q.Fragment,null,n,r?I.cloneElement(r,{ref:s}):null)}const PBe={x:0,y:0,scaleX:1,scaleY:1};function IBe(e){let{children:t}=e;return Q.createElement(c0.Provider,{value:SW},Q.createElement(z2.Provider,{value:PBe},t))}const MBe={position:"fixed",touchAction:"none"},RBe=e=>sk(e)?"transform 250ms ease":void 0,OBe=I.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:s,rect:a,style:l,transform:c,transition:u=RBe}=e;if(!a)return null;const d=i?c:{...c,scaleX:1,scaleY:1},f={...MBe,width:a.width,height:a.height,top:a.top,left:a.left,transform:Xg.Transform.toString(d),transformOrigin:i&&r?CLe(r,a):void 0,transition:typeof u=="function"?u(r):u,...l};return Q.createElement(n,{className:s,style:f,ref:t},o)}),$Be=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:s}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(i))n.node.style.setProperty(l,c);s!=null&&s.active&&n.node.classList.remove(s.active)}},NBe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Xg.Transform.toString(t)},{transform:Xg.Transform.toString(n)}]},FBe={duration:250,easing:"ease",keyframes:NBe,sideEffects:$Be({styles:{active:{opacity:"0"}}})};function DBe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return D2((o,s)=>{if(t===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=_W(s);if(!c)return;const{transform:u}=zr(s).getComputedStyle(s),d=sW(u);if(!d)return;const f=typeof t=="function"?t:LBe(t);return hW(l,i.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:s,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function LBe(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...FBe,...e};return o=>{let{active:s,dragOverlay:a,transform:l,...c}=o;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},d={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-u.x,y:l.y-u.y,...d},h=i({...c,active:s,dragOverlay:a,transform:{initial:l,final:f}}),[p]=h,m=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const _=r==null?void 0:r({active:s,dragOverlay:a,...c}),v=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{v.onfinish=()=>{_==null||_(),y()}})}}let xO=0;function BBe(e){return I.useMemo(()=>{if(e!=null)return xO++,xO},[e])}const zBe=Q.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:m,dragOverlay:_,over:v,measuringConfiguration:y,scrollableAncestors:g,scrollableAncestorRects:b,windowRect:S}=EBe(),w=I.useContext(z2),C=BBe(d==null?void 0:d.id),x=wW(s,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:_.rect,over:v,overlayNodeRect:_.rect,scrollableAncestors:g,scrollableAncestorRects:b,transform:w,windowRect:S}),k=uk(f),A=DBe({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:y}),R=k?_.setRef:void 0;return Q.createElement(IBe,null,Q.createElement(kBe,{animation:A},d&&C?Q.createElement(OBe,{key:C,id:d.id,ref:R,as:a,activatorEvent:u,adjustScale:t,className:l,transition:o,rect:k,style:{zIndex:c,...i},transform:x},n):null))}),jBe=hu([tW,JA],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),VBe=()=>{const e=nN(jBe);return I.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=Kg(n);if(!o)return i;const s=o.x-r.left,a=o.y-r.top,l=i.x+s-r.width/2,c=i.y+a-r.height/2,u=i.scaleX*e,d=i.scaleY*e;return{x:l,y:c,scaleX:u,scaleY:d}}return i},[e])},UBe=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 RLe({...e,droppableContainers:n})};function GBe(e){return ie.jsx(xBe,{...e})}const Oy=28,wO={w:Oy,h:Oy,maxW:Oy,maxH:Oy,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},HBe=e=>{const{t}=qH();if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:n,fieldTemplate:r}=e.dragData.payload;return ie.jsx(nb,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:ie.jsx(LG,{children:n.label||r.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:n,width:r,height:i}=e.dragData.payload.imageDTO;return ie.jsx(nb,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:ie.jsx(OA,{sx:{...wO},objectFit:"contain",src:n,width:r,height:i})})}return e.dragData.payloadType==="IMAGE_DTOS"?ie.jsxs($A,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...wO},children:[ie.jsx(W3,{children:e.dragData.payload.imageDTOs.length}),ie.jsx(W3,{size:"sm",children:t("parameters.images")})]}):null},WBe=I.memo(HBe),qBe=e=>{const[t,n]=I.useState(null),r=ue("images"),i=tN(),o=I.useCallback(d=>{r.trace({dragData:tt(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),s=I.useCallback(d=>{var h;r.trace({dragData:tt(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(UH({overData:f,activeData:t})),n(null))},[t,i,r]),a=fO(yW,{activationConstraint:{distance:10}}),l=fO(vW,{activationConstraint:{distance:10}}),c=xLe(a,l),u=VBe();return ie.jsxs(GBe,{onDragStart:o,onDragEnd:s,sensors:c,collisionDetection:UBe,autoScroll:!1,children:[e.children,ie.jsx(zBe,{dropAnimation:null,modifiers:[u],style:{width:"min-content",height:"min-content",cursor:"grabbing",userSelect:"none",padding:"10rem"},children:ie.jsx(PG,{children:t&&ie.jsx(AG.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:ie.jsx(WBe,{dragData:t})},"overlay-drag-image")})})]})},KBe=I.memo(qBe);function pE(e){"@babel/helpers - typeof";return pE=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},pE(e)}var CW=[],XBe=CW.forEach,QBe=CW.slice;function gE(e){return XBe.call(QBe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function EW(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":pE(XMLHttpRequest))==="object"}function YBe(e){return!!e&&typeof e.then=="function"}function ZBe(e){return YBe(e)?e:Promise.resolve(e)}function JBe(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 mE={exports:{}},$y={exports:{}},CO;function eze(){return CO||(CO=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(s){var a=typeof o<"u"&&o||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(P){return P&&DataView.prototype.isPrototypeOf(P)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(P){return P&&u.indexOf(Object.prototype.toString.call(P))>-1};function f(P){if(typeof P!="string"&&(P=String(P)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(P)||P==="")throw new TypeError('Invalid character in header field name: "'+P+'"');return P.toLowerCase()}function h(P){return typeof P!="string"&&(P=String(P)),P}function p(P){var O={next:function(){var F=P.shift();return{done:F===void 0,value:F}}};return l.iterable&&(O[Symbol.iterator]=function(){return O}),O}function m(P){this.map={},P instanceof m?P.forEach(function(O,F){this.append(F,O)},this):Array.isArray(P)?P.forEach(function(O){this.append(O[0],O[1])},this):P&&Object.getOwnPropertyNames(P).forEach(function(O){this.append(O,P[O])},this)}m.prototype.append=function(P,O){P=f(P),O=h(O);var F=this.map[P];this.map[P]=F?F+", "+O:O},m.prototype.delete=function(P){delete this.map[f(P)]},m.prototype.get=function(P){return P=f(P),this.has(P)?this.map[P]:null},m.prototype.has=function(P){return this.map.hasOwnProperty(f(P))},m.prototype.set=function(P,O){this.map[f(P)]=h(O)},m.prototype.forEach=function(P,O){for(var F in this.map)this.map.hasOwnProperty(F)&&P.call(O,this.map[F],F,this)},m.prototype.keys=function(){var P=[];return this.forEach(function(O,F){P.push(F)}),p(P)},m.prototype.values=function(){var P=[];return this.forEach(function(O){P.push(O)}),p(P)},m.prototype.entries=function(){var P=[];return this.forEach(function(O,F){P.push([F,O])}),p(P)},l.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function _(P){if(P.bodyUsed)return Promise.reject(new TypeError("Already read"));P.bodyUsed=!0}function v(P){return new Promise(function(O,F){P.onload=function(){O(P.result)},P.onerror=function(){F(P.error)}})}function y(P){var O=new FileReader,F=v(O);return O.readAsArrayBuffer(P),F}function g(P){var O=new FileReader,F=v(O);return O.readAsText(P),F}function b(P){for(var O=new Uint8Array(P),F=new Array(O.length),$=0;$<O.length;$++)F[$]=String.fromCharCode(O[$]);return F.join("")}function S(P){if(P.slice)return P.slice(0);var O=new Uint8Array(P.byteLength);return O.set(new Uint8Array(P)),O.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(P){this.bodyUsed=this.bodyUsed,this._bodyInit=P,P?typeof P=="string"?this._bodyText=P:l.blob&&Blob.prototype.isPrototypeOf(P)?this._bodyBlob=P:l.formData&&FormData.prototype.isPrototypeOf(P)?this._bodyFormData=P:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(P)?this._bodyText=P.toString():l.arrayBuffer&&l.blob&&c(P)?(this._bodyArrayBuffer=S(P.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(P)||d(P))?this._bodyArrayBuffer=S(P):this._bodyText=P=Object.prototype.toString.call(P):this._bodyText="",this.headers.get("content-type")||(typeof P=="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(P)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var P=_(this);if(P)return P;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 P=_(this);return P||(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 P=_(this);if(P)return P;if(this._bodyBlob)return g(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(b(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(A)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(P){var O=P.toUpperCase();return C.indexOf(O)>-1?O:P}function k(P,O){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var F=O.body;if(P instanceof k){if(P.bodyUsed)throw new TypeError("Already read");this.url=P.url,this.credentials=P.credentials,O.headers||(this.headers=new m(P.headers)),this.method=P.method,this.mode=P.mode,this.signal=P.signal,!F&&P._bodyInit!=null&&(F=P._bodyInit,P.bodyUsed=!0)}else this.url=String(P);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new m(O.headers)),this.method=x(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&F)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(F),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var $=/([?&])_=[^&]*/;if($.test(this.url))this.url=this.url.replace($,"$1_="+new Date().getTime());else{var D=/\?/;this.url+=(D.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function A(P){var O=new FormData;return P.trim().split("&").forEach(function(F){if(F){var $=F.split("="),D=$.shift().replace(/\+/g," "),N=$.join("=").replace(/\+/g," ");O.append(decodeURIComponent(D),decodeURIComponent(N))}}),O}function R(P){var O=new m,F=P.replace(/\r?\n[\t ]+/g," ");return F.split("\r").map(function($){return $.indexOf(`
`)===0?$.substr(1,$.length):$}).forEach(function($){var D=$.split(":"),N=D.shift().trim();if(N){var z=D.join(":").trim();O.append(N,z)}}),O}w.call(k.prototype);function L(P,O){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O||(O={}),this.type="default",this.status=O.status===void 0?200:O.status,this.ok=this.status>=200&&this.status<300,this.statusText=O.statusText===void 0?"":""+O.statusText,this.headers=new m(O.headers),this.url=O.url||"",this._initBody(P)}w.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},L.error=function(){var P=new L(null,{status:0,statusText:""});return P.type="error",P};var M=[301,302,303,307,308];L.redirect=function(P,O){if(M.indexOf(O)===-1)throw new RangeError("Invalid status code");return new L(null,{status:O,headers:{location:P}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(O,F){this.message=O,this.name=F;var $=Error(O);this.stack=$.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function E(P,O){return new Promise(function(F,$){var D=new k(P,O);if(D.signal&&D.signal.aborted)return $(new s.DOMException("Aborted","AbortError"));var N=new XMLHttpRequest;function z(){N.abort()}N.onload=function(){var H={status:N.status,statusText:N.statusText,headers:R(N.getAllResponseHeaders()||"")};H.url="responseURL"in N?N.responseURL:H.headers.get("X-Request-URL");var X="response"in N?N.response:N.responseText;setTimeout(function(){F(new L(X,H))},0)},N.onerror=function(){setTimeout(function(){$(new TypeError("Network request failed"))},0)},N.ontimeout=function(){setTimeout(function(){$(new TypeError("Network request failed"))},0)},N.onabort=function(){setTimeout(function(){$(new s.DOMException("Aborted","AbortError"))},0)};function V(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}N.open(D.method,V(D.url),!0),D.credentials==="include"?N.withCredentials=!0:D.credentials==="omit"&&(N.withCredentials=!1),"responseType"in N&&(l.blob?N.responseType="blob":l.arrayBuffer&&D.headers.get("Content-Type")&&D.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(N.responseType="arraybuffer")),O&&typeof O.headers=="object"&&!(O.headers instanceof m)?Object.getOwnPropertyNames(O.headers).forEach(function(H){N.setRequestHeader(H,h(O.headers[H]))}):D.headers.forEach(function(H,X){N.setRequestHeader(X,H)}),D.signal&&(D.signal.addEventListener("abort",z),N.onreadystatechange=function(){N.readyState===4&&D.signal.removeEventListener("abort",z)}),N.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return E.polyfill=!0,a.fetch||(a.fetch=E,a.Headers=m,a.Request=k,a.Response=L),s.Headers=m,s.Request=k,s.Response=L,s.fetch=E,s})({})})(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}($y,$y.exports)),$y.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 JBe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||eze();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(mE,mE.exports);var TW=mE.exports;const AW=Ml(TW),EO=MO({__proto__:null,default:AW},[TW]);function Cb(e){"@babel/helpers - typeof";return Cb=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},Cb(e)}var oa;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?oa=global.fetch:typeof window<"u"&&window.fetch?oa=window.fetch:oa=fetch);var Yg;EW()&&(typeof global<"u"&&global.XMLHttpRequest?Yg=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Yg=window.XMLHttpRequest));var Eb;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Eb=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Eb=window.ActiveXObject));!oa&&EO&&!Yg&&!Eb&&(oa=AW||EO);typeof oa!="function"&&(oa=void 0);var yE=function(t,n){if(n&&Cb(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},TO=function(t,n,r){var i=function(s){if(!s.ok)return r(s.statusText||"Error",{status:s.status});s.text().then(function(a){r(null,{status:s.status,data:a})}).catch(r)};typeof fetch=="function"?fetch(t,n).then(i).catch(r):oa(t,n).then(i).catch(r)},AO=!1,tze=function(t,n,r,i){t.queryStringParams&&(n=yE(n,t.queryStringParams));var o=gE({},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 s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=gE({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},AO?{}:s);try{TO(n,a,i)}catch(l){if(!s||Object.keys(s).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(s).forEach(function(c){delete a[c]}),TO(n,a,i),AO=!0}catch(c){i(c)}}},nze=function(t,n,r,i){r&&Cb(r)==="object"&&(r=yE("",r).slice(1)),t.queryStringParams&&(n=yE(n,t.queryStringParams));try{var o;Yg?o=new Yg:o=new Eb("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},rze=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},oa&&n.indexOf("file:")!==0)return tze(t,n,r,i);if(EW()||typeof ActiveXObject=="function")return nze(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Zg(e){"@babel/helpers - typeof";return Zg=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},Zg(e)}function ize(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kO(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,kW(r.key),r)}}function oze(e,t,n){return t&&kO(e.prototype,t),n&&kO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sze(e,t,n){return t=kW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kW(e){var t=aze(e,"string");return Zg(t)==="symbol"?t:String(t)}function aze(e,t){if(Zg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lze=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 sze({},r,i||"")},parseLoadPayload:function(n,r){},request:rze,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},PW=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]:{};ize(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return oze(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=gE(i,this.options||{},lze()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=ZBe(l),l.then(function(c){if(!c)return s(null,{});var u=a.services.interpolator.interpolate(c,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(u,s,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(a,l);this.options.request(this.options,n,c,function(u,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&&u&&u.message&&u.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+u.message,!0);if(u)return r(u,!1);var f,h;try{typeof d.data=="string"?f=s.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,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(f){var h=a.options.addPath;typeof a.options.addPath=="function"&&(h=a.options.addPath(f,r));var p=a.services.interpolator.interpolate(h,{lng:f,ns:r});a.options.request(a.options,p,l,function(m,_){c+=1,u.push(m),d.push(_),c===n.length&&typeof s=="function"&&s(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],c=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(f,h){f&&s.warn("loading namespace ".concat(d," for language ").concat(u," failed"),f),!f&&h&&s.log("loaded namespace ".concat(d," for language ").concat(u),h),i.loaded("".concat(u,"|").concat(d),f,h)})})})}}}]),e}();PW.type="backend";Oe.use(PW).use(UNe).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const cze=I.lazy(()=>H$(()=>import("./App-fe9505fe.js"),["./App-fe9505fe.js","./MantineProvider-44862fff.js","./App-6125620a.css"],import.meta.url)),uze=I.lazy(()=>H$(()=>import("./ThemeLocaleProvider-687f0135.js"),["./ThemeLocaleProvider-687f0135.js","./MantineProvider-44862fff.js","./ThemeLocaleProvider-0667edb8.css"],import.meta.url)),dze=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:s,selectedImage:a,customStarUi:l,socketOptions:c,isDebugging:u=!1})=>{I.useEffect(()=>(t&&Qv.set(t),e&&Yv.set(e),o&&F5.set(o),s&&In.set(s),Xj(),i&&i.length>0&&Kj(...i),()=>{Yv.set(void 0),Qv.set(void 0),F5.set(void 0),In.set(rN)}),[e,t,i,o,s]),I.useEffect(()=>(l&&Y6.set(l),()=>{Y6.set(void 0)}),[l]),I.useEffect(()=>(r&&Z6.set(r),()=>{Z6.set(void 0)}),[r]),I.useEffect(()=>(c&&g1.set(c),()=>{g1.set({})}),[c]),I.useEffect(()=>(u&&Zv.set(u),()=>{Zv.set(!1)}),[u]);const d=I.useMemo(()=>oLe(o),[o]);return I.useEffect(()=>{MD.set(d)},[d]),ie.jsx(Q.StrictMode,{children:ie.jsx(nQ,{store:d,children:ie.jsx(Q.Suspense,{fallback:ie.jsx(lLe,{}),children:ie.jsx(uze,{children:ie.jsx(KBe,{children:ie.jsx(cze,{config:n,selectedImage:a})})})})})})},fze=I.memo(dze);mC.createRoot(document.getElementById("root")).render(ie.jsx(fze,{}));export{FSe as $,nHe as A,OT as B,Mi as C,ie as D,WSe as E,PWe as F,O6e as G,Hm as H,e0 as I,or as J,Dl as K,eTe as L,SWe as M,vWe as N,PG as O,oye as P,AG as Q,Q as R,ig as S,R4e as T,Wm as U,IA as V,Km as W,bWe as X,_We as Y,j1 as Z,n9 as _,MN as a,WUe as a$,xWe as a0,us as a1,Ml as a2,z1 as a3,rU as a4,EWe as a5,D4e as a6,ys as a7,_V as a8,CS as a9,YT as aA,hV as aB,CSe as aC,gi as aD,Ev as aE,ES as aF,XHe as aG,kUe as aH,qUe as aI,KUe as aJ,CUe as aK,xUe as aL,LG as aM,Gu as aN,G8e as aO,HG as aP,gze as aQ,EUe as aR,fT as aS,ek as aT,uWe as aU,OA as aV,sLe as aW,cWe as aX,uO as aY,Oe as aZ,FUe as a_,rPe as aa,FG as ab,wWe as ac,Ae as ad,yWe as ae,CWe as af,hu as ag,tW as ah,nN as ai,NUe as aj,Sm as ak,AL as al,eB as am,B_ as an,ue as ao,tN as ap,yze as aq,Ve as ar,pi as as,qH as at,nb as au,$A as av,W3 as aw,JA as ax,HUe as ay,pSe as az,e_ as b,Kle as b$,hVe as b0,hae as b1,dT as b2,Dze as b3,iWe as b4,bze as b5,dWe as b6,vze as b7,Sze as b8,Zoe as b9,el as bA,B0 as bB,sGe as bC,iGe as bD,oGe as bE,VH as bF,ce as bG,Qe as bH,K0 as bI,Ot as bJ,$X as bK,ps as bL,LUe as bM,pze as bN,Ox as bO,Y6 as bP,tGe as bQ,nGe as bR,wUe as bS,hue as bT,Qv as bU,rMe as bV,he as bW,Lze as bX,Bze as bY,zze as bZ,jze as b_,Joe as ba,tWe as bb,rWe as bc,_ze as bd,sWe as be,xze as bf,mze as bg,$Ue as bh,IWe as bi,OUe as bj,Sc as bk,eGe as bl,JUe as bm,MUe as bn,lGe as bo,aqe as bp,sqe as bq,ul as br,J as bs,rGe as bt,aGe as bu,PUe as bv,IUe as bw,BUe as bx,vp as by,RUe as bz,eJ as c,mWe as c$,yje as c0,BHe as c1,zHe as c2,Wze as c3,Cje as c4,Uze as c5,dje as c6,Gze as c7,fje as c8,Xze as c9,Jse as cA,cae as cB,zWe as cC,eO as cD,eae as cE,BWe as cF,eje as cG,JR as cH,tae as cI,T$e as cJ,Qze as cK,V8 as cL,UHe as cM,GHe as cN,HHe as cO,oje as cP,WHe as cQ,sje as cR,qHe as cS,aje as cT,KHe as cU,fGe as cV,VUe as cW,nhe as cX,zUe as cY,Gj as cZ,wL as c_,A$e as ca,Hze as cb,vje as cc,Yze as cd,nL as ce,Vze as cf,Pje as cg,qze as ch,oI as ci,Kze as cj,sI as ck,nje as cl,pje as cm,ije as cn,zje as co,jje as cp,rje as cq,Vje as cr,jWe as cs,Zze as ct,YR as cu,hGe as cv,LWe as cw,Jze as cx,ZR as cy,hc as cz,Bie as d,rbe as d$,DUe as d0,_g as d1,iB as d2,Q5 as d3,Id as d4,uu as d5,gje as d6,yVe as d7,uVe as d8,nVe as d9,hHe as dA,vGe as dB,eHe as dC,JGe as dD,N4 as dE,J1e as dF,mGe as dG,W1e as dH,q1e as dI,K1e as dJ,Lle as dK,X1e as dL,$ze as dM,Q1e as dN,Ble as dO,Y1e as dP,Um as dQ,Dle as dR,ebe as dS,g_ as dT,ZWe as dU,DWe as dV,rqe as dW,FWe as dX,tbe as dY,nbe as dZ,iqe as d_,rVe as da,lVe as db,Sn as dc,$T as dd,Fo as de,As as df,hi as dg,aVe as dh,lje as di,YA as dj,cVe as dk,lWe as dl,jF as dm,dbe as dn,tHe as dp,ube as dq,tk as dr,kHe as ds,MHe as dt,$He as du,OHe as dv,PHe as dw,IHe as dx,RHe as dy,c$e as dz,RF as e,CI as e$,nqe as e0,ibe as e1,obe as e2,zle as e3,Z1e as e4,JD as e5,UWe as e6,sbe as e7,EGe as e8,TGe as e9,Che as eA,$Ge as eB,DGe as eC,LGe as eD,YGe as eE,ZGe as eF,AHe as eG,mue as eH,yue as eI,TUe as eJ,uGe as eK,dGe as eL,sB as eM,cGe as eN,c_ as eO,Uje as eP,Dje as eQ,Lje as eR,Bje as eS,yae as eT,li as eU,tI as eV,Pze as eW,YUe as eX,XUe as eY,QUe as eZ,Nl as e_,AGe as ea,kGe as eb,SGe as ec,xGe as ed,wGe as ee,CGe as ef,PGe as eg,IGe as eh,vT as ei,MGe as ej,RGe as ek,OGe as el,NGe as em,FGe as en,BGe as eo,zGe as ep,jGe as eq,VGe as er,UGe as es,GGe as et,HGe as eu,WGe as ev,qGe as ew,KGe as ex,XGe as ey,QGe as ez,DN as f,WWe as f$,dae as f0,nI as f1,eMe as f2,J8e as f3,Ize as f4,Mze as f5,h_ as f6,Rze as f7,fae as f8,Oze as f9,Sje as fA,xje as fB,wje as fC,bje as fD,_je as fE,qle as fF,Rje as fG,Mje as fH,NVe as fI,Zje as fJ,vUe as fK,FVe as fL,Nje as fM,$je as fN,Fje as fO,oT as fP,dVe as fQ,LHe as fR,oqe as fS,QNe as fT,ZHe as fU,tje as fV,jUe as fW,NWe as fX,eqe as fY,qWe as fZ,gGe as f_,kze as fa,Aze as fb,Q4 as fc,lae as fd,iae as fe,oae as ff,nae as fg,rae as fh,sae as fi,aae as fj,Eze as fk,VWe as fl,jHe as fm,ZD as fn,xbe as fo,PNe as fp,Hje as fq,Xle as fr,Gje as fs,Or as ft,hje as fu,Tje as fv,vae as fw,mp as fx,kje as fy,VHe as fz,WN as g,Rj as g$,tqe as g0,JWe as g1,pGe as g2,XWe as g3,KWe as g4,GWe as g5,YWe as g6,Fze as g7,HWe as g8,QWe as g9,rFe as gA,bbe as gB,bGe as gC,pbe as gD,fbe as gE,U1e as gF,uHe as gG,j1e as gH,z1e as gI,G1e as gJ,Oj as gK,vHe as gL,yHe as gM,THe as gN,ZNe as gO,V1e as gP,dHe as gQ,mbe as gR,bHe as gS,mHe as gT,gbe as gU,Gve as gV,gHe as gW,wHe as gX,rhe as gY,Lo as gZ,Ir as g_,Nze as ga,cB as gb,aj as gc,yGe as gd,aFe as ge,abe as gf,aHe as gg,lHe as gh,B1e as gi,L8 as gj,_Ge as gk,zz as gl,Vm as gm,rHe as gn,gc as go,pHe as gp,aWe as gq,ihe as gr,Y$ as gs,eNe as gt,lbe as gu,hbe as gv,iHe as gw,cbe as gx,D1 as gy,Te as gz,a_ as h,WVe as h$,NHe as h0,DHe as h1,kg as h2,Cl as h3,EHe as h4,SHe as h5,CHe as h6,xHe as h7,_He as h8,_j as h9,AVe as hA,Kje as hB,qje as hC,Wje as hD,hUe as hE,KG as hF,kq as hG,Ue as hH,Ooe as hI,fp as hJ,p1 as hK,rL as hL,Jle as hM,Jje as hN,eVe as hO,tVe as hP,uUe as hQ,PVe as hR,kVe as hS,rue as hT,cUe as hU,Z8e as hV,iue as hW,QA as hX,b7e as hY,OVe as hZ,KVe as h_,gWe as ha,fWe as hb,hWe as hc,pWe as hd,vVe as he,sVe as hf,pVe as hg,mVe as hh,pc as hi,qVe as hj,fUe as hk,dUe as hl,MVe as hm,nUe as hn,pUe as ho,tMe as hp,CVe as hq,VVe as hr,Ih as hs,BVe as ht,EVe as hu,LS as hv,jVe as hw,SVe as hx,zVe as hy,xVe as hz,Oie as i,UVe as i0,Xje as i1,Qje as i2,SUe as i3,RWe as i4,MWe as i5,XVe as i6,K8e as i7,tUe as i8,QVe as i9,wze as iA,qse as iB,L_e as iC,Z6 as iD,vV as iE,JT as iF,ds as iG,S4e as iH,X4e as iI,TWe as iJ,zSe as iK,kWe as iL,$6e as iM,j8e as iN,V8e as iO,$Se as iP,IVe as ia,wVe as ib,lUe as ic,aUe as id,JVe as ie,YVe as ig,ZVe as ih,bUe as ii,oUe as ij,_Ue as ik,_Ve as il,bVe as im,LVe as io,DVe as ip,yUe as iq,Y8e as ir,q8e as is,X8e as it,Q8e as iu,Yje as iv,RVe as iw,$We as ix,QHe as iy,YHe as iz,bn as j,hne as k,s_ as l,Mf as m,Qc as n,EF as o,ioe as p,no as q,I as r,Dd as s,Gn as t,rn as u,xo as v,ti as w,dl as x,Jo as y,nye as z};