InvokeAI/invokeai/frontend/web/dist/assets/index-cd3a0781.js
2023-09-15 13:15:25 -04:00

129 lines
1.3 MiB
Raw Blame History

This file contains ambiguous Unicode characters

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 OV=Object.defineProperty;var IV=(e,t,n)=>t in e?OV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ZS=(e,t,n)=>(IV(e,typeof t!="symbol"?t+"":t,n),n);function II(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 ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Q1(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var MI={exports:{}},Y1={},NI={exports:{}},It={};/**
* @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 im=Symbol.for("react.element"),MV=Symbol.for("react.portal"),NV=Symbol.for("react.fragment"),DV=Symbol.for("react.strict_mode"),LV=Symbol.for("react.profiler"),$V=Symbol.for("react.provider"),FV=Symbol.for("react.context"),BV=Symbol.for("react.forward_ref"),zV=Symbol.for("react.suspense"),UV=Symbol.for("react.memo"),jV=Symbol.for("react.lazy"),M4=Symbol.iterator;function VV(e){return e===null||typeof e!="object"?null:(e=M4&&e[M4]||e["@@iterator"],typeof e=="function"?e:null)}var DI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LI=Object.assign,$I={};function Zf(e,t,n){this.props=e,this.context=t,this.refs=$I,this.updater=n||DI}Zf.prototype.isReactComponent={};Zf.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")};Zf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function FI(){}FI.prototype=Zf.prototype;function Q3(e,t,n){this.props=e,this.context=t,this.refs=$I,this.updater=n||DI}var Y3=Q3.prototype=new FI;Y3.constructor=Q3;LI(Y3,Zf.prototype);Y3.isPureReactComponent=!0;var N4=Array.isArray,BI=Object.prototype.hasOwnProperty,Z3={current:null},zI={key:!0,ref:!0,__self:!0,__source:!0};function UI(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)BI.call(t,r)&&!zI.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:im,type:e,key:o,ref:s,props:i,_owner:Z3.current}}function GV(e,t){return{$$typeof:im,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function J3(e){return typeof e=="object"&&e!==null&&e.$$typeof===im}function HV(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var D4=/\/+/g;function JS(e,t){return typeof e=="object"&&e!==null&&e.key!=null?HV(""+e.key):t.toString(36)}function p0(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 im:case MV:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+JS(s,0):r,N4(i)?(n="",e!=null&&(n=e.replace(D4,"$&/")+"/"),p0(i,t,n,"",function(u){return u})):i!=null&&(J3(i)&&(i=GV(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(D4,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",N4(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+JS(o,a);s+=p0(o,t,n,l,i)}else if(l=VV(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+JS(o,a++),s+=p0(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 Jm(e,t,n){if(e==null)return e;var r=[],i=0;return p0(e,r,"","",function(o){return t.call(n,o,i++)}),r}function qV(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 Qi={current:null},g0={transition:null},WV={ReactCurrentDispatcher:Qi,ReactCurrentBatchConfig:g0,ReactCurrentOwner:Z3};It.Children={map:Jm,forEach:function(e,t,n){Jm(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jm(e,function(){t++}),t},toArray:function(e){return Jm(e,function(t){return t})||[]},only:function(e){if(!J3(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};It.Component=Zf;It.Fragment=NV;It.Profiler=LV;It.PureComponent=Q3;It.StrictMode=DV;It.Suspense=zV;It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WV;It.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=LI({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=Z3.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)BI.call(t,l)&&!zI.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:im,type:e.type,key:i,ref:o,props:r,_owner:s}};It.createContext=function(e){return e={$$typeof:FV,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:$V,_context:e},e.Consumer=e};It.createElement=UI;It.createFactory=function(e){var t=UI.bind(null,e);return t.type=e,t};It.createRef=function(){return{current:null}};It.forwardRef=function(e){return{$$typeof:BV,render:e}};It.isValidElement=J3;It.lazy=function(e){return{$$typeof:jV,_payload:{_status:-1,_result:e},_init:qV}};It.memo=function(e,t){return{$$typeof:UV,type:e,compare:t===void 0?null:t}};It.startTransition=function(e){var t=g0.transition;g0.transition={};try{e()}finally{g0.transition=t}};It.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};It.useCallback=function(e,t){return Qi.current.useCallback(e,t)};It.useContext=function(e){return Qi.current.useContext(e)};It.useDebugValue=function(){};It.useDeferredValue=function(e){return Qi.current.useDeferredValue(e)};It.useEffect=function(e,t){return Qi.current.useEffect(e,t)};It.useId=function(){return Qi.current.useId()};It.useImperativeHandle=function(e,t,n){return Qi.current.useImperativeHandle(e,t,n)};It.useInsertionEffect=function(e,t){return Qi.current.useInsertionEffect(e,t)};It.useLayoutEffect=function(e,t){return Qi.current.useLayoutEffect(e,t)};It.useMemo=function(e,t){return Qi.current.useMemo(e,t)};It.useReducer=function(e,t,n){return Qi.current.useReducer(e,t,n)};It.useRef=function(e){return Qi.current.useRef(e)};It.useState=function(e){return Qi.current.useState(e)};It.useSyncExternalStore=function(e,t,n){return Qi.current.useSyncExternalStore(e,t,n)};It.useTransition=function(){return Qi.current.useTransition()};It.version="18.2.0";NI.exports=It;var M=NI.exports;const yn=Fc(M),L4=II({__proto__:null,default:yn},[M]);/**
* @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 KV=M,XV=Symbol.for("react.element"),QV=Symbol.for("react.fragment"),YV=Object.prototype.hasOwnProperty,ZV=KV.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,JV={key:!0,ref:!0,__self:!0,__source:!0};function jI(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)YV.call(t,r)&&!JV.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:XV,type:e,key:o,ref:s,props:i,_owner:ZV.current}}Y1.Fragment=QV;Y1.jsx=jI;Y1.jsxs=jI;MI.exports=Y1;var Z=MI.exports,nx={},VI={exports:{}},Lo={},GI={exports:{}},HI={};/**
* @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(R,O){var I=R.length;R.push(O);e:for(;0<I;){var F=I-1>>>1,U=R[F];if(0<i(U,O))R[F]=O,R[I]=U,I=F;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var O=R[0],I=R.pop();if(I!==O){R[0]=I;e:for(var F=0,U=R.length,V=U>>>1;F<V;){var H=2*(F+1)-1,Y=R[H],Q=H+1,j=R[Q];if(0>i(Y,I))Q<U&&0>i(j,Y)?(R[F]=j,R[Q]=I,F=Q):(R[F]=Y,R[H]=I,F=H);else if(Q<U&&0>i(j,I))R[F]=j,R[Q]=I,F=Q;else break e}}return O}function i(R,O){var I=R.sortIndex-O.sortIndex;return I!==0?I:R.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,_=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(R){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=R)r(u),O.sortIndex=O.expirationTime,t(l,O);else break;O=n(u)}}function v(R){if(m=!1,g(R),!p)if(n(l)!==null)p=!0,D(S);else{var O=n(u);O!==null&&B(v,O.startTime-R)}}function S(R,O){p=!1,m&&(m=!1,_(C),C=-1),h=!0;var I=f;try{for(g(O),d=n(l);d!==null&&(!(d.expirationTime>O)||R&&!k());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var U=F(d.expirationTime<=O);O=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),g(O)}else r(l);d=n(l)}if(d!==null)var V=!0;else{var H=n(u);H!==null&&B(v,H.startTime-O),V=!1}return V}finally{d=null,f=I,h=!1}}var w=!1,x=null,C=-1,A=5,T=-1;function k(){return!(e.unstable_now()-T<A)}function L(){if(x!==null){var R=e.unstable_now();T=R;var O=!0;try{O=x(!0,R)}finally{O?N():(w=!1,x=null)}}else w=!1}var N;if(typeof y=="function")N=function(){y(L)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,P=E.port2;E.port1.onmessage=L,N=function(){P.postMessage(null)}}else N=function(){b(L,0)};function D(R){x=R,w||(w=!0,N())}function B(R,O){C=b(function(){R(e.unstable_now())},O)}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(R){R.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,D(S))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(R){switch(f){case 1:case 2:case 3:var O=3;break;default:O=f}var I=f;f=O;try{return R()}finally{f=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,O){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var I=f;f=R;try{return O()}finally{f=I}},e.unstable_scheduleCallback=function(R,O,I){var F=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?F+I:F):I=F,R){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=I+U,R={id:c++,callback:O,priorityLevel:R,startTime:I,expirationTime:U,sortIndex:-1},I>F?(R.sortIndex=I,t(u,R),n(l)===null&&R===n(u)&&(m?(_(C),C=-1):m=!0,B(v,I-F))):(R.sortIndex=U,t(l,R),p||h||(p=!0,D(S))),R},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(R){var O=f;return function(){var I=f;f=O;try{return R.apply(this,arguments)}finally{f=I}}}})(HI);GI.exports=HI;var eG=GI.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 qI=M,Io=eG;function oe(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 WI=new Set,Mp={};function Bc(e,t){Sf(e,t),Sf(e+"Capture",t)}function Sf(e,t){for(Mp[e]=t,e=0;e<t.length;e++)WI.add(t[e])}var el=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rx=Object.prototype.hasOwnProperty,tG=/^[: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]*$/,$4={},F4={};function nG(e){return rx.call(F4,e)?!0:rx.call($4,e)?!1:tG.test(e)?F4[e]=!0:($4[e]=!0,!1)}function rG(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 iG(e,t,n,r){if(t===null||typeof t>"u"||rG(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 Yi(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 Si={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Si[e]=new Yi(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Si[t]=new Yi(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Si[e]=new Yi(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Si[e]=new Yi(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){Si[e]=new Yi(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Si[e]=new Yi(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Si[e]=new Yi(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Si[e]=new Yi(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Si[e]=new Yi(e,5,!1,e.toLowerCase(),null,!1,!1)});var e5=/[\-:]([a-z])/g;function t5(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(e5,t5);Si[t]=new Yi(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(e5,t5);Si[t]=new Yi(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(e5,t5);Si[t]=new Yi(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Si[e]=new Yi(e,1,!1,e.toLowerCase(),null,!1,!1)});Si.xlinkHref=new Yi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Si[e]=new Yi(e,1,!1,e.toLowerCase(),null,!0,!0)});function n5(e,t,n,r){var i=Si.hasOwnProperty(t)?Si[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iG(t,n,i,r)&&(n=null),r||i===null?nG(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 ul=qI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ey=Symbol.for("react.element"),Id=Symbol.for("react.portal"),Md=Symbol.for("react.fragment"),r5=Symbol.for("react.strict_mode"),ix=Symbol.for("react.profiler"),KI=Symbol.for("react.provider"),XI=Symbol.for("react.context"),i5=Symbol.for("react.forward_ref"),ox=Symbol.for("react.suspense"),sx=Symbol.for("react.suspense_list"),o5=Symbol.for("react.memo"),Al=Symbol.for("react.lazy"),QI=Symbol.for("react.offscreen"),B4=Symbol.iterator;function wh(e){return e===null||typeof e!="object"?null:(e=B4&&e[B4]||e["@@iterator"],typeof e=="function"?e:null)}var ir=Object.assign,e2;function Qh(e){if(e2===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);e2=t&&t[1]||""}return`
`+e2+e}var t2=!1;function n2(e,t){if(!e||t2)return"";t2=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),o=r.stack.split(`
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{t2=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qh(e):""}function oG(e){switch(e.tag){case 5:return Qh(e.type);case 16:return Qh("Lazy");case 13:return Qh("Suspense");case 19:return Qh("SuspenseList");case 0:case 2:case 15:return e=n2(e.type,!1),e;case 11:return e=n2(e.type.render,!1),e;case 1:return e=n2(e.type,!0),e;default:return""}}function ax(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 Md:return"Fragment";case Id:return"Portal";case ix:return"Profiler";case r5:return"StrictMode";case ox:return"Suspense";case sx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case XI:return(e.displayName||"Context")+".Consumer";case KI:return(e._context.displayName||"Context")+".Provider";case i5:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case o5:return t=e.displayName||null,t!==null?t:ax(e.type)||"Memo";case Al:t=e._payload,e=e._init;try{return ax(e(t))}catch{}}return null}function sG(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 ax(t);case 8:return t===r5?"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 au(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function YI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aG(e){var t=YI(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 ty(e){e._valueTracker||(e._valueTracker=aG(e))}function ZI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function J0(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 lx(e,t){var n=t.checked;return ir({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function z4(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=au(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 JI(e,t){t=t.checked,t!=null&&n5(e,"checked",t,!1)}function ux(e,t){JI(e,t);var n=au(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")?cx(e,t.type,n):t.hasOwnProperty("defaultValue")&&cx(e,t.type,au(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function U4(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 cx(e,t,n){(t!=="number"||J0(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yh=Array.isArray;function Qd(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=""+au(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 dx(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return ir({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function j4(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(oe(92));if(Yh(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:au(n)}}function e9(e,t){var n=au(t.value),r=au(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 V4(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function t9(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 fx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?t9(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ny,n9=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(ny=ny||document.createElement("div"),ny.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ny.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Np(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lp={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},lG=["Webkit","ms","Moz","O"];Object.keys(lp).forEach(function(e){lG.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lp[t]=lp[e]})});function r9(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lp.hasOwnProperty(e)&&lp[e]?(""+t).trim():t+"px"}function i9(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=r9(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var uG=ir({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 hx(e,t){if(t){if(uG[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function px(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 gx=null;function s5(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mx=null,Yd=null,Zd=null;function G4(e){if(e=am(e)){if(typeof mx!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=n_(t),mx(e.stateNode,e.type,t))}}function o9(e){Yd?Zd?Zd.push(e):Zd=[e]:Yd=e}function s9(){if(Yd){var e=Yd,t=Zd;if(Zd=Yd=null,G4(e),t)for(e=0;e<t.length;e++)G4(t[e])}}function a9(e,t){return e(t)}function l9(){}var r2=!1;function u9(e,t,n){if(r2)return e(t,n);r2=!0;try{return a9(e,t,n)}finally{r2=!1,(Yd!==null||Zd!==null)&&(l9(),s9())}}function Dp(e,t){var n=e.stateNode;if(n===null)return null;var r=n_(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(oe(231,t,typeof n));return n}var yx=!1;if(el)try{var xh={};Object.defineProperty(xh,"passive",{get:function(){yx=!0}}),window.addEventListener("test",xh,xh),window.removeEventListener("test",xh,xh)}catch{yx=!1}function cG(e,t,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var up=!1,ev=null,tv=!1,vx=null,dG={onError:function(e){up=!0,ev=e}};function fG(e,t,n,r,i,o,s,a,l){up=!1,ev=null,cG.apply(dG,arguments)}function hG(e,t,n,r,i,o,s,a,l){if(fG.apply(this,arguments),up){if(up){var u=ev;up=!1,ev=null}else throw Error(oe(198));tv||(tv=!0,vx=u)}}function zc(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 c9(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 H4(e){if(zc(e)!==e)throw Error(oe(188))}function pG(e){var t=e.alternate;if(!t){if(t=zc(e),t===null)throw Error(oe(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 H4(i),e;if(o===r)return H4(i),t;o=o.sibling}throw Error(oe(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(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function d9(e){return e=pG(e),e!==null?f9(e):null}function f9(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=f9(e);if(t!==null)return t;e=e.sibling}return null}var h9=Io.unstable_scheduleCallback,q4=Io.unstable_cancelCallback,gG=Io.unstable_shouldYield,mG=Io.unstable_requestPaint,yr=Io.unstable_now,yG=Io.unstable_getCurrentPriorityLevel,a5=Io.unstable_ImmediatePriority,p9=Io.unstable_UserBlockingPriority,nv=Io.unstable_NormalPriority,vG=Io.unstable_LowPriority,g9=Io.unstable_IdlePriority,Z1=null,sa=null;function _G(e){if(sa&&typeof sa.onCommitFiberRoot=="function")try{sa.onCommitFiberRoot(Z1,e,void 0,(e.current.flags&128)===128)}catch{}}var As=Math.clz32?Math.clz32:wG,bG=Math.log,SG=Math.LN2;function wG(e){return e>>>=0,e===0?32:31-(bG(e)/SG|0)|0}var ry=64,iy=4194304;function Zh(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 rv(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=Zh(a):(o&=s,o!==0&&(r=Zh(o)))}else s=n&~i,s!==0?r=Zh(s):o!==0&&(r=Zh(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-As(t),i=1<<n,r|=e[n],t&=~i;return r}function xG(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 CG(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-As(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=xG(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function _x(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function m9(){var e=ry;return ry<<=1,!(ry&4194240)&&(ry=64),e}function i2(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function om(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-As(t),e[t]=n}function EG(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-As(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function l5(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-As(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var an=0;function y9(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var v9,u5,_9,b9,S9,bx=!1,oy=[],Hl=null,ql=null,Wl=null,Lp=new Map,$p=new Map,Ml=[],TG="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 W4(e,t){switch(e){case"focusin":case"focusout":Hl=null;break;case"dragenter":case"dragleave":ql=null;break;case"mouseover":case"mouseout":Wl=null;break;case"pointerover":case"pointerout":Lp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$p.delete(t.pointerId)}}function Ch(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=am(t),t!==null&&u5(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function AG(e,t,n,r,i){switch(t){case"focusin":return Hl=Ch(Hl,e,t,n,r,i),!0;case"dragenter":return ql=Ch(ql,e,t,n,r,i),!0;case"mouseover":return Wl=Ch(Wl,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Lp.set(o,Ch(Lp.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,$p.set(o,Ch($p.get(o)||null,e,t,n,r,i)),!0}return!1}function w9(e){var t=tc(e.target);if(t!==null){var n=zc(t);if(n!==null){if(t=n.tag,t===13){if(t=c9(n),t!==null){e.blockedOn=t,S9(e.priority,function(){_9(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 m0(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sx(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gx=r,n.target.dispatchEvent(r),gx=null}else return t=am(n),t!==null&&u5(t),e.blockedOn=n,!1;t.shift()}return!0}function K4(e,t,n){m0(e)&&n.delete(t)}function kG(){bx=!1,Hl!==null&&m0(Hl)&&(Hl=null),ql!==null&&m0(ql)&&(ql=null),Wl!==null&&m0(Wl)&&(Wl=null),Lp.forEach(K4),$p.forEach(K4)}function Eh(e,t){e.blockedOn===t&&(e.blockedOn=null,bx||(bx=!0,Io.unstable_scheduleCallback(Io.unstable_NormalPriority,kG)))}function Fp(e){function t(i){return Eh(i,e)}if(0<oy.length){Eh(oy[0],e);for(var n=1;n<oy.length;n++){var r=oy[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Hl!==null&&Eh(Hl,e),ql!==null&&Eh(ql,e),Wl!==null&&Eh(Wl,e),Lp.forEach(t),$p.forEach(t),n=0;n<Ml.length;n++)r=Ml[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ml.length&&(n=Ml[0],n.blockedOn===null);)w9(n),n.blockedOn===null&&Ml.shift()}var Jd=ul.ReactCurrentBatchConfig,iv=!0;function PG(e,t,n,r){var i=an,o=Jd.transition;Jd.transition=null;try{an=1,c5(e,t,n,r)}finally{an=i,Jd.transition=o}}function RG(e,t,n,r){var i=an,o=Jd.transition;Jd.transition=null;try{an=4,c5(e,t,n,r)}finally{an=i,Jd.transition=o}}function c5(e,t,n,r){if(iv){var i=Sx(e,t,n,r);if(i===null)p2(e,t,r,ov,n),W4(e,r);else if(AG(i,e,t,n,r))r.stopPropagation();else if(W4(e,r),t&4&&-1<TG.indexOf(e)){for(;i!==null;){var o=am(i);if(o!==null&&v9(o),o=Sx(e,t,n,r),o===null&&p2(e,t,r,ov,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else p2(e,t,r,null,n)}}var ov=null;function Sx(e,t,n,r){if(ov=null,e=s5(r),e=tc(e),e!==null)if(t=zc(e),t===null)e=null;else if(n=t.tag,n===13){if(e=c9(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 ov=e,null}function x9(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(yG()){case a5:return 1;case p9:return 4;case nv:case vG:return 16;case g9:return 536870912;default:return 16}default:return 16}}var Fl=null,d5=null,y0=null;function C9(){if(y0)return y0;var e,t=d5,n=t.length,r,i="value"in Fl?Fl.value:Fl.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 y0=i.slice(e,1<r?1-r:void 0)}function v0(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 sy(){return!0}function X4(){return!1}function $o(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)?sy:X4,this.isPropagationStopped=X4,this}return ir(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=sy)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sy)},persist:function(){},isPersistent:sy}),t}var Jf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f5=$o(Jf),sm=ir({},Jf,{view:0,detail:0}),OG=$o(sm),o2,s2,Th,J1=ir({},sm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:h5,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!==Th&&(Th&&e.type==="mousemove"?(o2=e.screenX-Th.screenX,s2=e.screenY-Th.screenY):s2=o2=0,Th=e),o2)},movementY:function(e){return"movementY"in e?e.movementY:s2}}),Q4=$o(J1),IG=ir({},J1,{dataTransfer:0}),MG=$o(IG),NG=ir({},sm,{relatedTarget:0}),a2=$o(NG),DG=ir({},Jf,{animationName:0,elapsedTime:0,pseudoElement:0}),LG=$o(DG),$G=ir({},Jf,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FG=$o($G),BG=ir({},Jf,{data:0}),Y4=$o(BG),zG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UG={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"},jG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VG(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jG[e])?!!t[e]:!1}function h5(){return VG}var GG=ir({},sm,{key:function(e){if(e.key){var t=zG[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=v0(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?UG[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:h5,charCode:function(e){return e.type==="keypress"?v0(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?v0(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HG=$o(GG),qG=ir({},J1,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Z4=$o(qG),WG=ir({},sm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:h5}),KG=$o(WG),XG=ir({},Jf,{propertyName:0,elapsedTime:0,pseudoElement:0}),QG=$o(XG),YG=ir({},J1,{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}),ZG=$o(YG),JG=[9,13,27,32],p5=el&&"CompositionEvent"in window,cp=null;el&&"documentMode"in document&&(cp=document.documentMode);var eH=el&&"TextEvent"in window&&!cp,E9=el&&(!p5||cp&&8<cp&&11>=cp),J4=String.fromCharCode(32),eA=!1;function T9(e,t){switch(e){case"keyup":return JG.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A9(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nd=!1;function tH(e,t){switch(e){case"compositionend":return A9(t);case"keypress":return t.which!==32?null:(eA=!0,J4);case"textInput":return e=t.data,e===J4&&eA?null:e;default:return null}}function nH(e,t){if(Nd)return e==="compositionend"||!p5&&T9(e,t)?(e=C9(),y0=d5=Fl=null,Nd=!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 E9&&t.locale!=="ko"?null:t.data;default:return null}}var rH={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 tA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rH[e.type]:t==="textarea"}function k9(e,t,n,r){o9(r),t=sv(t,"onChange"),0<t.length&&(n=new f5("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var dp=null,Bp=null;function iH(e){B9(e,0)}function e_(e){var t=$d(e);if(ZI(t))return e}function oH(e,t){if(e==="change")return t}var P9=!1;if(el){var l2;if(el){var u2="oninput"in document;if(!u2){var nA=document.createElement("div");nA.setAttribute("oninput","return;"),u2=typeof nA.oninput=="function"}l2=u2}else l2=!1;P9=l2&&(!document.documentMode||9<document.documentMode)}function rA(){dp&&(dp.detachEvent("onpropertychange",R9),Bp=dp=null)}function R9(e){if(e.propertyName==="value"&&e_(Bp)){var t=[];k9(t,Bp,e,s5(e)),u9(iH,t)}}function sH(e,t,n){e==="focusin"?(rA(),dp=t,Bp=n,dp.attachEvent("onpropertychange",R9)):e==="focusout"&&rA()}function aH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return e_(Bp)}function lH(e,t){if(e==="click")return e_(t)}function uH(e,t){if(e==="input"||e==="change")return e_(t)}function cH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ms=typeof Object.is=="function"?Object.is:cH;function zp(e,t){if(Ms(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(!rx.call(t,i)||!Ms(e[i],t[i]))return!1}return!0}function iA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function oA(e,t){var n=iA(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=iA(n)}}function O9(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?O9(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function I9(){for(var e=window,t=J0();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=J0(e.document)}return t}function g5(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 dH(e){var t=I9(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&O9(n.ownerDocument.documentElement,n)){if(r!==null&&g5(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=oA(n,o);var s=oA(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 fH=el&&"documentMode"in document&&11>=document.documentMode,Dd=null,wx=null,fp=null,xx=!1;function sA(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xx||Dd==null||Dd!==J0(r)||(r=Dd,"selectionStart"in r&&g5(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}),fp&&zp(fp,r)||(fp=r,r=sv(wx,"onSelect"),0<r.length&&(t=new f5("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Dd)))}function ay(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ld={animationend:ay("Animation","AnimationEnd"),animationiteration:ay("Animation","AnimationIteration"),animationstart:ay("Animation","AnimationStart"),transitionend:ay("Transition","TransitionEnd")},c2={},M9={};el&&(M9=document.createElement("div").style,"AnimationEvent"in window||(delete Ld.animationend.animation,delete Ld.animationiteration.animation,delete Ld.animationstart.animation),"TransitionEvent"in window||delete Ld.transitionend.transition);function t_(e){if(c2[e])return c2[e];if(!Ld[e])return e;var t=Ld[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in M9)return c2[e]=t[n];return e}var N9=t_("animationend"),D9=t_("animationiteration"),L9=t_("animationstart"),$9=t_("transitionend"),F9=new Map,aA="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 xu(e,t){F9.set(e,t),Bc(t,[e])}for(var d2=0;d2<aA.length;d2++){var f2=aA[d2],hH=f2.toLowerCase(),pH=f2[0].toUpperCase()+f2.slice(1);xu(hH,"on"+pH)}xu(N9,"onAnimationEnd");xu(D9,"onAnimationIteration");xu(L9,"onAnimationStart");xu("dblclick","onDoubleClick");xu("focusin","onFocus");xu("focusout","onBlur");xu($9,"onTransitionEnd");Sf("onMouseEnter",["mouseout","mouseover"]);Sf("onMouseLeave",["mouseout","mouseover"]);Sf("onPointerEnter",["pointerout","pointerover"]);Sf("onPointerLeave",["pointerout","pointerover"]);Bc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jh="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(" "),gH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jh));function lA(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hG(r,t,void 0,e),e.currentTarget=null}function B9(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;lA(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;lA(i,a,u),o=l}}}if(tv)throw e=vx,tv=!1,vx=null,e}function In(e,t){var n=t[kx];n===void 0&&(n=t[kx]=new Set);var r=e+"__bubble";n.has(r)||(z9(t,e,2,!1),n.add(r))}function h2(e,t,n){var r=0;t&&(r|=4),z9(n,e,r,t)}var ly="_reactListening"+Math.random().toString(36).slice(2);function Up(e){if(!e[ly]){e[ly]=!0,WI.forEach(function(n){n!=="selectionchange"&&(gH.has(n)||h2(n,!1,e),h2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ly]||(t[ly]=!0,h2("selectionchange",!1,t))}}function z9(e,t,n,r){switch(x9(t)){case 1:var i=PG;break;case 4:i=RG;break;default:i=c5}n=i.bind(null,t,n,e),i=void 0,!yx||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 p2(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=tc(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}u9(function(){var u=o,c=s5(n),d=[];e:{var f=F9.get(e);if(f!==void 0){var h=f5,p=e;switch(e){case"keypress":if(v0(n)===0)break e;case"keydown":case"keyup":h=HG;break;case"focusin":p="focus",h=a2;break;case"focusout":p="blur",h=a2;break;case"beforeblur":case"afterblur":h=a2;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=Q4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=MG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=KG;break;case N9:case D9:case L9:h=LG;break;case $9:h=QG;break;case"scroll":h=OG;break;case"wheel":h=ZG;break;case"copy":case"cut":case"paste":h=FG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Z4}var m=(t&4)!==0,b=!m&&e==="scroll",_=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,_!==null&&(v=Dp(y,_),v!=null&&m.push(jp(y,v,g)))),b)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==gx&&(p=n.relatedTarget||n.fromElement)&&(tc(p)||p[tl]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?tc(p):null,p!==null&&(b=zc(p),p!==b||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(m=Q4,v="onMouseLeave",_="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=Z4,v="onPointerLeave",_="onPointerEnter",y="pointer"),b=h==null?f:$d(h),g=p==null?f:$d(p),f=new m(v,y+"leave",h,n,c),f.target=b,f.relatedTarget=g,v=null,tc(c)===u&&(m=new m(_,y+"enter",p,n,c),m.target=g,m.relatedTarget=b,v=m),b=v,h&&p)t:{for(m=h,_=p,y=0,g=m;g;g=ud(g))y++;for(g=0,v=_;v;v=ud(v))g++;for(;0<y-g;)m=ud(m),y--;for(;0<g-y;)_=ud(_),g--;for(;y--;){if(m===_||_!==null&&m===_.alternate)break t;m=ud(m),_=ud(_)}m=null}else m=null;h!==null&&uA(d,f,h,m,!1),p!==null&&b!==null&&uA(d,b,p,m,!0)}}e:{if(f=u?$d(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=oH;else if(tA(f))if(P9)S=uH;else{S=aH;var w=sH}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=lH);if(S&&(S=S(e,u))){k9(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&cx(f,"number",f.value)}switch(w=u?$d(u):window,e){case"focusin":(tA(w)||w.contentEditable==="true")&&(Dd=w,wx=u,fp=null);break;case"focusout":fp=wx=Dd=null;break;case"mousedown":xx=!0;break;case"contextmenu":case"mouseup":case"dragend":xx=!1,sA(d,n,c);break;case"selectionchange":if(fH)break;case"keydown":case"keyup":sA(d,n,c)}var x;if(p5)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Nd?T9(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(E9&&n.locale!=="ko"&&(Nd||C!=="onCompositionStart"?C==="onCompositionEnd"&&Nd&&(x=C9()):(Fl=c,d5="value"in Fl?Fl.value:Fl.textContent,Nd=!0)),w=sv(u,C),0<w.length&&(C=new Y4(C,e,null,n,c),d.push({event:C,listeners:w}),x?C.data=x:(x=A9(n),x!==null&&(C.data=x)))),(x=eH?tH(e,n):nH(e,n))&&(u=sv(u,"onBeforeInput"),0<u.length&&(c=new Y4("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}B9(d,t)})}function jp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sv(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Dp(e,n),o!=null&&r.unshift(jp(e,o,i)),o=Dp(e,t),o!=null&&r.push(jp(e,o,i))),e=e.return}return r}function ud(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function uA(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Dp(n,o),l!=null&&s.unshift(jp(n,l,a))):i||(l=Dp(n,o),l!=null&&s.push(jp(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var mH=/\r\n?/g,yH=/\u0000|\uFFFD/g;function cA(e){return(typeof e=="string"?e:""+e).replace(mH,`
`).replace(yH,"")}function uy(e,t,n){if(t=cA(t),cA(e)!==t&&n)throw Error(oe(425))}function av(){}var Cx=null,Ex=null;function Tx(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 Ax=typeof setTimeout=="function"?setTimeout:void 0,vH=typeof clearTimeout=="function"?clearTimeout:void 0,dA=typeof Promise=="function"?Promise:void 0,_H=typeof queueMicrotask=="function"?queueMicrotask:typeof dA<"u"?function(e){return dA.resolve(null).then(e).catch(bH)}:Ax;function bH(e){setTimeout(function(){throw e})}function g2(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),Fp(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Fp(t)}function Kl(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 fA(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 eh=Math.random().toString(36).slice(2),Zs="__reactFiber$"+eh,Vp="__reactProps$"+eh,tl="__reactContainer$"+eh,kx="__reactEvents$"+eh,SH="__reactListeners$"+eh,wH="__reactHandles$"+eh;function tc(e){var t=e[Zs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tl]||n[Zs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fA(e);e!==null;){if(n=e[Zs])return n;e=fA(e)}return t}e=n,n=e.parentNode}return null}function am(e){return e=e[Zs]||e[tl],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $d(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function n_(e){return e[Vp]||null}var Px=[],Fd=-1;function Cu(e){return{current:e}}function Un(e){0>Fd||(e.current=Px[Fd],Px[Fd]=null,Fd--)}function En(e,t){Fd++,Px[Fd]=e.current,e.current=t}var lu={},Fi=Cu(lu),co=Cu(!1),bc=lu;function wf(e,t){var n=e.type.contextTypes;if(!n)return lu;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 fo(e){return e=e.childContextTypes,e!=null}function lv(){Un(co),Un(Fi)}function hA(e,t,n){if(Fi.current!==lu)throw Error(oe(168));En(Fi,t),En(co,n)}function U9(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(oe(108,sG(e)||"Unknown",i));return ir({},n,r)}function uv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lu,bc=Fi.current,En(Fi,e),En(co,co.current),!0}function pA(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=U9(e,t,bc),r.__reactInternalMemoizedMergedChildContext=e,Un(co),Un(Fi),En(Fi,e)):Un(co),En(co,n)}var Fa=null,r_=!1,m2=!1;function j9(e){Fa===null?Fa=[e]:Fa.push(e)}function xH(e){r_=!0,j9(e)}function Eu(){if(!m2&&Fa!==null){m2=!0;var e=0,t=an;try{var n=Fa;for(an=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Fa=null,r_=!1}catch(i){throw Fa!==null&&(Fa=Fa.slice(e+1)),h9(a5,Eu),i}finally{an=t,m2=!1}}return null}var Bd=[],zd=0,cv=null,dv=0,qo=[],Wo=0,Sc=null,Va=1,Ga="";function Wu(e,t){Bd[zd++]=dv,Bd[zd++]=cv,cv=e,dv=t}function V9(e,t,n){qo[Wo++]=Va,qo[Wo++]=Ga,qo[Wo++]=Sc,Sc=e;var r=Va;e=Ga;var i=32-As(r)-1;r&=~(1<<i),n+=1;var o=32-As(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Va=1<<32-As(t)+i|n<<i|r,Ga=o+e}else Va=1<<o|n<<i|r,Ga=e}function m5(e){e.return!==null&&(Wu(e,1),V9(e,1,0))}function y5(e){for(;e===cv;)cv=Bd[--zd],Bd[zd]=null,dv=Bd[--zd],Bd[zd]=null;for(;e===Sc;)Sc=qo[--Wo],qo[Wo]=null,Ga=qo[--Wo],qo[Wo]=null,Va=qo[--Wo],qo[Wo]=null}var Ro=null,ko=null,Wn=!1,bs=null;function G9(e,t){var n=Qo(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 gA(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,Ro=e,ko=Kl(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ro=e,ko=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Sc!==null?{id:Va,overflow:Ga}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Qo(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ro=e,ko=null,!0):!1;default:return!1}}function Rx(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ox(e){if(Wn){var t=ko;if(t){var n=t;if(!gA(e,t)){if(Rx(e))throw Error(oe(418));t=Kl(n.nextSibling);var r=Ro;t&&gA(e,t)?G9(r,n):(e.flags=e.flags&-4097|2,Wn=!1,Ro=e)}}else{if(Rx(e))throw Error(oe(418));e.flags=e.flags&-4097|2,Wn=!1,Ro=e}}}function mA(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ro=e}function cy(e){if(e!==Ro)return!1;if(!Wn)return mA(e),Wn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tx(e.type,e.memoizedProps)),t&&(t=ko)){if(Rx(e))throw H9(),Error(oe(418));for(;t;)G9(e,t),t=Kl(t.nextSibling)}if(mA(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ko=Kl(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ko=null}}else ko=Ro?Kl(e.stateNode.nextSibling):null;return!0}function H9(){for(var e=ko;e;)e=Kl(e.nextSibling)}function xf(){ko=Ro=null,Wn=!1}function v5(e){bs===null?bs=[e]:bs.push(e)}var CH=ul.ReactCurrentBatchConfig;function ys(e,t){if(e&&e.defaultProps){t=ir({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var fv=Cu(null),hv=null,Ud=null,_5=null;function b5(){_5=Ud=hv=null}function S5(e){var t=fv.current;Un(fv),e._currentValue=t}function Ix(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 ef(e,t){hv=e,_5=Ud=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(so=!0),e.firstContext=null)}function Jo(e){var t=e._currentValue;if(_5!==e)if(e={context:e,memoizedValue:t,next:null},Ud===null){if(hv===null)throw Error(oe(308));Ud=e,hv.dependencies={lanes:0,firstContext:e}}else Ud=Ud.next=e;return t}var nc=null;function w5(e){nc===null?nc=[e]:nc.push(e)}function q9(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,w5(t)):(n.next=i.next,i.next=n),t.interleaved=n,nl(e,r)}function nl(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 kl=!1;function x5(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function W9(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 Wa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ft&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,nl(e,n)}return i=r.interleaved,i===null?(t.next=t,w5(r)):(t.next=i.next,i.next=t),r.interleaved=t,nl(e,n)}function _0(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,l5(e,n)}}function yA(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 pv(e,t,n,r){var i=e.updateQueue;kl=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,c=u=l=null,a=o;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var 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=ir({},d,f);break e;case 2:kl=!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},c===null?(u=c=h,l=d):c=c.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(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,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);xc|=s,e.lanes=s,e.memoizedState=d}}function vA(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(oe(191,i));i.call(r)}}}var K9=new qI.Component().refs;function Mx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ir({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var i_={isMounted:function(e){return(e=e._reactInternals)?zc(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Wi(),i=Yl(e),o=Wa(r,i);o.payload=t,n!=null&&(o.callback=n),t=Xl(e,o,i),t!==null&&(ks(t,e,i,r),_0(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Wi(),i=Yl(e),o=Wa(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Xl(e,o,i),t!==null&&(ks(t,e,i,r),_0(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wi(),r=Yl(e),i=Wa(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xl(e,i,r),t!==null&&(ks(t,e,r,n),_0(t,e,r))}};function _A(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?!zp(n,r)||!zp(i,o):!0}function X9(e,t,n){var r=!1,i=lu,o=t.contextType;return typeof o=="object"&&o!==null?o=Jo(o):(i=fo(t)?bc:Fi.current,r=t.contextTypes,o=(r=r!=null)?wf(e,i):lu),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=i_,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function bA(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&&i_.enqueueReplaceState(t,t.state,null)}function Nx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=K9,x5(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Jo(o):(o=fo(t)?bc:Fi.current,i.context=wf(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Mx(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&&i_.enqueueReplaceState(i,i.state,null),pv(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(oe(309));var r=n.stateNode}if(!r)throw Error(oe(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===K9&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,e))}return e}function dy(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function SA(e){var t=e._init;return t(e._payload)}function Q9(e){function t(_,y){if(e){var g=_.deletions;g===null?(_.deletions=[y],_.flags|=16):g.push(y)}}function n(_,y){if(!e)return null;for(;y!==null;)t(_,y),y=y.sibling;return null}function r(_,y){for(_=new Map;y!==null;)y.key!==null?_.set(y.key,y):_.set(y.index,y),y=y.sibling;return _}function i(_,y){return _=Zl(_,y),_.index=0,_.sibling=null,_}function o(_,y,g){return _.index=g,e?(g=_.alternate,g!==null?(g=g.index,g<y?(_.flags|=2,y):g):(_.flags|=2,y)):(_.flags|=1048576,y)}function s(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,y,g,v){return y===null||y.tag!==6?(y=x2(g,_.mode,v),y.return=_,y):(y=i(y,g),y.return=_,y)}function l(_,y,g,v){var S=g.type;return S===Md?c(_,y,g.props.children,v,g.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Al&&SA(S)===y.type)?(v=i(y,g.props),v.ref=Ah(_,y,g),v.return=_,v):(v=E0(g.type,g.key,g.props,null,_.mode,v),v.ref=Ah(_,y,g),v.return=_,v)}function u(_,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=C2(g,_.mode,v),y.return=_,y):(y=i(y,g.children||[]),y.return=_,y)}function c(_,y,g,v,S){return y===null||y.tag!==7?(y=pc(g,_.mode,v,S),y.return=_,y):(y=i(y,g),y.return=_,y)}function d(_,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=x2(""+y,_.mode,g),y.return=_,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ey:return g=E0(y.type,y.key,y.props,null,_.mode,g),g.ref=Ah(_,null,y),g.return=_,g;case Id:return y=C2(y,_.mode,g),y.return=_,y;case Al:var v=y._init;return d(_,v(y._payload),g)}if(Yh(y)||wh(y))return y=pc(y,_.mode,g,null),y.return=_,y;dy(_,y)}return null}function f(_,y,g,v){var S=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:a(_,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ey:return g.key===S?l(_,y,g,v):null;case Id:return g.key===S?u(_,y,g,v):null;case Al:return S=g._init,f(_,y,S(g._payload),v)}if(Yh(g)||wh(g))return S!==null?null:c(_,y,g,v,null);dy(_,g)}return null}function h(_,y,g,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return _=_.get(g)||null,a(y,_,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ey:return _=_.get(v.key===null?g:v.key)||null,l(y,_,v,S);case Id:return _=_.get(v.key===null?g:v.key)||null,u(y,_,v,S);case Al:var w=v._init;return h(_,y,g,w(v._payload),S)}if(Yh(v)||wh(v))return _=_.get(g)||null,c(y,_,v,S,null);dy(y,v)}return null}function p(_,y,g,v){for(var S=null,w=null,x=y,C=y=0,A=null;x!==null&&C<g.length;C++){x.index>C?(A=x,x=null):A=x.sibling;var T=f(_,x,g[C],v);if(T===null){x===null&&(x=A);break}e&&x&&T.alternate===null&&t(_,x),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T,x=A}if(C===g.length)return n(_,x),Wn&&Wu(_,C),S;if(x===null){for(;C<g.length;C++)x=d(_,g[C],v),x!==null&&(y=o(x,y,C),w===null?S=x:w.sibling=x,w=x);return Wn&&Wu(_,C),S}for(x=r(_,x);C<g.length;C++)A=h(x,_,C,g[C],v),A!==null&&(e&&A.alternate!==null&&x.delete(A.key===null?C:A.key),y=o(A,y,C),w===null?S=A:w.sibling=A,w=A);return e&&x.forEach(function(k){return t(_,k)}),Wn&&Wu(_,C),S}function m(_,y,g,v){var S=wh(g);if(typeof S!="function")throw Error(oe(150));if(g=S.call(g),g==null)throw Error(oe(151));for(var w=S=null,x=y,C=y=0,A=null,T=g.next();x!==null&&!T.done;C++,T=g.next()){x.index>C?(A=x,x=null):A=x.sibling;var k=f(_,x,T.value,v);if(k===null){x===null&&(x=A);break}e&&x&&k.alternate===null&&t(_,x),y=o(k,y,C),w===null?S=k:w.sibling=k,w=k,x=A}if(T.done)return n(_,x),Wn&&Wu(_,C),S;if(x===null){for(;!T.done;C++,T=g.next())T=d(_,T.value,v),T!==null&&(y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return Wn&&Wu(_,C),S}for(x=r(_,x);!T.done;C++,T=g.next())T=h(x,_,C,T.value,v),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?C:T.key),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return e&&x.forEach(function(L){return t(_,L)}),Wn&&Wu(_,C),S}function b(_,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Md&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ey:e:{for(var S=g.key,w=y;w!==null;){if(w.key===S){if(S=g.type,S===Md){if(w.tag===7){n(_,w.sibling),y=i(w,g.props.children),y.return=_,_=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Al&&SA(S)===w.type){n(_,w.sibling),y=i(w,g.props),y.ref=Ah(_,w,g),y.return=_,_=y;break e}n(_,w);break}else t(_,w);w=w.sibling}g.type===Md?(y=pc(g.props.children,_.mode,v,g.key),y.return=_,_=y):(v=E0(g.type,g.key,g.props,null,_.mode,v),v.ref=Ah(_,y,g),v.return=_,_=v)}return s(_);case Id: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(_,y.sibling),y=i(y,g.children||[]),y.return=_,_=y;break e}else{n(_,y);break}else t(_,y);y=y.sibling}y=C2(g,_.mode,v),y.return=_,_=y}return s(_);case Al:return w=g._init,b(_,y,w(g._payload),v)}if(Yh(g))return p(_,y,g,v);if(wh(g))return m(_,y,g,v);dy(_,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(_,y.sibling),y=i(y,g),y.return=_,_=y):(n(_,y),y=x2(g,_.mode,v),y.return=_,_=y),s(_)):n(_,y)}return b}var Cf=Q9(!0),Y9=Q9(!1),lm={},aa=Cu(lm),Gp=Cu(lm),Hp=Cu(lm);function rc(e){if(e===lm)throw Error(oe(174));return e}function C5(e,t){switch(En(Hp,t),En(Gp,e),En(aa,lm),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fx(t,e)}Un(aa),En(aa,t)}function Ef(){Un(aa),Un(Gp),Un(Hp)}function Z9(e){rc(Hp.current);var t=rc(aa.current),n=fx(t,e.type);t!==n&&(En(Gp,e),En(aa,n))}function E5(e){Gp.current===e&&(Un(aa),Un(Gp))}var er=Cu(0);function gv(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 y2=[];function T5(){for(var e=0;e<y2.length;e++)y2[e]._workInProgressVersionPrimary=null;y2.length=0}var b0=ul.ReactCurrentDispatcher,v2=ul.ReactCurrentBatchConfig,wc=0,rr=null,Dr=null,Jr=null,mv=!1,hp=!1,qp=0,EH=0;function Ai(){throw Error(oe(321))}function A5(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ms(e[n],t[n]))return!1;return!0}function k5(e,t,n,r,i,o){if(wc=o,rr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,b0.current=e===null||e.memoizedState===null?PH:RH,e=n(r,i),hp){o=0;do{if(hp=!1,qp=0,25<=o)throw Error(oe(301));o+=1,Jr=Dr=null,t.updateQueue=null,b0.current=OH,e=n(r,i)}while(hp)}if(b0.current=yv,t=Dr!==null&&Dr.next!==null,wc=0,Jr=Dr=rr=null,mv=!1,t)throw Error(oe(300));return e}function P5(){var e=qp!==0;return qp=0,e}function Ws(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jr===null?rr.memoizedState=Jr=e:Jr=Jr.next=e,Jr}function es(){if(Dr===null){var e=rr.alternate;e=e!==null?e.memoizedState:null}else e=Dr.next;var t=Jr===null?rr.memoizedState:Jr.next;if(t!==null)Jr=t,Dr=e;else{if(e===null)throw Error(oe(310));Dr=e,e={memoizedState:Dr.memoizedState,baseState:Dr.baseState,baseQueue:Dr.baseQueue,queue:Dr.queue,next:null},Jr===null?rr.memoizedState=Jr=e:Jr=Jr.next=e}return Jr}function Wp(e,t){return typeof t=="function"?t(e):t}function _2(e){var t=es(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=Dr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,u=o;do{var c=u.lane;if((wc&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,rr.lanes|=c,xc|=c}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,Ms(r,t.memoizedState)||(so=!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,rr.lanes|=o,xc|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function b2(e){var t=es(),n=t.queue;if(n===null)throw Error(oe(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);Ms(o,t.memoizedState)||(so=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function J9(){}function eM(e,t){var n=rr,r=es(),i=t(),o=!Ms(r.memoizedState,i);if(o&&(r.memoizedState=i,so=!0),r=r.queue,R5(rM.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Jr!==null&&Jr.memoizedState.tag&1){if(n.flags|=2048,Kp(9,nM.bind(null,n,r,i,t),void 0,null),ni===null)throw Error(oe(349));wc&30||tM(n,t,i)}return i}function tM(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nM(e,t,n,r){t.value=n,t.getSnapshot=r,iM(t)&&oM(e)}function rM(e,t,n){return n(function(){iM(t)&&oM(e)})}function iM(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ms(e,n)}catch{return!0}}function oM(e){var t=nl(e,1);t!==null&&ks(t,e,1,-1)}function wA(e){var t=Ws();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=kH.bind(null,rr,e),[t.memoizedState,e]}function Kp(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.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 sM(){return es().memoizedState}function S0(e,t,n,r){var i=Ws();rr.flags|=e,i.memoizedState=Kp(1|t,n,void 0,r===void 0?null:r)}function o_(e,t,n,r){var i=es();r=r===void 0?null:r;var o=void 0;if(Dr!==null){var s=Dr.memoizedState;if(o=s.destroy,r!==null&&A5(r,s.deps)){i.memoizedState=Kp(t,n,o,r);return}}rr.flags|=e,i.memoizedState=Kp(1|t,n,o,r)}function xA(e,t){return S0(8390656,8,e,t)}function R5(e,t){return o_(2048,8,e,t)}function aM(e,t){return o_(4,2,e,t)}function lM(e,t){return o_(4,4,e,t)}function uM(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 cM(e,t,n){return n=n!=null?n.concat([e]):null,o_(4,4,uM.bind(null,t,e),n)}function O5(){}function dM(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&A5(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fM(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&A5(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function hM(e,t,n){return wc&21?(Ms(n,t)||(n=m9(),rr.lanes|=n,xc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,so=!0),e.memoizedState=n)}function TH(e,t){var n=an;an=n!==0&&4>n?n:4,e(!0);var r=v2.transition;v2.transition={};try{e(!1),t()}finally{an=n,v2.transition=r}}function pM(){return es().memoizedState}function AH(e,t,n){var r=Yl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gM(e))mM(t,n);else if(n=q9(e,t,n,r),n!==null){var i=Wi();ks(n,e,r,i),yM(n,t,r)}}function kH(e,t,n){var r=Yl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gM(e))mM(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,Ms(a,s)){var l=t.interleaved;l===null?(i.next=i,w5(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=q9(e,t,i,r),n!==null&&(i=Wi(),ks(n,e,r,i),yM(n,t,r))}}function gM(e){var t=e.alternate;return e===rr||t!==null&&t===rr}function mM(e,t){hp=mv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yM(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,l5(e,n)}}var yv={readContext:Jo,useCallback:Ai,useContext:Ai,useEffect:Ai,useImperativeHandle:Ai,useInsertionEffect:Ai,useLayoutEffect:Ai,useMemo:Ai,useReducer:Ai,useRef:Ai,useState:Ai,useDebugValue:Ai,useDeferredValue:Ai,useTransition:Ai,useMutableSource:Ai,useSyncExternalStore:Ai,useId:Ai,unstable_isNewReconciler:!1},PH={readContext:Jo,useCallback:function(e,t){return Ws().memoizedState=[e,t===void 0?null:t],e},useContext:Jo,useEffect:xA,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,S0(4194308,4,uM.bind(null,t,e),n)},useLayoutEffect:function(e,t){return S0(4194308,4,e,t)},useInsertionEffect:function(e,t){return S0(4,2,e,t)},useMemo:function(e,t){var n=Ws();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ws();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=AH.bind(null,rr,e),[r.memoizedState,e]},useRef:function(e){var t=Ws();return e={current:e},t.memoizedState=e},useState:wA,useDebugValue:O5,useDeferredValue:function(e){return Ws().memoizedState=e},useTransition:function(){var e=wA(!1),t=e[0];return e=TH.bind(null,e[1]),Ws().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rr,i=Ws();if(Wn){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),ni===null)throw Error(oe(349));wc&30||tM(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,xA(rM.bind(null,r,o,e),[e]),r.flags|=2048,Kp(9,nM.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ws(),t=ni.identifierPrefix;if(Wn){var n=Ga,r=Va;n=(r&~(1<<32-As(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qp++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=EH++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},RH={readContext:Jo,useCallback:dM,useContext:Jo,useEffect:R5,useImperativeHandle:cM,useInsertionEffect:aM,useLayoutEffect:lM,useMemo:fM,useReducer:_2,useRef:sM,useState:function(){return _2(Wp)},useDebugValue:O5,useDeferredValue:function(e){var t=es();return hM(t,Dr.memoizedState,e)},useTransition:function(){var e=_2(Wp)[0],t=es().memoizedState;return[e,t]},useMutableSource:J9,useSyncExternalStore:eM,useId:pM,unstable_isNewReconciler:!1},OH={readContext:Jo,useCallback:dM,useContext:Jo,useEffect:R5,useImperativeHandle:cM,useInsertionEffect:aM,useLayoutEffect:lM,useMemo:fM,useReducer:b2,useRef:sM,useState:function(){return b2(Wp)},useDebugValue:O5,useDeferredValue:function(e){var t=es();return Dr===null?t.memoizedState=e:hM(t,Dr.memoizedState,e)},useTransition:function(){var e=b2(Wp)[0],t=es().memoizedState;return[e,t]},useMutableSource:J9,useSyncExternalStore:eM,useId:pM,unstable_isNewReconciler:!1};function Tf(e,t){try{var n="",r=t;do n+=oG(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 S2(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Dx(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var IH=typeof WeakMap=="function"?WeakMap:Map;function vM(e,t,n){n=Wa(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_v||(_v=!0,Hx=r),Dx(e,t)},n}function _M(e,t,n){n=Wa(-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(){Dx(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Dx(e,t),typeof r!="function"&&(Ql===null?Ql=new Set([this]):Ql.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function CA(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new IH;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=qH.bind(null,e,t,n),t.then(e,e))}function EA(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 TA(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=Wa(-1,1),t.tag=2,Xl(n,t,1))),n.lanes|=1),e)}var MH=ul.ReactCurrentOwner,so=!1;function Hi(e,t,n,r){t.child=e===null?Y9(t,null,n,r):Cf(t,e.child,n,r)}function AA(e,t,n,r,i){n=n.render;var o=t.ref;return ef(t,i),r=k5(e,t,n,r,o,i),n=P5(),e!==null&&!so?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rl(e,t,i)):(Wn&&n&&m5(t),t.flags|=1,Hi(e,t,r,i),t.child)}function kA(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!B5(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,bM(e,t,o,r,i)):(e=E0(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:zp,n(s,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=Zl(o,r),e.ref=t.ref,e.return=t,t.child=e}function bM(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(zp(o,r)&&e.ref===t.ref)if(so=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(so=!0);else return t.lanes=e.lanes,rl(e,t,i)}return Lx(e,t,n,r,i)}function SM(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},En(Vd,Eo),Eo|=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,En(Vd,Eo),Eo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,En(Vd,Eo),Eo|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,En(Vd,Eo),Eo|=r;return Hi(e,t,i,n),t.child}function wM(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Lx(e,t,n,r,i){var o=fo(n)?bc:Fi.current;return o=wf(t,o),ef(t,i),n=k5(e,t,n,r,o,i),r=P5(),e!==null&&!so?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rl(e,t,i)):(Wn&&r&&m5(t),t.flags|=1,Hi(e,t,n,i),t.child)}function PA(e,t,n,r,i){if(fo(n)){var o=!0;uv(t)}else o=!1;if(ef(t,i),t.stateNode===null)w0(e,t),X9(t,n,r),Nx(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Jo(u):(u=fo(n)?bc:Fi.current,u=wf(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&bA(t,s,r,u),kl=!1;var f=t.memoizedState;s.state=f,pv(t,r,s,i),l=t.memoizedState,a!==r||f!==l||co.current||kl?(typeof c=="function"&&(Mx(t,n,c,r),l=t.memoizedState),(a=kl||_A(t,n,a,r,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,W9(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ys(t.type,a),s.props=u,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jo(l):(l=fo(n)?bc:Fi.current,l=wf(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&bA(t,s,r,l),kl=!1,f=t.memoizedState,s.state=f,pv(t,r,s,i);var p=t.memoizedState;a!==d||f!==p||co.current||kl?(typeof h=="function"&&(Mx(t,n,h,r),p=t.memoizedState),(u=kl||_A(t,n,u,r,f,p,l)||!1)?(c||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=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return $x(e,t,n,r,o,i)}function $x(e,t,n,r,i,o){wM(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&pA(t,n,!1),rl(e,t,o);r=t.stateNode,MH.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Cf(t,e.child,null,o),t.child=Cf(t,null,a,o)):Hi(e,t,a,o),t.memoizedState=r.state,i&&pA(t,n,!0),t.child}function xM(e){var t=e.stateNode;t.pendingContext?hA(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hA(e,t.context,!1),C5(e,t.containerInfo)}function RA(e,t,n,r,i){return xf(),v5(i),t.flags|=256,Hi(e,t,n,r),t.child}var Fx={dehydrated:null,treeContext:null,retryLane:0};function Bx(e){return{baseLanes:e,cachePool:null,transitions:null}}function CM(e,t,n){var r=t.pendingProps,i=er.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),En(er,i&1),e===null)return Ox(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=l_(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=Bx(n),t.memoizedState=Fx,e):I5(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return NH(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=Zl(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Zl(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?Bx(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Fx,r}return o=e.child,e=o.sibling,r=Zl(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 I5(e,t){return t=l_({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fy(e,t,n,r){return r!==null&&v5(r),Cf(t,e.child,null,n),e=I5(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function NH(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=S2(Error(oe(422))),fy(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=l_({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&&Cf(t,e.child,null,s),t.child.memoizedState=Bx(s),t.memoizedState=Fx,o);if(!(t.mode&1))return fy(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(oe(419)),r=S2(o,r,void 0),fy(e,t,s,r)}if(a=(s&e.childLanes)!==0,so||a){if(r=ni,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,nl(e,i),ks(r,e,i,-1))}return F5(),r=S2(Error(oe(421))),fy(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=WH.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ko=Kl(i.nextSibling),Ro=t,Wn=!0,bs=null,e!==null&&(qo[Wo++]=Va,qo[Wo++]=Ga,qo[Wo++]=Sc,Va=e.id,Ga=e.overflow,Sc=t),t=I5(t,r.children),t.flags|=4096,t)}function OA(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ix(e.return,t,n)}function w2(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 EM(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Hi(e,t,r.children,n),r=er.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&&OA(e,n,t);else if(e.tag===19)OA(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(En(er,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&&gv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),w2(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&&gv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}w2(t,!0,n,null,o);break;case"together":w2(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function w0(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xc|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=Zl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function DH(e,t,n){switch(t.tag){case 3:xM(t),xf();break;case 5:Z9(t);break;case 1:fo(t.type)&&uv(t);break;case 4:C5(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;En(fv,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(En(er,er.current&1),t.flags|=128,null):n&t.child.childLanes?CM(e,t,n):(En(er,er.current&1),e=rl(e,t,n),e!==null?e.sibling:null);En(er,er.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return EM(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),En(er,er.current),r)break;return null;case 22:case 23:return t.lanes=0,SM(e,t,n)}return rl(e,t,n)}var TM,zx,AM,kM;TM=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}};zx=function(){};AM=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,rc(aa.current);var o=null;switch(n){case"input":i=lx(e,i),r=lx(e,r),o=[];break;case"select":i=ir({},i,{value:void 0}),r=ir({},r,{value:void 0}),o=[];break;case"textarea":i=dx(e,i),r=dx(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=av)}hx(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Mp.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Mp.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&In("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};kM=function(e,t,n,r){n!==r&&(t.flags|=4)};function kh(e,t){if(!Wn)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 ki(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 LH(e,t,n){var r=t.pendingProps;switch(y5(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ki(t),null;case 1:return fo(t.type)&&lv(),ki(t),null;case 3:return r=t.stateNode,Ef(),Un(co),Un(Fi),T5(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cy(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bs!==null&&(Kx(bs),bs=null))),zx(e,t),ki(t),null;case 5:E5(t);var i=rc(Hp.current);if(n=t.type,e!==null&&t.stateNode!=null)AM(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return ki(t),null}if(e=rc(aa.current),cy(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Zs]=t,r[Vp]=o,e=(t.mode&1)!==0,n){case"dialog":In("cancel",r),In("close",r);break;case"iframe":case"object":case"embed":In("load",r);break;case"video":case"audio":for(i=0;i<Jh.length;i++)In(Jh[i],r);break;case"source":In("error",r);break;case"img":case"image":case"link":In("error",r),In("load",r);break;case"details":In("toggle",r);break;case"input":z4(r,o),In("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},In("invalid",r);break;case"textarea":j4(r,o),In("invalid",r)}hx(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&&uy(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&uy(r.textContent,a,e),i=["children",""+a]):Mp.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&In("scroll",r)}switch(n){case"input":ty(r),U4(r,o,!0);break;case"textarea":ty(r),V4(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=av)}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=t9(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[Zs]=t,e[Vp]=r,TM(e,t,!1,!1),t.stateNode=e;e:{switch(s=px(n,r),n){case"dialog":In("cancel",e),In("close",e),i=r;break;case"iframe":case"object":case"embed":In("load",e),i=r;break;case"video":case"audio":for(i=0;i<Jh.length;i++)In(Jh[i],e);i=r;break;case"source":In("error",e),i=r;break;case"img":case"image":case"link":In("error",e),In("load",e),i=r;break;case"details":In("toggle",e),i=r;break;case"input":z4(e,r),i=lx(e,r),In("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ir({},r,{value:void 0}),In("invalid",e);break;case"textarea":j4(e,r),i=dx(e,r),In("invalid",e);break;default:i=r}hx(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?i9(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&n9(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Np(e,l):typeof l=="number"&&Np(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Mp.hasOwnProperty(o)?l!=null&&o==="onScroll"&&In("scroll",e):l!=null&&n5(e,o,l,s))}switch(n){case"input":ty(e),U4(e,r,!1);break;case"textarea":ty(e),V4(e);break;case"option":r.value!=null&&e.setAttribute("value",""+au(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Qd(e,!!r.multiple,o,!1):r.defaultValue!=null&&Qd(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=av)}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 ki(t),null;case 6:if(e&&t.stateNode!=null)kM(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=rc(Hp.current),rc(aa.current),cy(t)){if(r=t.stateNode,n=t.memoizedProps,r[Zs]=t,(o=r.nodeValue!==n)&&(e=Ro,e!==null))switch(e.tag){case 3:uy(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uy(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Zs]=t,t.stateNode=r}return ki(t),null;case 13:if(Un(er),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Wn&&ko!==null&&t.mode&1&&!(t.flags&128))H9(),xf(),t.flags|=98560,o=!1;else if(o=cy(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(oe(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(oe(317));o[Zs]=t}else xf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ki(t),o=!1}else bs!==null&&(Kx(bs),bs=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||er.current&1?Br===0&&(Br=3):F5())),t.updateQueue!==null&&(t.flags|=4),ki(t),null);case 4:return Ef(),zx(e,t),e===null&&Up(t.stateNode.containerInfo),ki(t),null;case 10:return S5(t.type._context),ki(t),null;case 17:return fo(t.type)&&lv(),ki(t),null;case 19:if(Un(er),o=t.memoizedState,o===null)return ki(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)kh(o,!1);else{if(Br!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=gv(e),s!==null){for(t.flags|=128,kh(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 En(er,er.current&1|2),t.child}e=e.sibling}o.tail!==null&&yr()>Af&&(t.flags|=128,r=!0,kh(o,!1),t.lanes=4194304)}else{if(!r)if(e=gv(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Wn)return ki(t),null}else 2*yr()-o.renderingStartTime>Af&&n!==1073741824&&(t.flags|=128,r=!0,kh(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=yr(),t.sibling=null,n=er.current,En(er,r?n&1|2:n&1),t):(ki(t),null);case 22:case 23:return $5(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Eo&1073741824&&(ki(t),t.subtreeFlags&6&&(t.flags|=8192)):ki(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function $H(e,t){switch(y5(t),t.tag){case 1:return fo(t.type)&&lv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ef(),Un(co),Un(Fi),T5(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return E5(t),null;case 13:if(Un(er),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));xf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Un(er),null;case 4:return Ef(),null;case 10:return S5(t.type._context),null;case 22:case 23:return $5(),null;case 24:return null;default:return null}}var hy=!1,Mi=!1,FH=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function jd(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){lr(e,t,r)}else n.current=null}function Ux(e,t,n){try{n()}catch(r){lr(e,t,r)}}var IA=!1;function BH(e,t){if(Cx=iv,e=I9(),g5(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=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&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ex={focusedElem:e,selectionRange:n},iv=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){t=Ie;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,b=p.memoizedState,_=t.stateNode,y=_.getSnapshotBeforeUpdate(t.elementType===t.type?m:ys(t.type,m),b);_.__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(oe(163))}}catch(v){lr(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,Ie=e;break}Ie=t.return}return p=IA,IA=!1,p}function pp(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&&Ux(t,n,o)}i=i.next}while(i!==r)}}function s_(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 jx(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 PM(e){var t=e.alternate;t!==null&&(e.alternate=null,PM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zs],delete t[Vp],delete t[kx],delete t[SH],delete t[wH])),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 RM(e){return e.tag===5||e.tag===3||e.tag===4}function MA(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RM(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 Vx(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=av));else if(r!==4&&(e=e.child,e!==null))for(Vx(e,t,n),e=e.sibling;e!==null;)Vx(e,t,n),e=e.sibling}function Gx(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(Gx(e,t,n),e=e.sibling;e!==null;)Gx(e,t,n),e=e.sibling}var pi=null,vs=!1;function bl(e,t,n){for(n=n.child;n!==null;)OM(e,t,n),n=n.sibling}function OM(e,t,n){if(sa&&typeof sa.onCommitFiberUnmount=="function")try{sa.onCommitFiberUnmount(Z1,n)}catch{}switch(n.tag){case 5:Mi||jd(n,t);case 6:var r=pi,i=vs;pi=null,bl(e,t,n),pi=r,vs=i,pi!==null&&(vs?(e=pi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pi.removeChild(n.stateNode));break;case 18:pi!==null&&(vs?(e=pi,n=n.stateNode,e.nodeType===8?g2(e.parentNode,n):e.nodeType===1&&g2(e,n),Fp(e)):g2(pi,n.stateNode));break;case 4:r=pi,i=vs,pi=n.stateNode.containerInfo,vs=!0,bl(e,t,n),pi=r,vs=i;break;case 0:case 11:case 14:case 15:if(!Mi&&(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)&&Ux(n,t,s),i=i.next}while(i!==r)}bl(e,t,n);break;case 1:if(!Mi&&(jd(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){lr(n,t,a)}bl(e,t,n);break;case 21:bl(e,t,n);break;case 22:n.mode&1?(Mi=(r=Mi)||n.memoizedState!==null,bl(e,t,n),Mi=r):bl(e,t,n);break;default:bl(e,t,n)}}function NA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FH),t.forEach(function(r){var i=KH.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function gs(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:pi=a.stateNode,vs=!1;break e;case 3:pi=a.stateNode.containerInfo,vs=!0;break e;case 4:pi=a.stateNode.containerInfo,vs=!0;break e}a=a.return}if(pi===null)throw Error(oe(160));OM(o,s,i),pi=null,vs=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){lr(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)IM(t,e),t=t.sibling}function IM(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gs(t,e),js(e),r&4){try{pp(3,e,e.return),s_(3,e)}catch(m){lr(e,e.return,m)}try{pp(5,e,e.return)}catch(m){lr(e,e.return,m)}}break;case 1:gs(t,e),js(e),r&512&&n!==null&&jd(n,n.return);break;case 5:if(gs(t,e),js(e),r&512&&n!==null&&jd(n,n.return),e.flags&32){var i=e.stateNode;try{Np(i,"")}catch(m){lr(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&&JI(i,o),px(a,s);var u=px(a,o);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?i9(i,d):c==="dangerouslySetInnerHTML"?n9(i,d):c==="children"?Np(i,d):n5(i,c,d,u)}switch(a){case"input":ux(i,o);break;case"textarea":e9(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Qd(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Qd(i,!!o.multiple,o.defaultValue,!0):Qd(i,!!o.multiple,o.multiple?[]:"",!1))}i[Vp]=o}catch(m){lr(e,e.return,m)}}break;case 6:if(gs(t,e),js(e),r&4){if(e.stateNode===null)throw Error(oe(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){lr(e,e.return,m)}}break;case 3:if(gs(t,e),js(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(m){lr(e,e.return,m)}break;case 4:gs(t,e),js(e);break;case 13:gs(t,e),js(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(D5=yr())),r&4&&NA(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Mi=(u=Mi)||c,gs(t,e),Mi=u):gs(t,e),js(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Ie=e,c=e.child;c!==null;){for(d=Ie=c;Ie!==null;){switch(f=Ie,h=f.child,f.tag){case 0:case 11:case 14:case 15:pp(4,f,f.return);break;case 1:jd(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){lr(r,n,m)}}break;case 5:jd(f,f.return);break;case 22:if(f.memoizedState!==null){LA(d);continue}}h!==null?(h.return=f,Ie=h):LA(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=r9("display",s))}catch(m){lr(e,e.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){lr(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;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:gs(t,e),js(e),r&4&&NA(e);break;case 21:break;default:gs(t,e),js(e)}}function js(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(RM(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Np(i,""),r.flags&=-33);var o=MA(e);Gx(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=MA(e);Vx(e,a,s);break;default:throw Error(oe(161))}}catch(l){lr(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zH(e,t,n){Ie=e,MM(e)}function MM(e,t,n){for(var r=(e.mode&1)!==0;Ie!==null;){var i=Ie,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||hy;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Mi;a=hy;var u=Mi;if(hy=s,(Mi=l)&&!u)for(Ie=i;Ie!==null;)s=Ie,l=s.child,s.tag===22&&s.memoizedState!==null?$A(i):l!==null?(l.return=s,Ie=l):$A(i);for(;o!==null;)Ie=o,MM(o),o=o.sibling;Ie=i,hy=a,Mi=u}DA(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Ie=o):DA(e)}}function DA(e){for(;Ie!==null;){var t=Ie;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mi||s_(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mi)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ys(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&vA(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}vA(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Fp(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Mi||t.flags&512&&jx(t)}catch(f){lr(t,t.return,f)}}if(t===e){Ie=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ie=n;break}Ie=t.return}}function LA(e){for(;Ie!==null;){var t=Ie;if(t===e){Ie=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ie=n;break}Ie=t.return}}function $A(e){for(;Ie!==null;){var t=Ie;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{s_(4,t)}catch(l){lr(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){lr(t,i,l)}}var o=t.return;try{jx(t)}catch(l){lr(t,o,l)}break;case 5:var s=t.return;try{jx(t)}catch(l){lr(t,s,l)}}}catch(l){lr(t,t.return,l)}if(t===e){Ie=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Ie=a;break}Ie=t.return}}var UH=Math.ceil,vv=ul.ReactCurrentDispatcher,M5=ul.ReactCurrentOwner,Zo=ul.ReactCurrentBatchConfig,Ft=0,ni=null,kr=null,bi=0,Eo=0,Vd=Cu(0),Br=0,Xp=null,xc=0,a_=0,N5=0,gp=null,io=null,D5=0,Af=1/0,Da=null,_v=!1,Hx=null,Ql=null,py=!1,Bl=null,bv=0,mp=0,qx=null,x0=-1,C0=0;function Wi(){return Ft&6?yr():x0!==-1?x0:x0=yr()}function Yl(e){return e.mode&1?Ft&2&&bi!==0?bi&-bi:CH.transition!==null?(C0===0&&(C0=m9()),C0):(e=an,e!==0||(e=window.event,e=e===void 0?16:x9(e.type)),e):1}function ks(e,t,n,r){if(50<mp)throw mp=0,qx=null,Error(oe(185));om(e,n,r),(!(Ft&2)||e!==ni)&&(e===ni&&(!(Ft&2)&&(a_|=n),Br===4&&Nl(e,bi)),ho(e,r),n===1&&Ft===0&&!(t.mode&1)&&(Af=yr()+500,r_&&Eu()))}function ho(e,t){var n=e.callbackNode;CG(e,t);var r=rv(e,e===ni?bi:0);if(r===0)n!==null&&q4(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&q4(n),t===1)e.tag===0?xH(FA.bind(null,e)):j9(FA.bind(null,e)),_H(function(){!(Ft&6)&&Eu()}),n=null;else{switch(y9(r)){case 1:n=a5;break;case 4:n=p9;break;case 16:n=nv;break;case 536870912:n=g9;break;default:n=nv}n=UM(n,NM.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function NM(e,t){if(x0=-1,C0=0,Ft&6)throw Error(oe(327));var n=e.callbackNode;if(tf()&&e.callbackNode!==n)return null;var r=rv(e,e===ni?bi:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Sv(e,r);else{t=r;var i=Ft;Ft|=2;var o=LM();(ni!==e||bi!==t)&&(Da=null,Af=yr()+500,hc(e,t));do try{GH();break}catch(a){DM(e,a)}while(1);b5(),vv.current=o,Ft=i,kr!==null?t=0:(ni=null,bi=0,t=Br)}if(t!==0){if(t===2&&(i=_x(e),i!==0&&(r=i,t=Wx(e,i))),t===1)throw n=Xp,hc(e,0),Nl(e,r),ho(e,yr()),n;if(t===6)Nl(e,r);else{if(i=e.current.alternate,!(r&30)&&!jH(i)&&(t=Sv(e,r),t===2&&(o=_x(e),o!==0&&(r=o,t=Wx(e,o))),t===1))throw n=Xp,hc(e,0),Nl(e,r),ho(e,yr()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:Ku(e,io,Da);break;case 3:if(Nl(e,r),(r&130023424)===r&&(t=D5+500-yr(),10<t)){if(rv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Wi(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Ax(Ku.bind(null,e,io,Da),t);break}Ku(e,io,Da);break;case 4:if(Nl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-As(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=yr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UH(r/1960))-r,10<r){e.timeoutHandle=Ax(Ku.bind(null,e,io,Da),r);break}Ku(e,io,Da);break;case 5:Ku(e,io,Da);break;default:throw Error(oe(329))}}}return ho(e,yr()),e.callbackNode===n?NM.bind(null,e):null}function Wx(e,t){var n=gp;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),e=Sv(e,t),e!==2&&(t=io,io=n,t!==null&&Kx(t)),e}function Kx(e){io===null?io=e:io.push.apply(io,e)}function jH(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(!Ms(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 Nl(e,t){for(t&=~N5,t&=~a_,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-As(t),r=1<<n;e[n]=-1,t&=~r}}function FA(e){if(Ft&6)throw Error(oe(327));tf();var t=rv(e,0);if(!(t&1))return ho(e,yr()),null;var n=Sv(e,t);if(e.tag!==0&&n===2){var r=_x(e);r!==0&&(t=r,n=Wx(e,r))}if(n===1)throw n=Xp,hc(e,0),Nl(e,t),ho(e,yr()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ku(e,io,Da),ho(e,yr()),null}function L5(e,t){var n=Ft;Ft|=1;try{return e(t)}finally{Ft=n,Ft===0&&(Af=yr()+500,r_&&Eu())}}function Cc(e){Bl!==null&&Bl.tag===0&&!(Ft&6)&&tf();var t=Ft;Ft|=1;var n=Zo.transition,r=an;try{if(Zo.transition=null,an=1,e)return e()}finally{an=r,Zo.transition=n,Ft=t,!(Ft&6)&&Eu()}}function $5(){Eo=Vd.current,Un(Vd)}function hc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vH(n)),kr!==null)for(n=kr.return;n!==null;){var r=n;switch(y5(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&lv();break;case 3:Ef(),Un(co),Un(Fi),T5();break;case 5:E5(r);break;case 4:Ef();break;case 13:Un(er);break;case 19:Un(er);break;case 10:S5(r.type._context);break;case 22:case 23:$5()}n=n.return}if(ni=e,kr=e=Zl(e.current,null),bi=Eo=t,Br=0,Xp=null,N5=a_=xc=0,io=gp=null,nc!==null){for(t=0;t<nc.length;t++)if(n=nc[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}nc=null}return e}function DM(e,t){do{var n=kr;try{if(b5(),b0.current=yv,mv){for(var r=rr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}mv=!1}if(wc=0,Jr=Dr=rr=null,hp=!1,qp=0,M5.current=null,n===null||n.return===null){Br=1,Xp=t,kr=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=bi,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=EA(s);if(h!==null){h.flags&=-257,TA(h,s,a,o,t),h.mode&1&&CA(o,u,t),t=h,l=u;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)){CA(o,u,t),F5();break e}l=Error(oe(426))}}else if(Wn&&a.mode&1){var b=EA(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),TA(b,s,a,o,t),v5(Tf(l,a));break e}}o=l=Tf(l,a),Br!==4&&(Br=2),gp===null?gp=[o]:gp.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var _=vM(o,l,t);yA(o,_);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"&&(Ql===null||!Ql.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=_M(o,a,t);yA(o,v);break e}}o=o.return}while(o!==null)}FM(n)}catch(S){t=S,kr===n&&n!==null&&(kr=n=n.return);continue}break}while(1)}function LM(){var e=vv.current;return vv.current=yv,e===null?yv:e}function F5(){(Br===0||Br===3||Br===2)&&(Br=4),ni===null||!(xc&268435455)&&!(a_&268435455)||Nl(ni,bi)}function Sv(e,t){var n=Ft;Ft|=2;var r=LM();(ni!==e||bi!==t)&&(Da=null,hc(e,t));do try{VH();break}catch(i){DM(e,i)}while(1);if(b5(),Ft=n,vv.current=r,kr!==null)throw Error(oe(261));return ni=null,bi=0,Br}function VH(){for(;kr!==null;)$M(kr)}function GH(){for(;kr!==null&&!gG();)$M(kr)}function $M(e){var t=zM(e.alternate,e,Eo);e.memoizedProps=e.pendingProps,t===null?FM(e):kr=t,M5.current=null}function FM(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$H(n,t),n!==null){n.flags&=32767,kr=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Br=6,kr=null;return}}else if(n=LH(n,t,Eo),n!==null){kr=n;return}if(t=t.sibling,t!==null){kr=t;return}kr=t=e}while(t!==null);Br===0&&(Br=5)}function Ku(e,t,n){var r=an,i=Zo.transition;try{Zo.transition=null,an=1,HH(e,t,n,r)}finally{Zo.transition=i,an=r}return null}function HH(e,t,n,r){do tf();while(Bl!==null);if(Ft&6)throw Error(oe(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(oe(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(EG(e,o),e===ni&&(kr=ni=null,bi=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||py||(py=!0,UM(nv,function(){return tf(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Zo.transition,Zo.transition=null;var s=an;an=1;var a=Ft;Ft|=4,M5.current=null,BH(e,n),IM(n,e),dH(Ex),iv=!!Cx,Ex=Cx=null,e.current=n,zH(n),mG(),Ft=a,an=s,Zo.transition=o}else e.current=n;if(py&&(py=!1,Bl=e,bv=i),o=e.pendingLanes,o===0&&(Ql=null),_G(n.stateNode),ho(e,yr()),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(_v)throw _v=!1,e=Hx,Hx=null,e;return bv&1&&e.tag!==0&&tf(),o=e.pendingLanes,o&1?e===qx?mp++:(mp=0,qx=e):mp=0,Eu(),null}function tf(){if(Bl!==null){var e=y9(bv),t=Zo.transition,n=an;try{if(Zo.transition=null,an=16>e?16:e,Bl===null)var r=!1;else{if(e=Bl,Bl=null,bv=0,Ft&6)throw Error(oe(331));var i=Ft;for(Ft|=4,Ie=e.current;Ie!==null;){var o=Ie,s=o.child;if(Ie.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Ie=u;Ie!==null;){var c=Ie;switch(c.tag){case 0:case 11:case 15:pp(8,c,o)}var d=c.child;if(d!==null)d.return=c,Ie=d;else for(;Ie!==null;){c=Ie;var f=c.sibling,h=c.return;if(PM(c),c===u){Ie=null;break}if(f!==null){f.return=h,Ie=f;break}Ie=h}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(m!==null)}}Ie=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Ie=s;else e:for(;Ie!==null;){if(o=Ie,o.flags&2048)switch(o.tag){case 0:case 11:case 15:pp(9,o,o.return)}var _=o.sibling;if(_!==null){_.return=o.return,Ie=_;break e}Ie=o.return}}var y=e.current;for(Ie=y;Ie!==null;){s=Ie;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,Ie=g;else e:for(s=y;Ie!==null;){if(a=Ie,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:s_(9,a)}}catch(S){lr(a,a.return,S)}if(a===s){Ie=null;break e}var v=a.sibling;if(v!==null){v.return=a.return,Ie=v;break e}Ie=a.return}}if(Ft=i,Eu(),sa&&typeof sa.onPostCommitFiberRoot=="function")try{sa.onPostCommitFiberRoot(Z1,e)}catch{}r=!0}return r}finally{an=n,Zo.transition=t}}return!1}function BA(e,t,n){t=Tf(n,t),t=vM(e,t,1),e=Xl(e,t,1),t=Wi(),e!==null&&(om(e,1,t),ho(e,t))}function lr(e,t,n){if(e.tag===3)BA(e,e,n);else for(;t!==null;){if(t.tag===3){BA(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ql===null||!Ql.has(r))){e=Tf(n,e),e=_M(t,e,1),t=Xl(t,e,1),e=Wi(),t!==null&&(om(t,1,e),ho(t,e));break}}t=t.return}}function qH(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Wi(),e.pingedLanes|=e.suspendedLanes&n,ni===e&&(bi&n)===n&&(Br===4||Br===3&&(bi&130023424)===bi&&500>yr()-D5?hc(e,0):N5|=n),ho(e,t)}function BM(e,t){t===0&&(e.mode&1?(t=iy,iy<<=1,!(iy&130023424)&&(iy=4194304)):t=1);var n=Wi();e=nl(e,t),e!==null&&(om(e,t,n),ho(e,n))}function WH(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BM(e,n)}function KH(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(oe(314))}r!==null&&r.delete(t),BM(e,n)}var zM;zM=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||co.current)so=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return so=!1,DH(e,t,n);so=!!(e.flags&131072)}else so=!1,Wn&&t.flags&1048576&&V9(t,dv,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;w0(e,t),e=t.pendingProps;var i=wf(t,Fi.current);ef(t,n),i=k5(null,t,r,e,i,n);var o=P5();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,fo(r)?(o=!0,uv(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,x5(t),i.updater=i_,t.stateNode=i,i._reactInternals=t,Nx(t,r,e,n),t=$x(null,t,r,!0,o,n)):(t.tag=0,Wn&&o&&m5(t),Hi(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(w0(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=QH(r),e=ys(r,e),i){case 0:t=Lx(null,t,r,e,n);break e;case 1:t=PA(null,t,r,e,n);break e;case 11:t=AA(null,t,r,e,n);break e;case 14:t=kA(null,t,r,ys(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),Lx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),PA(e,t,r,i,n);case 3:e:{if(xM(t),e===null)throw Error(oe(387));r=t.pendingProps,o=t.memoizedState,i=o.element,W9(e,t),pv(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=Tf(Error(oe(423)),t),t=RA(e,t,r,n,i);break e}else if(r!==i){i=Tf(Error(oe(424)),t),t=RA(e,t,r,n,i);break e}else for(ko=Kl(t.stateNode.containerInfo.firstChild),Ro=t,Wn=!0,bs=null,n=Y9(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xf(),r===i){t=rl(e,t,n);break e}Hi(e,t,r,n)}t=t.child}return t;case 5:return Z9(t),e===null&&Ox(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Tx(r,i)?s=null:o!==null&&Tx(r,o)&&(t.flags|=32),wM(e,t),Hi(e,t,s,n),t.child;case 6:return e===null&&Ox(t),null;case 13:return CM(e,t,n);case 4:return C5(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Cf(t,null,r,n):Hi(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),AA(e,t,r,i,n);case 7:return Hi(e,t,t.pendingProps,n),t.child;case 8:return Hi(e,t,t.pendingProps.children,n),t.child;case 12:return Hi(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,En(fv,r._currentValue),r._currentValue=s,o!==null)if(Ms(o.value,s)){if(o.children===i.children&&!co.current){t=rl(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=Wa(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ix(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(oe(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ix(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}Hi(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ef(t,n),i=Jo(i),r=r(i),t.flags|=1,Hi(e,t,r,n),t.child;case 14:return r=t.type,i=ys(r,t.pendingProps),i=ys(r.type,i),kA(e,t,r,i,n);case 15:return bM(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),w0(e,t),t.tag=1,fo(r)?(e=!0,uv(t)):e=!1,ef(t,n),X9(t,r,i),Nx(t,r,i,n),$x(null,t,r,!0,e,n);case 19:return EM(e,t,n);case 22:return SM(e,t,n)}throw Error(oe(156,t.tag))};function UM(e,t){return h9(e,t)}function XH(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 Qo(e,t,n,r){return new XH(e,t,n,r)}function B5(e){return e=e.prototype,!(!e||!e.isReactComponent)}function QH(e){if(typeof e=="function")return B5(e)?1:0;if(e!=null){if(e=e.$$typeof,e===i5)return 11;if(e===o5)return 14}return 2}function Zl(e,t){var n=e.alternate;return n===null?(n=Qo(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 E0(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")B5(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Md:return pc(n.children,i,o,t);case r5:s=8,i|=8;break;case ix:return e=Qo(12,n,t,i|2),e.elementType=ix,e.lanes=o,e;case ox:return e=Qo(13,n,t,i),e.elementType=ox,e.lanes=o,e;case sx:return e=Qo(19,n,t,i),e.elementType=sx,e.lanes=o,e;case QI:return l_(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case KI:s=10;break e;case XI:s=9;break e;case i5:s=11;break e;case o5:s=14;break e;case Al:s=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Qo(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function pc(e,t,n,r){return e=Qo(7,e,r,t),e.lanes=n,e}function l_(e,t,n,r){return e=Qo(22,e,r,t),e.elementType=QI,e.lanes=n,e.stateNode={isHidden:!1},e}function x2(e,t,n){return e=Qo(6,e,null,t),e.lanes=n,e}function C2(e,t,n){return t=Qo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YH(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=i2(0),this.expirationTimes=i2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i2(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function z5(e,t,n,r,i,o,s,a,l){return e=new YH(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Qo(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},x5(o),e}function ZH(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Id,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function jM(e){if(!e)return lu;e=e._reactInternals;e:{if(zc(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(fo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var n=e.type;if(fo(n))return U9(e,n,t)}return t}function VM(e,t,n,r,i,o,s,a,l){return e=z5(n,r,!0,e,i,o,s,a,l),e.context=jM(null),n=e.current,r=Wi(),i=Yl(n),o=Wa(r,i),o.callback=t??null,Xl(n,o,i),e.current.lanes=i,om(e,i,r),ho(e,r),e}function u_(e,t,n,r){var i=t.current,o=Wi(),s=Yl(i);return n=jM(n),t.context===null?t.context=n:t.pendingContext=n,t=Wa(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xl(i,t,s),e!==null&&(ks(e,i,s,o),_0(e,i,s)),s}function wv(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 zA(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function U5(e,t){zA(e,t),(e=e.alternate)&&zA(e,t)}function JH(){return null}var GM=typeof reportError=="function"?reportError:function(e){console.error(e)};function j5(e){this._internalRoot=e}c_.prototype.render=j5.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));u_(e,t,null,null)};c_.prototype.unmount=j5.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cc(function(){u_(null,e,null,null)}),t[tl]=null}};function c_(e){this._internalRoot=e}c_.prototype.unstable_scheduleHydration=function(e){if(e){var t=b9();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ml.length&&t!==0&&t<Ml[n].priority;n++);Ml.splice(n,0,e),n===0&&w9(e)}};function V5(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function UA(){}function eq(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=wv(s);o.call(u)}}var s=VM(t,r,e,0,null,!1,!1,"",UA);return e._reactRootContainer=s,e[tl]=s.current,Up(e.nodeType===8?e.parentNode:e),Cc(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=wv(l);a.call(u)}}var l=z5(e,0,!1,null,null,!1,!1,"",UA);return e._reactRootContainer=l,e[tl]=l.current,Up(e.nodeType===8?e.parentNode:e),Cc(function(){u_(t,l,n,r)}),l}function f_(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=wv(s);a.call(l)}}u_(t,s,e,i)}else s=eq(n,t,e,i,r);return wv(s)}v9=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zh(t.pendingLanes);n!==0&&(l5(t,n|1),ho(t,yr()),!(Ft&6)&&(Af=yr()+500,Eu()))}break;case 13:Cc(function(){var r=nl(e,1);if(r!==null){var i=Wi();ks(r,e,1,i)}}),U5(e,1)}};u5=function(e){if(e.tag===13){var t=nl(e,134217728);if(t!==null){var n=Wi();ks(t,e,134217728,n)}U5(e,134217728)}};_9=function(e){if(e.tag===13){var t=Yl(e),n=nl(e,t);if(n!==null){var r=Wi();ks(n,e,t,r)}U5(e,t)}};b9=function(){return an};S9=function(e,t){var n=an;try{return an=e,t()}finally{an=n}};mx=function(e,t,n){switch(t){case"input":if(ux(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=n_(r);if(!i)throw Error(oe(90));ZI(r),ux(r,i)}}}break;case"textarea":e9(e,n);break;case"select":t=n.value,t!=null&&Qd(e,!!n.multiple,t,!1)}};a9=L5;l9=Cc;var tq={usingClientEntryPoint:!1,Events:[am,$d,n_,o9,s9,L5]},Ph={findFiberByHostInstance:tc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},nq={bundleType:Ph.bundleType,version:Ph.version,rendererPackageName:Ph.rendererPackageName,rendererConfig:Ph.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ul.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=d9(e),e===null?null:e.stateNode},findFiberByHostInstance:Ph.findFiberByHostInstance||JH,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 gy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gy.isDisabled&&gy.supportsFiber)try{Z1=gy.inject(nq),sa=gy}catch{}}Lo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tq;Lo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!V5(t))throw Error(oe(200));return ZH(e,t,null,n)};Lo.createRoot=function(e,t){if(!V5(e))throw Error(oe(299));var n=!1,r="",i=GM;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=z5(e,1,!1,null,null,n,!1,r,i),e[tl]=t.current,Up(e.nodeType===8?e.parentNode:e),new j5(t)};Lo.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(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=d9(t),e=e===null?null:e.stateNode,e};Lo.flushSync=function(e){return Cc(e)};Lo.hydrate=function(e,t,n){if(!d_(t))throw Error(oe(200));return f_(null,e,t,!0,n)};Lo.hydrateRoot=function(e,t,n){if(!V5(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=GM;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=VM(t,null,e,1,n??null,i,!1,o,s),e[tl]=t.current,Up(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 c_(t)};Lo.render=function(e,t,n){if(!d_(t))throw Error(oe(200));return f_(null,e,t,!1,n)};Lo.unmountComponentAtNode=function(e){if(!d_(e))throw Error(oe(40));return e._reactRootContainer?(Cc(function(){f_(null,null,e,!1,function(){e._reactRootContainer=null,e[tl]=null})}),!0):!1};Lo.unstable_batchedUpdates=L5;Lo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!d_(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return f_(e,t,n,!1,r)};Lo.version="18.2.0-next-9e3b772b8-20220608";function HM(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HM)}catch(e){console.error(e)}}HM(),VI.exports=Lo;var ws=VI.exports;const c6e=Fc(ws);var jA=ws;nx.createRoot=jA.createRoot,nx.hydrateRoot=jA.hydrateRoot;const rq="modulepreload",iq=function(e,t){return new URL(e,t).href},VA={},qM=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=iq(o,r),o in VA)return;VA[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const d=i[c];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":rq,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};function ti(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ki(e){return!!e&&!!e[mt]}function po(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===fq}(e)||Array.isArray(e)||!!e[nf]||!!(!((t=e.constructor)===null||t===void 0)&&t[nf])||h_(e)||p_(e))}function G5(e){return Ki(e)||ti(23,e),e[mt].t}function il(e,t,n){n===void 0&&(n=!1),uu(e)===0?(n?Object.keys:rf)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function uu(e){var t=e[mt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:h_(e)?2:p_(e)?3:0}function Jl(e,t){return uu(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function T0(e,t){return uu(e)===2?e.get(t):e[t]}function WM(e,t,n){var r=uu(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function KM(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function h_(e){return cq&&e instanceof Map}function p_(e){return dq&&e instanceof Set}function Kr(e){return e.o||e.t}function H5(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=QM(e);delete t[mt];for(var n=rf(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function um(e,t){return t===void 0&&(t=!1),q5(e)||Ki(e)||!po(e)||(uu(e)>1&&(e.set=e.add=e.clear=e.delete=oq),Object.freeze(e),t&&il(e,function(n,r){return um(r,!0)},!0)),e}function oq(){ti(2)}function q5(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function la(e){var t=Qx[e];return t||ti(18,e),t}function W5(e,t){Qx[e]||(Qx[e]=t)}function Qp(){return Zp}function E2(e,t){t&&(la("Patches"),e.u=[],e.s=[],e.v=t)}function xv(e){Xx(e),e.p.forEach(sq),e.p=null}function Xx(e){e===Zp&&(Zp=e.l)}function GA(e){return Zp={p:[],l:Zp,h:e,m:!0,_:0}}function sq(e){var t=e[mt];t.i===0||t.i===1?t.j():t.g=!0}function T2(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||la("ES5").S(t,e,r),r?(n[mt].P&&(xv(t),ti(4)),po(e)&&(e=Cv(t,e),t.l||Ev(t,e)),t.u&&la("Patches").M(n[mt].t,e,t.u,t.s)):e=Cv(t,n,[]),xv(t),t.u&&t.v(t.u,t.s),e!==m_?e:void 0}function Cv(e,t,n){if(q5(t))return t;var r=t[mt];if(!r)return il(t,function(a,l){return HA(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ev(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=H5(r.k):r.o,o=i,s=!1;r.i===3&&(o=new Set(i),i.clear(),s=!0),il(o,function(a,l){return HA(e,r,i,a,l,n,s)}),Ev(e,i,!1),n&&e.u&&la("Patches").N(r,n,e.u,e.s)}return r.o}function HA(e,t,n,r,i,o,s){if(Ki(i)){var a=Cv(e,i,o&&t&&t.i!==3&&!Jl(t.R,r)?o.concat(r):void 0);if(WM(n,r,a),!Ki(a))return;e.m=!1}else s&&n.add(i);if(po(i)&&!q5(i)){if(!e.h.D&&e._<1)return;Cv(e,i),t&&t.A.l||Ev(e,i)}}function Ev(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&um(t,n)}function A2(e,t){var n=e[mt];return(n?Kr(n):e)[t]}function qA(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function oo(e){e.P||(e.P=!0,e.l&&oo(e.l))}function k2(e){e.o||(e.o=H5(e.t))}function Yp(e,t,n){var r=h_(t)?la("MapSet").F(t,n):p_(t)?la("MapSet").T(t,n):e.O?function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:Qp(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=a,u=Jp;s&&(l=[a],u=ep);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return a.k=f,a.j=d,f}(t,n):la("ES5").J(t,n);return(n?n.A:Qp()).p.push(r),r}function g_(e){return Ki(e)||ti(22,e),function t(n){if(!po(n))return n;var r,i=n[mt],o=uu(n);if(i){if(!i.P&&(i.i<4||!la("ES5").K(i)))return i.t;i.I=!0,r=WA(n,o),i.I=!1}else r=WA(n,o);return il(r,function(s,a){i&&T0(i.t,s)===a||WM(r,s,t(a))}),o===3?new Set(r):r}(e)}function WA(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return H5(e)}function K5(){function e(o,s){var a=i[o];return a?a.enumerable=s:i[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[mt];return Jp.get(l,o)},set:function(l){var u=this[mt];Jp.set(u,o,l)}},a}function t(o){for(var s=o.length-1;s>=0;s--){var a=o[s][mt];if(!a.P)switch(a.i){case 5:r(a)&&oo(a);break;case 4:n(a)&&oo(a)}}}function n(o){for(var s=o.t,a=o.k,l=rf(a),u=l.length-1;u>=0;u--){var c=l[u];if(c!==mt){var d=s[c];if(d===void 0&&!Jl(s,c))return!0;var f=a[c],h=f&&f[mt];if(h?h.t!==d:!KM(f,d))return!0}}var p=!!s[mt];return l.length!==rf(s).length+(p?0:1)}function r(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l<s.length;l++)if(!s.hasOwnProperty(l))return!0;return!1}var i={};W5("ES5",{J:function(o,s){var a=Array.isArray(o),l=function(c,d){if(c){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var p=QM(d);delete p[mt];for(var m=rf(p),b=0;b<m.length;b++){var _=m[b];p[_]=e(_,c||!!p[_].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(a,o),u={i:a?5:4,A:s?s.A:Qp(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,mt,{value:u,writable:!0}),l},S:function(o,s,a){a?Ki(s)&&s[mt].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[mt];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)il(f,function(g){g!==mt&&(d[g]!==void 0||Jl(d,g)?h[g]||l(f[g]):(h[g]=!0,oo(c)))}),il(d,function(g){f[g]!==void 0||Jl(f,g)||(h[g]=!1,oo(c))});else if(p===5){if(r(c)&&(oo(c),h.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)h[m]=!1;else for(var b=d.length;b<f.length;b++)h[b]=!0;for(var _=Math.min(f.length,d.length),y=0;y<_;y++)f.hasOwnProperty(y)||(h[y]=!0),h[y]===void 0&&l(f[y])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function X5(){function e(r){if(!po(r))return r;if(Array.isArray(r))return r.map(e);if(h_(r))return new Map(Array.from(r.entries()).map(function(s){return[s[0],e(s[1])]}));if(p_(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var o in r)i[o]=e(r[o]);return Jl(r,nf)&&(i[nf]=r[nf]),i}function t(r){return Ki(r)?e(r):r}var n="add";W5("Patches",{$:function(r,i){return i.forEach(function(o){for(var s=o.path,a=o.op,l=r,u=0;u<s.length-1;u++){var c=uu(l),d=s[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||ti(24),typeof l=="function"&&d==="prototype"&&ti(24),typeof(l=T0(l,d))!="object"&&ti(15,s.join("/"))}var f=uu(l),h=e(o.value),p=s[s.length-1];switch(a){case"replace":switch(f){case 2:return l.set(p,h);case 3:ti(16);default:return l[p]=h}case n:switch(f){case 1:return p==="-"?l.push(h):l.splice(p,0,h);case 2:return l.set(p,h);case 3:return l.add(h);default:return l[p]=h}case"remove":switch(f){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:ti(17,a)}}),r},N:function(r,i,o,s){switch(r.i){case 0:case 4:case 2:return function(a,l,u,c){var d=a.t,f=a.o;il(a.R,function(h,p){var m=T0(d,h),b=T0(f,h),_=p?Jl(d,h)?"replace":n:"remove";if(m!==b||_!=="replace"){var y=l.concat(h);u.push(_==="remove"?{op:_,path:y}:{op:_,path:y,value:b}),c.push(_===n?{op:"remove",path:y}:_==="remove"?{op:n,path:y,value:t(m)}:{op:"replace",path:y,value:t(m)})}})}(r,i,o,s);case 5:case 1:return function(a,l,u,c){var d=a.t,f=a.R,h=a.o;if(h.length<d.length){var p=[h,d];d=p[0],h=p[1];var m=[c,u];u=m[0],c=m[1]}for(var b=0;b<d.length;b++)if(f[b]&&h[b]!==d[b]){var _=l.concat([b]);u.push({op:"replace",path:_,value:t(h[b])}),c.push({op:"replace",path:_,value:t(d[b])})}for(var y=d.length;y<h.length;y++){var g=l.concat([y]);u.push({op:n,path:g,value:t(h[y])})}d.length<h.length&&c.push({op:"replace",path:l.concat(["length"]),value:d.length})}(r,i,o,s);case 3:return function(a,l,u,c){var d=a.t,f=a.o,h=0;d.forEach(function(p){if(!f.has(p)){var m=l.concat([h]);u.push({op:"remove",path:m,value:p}),c.unshift({op:n,path:m,value:p})}h++}),h=0,f.forEach(function(p){if(!d.has(p)){var m=l.concat([h]);u.push({op:n,path:m,value:p}),c.unshift({op:"remove",path:m,value:p})}h++})}(r,i,o,s)}},M:function(r,i,o,s){o.push({op:"replace",path:[],value:i===m_?void 0:i}),s.push({op:"replace",path:[],value:r})}})}function XM(){function e(a,l){function u(){this.constructor=a}i(a,l),a.prototype=(u.prototype=l.prototype,new u)}function t(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function n(a){a.o||(a.o=new Set,a.t.forEach(function(l){if(po(l)){var u=Yp(a.A.h,l,a);a.p.set(l,u),a.o.add(u)}else a.o.add(l)}))}function r(a){a.g&&ti(3,JSON.stringify(Kr(a)))}var i=function(a,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)c.hasOwnProperty(d)&&(u[d]=c[d])})(a,l)},o=function(){function a(u,c){return this[mt]={i:2,l:c,A:c?c.A:Qp(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(a,Map);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Kr(this[mt]).size}}),l.has=function(u){return Kr(this[mt]).has(u)},l.set=function(u,c){var d=this[mt];return r(d),Kr(d).has(u)&&Kr(d).get(u)===c||(t(d),oo(d),d.R.set(u,!0),d.o.set(u,c),d.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[mt];return r(c),t(c),oo(c),c.t.has(u)?c.R.set(u,!1):c.R.delete(u),c.o.delete(u),!0},l.clear=function(){var u=this[mt];r(u),Kr(u).size&&(t(u),oo(u),u.R=new Map,il(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;Kr(this[mt]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[mt];r(c);var d=Kr(c).get(u);if(c.I||!po(d)||d!==c.t.get(u))return d;var f=Yp(c.A.h,d,c);return t(c),c.o.set(u,f),f},l.keys=function(){return Kr(this[mt]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[my]=function(){return c.values()},u.next=function(){var f=d.next();return f.done?f:{done:!1,value:c.get(f.value)}},u},l.entries=function(){var u,c=this,d=this.keys();return(u={})[my]=function(){return c.entries()},u.next=function(){var f=d.next();if(f.done)return f;var h=c.get(f.value);return{done:!1,value:[f.value,h]}},u},l[my]=function(){return this.entries()},a}(),s=function(){function a(u,c){return this[mt]={i:3,l:c,A:c?c.A:Qp(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(a,Set);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Kr(this[mt]).size}}),l.has=function(u){var c=this[mt];return r(c),c.o?!!c.o.has(u)||!(!c.p.has(u)||!c.o.has(c.p.get(u))):c.t.has(u)},l.add=function(u){var c=this[mt];return r(c),this.has(u)||(n(c),oo(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[mt];return r(c),n(c),oo(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[mt];r(u),Kr(u).size&&(n(u),oo(u),u.o.clear())},l.values=function(){var u=this[mt];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[mt];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[my]=function(){return this.values()},l.forEach=function(u,c){for(var d=this.values(),f=d.next();!f.done;)u.call(c,f.value,f.value,this),f=d.next()},a}();W5("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function aq(){K5(),XM(),X5()}function lq(e){return e}function uq(e){return e}var KA,Zp,Q5=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",cq=typeof Map<"u",dq=typeof Set<"u",XA=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",m_=Q5?Symbol.for("immer-nothing"):((KA={})["immer-nothing"]=!0,KA),nf=Q5?Symbol.for("immer-draftable"):"__$immer_draftable",mt=Q5?Symbol.for("immer-state"):"__$immer_state",my=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",fq=""+Object.prototype.constructor,rf=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,QM=Object.getOwnPropertyDescriptors||function(e){var t={};return rf(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Qx={},Jp={get:function(e,t){if(t===mt)return e;var n=Kr(e);if(!Jl(n,t))return function(i,o,s){var a,l=qA(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!po(r)?r:r===A2(e.t,t)?(k2(e),e.o[t]=Yp(e.A.h,r,e)):r},has:function(e,t){return t in Kr(e)},ownKeys:function(e){return Reflect.ownKeys(Kr(e))},set:function(e,t,n){var r=qA(Kr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=A2(Kr(e),t),o=i==null?void 0:i[mt];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(KM(n,i)&&(n!==void 0||Jl(e.t,t)))return!0;k2(e),oo(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return A2(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,k2(e),oo(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Kr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){ti(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ti(12)}},ep={};il(Jp,function(e,t){ep[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ep.deleteProperty=function(e,t){return ep.set.call(this,e,t,void 0)},ep.set=function(e,t,n){return Jp.set.call(this,e[0],t,n,e[0])};var YM=function(){function e(n){var r=this;this.O=XA,this.D=!0,this.produce=function(i,o,s){if(typeof i=="function"&&typeof o!="function"){var a=o;o=i;var l=r;return function(m){var b=this;m===void 0&&(m=a);for(var _=arguments.length,y=Array(_>1?_-1:0),g=1;g<_;g++)y[g-1]=arguments[g];return l.produce(m,function(v){var S;return(S=o).call.apply(S,[b,v].concat(y))})}}var u;if(typeof o!="function"&&ti(6),s!==void 0&&typeof s!="function"&&ti(7),po(i)){var c=GA(r),d=Yp(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?xv(c):Xx(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(m){return E2(c,s),T2(m,c)},function(m){throw xv(c),m}):(E2(c,s),T2(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===m_&&(u=void 0),r.D&&um(u,!0),s){var h=[],p=[];la("Patches").M(i,u,h,p),s(h,p)}return u}ti(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return r.produceWithPatches(u,function(h){return i.apply(void 0,[h].concat(d))})};var s,a,l=r.produce(i,o,function(u,c){s=u,a=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){po(n)||ti(8),Ki(n)&&(n=g_(n));var r=GA(this),i=Yp(this,n,void 0);return i[mt].C=!0,Xx(r),i},t.finishDraft=function(n,r){var i=n&&n[mt],o=i.A;return E2(o,r),T2(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!XA&&ti(20),this.O=n},t.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var s=la("Patches").$;return Ki(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Mo=new YM,ZM=Mo.produce,Y5=Mo.produceWithPatches.bind(Mo),hq=Mo.setAutoFreeze.bind(Mo),pq=Mo.setUseProxies.bind(Mo),Yx=Mo.applyPatches.bind(Mo),gq=Mo.createDraft.bind(Mo),mq=Mo.finishDraft.bind(Mo);const Tu=ZM,yq=Object.freeze(Object.defineProperty({__proto__:null,Immer:YM,applyPatches:Yx,castDraft:lq,castImmutable:uq,createDraft:gq,current:g_,default:Tu,enableAllPlugins:aq,enableES5:K5,enableMapSet:XM,enablePatches:X5,finishDraft:mq,freeze:um,immerable:nf,isDraft:Ki,isDraftable:po,nothing:m_,original:G5,produce:ZM,produceWithPatches:Y5,setAutoFreeze:hq,setUseProxies:pq},Symbol.toStringTag,{value:"Module"}));function eg(e){"@babel/helpers - typeof";return eg=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},eg(e)}function vq(e,t){if(eg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(eg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _q(e){var t=vq(e,"string");return eg(t)==="symbol"?t:String(t)}function bq(e,t,n){return t=_q(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QA(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 YA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QA(Object(n),!0).forEach(function(r){bq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gi(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 ZA=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),P2=function(){return Math.random().toString(36).substring(7).split("").join(".")},kf={INIT:"@@redux/INIT"+P2(),REPLACE:"@@redux/REPLACE"+P2(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+P2()}};function Sq(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function cm(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(gi(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(gi(1));return n(cm)(e,t)}if(typeof e!="function")throw new Error(gi(2));var i=e,o=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(gi(3));return o}function d(m){if(typeof m!="function")throw new Error(gi(4));if(l)throw new Error(gi(5));var b=!0;return u(),a.push(m),function(){if(b){if(l)throw new Error(gi(6));b=!1,u();var y=a.indexOf(m);a.splice(y,1),s=null}}}function f(m){if(!Sq(m))throw new Error(gi(7));if(typeof m.type>"u")throw new Error(gi(8));if(l)throw new Error(gi(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var b=s=a,_=0;_<b.length;_++){var y=b[_];y()}return m}function h(m){if(typeof m!="function")throw new Error(gi(10));i=m,f({type:kf.REPLACE})}function p(){var m,b=d;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(gi(11));function g(){y.next&&y.next(c())}g();var v=b(g);return{unsubscribe:v}}},m[ZA]=function(){return this},m}return f({type:kf.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[ZA]=p,r}var JM=cm;function wq(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:kf.INIT});if(typeof r>"u")throw new Error(gi(12));if(typeof n(void 0,{type:kf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(gi(13))})}function th(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]=="function"&&(n[i]=e[i])}var o=Object.keys(n),s;try{wq(n)}catch(a){s=a}return function(l,u){if(l===void 0&&(l={}),s)throw s;for(var c=!1,d={},f=0;f<o.length;f++){var h=o[f],p=n[h],m=l[h],b=p(m,u);if(typeof b>"u")throw u&&u.type,new Error(gi(14));d[h]=b,c=c||b!==m}return c=c||o.length!==Object.keys(l).length,c?d:l}}function JA(e,t){return function(){return t(e.apply(this,arguments))}}function eN(e,t){if(typeof e=="function")return JA(e,t);if(typeof e!="object"||e===null)throw new Error(gi(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=JA(i,t))}return n}function Pf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function Z5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(gi(15))},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return o=Pf.apply(void 0,a)(i.dispatch),YA(YA({},i),{},{dispatch:o})}}}const xq=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:kf,applyMiddleware:Z5,bindActionCreators:eN,combineReducers:th,compose:Pf,createStore:cm,legacy_createStore:JM},Symbol.toStringTag,{value:"Module"}));var Tv="NOT_FOUND";function Cq(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Tv},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function Eq(e,t){var n=[];function r(a){var l=n.findIndex(function(c){return t(a,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Tv}function i(a,l){r(a)===Tv&&(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 tN=function(t,n){return t===n};function Tq(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function Av(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?tN:r,o=n.maxSize,s=o===void 0?1:o,a=n.resultEqualityCheck,l=Tq(i),u=s===1?Cq(l):Eq(s,l);function c(){var d=u.get(arguments);if(d===Tv){if(d=e.apply(null,arguments),a){var f=u.getEntries(),h=f.find(function(p){return a(p.value,d)});h&&(d=h.value)}u.put(arguments,d)}return d}return c.clearCache=function(){return u.clear()},c}function Aq(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function nN(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];var u=0,c,d={memoizeOptions:void 0},f=a.pop();if(typeof f=="object"&&(d=f,f=a.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,p=h.memoizeOptions,m=p===void 0?n:p,b=Array.isArray(m)?m:[m],_=Aq(a),y=e.apply(void 0,[function(){return u++,f.apply(null,arguments)}].concat(b)),g=e(function(){for(var S=[],w=_.length,x=0;x<w;x++)S.push(_[x].apply(null,arguments));return c=y.apply(null,S),c});return Object.assign(g,{resultFunc:f,memoizedResultFunc:y,dependencies:_,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),g};return i}var $i=nN(Av),kq=function(t,n){if(n===void 0&&(n=$i),typeof t!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof t));var r=Object.keys(t),i=n(r.map(function(o){return t[o]}),function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return s.reduce(function(l,u,c){return l[r[c]]=u,l},{})});return i};const Pq=Object.freeze(Object.defineProperty({__proto__:null,createSelector:$i,createSelectorCreator:nN,createStructuredSelector:kq,defaultEqualityCheck:tN,defaultMemoize:Av},Symbol.toStringTag,{value:"Module"}));function rN(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,e):s(a)}}};return t}var iN=rN();iN.withExtraArgument=rN;const ek=iN;var oN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dm=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},cu=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Rq=Object.defineProperty,Oq=Object.defineProperties,Iq=Object.getOwnPropertyDescriptors,tk=Object.getOwnPropertySymbols,Mq=Object.prototype.hasOwnProperty,Nq=Object.prototype.propertyIsEnumerable,nk=function(e,t,n){return t in e?Rq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ao=function(e,t){for(var n in t||(t={}))Mq.call(t,n)&&nk(e,n,t[n]);if(tk)for(var r=0,i=tk(t);r<i.length;r++){var n=i[r];Nq.call(t,n)&&nk(e,n,t[n])}return e},R2=function(e,t){return Oq(e,Iq(t))},fm=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{a(n.next(l))}catch(u){i(u)}},s=function(l){try{a(n.throw(l))}catch(u){i(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,s)};a((n=n.apply(e,t)).next())})},Ia=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=$i.apply(void 0,e),r=function(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return n.apply(void 0,cu([Ki(i)?g_(i):i],o))};return r},Dq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pf:Pf.apply(null,arguments)};function Ns(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var sN=function(e){oN(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,cu([void 0],n[0].concat(this)))):new(t.bind.apply(t,cu([void 0],n.concat(this))))},t}(Array),aN=function(e){oN(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,cu([void 0],n[0].concat(this)))):new(t.bind.apply(t,cu([void 0],n.concat(this))))},t}(Array);function Zx(e){return po(e)?Tu(e,function(){}):e}function Lq(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function $q(e){return function(){return function(t){return function(n){return t(n)}}}}function lN(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||Ns(e)}function uN(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=lN),i===void 0&&(i=[]);var s;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var a=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(b,_){var y=t?t+"."+b:b;if(l){var g=i.some(function(v){return v instanceof RegExp?v.test(y):y===v});if(g)return"continue"}if(!n(_))return{value:{keyPath:y,value:_}};if(typeof _=="object"&&(s=uN(_,y,n,r,i,o),s))return{value:s}},c=0,d=a;c<d.length;c++){var f=d[c],h=f[0],p=f[1],m=u(h,p);if(typeof m=="object")return m.value}return o&&cN(e)&&o.add(e),!1}function cN(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if(!(typeof r!="object"||r===null)&&!cN(r))return!1}return!0}function Fq(e){return function(){return function(t){return function(n){return t(n)}}}}function Bq(e){return typeof e=="boolean"}function zq(){return function(t){return dN(t)}}function dN(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new sN;return n&&(Bq(n)?r.push(ek):r.push(ek.withExtraArgument(n.extraArgument))),r}var Uq=!0;function fN(e){var t=zq(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,s=o===void 0?t():o,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,d=n.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(Ns(i))h=th(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var p=s;typeof p=="function"&&(p=p(t));var m=Z5.apply(void 0,p),b=Pf;l&&(b=Dq(ao({trace:!Uq},typeof l=="object"&&l)));var _=new aN(m),y=_;Array.isArray(f)?y=cu([m],f):typeof f=="function"&&(y=f(_));var g=b.apply(void 0,y);return cm(h,c,g)}function Me(e,t){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return ao(ao({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function J5(e){return Ns(e)&&"type"in e}function hN(e){return J5(e)&&typeof e.type=="string"&&Object.keys(e).every(jq)}function jq(e){return["type","payload","error","meta"].indexOf(e)>-1}function Vq(e){return""+e}function pN(e){var t={},n=[],r,i={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,i},addMatcher:function(o,s){return n.push({matcher:o,reducer:s}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function Gq(e){return typeof e=="function"}function gN(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?pN(t):[t,n,r],o=i[0],s=i[1],a=i[2],l;if(Gq(e))l=function(){return Zx(e())};else{var u=Zx(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=cu([o[f.type]],s.filter(function(p){var m=p.matcher;return m(f)}).map(function(p){var m=p.reducer;return m}));return h.filter(function(p){return!!p}).length===0&&(h=[a]),h.reduce(function(p,m){if(m)if(Ki(p)){var b=p,_=m(b,f);return _===void 0?p:_}else{if(po(p))return Tu(p,function(y){return m(y,f)});var _=m(p,f);if(_===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return p},d)}return c.getInitialState=l,c}function Hq(e,t){return e+"/"+t}function tr(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:Zx(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},s={},a={};i.forEach(function(c){var d=r[c],f=Hq(t,c),h,p;"reducer"in d?(h=d.reducer,p=d.prepare):h=d,o[c]=h,s[f]=h,a[c]=p?Me(f,p):Me(f)});function l(){var c=typeof e.extraReducers=="function"?pN(e.extraReducers):[e.extraReducers],d=c[0],f=d===void 0?{}:d,h=c[1],p=h===void 0?[]:h,m=c[2],b=m===void 0?void 0:m,_=ao(ao({},f),s);return gN(n,function(y){for(var g in _)y.addCase(g,_[g]);for(var v=0,S=p;v<S.length;v++){var w=S[v];y.addMatcher(w.matcher,w.reducer)}b&&y.addDefaultCase(b)})}var u;return{name:t,reducer:function(c,d){return u||(u=l()),u(c,d)},actions:a,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function qq(){return{ids:[],entities:{}}}function Wq(){function e(t){return t===void 0&&(t={}),Object.assign(qq(),t)}return{getInitialState:e}}function Kq(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=Ia(n,r,function(u,c){return u.map(function(d){return c[d]})}),o=function(u,c){return c},s=function(u,c){return u[c]},a=Ia(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:a,selectById:Ia(r,o,s)};var l=Ia(t,r);return{selectIds:Ia(t,n),selectEntities:l,selectAll:Ia(t,i),selectTotal:Ia(t,a),selectById:Ia(l,o,s)}}return{getSelectors:e}}function Xq(e){var t=gr(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function gr(e){return function(n,r){function i(s){return hN(s)}var o=function(s){i(r)?e(r.payload,s):e(r,s)};return Ki(n)?(o(n),n):Tu(n,o)}}function yp(e,t){var n=t(e);return n}function gc(e){return Array.isArray(e)||(e=Object.values(e)),e}function mN(e,t,n){e=gc(e);for(var r=[],i=[],o=0,s=e;o<s.length;o++){var a=s[o],l=yp(a,t);l in n.entities?i.push({id:l,changes:a}):r.push(a)}return[r,i]}function yN(e){function t(p,m){var b=yp(p,e);b in m.entities||(m.ids.push(b),m.entities[b]=p)}function n(p,m){p=gc(p);for(var b=0,_=p;b<_.length;b++){var y=_[b];t(y,m)}}function r(p,m){var b=yp(p,e);b in m.entities||m.ids.push(b),m.entities[b]=p}function i(p,m){p=gc(p);for(var b=0,_=p;b<_.length;b++){var y=_[b];r(y,m)}}function o(p,m){p=gc(p),m.ids=[],m.entities={},n(p,m)}function s(p,m){return a([p],m)}function a(p,m){var b=!1;p.forEach(function(_){_ in m.entities&&(delete m.entities[_],b=!0)}),b&&(m.ids=m.ids.filter(function(_){return _ in m.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function u(p,m,b){var _=b.entities[m.id],y=Object.assign({},_,m.changes),g=yp(y,e),v=g!==m.id;return v&&(p[m.id]=g,delete b.entities[m.id]),b.entities[g]=y,v}function c(p,m){return d([p],m)}function d(p,m){var b={},_={};p.forEach(function(v){v.id in m.entities&&(_[v.id]={id:v.id,changes:ao(ao({},_[v.id]?_[v.id].changes:null),v.changes)})}),p=Object.values(_);var y=p.length>0;if(y){var g=p.filter(function(v){return u(b,v,m)}).length>0;g&&(m.ids=Object.keys(m.entities))}}function f(p,m){return h([p],m)}function h(p,m){var b=mN(p,e,m),_=b[0],y=b[1];d(y,m),n(_,m)}return{removeAll:Xq(l),addOne:gr(t),addMany:gr(n),setOne:gr(r),setMany:gr(i),setAll:gr(o),updateOne:gr(c),updateMany:gr(d),upsertOne:gr(f),upsertMany:gr(h),removeOne:gr(s),removeMany:gr(a)}}function Qq(e,t){var n=yN(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function s(y,g){return a([y],g)}function a(y,g){y=gc(y);var v=y.filter(function(S){return!(yp(S,e)in g.entities)});v.length!==0&&b(v,g)}function l(y,g){return u([y],g)}function u(y,g){y=gc(y),y.length!==0&&b(y,g)}function c(y,g){y=gc(y),g.entities={},g.ids=[],a(y,g)}function d(y,g){return f([y],g)}function f(y,g){for(var v=!1,S=0,w=y;S<w.length;S++){var x=w[S],C=g.entities[x.id];if(C){v=!0,Object.assign(C,x.changes);var A=e(C);x.id!==A&&(delete g.entities[x.id],g.entities[A]=C)}}v&&_(g)}function h(y,g){return p([y],g)}function p(y,g){var v=mN(y,e,g),S=v[0],w=v[1];f(w,g),a(S,g)}function m(y,g){if(y.length!==g.length)return!1;for(var v=0;v<y.length&&v<g.length;v++)if(y[v]!==g[v])return!1;return!0}function b(y,g){y.forEach(function(v){g.entities[e(v)]=v}),_(g)}function _(y){var g=Object.values(y.entities);g.sort(t);var v=g.map(e),S=y.ids;m(S,v)||(y.ids=v)}return{removeOne:r,removeMany:i,removeAll:o,addOne:gr(s),updateOne:gr(d),upsertOne:gr(h),setOne:gr(l),setMany:gr(u),setAll:gr(c),addMany:gr(a),updateMany:gr(f),upsertMany:gr(p)}}function cl(e){e===void 0&&(e={});var t=ao({sortComparer:!1,selectId:function(a){return a.id}},e),n=t.selectId,r=t.sortComparer,i=Wq(),o=Kq(),s=r?Qq(n,r):yN(n);return ao(ao(ao({selectId:n,sortComparer:r},i),o),s)}var Yq="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",y_=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=Yq[Math.random()*64|0];return t},Zq=["name","message","stack","code"],O2=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),rk=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),vN=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=Zq;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},du=function(){function e(t,n,r){var i=Me(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:R2(ao({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=Me(t+"/pending",function(u,c,d){return{payload:void 0,meta:R2(ao({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),s=Me(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||vN)(u||"Rejected"),meta:R2(ao({},h||{}),{arg:d,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),a=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function l(u){return function(c,d,f){var h=r!=null&&r.idGenerator?r.idGenerator(u):y_(),p=new a,m;function b(y){m=y,p.abort()}var _=function(){return fm(this,null,function(){var y,g,v,S,w,x,C;return dm(this,function(A){switch(A.label){case 0:return A.trys.push([0,4,,5]),S=(y=r==null?void 0:r.condition)==null?void 0:y.call(r,u,{getState:d,extra:f}),Jq(S)?[4,S]:[3,2];case 1:S=A.sent(),A.label=2;case 2:if(S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=new Promise(function(T,k){return p.signal.addEventListener("abort",function(){return k({name:"AbortError",message:m||"Aborted"})})}),c(o(h,u,(g=r==null?void 0:r.getPendingMeta)==null?void 0:g.call(r,{requestId:h,arg:u},{getState:d,extra:f}))),[4,Promise.race([w,Promise.resolve(n(u,{dispatch:c,getState:d,extra:f,requestId:h,signal:p.signal,abort:b,rejectWithValue:function(T,k){return new O2(T,k)},fulfillWithValue:function(T,k){return new rk(T,k)}})).then(function(T){if(T instanceof O2)throw T;return T instanceof rk?i(T.payload,h,u,T.meta):i(T,h,u)})])];case 3:return v=A.sent(),[3,5];case 4:return x=A.sent(),v=x instanceof O2?s(null,h,u,x.payload,x.meta):s(x,h,u),[3,5];case 5:return C=r&&!r.dispatchConditionRejection&&s.match(v)&&v.meta.condition,C||c(v),[2,v]}})})}();return Object.assign(_,{abort:b,requestId:h,arg:u,unwrap:function(){return _.then(_N)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function _N(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Jq(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var eW=function(e){return e&&typeof e.match=="function"},bN=function(e,t){return eW(e)?e.match(t):e(t)};function is(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return bN(r,n)})}}function of(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return bN(r,n)})}}function v_(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function hm(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function __(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return v_(n,["pending"])}:hm(e)?function(n){var r=e.map(function(o){return o.pending}),i=is.apply(void 0,r);return i(n)}:__()(e[0])}function Rf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return v_(n,["rejected"])}:hm(e)?function(n){var r=e.map(function(o){return o.rejected}),i=is.apply(void 0,r);return i(n)}:Rf()(e[0])}function pm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r&&r.meta&&r.meta.rejectedWithValue};return e.length===0?function(r){var i=of(Rf.apply(void 0,e),n);return i(r)}:hm(e)?function(r){var i=of(Rf.apply(void 0,e),n);return i(r)}:pm()(e[0])}function Au(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return v_(n,["fulfilled"])}:hm(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=is.apply(void 0,r);return i(n)}:Au()(e[0])}function kv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return v_(n,["pending","fulfilled","rejected"])}:hm(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var s=o[i];r.push(s.pending,s.rejected,s.fulfilled)}var a=is.apply(void 0,r);return a(n)}:kv()(e[0])}var eE=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},Jx=function(){},SN=function(e,t){return t===void 0&&(t=Jx),e.catch(t),e},wN=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},sf=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},tW="task",xN="listener",CN="completed",tE="cancelled",nW="task-"+tE,rW="task-"+CN,EN=xN+"-"+tE,iW=xN+"-"+CN,gm=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=tW+" "+tE+" (reason: "+t+")"}return e}(),af=function(e){if(e.aborted)throw new gm(e.reason)};function TN(e,t){var n=Jx;return new Promise(function(r,i){var o=function(){return i(new gm(e.reason))};if(e.aborted){o();return}n=wN(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=Jx})}var oW=function(e,t){return fm(void 0,null,function(){var n,r;return dm(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,e()];case 2:return n=i.sent(),[2,{status:"ok",value:n}];case 3:return r=i.sent(),[2,{status:r instanceof gm?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},Pv=function(e){return function(t){return SN(TN(e,t).then(function(n){return af(e),n}))}},AN=function(e){var t=Pv(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},sW=Object.assign,ik={},mm="listenerMiddleware",aW=function(e){var t=function(n){return wN(e,function(){return sf(n,e.reason)})};return function(n){eE(n,"taskExecutor");var r=new AbortController;t(r);var i=oW(function(){return fm(void 0,null,function(){var o;return dm(this,function(s){switch(s.label){case 0:return af(e),af(r.signal),[4,n({pause:Pv(r.signal),delay:AN(r.signal),signal:r.signal})];case 1:return o=s.sent(),af(r.signal),[2,o]}})})},function(){return sf(r,rW)});return{result:Pv(e)(i),cancel:function(){sf(r,nW)}}}},lW=function(e,t){var n=function(r,i){return fm(void 0,null,function(){var o,s,a,l;return dm(this,function(u){switch(u.label){case 0:af(t),o=function(){},s=new Promise(function(c,d){var f=e({predicate:r,effect:function(h,p){p.unsubscribe(),c([h,p.getState(),p.getOriginalState()])}});o=function(){f(),d()}}),a=[s],i!=null&&a.push(new Promise(function(c){return setTimeout(c,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,TN(t,Promise.race(a))];case 2:return l=u.sent(),af(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return SN(n(r,i))}},kN=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=Me(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return eE(o,"options.listener"),{predicate:i,type:t,effect:o}},uW=function(e){var t=kN(e),n=t.type,r=t.predicate,i=t.effect,o=y_(),s={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},eC=function(e){e.pending.forEach(function(t){sf(t,EN)})},cW=function(e){return function(){e.forEach(eC),e.clear()}},ok=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},PN=Me(mm+"/add"),RN=Me(mm+"/removeAll"),ON=Me(mm+"/remove"),dW=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,cu([mm+"/error"],e))};function IN(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?dW:i;eE(o,"onError");var s=function(h){return h.unsubscribe=function(){return n.delete(h.id)},n.set(h.id,h),function(p){h.unsubscribe(),p!=null&&p.cancelActive&&eC(h)}},a=function(h){for(var p=0,m=Array.from(n.values());p<m.length;p++){var b=m[p];if(h(b))return b}},l=function(h){var p=a(function(m){return m.effect===h.effect});return p||(p=uW(h)),s(p)},u=function(h){var p=kN(h),m=p.type,b=p.effect,_=p.predicate,y=a(function(g){var v=typeof m=="string"?g.type===m:g.predicate===_;return v&&g.effect===b});return y&&(y.unsubscribe(),h.cancelActive&&eC(y)),!!y},c=function(h,p,m,b){return fm(t,null,function(){var _,y,g;return dm(this,function(v){switch(v.label){case 0:_=new AbortController,y=lW(l,_.signal),v.label=1;case 1:return v.trys.push([1,3,4,5]),h.pending.add(_),[4,Promise.resolve(h.effect(p,sW({},m,{getOriginalState:b,condition:function(S,w){return y(S,w).then(Boolean)},take:y,delay:AN(_.signal),pause:Pv(_.signal),extra:r,signal:_.signal,fork:aW(_.signal),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(S,w,x){S!==_&&(sf(S,EN),x.delete(S))})}})))];case 2:return v.sent(),[3,5];case 3:return g=v.sent(),g instanceof gm||ok(o,g,{raisedBy:"effect"}),[3,5];case 4:return sf(_,iW),h.pending.delete(_),[7];case 5:return[2]}})})},d=cW(n),f=function(h){return function(p){return function(m){if(!J5(m))return p(m);if(PN.match(m))return l(m.payload);if(RN.match(m)){d();return}if(ON.match(m))return u(m.payload);var b=h.getState(),_=function(){if(b===ik)throw new Error(mm+": getOriginalState can only be called synchronously");return b},y;try{if(y=p(m),n.size>0)for(var g=h.getState(),v=Array.from(n.values()),S=0,w=v;S<w.length;S++){var x=w[S],C=!1;try{C=x.predicate(m,g,b)}catch(A){C=!1,ok(o,A,{raisedBy:"predicate"})}C&&c(x,m,h,_)}}finally{b=ik}return y}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var ic="RTK_autoBatch",A0=function(){return function(e){var t;return{payload:e,meta:(t={},t[ic]=!0,t)}}},sk,fW=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(sk||(sk=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},MN=function(e){return function(t){setTimeout(t,e)}},hW=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:MN(10),NN=function(e){return e===void 0&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(void 0,n),o=!0,s=!1,a=!1,l=new Set,u=e.type==="tick"?fW:e.type==="raf"?hW:e.type==="callback"?e.queueNotification:MN(e.timeout),c=function(){a=!1,s&&(s=!1,l.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return o&&d()},h=i.subscribe(f);return l.add(d),function(){h(),l.delete(d)}},dispatch:function(d){var f;try{return o=!((f=d==null?void 0:d.meta)!=null&&f[ic]),s=!o,s&&(a||(a=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};K5();const pW=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:aN,MiddlewareArray:sN,SHOULD_AUTOBATCH:ic,TaskAbortError:gm,__DO_NOT_USE__ActionTypes:kf,addListener:PN,applyMiddleware:Z5,autoBatchEnhancer:NN,bindActionCreators:eN,clearAllListeners:RN,combineReducers:th,compose:Pf,configureStore:fN,createAction:Me,createAsyncThunk:du,createDraftSafeSelector:Ia,createEntityAdapter:cl,createImmutableStateInvariantMiddleware:$q,createListenerMiddleware:IN,createNextState:Tu,createReducer:gN,createSelector:$i,createSerializableStateInvariantMiddleware:Fq,createSlice:tr,createStore:cm,current:g_,findNonSerializableValue:uN,freeze:um,getDefaultMiddleware:dN,getType:Vq,isAction:J5,isAllOf:of,isAnyOf:is,isAsyncThunkAction:kv,isDraft:Ki,isFluxStandardAction:hN,isFulfilled:Au,isImmutableDefault:Lq,isPending:__,isPlain:lN,isPlainObject:Ns,isRejected:Rf,isRejectedWithValue:pm,legacy_createStore:JM,miniSerializeError:vN,nanoid:y_,original:G5,prepareAutoBatched:A0,removeListener:ON,unwrapResult:_N},Symbol.toStringTag,{value:"Module"})),yy=(e,t)=>Math.floor(e/t)*t,Ss=(e,t)=>Math.round(e/t)*t;var gW=typeof global=="object"&&global&&global.Object===Object&&global;const DN=gW;var mW=typeof self=="object"&&self&&self.Object===Object&&self,yW=DN||mW||Function("return this")();const ba=yW;var vW=ba.Symbol;const ts=vW;var LN=Object.prototype,_W=LN.hasOwnProperty,bW=LN.toString,Rh=ts?ts.toStringTag:void 0;function SW(e){var t=_W.call(e,Rh),n=e[Rh];try{e[Rh]=void 0;var r=!0}catch{}var i=bW.call(e);return r&&(t?e[Rh]=n:delete e[Rh]),i}var wW=Object.prototype,xW=wW.toString;function CW(e){return xW.call(e)}var EW="[object Null]",TW="[object Undefined]",ak=ts?ts.toStringTag:void 0;function $s(e){return e==null?e===void 0?TW:EW:ak&&ak in Object(e)?SW(e):CW(e)}function go(e){return e!=null&&typeof e=="object"}var AW="[object Symbol]";function b_(e){return typeof e=="symbol"||go(e)&&$s(e)==AW}function nE(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 kW=Array.isArray;const Rr=kW;var PW=1/0,lk=ts?ts.prototype:void 0,uk=lk?lk.toString:void 0;function Rv(e){if(typeof e=="string")return e;if(Rr(e))return nE(e,Rv)+"";if(b_(e))return uk?uk.call(e):"";var t=e+"";return t=="0"&&1/e==-PW?"-0":t}var RW=/\s/;function OW(e){for(var t=e.length;t--&&RW.test(e.charAt(t)););return t}var IW=/^\s+/;function MW(e){return e&&e.slice(0,OW(e)+1).replace(IW,"")}function Bi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ck=0/0,NW=/^[-+]0x[0-9a-f]+$/i,DW=/^0b[01]+$/i,LW=/^0o[0-7]+$/i,$W=parseInt;function k0(e){if(typeof e=="number")return e;if(b_(e))return ck;if(Bi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MW(e);var n=DW.test(e);return n||LW.test(e)?$W(e.slice(2),n?2:8):NW.test(e)?ck:+e}var dk=1/0,FW=17976931348623157e292;function BW(e){if(!e)return e===0?e:0;if(e=k0(e),e===dk||e===-dk){var t=e<0?-1:1;return t*FW}return e===e?e:0}function $N(e){var t=BW(e),n=t%1;return t===t?n?t-n:t:0}function S_(e){return e}var zW="[object AsyncFunction]",UW="[object Function]",jW="[object GeneratorFunction]",VW="[object Proxy]";function rE(e){if(!Bi(e))return!1;var t=$s(e);return t==UW||t==jW||t==zW||t==VW}var GW=ba["__core-js_shared__"];const I2=GW;var fk=function(){var e=/[^.]+$/.exec(I2&&I2.keys&&I2.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function HW(e){return!!fk&&fk in e}var qW=Function.prototype,WW=qW.toString;function Uc(e){if(e!=null){try{return WW.call(e)}catch{}try{return e+""}catch{}}return""}var KW=/[\\^$.*+?()[\]{}|]/g,XW=/^\[object .+?Constructor\]$/,QW=Function.prototype,YW=Object.prototype,ZW=QW.toString,JW=YW.hasOwnProperty,eK=RegExp("^"+ZW.call(JW).replace(KW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tK(e){if(!Bi(e)||HW(e))return!1;var t=rE(e)?eK:XW;return t.test(Uc(e))}function nK(e,t){return e==null?void 0:e[t]}function jc(e,t){var n=nK(e,t);return tK(n)?n:void 0}var rK=jc(ba,"WeakMap");const tC=rK;var hk=Object.create,iK=function(){function e(){}return function(t){if(!Bi(t))return{};if(hk)return hk(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const oK=iK;function FN(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 sK(){}function BN(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var aK=800,lK=16,uK=Date.now;function cK(e){var t=0,n=0;return function(){var r=uK(),i=lK-(r-n);if(n=r,i>0){if(++t>=aK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function dK(e){return function(){return e}}var fK=function(){try{var e=jc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ov=fK;var hK=Ov?function(e,t){return Ov(e,"toString",{configurable:!0,enumerable:!1,value:dK(t),writable:!0})}:S_;const pK=hK;var gK=cK(pK);const zN=gK;function UN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function mK(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 yK(e){return e!==e}function vK(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function _K(e,t,n){return t===t?vK(e,t,n):mK(e,yK,n)}function bK(e,t){var n=e==null?0:e.length;return!!n&&_K(e,t,0)>-1}var SK=9007199254740991,wK=/^(?:0|[1-9]\d*)$/;function iE(e,t){var n=typeof e;return t=t??SK,!!t&&(n=="number"||n!="symbol"&&wK.test(e))&&e>-1&&e%1==0&&e<t}function w_(e,t,n){t=="__proto__"&&Ov?Ov(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ym(e,t){return e===t||e!==e&&t!==t}var xK=Object.prototype,CK=xK.hasOwnProperty;function jN(e,t,n){var r=e[t];(!(CK.call(e,t)&&ym(r,n))||n===void 0&&!(t in e))&&w_(e,t,n)}function nh(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?w_(n,a,l):jN(n,a,l)}return n}var pk=Math.max;function VN(e,t,n){return t=pk(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=pk(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),FN(e,this,a)}}function GN(e,t){return zN(VN(e,t,S_),e+"")}var EK=9007199254740991;function oE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=EK}function Vc(e){return e!=null&&oE(e.length)&&!rE(e)}function HN(e,t,n){if(!Bi(n))return!1;var r=typeof t;return(r=="number"?Vc(n)&&iE(t,n.length):r=="string"&&t in n)?ym(n[t],e):!1}function qN(e){return GN(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&&HN(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 TK=Object.prototype;function sE(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||TK;return e===n}function AK(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var kK="[object Arguments]";function gk(e){return go(e)&&$s(e)==kK}var WN=Object.prototype,PK=WN.hasOwnProperty,RK=WN.propertyIsEnumerable,OK=gk(function(){return arguments}())?gk:function(e){return go(e)&&PK.call(e,"callee")&&!RK.call(e,"callee")};const tg=OK;function IK(){return!1}var KN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mk=KN&&typeof module=="object"&&module&&!module.nodeType&&module,MK=mk&&mk.exports===KN,yk=MK?ba.Buffer:void 0,NK=yk?yk.isBuffer:void 0,DK=NK||IK;const ng=DK;var LK="[object Arguments]",$K="[object Array]",FK="[object Boolean]",BK="[object Date]",zK="[object Error]",UK="[object Function]",jK="[object Map]",VK="[object Number]",GK="[object Object]",HK="[object RegExp]",qK="[object Set]",WK="[object String]",KK="[object WeakMap]",XK="[object ArrayBuffer]",QK="[object DataView]",YK="[object Float32Array]",ZK="[object Float64Array]",JK="[object Int8Array]",eX="[object Int16Array]",tX="[object Int32Array]",nX="[object Uint8Array]",rX="[object Uint8ClampedArray]",iX="[object Uint16Array]",oX="[object Uint32Array]",Dn={};Dn[YK]=Dn[ZK]=Dn[JK]=Dn[eX]=Dn[tX]=Dn[nX]=Dn[rX]=Dn[iX]=Dn[oX]=!0;Dn[LK]=Dn[$K]=Dn[XK]=Dn[FK]=Dn[QK]=Dn[BK]=Dn[zK]=Dn[UK]=Dn[jK]=Dn[VK]=Dn[GK]=Dn[HK]=Dn[qK]=Dn[WK]=Dn[KK]=!1;function sX(e){return go(e)&&oE(e.length)&&!!Dn[$s(e)]}function x_(e){return function(t){return e(t)}}var XN=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vp=XN&&typeof module=="object"&&module&&!module.nodeType&&module,aX=vp&&vp.exports===XN,M2=aX&&DN.process,lX=function(){try{var e=vp&&vp.require&&vp.require("util").types;return e||M2&&M2.binding&&M2.binding("util")}catch{}}();const fu=lX;var vk=fu&&fu.isTypedArray,uX=vk?x_(vk):sX;const aE=uX;var cX=Object.prototype,dX=cX.hasOwnProperty;function QN(e,t){var n=Rr(e),r=!n&&tg(e),i=!n&&!r&&ng(e),o=!n&&!r&&!i&&aE(e),s=n||r||i||o,a=s?AK(e.length,String):[],l=a.length;for(var u in e)(t||dX.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iE(u,l)))&&a.push(u);return a}function YN(e,t){return function(n){return e(t(n))}}var fX=YN(Object.keys,Object);const hX=fX;var pX=Object.prototype,gX=pX.hasOwnProperty;function ZN(e){if(!sE(e))return hX(e);var t=[];for(var n in Object(e))gX.call(e,n)&&n!="constructor"&&t.push(n);return t}function vm(e){return Vc(e)?QN(e):ZN(e)}function mX(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var yX=Object.prototype,vX=yX.hasOwnProperty;function _X(e){if(!Bi(e))return mX(e);var t=sE(e),n=[];for(var r in e)r=="constructor"&&(t||!vX.call(e,r))||n.push(r);return n}function _m(e){return Vc(e)?QN(e,!0):_X(e)}var bX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SX=/^\w*$/;function lE(e,t){if(Rr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||b_(e)?!0:SX.test(e)||!bX.test(e)||t!=null&&e in Object(t)}var wX=jc(Object,"create");const rg=wX;function xX(){this.__data__=rg?rg(null):{},this.size=0}function CX(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var EX="__lodash_hash_undefined__",TX=Object.prototype,AX=TX.hasOwnProperty;function kX(e){var t=this.__data__;if(rg){var n=t[e];return n===EX?void 0:n}return AX.call(t,e)?t[e]:void 0}var PX=Object.prototype,RX=PX.hasOwnProperty;function OX(e){var t=this.__data__;return rg?t[e]!==void 0:RX.call(t,e)}var IX="__lodash_hash_undefined__";function MX(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rg&&t===void 0?IX:t,this}function Ec(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ec.prototype.clear=xX;Ec.prototype.delete=CX;Ec.prototype.get=kX;Ec.prototype.has=OX;Ec.prototype.set=MX;function NX(){this.__data__=[],this.size=0}function C_(e,t){for(var n=e.length;n--;)if(ym(e[n][0],t))return n;return-1}var DX=Array.prototype,LX=DX.splice;function $X(e){var t=this.__data__,n=C_(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():LX.call(t,n,1),--this.size,!0}function FX(e){var t=this.__data__,n=C_(t,e);return n<0?void 0:t[n][1]}function BX(e){return C_(this.__data__,e)>-1}function zX(e,t){var n=this.__data__,r=C_(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function dl(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])}}dl.prototype.clear=NX;dl.prototype.delete=$X;dl.prototype.get=FX;dl.prototype.has=BX;dl.prototype.set=zX;var UX=jc(ba,"Map");const ig=UX;function jX(){this.size=0,this.__data__={hash:new Ec,map:new(ig||dl),string:new Ec}}function VX(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function E_(e,t){var n=e.__data__;return VX(t)?n[typeof t=="string"?"string":"hash"]:n.map}function GX(e){var t=E_(this,e).delete(e);return this.size-=t?1:0,t}function HX(e){return E_(this,e).get(e)}function qX(e){return E_(this,e).has(e)}function WX(e,t){var n=E_(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function fl(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])}}fl.prototype.clear=jX;fl.prototype.delete=GX;fl.prototype.get=HX;fl.prototype.has=qX;fl.prototype.set=WX;var KX="Expected a function";function uE(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(KX);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(uE.Cache||fl),n}uE.Cache=fl;var XX=500;function QX(e){var t=uE(e,function(r){return n.size===XX&&n.clear(),r}),n=t.cache;return t}var YX=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ZX=/\\(\\)?/g,JX=QX(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(YX,function(n,r,i,o){t.push(i?o.replace(ZX,"$1"):r||n)}),t});const eQ=JX;function Of(e){return e==null?"":Rv(e)}function T_(e,t){return Rr(e)?e:lE(e,t)?[e]:eQ(Of(e))}var tQ=1/0;function bm(e){if(typeof e=="string"||b_(e))return e;var t=e+"";return t=="0"&&1/e==-tQ?"-0":t}function cE(e,t){t=T_(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[bm(t[n++])];return n&&n==r?e:void 0}function Iv(e,t,n){var r=e==null?void 0:cE(e,t);return r===void 0?n:r}function dE(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _k=ts?ts.isConcatSpreadable:void 0;function nQ(e){return Rr(e)||tg(e)||!!(_k&&e&&e[_k])}function JN(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=nQ),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?JN(a,t-1,n,r,i):dE(i,a):r||(i[i.length]=a)}return i}function rQ(e){var t=e==null?0:e.length;return t?JN(e,1):[]}function iQ(e){return zN(VN(e,void 0,rQ),e+"")}var oQ=YN(Object.getPrototypeOf,Object);const fE=oQ;var sQ="[object Object]",aQ=Function.prototype,lQ=Object.prototype,e7=aQ.toString,uQ=lQ.hasOwnProperty,cQ=e7.call(Object);function t7(e){if(!go(e)||$s(e)!=sQ)return!1;var t=fE(e);if(t===null)return!0;var n=uQ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&e7.call(n)==cQ}function n7(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 r7(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:n7(e,t,n)}var dQ="\\ud800-\\udfff",fQ="\\u0300-\\u036f",hQ="\\ufe20-\\ufe2f",pQ="\\u20d0-\\u20ff",gQ=fQ+hQ+pQ,mQ="\\ufe0e\\ufe0f",yQ="\\u200d",vQ=RegExp("["+yQ+dQ+gQ+mQ+"]");function A_(e){return vQ.test(e)}function _Q(e){return e.split("")}var i7="\\ud800-\\udfff",bQ="\\u0300-\\u036f",SQ="\\ufe20-\\ufe2f",wQ="\\u20d0-\\u20ff",xQ=bQ+SQ+wQ,CQ="\\ufe0e\\ufe0f",EQ="["+i7+"]",nC="["+xQ+"]",rC="\\ud83c[\\udffb-\\udfff]",TQ="(?:"+nC+"|"+rC+")",o7="[^"+i7+"]",s7="(?:\\ud83c[\\udde6-\\uddff]){2}",a7="[\\ud800-\\udbff][\\udc00-\\udfff]",AQ="\\u200d",l7=TQ+"?",u7="["+CQ+"]?",kQ="(?:"+AQ+"(?:"+[o7,s7,a7].join("|")+")"+u7+l7+")*",PQ=u7+l7+kQ,RQ="(?:"+[o7+nC+"?",nC,s7,a7,EQ].join("|")+")",OQ=RegExp(rC+"(?="+rC+")|"+RQ+PQ,"g");function IQ(e){return e.match(OQ)||[]}function c7(e){return A_(e)?IQ(e):_Q(e)}function MQ(e){return function(t){t=Of(t);var n=A_(t)?c7(t):void 0,r=n?n[0]:t.charAt(0),i=n?r7(n,1).join(""):t.slice(1);return r[e]()+i}}var NQ=MQ("toUpperCase");const d7=NQ;function f7(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 DQ(e){return function(t){return e==null?void 0:e[t]}}var LQ={À:"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"},$Q=DQ(LQ);const FQ=$Q;var BQ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zQ="\\u0300-\\u036f",UQ="\\ufe20-\\ufe2f",jQ="\\u20d0-\\u20ff",VQ=zQ+UQ+jQ,GQ="["+VQ+"]",HQ=RegExp(GQ,"g");function qQ(e){return e=Of(e),e&&e.replace(BQ,FQ).replace(HQ,"")}var WQ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function KQ(e){return e.match(WQ)||[]}var XQ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function QQ(e){return XQ.test(e)}var h7="\\ud800-\\udfff",YQ="\\u0300-\\u036f",ZQ="\\ufe20-\\ufe2f",JQ="\\u20d0-\\u20ff",eY=YQ+ZQ+JQ,p7="\\u2700-\\u27bf",g7="a-z\\xdf-\\xf6\\xf8-\\xff",tY="\\xac\\xb1\\xd7\\xf7",nY="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rY="\\u2000-\\u206f",iY=" \\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",m7="A-Z\\xc0-\\xd6\\xd8-\\xde",oY="\\ufe0e\\ufe0f",y7=tY+nY+rY+iY,v7="[']",bk="["+y7+"]",sY="["+eY+"]",_7="\\d+",aY="["+p7+"]",b7="["+g7+"]",S7="[^"+h7+y7+_7+p7+g7+m7+"]",lY="\\ud83c[\\udffb-\\udfff]",uY="(?:"+sY+"|"+lY+")",cY="[^"+h7+"]",w7="(?:\\ud83c[\\udde6-\\uddff]){2}",x7="[\\ud800-\\udbff][\\udc00-\\udfff]",Ed="["+m7+"]",dY="\\u200d",Sk="(?:"+b7+"|"+S7+")",fY="(?:"+Ed+"|"+S7+")",wk="(?:"+v7+"(?:d|ll|m|re|s|t|ve))?",xk="(?:"+v7+"(?:D|LL|M|RE|S|T|VE))?",C7=uY+"?",E7="["+oY+"]?",hY="(?:"+dY+"(?:"+[cY,w7,x7].join("|")+")"+E7+C7+")*",pY="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gY="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mY=E7+C7+hY,yY="(?:"+[aY,w7,x7].join("|")+")"+mY,vY=RegExp([Ed+"?"+b7+"+"+wk+"(?="+[bk,Ed,"$"].join("|")+")",fY+"+"+xk+"(?="+[bk,Ed+Sk,"$"].join("|")+")",Ed+"?"+Sk+"+"+wk,Ed+"+"+xk,gY,pY,_7,yY].join("|"),"g");function _Y(e){return e.match(vY)||[]}function bY(e,t,n){return e=Of(e),t=n?void 0:t,t===void 0?QQ(e)?_Y(e):KQ(e):e.match(t)||[]}var SY="[']",wY=RegExp(SY,"g");function xY(e){return function(t){return f7(bY(qQ(t).replace(wY,"")),e,"")}}function CY(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function zl(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=k0(n),n=n===n?n:0),t!==void 0&&(t=k0(t),t=t===t?t:0),CY(k0(e),t,n)}function EY(){this.__data__=new dl,this.size=0}function TY(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function AY(e){return this.__data__.get(e)}function kY(e){return this.__data__.has(e)}var PY=200;function RY(e,t){var n=this.__data__;if(n instanceof dl){var r=n.__data__;if(!ig||r.length<PY-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new fl(r)}return n.set(e,t),this.size=n.size,this}function Ps(e){var t=this.__data__=new dl(e);this.size=t.size}Ps.prototype.clear=EY;Ps.prototype.delete=TY;Ps.prototype.get=AY;Ps.prototype.has=kY;Ps.prototype.set=RY;function OY(e,t){return e&&nh(t,vm(t),e)}function IY(e,t){return e&&nh(t,_m(t),e)}var T7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ck=T7&&typeof module=="object"&&module&&!module.nodeType&&module,MY=Ck&&Ck.exports===T7,Ek=MY?ba.Buffer:void 0,Tk=Ek?Ek.allocUnsafe:void 0;function A7(e,t){if(t)return e.slice();var n=e.length,r=Tk?Tk(n):new e.constructor(n);return e.copy(r),r}function k7(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 P7(){return[]}var NY=Object.prototype,DY=NY.propertyIsEnumerable,Ak=Object.getOwnPropertySymbols,LY=Ak?function(e){return e==null?[]:(e=Object(e),k7(Ak(e),function(t){return DY.call(e,t)}))}:P7;const hE=LY;function $Y(e,t){return nh(e,hE(e),t)}var FY=Object.getOwnPropertySymbols,BY=FY?function(e){for(var t=[];e;)dE(t,hE(e)),e=fE(e);return t}:P7;const R7=BY;function zY(e,t){return nh(e,R7(e),t)}function O7(e,t,n){var r=t(e);return Rr(e)?r:dE(r,n(e))}function iC(e){return O7(e,vm,hE)}function I7(e){return O7(e,_m,R7)}var UY=jc(ba,"DataView");const oC=UY;var jY=jc(ba,"Promise");const sC=jY;var VY=jc(ba,"Set");const lf=VY;var kk="[object Map]",GY="[object Object]",Pk="[object Promise]",Rk="[object Set]",Ok="[object WeakMap]",Ik="[object DataView]",HY=Uc(oC),qY=Uc(ig),WY=Uc(sC),KY=Uc(lf),XY=Uc(tC),Xu=$s;(oC&&Xu(new oC(new ArrayBuffer(1)))!=Ik||ig&&Xu(new ig)!=kk||sC&&Xu(sC.resolve())!=Pk||lf&&Xu(new lf)!=Rk||tC&&Xu(new tC)!=Ok)&&(Xu=function(e){var t=$s(e),n=t==GY?e.constructor:void 0,r=n?Uc(n):"";if(r)switch(r){case HY:return Ik;case qY:return kk;case WY:return Pk;case KY:return Rk;case XY:return Ok}return t});const If=Xu;var QY=Object.prototype,YY=QY.hasOwnProperty;function ZY(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&YY.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var JY=ba.Uint8Array;const Mv=JY;function pE(e){var t=new e.constructor(e.byteLength);return new Mv(t).set(new Mv(e)),t}function eZ(e,t){var n=t?pE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var tZ=/\w*$/;function nZ(e){var t=new e.constructor(e.source,tZ.exec(e));return t.lastIndex=e.lastIndex,t}var Mk=ts?ts.prototype:void 0,Nk=Mk?Mk.valueOf:void 0;function rZ(e){return Nk?Object(Nk.call(e)):{}}function M7(e,t){var n=t?pE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var iZ="[object Boolean]",oZ="[object Date]",sZ="[object Map]",aZ="[object Number]",lZ="[object RegExp]",uZ="[object Set]",cZ="[object String]",dZ="[object Symbol]",fZ="[object ArrayBuffer]",hZ="[object DataView]",pZ="[object Float32Array]",gZ="[object Float64Array]",mZ="[object Int8Array]",yZ="[object Int16Array]",vZ="[object Int32Array]",_Z="[object Uint8Array]",bZ="[object Uint8ClampedArray]",SZ="[object Uint16Array]",wZ="[object Uint32Array]";function xZ(e,t,n){var r=e.constructor;switch(t){case fZ:return pE(e);case iZ:case oZ:return new r(+e);case hZ:return eZ(e,n);case pZ:case gZ:case mZ:case yZ:case vZ:case _Z:case bZ:case SZ:case wZ:return M7(e,n);case sZ:return new r;case aZ:case cZ:return new r(e);case lZ:return nZ(e);case uZ:return new r;case dZ:return rZ(e)}}function N7(e){return typeof e.constructor=="function"&&!sE(e)?oK(fE(e)):{}}var CZ="[object Map]";function EZ(e){return go(e)&&If(e)==CZ}var Dk=fu&&fu.isMap,TZ=Dk?x_(Dk):EZ;const AZ=TZ;var kZ="[object Set]";function PZ(e){return go(e)&&If(e)==kZ}var Lk=fu&&fu.isSet,RZ=Lk?x_(Lk):PZ;const OZ=RZ;var IZ=1,MZ=2,NZ=4,D7="[object Arguments]",DZ="[object Array]",LZ="[object Boolean]",$Z="[object Date]",FZ="[object Error]",L7="[object Function]",BZ="[object GeneratorFunction]",zZ="[object Map]",UZ="[object Number]",$7="[object Object]",jZ="[object RegExp]",VZ="[object Set]",GZ="[object String]",HZ="[object Symbol]",qZ="[object WeakMap]",WZ="[object ArrayBuffer]",KZ="[object DataView]",XZ="[object Float32Array]",QZ="[object Float64Array]",YZ="[object Int8Array]",ZZ="[object Int16Array]",JZ="[object Int32Array]",eJ="[object Uint8Array]",tJ="[object Uint8ClampedArray]",nJ="[object Uint16Array]",rJ="[object Uint32Array]",xn={};xn[D7]=xn[DZ]=xn[WZ]=xn[KZ]=xn[LZ]=xn[$Z]=xn[XZ]=xn[QZ]=xn[YZ]=xn[ZZ]=xn[JZ]=xn[zZ]=xn[UZ]=xn[$7]=xn[jZ]=xn[VZ]=xn[GZ]=xn[HZ]=xn[eJ]=xn[tJ]=xn[nJ]=xn[rJ]=!0;xn[FZ]=xn[L7]=xn[qZ]=!1;function _p(e,t,n,r,i,o){var s,a=t&IZ,l=t&MZ,u=t&NZ;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!Bi(e))return e;var c=Rr(e);if(c){if(s=ZY(e),!a)return BN(e,s)}else{var d=If(e),f=d==L7||d==BZ;if(ng(e))return A7(e,a);if(d==$7||d==D7||f&&!i){if(s=l||f?{}:N7(e),!a)return l?zY(e,IY(s,e)):$Y(e,OY(s,e))}else{if(!xn[d])return i?e:{};s=xZ(e,d,a)}}o||(o=new Ps);var h=o.get(e);if(h)return h;o.set(e,s),OZ(e)?e.forEach(function(b){s.add(_p(b,t,n,b,e,o))}):AZ(e)&&e.forEach(function(b,_){s.set(_,_p(b,t,n,_,e,o))});var p=u?l?I7:iC:l?_m:vm,m=c?void 0:p(e);return UN(m||e,function(b,_){m&&(_=b,b=e[_]),jN(s,_,_p(b,t,n,_,e,o))}),s}var iJ=1,oJ=4;function Zn(e){return _p(e,iJ|oJ)}var sJ="__lodash_hash_undefined__";function aJ(e){return this.__data__.set(e,sJ),this}function lJ(e){return this.__data__.has(e)}function og(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new fl;++t<n;)this.add(e[t])}og.prototype.add=og.prototype.push=aJ;og.prototype.has=lJ;function F7(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 B7(e,t){return e.has(t)}var uJ=1,cJ=2;function z7(e,t,n,r,i,o){var s=n&uJ,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&cJ?new og:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var p=e[d],m=t[d];if(r)var b=s?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(b!==void 0){if(b)continue;f=!1;break}if(h){if(!F7(t,function(_,y){if(!B7(h,y)&&(p===_||i(p,_,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 dJ(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function gE(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var fJ=1,hJ=2,pJ="[object Boolean]",gJ="[object Date]",mJ="[object Error]",yJ="[object Map]",vJ="[object Number]",_J="[object RegExp]",bJ="[object Set]",SJ="[object String]",wJ="[object Symbol]",xJ="[object ArrayBuffer]",CJ="[object DataView]",$k=ts?ts.prototype:void 0,N2=$k?$k.valueOf:void 0;function EJ(e,t,n,r,i,o,s){switch(n){case CJ:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xJ:return!(e.byteLength!=t.byteLength||!o(new Mv(e),new Mv(t)));case pJ:case gJ:case vJ:return ym(+e,+t);case mJ:return e.name==t.name&&e.message==t.message;case _J:case SJ:return e==t+"";case yJ:var a=dJ;case bJ:var l=r&fJ;if(a||(a=gE),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=hJ,s.set(e,t);var c=z7(a(e),a(t),r,i,o,s);return s.delete(e),c;case wJ:if(N2)return N2.call(e)==N2.call(t)}return!1}var TJ=1,AJ=Object.prototype,kJ=AJ.hasOwnProperty;function PJ(e,t,n,r,i,o){var s=n&TJ,a=iC(e),l=a.length,u=iC(t),c=u.length;if(l!=c&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in t:kJ.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 b=s;++d<l;){f=a[d];var _=e[f],y=t[f];if(r)var g=s?r(y,_,f,t,e,o):r(_,y,f,e,t,o);if(!(g===void 0?_===y||i(_,y,n,r,o):g)){m=!1;break}b||(b=f=="constructor")}if(m&&!b){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var RJ=1,Fk="[object Arguments]",Bk="[object Array]",vy="[object Object]",OJ=Object.prototype,zk=OJ.hasOwnProperty;function IJ(e,t,n,r,i,o){var s=Rr(e),a=Rr(t),l=s?Bk:If(e),u=a?Bk:If(t);l=l==Fk?vy:l,u=u==Fk?vy:u;var c=l==vy,d=u==vy,f=l==u;if(f&&ng(e)){if(!ng(t))return!1;s=!0,c=!1}if(f&&!c)return o||(o=new Ps),s||aE(e)?z7(e,t,n,r,i,o):EJ(e,t,l,n,r,i,o);if(!(n&RJ)){var h=c&&zk.call(e,"__wrapped__"),p=d&&zk.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,b=p?t.value():t;return o||(o=new Ps),i(m,b,n,r,o)}}return f?(o||(o=new Ps),PJ(e,t,n,r,i,o)):!1}function k_(e,t,n,r,i){return e===t?!0:e==null||t==null||!go(e)&&!go(t)?e!==e&&t!==t:IJ(e,t,n,r,k_,i)}var MJ=1,NJ=2;function DJ(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],u=e[l],c=a[1];if(s&&a[2]){if(u===void 0&&!(l in e))return!1}else{var d=new Ps;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?k_(c,u,MJ|NJ,r,d):f))return!1}}return!0}function U7(e){return e===e&&!Bi(e)}function LJ(e){for(var t=vm(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,U7(i)]}return t}function j7(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function $J(e){var t=LJ(e);return t.length==1&&t[0][2]?j7(t[0][0],t[0][1]):function(n){return n===e||DJ(n,e,t)}}function FJ(e,t){return e!=null&&t in Object(e)}function BJ(e,t,n){t=T_(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=bm(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&&oE(i)&&iE(s,i)&&(Rr(e)||tg(e)))}function zJ(e,t){return e!=null&&BJ(e,t,FJ)}var UJ=1,jJ=2;function VJ(e,t){return lE(e)&&U7(t)?j7(bm(e),t):function(n){var r=Iv(n,e);return r===void 0&&r===t?zJ(n,e):k_(t,r,UJ|jJ)}}function V7(e){return function(t){return t==null?void 0:t[e]}}function GJ(e){return function(t){return cE(t,e)}}function HJ(e){return lE(e)?V7(bm(e)):GJ(e)}function rh(e){return typeof e=="function"?e:e==null?S_:typeof e=="object"?Rr(e)?VJ(e[0],e[1]):$J(e):HJ(e)}function qJ(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 WJ(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 KJ=WJ();const G7=KJ;function XJ(e,t){return e&&G7(e,t,vm)}function QJ(e,t){return function(n,r){if(n==null)return n;if(!Vc(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 YJ=QJ(XJ);const ih=YJ;function ZJ(e,t,n,r){return ih(e,function(i,o,s){t(r,i,n(i),s)}),r}function JJ(e,t){return function(n,r){var i=Rr(n)?qJ:ZJ,o=t?t():{};return i(n,e,rh(r),o)}}function aC(e,t,n){(n!==void 0&&!ym(e[t],n)||n===void 0&&!(t in e))&&w_(e,t,n)}function eee(e){return go(e)&&Vc(e)}function lC(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function tee(e){return nh(e,_m(e))}function nee(e,t,n,r,i,o,s){var a=lC(e,n),l=lC(t,n),u=s.get(l);if(u){aC(e,n,u);return}var c=o?o(a,l,n+"",e,t,s):void 0,d=c===void 0;if(d){var f=Rr(l),h=!f&&ng(l),p=!f&&!h&&aE(l);c=l,f||h||p?Rr(a)?c=a:eee(a)?c=BN(a):h?(d=!1,c=A7(l,!0)):p?(d=!1,c=M7(l,!0)):c=[]:t7(l)||tg(l)?(c=a,tg(a)?c=tee(a):(!Bi(a)||rE(a))&&(c=N7(l))):d=!1}d&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),aC(e,n,c)}function P_(e,t,n,r,i){e!==t&&G7(t,function(o,s){if(i||(i=new Ps),Bi(o))nee(e,t,s,n,P_,r,i);else{var a=r?r(lC(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),aC(e,s,a)}},_m)}function H7(e,t,n,r,i,o){return Bi(e)&&Bi(t)&&(o.set(t,e),P_(e,t,void 0,H7,o),o.delete(t)),e}var ree=qN(function(e,t,n,r){P_(e,t,n,r)});const iee=ree;var oee=GN(function(e){return e.push(void 0,H7),FN(iee,void 0,e)});const see=oee;function aee(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 lee(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function uee(e){return typeof e=="function"?e:S_}function ns(e,t){var n=Rr(e)?UN:ih;return n(e,uee(t))}function cee(e,t){var n=[];return ih(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}function dee(e,t){var n=Rr(e)?k7:cee;return n(e,rh(t))}function fee(e,t){var n=-1,r=Vc(e)?Array(e.length):[];return ih(e,function(i,o,s){r[++n]=t(i,o,s)}),r}function hee(e,t){var n=Rr(e)?nE:fee;return n(e,rh(t))}var pee="[object String]";function q7(e){return typeof e=="string"||!Rr(e)&&go(e)&&$s(e)==pee}function gee(e,t){return t.length<2?e:cE(e,n7(t,0,-1))}var mee="[object Boolean]";function yee(e){return e===!0||e===!1||go(e)&&$s(e)==mee}function Sm(e,t){return k_(e,t)}function vee(e){return typeof e=="number"&&e==$N(e)}var _ee="[object Number]";function W7(e){return typeof e=="number"||go(e)&&$s(e)==_ee}var bee="[object RegExp]";function See(e){return go(e)&&$s(e)==bee}var Uk=fu&&fu.isRegExp,wee=Uk?x_(Uk):See;const xee=wee;var Cee=JJ(function(e,t,n){w_(e,n,t)});const mE=Cee;var Eee=qN(function(e,t,n){P_(e,t,n)});const Tee=Eee;function K7(e,t){return t=T_(t,e),e=gee(e,t),e==null||delete e[bm(lee(t))]}function Aee(e){return t7(e)?void 0:e}var kee=1,Pee=2,Ree=4,Oee=iQ(function(e,t){var n={};if(e==null)return n;var r=!1;t=nE(t,function(o){return o=T_(o,e),r||(r=o.length>1),o}),nh(e,I7(e),n),r&&(n=_p(n,kee|Pee|Ree,Aee));for(var i=t.length;i--;)K7(n,t[i]);return n});const R_=Oee;var Iee=V7("length");const Mee=Iee;var X7="\\ud800-\\udfff",Nee="\\u0300-\\u036f",Dee="\\ufe20-\\ufe2f",Lee="\\u20d0-\\u20ff",$ee=Nee+Dee+Lee,Fee="\\ufe0e\\ufe0f",Bee="["+X7+"]",uC="["+$ee+"]",cC="\\ud83c[\\udffb-\\udfff]",zee="(?:"+uC+"|"+cC+")",Q7="[^"+X7+"]",Y7="(?:\\ud83c[\\udde6-\\uddff]){2}",Z7="[\\ud800-\\udbff][\\udc00-\\udfff]",Uee="\\u200d",J7=zee+"?",eD="["+Fee+"]?",jee="(?:"+Uee+"(?:"+[Q7,Y7,Z7].join("|")+")"+eD+J7+")*",Vee=eD+J7+jee,Gee="(?:"+[Q7+uC+"?",uC,Y7,Z7,Bee].join("|")+")",jk=RegExp(cC+"(?="+cC+")|"+Gee+Vee,"g");function Hee(e){for(var t=jk.lastIndex=0;jk.test(e);)++t;return t}function tD(e){return A_(e)?Hee(e):Mee(e)}function qee(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}function dC(e,t,n){var r=Rr(e)?f7:qee,i=arguments.length<3;return r(e,rh(t),n,i,ih)}var Wee="[object Map]",Kee="[object Set]";function O_(e){if(e==null)return 0;if(Vc(e))return q7(e)?tD(e):e.length;var t=If(e);return t==Wee||t==Kee?e.size:ZN(e).length}function Xee(e,t){var n;return ih(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function bp(e,t,n){var r=Rr(e)?F7:Xee;return n&&HN(e,t,n)&&(t=void 0),r(e,rh(t))}var Qee=xY(function(e,t,n){return e+(n?" ":"")+d7(t)});const Yee=Qee;var Zee=30,Jee="...",ete=/\w*$/;function D2(e,t){var n=Zee,r=Jee;if(Bi(t)){var i="separator"in t?t.separator:i;n="length"in t?$N(t.length):n,r="omission"in t?Rv(t.omission):r}e=Of(e);var o=e.length;if(A_(e)){var s=c7(e);o=s.length}if(n>=o)return e;var a=n-tD(r);if(a<1)return r;var l=s?r7(s,0,a).join(""):e.slice(0,a);if(i===void 0)return l+r;if(s&&(a+=l.length-a),xee(i)){if(e.slice(a).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Of(ete.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?a:d)}}else if(e.indexOf(Rv(i),a)!=a){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var tte=1/0,nte=lf&&1/gE(new lf([,-0]))[1]==tte?function(e){return new lf(e)}:sK;const rte=nte;var ite=200;function ote(e,t,n){var r=-1,i=bK,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=aee;else if(o>=ite){var u=t?null:rte(e);if(u)return gE(u);s=!1,i=B7,l=new og}else l=t?[]:a;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),a.push(c)}else i(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}function Vk(e,t){return e&&e.length?ote(e,rh(t)):[]}function ste(e,t){return e==null?!0:K7(e,t)}const nD={shouldUpdateImagesOnConnect:!1,shouldFetchMetadataFromApi:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches"],disabledSDFeatures:["variation","symmetry","hires","perlinNoise","noiseThreshold"],nodesAllowlist:void 0,nodesDenylist:void 0,canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:20,inputMax:9999,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},rD=tr({name:"config",initialState:nD,reducers:{configChanged:(e,t)=>{Tee(e,t.payload)}}}),{configChanged:ate}=rD.actions,lte=rD.reducer,d6e={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},f6e={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},ute={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]}},h6e={lycoris:"LyCORIS",diffusers:"Diffusers"},p6e=0,cte=4294967295;var jt;(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})(jt||(jt={}));var fC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fC||(fC={}));const ke=jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dl=e=>{switch(typeof e){case"undefined":return ke.undefined;case"string":return ke.string;case"number":return isNaN(e)?ke.nan:ke.number;case"boolean":return ke.boolean;case"function":return ke.function;case"bigint":return ke.bigint;case"symbol":return ke.symbol;case"object":return Array.isArray(e)?ke.array:e===null?ke.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ke.promise:typeof Map<"u"&&e instanceof Map?ke.map:typeof Set<"u"&&e instanceof Set?ke.set:typeof Date<"u"&&e instanceof Date?ke.date:ke.object;default:return ke.unknown}},ce=jt.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"]),dte=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Rs extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,jt.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()}}Rs.create=e=>new Rs(e);const sg=(e,t)=>{let n;switch(e.code){case ce.invalid_type:e.received===ke.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ce.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,jt.jsonStringifyReplacer)}`;break;case ce.unrecognized_keys:n=`Unrecognized key(s) in object: ${jt.joinValues(e.keys,", ")}`;break;case ce.invalid_union:n="Invalid input";break;case ce.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${jt.joinValues(e.options)}`;break;case ce.invalid_enum_value:n=`Invalid enum value. Expected ${jt.joinValues(e.options)}, received '${e.received}'`;break;case ce.invalid_arguments:n="Invalid function arguments";break;case ce.invalid_return_type:n="Invalid function return type";break;case ce.invalid_date:n="Invalid date";break;case ce.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}"`:jt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ce.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 ce.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 ce.custom:n="Invalid input";break;case ce.invalid_intersection_types:n="Intersection results could not be merged";break;case ce.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ce.not_finite:n="Number must be finite";break;default:n=t.defaultError,jt.assertNever(e)}return{message:n}};let iD=sg;function fte(e){iD=e}function Nv(){return iD}const Dv=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},hte=[];function Pe(e,t){const n=Dv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Nv(),sg].filter(r=>!!r)});e.common.issues.push(n)}class zi{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 ct;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 zi.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 ct;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 ct=Object.freeze({status:"aborted"}),oD=e=>({status:"dirty",value:e}),Xi=e=>({status:"valid",value:e}),hC=e=>e.status==="aborted",pC=e=>e.status==="dirty",ag=e=>e.status==="valid",Lv=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class ga{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 Gk=(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 Rs(e.common.issues);return this._error=n,this._error}}};function yt(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 St{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 Dl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Dl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new zi,ctx:{common:t.parent.common,data:t.data,parsedType:Dl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Lv(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:Dl(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Gk(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:Dl(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Lv(i)?i:Promise.resolve(i));return Gk(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:ce.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 Ds({schema:this,typeName:nt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ka.create(this,this._def)}nullable(){return kc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Os.create(this,this._def)}promise(){return Nf.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 Ds({...yt(this._def),schema:this,typeName:nt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new yg({...yt(this._def),innerType:this,defaultValue:n,typeName:nt.ZodDefault})}brand(){return new aD({typeName:nt.ZodBranded,type:this,...yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new zv({...yt(this._def),innerType:this,catchValue:n,typeName:nt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return wm.create(this,t)}readonly(){return jv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pte=/^c[^\s-]{8,}$/i,gte=/^[a-z][a-z0-9]*$/,mte=/[0-9A-HJKMNP-TV-Z]{26}/,yte=/^[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,vte=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_te=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,bte=/^(((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}))$/,Ste=/^(([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})))$/,wte=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 xte(e,t){return!!((t==="v4"||!t)&&bte.test(e)||(t==="v6"||!t)&&Ste.test(e))}class Ts extends St{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:ce.invalid_string,...Ze.errToObj(r)}),this.nonempty=t=>this.min(1,Ze.errToObj(t)),this.trim=()=>new Ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ke.string){const o=this._getOrReturnCtx(t);return Pe(o,{code:ce.invalid_type,expected:ke.string,received:o.parsedType}),ct}const r=new zi;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:ce.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),Pe(i,{code:ce.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?Pe(i,{code:ce.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Pe(i,{code:ce.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")vte.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"email",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")_te.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"emoji",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")yte.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"uuid",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")pte.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")gte.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid2",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")mte.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ulid",code:ce.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Pe(i,{validation:"url",code:ce.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),Pe(i,{validation:"regex",code:ce.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),Pe(i,{code:ce.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),Pe(i,{code:ce.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:ce.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?wte(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:ce.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?xte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ip",code:ce.invalid_string,message:o.message}),r.dirty()):jt.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ts.create=e=>{var t;return new Ts({checks:[],typeName:nt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...yt(e)})};function Cte(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 hu extends St{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)!==ke.number){const o=this._getOrReturnCtx(t);return Pe(o,{code:ce.invalid_type,expected:ke.number,received:o.parsedType}),ct}let r;const i=new zi;for(const o of this._def.checks)o.kind==="int"?jt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:ce.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),Pe(r,{code:ce.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),Pe(r,{code:ce.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Cte(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:ce.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:ce.not_finite,message:o.message}),i.dirty()):jt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new hu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new hu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&jt.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)}}hu.create=e=>new hu({checks:[],typeName:nt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class pu extends St{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)!==ke.bigint){const o=this._getOrReturnCtx(t);return Pe(o,{code:ce.invalid_type,expected:ke.bigint,received:o.parsedType}),ct}let r;const i=new zi;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),Pe(r,{code:ce.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),Pe(r,{code:ce.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),Pe(r,{code:ce.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):jt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new pu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new pu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}pu.create=e=>{var t;return new pu({checks:[],typeName:nt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...yt(e)})};class lg extends St{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ke.boolean){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.boolean,received:r.parsedType}),ct}return Xi(t.data)}}lg.create=e=>new lg({typeName:nt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class Tc extends St{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ke.date){const o=this._getOrReturnCtx(t);return Pe(o,{code:ce.invalid_type,expected:ke.date,received:o.parsedType}),ct}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Pe(o,{code:ce.invalid_date}),ct}const r=new zi;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:ce.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),Pe(i,{code:ce.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):jt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Tc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Tc.create=e=>new Tc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:nt.ZodDate,...yt(e)});class $v extends St{_parse(t){if(this._getType(t)!==ke.symbol){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.symbol,received:r.parsedType}),ct}return Xi(t.data)}}$v.create=e=>new $v({typeName:nt.ZodSymbol,...yt(e)});class ug extends St{_parse(t){if(this._getType(t)!==ke.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.undefined,received:r.parsedType}),ct}return Xi(t.data)}}ug.create=e=>new ug({typeName:nt.ZodUndefined,...yt(e)});class cg extends St{_parse(t){if(this._getType(t)!==ke.null){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.null,received:r.parsedType}),ct}return Xi(t.data)}}cg.create=e=>new cg({typeName:nt.ZodNull,...yt(e)});class Mf extends St{constructor(){super(...arguments),this._any=!0}_parse(t){return Xi(t.data)}}Mf.create=e=>new Mf({typeName:nt.ZodAny,...yt(e)});class mc extends St{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xi(t.data)}}mc.create=e=>new mc({typeName:nt.ZodUnknown,...yt(e)});class ol extends St{_parse(t){const n=this._getOrReturnCtx(t);return Pe(n,{code:ce.invalid_type,expected:ke.never,received:n.parsedType}),ct}}ol.create=e=>new ol({typeName:nt.ZodNever,...yt(e)});class Fv extends St{_parse(t){if(this._getType(t)!==ke.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.void,received:r.parsedType}),ct}return Xi(t.data)}}Fv.create=e=>new Fv({typeName:nt.ZodVoid,...yt(e)});class Os extends St{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ke.array)return Pe(n,{code:ce.invalid_type,expected:ke.array,received:n.parsedType}),ct;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Pe(n,{code:s?ce.too_big:ce.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&&(Pe(n,{code:ce.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&&(Pe(n,{code:ce.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 ga(n,s,n.path,a)))).then(s=>zi.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new ga(n,s,n.path,a)));return zi.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Os({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new Os({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new Os({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}Os.create=(e,t)=>new Os({type:e,minLength:null,maxLength:null,exactLength:null,typeName:nt.ZodArray,...yt(t)});function Td(e){if(e instanceof Jn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ka.create(Td(r))}return new Jn({...e._def,shape:()=>t})}else return e instanceof Os?new Os({...e._def,type:Td(e.element)}):e instanceof Ka?Ka.create(Td(e.unwrap())):e instanceof kc?kc.create(Td(e.unwrap())):e instanceof ma?ma.create(e.items.map(t=>Td(t))):e}class Jn extends St{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=jt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ke.object){const u=this._getOrReturnCtx(t);return Pe(u,{code:ce.invalid_type,expected:ke.object,received:u.parsedType}),ct}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ol&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ga(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof ol){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(Pe(i,{code:ce.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ga(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>zi.mergeObjectSync(r,u)):zi.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new Jn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Jn({...this._def,unknownKeys:"strip"})}passthrough(){return new Jn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Jn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Jn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:nt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Jn({...this._def,catchall:t})}pick(t){const n={};return jt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Jn({...this._def,shape:()=>n})}omit(t){const n={};return jt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Jn({...this._def,shape:()=>n})}deepPartial(){return Td(this)}partial(t){const n={};return jt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Jn({...this._def,shape:()=>n})}required(t){const n={};return jt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ka;)o=o._def.innerType;n[r]=o}}),new Jn({...this._def,shape:()=>n})}keyof(){return sD(jt.objectKeys(this.shape))}}Jn.create=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strip",catchall:ol.create(),typeName:nt.ZodObject,...yt(t)});Jn.strictCreate=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strict",catchall:ol.create(),typeName:nt.ZodObject,...yt(t)});Jn.lazycreate=(e,t)=>new Jn({shape:e,unknownKeys:"strip",catchall:ol.create(),typeName:nt.ZodObject,...yt(t)});class dg extends St{_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 Rs(a.ctx.common.issues));return Pe(n,{code:ce.invalid_union,unionErrors:s}),ct}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Rs(l));return Pe(n,{code:ce.invalid_union,unionErrors:a}),ct}}get options(){return this._def.options}}dg.create=(e,t)=>new dg({options:e,typeName:nt.ZodUnion,...yt(t)});const P0=e=>e instanceof pg?P0(e.schema):e instanceof Ds?P0(e.innerType()):e instanceof gg?[e.value]:e instanceof gu?e.options:e instanceof mg?Object.keys(e.enum):e instanceof yg?P0(e._def.innerType):e instanceof ug?[void 0]:e instanceof cg?[null]:null;class I_ extends St{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.object)return Pe(n,{code:ce.invalid_type,expected:ke.object,received:n.parsedType}),ct;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}):(Pe(n,{code:ce.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ct)}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=P0(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 I_({typeName:nt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...yt(r)})}}function gC(e,t){const n=Dl(e),r=Dl(t);if(e===t)return{valid:!0,data:e};if(n===ke.object&&r===ke.object){const i=jt.objectKeys(t),o=jt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=gC(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===ke.array&&r===ke.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=gC(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ke.date&&r===ke.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fg extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(hC(o)||hC(s))return ct;const a=gC(o.value,s.value);return a.valid?((pC(o)||pC(s))&&n.dirty(),{status:n.value,value:a.data}):(Pe(r,{code:ce.invalid_intersection_types}),ct)};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:nt.ZodIntersection,...yt(n)});class ma extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.array)return Pe(r,{code:ce.invalid_type,expected:ke.array,received:r.parsedType}),ct;if(r.data.length<this._def.items.length)return Pe(r,{code:ce.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ct;!this._def.rest&&r.data.length>this._def.items.length&&(Pe(r,{code:ce.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 ga(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>zi.mergeArray(n,s)):zi.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ma({...this._def,rest:t})}}ma.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ma({items:e,typeName:nt.ZodTuple,rest:null,...yt(t)})};class hg extends St{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!==ke.object)return Pe(r,{code:ce.invalid_type,expected:ke.object,received:r.parsedType}),ct;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new ga(r,a,r.path,a)),value:s._parse(new ga(r,r.data[a],r.path,a))});return r.common.async?zi.mergeObjectAsync(n,i):zi.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof St?new hg({keyType:t,valueType:n,typeName:nt.ZodRecord,...yt(r)}):new hg({keyType:Ts.create(),valueType:t,typeName:nt.ZodRecord,...yt(n)})}}class Bv extends St{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!==ke.map)return Pe(r,{code:ce.invalid_type,expected:ke.map,received:r.parsedType}),ct;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new ga(r,a,r.path,[u,"key"])),value:o._parse(new ga(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return ct;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return ct;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}Bv.create=(e,t,n)=>new Bv({valueType:t,keyType:e,typeName:nt.ZodMap,...yt(n)});class Ac extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ke.set)return Pe(r,{code:ce.invalid_type,expected:ke.set,received:r.parsedType}),ct;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Pe(r,{code:ce.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&&(Pe(r,{code:ce.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const u=new Set;for(const c of l){if(c.status==="aborted")return ct;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>o._parse(new ga(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new Ac({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new Ac({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ac.create=(e,t)=>new Ac({valueType:e,minSize:null,maxSize:null,typeName:nt.ZodSet,...yt(t)});class uf extends St{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.function)return Pe(n,{code:ce.invalid_type,expected:ke.function,received:n.parsedType}),ct;function r(a,l){return Dv({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Nv(),sg].filter(u=>!!u),issueData:{code:ce.invalid_arguments,argumentsError:l}})}function i(a,l){return Dv({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Nv(),sg].filter(u=>!!u),issueData:{code:ce.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Nf){const a=this;return Xi(async function(...l){const u=new Rs([]),c=await a._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const a=this;return Xi(function(...l){const u=a._def.args.safeParse(l,o);if(!u.success)throw new Rs([r(l,u.error)]);const c=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(c,o);if(!d.success)throw new Rs([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new uf({...this._def,args:ma.create(t).rest(mc.create())})}returns(t){return new uf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new uf({args:t||ma.create([]).rest(mc.create()),returns:n||mc.create(),typeName:nt.ZodFunction,...yt(r)})}}class pg extends St{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:nt.ZodLazy,...yt(t)});class gg extends St{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Pe(n,{received:n.data,code:ce.invalid_literal,expected:this._def.value}),ct}return{status:"valid",value:t.data}}get value(){return this._def.value}}gg.create=(e,t)=>new gg({value:e,typeName:nt.ZodLiteral,...yt(t)});function sD(e,t){return new gu({values:e,typeName:nt.ZodEnum,...yt(t)})}class gu extends St{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{expected:jt.joinValues(r),received:n.parsedType,code:ce.invalid_type}),ct}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{received:n.data,code:ce.invalid_enum_value,options:r}),ct}return Xi(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 gu.create(t)}exclude(t){return gu.create(this.options.filter(n=>!t.includes(n)))}}gu.create=sD;class mg extends St{_parse(t){const n=jt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ke.string&&r.parsedType!==ke.number){const i=jt.objectValues(n);return Pe(r,{expected:jt.joinValues(i),received:r.parsedType,code:ce.invalid_type}),ct}if(n.indexOf(t.data)===-1){const i=jt.objectValues(n);return Pe(r,{received:r.data,code:ce.invalid_enum_value,options:i}),ct}return Xi(t.data)}get enum(){return this._def.values}}mg.create=(e,t)=>new mg({values:e,typeName:nt.ZodNativeEnum,...yt(t)});class Nf extends St{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ke.promise&&n.common.async===!1)return Pe(n,{code:ce.invalid_type,expected:ke.promise,received:n.parsedType}),ct;const r=n.parsedType===ke.promise?n.data:Promise.resolve(n.data);return Xi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Nf.create=(e,t)=>new Nf({type:e,typeName:nt.ZodPromise,...yt(t)});class Ds extends St{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===nt.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=>{Pe(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"?ct:(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"?ct:(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);jt.assertNever(i)}}Ds.create=(e,t,n)=>new Ds({schema:e,typeName:nt.ZodEffects,effect:t,...yt(n)});Ds.createWithPreprocess=(e,t,n)=>new Ds({schema:t,effect:{type:"preprocess",transform:e},typeName:nt.ZodEffects,...yt(n)});class Ka extends St{_parse(t){return this._getType(t)===ke.undefined?Xi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ka.create=(e,t)=>new Ka({innerType:e,typeName:nt.ZodOptional,...yt(t)});class kc extends St{_parse(t){return this._getType(t)===ke.null?Xi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}kc.create=(e,t)=>new kc({innerType:e,typeName:nt.ZodNullable,...yt(t)});class yg extends St{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ke.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:nt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yt(t)});class zv extends St{_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 Lv(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Rs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}zv.create=(e,t)=>new zv({innerType:e,typeName:nt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yt(t)});class Uv extends St{_parse(t){if(this._getType(t)!==ke.nan){const r=this._getOrReturnCtx(t);return Pe(r,{code:ce.invalid_type,expected:ke.nan,received:r.parsedType}),ct}return{status:"valid",value:t.data}}}Uv.create=e=>new Uv({typeName:nt.ZodNaN,...yt(e)});const Ete=Symbol("zod_brand");class aD extends St{_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 wm extends St{_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"?ct:o.status==="dirty"?(n.dirty(),oD(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"?ct: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 wm({in:t,out:n,typeName:nt.ZodPipeline})}}class jv extends St{_parse(t){const n=this._def.innerType._parse(t);return ag(n)&&(n.value=Object.freeze(n.value)),n}}jv.create=(e,t)=>new jv({innerType:e,typeName:nt.ZodReadonly,...yt(t)});const lD=(e,t={},n)=>e?Mf.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):Mf.create(),Tte={object:Jn.lazycreate};var nt;(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"})(nt||(nt={}));const Ate=(e,t={message:`Input not instance of ${e.name}`})=>lD(n=>n instanceof e,t),uD=Ts.create,cD=hu.create,kte=Uv.create,Pte=pu.create,dD=lg.create,Rte=Tc.create,Ote=$v.create,Ite=ug.create,Mte=cg.create,Nte=Mf.create,Dte=mc.create,Lte=ol.create,$te=Fv.create,Fte=Os.create,Bte=Jn.create,zte=Jn.strictCreate,Ute=dg.create,jte=I_.create,Vte=fg.create,Gte=ma.create,Hte=hg.create,qte=Bv.create,Wte=Ac.create,Kte=uf.create,Xte=pg.create,Qte=gg.create,Yte=gu.create,Zte=mg.create,Jte=Nf.create,Hk=Ds.create,ene=Ka.create,tne=kc.create,nne=Ds.createWithPreprocess,rne=wm.create,ine=()=>uD().optional(),one=()=>cD().optional(),sne=()=>dD().optional(),ane={string:e=>Ts.create({...e,coerce:!0}),number:e=>hu.create({...e,coerce:!0}),boolean:e=>lg.create({...e,coerce:!0}),bigint:e=>pu.create({...e,coerce:!0}),date:e=>Tc.create({...e,coerce:!0})},lne=ct;var z=Object.freeze({__proto__:null,defaultErrorMap:sg,setErrorMap:fte,getErrorMap:Nv,makeIssue:Dv,EMPTY_PATH:hte,addIssueToContext:Pe,ParseStatus:zi,INVALID:ct,DIRTY:oD,OK:Xi,isAborted:hC,isDirty:pC,isValid:ag,isAsync:Lv,get util(){return jt},get objectUtil(){return fC},ZodParsedType:ke,getParsedType:Dl,ZodType:St,ZodString:Ts,ZodNumber:hu,ZodBigInt:pu,ZodBoolean:lg,ZodDate:Tc,ZodSymbol:$v,ZodUndefined:ug,ZodNull:cg,ZodAny:Mf,ZodUnknown:mc,ZodNever:ol,ZodVoid:Fv,ZodArray:Os,ZodObject:Jn,ZodUnion:dg,ZodDiscriminatedUnion:I_,ZodIntersection:fg,ZodTuple:ma,ZodRecord:hg,ZodMap:Bv,ZodSet:Ac,ZodFunction:uf,ZodLazy:pg,ZodLiteral:gg,ZodEnum:gu,ZodNativeEnum:mg,ZodPromise:Nf,ZodEffects:Ds,ZodTransformer:Ds,ZodOptional:Ka,ZodNullable:kc,ZodDefault:yg,ZodCatch:zv,ZodNaN:Uv,BRAND:Ete,ZodBranded:aD,ZodPipeline:wm,ZodReadonly:jv,custom:lD,Schema:St,ZodSchema:St,late:Tte,get ZodFirstPartyTypeKind(){return nt},coerce:ane,any:Nte,array:Fte,bigint:Pte,boolean:dD,date:Rte,discriminatedUnion:jte,effect:Hk,enum:Yte,function:Kte,instanceof:Ate,intersection:Vte,lazy:Xte,literal:Qte,map:qte,nan:kte,nativeEnum:Zte,never:Lte,null:Mte,nullable:tne,number:cD,object:Bte,oboolean:sne,onumber:one,optional:ene,ostring:ine,pipeline:rne,preprocess:nne,promise:Jte,record:Hte,set:Wte,strictObject:zte,string:uD,symbol:Ote,transformer:Hk,tuple:Gte,undefined:Ite,union:Ute,unknown:Dte,void:$te,NEVER:lne,ZodIssueCode:ce,quotelessJson:dte,ZodError:Rs});const une=z.string(),g6e=e=>une.safeParse(e).success,cne=z.string(),m6e=e=>cne.safeParse(e).success,dne=z.string(),y6e=e=>dne.safeParse(e).success,fne=z.string(),v6e=e=>fne.safeParse(e).success,hne=z.number().int().min(1),_6e=e=>hne.safeParse(e).success,pne=z.number().min(1),b6e=e=>pne.safeParse(e).success,fD=z.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"]),S6e=e=>fD.safeParse(e).success,w6e={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"},gne=z.number().int().min(0).max(cte),x6e=e=>gne.safeParse(e).success,mne=z.number().multipleOf(8).min(64),C6e=e=>mne.safeParse(e).success,yne=z.number().multipleOf(8).min(64),E6e=e=>yne.safeParse(e).success,Gc=z.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),M_=z.object({model_name:z.string().min(1),base_model:Gc,model_type:z.literal("main")}),T6e=e=>M_.safeParse(e).success,yE=z.object({model_name:z.string().min(1),base_model:z.literal("sdxl-refiner"),model_type:z.literal("main")}),A6e=e=>yE.safeParse(e).success,hD=z.object({model_name:z.string().min(1),base_model:Gc,model_type:z.literal("onnx")}),xm=z.union([M_,hD]),vne=z.object({model_name:z.string().min(1),base_model:Gc}),k6e=z.object({model_name:z.string().min(1),base_model:Gc}),P6e=z.object({model_name:z.string().min(1),base_model:Gc}),R6e=z.object({model_name:z.string().min(1),base_model:Gc}),_ne=z.number().min(0).max(1),O6e=e=>_ne.safeParse(e).success;z.enum(["fp16","fp32"]);const bne=z.number().min(1).max(10),I6e=e=>bne.safeParse(e).success,Sne=z.number().min(1).max(10),M6e=e=>Sne.safeParse(e).success,wne=z.number().min(0).max(1),N6e=e=>wne.safeParse(e).success;z.enum(["box","gaussian"]);z.enum(["unmasked","mask","edge"]);const Fs={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"edge",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,shouldUseNoiseSettings:!1,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},xne=Fs,pD=tr({name:"generation",initialState:xne,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=zl(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=zl(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},toggleSize:e=>{const[t,n]=[e.width,e.height];e.width=n,e.height=t},setScheduler:(e,t)=>{e.scheduler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setSeamlessXAxis:(e,t)=>{e.seamlessXAxis=t.payload},setSeamlessYAxis:(e,t)=>{e.seamlessYAxis=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},resetParametersState:e=>({...e,...Fs}),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},setShouldUseNoiseSettings:(e,t)=>{e.shouldUseNoiseSettings=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=ute[e.model.base_model];e.clipSkip=zl(e.clipSkip,0,n)},vaeSelected:(e,t)=>{e.vae=t.payload},vaePrecisionChanged:(e,t)=>{e.vaePrecision=t.payload},setClipSkip:(e,t)=>{e.clipSkip=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setShouldShowAdvancedOptions:(e,t)=>{e.shouldShowAdvancedOptions=t.payload,t.payload||(e.clipSkip=0)},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Ss(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(ate,(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=M_.safeParse({model_name:a,base_model:o,model_type:s});l.success&&(t.model=l.data)}}),e.addCase(Ene,(t,n)=>{n.payload||(t.clipSkip=0)})}}),{clampSymmetrySteps:D6e,clearInitialImage:vE,resetParametersState:L6e,resetSeed:$6e,setCfgScale:F6e,setWidth:qk,setHeight:Wk,toggleSize:B6e,setImg2imgStrength:z6e,setInfillMethod:Cne,setIterations:U6e,setPerlin:j6e,setPositivePrompt:V6e,setNegativePrompt:G6e,setScheduler:H6e,setMaskBlur:q6e,setMaskBlurMethod:W6e,setCanvasCoherenceMode:K6e,setCanvasCoherenceSteps:X6e,setCanvasCoherenceStrength:Q6e,setSeed:Y6e,setSeedWeights:Z6e,setShouldFitToWidthHeight:J6e,setShouldGenerateVariations:e8e,setShouldRandomizeSeed:t8e,setSteps:n8e,setThreshold:r8e,setInfillTileSize:i8e,setInfillPatchmatchDownscaleSize:o8e,setVariationAmount:s8e,setShouldUseSymmetry:a8e,setHorizontalSymmetrySteps:l8e,setVerticalSymmetrySteps:u8e,initialImageChanged:N_,modelChanged:Ul,vaeSelected:gD,setShouldUseNoiseSettings:c8e,setSeamlessXAxis:d8e,setSeamlessYAxis:f8e,setClipSkip:h8e,shouldUseCpuNoiseChanged:p8e,setShouldShowAdvancedOptions:Ene,setAspectRatio:Tne,setShouldLockAspectRatio:g8e,vaePrecisionChanged:m8e}=pD.actions,Ane=pD.reducer;let Vi=[],ku=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let s=n.indexOf(i);~s&&(n.splice(s,2),r.lc--,r.lc||r.off())}},notify(i){let o=!Vi.length;for(let s=0;s<n.length;s+=2)Vi.push(n[s],r.value,i,n[s+1]);if(o){for(let s=0;s<Vi.length;s+=4){let a=!1;for(let l=s+7;l<Vi.length;l+=4)if(Vi[l]<Vi[s+3]){a=!0;break}a?Vi.push(Vi[s],Vi[s+1],Vi[s+2],Vi[s+3]):Vi[s](Vi[s+1],Vi[s+2])}Vi.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let s=r.listen(i,o);return i(r.value),s},value:e};return r};const kne=5,_y=6,by=10;let Pne=(e,t,n,r)=>(e.events=e.events||{},e.events[n+by]||(e.events[n+by]=r(i=>{e.events[n].reduceRight((o,s)=>(s(o),o),{shared:{},...i})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let i=e.events[n],o=i.indexOf(t);i.splice(o,1),i.length||(delete e.events[n],e.events[n+by](),delete e.events[n+by])}),Rne=1e3,One=(e,t)=>Pne(e,r=>{let i=t(r);i&&e.events[_y].push(i)},kne,r=>{let i=e.listen;e.listen=(...s)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...s));let o=e.off;return e.events[_y]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let s of e.events[_y])s();e.events[_y]=[]}},Rne)},()=>{e.listen=i,e.off=o}}),Ine=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(s=>s.get());(n===void 0||o.some((s,a)=>s!==n[a]))&&(n=o,i.set(t(...o)))},i=ku(void 0,Math.max(...e.map(o=>o.l))+1);return One(i,()=>{let o=e.map(s=>s.listen(r,i.l));return r(),()=>{for(let s of o)s()}}),i};const Mne={"Content-Type":"application/json"},Nne=/\/*$/;function Dne(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e;async function o(s,a){const{headers:l,body:u,params:c={},parseAs:d="json",querySerializer:f=n??Lne,bodySerializer:h=r??$ne,...p}=a||{},m=Fne(s,{baseUrl:i.baseUrl,params:c,querySerializer:f}),b=Bne(Mne,e==null?void 0:e.headers,l,c.header),_={redirect:"follow",...i,...p,headers:b};u&&(_.body=h(u)),_.body instanceof FormData&&b.delete("Content-Type");const y=await t(m,_);if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok){let v=y.body;if(d!=="stream"){const S=y.clone();v=typeof S[d]=="function"?await S[d]():await S.text()}return{data:v,response:y}}let g={};try{g=await y.clone().json()}catch{g=await y.clone().text()}return{error:g,response:y}}return{async GET(s,a){return o(s,{...a,method:"GET"})},async PUT(s,a){return o(s,{...a,method:"PUT"})},async POST(s,a){return o(s,{...a,method:"POST"})},async DELETE(s,a){return o(s,{...a,method:"DELETE"})},async OPTIONS(s,a){return o(s,{...a,method:"OPTIONS"})},async HEAD(s,a){return o(s,{...a,method:"HEAD"})},async PATCH(s,a){return o(s,{...a,method:"PATCH"})},async TRACE(s,a){return o(s,{...a,method:"TRACE"})}}}function Lne(e){const t=new URLSearchParams;if(e&&typeof e=="object")for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r);return t.toString()}function $ne(e){return JSON.stringify(e)}function Fne(e,t){let n=`${t.baseUrl?t.baseUrl.replace(Nne,""):""}${e}`;if(t.params.path)for(const[r,i]of Object.entries(t.params.path))n=n.replace(`{${r}}`,encodeURIComponent(String(i)));if(t.params.query){const r=t.querySerializer(t.params.query);r&&(n+=`?${r}`)}return n}function Bne(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)o===null?t.delete(i):o!==void 0&&t.set(i,o)}return t}const Df=ku(),vg=ku(),_g=ku(),D_=Ine([Df,vg,_g],(e,t,n)=>Dne({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`})),wi=du("api/sessionCreated",async(e,{rejectWithValue:t})=>{const{graph:n}=e,{POST:r}=D_.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/",{body:n});return o?t({arg:e,status:s.status,error:o}):i}),zne=e=>Bi(e)&&"status"in e,Une=e=>Bi(e)&&"detail"in e,oh=du("api/sessionInvoked",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{PUT:r}=D_.get(),{error:i,response:o}=await r("/api/v1/sessions/{session_id}/invoke",{params:{query:{all:!0},path:{session_id:n}}});if(i){if(zne(i)&&i.status===403)return t({arg:e,status:o.status,error:i.body.detail});if(Une(i)&&o.status===403)return t({arg:e,status:o.status,error:i.detail});if(i)return t({arg:e,status:o.status,error:i})}}),Pu=du("api/sessionCanceled",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{DELETE:r}=D_.get(),{data:i,error:o}=await r("/api/v1/sessions/{session_id}/invoke",{params:{path:{session_id:n}}});return o?t({arg:e,error:o}):i});du("api/listSessions",async(e,{rejectWithValue:t})=>{const{params:n}=e,{GET:r}=D_.get(),{data:i,error:o}=await r("/api/v1/sessions/",{params:n});return o?t({arg:e,error:o}):i});const mD=is(wi.rejected,oh.rejected),Sy=(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}},wy=(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},y8e=.999,v8e=.1,_8e=20,xy=.95,b8e=30,S8e=10,jne=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),cd=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=Ss(a/o,64)):o<1&&(r.height=a,r.width=Ss(a*o,64)),s=r.width*r.height;return r},Vne=e=>({width:Ss(e.width,64),height:Ss(e.height,64)}),w8e=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],x8e=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],yD=e=>e.kind==="line"&&e.layer==="mask",C8e=e=>e.kind==="line"&&e.layer==="base",Gne=e=>e.kind==="image"&&e.layer==="base",E8e=e=>e.kind==="fillRect"&&e.layer==="base",T8e=e=>e.kind==="eraseRect"&&e.layer==="base",Hne=e=>e.kind==="line",Ad={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},vD={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:Ad,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"},_D=tr({name:"canvas",initialState:vD,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(Zn(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!yD(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:yy(zl(r,64,512),64),height:yy(zl(i,64,512),64)},a={x:Ss(r/2-s.width/2,64),y:Ss(i/2-s.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const c=cd(s);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=s,e.boundingBoxCoordinates=a,e.pastLayerStates.push(Zn(e.layerState)),e.layerState={...Ad,objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[];const l=wy(o.width,o.height,r,i,xy),u=Sy(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=Vne(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=cd(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=jne(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},canvasSessionIdChanged:(e,t)=>{e.layerState.stagingArea.sessionId=t.payload},stagingAreaInitialized:(e,t)=>{const{sessionId:n,boundingBox:r}=t.payload;e.layerState.stagingArea={boundingBox:r,sessionId:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Zn(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(Zn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Ad.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Zn(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(Zn(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(Zn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:a,points:t.payload,...l};s&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(Hne);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Zn(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Zn(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(Zn(e.layerState)),e.layerState=Ad,e.futureLayerStates=[]},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(Gne)){const o=wy(i.width,i.height,512,512,xy),s=Sy(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=cd(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:u}=n;if(l!==0&&u!==0){const c=r?1:wy(i,o,l,u,xy),d=Sy(i,o,s,a,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=wy(i,o,512,512,xy),d=Sy(i,o,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=cd(f);e.scaledBoundingBoxDimensions=h}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:(e,t)=>{if(!e.layerState.stagingArea.images.length)return;const{images:n,selectedImageIndex:r}=e.layerState.stagingArea;e.pastLayerStates.push(Zn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const i=n[r];i&&e.layerState.objects.push({...i}),e.layerState.stagingArea={...Ad.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,s=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>s){const a={width:yy(zl(o,64,512),64),height:yy(zl(s,64,512),64)},l={x:Ss(o/2-a.width/2,64),y:Ss(s/2-a.height/2,64)};if(e.boundingBoxDimensions=a,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=cd(a);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=cd(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(Zn(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(Pu.pending,t=>{t.layerState.stagingArea.images.length||(t.layerState.stagingArea=Ad.stagingArea)}),e.addCase(Tne,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Ss(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Ss(t.scaledBoundingBoxDimensions.width/r,64))})}}),{addEraseRect:A8e,addFillRect:k8e,addImageToStagingArea:qne,addLine:P8e,addPointToCurrentLine:R8e,clearCanvasHistory:O8e,clearMask:I8e,commitColorPickerColor:M8e,commitStagingAreaImage:Wne,discardStagedImages:N8e,fitBoundingBoxToStage:D8e,mouseLeftCanvas:L8e,nextStagingAreaImage:$8e,prevStagingAreaImage:F8e,redo:B8e,resetCanvas:_E,resetCanvasInteractionState:z8e,resetCanvasView:U8e,setBoundingBoxCoordinates:j8e,setBoundingBoxDimensions:Kk,setBoundingBoxPreviewFill:V8e,setBoundingBoxScaleMethod:G8e,flipBoundingBoxAxes:H8e,setBrushColor:q8e,setBrushSize:W8e,setColorPickerColor:K8e,setCursorPosition:X8e,setInitialCanvasImage:bD,setIsDrawing:Q8e,setIsMaskEnabled:Y8e,setIsMouseOverBoundingBox:Z8e,setIsMoveBoundingBoxKeyHeld:J8e,setIsMoveStageKeyHeld:eRe,setIsMovingBoundingBox:tRe,setIsMovingStage:nRe,setIsTransformingBoundingBox:rRe,setLayer:iRe,setMaskColor:oRe,setMergedCanvas:Kne,setShouldAutoSave:sRe,setShouldCropToBoundingBoxOnSave:aRe,setShouldDarkenOutsideBoundingBox:lRe,setShouldLockBoundingBox:uRe,setShouldPreserveMaskedArea:cRe,setShouldShowBoundingBox:dRe,setShouldShowBrush:fRe,setShouldShowBrushPreview:hRe,setShouldShowCanvasDebugInfo:pRe,setShouldShowCheckboardTransparency:gRe,setShouldShowGrid:mRe,setShouldShowIntermediates:yRe,setShouldShowStagingImage:vRe,setShouldShowStagingOutline:_Re,setShouldSnapToGrid:bRe,setStageCoordinates:SRe,setStageScale:wRe,setTool:xRe,toggleShouldLockBoundingBox:CRe,toggleTool:ERe,undo:TRe,setScaledBoundingBoxDimensions:ARe,setShouldRestrictStrokesToBox:kRe,stagingAreaInitialized:Xne,canvasSessionIdChanged:Qne,setShouldAntialias:PRe,canvasResized:RRe}=_D.actions,Yne=_D.reducer,Zne={isModalOpen:!1,imagesToChange:[]},SD=tr({name:"changeBoardModal",initialState:Zne,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:ORe,imagesToChangeSelected:IRe,changeBoardReset:MRe}=SD.actions,Jne=SD.reducer;var wD={exports:{}},xD={};const So=Q1(pW),Oh=Q1(yq),ere=Q1(Pq);(function(e){var t,n,r=ut&&ut.__generator||function(W,J){var te,le,re,De,ze={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return De={next:rt(0),throw:rt(1),return:rt(2)},typeof Symbol=="function"&&(De[Symbol.iterator]=function(){return this}),De;function rt(Oe){return function(Ue){return function(Ae){if(te)throw new TypeError("Generator is already executing.");for(;ze;)try{if(te=1,le&&(re=2&Ae[0]?le.return:Ae[0]?le.throw||((re=le.return)&&re.call(le),0):le.next)&&!(re=re.call(le,Ae[1])).done)return re;switch(le=0,re&&(Ae=[2&Ae[0],re.value]),Ae[0]){case 0:case 1:re=Ae;break;case 4:return ze.label++,{value:Ae[1],done:!1};case 5:ze.label++,le=Ae[1],Ae=[0];continue;case 7:Ae=ze.ops.pop(),ze.trys.pop();continue;default:if(!((re=(re=ze.trys).length>0&&re[re.length-1])||Ae[0]!==6&&Ae[0]!==2)){ze=0;continue}if(Ae[0]===3&&(!re||Ae[1]>re[0]&&Ae[1]<re[3])){ze.label=Ae[1];break}if(Ae[0]===6&&ze.label<re[1]){ze.label=re[1],re=Ae;break}if(re&&ze.label<re[2]){ze.label=re[2],ze.ops.push(Ae);break}re[2]&&ze.ops.pop(),ze.trys.pop();continue}Ae=J.call(W,ze)}catch(ne){Ae=[6,ne],le=0}finally{te=re=0}if(5&Ae[0])throw Ae[1];return{value:Ae[0]?Ae[1]:void 0,done:!0}}([Oe,Ue])}}},i=ut&&ut.__spreadArray||function(W,J){for(var te=0,le=J.length,re=W.length;te<le;te++,re++)W[re]=J[te];return W},o=Object.create,s=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=function(W,J,te){return J in W?s(W,J,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[J]=te},b=function(W,J){for(var te in J||(J={}))h.call(J,te)&&m(W,te,J[te]);if(d)for(var le=0,re=d(J);le<re.length;le++)p.call(J,te=re[le])&&m(W,te,J[te]);return W},_=function(W,J){return a(W,u(J))},y=function(W){return s(W,"__esModule",{value:!0})},g=function(W,J){var te={};for(var le in W)h.call(W,le)&&J.indexOf(le)<0&&(te[le]=W[le]);if(W!=null&&d)for(var re=0,De=d(W);re<De.length;re++)J.indexOf(le=De[re])<0&&p.call(W,le)&&(te[le]=W[le]);return te},v=function(W){return function(J,te,le){if(te&&typeof te=="object"||typeof te=="function")for(var re=function(rt){h.call(J,rt)||rt==="default"||s(J,rt,{get:function(){return te[rt]},enumerable:!(le=l(te,rt))||le.enumerable})},De=0,ze=c(te);De<ze.length;De++)re(ze[De]);return J}(y(s(W!=null?o(f(W)):{},"default",W&&W.__esModule&&"default"in W?{get:function(){return W.default},enumerable:!0}:{value:W,enumerable:!0})),W)},S=function(W,J,te){return new Promise(function(le,re){var De=function(Oe){try{rt(te.next(Oe))}catch(Ue){re(Ue)}},ze=function(Oe){try{rt(te.throw(Oe))}catch(Ue){re(Ue)}},rt=function(Oe){return Oe.done?le(Oe.value):Promise.resolve(Oe.value).then(De,ze)};rt((te=te.apply(W,J)).next())})};y(e),function(W,J){for(var te in J)s(W,te,{get:J[te],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return to},copyWithStructuralSharing:function(){return C},coreModule:function(){return qr},createApi:function(){return Ta},defaultSerializeQueryArgs:function(){return Ui},fakeBaseQuery:function(){return Ca},fetchBaseQuery:function(){return E},retry:function(){return R},setupListeners:function(){return Y},skipSelector:function(){return Or},skipToken:function(){return sr}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var w=function(W){return[].concat.apply([],W)},x=v(So).isPlainObject;function C(W,J){if(W===J||!(x(W)&&x(J)||Array.isArray(W)&&Array.isArray(J)))return J;for(var te=Object.keys(J),le=Object.keys(W),re=te.length===le.length,De=Array.isArray(J)?[]:{},ze=0,rt=te;ze<rt.length;ze++){var Oe=rt[ze];De[Oe]=C(W[Oe],J[Oe]),re&&(re=W[Oe]===De[Oe])}return re?W:De}var A=v(So),T=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return fetch.apply(void 0,W)},k=function(W){return W.status>=200&&W.status<=299},L=function(W){return/ion\/(vnd\.api\+)?json/.test(W.get("content-type")||"")};function N(W){if(!(0,A.isPlainObject)(W))return W;for(var J=b({},W),te=0,le=Object.entries(J);te<le.length;te++){var re=le[te];re[1]===void 0&&delete J[re[0]]}return J}function E(W){var J=this;W===void 0&&(W={});var te=W.baseUrl,le=W.prepareHeaders,re=le===void 0?function(_t){return _t}:le,De=W.fetchFn,ze=De===void 0?T:De,rt=W.paramsSerializer,Oe=W.isJsonContentType,Ue=Oe===void 0?L:Oe,Ae=W.jsonContentType,ne=Ae===void 0?"application/json":Ae,ye=W.jsonReplacer,We=W.timeout,Ke=W.responseHandler,it=W.validateStatus,ot=g(W,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&ze===T&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(_t,wt){return S(J,null,function(){var en,tn,Ei,bo,Ti,hr,li,jn,ro,ps,Je,nn,Kt,Qn,pr,ui,dn,Pt,Bt,fn,Xt,sn,ve,Xe,Le,Ce,je,st,$e,_e,se,Se,ue,fe,be,Qe;return r(this,function(Ge){switch(Ge.label){case 0:return en=wt.signal,tn=wt.getState,Ei=wt.extra,bo=wt.endpoint,Ti=wt.forced,hr=wt.type,ro=(jn=typeof _t=="string"?{url:_t}:_t).url,Je=(ps=jn.headers)===void 0?new Headers(ot.headers):ps,Kt=(nn=jn.params)===void 0?void 0:nn,pr=(Qn=jn.responseHandler)===void 0?Ke??"json":Qn,dn=(ui=jn.validateStatus)===void 0?it??k:ui,Bt=(Pt=jn.timeout)===void 0?We:Pt,fn=g(jn,["url","headers","params","responseHandler","validateStatus","timeout"]),Xt=b(_(b({},ot),{signal:en}),fn),Je=new Headers(N(Je)),sn=Xt,[4,re(Je,{getState:tn,extra:Ei,endpoint:bo,forced:Ti,type:hr})];case 1:sn.headers=Ge.sent()||Je,ve=function(Ee){return typeof Ee=="object"&&((0,A.isPlainObject)(Ee)||Array.isArray(Ee)||typeof Ee.toJSON=="function")},!Xt.headers.has("content-type")&&ve(Xt.body)&&Xt.headers.set("content-type",ne),ve(Xt.body)&&Ue(Xt.headers)&&(Xt.body=JSON.stringify(Xt.body,ye)),Kt&&(Xe=~ro.indexOf("?")?"&":"?",Le=rt?rt(Kt):new URLSearchParams(N(Kt)),ro+=Xe+Le),ro=function(Ee,xt){if(!Ee)return xt;if(!xt)return Ee;if(function($t){return new RegExp("(^|:)//").test($t)}(xt))return xt;var Lt=Ee.endsWith("/")||!xt.startsWith("?")?"/":"";return Ee=function($t){return $t.replace(/\/$/,"")}(Ee),""+Ee+Lt+function($t){return $t.replace(/^\//,"")}(xt)}(te,ro),Ce=new Request(ro,Xt),je=Ce.clone(),li={request:je},$e=!1,_e=Bt&&setTimeout(function(){$e=!0,wt.abort()},Bt),Ge.label=2;case 2:return Ge.trys.push([2,4,5,6]),[4,ze(Ce)];case 3:return st=Ge.sent(),[3,6];case 4:return se=Ge.sent(),[2,{error:{status:$e?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(se)},meta:li}];case 5:return _e&&clearTimeout(_e),[7];case 6:Se=st.clone(),li.response=Se,fe="",Ge.label=7;case 7:return Ge.trys.push([7,9,,10]),[4,Promise.all([pt(st,pr).then(function(Ee){return ue=Ee},function(Ee){return be=Ee}),Se.text().then(function(Ee){return fe=Ee},function(){})])];case 8:if(Ge.sent(),be)throw be;return[3,10];case 9:return Qe=Ge.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:st.status,data:fe,error:String(Qe)},meta:li}];case 10:return[2,dn(st,ue)?{data:ue,meta:li}:{error:{status:st.status,data:ue},meta:li}]}})})};function pt(_t,wt){return S(this,null,function(){var en;return r(this,function(tn){switch(tn.label){case 0:return typeof wt=="function"?[2,wt(_t)]:(wt==="content-type"&&(wt=Ue(_t.headers)?"json":"text"),wt!=="json"?[3,2]:[4,_t.text()]);case 1:return[2,(en=tn.sent()).length?JSON.parse(en):null];case 2:return[2,_t.text()]}})})}}var P=function(W,J){J===void 0&&(J=void 0),this.value=W,this.meta=J};function D(W,J){return W===void 0&&(W=0),J===void 0&&(J=5),S(this,null,function(){var te,le;return r(this,function(re){switch(re.label){case 0:return te=Math.min(W,J),le=~~((Math.random()+.4)*(300<<te)),[4,new Promise(function(De){return setTimeout(function(ze){return De(ze)},le)})];case 1:return re.sent(),[2]}})})}var B={},R=Object.assign(function(W,J){return function(te,le,re){return S(void 0,null,function(){var De,ze,rt,Oe,Ue,Ae,ne;return r(this,function(ye){switch(ye.label){case 0:De=[5,(J||B).maxRetries,(re||B).maxRetries].filter(function(We){return We!==void 0}),ze=De.slice(-1)[0],rt=function(We,Ke,it){return it.attempt<=ze},Oe=b(b({maxRetries:ze,backoff:D,retryCondition:rt},J),re),Ue=0,ye.label=1;case 1:ye.label=2;case 2:return ye.trys.push([2,4,,6]),[4,W(te,le,re)];case 3:if((Ae=ye.sent()).error)throw new P(Ae);return[2,Ae];case 4:if(ne=ye.sent(),Ue++,ne.throwImmediately){if(ne instanceof P)return[2,ne.value];throw ne}return ne instanceof P&&!Oe.retryCondition(ne.value.error,te,{attempt:Ue,baseQueryApi:le,extraOptions:re})?[2,ne.value]:[4,Oe.backoff(Ue,Oe.maxRetries)];case 5:return ye.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(W){throw Object.assign(new P({error:W}),{throwImmediately:!0})}}),O=v(So),I=(0,O.createAction)("__rtkq/focused"),F=(0,O.createAction)("__rtkq/unfocused"),U=(0,O.createAction)("__rtkq/online"),V=(0,O.createAction)("__rtkq/offline"),H=!1;function Y(W,J){return J?J(W,{onFocus:I,onFocusLost:F,onOffline:V,onOnline:U}):(te=function(){return W(I())},le=function(){return W(U())},re=function(){return W(V())},De=function(){window.document.visibilityState==="visible"?te():W(F())},H||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",De,!1),window.addEventListener("focus",te,!1),window.addEventListener("online",le,!1),window.addEventListener("offline",re,!1),H=!0),function(){window.removeEventListener("focus",te),window.removeEventListener("visibilitychange",De),window.removeEventListener("online",le),window.removeEventListener("offline",re),H=!1});var te,le,re,De}var Q,j,K=v(So);function ee(W){return W.type===Q.query}function ie(W,J,te,le,re,De){return typeof W=="function"?W(J,te,le,re).map(ge).map(De):Array.isArray(W)?W.map(ge).map(De):[]}function ge(W){return typeof W=="string"?{type:W}:W}(j=Q||(Q={})).query="query",j.mutation="mutation";var ae=v(So);function dt(W){return W!=null}var et=Symbol("forceQueryFn"),Ne=function(W){return typeof W[et]=="function"},lt=v(So),Te=v(Oh),Ht=v(So);function br(W){return W}function An(W,J,te,le){return ie(te[W.meta.arg.endpointName][J],(0,lt.isFulfilled)(W)?W.payload:void 0,(0,lt.isRejectedWithValue)(W)?W.payload:void 0,W.meta.arg.originalArgs,"baseQueryMeta"in W.meta?W.meta.baseQueryMeta:void 0,le)}var _n=v(Oh),qt=v(Oh);function kn(W,J,te){var le=W[J];le&&te(le)}function Sr(W){var J;return(J="arg"in W?W.arg.fixedCacheKey:W.fixedCacheKey)!=null?J:W.requestId}function eo(W,J,te){var le=W[Sr(J)];le&&te(le)}var Vr={},sr=Symbol.for("RTKQ/skipToken"),Or=sr,Gr={status:t.uninitialized},Pn=(0,K.createNextState)(Gr,function(){}),cn=(0,K.createNextState)(Gr,function(){}),xi=v(So),oi=WeakMap?new WeakMap:void 0,Ui=function(W){var J=W.endpointName,te=W.queryArgs,le="",re=oi==null?void 0:oi.get(te);if(typeof re=="string")le=re;else{var De=JSON.stringify(te,function(ze,rt){return(0,xi.isPlainObject)(rt)?Object.keys(rt).sort().reduce(function(Oe,Ue){return Oe[Ue]=rt[Ue],Oe},{}):rt});(0,xi.isPlainObject)(te)&&(oi==null||oi.set(te,De)),le=De}return J+"("+le+")"},fs=v(So),wr=v(ere);function to(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return function(te){var le=(0,wr.defaultMemoize)(function(Oe){var Ue,Ae;return(Ae=te.extractRehydrationInfo)==null?void 0:Ae.call(te,Oe,{reducerPath:(Ue=te.reducerPath)!=null?Ue:"api"})}),re=_(b({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},te),{extractRehydrationInfo:le,serializeQueryArgs:function(Oe){var Ue=Ui;if("serializeQueryArgs"in Oe.endpointDefinition){var Ae=Oe.endpointDefinition.serializeQueryArgs;Ue=function(ne){var ye=Ae(ne);return typeof ye=="string"?ye:Ui(_(b({},ne),{queryArgs:ye}))}}else te.serializeQueryArgs&&(Ue=te.serializeQueryArgs);return Ue(Oe)},tagTypes:i([],te.tagTypes||[])}),De={endpointDefinitions:{},batch:function(Oe){Oe()},apiUid:(0,fs.nanoid)(),extractRehydrationInfo:le,hasRehydrationInfo:(0,wr.defaultMemoize)(function(Oe){return le(Oe)!=null})},ze={injectEndpoints:function(Oe){for(var Ue=Oe.endpoints({query:function(pt){return _(b({},pt),{type:Q.query})},mutation:function(pt){return _(b({},pt),{type:Q.mutation})}}),Ae=0,ne=Object.entries(Ue);Ae<ne.length;Ae++){var ye=ne[Ae],We=ye[0],Ke=ye[1];if(Oe.overrideExisting||!(We in De.endpointDefinitions)){De.endpointDefinitions[We]=Ke;for(var it=0,ot=rt;it<ot.length;it++)ot[it].injectEndpoint(We,Ke)}}return ze},enhanceEndpoints:function(Oe){var Ue=Oe.addTagTypes,Ae=Oe.endpoints;if(Ue)for(var ne=0,ye=Ue;ne<ye.length;ne++){var We=ye[ne];re.tagTypes.includes(We)||re.tagTypes.push(We)}if(Ae)for(var Ke=0,it=Object.entries(Ae);Ke<it.length;Ke++){var ot=it[Ke],pt=ot[0],_t=ot[1];typeof _t=="function"?_t(De.endpointDefinitions[pt]):Object.assign(De.endpointDefinitions[pt]||{},_t)}return ze}},rt=W.map(function(Oe){return Oe.init(ze,re,De)});return ze.injectEndpoints({endpoints:te.endpoints})}}function Ca(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var _o,Ea=v(So),Rn=function(W){var J=W.reducerPath,te=W.api,le=W.context,re=W.internalState,De=te.internalActions,ze=De.removeQueryResult,rt=De.unsubscribeQueryResult;function Oe(ne){var ye=re.currentSubscriptions[ne];return!!ye&&!function(We){for(var Ke in We)return!1;return!0}(ye)}var Ue={};function Ae(ne,ye,We,Ke){var it,ot=le.endpointDefinitions[ye],pt=(it=ot==null?void 0:ot.keepUnusedDataFor)!=null?it:Ke.keepUnusedDataFor;if(pt!==1/0){var _t=Math.max(0,Math.min(pt,2147482647e-3));if(!Oe(ne)){var wt=Ue[ne];wt&&clearTimeout(wt),Ue[ne]=setTimeout(function(){Oe(ne)||We.dispatch(ze({queryCacheKey:ne})),delete Ue[ne]},1e3*_t)}}}return function(ne,ye,We){var Ke;if(rt.match(ne)){var it=ye.getState()[J];Ae(Ti=ne.payload.queryCacheKey,(Ke=it.queries[Ti])==null?void 0:Ke.endpointName,ye,it.config)}if(te.util.resetApiState.match(ne))for(var ot=0,pt=Object.entries(Ue);ot<pt.length;ot++){var _t=pt[ot],wt=_t[0],en=_t[1];en&&clearTimeout(en),delete Ue[wt]}if(le.hasRehydrationInfo(ne)){it=ye.getState()[J];for(var tn=le.extractRehydrationInfo(ne).queries,Ei=0,bo=Object.entries(tn);Ei<bo.length;Ei++){var Ti,hr=bo[Ei],li=hr[1];Ae(Ti=hr[0],li==null?void 0:li.endpointName,ye,it.config)}}}},Wt=v(So),Ir=function(W){var J=W.reducerPath,te=W.context,le=W.context.endpointDefinitions,re=W.mutationThunk,De=W.api,ze=W.assertTagType,rt=W.refetchQuery,Oe=De.internalActions.removeQueryResult,Ue=(0,Wt.isAnyOf)((0,Wt.isFulfilled)(re),(0,Wt.isRejectedWithValue)(re));function Ae(ne,ye){var We=ye.getState(),Ke=We[J],it=De.util.selectInvalidatedBy(We,ne);te.batch(function(){for(var ot,pt=0,_t=Array.from(it.values());pt<_t.length;pt++){var wt=_t[pt].queryCacheKey,en=Ke.queries[wt],tn=(ot=Ke.subscriptions[wt])!=null?ot:{};en&&(Object.keys(tn).length===0?ye.dispatch(Oe({queryCacheKey:wt})):en.status!==t.uninitialized&&ye.dispatch(rt(en,wt)))}})}return function(ne,ye){Ue(ne)&&Ae(An(ne,"invalidatesTags",le,ze),ye),De.util.invalidateTags.match(ne)&&Ae(ie(ne.payload,void 0,void 0,void 0,void 0,ze),ye)}},xr=function(W){var J=W.reducerPath,te=W.queryThunk,le=W.api,re=W.refetchQuery,De=W.internalState,ze={};function rt(ne,ye){var We=ne.queryCacheKey,Ke=ye.getState()[J].queries[We];if(Ke&&Ke.status!==t.uninitialized){var it=Ae(De.currentSubscriptions[We]);if(Number.isFinite(it)){var ot=ze[We];ot!=null&&ot.timeout&&(clearTimeout(ot.timeout),ot.timeout=void 0);var pt=Date.now()+it,_t=ze[We]={nextPollTimestamp:pt,pollingInterval:it,timeout:setTimeout(function(){_t.timeout=void 0,ye.dispatch(re(Ke,We))},it)}}}}function Oe(ne,ye){var We=ne.queryCacheKey,Ke=ye.getState()[J].queries[We];if(Ke&&Ke.status!==t.uninitialized){var it=Ae(De.currentSubscriptions[We]);if(Number.isFinite(it)){var ot=ze[We],pt=Date.now()+it;(!ot||pt<ot.nextPollTimestamp)&&rt({queryCacheKey:We},ye)}else Ue(We)}}function Ue(ne){var ye=ze[ne];ye!=null&&ye.timeout&&clearTimeout(ye.timeout),delete ze[ne]}function Ae(ne){ne===void 0&&(ne={});var ye=Number.POSITIVE_INFINITY;for(var We in ne)ne[We].pollingInterval&&(ye=Math.min(ne[We].pollingInterval,ye));return ye}return function(ne,ye){(le.internalActions.updateSubscriptionOptions.match(ne)||le.internalActions.unsubscribeQueryResult.match(ne))&&Oe(ne.payload,ye),(te.pending.match(ne)||te.rejected.match(ne)&&ne.meta.condition)&&Oe(ne.meta.arg,ye),(te.fulfilled.match(ne)||te.rejected.match(ne)&&!ne.meta.condition)&&rt(ne.meta.arg,ye),le.util.resetApiState.match(ne)&&function(){for(var We=0,Ke=Object.keys(ze);We<Ke.length;We++)Ue(Ke[We])}()}},Cr=v(So),Hr=new Error("Promise never resolved before cacheEntryRemoved."),Ci=function(W){var J=W.api,te=W.reducerPath,le=W.context,re=W.queryThunk,De=W.mutationThunk,ze=(0,Cr.isAsyncThunkAction)(re),rt=(0,Cr.isAsyncThunkAction)(De),Oe=(0,Cr.isFulfilled)(re,De),Ue={};function Ae(ne,ye,We,Ke,it){var ot=le.endpointDefinitions[ne],pt=ot==null?void 0:ot.onCacheEntryAdded;if(pt){var _t={},wt=new Promise(function(hr){_t.cacheEntryRemoved=hr}),en=Promise.race([new Promise(function(hr){_t.valueResolved=hr}),wt.then(function(){throw Hr})]);en.catch(function(){}),Ue[We]=_t;var tn=J.endpoints[ne].select(ot.type===Q.query?ye:We),Ei=Ke.dispatch(function(hr,li,jn){return jn}),bo=_(b({},Ke),{getCacheEntry:function(){return tn(Ke.getState())},requestId:it,extra:Ei,updateCachedData:ot.type===Q.query?function(hr){return Ke.dispatch(J.util.updateQueryData(ne,ye,hr))}:void 0,cacheDataLoaded:en,cacheEntryRemoved:wt}),Ti=pt(ye,bo);Promise.resolve(Ti).catch(function(hr){if(hr!==Hr)throw hr})}}return function(ne,ye,We){var Ke=function(tn){return ze(tn)?tn.meta.arg.queryCacheKey:rt(tn)?tn.meta.requestId:J.internalActions.removeQueryResult.match(tn)?tn.payload.queryCacheKey:J.internalActions.removeMutationResult.match(tn)?Sr(tn.payload):""}(ne);if(re.pending.match(ne)){var it=We[te].queries[Ke],ot=ye.getState()[te].queries[Ke];!it&&ot&&Ae(ne.meta.arg.endpointName,ne.meta.arg.originalArgs,Ke,ye,ne.meta.requestId)}else if(De.pending.match(ne))(ot=ye.getState()[te].mutations[Ke])&&Ae(ne.meta.arg.endpointName,ne.meta.arg.originalArgs,Ke,ye,ne.meta.requestId);else if(Oe(ne))(en=Ue[Ke])!=null&&en.valueResolved&&(en.valueResolved({data:ne.payload,meta:ne.meta.baseQueryMeta}),delete en.valueResolved);else if(J.internalActions.removeQueryResult.match(ne)||J.internalActions.removeMutationResult.match(ne))(en=Ue[Ke])&&(delete Ue[Ke],en.cacheEntryRemoved());else if(J.util.resetApiState.match(ne))for(var pt=0,_t=Object.entries(Ue);pt<_t.length;pt++){var wt=_t[pt],en=wt[1];delete Ue[wt[0]],en.cacheEntryRemoved()}}},no=v(So),si=function(W){var J=W.api,te=W.context,le=W.queryThunk,re=W.mutationThunk,De=(0,no.isPending)(le,re),ze=(0,no.isRejected)(le,re),rt=(0,no.isFulfilled)(le,re),Oe={};return function(Ue,Ae){var ne,ye,We;if(De(Ue)){var Ke=Ue.meta,it=Ke.requestId,ot=Ke.arg,pt=ot.endpointName,_t=ot.originalArgs,wt=te.endpointDefinitions[pt],en=wt==null?void 0:wt.onQueryStarted;if(en){var tn={},Ei=new Promise(function(ps,Je){tn.resolve=ps,tn.reject=Je});Ei.catch(function(){}),Oe[it]=tn;var bo=J.endpoints[pt].select(wt.type===Q.query?_t:it),Ti=Ae.dispatch(function(ps,Je,nn){return nn}),hr=_(b({},Ae),{getCacheEntry:function(){return bo(Ae.getState())},requestId:it,extra:Ti,updateCachedData:wt.type===Q.query?function(ps){return Ae.dispatch(J.util.updateQueryData(pt,_t,ps))}:void 0,queryFulfilled:Ei});en(_t,hr)}}else if(rt(Ue)){var li=Ue.meta,jn=li.baseQueryMeta;(ne=Oe[it=li.requestId])==null||ne.resolve({data:Ue.payload,meta:jn}),delete Oe[it]}else if(ze(Ue)){var ro=Ue.meta;jn=ro.baseQueryMeta,(We=Oe[it=ro.requestId])==null||We.reject({error:(ye=Ue.payload)!=null?ye:Ue.error,isUnhandledError:!ro.rejectedWithValue,meta:jn}),delete Oe[it]}}},Mr=function(W){var J=W.api,te=W.context.apiUid;return function(le,re){J.util.resetApiState.match(le)&&re.dispatch(J.internalActions.middlewareRegistered(te))}},hs=v(Oh),Us=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof ut<"u"?ut:globalThis):function(W){return(_o||(_o=Promise.resolve())).then(W).catch(function(J){return setTimeout(function(){throw J},0)})};function ai(W){for(var J=[],te=1;te<arguments.length;te++)J[te-1]=arguments[te];Object.assign.apply(Object,i([W],J))}var yl=v(Oh),Bo=Symbol(),qr=function(){return{name:Bo,init:function(W,J,te){var le=J.baseQuery,re=J.reducerPath,De=J.serializeQueryArgs,ze=J.keepUnusedDataFor,rt=J.refetchOnMountOrArgChange,Oe=J.refetchOnFocus,Ue=J.refetchOnReconnect;(0,yl.enablePatches)();var Ae=function(Je){return Je};Object.assign(W,{reducerPath:re,endpoints:{},internalActions:{onOnline:U,onOffline:V,onFocus:I,onFocusLost:F},util:{}});var ne=function(Je){var nn=this,Kt=Je.reducerPath,Qn=Je.baseQuery,pr=Je.context.endpointDefinitions,ui=Je.serializeQueryArgs,dn=Je.api,Pt=function(ve,Xe){return S(nn,[ve,Xe],function(Le,Ce){var je,st,$e,_e,se,Se,ue,fe,be,Qe,Ge,Ee,xt,Lt=Ce.signal,$t=Ce.abort,Yn=Ce.rejectWithValue,ar=Ce.fulfillWithValue,On=Ce.dispatch,bn=Ce.getState,ji=Ce.extra;return r(this,function($){switch($.label){case 0:je=pr[Le.endpointName],$.label=1;case 1:return $.trys.push([1,8,,13]),st=br,$e=void 0,_e={signal:Lt,abort:$t,dispatch:On,getState:bn,extra:ji,endpoint:Le.endpointName,type:Le.type,forced:Le.type==="query"?Bt(Le,bn()):void 0},(se=Le.type==="query"?Le[et]:void 0)?($e=se(),[3,6]):[3,2];case 2:return je.query?[4,Qn(je.query(Le.originalArgs),_e,je.extraOptions)]:[3,4];case 3:return $e=$.sent(),je.transformResponse&&(st=je.transformResponse),[3,6];case 4:return[4,je.queryFn(Le.originalArgs,_e,je.extraOptions,function(G){return Qn(G,_e,je.extraOptions)})];case 5:$e=$.sent(),$.label=6;case 6:if($e.error)throw new P($e.error,$e.meta);return Se=ar,[4,st($e.data,$e.meta,Le.originalArgs)];case 7:return[2,Se.apply(void 0,[$.sent(),(Ee={fulfilledTimeStamp:Date.now(),baseQueryMeta:$e.meta},Ee[Ht.SHOULD_AUTOBATCH]=!0,Ee)])];case 8:if(ue=$.sent(),!((fe=ue)instanceof P))return[3,12];be=br,je.query&&je.transformErrorResponse&&(be=je.transformErrorResponse),$.label=9;case 9:return $.trys.push([9,11,,12]),Qe=Yn,[4,be(fe.value,fe.meta,Le.originalArgs)];case 10:return[2,Qe.apply(void 0,[$.sent(),(xt={baseQueryMeta:fe.meta},xt[Ht.SHOULD_AUTOBATCH]=!0,xt)])];case 11:return Ge=$.sent(),fe=Ge,[3,12];case 12:throw console.error(fe),fe;case 13:return[2]}})})};function Bt(ve,Xe){var Le,Ce,je,st,$e=(Ce=(Le=Xe[Kt])==null?void 0:Le.queries)==null?void 0:Ce[ve.queryCacheKey],_e=(je=Xe[Kt])==null?void 0:je.config.refetchOnMountOrArgChange,se=$e==null?void 0:$e.fulfilledTimeStamp,Se=(st=ve.forceRefetch)!=null?st:ve.subscribe&&_e;return!!Se&&(Se===!0||(Number(new Date)-Number(se))/1e3>=Se)}var fn=(0,Ht.createAsyncThunk)(Kt+"/executeQuery",Pt,{getPendingMeta:function(){var ve;return(ve={startedTimeStamp:Date.now()})[Ht.SHOULD_AUTOBATCH]=!0,ve},condition:function(ve,Xe){var Le,Ce,je,st=(0,Xe.getState)(),$e=(Ce=(Le=st[Kt])==null?void 0:Le.queries)==null?void 0:Ce[ve.queryCacheKey],_e=$e==null?void 0:$e.fulfilledTimeStamp,se=ve.originalArgs,Se=$e==null?void 0:$e.originalArgs,ue=pr[ve.endpointName];return!(!Ne(ve)&&(($e==null?void 0:$e.status)==="pending"||!Bt(ve,st)&&(!ee(ue)||!((je=ue==null?void 0:ue.forceRefetch)!=null&&je.call(ue,{currentArg:se,previousArg:Se,endpointState:$e,state:st})))&&_e))},dispatchConditionRejection:!0}),Xt=(0,Ht.createAsyncThunk)(Kt+"/executeMutation",Pt,{getPendingMeta:function(){var ve;return(ve={startedTimeStamp:Date.now()})[Ht.SHOULD_AUTOBATCH]=!0,ve}});function sn(ve){return function(Xe){var Le,Ce;return((Ce=(Le=Xe==null?void 0:Xe.meta)==null?void 0:Le.arg)==null?void 0:Ce.endpointName)===ve}}return{queryThunk:fn,mutationThunk:Xt,prefetch:function(ve,Xe,Le){return function(Ce,je){var st=function(ue){return"force"in ue}(Le)&&Le.force,$e=function(ue){return"ifOlderThan"in ue}(Le)&&Le.ifOlderThan,_e=function(ue){return ue===void 0&&(ue=!0),dn.endpoints[ve].initiate(Xe,{forceRefetch:ue})},se=dn.endpoints[ve].select(Xe)(je());if(st)Ce(_e());else if($e){var Se=se==null?void 0:se.fulfilledTimeStamp;if(!Se)return void Ce(_e());(Number(new Date)-Number(new Date(Se)))/1e3>=$e&&Ce(_e())}else Ce(_e(!1))}},updateQueryData:function(ve,Xe,Le){return function(Ce,je){var st,$e,_e=dn.endpoints[ve].select(Xe)(je()),se={patches:[],inversePatches:[],undo:function(){return Ce(dn.util.patchQueryData(ve,Xe,se.inversePatches))}};if(_e.status===t.uninitialized)return se;if("data"in _e)if((0,Te.isDraftable)(_e.data)){var Se=(0,Te.produceWithPatches)(_e.data,Le),ue=Se[2];(st=se.patches).push.apply(st,Se[1]),($e=se.inversePatches).push.apply($e,ue)}else{var fe=Le(_e.data);se.patches.push({op:"replace",path:[],value:fe}),se.inversePatches.push({op:"replace",path:[],value:_e.data})}return Ce(dn.util.patchQueryData(ve,Xe,se.patches)),se}},upsertQueryData:function(ve,Xe,Le){return function(Ce){var je;return Ce(dn.endpoints[ve].initiate(Xe,((je={subscribe:!1,forceRefetch:!0})[et]=function(){return{data:Le}},je)))}},patchQueryData:function(ve,Xe,Le){return function(Ce){Ce(dn.internalActions.queryResultPatched({queryCacheKey:ui({queryArgs:Xe,endpointDefinition:pr[ve],endpointName:ve}),patches:Le}))}},buildMatchThunkActions:function(ve,Xe){return{matchPending:(0,lt.isAllOf)((0,lt.isPending)(ve),sn(Xe)),matchFulfilled:(0,lt.isAllOf)((0,lt.isFulfilled)(ve),sn(Xe)),matchRejected:(0,lt.isAllOf)((0,lt.isRejected)(ve),sn(Xe))}}}}({baseQuery:le,reducerPath:re,context:te,api:W,serializeQueryArgs:De}),ye=ne.queryThunk,We=ne.mutationThunk,Ke=ne.patchQueryData,it=ne.updateQueryData,ot=ne.upsertQueryData,pt=ne.prefetch,_t=ne.buildMatchThunkActions,wt=function(Je){var nn=Je.reducerPath,Kt=Je.queryThunk,Qn=Je.mutationThunk,pr=Je.context,ui=pr.endpointDefinitions,dn=pr.apiUid,Pt=pr.extractRehydrationInfo,Bt=pr.hasRehydrationInfo,fn=Je.assertTagType,Xt=Je.config,sn=(0,ae.createAction)(nn+"/resetApiState"),ve=(0,ae.createSlice)({name:nn+"/queries",initialState:Vr,reducers:{removeQueryResult:{reducer:function(_e,se){delete _e[se.payload.queryCacheKey]},prepare:(0,ae.prepareAutoBatched)()},queryResultPatched:function(_e,se){var Se=se.payload,ue=Se.patches;kn(_e,Se.queryCacheKey,function(fe){fe.data=(0,qt.applyPatches)(fe.data,ue.concat())})}},extraReducers:function(_e){_e.addCase(Kt.pending,function(se,Se){var ue,fe=Se.meta,be=Se.meta.arg,Qe=Ne(be);(be.subscribe||Qe)&&(se[ue=be.queryCacheKey]!=null||(se[ue]={status:t.uninitialized,endpointName:be.endpointName})),kn(se,be.queryCacheKey,function(Ge){Ge.status=t.pending,Ge.requestId=Qe&&Ge.requestId?Ge.requestId:fe.requestId,be.originalArgs!==void 0&&(Ge.originalArgs=be.originalArgs),Ge.startedTimeStamp=fe.startedTimeStamp})}).addCase(Kt.fulfilled,function(se,Se){var ue=Se.meta,fe=Se.payload;kn(se,ue.arg.queryCacheKey,function(be){var Qe;if(be.requestId===ue.requestId||Ne(ue.arg)){var Ge=ui[ue.arg.endpointName].merge;if(be.status=t.fulfilled,Ge)if(be.data!==void 0){var Ee=ue.fulfilledTimeStamp,xt=ue.arg,Lt=ue.baseQueryMeta,$t=ue.requestId,Yn=(0,ae.createNextState)(be.data,function(ar){return Ge(ar,fe,{arg:xt.originalArgs,baseQueryMeta:Lt,fulfilledTimeStamp:Ee,requestId:$t})});be.data=Yn}else be.data=fe;else be.data=(Qe=ui[ue.arg.endpointName].structuralSharing)==null||Qe?C((0,_n.isDraft)(be.data)?(0,qt.original)(be.data):be.data,fe):fe;delete be.error,be.fulfilledTimeStamp=ue.fulfilledTimeStamp}})}).addCase(Kt.rejected,function(se,Se){var ue=Se.meta,fe=ue.condition,be=ue.requestId,Qe=Se.error,Ge=Se.payload;kn(se,ue.arg.queryCacheKey,function(Ee){if(!fe){if(Ee.requestId!==be)return;Ee.status=t.rejected,Ee.error=Ge??Qe}})}).addMatcher(Bt,function(se,Se){for(var ue=Pt(Se).queries,fe=0,be=Object.entries(ue);fe<be.length;fe++){var Qe=be[fe],Ge=Qe[1];(Ge==null?void 0:Ge.status)!==t.fulfilled&&(Ge==null?void 0:Ge.status)!==t.rejected||(se[Qe[0]]=Ge)}})}}),Xe=(0,ae.createSlice)({name:nn+"/mutations",initialState:Vr,reducers:{removeMutationResult:{reducer:function(_e,se){var Se=Sr(se.payload);Se in _e&&delete _e[Se]},prepare:(0,ae.prepareAutoBatched)()}},extraReducers:function(_e){_e.addCase(Qn.pending,function(se,Se){var ue=Se.meta,fe=ue.requestId,be=ue.arg,Qe=ue.startedTimeStamp;be.track&&(se[Sr(Se.meta)]={requestId:fe,status:t.pending,endpointName:be.endpointName,startedTimeStamp:Qe})}).addCase(Qn.fulfilled,function(se,Se){var ue=Se.payload,fe=Se.meta;fe.arg.track&&eo(se,fe,function(be){be.requestId===fe.requestId&&(be.status=t.fulfilled,be.data=ue,be.fulfilledTimeStamp=fe.fulfilledTimeStamp)})}).addCase(Qn.rejected,function(se,Se){var ue=Se.payload,fe=Se.error,be=Se.meta;be.arg.track&&eo(se,be,function(Qe){Qe.requestId===be.requestId&&(Qe.status=t.rejected,Qe.error=ue??fe)})}).addMatcher(Bt,function(se,Se){for(var ue=Pt(Se).mutations,fe=0,be=Object.entries(ue);fe<be.length;fe++){var Qe=be[fe],Ge=Qe[0],Ee=Qe[1];(Ee==null?void 0:Ee.status)!==t.fulfilled&&(Ee==null?void 0:Ee.status)!==t.rejected||Ge===(Ee==null?void 0:Ee.requestId)||(se[Ge]=Ee)}})}}),Le=(0,ae.createSlice)({name:nn+"/invalidation",initialState:Vr,reducers:{},extraReducers:function(_e){_e.addCase(ve.actions.removeQueryResult,function(se,Se){for(var ue=Se.payload.queryCacheKey,fe=0,be=Object.values(se);fe<be.length;fe++)for(var Qe=0,Ge=Object.values(be[fe]);Qe<Ge.length;Qe++){var Ee=Ge[Qe],xt=Ee.indexOf(ue);xt!==-1&&Ee.splice(xt,1)}}).addMatcher(Bt,function(se,Se){for(var ue,fe,be,Qe,Ge=Pt(Se).provided,Ee=0,xt=Object.entries(Ge);Ee<xt.length;Ee++)for(var Lt=xt[Ee],$t=Lt[0],Yn=0,ar=Object.entries(Lt[1]);Yn<ar.length;Yn++)for(var On=ar[Yn],bn=On[0],ji=On[1],$=(Qe=(fe=(ue=se[$t])!=null?ue:se[$t]={})[be=bn||"__internal_without_id"])!=null?Qe:fe[be]=[],G=0,X=ji;G<X.length;G++){var de=X[G];$.includes(de)||$.push(de)}}).addMatcher((0,ae.isAnyOf)((0,ae.isFulfilled)(Kt),(0,ae.isRejectedWithValue)(Kt)),function(se,Se){for(var ue,fe,be,Qe,Ge=An(Se,"providesTags",ui,fn),Ee=Se.meta.arg.queryCacheKey,xt=0,Lt=Object.values(se);xt<Lt.length;xt++)for(var $t=0,Yn=Object.values(Lt[xt]);$t<Yn.length;$t++){var ar=Yn[$t],On=ar.indexOf(Ee);On!==-1&&ar.splice(On,1)}for(var bn=0,ji=Ge;bn<ji.length;bn++){var $=ji[bn],G=$.type,X=$.id,de=(Qe=(fe=(ue=se[G])!=null?ue:se[G]={})[be=X||"__internal_without_id"])!=null?Qe:fe[be]=[];de.includes(Ee)||de.push(Ee)}})}}),Ce=(0,ae.createSlice)({name:nn+"/subscriptions",initialState:Vr,reducers:{updateSubscriptionOptions:function(_e,se){},unsubscribeQueryResult:function(_e,se){},internal_probeSubscription:function(_e,se){}}}),je=(0,ae.createSlice)({name:nn+"/internalSubscriptions",initialState:Vr,reducers:{subscriptionsUpdated:{reducer:function(_e,se){return(0,qt.applyPatches)(_e,se.payload)},prepare:(0,ae.prepareAutoBatched)()}}}),st=(0,ae.createSlice)({name:nn+"/config",initialState:b({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Xt),reducers:{middlewareRegistered:function(_e,se){_e.middlewareRegistered=_e.middlewareRegistered!=="conflict"&&dn===se.payload||"conflict"}},extraReducers:function(_e){_e.addCase(U,function(se){se.online=!0}).addCase(V,function(se){se.online=!1}).addCase(I,function(se){se.focused=!0}).addCase(F,function(se){se.focused=!1}).addMatcher(Bt,function(se){return b({},se)})}}),$e=(0,ae.combineReducers)({queries:ve.reducer,mutations:Xe.reducer,provided:Le.reducer,subscriptions:je.reducer,config:st.reducer});return{reducer:function(_e,se){return $e(sn.match(se)?void 0:_e,se)},actions:_(b(b(b(b(b({},st.actions),ve.actions),Ce.actions),je.actions),Xe.actions),{unsubscribeMutationResult:Xe.actions.removeMutationResult,resetApiState:sn})}}({context:te,queryThunk:ye,mutationThunk:We,reducerPath:re,assertTagType:Ae,config:{refetchOnFocus:Oe,refetchOnReconnect:Ue,refetchOnMountOrArgChange:rt,keepUnusedDataFor:ze,reducerPath:re}}),en=wt.reducer,tn=wt.actions;ai(W.util,{patchQueryData:Ke,updateQueryData:it,upsertQueryData:ot,prefetch:pt,resetApiState:tn.resetApiState}),ai(W.internalActions,tn);var Ei=function(Je){var nn=Je.reducerPath,Kt=Je.queryThunk,Qn=Je.api,pr=Je.context,ui=pr.apiUid,dn={invalidateTags:(0,Ea.createAction)(nn+"/invalidateTags")},Pt=[Mr,Rn,Ir,xr,Ci,si];return{middleware:function(fn){var Xt=!1,sn=_(b({},Je),{internalState:{currentSubscriptions:{}},refetchQuery:Bt}),ve=Pt.map(function(Ce){return Ce(sn)}),Xe=function(Ce){var je=Ce.api,st=Ce.queryThunk,$e=Ce.internalState,_e=je.reducerPath+"/subscriptions",se=null,Se=!1,ue=je.internalActions,fe=ue.updateSubscriptionOptions,be=ue.unsubscribeQueryResult;return function(Qe,Ge){var Ee,xt;if(se||(se=JSON.parse(JSON.stringify($e.currentSubscriptions))),je.util.resetApiState.match(Qe))return se=$e.currentSubscriptions={},[!0,!1];if(je.internalActions.internal_probeSubscription.match(Qe)){var Lt=Qe.payload;return[!1,!!((Ee=$e.currentSubscriptions[Lt.queryCacheKey])!=null&&Ee[Lt.requestId])]}var $t=function(On,bn){var ji,$,G,X,de,bt,rn,Sn,Et;if(fe.match(bn)){var hn=bn.payload,ci=hn.queryCacheKey,Vn=hn.requestId;return(ji=On==null?void 0:On[ci])!=null&&ji[Vn]&&(On[ci][Vn]=hn.options),!0}if(be.match(bn)){var vl=bn.payload;return Vn=vl.requestId,On[ci=vl.queryCacheKey]&&delete On[ci][Vn],!0}if(je.internalActions.removeQueryResult.match(bn))return delete On[bn.payload.queryCacheKey],!0;if(st.pending.match(bn)){var sd=bn.meta;if(Vn=sd.requestId,(ld=sd.arg).subscribe)return(_l=(G=On[$=ld.queryCacheKey])!=null?G:On[$]={})[Vn]=(de=(X=ld.subscriptionOptions)!=null?X:_l[Vn])!=null?de:{},!0}if(st.rejected.match(bn)){var _l,ad=bn.meta,ld=ad.arg;if(Vn=ad.requestId,ad.condition&&ld.subscribe)return(_l=(rn=On[bt=ld.queryCacheKey])!=null?rn:On[bt]={})[Vn]=(Et=(Sn=ld.subscriptionOptions)!=null?Sn:_l[Vn])!=null?Et:{},!0}return!1}($e.currentSubscriptions,Qe);if($t){Se||(Us(function(){var On=JSON.parse(JSON.stringify($e.currentSubscriptions)),bn=(0,hs.produceWithPatches)(se,function(){return On});Ge.next(je.internalActions.subscriptionsUpdated(bn[1])),se=On,Se=!1}),Se=!0);var Yn=!!((xt=Qe.type)!=null&&xt.startsWith(_e)),ar=st.rejected.match(Qe)&&Qe.meta.condition&&!!Qe.meta.arg.subscribe;return[!Yn&&!ar,!1]}return[!0,!1]}}(sn),Le=function(Ce){var je=Ce.reducerPath,st=Ce.context,$e=Ce.refetchQuery,_e=Ce.internalState,se=Ce.api.internalActions.removeQueryResult;function Se(ue,fe){var be=ue.getState()[je],Qe=be.queries,Ge=_e.currentSubscriptions;st.batch(function(){for(var Ee=0,xt=Object.keys(Ge);Ee<xt.length;Ee++){var Lt=xt[Ee],$t=Qe[Lt],Yn=Ge[Lt];Yn&&$t&&(Object.values(Yn).some(function(ar){return ar[fe]===!0})||Object.values(Yn).every(function(ar){return ar[fe]===void 0})&&be.config[fe])&&(Object.keys(Yn).length===0?ue.dispatch(se({queryCacheKey:Lt})):$t.status!==t.uninitialized&&ue.dispatch($e($t,Lt)))}})}return function(ue,fe){I.match(ue)&&Se(fe,"refetchOnFocus"),U.match(ue)&&Se(fe,"refetchOnReconnect")}}(sn);return function(Ce){return function(je){Xt||(Xt=!0,fn.dispatch(Qn.internalActions.middlewareRegistered(ui)));var st,$e=_(b({},fn),{next:Ce}),_e=fn.getState(),se=Xe(je,$e,_e),Se=se[1];if(st=se[0]?Ce(je):Se,fn.getState()[nn]&&(Le(je,$e,_e),function(be){return!!be&&typeof be.type=="string"&&be.type.startsWith(nn+"/")}(je)||pr.hasRehydrationInfo(je)))for(var ue=0,fe=ve;ue<fe.length;ue++)(0,fe[ue])(je,$e,_e);return st}}},actions:dn};function Bt(fn,Xt,sn){return sn===void 0&&(sn={}),Kt(b({type:"query",endpointName:fn.endpointName,originalArgs:fn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Xt},sn))}}({reducerPath:re,context:te,queryThunk:ye,mutationThunk:We,api:W,assertTagType:Ae}),bo=Ei.middleware;ai(W.util,Ei.actions),ai(W,{reducer:en,middleware:bo});var Ti=function(Je){var nn=Je.serializeQueryArgs,Kt=Je.reducerPath,Qn=function(Pt){return Pn},pr=function(Pt){return cn};return{buildQuerySelector:function(Pt,Bt){return function(fn){var Xt=nn({queryArgs:fn,endpointDefinition:Bt,endpointName:Pt});return(0,K.createSelector)(fn===sr?Qn:function(sn){var ve,Xe,Le;return(Le=(Xe=(ve=dn(sn))==null?void 0:ve.queries)==null?void 0:Xe[Xt])!=null?Le:Pn},ui)}},buildMutationSelector:function(){return function(Pt){var Bt,fn;return fn=typeof Pt=="object"?(Bt=Sr(Pt))!=null?Bt:sr:Pt,(0,K.createSelector)(fn===sr?pr:function(Xt){var sn,ve,Xe;return(Xe=(ve=(sn=dn(Xt))==null?void 0:sn.mutations)==null?void 0:ve[fn])!=null?Xe:cn},ui)}},selectInvalidatedBy:function(Pt,Bt){for(var fn,Xt=Pt[Kt],sn=new Set,ve=0,Xe=Bt.map(ge);ve<Xe.length;ve++){var Le=Xe[ve],Ce=Xt.provided[Le.type];if(Ce)for(var je=0,st=(fn=Le.id!==void 0?Ce[Le.id]:w(Object.values(Ce)))!=null?fn:[];je<st.length;je++)sn.add(st[je])}return w(Array.from(sn.values()).map(function($e){var _e=Xt.queries[$e];return _e?[{queryCacheKey:$e,endpointName:_e.endpointName,originalArgs:_e.originalArgs}]:[]}))}};function ui(Pt){return b(b({},Pt),{status:Bt=Pt.status,isUninitialized:Bt===t.uninitialized,isLoading:Bt===t.pending,isSuccess:Bt===t.fulfilled,isError:Bt===t.rejected});var Bt}function dn(Pt){return Pt[Kt]}}({serializeQueryArgs:De,reducerPath:re}),hr=Ti.buildQuerySelector,li=Ti.buildMutationSelector;ai(W.util,{selectInvalidatedBy:Ti.selectInvalidatedBy});var jn=function(Je){var nn=Je.serializeQueryArgs,Kt=Je.queryThunk,Qn=Je.mutationThunk,pr=Je.api,ui=Je.context,dn=new Map,Pt=new Map,Bt=pr.internalActions,fn=Bt.unsubscribeQueryResult,Xt=Bt.removeMutationResult,sn=Bt.updateSubscriptionOptions;return{buildInitiateQuery:function(ve,Xe){var Le=function(Ce,je){var st=je===void 0?{}:je,$e=st.subscribe,_e=$e===void 0||$e,se=st.forceRefetch,Se=st.subscriptionOptions,ue=st[et];return function(fe,be){var Qe,Ge,Ee=nn({queryArgs:Ce,endpointDefinition:Xe,endpointName:ve}),xt=Kt(((Qe={type:"query",subscribe:_e,forceRefetch:se,subscriptionOptions:Se,endpointName:ve,originalArgs:Ce,queryCacheKey:Ee})[et]=ue,Qe)),Lt=pr.endpoints[ve].select(Ce),$t=fe(xt),Yn=Lt(be()),ar=$t.requestId,On=$t.abort,bn=Yn.requestId!==ar,ji=(Ge=dn.get(fe))==null?void 0:Ge[Ee],$=function(){return Lt(be())},G=Object.assign(ue?$t.then($):bn&&!ji?Promise.resolve(Yn):Promise.all([ji,$t]).then($),{arg:Ce,requestId:ar,subscriptionOptions:Se,queryCacheKey:Ee,abort:On,unwrap:function(){return S(this,null,function(){var de;return r(this,function(bt){switch(bt.label){case 0:return[4,G];case 1:if((de=bt.sent()).isError)throw de.error;return[2,de.data]}})})},refetch:function(){return fe(Le(Ce,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){_e&&fe(fn({queryCacheKey:Ee,requestId:ar}))},updateSubscriptionOptions:function(de){G.subscriptionOptions=de,fe(sn({endpointName:ve,requestId:ar,queryCacheKey:Ee,options:de}))}});if(!ji&&!bn&&!ue){var X=dn.get(fe)||{};X[Ee]=G,dn.set(fe,X),G.then(function(){delete X[Ee],Object.keys(X).length||dn.delete(fe)})}return G}};return Le},buildInitiateMutation:function(ve){return function(Xe,Le){var Ce=Le===void 0?{}:Le,je=Ce.track,st=je===void 0||je,$e=Ce.fixedCacheKey;return function(_e,se){var Se=Qn({type:"mutation",endpointName:ve,originalArgs:Xe,track:st,fixedCacheKey:$e}),ue=_e(Se),fe=ue.requestId,be=ue.abort,Qe=ue.unwrap,Ge=ue.unwrap().then(function($t){return{data:$t}}).catch(function($t){return{error:$t}}),Ee=function(){_e(Xt({requestId:fe,fixedCacheKey:$e}))},xt=Object.assign(Ge,{arg:ue.arg,requestId:fe,abort:be,unwrap:Qe,unsubscribe:Ee,reset:Ee}),Lt=Pt.get(_e)||{};return Pt.set(_e,Lt),Lt[fe]=xt,xt.then(function(){delete Lt[fe],Object.keys(Lt).length||Pt.delete(_e)}),$e&&(Lt[$e]=xt,xt.then(function(){Lt[$e]===xt&&(delete Lt[$e],Object.keys(Lt).length||Pt.delete(_e))})),xt}}},getRunningQueryThunk:function(ve,Xe){return function(Le){var Ce,je=nn({queryArgs:Xe,endpointDefinition:ui.endpointDefinitions[ve],endpointName:ve});return(Ce=dn.get(Le))==null?void 0:Ce[je]}},getRunningMutationThunk:function(ve,Xe){return function(Le){var Ce;return(Ce=Pt.get(Le))==null?void 0:Ce[Xe]}},getRunningQueriesThunk:function(){return function(ve){return Object.values(dn.get(ve)||{}).filter(dt)}},getRunningMutationsThunk:function(){return function(ve){return Object.values(Pt.get(ve)||{}).filter(dt)}},getRunningOperationPromises:function(){var ve=function(Xe){return Array.from(Xe.values()).flatMap(function(Le){return Le?Object.values(Le):[]})};return i(i([],ve(dn)),ve(Pt)).filter(dt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:ye,mutationThunk:We,api:W,serializeQueryArgs:De,context:te}),ro=jn.buildInitiateQuery,ps=jn.buildInitiateMutation;return ai(W.util,{getRunningOperationPromises:jn.getRunningOperationPromises,getRunningOperationPromise:jn.removalWarning,getRunningMutationThunk:jn.getRunningMutationThunk,getRunningMutationsThunk:jn.getRunningMutationsThunk,getRunningQueryThunk:jn.getRunningQueryThunk,getRunningQueriesThunk:jn.getRunningQueriesThunk}),{name:Bo,injectEndpoint:function(Je,nn){var Kt,Qn=W;(Kt=Qn.endpoints)[Je]!=null||(Kt[Je]={}),ee(nn)?ai(Qn.endpoints[Je],{name:Je,select:hr(Je,nn),initiate:ro(Je,nn)},_t(ye,Je)):nn.type===Q.mutation&&ai(Qn.endpoints[Je],{name:Je,select:li(),initiate:ps(Je)},_t(We,Je))}}}}},Ta=to(qr())})(xD);wD.exports=xD;var tre=wD.exports;const Xr=["general"],jl=["control","mask","user","other"],nre=100,Cy=20,CD=z.enum(["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","IPAdapterField","IPAdapterModelField","LatentsCollection","LatentsField","LatentsPolymorphic","LoRAModelField","MainModelField","ONNXModelField","Scheduler","SDXLMainModelField","SDXLRefinerModelField","string","StringCollection","StringPolymorphic","UNetField","VaeField","VaeModelField"]),rre=z.enum(["WorkflowField","IsIntermediate","MetadataField"]),Xk=e=>CD.safeParse(e).success||rre.safeParse(e).success;z.enum(["connection","direct","any"]);const ED=z.object({id:z.string().trim().min(1),name:z.string().trim().min(1),type:CD}),ire=ED.extend({fieldKind:z.literal("output")}),ht=ED.extend({fieldKind:z.literal("input"),label:z.string()}),Hc=z.object({model_name:z.string().trim().min(1),base_model:Gc}),Lf=z.object({image_name:z.string().trim().min(1)}),Vv=z.object({latents_name:z.string().trim().min(1),seed:z.number().int().optional()}),Gv=z.object({conditioning_name:z.string().trim().min(1)}),ore=z.object({mask_name:z.string().trim().min(1),masked_latents_name:z.string().trim().min(1).optional()}),sre=ht.extend({type:z.literal("integer"),value:z.number().int().optional()}),are=ht.extend({type:z.literal("IntegerCollection"),value:z.array(z.number().int()).optional()}),lre=ht.extend({type:z.literal("IntegerPolymorphic"),value:z.union([z.number().int(),z.array(z.number().int())]).optional()}),ure=ht.extend({type:z.literal("float"),value:z.number().optional()}),cre=ht.extend({type:z.literal("FloatCollection"),value:z.array(z.number()).optional()}),dre=ht.extend({type:z.literal("FloatPolymorphic"),value:z.union([z.number(),z.array(z.number())]).optional()}),fre=ht.extend({type:z.literal("string"),value:z.string().optional()}),hre=ht.extend({type:z.literal("StringCollection"),value:z.array(z.string()).optional()}),pre=ht.extend({type:z.literal("StringPolymorphic"),value:z.union([z.string(),z.array(z.string())]).optional()}),gre=ht.extend({type:z.literal("boolean"),value:z.boolean().optional()}),mre=ht.extend({type:z.literal("BooleanCollection"),value:z.array(z.boolean()).optional()}),yre=ht.extend({type:z.literal("BooleanPolymorphic"),value:z.union([z.boolean(),z.array(z.boolean())]).optional()}),vre=ht.extend({type:z.literal("enum"),value:z.string().optional()}),_re=ht.extend({type:z.literal("LatentsField"),value:Vv.optional()}),bre=ht.extend({type:z.literal("LatentsCollection"),value:z.array(Vv).optional()}),Sre=ht.extend({type:z.literal("LatentsPolymorphic"),value:z.union([Vv,z.array(Vv)]).optional()}),wre=ht.extend({type:z.literal("DenoiseMaskField"),value:ore.optional()}),xre=ht.extend({type:z.literal("ConditioningField"),value:Gv.optional()}),Cre=ht.extend({type:z.literal("ConditioningCollection"),value:z.array(Gv).optional()}),Ere=ht.extend({type:z.literal("ConditioningPolymorphic"),value:z.union([Gv,z.array(Gv)]).optional()}),Tre=Hc,bg=z.object({image:Lf,control_model:Tre,control_weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),control_mode:z.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),Are=ht.extend({type:z.literal("ControlField"),value:bg.optional()}),kre=ht.extend({type:z.literal("ControlPolymorphic"),value:z.union([bg,z.array(bg)]).optional()}),Pre=ht.extend({type:z.literal("ControlCollection"),value:z.array(bg).optional()}),Rre=Hc,Ore=z.object({image:Lf,ip_adapter_model:Rre,image_encoder_model:z.string().trim().min(1),weight:z.number()}),Ire=ht.extend({type:z.literal("IPAdapterField"),value:Ore.optional()}),Mre=z.enum(["onnx","main","vae","lora","controlnet","embedding"]),Nre=z.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),$f=Hc.extend({model_type:Mre,submodel:Nre.optional()}),TD=$f.extend({weight:z.number().optional()}),Dre=z.object({unet:$f,scheduler:$f,loras:z.array(TD)}),Lre=ht.extend({type:z.literal("UNetField"),value:Dre.optional()}),$re=z.object({tokenizer:$f,text_encoder:$f,skipped_layers:z.number(),loras:z.array(TD)}),Fre=ht.extend({type:z.literal("ClipField"),value:$re.optional()}),Bre=z.object({vae:$f}),zre=ht.extend({type:z.literal("VaeField"),value:Bre.optional()}),Ure=ht.extend({type:z.literal("ImageField"),value:Lf.optional()}),jre=ht.extend({type:z.literal("ImagePolymorphic"),value:z.union([Lf,z.array(Lf)]).optional()}),Vre=ht.extend({type:z.literal("ImageCollection"),value:z.array(Lf).optional()}),Gre=ht.extend({type:z.literal("MainModelField"),value:xm.optional()}),Hre=ht.extend({type:z.literal("SDXLMainModelField"),value:xm.optional()}),qre=ht.extend({type:z.literal("SDXLRefinerModelField"),value:xm.optional()}),AD=Hc,Wre=ht.extend({type:z.literal("VaeModelField"),value:AD.optional()}),kD=Hc,Kre=ht.extend({type:z.literal("LoRAModelField"),value:kD.optional()}),Xre=Hc,Qre=ht.extend({type:z.literal("ControlNetModelField"),value:Xre.optional()}),Yre=Hc,Zre=ht.extend({type:z.literal("IPAdapterModelField"),value:Yre.optional()}),Jre=ht.extend({type:z.literal("Collection"),value:z.array(z.any()).optional()}),eie=ht.extend({type:z.literal("CollectionItem"),value:z.any().optional()}),Hv=z.object({r:z.number().int().min(0).max(255),g:z.number().int().min(0).max(255),b:z.number().int().min(0).max(255),a:z.number().int().min(0).max(255)}),tie=ht.extend({type:z.literal("ColorField"),value:Hv.optional()}),nie=ht.extend({type:z.literal("ColorCollection"),value:z.array(Hv).optional()}),rie=ht.extend({type:z.literal("ColorPolymorphic"),value:z.union([Hv,z.array(Hv)]).optional()}),iie=ht.extend({type:z.literal("Scheduler"),value:fD.optional()}),oie=z.discriminatedUnion("type",[mre,gre,yre,Fre,Jre,eie,tie,nie,rie,xre,Cre,Ere,Are,Qre,Pre,kre,wre,vre,cre,ure,dre,Vre,jre,Ure,are,lre,sre,Ire,Zre,_re,bre,Sre,Kre,Gre,iie,Hre,qre,hre,pre,fre,Lre,zre,Wre]),NRe=e=>!!(e&&e.fieldKind==="input"),DRe=e=>!!(e&&e.fieldKind==="input"),sie=e=>!!(e&&!("$ref"in e)),Qk=e=>!!(e&&!("$ref"in e)&&e.type==="array"),Ey=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),Ih=e=>!!(e&&"$ref"in e),aie=e=>"class"in e&&e.class==="invocation",lie=e=>"class"in e&&e.class==="output",Yk=e=>!("$ref"in e),PD=z.object({app_version:z.string().nullish(),generation_mode:z.string().nullish(),created_by:z.string().nullish(),positive_prompt:z.string().nullish(),negative_prompt:z.string().nullish(),width:z.number().int().nullish(),height:z.number().int().nullish(),seed:z.number().int().nullish(),rand_device:z.string().nullish(),cfg_scale:z.number().nullish(),steps:z.number().int().nullish(),scheduler:z.string().nullish(),clip_skip:z.number().int().nullish(),model:z.union([M_.deepPartial(),hD.deepPartial()]).nullish(),controlnets:z.array(bg.deepPartial()).nullish(),loras:z.array(z.object({lora:kD.deepPartial(),weight:z.number()})).nullish(),vae:AD.nullish(),strength:z.number().nullish(),init_image:z.string().nullish(),positive_style_prompt:z.string().nullish(),negative_style_prompt:z.string().nullish(),refiner_model:yE.deepPartial().nullish(),refiner_cfg_scale:z.number().nullish(),refiner_steps:z.number().int().nullish(),refiner_scheduler:z.string().nullish(),refiner_positive_aesthetic_score:z.number().nullish(),refiner_negative_aesthetic_score:z.number().nullish(),refiner_start:z.number().nullish()}).passthrough(),bE=z.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))});bE.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});const uie=z.object({id:z.string().trim().min(1),type:z.string().trim().min(1),inputs:z.record(oie),outputs:z.record(ire),label:z.string(),isOpen:z.boolean(),notes:z.string(),embedWorkflow:z.boolean(),isIntermediate:z.boolean(),version:bE.optional()}),cie=z.object({id:z.string().trim().min(1),type:z.literal("notes"),label:z.string(),isOpen:z.boolean(),notes:z.string()}),RD=z.object({x:z.number(),y:z.number()}).default({x:0,y:0}),qv=z.number().gt(0).nullish(),OD=z.object({id:z.string().trim().min(1),type:z.literal("invocation"),data:uie,width:qv,height:qv,position:RD}),mC=e=>OD.safeParse(e).success,die=z.object({id:z.string().trim().min(1),type:z.literal("notes"),data:cie,width:qv,height:qv,position:RD}),ID=z.discriminatedUnion("type",[OD,die]),fie=z.object({source:z.string().trim().min(1),sourceHandle:z.string().trim().min(1),target:z.string().trim().min(1),targetHandle:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("default")}),hie=z.object({source:z.string().trim().min(1),target:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("collapsed")}),MD=z.union([fie,hie]),pie=z.object({nodeId:z.string().trim().min(1),fieldName:z.string().trim().min(1)}),ND=z.object({name:z.string().default(""),author:z.string().default(""),description:z.string().default(""),version:z.string().default(""),contact:z.string().default(""),tags:z.string().default(""),notes:z.string().default(""),nodes:z.array(ID).default([]),edges:z.array(MD).default([]),exposedFields:z.array(pie).default([]),meta:z.object({version:bE}).default({version:"1.0.0"})});ND.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(mC),o=mE(i,"id");return n.forEach((s,a)=>{const l=o[s.source],u=o[s.target],c=[];if(l?s.type==="default"&&!(s.sourceHandle in l.data.outputs)&&c.push(`Output field "${s.source}.${s.sourceHandle}" does not exist`):c.push(`Output node ${s.source} does not exist`),u?s.type==="default"&&!(s.targetHandle in u.data.inputs)&&c.push(`Input field "${s.target}.${s.targetHandle}" does not exist`):c.push(`Input node ${s.target} does not exist`),c.length){delete n[a];const d=s.type==="default"?s.sourceHandle:s.source,f=s.type==="default"?s.targetHandle:s.target;r.push({message:`Edge "${d} -> ${f}" skipped`,issues:c,data:s})}}),{workflow:e,warnings:r}});const Wr=e=>!!(e&&e.type==="invocation"),LRe=e=>!!(e&&!["notes","current_image"].includes(e.type)),Zk=e=>!!(e&&e.type==="notes");var La=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(La||{});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gie=4,Jk=0,eP=1,mie=2;function sh(e){let t=e.length;for(;--t>=0;)e[t]=0}const yie=0,DD=1,vie=2,_ie=3,bie=258,SE=29,Cm=256,Sg=Cm+1+SE,cf=30,wE=19,LD=2*Sg+1,oc=15,L2=16,Sie=7,xE=256,$D=16,FD=17,BD=18,yC=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),R0=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wie=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),zD=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xie=512,Ba=new Array((Sg+2)*2);sh(Ba);const Sp=new Array(cf*2);sh(Sp);const wg=new Array(xie);sh(wg);const xg=new Array(bie-_ie+1);sh(xg);const CE=new Array(SE);sh(CE);const Wv=new Array(cf);sh(Wv);function $2(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let UD,jD,VD;function F2(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const GD=e=>e<256?wg[e]:wg[256+(e>>>7)],Cg=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},lo=(e,t,n)=>{e.bi_valid>L2-n?(e.bi_buf|=t<<e.bi_valid&65535,Cg(e,e.bi_buf),e.bi_buf=t>>L2-e.bi_valid,e.bi_valid+=n-L2):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Js=(e,t,n)=>{lo(e,n[t*2],n[t*2+1])},HD=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Cie=e=>{e.bi_valid===16?(Cg(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Eie=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,f,h,p,m=0;for(f=0;f<=oc;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<LD;u++)c=e.heap[u],f=n[n[c*2+1]*2+1]+1,f>l&&(f=l,m++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,h=0,c>=a&&(h=s[c-a]),p=n[c*2],e.opt_len+=p*(f+h),o&&(e.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},qD=(e,t,n)=>{const r=new Array(oc+1);let i=0,o,s;for(o=1;o<=oc;o++)i=i+n[o-1]<<1,r[o]=i;for(s=0;s<=t;s++){let a=e[s*2+1];a!==0&&(e[s*2]=HD(r[a]++,a))}},Tie=()=>{let e,t,n,r,i;const o=new Array(oc+1);for(n=0,r=0;r<SE-1;r++)for(CE[r]=n,e=0;e<1<<yC[r];e++)xg[n++]=r;for(xg[n-1]=r,i=0,r=0;r<16;r++)for(Wv[r]=i,e=0;e<1<<R0[r];e++)wg[i++]=r;for(i>>=7;r<cf;r++)for(Wv[r]=i<<7,e=0;e<1<<R0[r]-7;e++)wg[256+i++]=r;for(t=0;t<=oc;t++)o[t]=0;for(e=0;e<=143;)Ba[e*2+1]=8,e++,o[8]++;for(;e<=255;)Ba[e*2+1]=9,e++,o[9]++;for(;e<=279;)Ba[e*2+1]=7,e++,o[7]++;for(;e<=287;)Ba[e*2+1]=8,e++,o[8]++;for(qD(Ba,Sg+1,o),e=0;e<cf;e++)Sp[e*2+1]=5,Sp[e*2]=HD(e,5);UD=new $2(Ba,yC,Cm+1,Sg,oc),jD=new $2(Sp,R0,0,cf,oc),VD=new $2(new Array(0),wie,0,wE,Sie)},WD=e=>{let t;for(t=0;t<Sg;t++)e.dyn_ltree[t*2]=0;for(t=0;t<cf;t++)e.dyn_dtree[t*2]=0;for(t=0;t<wE;t++)e.bl_tree[t*2]=0;e.dyn_ltree[xE*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},KD=e=>{e.bi_valid>8?Cg(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},tP=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},B2=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&tP(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!tP(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},nP=(e,t,n)=>{let r,i,o=0,s,a;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Js(e,i,t):(s=xg[i],Js(e,s+Cm+1,t),a=yC[s],a!==0&&(i-=CE[s],lo(e,i,a)),r--,s=GD(r),Js(e,s,n),a=R0[s],a!==0&&(r-=Wv[s],lo(e,r,a)));while(o<e.sym_next);Js(e,xE,t)},vC=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,l=-1,u;for(e.heap_len=0,e.heap_max=LD,s=0;s<o;s++)n[s*2]!==0?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)B2(e,n,s);u=o;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B2(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,n[u*2]=n[s*2]+n[a*2],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,n[s*2+1]=n[a*2+1]=u,e.heap[1]=u++,B2(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Eie(e,t),qD(n,l,e.bl_count)},rP=(e,t,n)=>{let r,i=-1,o,s=t[0*2+1],a=0,l=7,u=4;for(s===0&&(l=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=s,s=t[(r+1)*2+1],!(++a<l&&o===s)&&(a<u?e.bl_tree[o*2]+=a:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[$D*2]++):a<=10?e.bl_tree[FD*2]++:e.bl_tree[BD*2]++,a=0,i=o,s===0?(l=138,u=3):o===s?(l=6,u=3):(l=7,u=4))},iP=(e,t,n)=>{let r,i=-1,o,s=t[0*2+1],a=0,l=7,u=4;for(s===0&&(l=138,u=3),r=0;r<=n;r++)if(o=s,s=t[(r+1)*2+1],!(++a<l&&o===s)){if(a<u)do Js(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==i&&(Js(e,o,e.bl_tree),a--),Js(e,$D,e.bl_tree),lo(e,a-3,2)):a<=10?(Js(e,FD,e.bl_tree),lo(e,a-3,3)):(Js(e,BD,e.bl_tree),lo(e,a-11,7));a=0,i=o,s===0?(l=138,u=3):o===s?(l=6,u=3):(l=7,u=4)}},Aie=e=>{let t;for(rP(e,e.dyn_ltree,e.l_desc.max_code),rP(e,e.dyn_dtree,e.d_desc.max_code),vC(e,e.bl_desc),t=wE-1;t>=3&&e.bl_tree[zD[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},kie=(e,t,n,r)=>{let i;for(lo(e,t-257,5),lo(e,n-1,5),lo(e,r-4,4),i=0;i<r;i++)lo(e,e.bl_tree[zD[i]*2+1],3);iP(e,e.dyn_ltree,t-1),iP(e,e.dyn_dtree,n-1)},Pie=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Jk;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return eP;for(n=32;n<Cm;n++)if(e.dyn_ltree[n*2]!==0)return eP;return Jk};let oP=!1;const Rie=e=>{oP||(Tie(),oP=!0),e.l_desc=new F2(e.dyn_ltree,UD),e.d_desc=new F2(e.dyn_dtree,jD),e.bl_desc=new F2(e.bl_tree,VD),e.bi_buf=0,e.bi_valid=0,WD(e)},XD=(e,t,n,r)=>{lo(e,(yie<<1)+(r?1:0),3),KD(e),Cg(e,n),Cg(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Oie=e=>{lo(e,DD<<1,3),Js(e,xE,Ba),Cie(e)},Iie=(e,t,n,r)=>{let i,o,s=0;e.level>0?(e.strm.data_type===mie&&(e.strm.data_type=Pie(e)),vC(e,e.l_desc),vC(e,e.d_desc),s=Aie(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?XD(e,t,n,r):e.strategy===gie||o===i?(lo(e,(DD<<1)+(r?1:0),3),nP(e,Ba,Sp)):(lo(e,(vie<<1)+(r?1:0),3),kie(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),nP(e,e.dyn_ltree,e.dyn_dtree)),WD(e),r&&KD(e)},Mie=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(xg[n]+Cm+1)*2]++,e.dyn_dtree[GD(t)*2]++),e.sym_next===e.sym_end);var Nie=Rie,Die=XD,Lie=Iie,$ie=Mie,Fie=Oie,Bie={_tr_init:Nie,_tr_stored_block:Die,_tr_flush_block:Lie,_tr_tally:$ie,_tr_align:Fie};const zie=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[r++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0};var Eg=zie;const Uie=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},jie=new Uint32Array(Uie()),Vie=(e,t,n,r)=>{const i=jie,o=r+n;e^=-1;for(let s=r;s<o;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var Yr=Vie,Ff={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Em={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Gie,_tr_stored_block:_C,_tr_flush_block:Hie,_tr_tally:eu,_tr_align:qie}=Bie,{Z_NO_FLUSH:tu,Z_PARTIAL_FLUSH:Wie,Z_FULL_FLUSH:Kie,Z_FINISH:Xo,Z_BLOCK:sP,Z_OK:mi,Z_STREAM_END:aP,Z_STREAM_ERROR:ua,Z_DATA_ERROR:Xie,Z_BUF_ERROR:z2,Z_DEFAULT_COMPRESSION:Qie,Z_FILTERED:Yie,Z_HUFFMAN_ONLY:Ty,Z_RLE:Zie,Z_FIXED:Jie,Z_DEFAULT_STRATEGY:eoe,Z_UNKNOWN:toe,Z_DEFLATED:L_}=Em,noe=9,roe=15,ioe=8,ooe=29,soe=256,bC=soe+1+ooe,aoe=30,loe=19,uoe=2*bC+1,coe=15,Nt=3,Vl=258,ca=Vl+Nt+1,doe=32,Bf=42,EE=57,SC=69,wC=73,xC=91,CC=103,sc=113,tp=666,qi=1,ah=2,Pc=3,lh=4,foe=3,ac=(e,t)=>(e.msg=Ff[t],t),lP=e=>e*2-(e>4?9:0),Ll=e=>{let t=e.length;for(;--t>=0;)e[t]=0},hoe=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let poe=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,nu=poe;const xo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Po=(e,t)=>{Hie(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,xo(e.strm)},Qt=(e,t)=>{e.pending_buf[e.pending++]=t},Mh=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},EC=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Eg(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Yr(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},QD=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,s=e.prev_length,a=e.nice_match;const l=e.strstart>e.w_size-ca?e.strstart-(e.w_size-ca):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Vl;let h=u[r+s-1],p=u[r+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do if(i=t,!(u[i+s]!==p||u[i+s-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<f);if(o=Vl-(f-r),r=f-Vl,o>s){if(e.match_start=t,s=o,o>=a)break;h=u[r+s-1],p=u[r+s]}}while((t=d[t&c])>l&&--n!==0);return s<=e.lookahead?s:e.lookahead},zf=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ca)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),hoe(e),r+=t),e.strm.avail_in===0)break;if(n=EC(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Nt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=nu(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=nu(e,e.ins_h,e.window[i+Nt-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<Nt)););}while(e.lookahead<ca&&e.strm.avail_in!==0)},YD=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,s=0,a=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r<n&&(r===0&&t!==Xo||t===tu||r!==i+e.strm.avail_in)))break;s=t===Xo&&r===i+e.strm.avail_in?1:0,_C(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,xo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(EC(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(s===0);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?lh:t!==tu&&t!==Xo&&e.strm.avail_in===0&&e.strstart===e.block_start?ah:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(EC(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===Xo)&&t!==tu&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,s=t===Xo&&e.strm.avail_in===0&&r===i?1:0,_C(e,e.block_start,r,s),e.block_start+=r,xo(e.strm)),s?Pc:qi)},U2=(e,t)=>{let n,r;for(;;){if(e.lookahead<ca){if(zf(e),e.lookahead<ca&&t===tu)return qi;if(e.lookahead===0)break}if(n=0,e.lookahead>=Nt&&(e.ins_h=nu(e,e.ins_h,e.window[e.strstart+Nt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-ca&&(e.match_length=QD(e,n)),e.match_length>=Nt)if(r=eu(e,e.strstart-e.match_start,e.match_length-Nt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Nt){e.match_length--;do e.strstart++,e.ins_h=nu(e,e.ins_h,e.window[e.strstart+Nt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=nu(e,e.ins_h,e.window[e.strstart+1]);else r=eu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Po(e,!1),e.strm.avail_out===0))return qi}return e.insert=e.strstart<Nt-1?e.strstart:Nt-1,t===Xo?(Po(e,!0),e.strm.avail_out===0?Pc:lh):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?qi:ah},dd=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<ca){if(zf(e),e.lookahead<ca&&t===tu)return qi;if(e.lookahead===0)break}if(n=0,e.lookahead>=Nt&&(e.ins_h=nu(e,e.ins_h,e.window[e.strstart+Nt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Nt-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-ca&&(e.match_length=QD(e,n),e.match_length<=5&&(e.strategy===Yie||e.match_length===Nt&&e.strstart-e.match_start>4096)&&(e.match_length=Nt-1)),e.prev_length>=Nt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Nt,r=eu(e,e.strstart-1-e.prev_match,e.prev_length-Nt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=nu(e,e.ins_h,e.window[e.strstart+Nt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Nt-1,e.strstart++,r&&(Po(e,!1),e.strm.avail_out===0))return qi}else if(e.match_available){if(r=eu(e,0,e.window[e.strstart-1]),r&&Po(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return qi}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=eu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Nt-1?e.strstart:Nt-1,t===Xo?(Po(e,!0),e.strm.avail_out===0?Pc:lh):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?qi:ah},goe=(e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=Vl){if(zf(e),e.lookahead<=Vl&&t===tu)return qi;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Nt&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+Vl;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=Vl-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Nt?(n=eu(e,1,e.match_length-Nt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=eu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Po(e,!1),e.strm.avail_out===0))return qi}return e.insert=0,t===Xo?(Po(e,!0),e.strm.avail_out===0?Pc:lh):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?qi:ah},moe=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(zf(e),e.lookahead===0)){if(t===tu)return qi;break}if(e.match_length=0,n=eu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Po(e,!1),e.strm.avail_out===0))return qi}return e.insert=0,t===Xo?(Po(e,!0),e.strm.avail_out===0?Pc:lh):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?qi:ah};function Vs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const np=[new Vs(0,0,0,0,YD),new Vs(4,4,8,4,U2),new Vs(4,5,16,8,U2),new Vs(4,6,32,32,U2),new Vs(4,4,16,16,dd),new Vs(8,16,32,32,dd),new Vs(8,16,128,128,dd),new Vs(8,32,128,256,dd),new Vs(32,128,258,1024,dd),new Vs(32,258,258,4096,dd)],yoe=e=>{e.window_size=2*e.w_size,Ll(e.head),e.max_lazy_match=np[e.level].max_lazy,e.good_match=np[e.level].good_length,e.nice_match=np[e.level].nice_length,e.max_chain_length=np[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Nt-1,e.match_available=0,e.ins_h=0};function voe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=L_,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(uoe*2),this.dyn_dtree=new Uint16Array((2*aoe+1)*2),this.bl_tree=new Uint16Array((2*loe+1)*2),Ll(this.dyn_ltree),Ll(this.dyn_dtree),Ll(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(coe+1),this.heap=new Uint16Array(2*bC+1),Ll(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*bC+1),Ll(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Tm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Bf&&t.status!==EE&&t.status!==SC&&t.status!==wC&&t.status!==xC&&t.status!==CC&&t.status!==sc&&t.status!==tp?1:0},ZD=e=>{if(Tm(e))return ac(e,ua);e.total_in=e.total_out=0,e.data_type=toe;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?EE:t.wrap?Bf:sc,e.adler=t.wrap===2?0:1,t.last_flush=-2,Gie(t),mi},JD=e=>{const t=ZD(e);return t===mi&&yoe(e.state),t},_oe=(e,t)=>Tm(e)||e.state.wrap!==2?ua:(e.state.gzhead=t,mi),eL=(e,t,n,r,i,o)=>{if(!e)return ua;let s=1;if(t===Qie&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>noe||n!==L_||r<8||r>15||t<0||t>9||o<0||o>Jie||r===8&&s!==1)return ac(e,ua);r===8&&(r=9);const a=new voe;return e.state=a,a.strm=e,a.status=Bf,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+Nt-1)/Nt),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=t,a.strategy=o,a.method=n,JD(e)},boe=(e,t)=>eL(e,t,L_,roe,ioe,eoe),Soe=(e,t)=>{if(Tm(e)||t>sP||t<0)return e?ac(e,ua):ua;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===tp&&t!==Xo)return ac(e,e.avail_out===0?z2:ua);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(xo(e),e.avail_out===0)return n.last_flush=-1,mi}else if(e.avail_in===0&&lP(t)<=lP(r)&&t!==Xo)return ac(e,z2);if(n.status===tp&&e.avail_in!==0)return ac(e,z2);if(n.status===Bf&&n.wrap===0&&(n.status=sc),n.status===Bf){let i=L_+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Ty||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=doe),i+=31-i%31,Mh(n,i),n.strstart!==0&&(Mh(n,e.adler>>>16),Mh(n,e.adler&65535)),e.adler=1,n.status=sc,xo(e),n.pending!==0)return n.last_flush=-1,mi}if(n.status===EE){if(e.adler=0,Qt(n,31),Qt(n,139),Qt(n,8),n.gzhead)Qt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Qt(n,n.gzhead.time&255),Qt(n,n.gzhead.time>>8&255),Qt(n,n.gzhead.time>>16&255),Qt(n,n.gzhead.time>>24&255),Qt(n,n.level===9?2:n.strategy>=Ty||n.level<2?4:0),Qt(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Qt(n,n.gzhead.extra.length&255),Qt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Yr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=SC;else if(Qt(n,0),Qt(n,0),Qt(n,0),Qt(n,0),Qt(n,0),Qt(n,n.level===9?2:n.strategy>=Ty||n.level<2?4:0),Qt(n,foe),n.status=sc,xo(e),n.pending!==0)return n.last_flush=-1,mi}if(n.status===SC){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,xo(e),n.pending!==0)return n.last_flush=-1,mi;i=0,o-=a}let s=new Uint8Array(n.gzhead.extra);n.pending_buf.set(s.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=wC}if(n.status===wC){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i)),xo(e),n.pending!==0)return n.last_flush=-1,mi;i=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,Qt(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=xC}if(n.status===xC){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i)),xo(e),n.pending!==0)return n.last_flush=-1,mi;i=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,Qt(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Yr(e.adler,n.pending_buf,n.pending-i,i))}n.status=CC}if(n.status===CC){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(xo(e),n.pending!==0))return n.last_flush=-1,mi;Qt(n,e.adler&255),Qt(n,e.adler>>8&255),e.adler=0}if(n.status=sc,xo(e),n.pending!==0)return n.last_flush=-1,mi}if(e.avail_in!==0||n.lookahead!==0||t!==tu&&n.status!==tp){let i=n.level===0?YD(n,t):n.strategy===Ty?moe(n,t):n.strategy===Zie?goe(n,t):np[n.level].func(n,t);if((i===Pc||i===lh)&&(n.status=tp),i===qi||i===Pc)return e.avail_out===0&&(n.last_flush=-1),mi;if(i===ah&&(t===Wie?qie(n):t!==sP&&(_C(n,0,0,!1),t===Kie&&(Ll(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),xo(e),e.avail_out===0))return n.last_flush=-1,mi}return t!==Xo?mi:n.wrap<=0?aP:(n.wrap===2?(Qt(n,e.adler&255),Qt(n,e.adler>>8&255),Qt(n,e.adler>>16&255),Qt(n,e.adler>>24&255),Qt(n,e.total_in&255),Qt(n,e.total_in>>8&255),Qt(n,e.total_in>>16&255),Qt(n,e.total_in>>24&255)):(Mh(n,e.adler>>>16),Mh(n,e.adler&65535)),xo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?mi:aP)},woe=e=>{if(Tm(e))return ua;const t=e.state.status;return e.state=null,t===sc?ac(e,Xie):mi},xoe=(e,t)=>{let n=t.length;if(Tm(e))return ua;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Bf||r.lookahead)return ua;if(i===1&&(e.adler=Eg(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Ll(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(t.subarray(n-r.w_size,n),0),t=l,n=r.w_size}const o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,zf(r);r.lookahead>=Nt;){let l=r.strstart,u=r.lookahead-(Nt-1);do r.ins_h=nu(r,r.ins_h,r.window[l+Nt-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Nt-1,zf(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Nt-1,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,r.wrap=i,mi};var Coe=boe,Eoe=eL,Toe=JD,Aoe=ZD,koe=_oe,Poe=Soe,Roe=woe,Ooe=xoe,Ioe="pako deflate (from Nodeca project)",wp={deflateInit:Coe,deflateInit2:Eoe,deflateReset:Toe,deflateResetKeep:Aoe,deflateSetHeader:koe,deflate:Poe,deflateEnd:Roe,deflateSetDictionary:Ooe,deflateInfo:Ioe};const Moe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Noe=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)Moe(n,r)&&(e[r]=n[r])}}return e},Doe=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,o=e.length;r<o;r++){let s=e[r];n.set(s,i),i+=s.length}return n},$_={assign:Noe,flattenChunks:Doe};let tL=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{tL=!1}const Tg=new Uint8Array(256);for(let e=0;e<256;e++)Tg[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Tg[254]=Tg[254]=1;var Loe=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,s=e.length,a=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const $oe=(e,t)=>{if(t<65534&&e.subarray&&tL)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var Foe=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const o=new Array(n*2);for(i=0,r=0;r<n;){let s=e[r++];if(s<128){o[i++]=s;continue}let a=Tg[s];if(a>4){o[i++]=65533,r+=a-1;continue}for(s&=a===2?31:a===3?15:7;a>1&&r<n;)s=s<<6|e[r++]&63,a--;if(a>1){o[i++]=65533;continue}s<65536?o[i++]=s:(s-=65536,o[i++]=55296|s>>10&1023,o[i++]=56320|s&1023)}return $oe(o,i)},Boe=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Tg[e[n]]>t?n:t},Ag={string2buf:Loe,buf2string:Foe,utf8border:Boe};function zoe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var nL=zoe;const rL=Object.prototype.toString,{Z_NO_FLUSH:Uoe,Z_SYNC_FLUSH:joe,Z_FULL_FLUSH:Voe,Z_FINISH:Goe,Z_OK:Kv,Z_STREAM_END:Hoe,Z_DEFAULT_COMPRESSION:qoe,Z_DEFAULT_STRATEGY:Woe,Z_DEFLATED:Koe}=Em;function TE(e){this.options=$_.assign({level:qoe,method:Koe,chunkSize:16384,windowBits:15,memLevel:8,strategy:Woe},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nL,this.strm.avail_out=0;let n=wp.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Kv)throw new Error(Ff[n]);if(t.header&&wp.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=Ag.string2buf(t.dictionary):rL.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=wp.deflateSetDictionary(this.strm,r),n!==Kv)throw new Error(Ff[n]);this._dict_set=!0}}TE.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?Goe:Uoe,typeof e=="string"?n.input=Ag.string2buf(e):rL.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===joe||o===Voe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=wp.deflate(n,o),i===Hoe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=wp.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Kv;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};TE.prototype.onData=function(e){this.chunks.push(e)};TE.prototype.onEnd=function(e){e===Kv&&(this.result=$_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Ay=16209,Xoe=16191;var Qoe=function(t,n){let r,i,o,s,a,l,u,c,d,f,h,p,m,b,_,y,g,v,S,w,x,C,A,T;const k=t.state;r=t.next_in,A=t.input,i=r+(t.avail_in-5),o=t.next_out,T=t.output,s=o-(n-t.avail_out),a=o+(t.avail_out-257),l=k.dmax,u=k.wsize,c=k.whave,d=k.wnext,f=k.window,h=k.hold,p=k.bits,m=k.lencode,b=k.distcode,_=(1<<k.lenbits)-1,y=(1<<k.distbits)-1;e:do{p<15&&(h+=A[r++]<<p,p+=8,h+=A[r++]<<p,p+=8),g=m[h&_];t:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v===0)T[o++]=g&65535;else if(v&16){S=g&65535,v&=15,v&&(p<v&&(h+=A[r++]<<p,p+=8),S+=h&(1<<v)-1,h>>>=v,p-=v),p<15&&(h+=A[r++]<<p,p+=8,h+=A[r++]<<p,p+=8),g=b[h&y];n:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v&16){if(w=g&65535,v&=15,p<v&&(h+=A[r++]<<p,p+=8,p<v&&(h+=A[r++]<<p,p+=8)),w+=h&(1<<v)-1,w>l){t.msg="invalid distance too far back",k.mode=Ay;break e}if(h>>>=v,p-=v,v=o-s,w>v){if(v=w-v,v>c&&k.sane){t.msg="invalid distance too far back",k.mode=Ay;break e}if(x=0,C=f,d===0){if(x+=u-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}else if(d<v){if(x+=u+d-v,v-=d,v<S){S-=v;do T[o++]=f[x++];while(--v);if(x=0,d<S){v=d,S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}}else if(x+=d-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}for(;S>2;)T[o++]=C[x++],T[o++]=C[x++],T[o++]=C[x++],S-=3;S&&(T[o++]=C[x++],S>1&&(T[o++]=C[x++]))}else{x=o-w;do T[o++]=T[x++],T[o++]=T[x++],T[o++]=T[x++],S-=3;while(S>2);S&&(T[o++]=T[x++],S>1&&(T[o++]=T[x++]))}}else if(v&64){t.msg="invalid distance code",k.mode=Ay;break e}else{g=b[(g&65535)+(h&(1<<v)-1)];continue n}break}}else if(v&64)if(v&32){k.mode=Xoe;break e}else{t.msg="invalid literal/length code",k.mode=Ay;break e}else{g=m[(g&65535)+(h&(1<<v)-1)];continue t}break}}while(r<i&&o<a);S=p>>3,r-=S,p-=S<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=o<a?257+(a-o):257-(o-a),k.hold=h,k.bits=p};const fd=15,uP=852,cP=592,dP=0,j2=1,fP=2,Yoe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Zoe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Joe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ese=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),tse=(e,t,n,r,i,o,s,a)=>{const l=a.bits;let u=0,c=0,d=0,f=0,h=0,p=0,m=0,b=0,_=0,y=0,g,v,S,w,x,C=null,A;const T=new Uint16Array(fd+1),k=new Uint16Array(fd+1);let L=null,N,E,P;for(u=0;u<=fd;u++)T[u]=0;for(c=0;c<r;c++)T[t[n+c]]++;for(h=l,f=fd;f>=1&&T[f]===0;f--);if(h>f&&(h=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,a.bits=1,0;for(d=1;d<f&&T[d]===0;d++);for(h<d&&(h=d),b=1,u=1;u<=fd;u++)if(b<<=1,b-=T[u],b<0)return-1;if(b>0&&(e===dP||f!==1))return-1;for(k[1]=0,u=1;u<fd;u++)k[u+1]=k[u]+T[u];for(c=0;c<r;c++)t[n+c]!==0&&(s[k[t[n+c]]++]=c);if(e===dP?(C=L=s,A=20):e===j2?(C=Yoe,L=Zoe,A=257):(C=Joe,L=ese,A=0),y=0,c=0,u=d,x=o,p=h,m=0,S=-1,_=1<<h,w=_-1,e===j2&&_>uP||e===fP&&_>cP)return 1;for(;;){N=u-m,s[c]+1<A?(E=0,P=s[c]):s[c]>=A?(E=L[s[c]-A],P=C[s[c]-A]):(E=32+64,P=0),g=1<<u-m,v=1<<p,d=v;do v-=g,i[x+(y>>m)+v]=N<<24|E<<16|P|0;while(v!==0);for(g=1<<u-1;y&g;)g>>=1;if(g!==0?(y&=g-1,y+=g):y=0,c++,--T[u]===0){if(u===f)break;u=t[n+s[c]]}if(u>h&&(y&w)!==S){for(m===0&&(m=h),x+=d,p=u-m,b=1<<p;p+m<f&&(b-=T[p+m],!(b<=0));)p++,b<<=1;if(_+=1<<p,e===j2&&_>uP||e===fP&&_>cP)return 1;S=y&w,i[S]=h<<24|p<<16|x-o|0}}return y!==0&&(i[x+y]=u-m<<24|64<<16|0),a.bits=h,0};var xp=tse;const nse=0,iL=1,oL=2,{Z_FINISH:hP,Z_BLOCK:rse,Z_TREES:ky,Z_OK:Rc,Z_STREAM_END:ise,Z_NEED_DICT:ose,Z_STREAM_ERROR:rs,Z_DATA_ERROR:sL,Z_MEM_ERROR:aL,Z_BUF_ERROR:sse,Z_DEFLATED:pP}=Em,F_=16180,gP=16181,mP=16182,yP=16183,vP=16184,_P=16185,bP=16186,SP=16187,wP=16188,xP=16189,Xv=16190,Aa=16191,V2=16192,CP=16193,G2=16194,EP=16195,TP=16196,AP=16197,kP=16198,Py=16199,Ry=16200,PP=16201,RP=16202,OP=16203,IP=16204,MP=16205,H2=16206,NP=16207,DP=16208,Gn=16209,lL=16210,uL=16211,ase=852,lse=592,use=15,cse=use,LP=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function dse(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const qc=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<F_||t.mode>uL?1:0},cL=e=>{if(qc(e))return rs;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=F_,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ase),t.distcode=t.distdyn=new Int32Array(lse),t.sane=1,t.back=-1,Rc},dL=e=>{if(qc(e))return rs;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,cL(e)},fL=(e,t)=>{let n;if(qc(e))return rs;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?rs:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,dL(e))},hL=(e,t)=>{if(!e)return rs;const n=new dse;e.state=n,n.strm=e,n.window=null,n.mode=F_;const r=fL(e,t);return r!==Rc&&(e.state=null),r},fse=e=>hL(e,cse);let $P=!0,q2,W2;const hse=e=>{if($P){q2=new Int32Array(512),W2=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(xp(iL,e.lens,0,288,q2,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;xp(oL,e.lens,0,32,W2,0,e.work,{bits:5}),$P=!1}e.lencode=q2,e.lenbits=9,e.distcode=W2,e.distbits=5},pL=(e,t,n,r)=>{let i;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},pse=(e,t)=>{let n,r,i,o,s,a,l,u,c,d,f,h,p,m,b=0,_,y,g,v,S,w,x,C;const A=new Uint8Array(4);let T,k;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(qc(e)||!e.output||!e.input&&e.avail_in!==0)return rs;n=e.state,n.mode===Aa&&(n.mode=V2),s=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,a=e.avail_in,u=n.hold,c=n.bits,d=a,f=l,C=Rc;e:for(;;)switch(n.mode){case F_:if(n.wrap===0){n.mode=V2;break}for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,A[0]=u&255,A[1]=u>>>8&255,n.check=Yr(n.check,A,2,0),u=0,c=0,n.mode=gP;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Gn;break}if((u&15)!==pP){e.msg="unknown compression method",n.mode=Gn;break}if(u>>>=4,c-=4,x=(u&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){e.msg="invalid window size",n.mode=Gn;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?xP:Aa,u=0,c=0;break;case gP:for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.flags=u,(n.flags&255)!==pP){e.msg="unknown compression method",n.mode=Gn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Gn;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,n.check=Yr(n.check,A,2,0)),u=0,c=0,n.mode=mP;case mP:for(;c<32;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,n.check=Yr(n.check,A,4,0)),u=0,c=0,n.mode=yP;case yP:for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,n.check=Yr(n.check,A,2,0)),u=0,c=0,n.mode=vP;case vP:if(n.flags&1024){for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,n.check=Yr(n.check,A,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=_P;case _P:if(n.flags&1024&&(h=n.length,h>a&&(h=a),h&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+h),x)),n.flags&512&&n.wrap&4&&(n.check=Yr(n.check,r,h,o)),a-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=bP;case bP:if(n.flags&2048){if(a===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&h<a);if(n.flags&512&&n.wrap&4&&(n.check=Yr(n.check,r,h,o)),a-=h,o+=h,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=SP;case SP:if(n.flags&4096){if(a===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&h<a);if(n.flags&512&&n.wrap&4&&(n.check=Yr(n.check,r,h,o)),a-=h,o+=h,x)break e}else n.head&&(n.head.comment=null);n.mode=wP;case wP:if(n.flags&512){for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Gn;break}u=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Aa;break;case xP:for(;c<32;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}e.adler=n.check=LP(u),u=0,c=0,n.mode=Xv;case Xv:if(n.havedict===0)return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=c,ose;e.adler=n.check=1,n.mode=Aa;case Aa:if(t===rse||t===ky)break e;case V2:if(n.last){u>>>=c&7,c-=c&7,n.mode=H2;break}for(;c<3;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}switch(n.last=u&1,u>>>=1,c-=1,u&3){case 0:n.mode=CP;break;case 1:if(hse(n),n.mode=Py,t===ky){u>>>=2,c-=2;break e}break;case 2:n.mode=TP;break;case 3:e.msg="invalid block type",n.mode=Gn}u>>>=2,c-=2;break;case CP:for(u>>>=c&7,c-=c&7;c<32;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Gn;break}if(n.length=u&65535,u=0,c=0,n.mode=G2,t===ky)break e;case G2:n.mode=EP;case EP:if(h=n.length,h){if(h>a&&(h=a),h>l&&(h=l),h===0)break e;i.set(r.subarray(o,o+h),s),a-=h,o+=h,l-=h,s+=h,n.length-=h;break}n.mode=Aa;break;case TP:for(;c<14;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.nlen=(u&31)+257,u>>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Gn;break}n.have=0,n.mode=AP;case AP:for(;n.have<n.ncode;){for(;c<3;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.lens[L[n.have++]]=u&7,u>>>=3,c-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},C=xp(nse,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid code lengths set",n.mode=Gn;break}n.have=0,n.mode=kP;case kP:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[u&(1<<n.lenbits)-1],_=b>>>24,y=b>>>16&255,g=b&65535,!(_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(g<16)u>>>=_,c-=_,n.lens[n.have++]=g;else{if(g===16){for(k=_+2;c<k;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(u>>>=_,c-=_,n.have===0){e.msg="invalid bit length repeat",n.mode=Gn;break}x=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(g===17){for(k=_+3;c<k;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=_,c-=_,x=0,h=3+(u&7),u>>>=3,c-=3}else{for(k=_+7;c<k;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=_,c-=_,x=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Gn;break}for(;h--;)n.lens[n.have++]=x}}if(n.mode===Gn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Gn;break}if(n.lenbits=9,T={bits:n.lenbits},C=xp(iL,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid literal/lengths set",n.mode=Gn;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},C=xp(oL,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,C){e.msg="invalid distances set",n.mode=Gn;break}if(n.mode=Py,t===ky)break e;case Py:n.mode=Ry;case Ry:if(a>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=c,Qoe(e,f),s=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,a=e.avail_in,u=n.hold,c=n.bits,n.mode===Aa&&(n.back=-1);break}for(n.back=0;b=n.lencode[u&(1<<n.lenbits)-1],_=b>>>24,y=b>>>16&255,g=b&65535,!(_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(y&&!(y&240)){for(v=_,S=y,w=g;b=n.lencode[w+((u&(1<<v+S)-1)>>v)],_=b>>>24,y=b>>>16&255,g=b&65535,!(v+_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=_,c-=_,n.back+=_,n.length=g,y===0){n.mode=MP;break}if(y&32){n.back=-1,n.mode=Aa;break}if(y&64){e.msg="invalid literal/length code",n.mode=Gn;break}n.extra=y&15,n.mode=PP;case PP:if(n.extra){for(k=n.extra;c<k;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=RP;case RP:for(;b=n.distcode[u&(1<<n.distbits)-1],_=b>>>24,y=b>>>16&255,g=b&65535,!(_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(!(y&240)){for(v=_,S=y,w=g;b=n.distcode[w+((u&(1<<v+S)-1)>>v)],_=b>>>24,y=b>>>16&255,g=b&65535,!(v+_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=_,c-=_,n.back+=_,y&64){e.msg="invalid distance code",n.mode=Gn;break}n.offset=g,n.extra=y&15,n.mode=OP;case OP:if(n.extra){for(k=n.extra;c<k;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Gn;break}n.mode=IP;case IP:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Gn;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=s-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[s++]=m[p++];while(--h);n.length===0&&(n.mode=Ry);break;case MP:if(l===0)break e;i[s++]=n.length,l--,n.mode=Ry;break;case H2:if(n.wrap){for(;c<32;){if(a===0)break e;a--,u|=r[o++]<<c,c+=8}if(f-=l,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?Yr(n.check,i,f,s-f):Eg(n.check,i,f,s-f)),f=l,n.wrap&4&&(n.flags?u:LP(u))!==n.check){e.msg="incorrect data check",n.mode=Gn;break}u=0,c=0}n.mode=NP;case NP:if(n.wrap&&n.flags){for(;c<32;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Gn;break}u=0,c=0}n.mode=DP;case DP:C=ise;break e;case Gn:C=sL;break e;case lL:return aL;case uL:default:return rs}return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,n.hold=u,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<Gn&&(n.mode<H2||t!==hP))&&pL(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?Yr(n.check,i,f,e.next_out-f):Eg(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Aa?128:0)+(n.mode===Py||n.mode===G2?256:0),(d===0&&f===0||t===hP)&&C===Rc&&(C=sse),C},gse=e=>{if(qc(e))return rs;let t=e.state;return t.window&&(t.window=null),e.state=null,Rc},mse=(e,t)=>{if(qc(e))return rs;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Rc):rs},yse=(e,t)=>{const n=t.length;let r,i,o;return qc(e)||(r=e.state,r.wrap!==0&&r.mode!==Xv)?rs:r.mode===Xv&&(i=1,i=Eg(i,t,n,0),i!==r.check)?sL:(o=pL(e,t,n,n),o?(r.mode=lL,aL):(r.havedict=1,Rc))};var vse=dL,_se=fL,bse=cL,Sse=fse,wse=hL,xse=pse,Cse=gse,Ese=mse,Tse=yse,Ase="pako inflate (from Nodeca project)",za={inflateReset:vse,inflateReset2:_se,inflateResetKeep:bse,inflateInit:Sse,inflateInit2:wse,inflate:xse,inflateEnd:Cse,inflateGetHeader:Ese,inflateSetDictionary:Tse,inflateInfo:Ase};function kse(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Pse=kse;const gL=Object.prototype.toString,{Z_NO_FLUSH:Rse,Z_FINISH:Ose,Z_OK:kg,Z_STREAM_END:K2,Z_NEED_DICT:X2,Z_STREAM_ERROR:Ise,Z_DATA_ERROR:FP,Z_MEM_ERROR:Mse}=Em;function Am(e){this.options=$_.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nL,this.strm.avail_out=0;let n=za.inflateInit2(this.strm,t.windowBits);if(n!==kg)throw new Error(Ff[n]);if(this.header=new Pse,za.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Ag.string2buf(t.dictionary):gL.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=za.inflateSetDictionary(this.strm,t.dictionary),n!==kg)))throw new Error(Ff[n])}Am.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Ose:Rse,gL.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=za.inflate(n,s),o===X2&&i&&(o=za.inflateSetDictionary(n,i),o===kg?o=za.inflate(n,s):o===FP&&(o=X2));n.avail_in>0&&o===K2&&n.state.wrap>0&&e[n.next_in]!==0;)za.inflateReset(n),o=za.inflate(n,s);switch(o){case Ise:case FP:case X2:case Mse:return this.onEnd(o),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||o===K2))if(this.options.to==="string"){let l=Ag.utf8border(n.output,n.next_out),u=n.next_out-l,c=Ag.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===kg&&a===0)){if(o===K2)return o=za.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Am.prototype.onData=function(e){this.chunks.push(e)};Am.prototype.onEnd=function(e){e===kg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=$_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function AE(e,t){const n=new Am(t);if(n.push(e),n.err)throw n.msg||Ff[n.err];return n.result}function Nse(e,t){return t=t||{},t.raw=!0,AE(e,t)}var Dse=Am,Lse=AE,$se=Nse,Fse=AE,Bse=Em,zse={Inflate:Dse,inflate:Lse,inflateRaw:$se,ungzip:Fse,constants:Bse};const{Inflate:$Re,inflate:Use,inflateRaw:FRe,ungzip:BRe}=zse;var mL=Use;const yL=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;yL[e]=t}function jse(e){let t=-1;for(let n=0;n<e.length;n++)t=yL[(t^e[n])&255]^t>>>8;return t^-1}var Hn;(function(e){e[e.GRAYSCALE=0]="GRAYSCALE",e[e.TRUE_COLOR=2]="TRUE_COLOR",e[e.PALETTE=3]="PALETTE",e[e.GRAYSCALE_WITH_ALPHA=4]="GRAYSCALE_WITH_ALPHA",e[e.TRUE_COLOR_WITH_ALPHA=6]="TRUE_COLOR_WITH_ALPHA"})(Hn||(Hn={}));const Vse={[Hn.GRAYSCALE]:1,[Hn.TRUE_COLOR]:3,[Hn.PALETTE]:1,[Hn.GRAYSCALE_WITH_ALPHA]:2,[Hn.TRUE_COLOR_WITH_ALPHA]:4},Gse=1;var To;(function(e){e[e.NONE=0]="NONE",e[e.SUB=1]="SUB",e[e.UP=2]="UP",e[e.AVERAGE=3]="AVERAGE",e[e.PAETH=4]="PAETH"})(To||(To={}));const Hse={[To.NONE](e){return e},[To.SUB](e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++){const i=n[r-t]||0;n[r]=e[r]+i}return n},[To.UP](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=n[i]||0;r[i]=o+e[i]}return r},[To.AVERAGE](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,s=n[i]||0,a=o+s>>1;r[i]=e[i]+a}return r},[To.PAETH](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,s=n[i],a=n[i-t]||0,l=vL(o,s,a);r[i]=e[i]+l}return r}};To.NONE+"",To.SUB+"",To.UP+"",To.AVERAGE+"",To.PAETH+"";function vL(e,t,n){const r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),s=Math.abs(r-n);return i<=o&&i<=s?e:o<=s?t:n}function Zr(e,t,n){if(t===n)return e;const r=2**t-1,i=2**n-1;return Math.round(e*i/r)}function qse(e,t){const n=[];let r=0;for(;r<e.length;)if(t===1){const i=e[r++];n.push(i>>7&1,i>>6&1,i>>5&1,i>>4&1,i>>3&1,i>>2&1,i>>1&1,i&1)}else if(t===2){const i=e[r++];n.push(i>>6&3,i>>4&3,i>>2&3,i&3)}else if(t===4){const i=e[r++];n.push(i>>4&15,i&15)}else if(t===8){const i=e[r++];n.push(i)}else if(t===16)n.push(e[r++]<<8|e[r++]);else throw new Error("Unsupported depth: "+t);return n}const _L=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];function Wse(e,t,n){if(!e)return[{passWidth:t,passHeight:n,passIndex:0}];const r=[];return _L.forEach(function({x:i,y:o},s){const a=t%8,l=n%8,u=t-a>>3,c=n-l>>3;let d=u*i.length;for(let h=0;h<i.length&&i[h]<a;h++)d++;let f=c*o.length;for(let h=0;h<o.length&&o[h]<l;h++)f++;d&&f&&r.push({passWidth:d,passHeight:f,passIndex:s})}),r}function Kse(e,t,n,r,i){if(!e)return t*i+r<<2;const o=_L[n],s=r%o.x.length,a=i%o.y.length,l=(r-s)/o.x.length,u=(i-a)/o.y.length,c=o.x[s],d=o.y[a];return t*((u<<3)+d)+(l<<3)+c<<2}function Xse(e,t,n,r,i,o,s,a){let l=[];const u=mL(e),c=Wse(t,r,i),f=Vse[n]*o,h=f>>3||1;let p=0,m=new Uint8Array;for(let b=0;b<c.length;b++){const{passWidth:_,passHeight:y,passIndex:g}=c[b];for(let v=0;v<y;v++){let k=function(){if(n===Hn.GRAYSCALE){const L=Zr(T[A++],o,8);return[L,L,L,255]}if(n===Hn.TRUE_COLOR)return[Zr(T[A++],o,8),Zr(T[A++],o,8),Zr(T[A++],o,8),255];if(n===Hn.PALETTE){const L=T[A++];if(!s)throw new Error("Mising chunk: PLTE");return s[L]}if(n===Hn.GRAYSCALE_WITH_ALPHA){const L=Zr(T[A++],o,8);return[L,L,L,Zr(T[A++],o,8)]}if(n===Hn.TRUE_COLOR_WITH_ALPHA)return[Zr(T[A++],o,8),Zr(T[A++],o,8),Zr(T[A++],o,8),Zr(T[A++],o,8)];throw new Error("Unsupported color type: "+n)};const S=(_*f+7>>3)+Gse,w=u[p];if(!(w in To))throw new Error("Unsupported filter type: "+w);const x=Hse[w],C=x(u.slice(p+1,p+S),h,m);m=C;let A=0;const T=qse(C,o);for(let L=0;L<_;L++){const N=k();a&&N[0]===a[0]&&N[1]===a[1]&&N[2]===a[2]&&(N[3]=0);const E=Kse(t,r,g,L,v);for(let P=0;P<N.length;P++)l[E+P]=N[P]}p+=S}}return l}const Q2=[137,80,78,71,13,10,26,10],Qse=1e5;function Y2(e){let t=0,n="";for(;t<e.length;){let r=e[t++];if(r>127)if(r>191&&r<224){if(t>=e.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");r=(r&31)<<6|e[t++]&63}else if(r>223&&r<240){if(t+1>=e.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");r=(r&15)<<12|(e[t++]&63)<<6|e[t++]&63}else if(r>239&&r<248){if(t+2>=e.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");r=(r&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63}else throw new Error("UTF-8 decode: unknown multibyte start 0x"+r.toString(16)+" at index "+(t-1));if(r<=65535)n+=String.fromCharCode(r);else if(r<=1114111)r-=65536,n+=String.fromCharCode(r>>10|55296),n+=String.fromCharCode(r&1023|56320);else throw new Error("UTF-8 decode: code point 0x"+r.toString(16)+" exceeds UTF-16 reach")}return n}function Yse(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}const Sl=1e5;function Zse(e){const t=new Uint8Array(e);let n=new Uint8Array;const r={width:0,height:0,depth:0,colorType:0,compression:0,interlace:0,filter:0,data:[]};let i=0;function o(){return t[i++]<<24|t[i++]<<16|t[i++]<<8|t[i++]}function s(){return t[i++]<<8|t[i++]}function a(){return t[i++]}function l(){const R=[];let O=0;for(;(O=t[i++])!==0;)R.push(O);return new Uint8Array(R)}function u(R){const O=i+R;let I="";for(;i<O;){const F=a();if(F===0)break;I+=String.fromCharCode(F)}return I}function c(R){let O="";for(;i<R;){const I=a();O+=String.fromCharCode(I)}return O}function d(R){const O=t.slice(i,R);return i=R,mL(O)}function f(){let R="";for(const O=i+4;i<O;i++)R+=String.fromCharCode(t[i]);return R}for(;i<Q2.length;i++)if(t[i]!==Q2[i])throw new Error(`Invalid file signature, at position ${i}: ${t[i]} !== ${Q2[i]}`);const h={IHDR:p,PLTE:m,IDAT:b,IEND:_,tRNS:y,cHRM:g,gAMA:v,iCCP:S,sBIT:w,sRGB:x,tEXt:C,zTXt:A,iTXt:T,bKGD:k,hIST:L,pHYs:N,sPLT:E,tIME:P};function p(){r.width=o(),r.height=o(),r.depth=a();const R=a();if(!(R in Hn))throw new Error("Unsupported color type: "+R);r.colorType=R,r.compression=a(),r.filter=a(),r.interlace=a()}function m(R){const O=[];for(let I=0;I<R;I+=3)O.push([t[i++],t[i++],t[i++],255]);r.palette=O}function b(R){n=Yse(n,t.slice(i,i+R)),i+=R}function _(R){i+=R}function y(R){if(r.colorType===Hn.GRAYSCALE){const O=Zr(t[i++]<<8|t[i++],r.depth,8);r.transparent=[O,O,O,255]}else if(r.colorType===Hn.TRUE_COLOR)r.transparent=[Zr(t[i++]<<8|t[i++],r.depth,8),Zr(t[i++]<<8|t[i++],r.depth,8),Zr(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===Hn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");for(let O=0;O<R;O++)r.palette[O][3]=t[i++]}}function g(){r.chromaticities={white:{x:o()/Sl,y:o()/Sl},red:{x:o()/Sl,y:o()/Sl},green:{x:o()/Sl,y:o()/Sl},blue:{x:o()/Sl,y:o()/Sl}}}function v(){r.gamma=o()/Qse}function S(R){const O=i+R,I=u(80);a();const F=d(O);r.icc={name:I,profile:Array.from(F)}}function w(){if(r.colorType===Hn.GRAYSCALE){const R=a();r.significantBits=[R,R,R,r.depth]}else if(r.colorType===Hn.TRUE_COLOR||r.colorType===Hn.PALETTE)r.significantBits=[a(),a(),a(),r.depth];else if(r.colorType===Hn.GRAYSCALE_WITH_ALPHA){const R=a();r.significantBits=[R,R,R,a()]}else r.colorType===Hn.TRUE_COLOR_WITH_ALPHA&&(r.significantBits=[a(),a(),a(),a()])}function x(){r.sRGB=a()}function C(R){const O=i+R,I=u(80),F=c(O);r.text||(r.text={}),r.text[I]=F}function A(R){const O=i+R,I=u(80);a();const F=d(O);let U="";for(let V=0;V<F.length;V++)U+=String.fromCharCode(F[V]);r.compressedText||(r.compressedText={}),r.compressedText[I]=U}function T(R){const O=i+R,I=u(80),F=a();a();const U=u(1/0),V=Y2(l());let H="";if(F===0)H=Y2(t.slice(i,O)),i=O;else{const Y=d(O);H=Y2(Y)}r.internationalText||(r.internationalText={}),r.internationalText[I]={languageTag:U,translatedKeyword:V,text:H}}function k(){if((r.colorType&3)===Hn.GRAYSCALE){const R=Zr(t[i++]<<8|t[i++],r.depth,8);r.background=[R,R,R,255]}else if((r.colorType&3)===Hn.TRUE_COLOR)r.background=[Zr(t[i++]<<8|t[i++],r.depth,8),Zr(t[i++]<<8|t[i++],r.depth,8),Zr(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===Hn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");r.background=r.palette[t[i++]]}}function L(R){const O=i+R,I=[];for(;i<O;)I.push(s());r.histogram=I}function N(){const R=o(),O=o(),I=a();r.physicalDimensions={pixelPerUnitX:R,pixelPerUnitY:O,unit:I}}function E(R){const O=i+R,I=u(80),F=a(),U=[];if(F===8)for(;i<O;)U.push([a(),a(),a(),a(),s()]);else if(F===16)for(;i<O;)U.push([s(),s(),s(),s(),s()]);r.suggestedPalette={name:I,depth:F,palette:U}}function P(){const R=s(),O=a(),I=a(),F=a(),U=a(),V=a();r.lastModificationTime=Date.UTC(R,O-1,I,F,U,V)}function D(){const R=i,O=o(),I=f();h[I]?h[I](O):(I.charCodeAt(0)&32,i+=O),B(R,O)}function B(R,O){const I=o(),F=jse(t.slice(R+4,R+8+O));if(I!==F)throw new Error("Crc32 error: calculated "+F+", expected "+I);i<t.length&&D()}return D(),r.data=Xse(n,r.interlace,r.colorType,r.width,r.height,r.depth,r.palette,r.transparent),r}var bL={},B_={},z_={};Object.defineProperty(z_,"__esModule",{value:!0});z_.createLogMethods=void 0;var Jse=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)}};z_.createLogMethods=Jse;var kE={},U_={};Object.defineProperty(U_,"__esModule",{value:!0});U_.boolean=void 0;const eae=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}};U_.boolean=eae;var j_={};Object.defineProperty(j_,"__esModule",{value:!0});j_.isBooleanable=void 0;const tae=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}};j_.isBooleanable=tae;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=U_;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=j_;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(kE);var BP=Object.prototype.toString,SL=function(t){var n=BP.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&BP.call(t.callee)==="[object Function]"),r},Z2,zP;function nae(){if(zP)return Z2;zP=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=SL,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},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&t.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),d=function(f){if(typeof window>"u"||!c)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",b=r(h),_=p&&n.call(h)==="[object String]",y=[];if(!p&&!m&&!b)throw new TypeError("Object.keys called on a non-object");var g=s&&m;if(_&&h.length>0&&!t.call(h,0))for(var v=0;v<h.length;++v)y.push(String(v));if(b&&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 x=d(h),C=0;C<a.length;++C)!(x&&a[C]==="constructor")&&t.call(h,a[C])&&y.push(a[C]);return y}}return Z2=e,Z2}var rae=Array.prototype.slice,iae=SL,UP=Object.keys,O0=UP?function(t){return UP(t)}:nae(),jP=Object.keys;O0.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 iae(r)?jP(rae.call(r)):jP(r)})}else Object.keys=O0;return Object.keys||O0};var oae=O0,sae=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},VP=typeof Symbol<"u"&&Symbol,aae=sae,lae=function(){return typeof VP!="function"||typeof Symbol!="function"||typeof VP("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:aae()},GP={foo:{}},uae=Object,cae=function(){return{__proto__:GP}.foo===GP.foo&&!({__proto__:null}instanceof uae)},dae="Function.prototype.bind called on incompatible ",J2=Array.prototype.slice,fae=Object.prototype.toString,hae="[object Function]",pae=function(t){var n=this;if(typeof n!="function"||fae.call(n)!==hae)throw new TypeError(dae+n);for(var r=J2.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(J2.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(J2.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},gae=pae,wL=Function.prototype.bind||gae,mae=wL,yae=mae.call(Function.call,Object.prototype.hasOwnProperty),Ot,Uf=SyntaxError,xL=Function,df=TypeError,ew=function(e){try{return xL('"use strict"; return ('+e+").constructor;")()}catch{}},yc=Object.getOwnPropertyDescriptor;if(yc)try{yc({},"")}catch{yc=null}var tw=function(){throw new df},vae=yc?function(){try{return arguments.callee,tw}catch{try{return yc(arguments,"callee").get}catch{return tw}}}():tw,hd=lae(),_ae=cae(),Qr=Object.getPrototypeOf||(_ae?function(e){return e.__proto__}:null),kd={},bae=typeof Uint8Array>"u"||!Qr?Ot:Qr(Uint8Array),vc={"%AggregateError%":typeof AggregateError>"u"?Ot:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ot:ArrayBuffer,"%ArrayIteratorPrototype%":hd&&Qr?Qr([][Symbol.iterator]()):Ot,"%AsyncFromSyncIteratorPrototype%":Ot,"%AsyncFunction%":kd,"%AsyncGenerator%":kd,"%AsyncGeneratorFunction%":kd,"%AsyncIteratorPrototype%":kd,"%Atomics%":typeof Atomics>"u"?Ot:Atomics,"%BigInt%":typeof BigInt>"u"?Ot:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ot:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ot:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ot:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ot:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ot:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ot:FinalizationRegistry,"%Function%":xL,"%GeneratorFunction%":kd,"%Int8Array%":typeof Int8Array>"u"?Ot:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ot:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ot:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hd&&Qr?Qr(Qr([][Symbol.iterator]())):Ot,"%JSON%":typeof JSON=="object"?JSON:Ot,"%Map%":typeof Map>"u"?Ot:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hd||!Qr?Ot:Qr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ot:Promise,"%Proxy%":typeof Proxy>"u"?Ot:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ot:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ot:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hd||!Qr?Ot:Qr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ot:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hd&&Qr?Qr(""[Symbol.iterator]()):Ot,"%Symbol%":hd?Symbol:Ot,"%SyntaxError%":Uf,"%ThrowTypeError%":vae,"%TypedArray%":bae,"%TypeError%":df,"%Uint8Array%":typeof Uint8Array>"u"?Ot:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ot:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ot:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ot:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ot:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ot:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ot:WeakSet};if(Qr)try{null.error}catch(e){var Sae=Qr(Qr(e));vc["%Error.prototype%"]=Sae}var wae=function e(t){var n;if(t==="%AsyncFunction%")n=ew("async function () {}");else if(t==="%GeneratorFunction%")n=ew("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ew("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Qr&&(n=Qr(i.prototype))}return vc[t]=n,n},HP={"%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"]},km=wL,Qv=yae,xae=km.call(Function.call,Array.prototype.concat),Cae=km.call(Function.apply,Array.prototype.splice),qP=km.call(Function.call,String.prototype.replace),Yv=km.call(Function.call,String.prototype.slice),Eae=km.call(Function.call,RegExp.prototype.exec),Tae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Aae=/\\(\\)?/g,kae=function(t){var n=Yv(t,0,1),r=Yv(t,-1);if(n==="%"&&r!=="%")throw new Uf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Uf("invalid intrinsic syntax, expected opening `%`");var i=[];return qP(t,Tae,function(o,s,a,l){i[i.length]=a?qP(l,Aae,"$1"):s||o}),i},Pae=function(t,n){var r=t,i;if(Qv(HP,r)&&(i=HP[r],r="%"+i[0]+"%"),Qv(vc,r)){var o=vc[r];if(o===kd&&(o=wae(r)),typeof o>"u"&&!n)throw new df("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Uf("intrinsic "+t+" does not exist!")},Rae=function(t,n){if(typeof t!="string"||t.length===0)throw new df("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new df('"allowMissing" argument must be a boolean');if(Eae(/^%?[^%]*%?$/,t)===null)throw new Uf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=kae(t),i=r.length>0?r[0]:"",o=Pae("%"+i+"%",n),s=o.name,a=o.value,l=!1,u=o.alias;u&&(i=u[0],Cae(r,xae([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=Yv(f,0,1),p=Yv(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new Uf("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,s="%"+i+"%",Qv(vc,s))a=vc[s];else if(a!=null){if(!(f in a)){if(!n)throw new df("base intrinsic for "+t+" exists, but the property is not available.");return}if(yc&&c+1>=r.length){var m=yc(a,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[f]}else d=Qv(a,f),a=a[f];d&&!l&&(vc[s]=a)}}return a},Oae=Rae,TC=Oae("%Object.defineProperty%",!0),AC=function(){if(TC)try{return TC({},"a",{value:1}),!0}catch{return!1}return!1};AC.hasArrayLengthDefineBug=function(){if(!AC())return null;try{return TC([],"length",{value:1}).length!==1}catch{return!0}};var Iae=AC,Mae=oae,Nae=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Dae=Object.prototype.toString,Lae=Array.prototype.concat,CL=Object.defineProperty,$ae=function(e){return typeof e=="function"&&Dae.call(e)==="[object Function]"},Fae=Iae(),EL=CL&&Fae,Bae=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!$ae(r)||!r())return}EL?CL(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},TL=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Mae(t);Nae&&(r=Lae.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)Bae(e,r[i],t[r[i]],n[r[i]])};TL.supportsDescriptors=!!EL;var AL=TL,I0={exports:{}};typeof self<"u"?I0.exports=self:typeof window<"u"?I0.exports=window:I0.exports=Function("return this")();var kL=I0.exports,zae=kL,PL=function(){return typeof ut!="object"||!ut||ut.Math!==Math||ut.Array!==Array?zae:ut},Uae=AL,jae=PL,Vae=function(){var t=jae();if(Uae.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},Gae=AL,Hae=kL,RL=PL,qae=Vae,Wae=RL(),OL=function(){return Wae};Gae(OL,{getPolyfill:RL,implementation:Hae,shim:qae});var PE=OL,IL={},Pm={},RE={},V_={},G_={};Object.defineProperty(G_,"__esModule",{value:!0});G_.convertWildcardToRegex=void 0;var Kae=/\*+/g,Xae=function(e){return new RegExp(e.replace(Kae,"(.+?)"))};G_.convertWildcardToRegex=Xae;var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});Rm.escapeRegexString=void 0;var Qae=/[$()*+.?[\\\]^{|}]/g,Yae=/-/g,Zae=function(e){return e.replace(Qae,"\\$&").replace(Yae,"\\x2d")};Rm.escapeRegexString=Zae;var H_={};Object.defineProperty(H_,"__esModule",{value:!0});H_.parseRegex=void 0;var Jae=/(\/?)(.+)\1([a-z]*)/,ele=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,tle=function(e){var t=Jae.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!ele.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};H_.parseRegex=tle;Object.defineProperty(V_,"__esModule",{value:!0});V_.createStringTest=void 0;var nle=G_,rle=Rm,ile=H_,nw=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,ile.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}},ole=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 nw(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?nw(e,String((0,nle.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):nw(e,"/("+(0,rle.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};V_.createStringTest=ole;var q_={};Object.defineProperty(q_,"__esModule",{value:!0});q_.testComparisonRange=void 0;var sle=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))}};q_.testComparisonRange=sle;var W_={};Object.defineProperty(W_,"__esModule",{value:!0});W_.testRange=void 0;var ale=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};W_.testRange=ale;(function(e){var t=ut&&ut.__assign||function(){return t=Object.assign||function(c){for(var d,f=1,h=arguments.length;f<h;f++){d=arguments[f];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},t.apply(this,arguments)},n=ut&&ut.__spreadArray||function(c,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 c.concat(m||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=V_,i=q_,o=W_,s=function(c){if(c.type!=="Tag")throw new Error("Expected a tag expression.");var d=c.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(c.operator&&c.operator.operator!==":"){var h=c.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)({},c);return function(m){return p(String(m))}}},a=function(c,d,f,h,p){if(Array.isArray(d)){for(var m=!1,b=0,_=0,y=d;_<y.length;_++){var g=y[_];if(a(c,g,f,n(n([],h,!0),[String(b++)],!1),p)){if(f)return!0;m=!0}}return m}else if(typeof d=="object"&&d!==null){var m=!1;for(var v in d)if(a(c,d[v],f,n(n([],h,!0),[v],!1),p)){if(f)return!0;m=!0}return m}if(c.type!=="Tag")throw new Error("Expected a tag expression.");if(!c.test)throw new Error("Expected test to be defined.");var S=c.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(c,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=s(d)),d.field.type==="ImplicitField"){var m=!1;for(var b in c)if(a(t(t({},d),{field:{location:{end:-1,start:-1},name:b,quoted:!0,quotes:"double",type:"Field"}}),c[b],f,n(n([],h,!0),[b],!1),p)){if(f)return!0;m=!0}return m}if(d.field.name in c)return a(d,c[d.field.name],f,h,p);if(d.getValue&&d.field.path)return a(d,d.getValue(c),f,d.field.path,p);if(d.field.path){for(var _=c,y=0,g=d.field.path;y<g.length;y++){var v=g[y];if(typeof _!="object"||_===null)return!1;if(v in _)_=_[v];else return!1}return a(d,_,f,d.field.path,p)}else return!1},u=function(c,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),c.type==="Tag")return d.filter(function(y){return l(y,c,f,c.field.type==="ImplicitField"?h:n(n([],h,!0),[c.field.name],!1),p)});if(c.type==="UnaryOperator"){var m=(0,e.internalFilter)(c.operand,d,f,h,[]);return d.filter(function(y){return!m.includes(y)})}if(!c.left)throw new Error("Expected left to be defined.");var b=(0,e.internalFilter)(c.left,d,f,h,p);if(!c.right)throw new Error("Expected right to be defined.");if(c.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(c.operator.operator==="OR"){var _=(0,e.internalFilter)(c.right,d,f,h,p);return Array.from(new Set(n(n([],b,!0),_,!0)))}else if(c.operator.operator==="AND")return(0,e.internalFilter)(c.right,b,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=u})(RE);Object.defineProperty(Pm,"__esModule",{value:!0});Pm.filter=void 0;var lle=RE,ule=function(e,t){return(0,lle.internalFilter)(e,t)};Pm.filter=ule;var K_={};Object.defineProperty(K_,"__esModule",{value:!0});K_.highlight=void 0;var cle=Rm,dle=RE,fle=function(e,t){var n=[];(0,dle.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(c){return c.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,s=n;o<s.length;o++){var a=s[o];i(a)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,cle.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};K_.highlight=fle;var X_={},ML={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(ut,function(){function t(u,c,d){return this.id=++t.highestId,this.name=u,this.symbols=c,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,d,f){this.rule=u,this.dot=c,this.reference=d,this.data=[],this.wantedBy=f,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,d=this.wants,f=this.completed,h=0;h<c.length;h++){var p=c[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var m=p.wantedBy,b=m.length;b--;){var _=m[b];this.complete(_,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],b=0;b<g.length;b++){var v=g[b];this.complete(p,v)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(u){for(var c=this.grammar.byName[u]||[],d=0;d<c.length;d++){var f=c[d],h=this.wants[u],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(u,c){var d=u.nextState(c);this.states.push(d)};function i(u,c){this.rules=u,this.start=c||this.rules[0].name;var d=this.byName={};this.rules.forEach(function(f){d.hasOwnProperty(f.name)||(d[f.name]=[]),d[f.name].push(f)})}i.fromCompiled=function(f,c){var d=f.Lexer;f.ParserStart&&(c=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,c);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(u,c){this.buffer=u,this.index=0,this.line=c?c.line:1,this.lastLineBreak=c?-c.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var u=this.buffer[this.index++];return u===`
`&&(this.line+=1,this.lastLineBreak=this.index),{value:u}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(u,c){var d=this.buffer;if(typeof d=="string"){var f=d.split(`
`).slice(Math.max(0,this.line-5),this.line),h=d.indexOf(`
`,this.index);h===-1&&(h=d.length);var p=this.index-this.lastLineBreak,m=String(this.line).length;return c+=" at line "+this.line+" col "+p+`:
`,c+=f.map(function(_,y){return b(this.line-f.length+y+1,m)+" "+_},this).join(`
`),c+=`
`+b("",m+p)+`^
`,c}else return c+" at index "+(this.index-1);function b(_,y){var g=String(_);return Array(y-g.length+1).join(" ")+g}};function s(u,c,d){if(u instanceof i)var f=u,d=c;else var f=i.fromCompiled(u,c);this.grammar=f,this.options={keepHistory:!1,lexer:f.lexer||new o};for(var h in d||{})this.options[h]=d[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new r(f,0);this.table=[p],p.wants[f.start]=[],p.predict(f.start),p.process(),this.current=0}s.fail={},s.prototype.feed=function(u){var c=this.lexer;c.reset(u,this.lexerState);for(var d;;){try{if(d=c.next(),!d)break}catch(x){var m=new r(this.grammar,this.current+1);this.table.push(m);var f=new Error(this.reportLexerError(x));throw f.offset=this.current,f.token=x.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 b=d.text!==void 0?d.text:d.value,_=c.constructor===o?d.value:d,y=h.scannable,g=y.length;g--;){var v=y[g],S=v.rule.symbols[v.dot];if(S.test?S.test(_):S.type?S.type===d.type:S.literal===b){var w=v.nextState({data:_,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=c.save()),this.current++}return h&&(this.lexerState=c.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(u){var c,d,f=u.token;return f?(c="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(c="input (lexer error)",d=u.message),this.reportErrorCommon(d,c)},s.prototype.reportError=function(u){var c=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),d=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(d,c)},s.prototype.reportErrorCommon=function(u,c){var d=[];d.push(u);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(b){var _=b.rule.symbols[b.dot];return _&&typeof _!="string"});if(p.length===0)d.push("Unexpected "+c+`. I did not expect any more input. Here is the state of my parse table:
`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+c+`. Instead, I was expecting to see one of the following:
`);var m=p.map(function(b){return this.buildFirstStateStack(b,[])||[b]},this);m.forEach(function(b){var _=b[0],y=_.rule.symbols[_.dot],g=this.getSymbolDisplay(y);d.push("A "+g+" based on:"),this.displayStateStack(b,d)},this)}return d.push(""),d.join(`
`)},s.prototype.displayStateStack=function(u,c){for(var d,f=0,h=0;h<u.length;h++){var p=u[h],m=p.rule.toString(p.dot);m===d?f++:(f>0&&c.push(" ^ "+f+" more lines identical to this"),f=0,c.push(" "+m)),d=m}},s.prototype.getSymbolDisplay=function(u){return a(u)},s.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var d=u.wantedBy[0],f=[u].concat(c),h=this.buildFirstStateStack(d,f);return h===null?null:[u].concat(h)},s.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},s.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},s.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},s.prototype.finish=function(){var u=[],c=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===c&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==s.fail&&u.push(f)}),u.map(function(f){return f.data})};function a(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:s,Grammar:i,Rule:t}})})(ML);var hle=ML.exports,Oc={},NL={},Ru={};Ru.__esModule=void 0;Ru.__esModule=!0;var ple=typeof Object.setPrototypeOf=="function",gle=typeof Object.getPrototypeOf=="function",mle=typeof Object.defineProperty=="function",yle=typeof Object.create=="function",vle=typeof Object.prototype.hasOwnProperty=="function",_le=function(t,n){ple?Object.setPrototypeOf(t,n):t.__proto__=n};Ru.setPrototypeOf=_le;var ble=function(t){return gle?Object.getPrototypeOf(t):t.__proto__||t.prototype};Ru.getPrototypeOf=ble;var WP=!1,Sle=function e(t,n,r){if(mle&&!WP)try{Object.defineProperty(t,n,r)}catch{WP=!0,e(t,n,r)}else t[n]=r.value};Ru.defineProperty=Sle;var DL=function(t,n){return vle?t.hasOwnProperty(t,n):t[n]===void 0};Ru.hasOwnProperty=DL;var wle=function(t,n){if(yle)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)DL(n,o)&&(i[o]=n[o].value);return i};Ru.objectCreate=wle;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=Ru,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,s=new Error().toString()==="[object Error]",a="";function l(u){var c=this.constructor,d=c.name||function(){var b=c.toString().match(/^function\s*([^\s(]+)/);return b===null?a||"Error":b[1]}(),f=d==="Error",h=f?a:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof c)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:c),p.stack===void 0){var m=new Error(u);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})(NL);var LL=ut&&ut.__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(Oc,"__esModule",{value:!0});Oc.SyntaxError=Oc.LiqeError=void 0;var xle=NL,$L=function(e){LL(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(xle.ExtendableError);Oc.LiqeError=$L;var Cle=function(e){LL(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}($L);Oc.SyntaxError=Cle;var OE={},Zv=ut&&ut.__assign||function(){return Zv=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},Zv.apply(this,arguments)};Object.defineProperty(OE,"__esModule",{value:!0});function ka(e){return e[0]}var Ele={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:ka},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:ka},{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:ka},{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:ka},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:ka},{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:ka},{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:ka},{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:ka},{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,Zv({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 Zv({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:ka},{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"};OE.default=Ele;var FL={},Q_={},Om={};Object.defineProperty(Om,"__esModule",{value:!0});Om.isSafePath=void 0;var Tle=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Ale=function(e){return Tle.test(e)};Om.isSafePath=Ale;Object.defineProperty(Q_,"__esModule",{value:!0});Q_.createGetValueFunctionBody=void 0;var kle=Om,Ple=function(e){if(!(0,kle.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};Q_.createGetValueFunctionBody=Ple;(function(e){var t=ut&&ut.__assign||function(){return t=Object.assign||function(o){for(var s,a=1,l=arguments.length;a<l;a++){s=arguments[a];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(o[u]=s[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=Q_,r=Om,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})(FL);var BL=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X_,"__esModule",{value:!0});X_.parse=void 0;var zL=BL(hle),Rle=Oc,Ole=BL(OE),Ile=FL,Mle=zL.default.Grammar.fromCompiled(Ole.default),Nle=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,Dle=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new zL.default.Parser(Mle),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(Nle);throw r?new Rle.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,Ile.hydrateAst)(n[0]);return i};X_.parse=Dle;var Y_={};Object.defineProperty(Y_,"__esModule",{value:!0});Y_.test=void 0;var Lle=Pm,$le=function(e,t){return(0,Lle.filter)(e,[t]).length===1};Y_.test=$le;var UL={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,s){return s==="double"?'"'.concat(o,'"'):s==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var s=o.range,a=s.min,l=s.max,u=s.minInclusive,c=s.maxInclusive;return"".concat(u?"[":"{").concat(a," TO ").concat(l).concat(c?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var s=o.field,a=o.expression,l=o.operator;if(s.type==="ImplicitField")return n(a);var u=s.quoted?t(s.name,s.quotes):s.name,c=" ".repeat(a.location.start-l.location.end);return u+l.operator+c+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})(UL);var Z_={};Object.defineProperty(Z_,"__esModule",{value:!0});Z_.isSafeUnquotedExpression=void 0;var Fle=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};Z_.isSafeUnquotedExpression=Fle;(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=Pm;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=K_;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=X_;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=Y_;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Oc;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var s=UL;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return s.serialize}});var a=Z_;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return a.isSafeUnquotedExpression}})})(IL);var Im={},jL={},Ic={};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.ROARR_LOG_FORMAT_VERSION=Ic.ROARR_VERSION=void 0;Ic.ROARR_VERSION="5.0.0";Ic.ROARR_LOG_FORMAT_VERSION="2.0.0";var Mm={};Object.defineProperty(Mm,"__esModule",{value:!0});Mm.logLevels=void 0;Mm.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var VL={},J_={};Object.defineProperty(J_,"__esModule",{value:!0});J_.hasOwnProperty=void 0;const Ble=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);J_.hasOwnProperty=Ble;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=J_;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(VL);var GL={},eb={},tb={};Object.defineProperty(tb,"__esModule",{value:!0});tb.tokenize=void 0;const zle=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Ule=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=zle.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};tb.tokenize=Ule;Object.defineProperty(eb,"__esModule",{value:!0});eb.createPrintf=void 0;const KP=kE,jle=tb,Vle=(e,t)=>t.placeholder,Gle=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:Vle,i={};return(o,...s)=>{let a=i[o];a||(a=i[o]=jle.tokenize(o));let l="";for(const u of a)if(u.type==="literal")l+=u.literal;else{let c=s[u.position];if(c===void 0)l+=r(o,u,s);else if(u.conversion==="b")l+=KP.boolean(c)?"true":"false";else if(u.conversion==="B")l+=KP.boolean(c)?"TRUE":"FALSE";else if(u.conversion==="c")l+=c;else if(u.conversion==="C")l+=String(c).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")c=String(Math.trunc(c)),u.width!==null&&(c=n(c,u.width,u.flag)),l+=c;else if(u.conversion==="e")l+=Number(c).toExponential();else if(u.conversion==="E")l+=Number(c).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(c=Number(c).toFixed(u.precision)),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="o")l+=(Number.parseInt(String(c),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="S")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=String(c).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(c),10)>>>0;else if(u.conversion==="x")c=(Number.parseInt(String(c),10)>>>0).toString(16),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else throw new Error("Unknown format specifier.")}return l}};eb.createPrintf=Gle;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=eb;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(GL);var kC={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=b();r.configure=b,r.stringify=r,r.default=r,t.stringify=r,t.configure=b,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(_){return _.length<5e3&&!i.test(_)?`"${_}"`:JSON.stringify(_)}function s(_){if(_.length>200)return _.sort();for(let y=1;y<_.length;y++){const g=_[y];let v=y;for(;v!==0&&_[v-1]>g;)_[v]=_[v-1],v--;_[v]=g}return _}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(_){return a.call(_)!==void 0&&_.length!==0}function u(_,y,g){_.length<g&&(g=_.length);const v=y===","?"":" ";let S=`"0":${v}${_[0]}`;for(let w=1;w<g;w++)S+=`${y}"${w}":${v}${_[w]}`;return S}function c(_){if(n.call(_,"circularValue")){const y=_.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(_,y){let g;if(n.call(_,y)&&(g=_[y],typeof g!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return g===void 0?!0:g}function f(_,y){let g;if(n.call(_,y)){if(g=_[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(_){return _===1?"1 item":`${_} items`}function p(_){const y=new Set;for(const g of _)(typeof g=="string"||typeof g=="number")&&y.add(String(g));return y}function m(_){if(n.call(_,"strict")){const y=_.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return g=>{let v=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(v+=` (${g.toString()})`),new Error(v)}}}function b(_){_={..._};const y=m(_);y&&(_.bigint===void 0&&(_.bigint=!1),"circularValue"in _||(_.circularValue=Error));const g=c(_),v=d(_,"bigint"),S=d(_,"deterministic"),w=f(_,"maximumDepth"),x=f(_,"maximumBreadth");function C(N,E,P,D,B,R){let O=E[N];switch(typeof O=="object"&&O!==null&&typeof O.toJSON=="function"&&(O=O.toJSON(N)),O=D.call(E,N,O),typeof O){case"string":return o(O);case"object":{if(O===null)return"null";if(P.indexOf(O)!==-1)return g;let I="",F=",";const U=R;if(Array.isArray(O)){if(O.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(O),B!==""&&(R+=B,I+=`
${R}`,F=`,
${R}`);const K=Math.min(O.length,x);let ee=0;for(;ee<K-1;ee++){const ge=C(String(ee),O,P,D,B,R);I+=ge!==void 0?ge:"null",I+=F}const ie=C(String(ee),O,P,D,B,R);if(I+=ie!==void 0?ie:"null",O.length-1>x){const ge=O.length-x-1;I+=`${F}"... ${h(ge)} not stringified"`}return B!==""&&(I+=`
${U}`),P.pop(),`[${I}]`}let V=Object.keys(O);const H=V.length;if(H===0)return"{}";if(w<P.length+1)return'"[Object]"';let Y="",Q="";B!==""&&(R+=B,F=`,
${R}`,Y=" ");const j=Math.min(H,x);S&&!l(O)&&(V=s(V)),P.push(O);for(let K=0;K<j;K++){const ee=V[K],ie=C(ee,O,P,D,B,R);ie!==void 0&&(I+=`${Q}${o(ee)}:${Y}${ie}`,Q=F)}if(H>x){const K=H-x;I+=`${Q}"...":${Y}"${h(K)} not stringified"`,Q=F}return B!==""&&Q.length>1&&(I=`
${R}${I}
${U}`),P.pop(),`{${I}}`}case"number":return isFinite(O)?String(O):y?y(O):"null";case"boolean":return O===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(O);default:return y?y(O):void 0}}function A(N,E,P,D,B,R){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(N)),typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(P.indexOf(E)!==-1)return g;const O=R;let I="",F=",";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E),B!==""&&(R+=B,I+=`
${R}`,F=`,
${R}`);const H=Math.min(E.length,x);let Y=0;for(;Y<H-1;Y++){const j=A(String(Y),E[Y],P,D,B,R);I+=j!==void 0?j:"null",I+=F}const Q=A(String(Y),E[Y],P,D,B,R);if(I+=Q!==void 0?Q:"null",E.length-1>x){const j=E.length-x-1;I+=`${F}"... ${h(j)} not stringified"`}return B!==""&&(I+=`
${O}`),P.pop(),`[${I}]`}P.push(E);let U="";B!==""&&(R+=B,F=`,
${R}`,U=" ");let V="";for(const H of D){const Y=A(H,E[H],P,D,B,R);Y!==void 0&&(I+=`${V}${o(H)}:${U}${Y}`,V=F)}return B!==""&&V.length>1&&(I=`
${R}${I}
${O}`),P.pop(),`{${I}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function T(N,E,P,D,B){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(N),typeof E!="object")return T(N,E,P,D,B);if(E===null)return"null"}if(P.indexOf(E)!==-1)return g;const R=B;if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E),B+=D;let Y=`
${B}`;const Q=`,
${B}`,j=Math.min(E.length,x);let K=0;for(;K<j-1;K++){const ie=T(String(K),E[K],P,D,B);Y+=ie!==void 0?ie:"null",Y+=Q}const ee=T(String(K),E[K],P,D,B);if(Y+=ee!==void 0?ee:"null",E.length-1>x){const ie=E.length-x-1;Y+=`${Q}"... ${h(ie)} not stringified"`}return Y+=`
${R}`,P.pop(),`[${Y}]`}let O=Object.keys(E);const I=O.length;if(I===0)return"{}";if(w<P.length+1)return'"[Object]"';B+=D;const F=`,
${B}`;let U="",V="",H=Math.min(I,x);l(E)&&(U+=u(E,F,x),O=O.slice(E.length),H-=E.length,V=F),S&&(O=s(O)),P.push(E);for(let Y=0;Y<H;Y++){const Q=O[Y],j=T(Q,E[Q],P,D,B);j!==void 0&&(U+=`${V}${o(Q)}: ${j}`,V=F)}if(I>x){const Y=I-x;U+=`${V}"...": "${h(Y)} not stringified"`,V=F}return V!==""&&(U=`
${B}${U}
${R}`),P.pop(),`{${U}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function k(N,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(N),typeof E!="object")return k(N,E,P);if(E===null)return"null"}if(P.indexOf(E)!==-1)return g;let D="";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<P.length+1)return'"[Array]"';P.push(E);const F=Math.min(E.length,x);let U=0;for(;U<F-1;U++){const H=k(String(U),E[U],P);D+=H!==void 0?H:"null",D+=","}const V=k(String(U),E[U],P);if(D+=V!==void 0?V:"null",E.length-1>x){const H=E.length-x-1;D+=`,"... ${h(H)} not stringified"`}return P.pop(),`[${D}]`}let B=Object.keys(E);const R=B.length;if(R===0)return"{}";if(w<P.length+1)return'"[Object]"';let O="",I=Math.min(R,x);l(E)&&(D+=u(E,",",x),B=B.slice(E.length),I-=E.length,O=","),S&&(B=s(B)),P.push(E);for(let F=0;F<I;F++){const U=B[F],V=k(U,E[U],P);V!==void 0&&(D+=`${O}${o(U)}:${V}`,O=",")}if(R>x){const F=R-x;D+=`${O}"...":"${h(F)} not stringified"`}return P.pop(),`{${D}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function L(N,E,P){if(arguments.length>1){let D="";if(typeof P=="number"?D=" ".repeat(Math.min(P,10)):typeof P=="string"&&(D=P.slice(0,10)),E!=null){if(typeof E=="function")return C("",{"":N},[],E,D,"");if(Array.isArray(E))return A("",N,[],p(E),D,"")}if(D.length!==0)return T("",N,[],D,"")}return k("",N,[])}return L}})(kC,kC.exports);var Hle=kC.exports;(function(e){var t=ut&&ut.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=Ic,r=Mm,i=VL,o=GL,s=t(PE),a=t(Hle);let l=!1;const u=(0,s.default)(),c=()=>u.ROARR,d=()=>({messageContext:{},transforms:[]}),f=()=>{const g=c().asyncLocalStorage;if(!g)throw new Error("AsyncLocalContext is unavailable.");const v=g.getStore();return v||d()},h=()=>!!c().asyncLocalStorage,p=()=>{if(h()){const g=f();return(0,i.hasOwnProperty)(g,"sequenceRoot")&&(0,i.hasOwnProperty)(g,"sequence")&&typeof g.sequence=="number"?String(g.sequenceRoot)+"."+String(g.sequence++):String(c().sequence++)}return String(c().sequence++)},m=(g,v)=>(S,w,x,C,A,T,k,L,N,E)=>{g.child({logLevel:v})(S,w,x,C,A,T,k,L,N,E)},b=1e3,_=(g,v)=>(S,w,x,C,A,T,k,L,N,E)=>{const P=(0,a.default)({a:S,b:w,c:x,d:C,e:A,f:T,g:k,h:L,i:N,j:E,logLevel:v});if(!P)throw new Error("Expected key to be a string");const D=c().onceLog;D.has(P)||(D.add(P),D.size>b&&D.clear(),g.child({logLevel:v})(S,w,x,C,A,T,k,L,N,E))},y=(g,v={},S=[])=>{const w=(x,C,A,T,k,L,N,E,P,D)=>{const B=Date.now(),R=p();let O;h()?O=f():O=d();let I,F;if(typeof x=="string"?I={...O.messageContext,...v}:I={...O.messageContext,...v,...x},typeof x=="string"&&C===void 0)F=x;else if(typeof x=="string"){if(!x.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.");F=(0,o.printf)(x,C,A,T,k,L,N,E,P,D)}else{let V=C;if(typeof C!="string")if(C===void 0)V="";else throw new TypeError("Message must be a string. Received "+typeof C+".");F=(0,o.printf)(V,A,T,k,L,N,E,P,D)}let U={context:I,message:F,sequence:R,time:B,version:n.ROARR_LOG_FORMAT_VERSION};for(const V of[...O.transforms,...S])if(U=V(U),typeof U!="object"||U===null)throw new Error("Message transform function must return a message object.");g(U)};return w.child=x=>{let C;return h()?C=f():C=d(),typeof x=="function"?(0,e.createLogger)(g,{...C.messageContext,...v,...x},[x,...S]):(0,e.createLogger)(g,{...C.messageContext,...v,...x},S)},w.getContext=()=>{let x;return h()?x=f():x=d(),{...x.messageContext,...v}},w.adopt=async(x,C)=>{if(!h())return l===!1&&(l=!0,g({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:p(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),x();const A=f();let T;(0,i.hasOwnProperty)(A,"sequenceRoot")&&(0,i.hasOwnProperty)(A,"sequence")&&typeof A.sequence=="number"?T=A.sequenceRoot+"."+String(A.sequence++):T=String(c().sequence++);let k={...A.messageContext};const L=[...A.transforms];typeof C=="function"?L.push(C):k={...k,...C};const N=c().asyncLocalStorage;if(!N)throw new Error("Async local context unavailable.");return N.run({messageContext:k,sequence:0,sequenceRoot:T,transforms:L},()=>x())},w.debug=m(w,r.logLevels.debug),w.debugOnce=_(w,r.logLevels.debug),w.error=m(w,r.logLevels.error),w.errorOnce=_(w,r.logLevels.error),w.fatal=m(w,r.logLevels.fatal),w.fatalOnce=_(w,r.logLevels.fatal),w.info=m(w,r.logLevels.info),w.infoOnce=_(w,r.logLevels.info),w.trace=m(w,r.logLevels.trace),w.traceOnce=_(w,r.logLevels.trace),w.warn=m(w,r.logLevels.warn),w.warnOnce=_(w,r.logLevels.warn),w};e.createLogger=y})(jL);var nb={},qle=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},Wle=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nb,"__esModule",{value:!0});nb.createRoarrInitialGlobalStateBrowser=void 0;const XP=Ic,QP=Wle(qle),Kle=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(QP.default),t.includes(XP.ROARR_VERSION)||t.push(XP.ROARR_VERSION),t.sort(QP.default),{sequence:0,...e,versions:t}};nb.createRoarrInitialGlobalStateBrowser=Kle;var rb={};Object.defineProperty(rb,"__esModule",{value:!0});rb.getLogLevelName=void 0;const Xle=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";rb.getLogLevelName=Xle;(function(e){var t=ut&&ut.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const n=jL,r=nb,o=(0,t(PE).default)(),s=(0,r.createRoarrInitialGlobalStateBrowser)(o.ROARR||{});e.ROARR=s,o.ROARR=s;const a=d=>JSON.stringify(d),l=(0,n.createLogger)(d=>{var f;s.write&&s.write(((f=s.serializeMessage)!==null&&f!==void 0?f:a)(d))});e.Roarr=l;var u=Mm;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var c=rb;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return c.getLogLevelName}})})(Im);var Qle=ut&&ut.__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},Yle=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(B_,"__esModule",{value:!0});B_.createLogWriter=void 0;var Zle=z_,Jle=kE,eue=Yle(PE),HL=IL,tue=Im,YP=(0,eue.default)(),nue={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"}},rue={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},iue=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,HL.parse)(t):null},oue=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:YP.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,Zle.createLogMethods)();if(!r&&!YP.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,Jle.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=iue(r);return function(s){var a=JSON.parse(s),l=a.context,u=l.logLevel,c=l.namespace,d=Qle(l,["logLevel","namespace"]);if(!(o&&!(0,HL.test)(o,a))){var f=(0,tue.getLogLevelName)(Number(u)),h=i[f],p=nue[f],m=`
background-color: `.concat(p.backgroundColor,`;
color: `).concat(p.color,`;
font-weight: bold;
`),b=`
color: `.concat(rue[f].color,`;
`),_=`
color: inherit;
`;Object.keys(d).length>0?h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(a.message," %O"),m,b,_,d):h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(a.message),m,b,_)}}};B_.createLogWriter=oue;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=B_;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(bL);Im.ROARR.write=bL.createLogWriter();const qL={};Im.Roarr.child(qL);const ib=ku(Im.Roarr.child(qL)),pe=e=>ib.get().child({namespace:e}),zRe=["trace","debug","info","warn","error","fatal"],URe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},gn=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},sue=async e=>{const t={},n=await e.arrayBuffer(),r=Zse(n).text,i=Iv(r,"invokeai_metadata");if(i){const s=PD.safeParse(JSON.parse(i));s.success?t.metadata=s.data:pe("system").error({error:gn(s.error)},"Problem reading metadata from image")}const o=Iv(r,"invokeai_workflow");if(o){const s=ND.safeParse(JSON.parse(o));s.success?t.workflow=s.data:pe("system").error({error:gn(s.error)},"Problem reading workflow from image")}return t};var Jv=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},e1=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},aue=Object.defineProperty,lue=Object.defineProperties,uue=Object.getOwnPropertyDescriptors,t1=Object.getOwnPropertySymbols,WL=Object.prototype.hasOwnProperty,KL=Object.prototype.propertyIsEnumerable,ZP=function(e,t,n){return t in e?aue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},mr=function(e,t){for(var n in t||(t={}))WL.call(t,n)&&ZP(e,n,t[n]);if(t1)for(var r=0,i=t1(t);r<i.length;r++){var n=i[r];KL.call(t,n)&&ZP(e,n,t[n])}return e},na=function(e,t){return lue(e,uue(t))},JP=function(e,t){var n={};for(var r in e)WL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&t1)for(var i=0,o=t1(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&KL.call(e,r)&&(n[r]=e[r])}return n},n1=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{a(n.next(l))}catch(u){i(u)}},s=function(l){try{a(n.throw(l))}catch(u){i(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,s)};a((n=n.apply(e,t)).next())})},qn;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(qn||(qn={}));function cue(e){return{status:e,isUninitialized:e===qn.uninitialized,isLoading:e===qn.pending,isSuccess:e===qn.fulfilled,isError:e===qn.rejected}}function due(e){return new RegExp("(^|:)//").test(e)}var fue=function(e){return e.replace(/\/$/,"")},hue=function(e){return e.replace(/^\//,"")};function pue(e,t){if(!e)return t;if(!t)return e;if(due(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=fue(e),t=hue(t),""+e+n+t}var e6=function(e){return[].concat.apply([],e)};function gue(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function mue(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var t6=Ns;function XL(e,t){if(e===t||!(t6(e)&&t6(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,o=Array.isArray(t)?[]:{},s=0,a=n;s<a.length;s++){var l=a[s];o[l]=XL(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var n6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},yue=function(e){return e.status>=200&&e.status<=299},vue=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function r6(e){if(!Ns(e))return e;for(var t=mr({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],s=i[1];s===void 0&&delete t[o]}return t}function _ue(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(g){return g}:i,s=n.fetchFn,a=s===void 0?n6:s,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?vue:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,m=n.responseHandler,b=n.validateStatus,_=JP(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&a===n6&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(g,v){return n1(t,null,function(){var S,w,x,C,A,T,k,L,N,E,P,D,B,R,O,I,F,U,V,H,Y,Q,j,K,ee,ie,ge,ae,dt,et,Ne,lt,Te,Ht,br,An;return Jv(this,function(_n){switch(_n.label){case 0:return S=v.signal,w=v.getState,x=v.extra,C=v.endpoint,A=v.forced,T=v.type,L=typeof g=="string"?{url:g}:g,N=L.url,E=L.headers,P=E===void 0?new Headers(_.headers):E,D=L.params,B=D===void 0?void 0:D,R=L.responseHandler,O=R===void 0?m??"json":R,I=L.validateStatus,F=I===void 0?b??yue:I,U=L.timeout,V=U===void 0?p:U,H=JP(L,["url","headers","params","responseHandler","validateStatus","timeout"]),Y=mr(na(mr({},_),{signal:S}),H),P=new Headers(r6(P)),Q=Y,[4,o(P,{getState:w,extra:x,endpoint:C,forced:A,type:T})];case 1:Q.headers=_n.sent()||P,j=function(qt){return typeof qt=="object"&&(Ns(qt)||Array.isArray(qt)||typeof qt.toJSON=="function")},!Y.headers.has("content-type")&&j(Y.body)&&Y.headers.set("content-type",f),j(Y.body)&&c(Y.headers)&&(Y.body=JSON.stringify(Y.body,h)),B&&(K=~N.indexOf("?")?"&":"?",ee=l?l(B):new URLSearchParams(r6(B)),N+=K+ee),N=pue(r,N),ie=new Request(N,Y),ge=ie.clone(),k={request:ge},dt=!1,et=V&&setTimeout(function(){dt=!0,v.abort()},V),_n.label=2;case 2:return _n.trys.push([2,4,5,6]),[4,a(ie)];case 3:return ae=_n.sent(),[3,6];case 4:return Ne=_n.sent(),[2,{error:{status:dt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ne)},meta:k}];case 5:return et&&clearTimeout(et),[7];case 6:lt=ae.clone(),k.response=lt,Ht="",_n.label=7;case 7:return _n.trys.push([7,9,,10]),[4,Promise.all([y(ae,O).then(function(qt){return Te=qt},function(qt){return br=qt}),lt.text().then(function(qt){return Ht=qt},function(){})])];case 8:if(_n.sent(),br)throw br;return[3,10];case 9:return An=_n.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ae.status,data:Ht,error:String(An)},meta:k}];case 10:return[2,F(ae,Te)?{data:Te,meta:k}:{error:{status:ae.status,data:Te},meta:k}]}})})};function y(g,v){return n1(this,null,function(){var S;return Jv(this,function(w){switch(w.label){case 0:return typeof v=="function"?[2,v(g)]:(v==="content-type"&&(v=c(g.headers)?"json":"text"),v!=="json"?[3,2]:[4,g.text()]);case 1:return S=w.sent(),[2,S.length?JSON.parse(S):null];case 2:return[2,g.text()]}})})}}var i6=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),IE=Me("__rtkq/focused"),QL=Me("__rtkq/unfocused"),ME=Me("__rtkq/online"),YL=Me("__rtkq/offline"),ya;(function(e){e.query="query",e.mutation="mutation"})(ya||(ya={}));function ZL(e){return e.type===ya.query}function bue(e){return e.type===ya.mutation}function JL(e,t,n,r,i,o){return Sue(e)?e(t,n,r,i).map(PC).map(o):Array.isArray(e)?e.map(PC).map(o):[]}function Sue(e){return typeof e=="function"}function PC(e){return typeof e=="string"?{type:e}:e}function rw(e){return e!=null}var Pg=Symbol("forceQueryFn"),RC=function(e){return typeof e[Pg]=="function"};function wue(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,s=new Map,a=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,c=l.removeMutationResult,d=l.updateSubscriptionOptions;return{buildInitiateQuery:y,buildInitiateMutation:g,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:b,getRunningMutationsThunk:_,getRunningOperationPromises:h,removalWarning:f};function f(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function h(){typeof process<"u";var v=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return e1(e1([],v(s)),v(a)).filter(rw)}function p(v,S){return function(w){var x,C=o.endpointDefinitions[v],A=t({queryArgs:S,endpointDefinition:C,endpointName:v});return(x=s.get(w))==null?void 0:x[A]}}function m(v,S){return function(w){var x;return(x=a.get(w))==null?void 0:x[S]}}function b(){return function(v){return Object.values(s.get(v)||{}).filter(rw)}}function _(){return function(v){return Object.values(a.get(v)||{}).filter(rw)}}function y(v,S){var w=function(x,C){var A=C===void 0?{}:C,T=A.subscribe,k=T===void 0?!0:T,L=A.forceRefetch,N=A.subscriptionOptions,E=Pg,P=A[E];return function(D,B){var R,O,I=t({queryArgs:x,endpointDefinition:S,endpointName:v}),F=n((R={type:"query",subscribe:k,forceRefetch:L,subscriptionOptions:N,endpointName:v,originalArgs:x,queryCacheKey:I},R[Pg]=P,R)),U=i.endpoints[v].select(x),V=D(F),H=U(B()),Y=V.requestId,Q=V.abort,j=H.requestId!==Y,K=(O=s.get(D))==null?void 0:O[I],ee=function(){return U(B())},ie=Object.assign(P?V.then(ee):j&&!K?Promise.resolve(H):Promise.all([K,V]).then(ee),{arg:x,requestId:Y,subscriptionOptions:N,queryCacheKey:I,abort:Q,unwrap:function(){return n1(this,null,function(){var ae;return Jv(this,function(dt){switch(dt.label){case 0:return[4,ie];case 1:if(ae=dt.sent(),ae.isError)throw ae.error;return[2,ae.data]}})})},refetch:function(){return D(w(x,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){k&&D(u({queryCacheKey:I,requestId:Y}))},updateSubscriptionOptions:function(ae){ie.subscriptionOptions=ae,D(d({endpointName:v,requestId:Y,queryCacheKey:I,options:ae}))}});if(!K&&!j&&!P){var ge=s.get(D)||{};ge[I]=ie,s.set(D,ge),ie.then(function(){delete ge[I],Object.keys(ge).length||s.delete(D)})}return ie}};return w}function g(v){return function(S,w){var x=w===void 0?{}:w,C=x.track,A=C===void 0?!0:C,T=x.fixedCacheKey;return function(k,L){var N=r({type:"mutation",endpointName:v,originalArgs:S,track:A,fixedCacheKey:T}),E=k(N),P=E.requestId,D=E.abort,B=E.unwrap,R=E.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),O=function(){k(c({requestId:P,fixedCacheKey:T}))},I=Object.assign(R,{arg:E.arg,requestId:P,abort:D,unwrap:B,unsubscribe:O,reset:O}),F=a.get(k)||{};return a.set(k,F),F[P]=I,I.then(function(){delete F[P],Object.keys(F).length||a.delete(k)}),T&&(F[T]=I,I.then(function(){F[T]===I&&(delete F[T],Object.keys(F).length||a.delete(k))})),I}}}}function o6(e){return e}function xue(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,s=e.api,a=function(g,v,S){return function(w){var x=i[g];w(s.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:v,endpointDefinition:x,endpointName:g}),patches:S}))}},l=function(g,v,S){return function(w,x){var C,A,T=s.endpoints[g].select(v)(x()),k={patches:[],inversePatches:[],undo:function(){return w(s.util.patchQueryData(g,v,k.inversePatches))}};if(T.status===qn.uninitialized)return k;if("data"in T)if(po(T.data)){var L=Y5(T.data,S),N=L[1],E=L[2];(C=k.patches).push.apply(C,N),(A=k.inversePatches).push.apply(A,E)}else{var P=S(T.data);k.patches.push({op:"replace",path:[],value:P}),k.inversePatches.push({op:"replace",path:[],value:T.data})}return w(s.util.patchQueryData(g,v,k.patches)),k}},u=function(g,v,S){return function(w){var x;return w(s.endpoints[g].initiate(v,(x={subscribe:!1,forceRefetch:!0},x[Pg]=function(){return{data:S}},x)))}},c=function(g,v){return n1(t,[g,v],function(S,w){var x,C,A,T,k,L,N,E,P,D,B,R,O,I,F,U,V,H,Y=w.signal,Q=w.abort,j=w.rejectWithValue,K=w.fulfillWithValue,ee=w.dispatch,ie=w.getState,ge=w.extra;return Jv(this,function(ae){switch(ae.label){case 0:x=i[S.endpointName],ae.label=1;case 1:return ae.trys.push([1,8,,13]),C=o6,A=void 0,T={signal:Y,abort:Q,dispatch:ee,getState:ie,extra:ge,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?d(S,ie()):void 0},k=S.type==="query"?S[Pg]:void 0,k?(A=k(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(S.originalArgs),T,x.extraOptions)]:[3,4];case 3:return A=ae.sent(),x.transformResponse&&(C=x.transformResponse),[3,6];case 4:return[4,x.queryFn(S.originalArgs,T,x.extraOptions,function(dt){return r(dt,T,x.extraOptions)})];case 5:A=ae.sent(),ae.label=6;case 6:if(typeof process<"u",A.error)throw new i6(A.error,A.meta);return B=K,[4,C(A.data,A.meta,S.originalArgs)];case 7:return[2,B.apply(void 0,[ae.sent(),(V={fulfilledTimeStamp:Date.now(),baseQueryMeta:A.meta},V[ic]=!0,V)])];case 8:if(R=ae.sent(),O=R,!(O instanceof i6))return[3,12];I=o6,x.query&&x.transformErrorResponse&&(I=x.transformErrorResponse),ae.label=9;case 9:return ae.trys.push([9,11,,12]),F=j,[4,I(O.value,O.meta,S.originalArgs)];case 10:return[2,F.apply(void 0,[ae.sent(),(H={baseQueryMeta:O.meta},H[ic]=!0,H)])];case 11:return U=ae.sent(),O=U,[3,12];case 12:throw typeof process<"u",console.error(O),O;case 13:return[2]}})})};function d(g,v){var S,w,x,C,A=(w=(S=v[n])==null?void 0:S.queries)==null?void 0:w[g.queryCacheKey],T=(x=v[n])==null?void 0:x.config.refetchOnMountOrArgChange,k=A==null?void 0:A.fulfilledTimeStamp,L=(C=g.forceRefetch)!=null?C:g.subscribe&&T;return L?L===!0||(Number(new Date)-Number(k))/1e3>=L:!1}var f=du(n+"/executeQuery",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[ic]=!0,g},condition:function(g,v){var S=v.getState,w,x,C,A=S(),T=(x=(w=A[n])==null?void 0:w.queries)==null?void 0:x[g.queryCacheKey],k=T==null?void 0:T.fulfilledTimeStamp,L=g.originalArgs,N=T==null?void 0:T.originalArgs,E=i[g.endpointName];return RC(g)?!0:(T==null?void 0:T.status)==="pending"?!1:d(g,A)||ZL(E)&&((C=E==null?void 0:E.forceRefetch)!=null&&C.call(E,{currentArg:L,previousArg:N,endpointState:T,state:A}))?!0:!k},dispatchConditionRejection:!0}),h=du(n+"/executeMutation",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[ic]=!0,g}}),p=function(g){return"force"in g},m=function(g){return"ifOlderThan"in g},b=function(g,v,S){return function(w,x){var C=p(S)&&S.force,A=m(S)&&S.ifOlderThan,T=function(E){return E===void 0&&(E=!0),s.endpoints[g].initiate(v,{forceRefetch:E})},k=s.endpoints[g].select(v)(x());if(C)w(T());else if(A){var L=k==null?void 0:k.fulfilledTimeStamp;if(!L){w(T());return}var N=(Number(new Date)-Number(new Date(L)))/1e3>=A;N&&w(T())}else w(T(!1))}};function _(g){return function(v){var S,w;return((w=(S=v==null?void 0:v.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===g}}function y(g,v){return{matchPending:of(__(g),_(v)),matchFulfilled:of(Au(g),_(v)),matchRejected:of(Rf(g),_(v))}}return{queryThunk:f,mutationThunk:h,prefetch:b,updateQueryData:l,upsertQueryData:u,patchQueryData:a,buildMatchThunkActions:y}}function e$(e,t,n,r){return JL(n[e.meta.arg.endpointName][t],Au(e)?e.payload:void 0,pm(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Oy(e,t,n){var r=e[t];r&&n(r)}function Rg(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function s6(e,t,n){var r=e[Rg(t)];r&&n(r)}var Nh={};function Cue(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,s=i.apiUid,a=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,c=e.config,d=Me(t+"/resetApiState"),f=tr({name:t+"/queries",initialState:Nh,reducers:{removeQueryResult:{reducer:function(S,w){var x=w.payload.queryCacheKey;delete S[x]},prepare:A0()},queryResultPatched:function(S,w){var x=w.payload,C=x.queryCacheKey,A=x.patches;Oy(S,C,function(T){T.data=Yx(T.data,A.concat())})}},extraReducers:function(S){S.addCase(n.pending,function(w,x){var C=x.meta,A=x.meta.arg,T,k,L=RC(A);(A.subscribe||L)&&((k=w[T=A.queryCacheKey])!=null||(w[T]={status:qn.uninitialized,endpointName:A.endpointName})),Oy(w,A.queryCacheKey,function(N){N.status=qn.pending,N.requestId=L&&N.requestId?N.requestId:C.requestId,A.originalArgs!==void 0&&(N.originalArgs=A.originalArgs),N.startedTimeStamp=C.startedTimeStamp})}).addCase(n.fulfilled,function(w,x){var C=x.meta,A=x.payload;Oy(w,C.arg.queryCacheKey,function(T){var k;if(!(T.requestId!==C.requestId&&!RC(C.arg))){var L=o[C.arg.endpointName].merge;if(T.status=qn.fulfilled,L)if(T.data!==void 0){var N=C.fulfilledTimeStamp,E=C.arg,P=C.baseQueryMeta,D=C.requestId,B=Tu(T.data,function(R){return L(R,A,{arg:E.originalArgs,baseQueryMeta:P,fulfilledTimeStamp:N,requestId:D})});T.data=B}else T.data=A;else T.data=(k=o[C.arg.endpointName].structuralSharing)==null||k?XL(Ki(T.data)?G5(T.data):T.data,A):A;delete T.error,T.fulfilledTimeStamp=C.fulfilledTimeStamp}})}).addCase(n.rejected,function(w,x){var C=x.meta,A=C.condition,T=C.arg,k=C.requestId,L=x.error,N=x.payload;Oy(w,T.queryCacheKey,function(E){if(!A){if(E.requestId!==k)return;E.status=qn.rejected,E.error=N??L}})}).addMatcher(l,function(w,x){for(var C=a(x).queries,A=0,T=Object.entries(C);A<T.length;A++){var k=T[A],L=k[0],N=k[1];((N==null?void 0:N.status)===qn.fulfilled||(N==null?void 0:N.status)===qn.rejected)&&(w[L]=N)}})}}),h=tr({name:t+"/mutations",initialState:Nh,reducers:{removeMutationResult:{reducer:function(S,w){var x=w.payload,C=Rg(x);C in S&&delete S[C]},prepare:A0()}},extraReducers:function(S){S.addCase(r.pending,function(w,x){var C=x.meta,A=x.meta,T=A.requestId,k=A.arg,L=A.startedTimeStamp;k.track&&(w[Rg(C)]={requestId:T,status:qn.pending,endpointName:k.endpointName,startedTimeStamp:L})}).addCase(r.fulfilled,function(w,x){var C=x.payload,A=x.meta;A.arg.track&&s6(w,A,function(T){T.requestId===A.requestId&&(T.status=qn.fulfilled,T.data=C,T.fulfilledTimeStamp=A.fulfilledTimeStamp)})}).addCase(r.rejected,function(w,x){var C=x.payload,A=x.error,T=x.meta;T.arg.track&&s6(w,T,function(k){k.requestId===T.requestId&&(k.status=qn.rejected,k.error=C??A)})}).addMatcher(l,function(w,x){for(var C=a(x).mutations,A=0,T=Object.entries(C);A<T.length;A++){var k=T[A],L=k[0],N=k[1];((N==null?void 0:N.status)===qn.fulfilled||(N==null?void 0:N.status)===qn.rejected)&&L!==(N==null?void 0:N.requestId)&&(w[L]=N)}})}}),p=tr({name:t+"/invalidation",initialState:Nh,reducers:{},extraReducers:function(S){S.addCase(f.actions.removeQueryResult,function(w,x){for(var C=x.payload.queryCacheKey,A=0,T=Object.values(w);A<T.length;A++)for(var k=T[A],L=0,N=Object.values(k);L<N.length;L++){var E=N[L],P=E.indexOf(C);P!==-1&&E.splice(P,1)}}).addMatcher(l,function(w,x){for(var C,A,T,k,L=a(x).provided,N=0,E=Object.entries(L);N<E.length;N++)for(var P=E[N],D=P[0],B=P[1],R=0,O=Object.entries(B);R<O.length;R++)for(var I=O[R],F=I[0],U=I[1],V=(k=(A=(C=w[D])!=null?C:w[D]={})[T=F||"__internal_without_id"])!=null?k:A[T]=[],H=0,Y=U;H<Y.length;H++){var Q=Y[H],j=V.includes(Q);j||V.push(Q)}}).addMatcher(is(Au(n),pm(n)),function(w,x){for(var C,A,T,k,L=e$(x,"providesTags",o,u),N=x.meta.arg.queryCacheKey,E=0,P=Object.values(w);E<P.length;E++)for(var D=P[E],B=0,R=Object.values(D);B<R.length;B++){var O=R[B],I=O.indexOf(N);I!==-1&&O.splice(I,1)}for(var F=0,U=L;F<U.length;F++){var V=U[F],H=V.type,Y=V.id,Q=(k=(A=(C=w[H])!=null?C:w[H]={})[T=Y||"__internal_without_id"])!=null?k:A[T]=[],j=Q.includes(N);j||Q.push(N)}})}}),m=tr({name:t+"/subscriptions",initialState:Nh,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),b=tr({name:t+"/internalSubscriptions",initialState:Nh,reducers:{subscriptionsUpdated:{reducer:function(S,w){return Yx(S,w.payload)},prepare:A0()}}}),_=tr({name:t+"/config",initialState:mr({online:gue(),focused:mue(),middlewareRegistered:!1},c),reducers:{middlewareRegistered:function(S,w){var x=w.payload;S.middlewareRegistered=S.middlewareRegistered==="conflict"||s!==x?"conflict":!0}},extraReducers:function(S){S.addCase(ME,function(w){w.online=!0}).addCase(YL,function(w){w.online=!1}).addCase(IE,function(w){w.focused=!0}).addCase(QL,function(w){w.focused=!1}).addMatcher(l,function(w){return mr({},w)})}}),y=th({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:b.reducer,config:_.reducer}),g=function(S,w){return y(d.match(w)?void 0:S,w)},v=na(mr(mr(mr(mr(mr({},_.actions),f.actions),m.actions),b.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:g,actions:v}}var lc=Symbol.for("RTKQ/skipToken"),t$={status:qn.uninitialized},a6=Tu(t$,function(){}),l6=Tu(t$,function(){});function Eue(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return a6},i=function(c){return l6};return{buildQuerySelector:a,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return mr(mr({},c),cue(c.status))}function s(c){var d=c[n];return d}function a(c,d){return function(f){var h=t({queryArgs:f,endpointDefinition:d,endpointName:c}),p=function(b){var _,y,g;return(g=(y=(_=s(b))==null?void 0:_.queries)==null?void 0:y[h])!=null?g:a6},m=f===lc?r:p;return $i(m,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=Rg(c))!=null?d:lc:f=c;var h=function(m){var b,_,y;return(y=(_=(b=s(m))==null?void 0:b.mutations)==null?void 0:_[f])!=null?y:l6},p=f===lc?i:h;return $i(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,m=0,b=d.map(PC);m<b.length;m++){var _=b[m],y=h.provided[_.type];if(y)for(var g=(f=_.id!==void 0?y[_.id]:e6(Object.values(y)))!=null?f:[],v=0,S=g;v<S.length;v++){var w=S[v];p.add(w)}}return e6(Array.from(p.values()).map(function(x){var C=h.queries[x];return C?[{queryCacheKey:x,endpointName:C.endpointName,originalArgs:C.originalArgs}]:[]}))}}var Iy=WeakMap?new WeakMap:void 0,u6=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Iy==null?void 0:Iy.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return Ns(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});Ns(n)&&(Iy==null||Iy.set(n,o)),r=o}return t+"("+r+")"};function Tue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=Av(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=na(mr({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=u6;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:u6(na(mr({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:e1([],r.tagTypes||[])}),s={endpointDefinitions:{},batch:function(c){c()},apiUid:y_(),extractRehydrationInfo:i,hasRehydrationInfo:Av(function(c){return i(c)!=null})},a={injectEndpoints:u,enhanceEndpoints:function(c){var d=c.addTagTypes,f=c.endpoints;if(d)for(var h=0,p=d;h<p.length;h++){var m=p[h];o.tagTypes.includes(m)||o.tagTypes.push(m)}if(f)for(var b=0,_=Object.entries(f);b<_.length;b++){var y=_[b],g=y[0],v=y[1];typeof v=="function"?v(s.endpointDefinitions[g]):Object.assign(s.endpointDefinitions[g]||{},v)}return a}},l=e.map(function(c){return c.init(a,o,s)});function u(c){for(var d=c.endpoints({query:function(v){return na(mr({},v),{type:ya.query})},mutation:function(v){return na(mr({},v),{type:ya.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var p=h[f],m=p[0],b=p[1];if(!c.overrideExisting&&m in s.endpointDefinitions){typeof process<"u";continue}s.endpointDefinitions[m]=b;for(var _=0,y=l;_<y.length;_++){var g=y[_];g.injectEndpoint(m,b)}}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function Aue(e){for(var t in e)return!1;return!0}var kue=2147483647/1e3-1,Pue=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,s=o.removeQueryResult,a=o.unsubscribeQueryResult;function l(f){var h=i.currentSubscriptions[f];return!!h&&!Aue(h)}var u={},c=function(f,h,p){var m;if(a.match(f)){var b=h.getState()[t],_=f.payload.queryCacheKey;d(_,(m=b.queries[_])==null?void 0:m.endpointName,h,b.config)}if(n.util.resetApiState.match(f))for(var y=0,g=Object.entries(u);y<g.length;y++){var v=g[y],S=v[0],w=v[1];w&&clearTimeout(w),delete u[S]}if(r.hasRehydrationInfo(f))for(var b=h.getState()[t],x=r.extractRehydrationInfo(f).queries,C=0,A=Object.entries(x);C<A.length;C++){var T=A[C],_=T[0],k=T[1];d(_,k==null?void 0:k.endpointName,h,b.config)}};function d(f,h,p,m){var b,_=r.endpointDefinitions[h],y=(b=_==null?void 0:_.keepUnusedDataFor)!=null?b:m.keepUnusedDataFor;if(y!==1/0){var g=Math.max(0,Math.min(y,kue));if(!l(f)){var v=u[f];v&&clearTimeout(v),u[f]=setTimeout(function(){l(f)||p.dispatch(s({queryCacheKey:f})),delete u[f]},g*1e3)}}}return c},Rue=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,s=e.assertTagType,a=e.refetchQuery,l=o.internalActions.removeQueryResult,u=is(Au(i),pm(i)),c=function(f,h){u(f)&&d(e$(f,"invalidatesTags",r,s),h),o.util.invalidateTags.match(f)&&d(JL(f.payload,void 0,void 0,void 0,void 0,s),h)};function d(f,h){var p=h.getState(),m=p[t],b=o.util.selectInvalidatedBy(p,f);n.batch(function(){for(var _,y=Array.from(b.values()),g=0,v=y;g<v.length;g++){var S=v[g].queryCacheKey,w=m.queries[S],x=(_=m.subscriptions[S])!=null?_:{};w&&(Object.keys(x).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==qn.uninitialized&&h.dispatch(a(w,S)))}})}return c},Oue=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,s={},a=function(h,p){(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&u(h.payload,p),(n.pending.match(h)||n.rejected.match(h)&&h.meta.condition)&&u(h.meta.arg,p),(n.fulfilled.match(h)||n.rejected.match(h)&&!h.meta.condition)&&l(h.meta.arg,p),r.util.resetApiState.match(h)&&d()};function l(h,p){var m=h.queryCacheKey,b=p.getState()[t],_=b.queries[m],y=o.currentSubscriptions[m];if(!(!_||_.status===qn.uninitialized)){var g=f(y);if(Number.isFinite(g)){var v=s[m];v!=null&&v.timeout&&(clearTimeout(v.timeout),v.timeout=void 0);var S=Date.now()+g,w=s[m]={nextPollTimestamp:S,pollingInterval:g,timeout:setTimeout(function(){w.timeout=void 0,p.dispatch(i(_,m))},g)}}}}function u(h,p){var m=h.queryCacheKey,b=p.getState()[t],_=b.queries[m],y=o.currentSubscriptions[m];if(!(!_||_.status===qn.uninitialized)){var g=f(y);if(!Number.isFinite(g)){c(m);return}var v=s[m],S=Date.now()+g;(!v||S<v.nextPollTimestamp)&&l({queryCacheKey:m},p)}}function c(h){var p=s[h];p!=null&&p.timeout&&clearTimeout(p.timeout),delete s[h]}function d(){for(var h=0,p=Object.keys(s);h<p.length;h++){var m=p[h];c(m)}}function f(h){h===void 0&&(h={});var p=Number.POSITIVE_INFINITY;for(var m in h)h[m].pollingInterval&&(p=Math.min(h[m].pollingInterval,p));return p}return a},Iue=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,s=r.internalActions.removeQueryResult,a=function(u,c){IE.match(u)&&l(c,"refetchOnFocus"),ME.match(u)&&l(c,"refetchOnReconnect")};function l(u,c){var d=u.getState()[t],f=d.queries,h=o.currentSubscriptions;n.batch(function(){for(var p=0,m=Object.keys(h);p<m.length;p++){var b=m[p],_=f[b],y=h[b];if(!(!y||!_)){var g=Object.values(y).some(function(v){return v[c]===!0})||Object.values(y).every(function(v){return v[c]===void 0})&&d.config[c];g&&(Object.keys(y).length===0?u.dispatch(s({queryCacheKey:b})):_.status!==qn.uninitialized&&u.dispatch(i(_,b)))}}})}return a},c6=new Error("Promise never resolved before cacheEntryRemoved."),Mue=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var s=kv(i),a=kv(o),l=Au(i,o),u={},c=function(h,p,m){var b=d(h);if(i.pending.match(h)){var _=m[n].queries[b],y=p.getState()[n].queries[b];!_&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,b,p,h.meta.requestId)}else if(o.pending.match(h)){var y=p.getState()[n].mutations[b];y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,b,p,h.meta.requestId)}else if(l(h)){var g=u[b];g!=null&&g.valueResolved&&(g.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete g.valueResolved)}else if(t.internalActions.removeQueryResult.match(h)||t.internalActions.removeMutationResult.match(h)){var g=u[b];g&&(delete u[b],g.cacheEntryRemoved())}else if(t.util.resetApiState.match(h))for(var v=0,S=Object.entries(u);v<S.length;v++){var w=S[v],x=w[0],g=w[1];delete u[x],g.cacheEntryRemoved()}};function d(h){return s(h)?h.meta.arg.queryCacheKey:a(h)?h.meta.requestId:t.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:t.internalActions.removeMutationResult.match(h)?Rg(h.payload):""}function f(h,p,m,b,_){var y=r.endpointDefinitions[h],g=y==null?void 0:y.onCacheEntryAdded;if(g){var v={},S=new Promise(function(k){v.cacheEntryRemoved=k}),w=Promise.race([new Promise(function(k){v.valueResolved=k}),S.then(function(){throw c6})]);w.catch(function(){}),u[m]=v;var x=t.endpoints[h].select(y.type===ya.query?p:m),C=b.dispatch(function(k,L,N){return N}),A=na(mr({},b),{getCacheEntry:function(){return x(b.getState())},requestId:_,extra:C,updateCachedData:y.type===ya.query?function(k){return b.dispatch(t.util.updateQueryData(h,p,k))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),T=g(p,A);Promise.resolve(T).catch(function(k){if(k!==c6)throw k})}}return c},Nue=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=__(r,i),s=Rf(r,i),a=Au(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var m=c.meta,b=m.requestId,_=m.arg,y=_.endpointName,g=_.originalArgs,v=n.endpointDefinitions[y],S=v==null?void 0:v.onQueryStarted;if(S){var w={},x=new Promise(function(P,D){w.resolve=P,w.reject=D});x.catch(function(){}),l[b]=w;var C=t.endpoints[y].select(v.type===ya.query?g:b),A=d.dispatch(function(P,D,B){return B}),T=na(mr({},d),{getCacheEntry:function(){return C(d.getState())},requestId:b,extra:A,updateCachedData:v.type===ya.query?function(P){return d.dispatch(t.util.updateQueryData(y,g,P))}:void 0,queryFulfilled:x});S(g,T)}}else if(a(c)){var k=c.meta,b=k.requestId,L=k.baseQueryMeta;(f=l[b])==null||f.resolve({data:c.payload,meta:L}),delete l[b]}else if(s(c)){var N=c.meta,b=N.requestId,E=N.rejectedWithValue,L=N.baseQueryMeta;(p=l[b])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!E,meta:L}),delete l[b]}};return u},Due=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var s,a;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},d6,Lue=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(d6||(d6=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},$ue=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,s=!1,a=t.internalActions,l=a.updateSubscriptionOptions,u=a.unsubscribeQueryResult,c=function(d,f){var h,p,m,b,_,y,g,v,S;if(l.match(f)){var w=f.payload,x=w.queryCacheKey,C=w.requestId,A=w.options;return(h=d==null?void 0:d[x])!=null&&h[C]&&(d[x][C]=A),!0}if(u.match(f)){var T=f.payload,x=T.queryCacheKey,C=T.requestId;return d[x]&&delete d[x][C],!0}if(t.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(n.pending.match(f)){var k=f.meta,L=k.arg,C=k.requestId;if(L.subscribe){var N=(m=d[p=L.queryCacheKey])!=null?m:d[p]={};return N[C]=(_=(b=L.subscriptionOptions)!=null?b:N[C])!=null?_:{},!0}}if(n.rejected.match(f)){var E=f.meta,P=E.condition,L=E.arg,C=E.requestId;if(P&&L.subscribe){var N=(g=d[y=L.queryCacheKey])!=null?g:d[y]={};return N[C]=(S=(v=L.subscriptionOptions)!=null?v:N[C])!=null?S:{},!0}}return!1};return function(d,f){var h,p;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(d))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(d)){var m=d.payload,b=m.queryCacheKey,_=m.requestId,y=!!((h=r.currentSubscriptions[b])!=null&&h[_]);return[!1,y]}var g=c(r.currentSubscriptions,d);if(g){s||(Lue(function(){var x=JSON.parse(JSON.stringify(r.currentSubscriptions)),C=Y5(o,function(){return x}),A=C[1];f.next(t.internalActions.subscriptionsUpdated(A)),o=x,s=!1}),s=!0);var v=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!v&&!S;return[w,!1]}return[!0,!1]}};function Fue(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,s={invalidateTags:Me(t+"/invalidateTags")},a=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(t+"/")},l=[Due,Pue,Rue,Oue,Mue,Nue],u=function(d){var f=!1,h={currentSubscriptions:{}},p=na(mr({},e),{internalState:h,refetchQuery:c}),m=l.map(function(y){return y(p)}),b=$ue(p),_=Iue(p);return function(y){return function(g){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var v=na(mr({},d),{next:y}),S=d.getState(),w=b(g,v,S),x=w[0],C=w[1],A;if(x?A=y(g):A=C,d.getState()[t]&&(_(g,v,S),a(g)||i.hasRehydrationInfo(g)))for(var T=0,k=m;T<k.length;T++){var L=k[T];L(g,v,S)}return A}}};return{middleware:u,actions:s};function c(d,f,h){return h===void 0&&(h={}),n(mr({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function wl(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,e1([e],t))}var f6=Symbol(),Bue=function(){return{name:f6,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,s=t.serializeQueryArgs,a=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,c=t.refetchOnReconnect;X5();var d=function(V){return typeof process<"u",V};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:ME,onOffline:YL,onFocus:IE,onFocusLost:QL},util:{}});var f=xue({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:s}),h=f.queryThunk,p=f.mutationThunk,m=f.patchQueryData,b=f.updateQueryData,_=f.upsertQueryData,y=f.prefetch,g=f.buildMatchThunkActions,v=Cue({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:a,reducerPath:o}}),S=v.reducer,w=v.actions;wl(e.util,{patchQueryData:m,updateQueryData:b,upsertQueryData:_,prefetch:y,resetApiState:w.resetApiState}),wl(e.internalActions,w);var x=Fue({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),C=x.middleware,A=x.actions;wl(e.util,A),wl(e,{reducer:S,middleware:C});var T=Eue({serializeQueryArgs:s,reducerPath:o}),k=T.buildQuerySelector,L=T.buildMutationSelector,N=T.selectInvalidatedBy;wl(e.util,{selectInvalidatedBy:N});var E=wue({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:s,context:n}),P=E.buildInitiateQuery,D=E.buildInitiateMutation,B=E.getRunningMutationThunk,R=E.getRunningMutationsThunk,O=E.getRunningQueriesThunk,I=E.getRunningQueryThunk,F=E.getRunningOperationPromises,U=E.removalWarning;return wl(e.util,{getRunningOperationPromises:F,getRunningOperationPromise:U,getRunningMutationThunk:B,getRunningMutationsThunk:R,getRunningQueryThunk:I,getRunningQueriesThunk:O}),{name:f6,injectEndpoint:function(V,H){var Y,Q,j=e;(Q=(Y=j.endpoints)[V])!=null||(Y[V]={}),ZL(H)?wl(j.endpoints[V],{name:V,select:k(V,H),initiate:P(V,H)},g(h,V)):bue(H)&&wl(j.endpoints[V],{name:V,select:L(),initiate:D(V)},g(p,V))}}}}},n$={exports:{}},r$={};/**
* @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 jf=M;function zue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uue=typeof Object.is=="function"?Object.is:zue,jue=jf.useState,Vue=jf.useEffect,Gue=jf.useLayoutEffect,Hue=jf.useDebugValue;function que(e,t){var n=t(),r=jue({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Gue(function(){i.value=n,i.getSnapshot=t,iw(i)&&o({inst:i})},[e,n,t]),Vue(function(){return iw(i)&&o({inst:i}),e(function(){iw(i)&&o({inst:i})})},[e]),Hue(n),n}function iw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Uue(e,n)}catch{return!0}}function Wue(e,t){return t()}var Kue=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Wue:que;r$.useSyncExternalStore=jf.useSyncExternalStore!==void 0?jf.useSyncExternalStore:Kue;n$.exports=r$;var Xue=n$.exports,i$={exports:{}},o$={};/**
* @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 ob=M,Que=Xue;function Yue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zue=typeof Object.is=="function"?Object.is:Yue,Jue=Que.useSyncExternalStore,ece=ob.useRef,tce=ob.useEffect,nce=ob.useMemo,rce=ob.useDebugValue;o$.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=ece(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=nce(function(){function l(h){if(!u){if(u=!0,c=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,Zue(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,d=m)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var a=Jue(e,o[0],o[1]);return tce(function(){s.hasValue=!0,s.value=a},[a]),rce(a),a};i$.exports=o$;var s$=i$.exports;const ice=Fc(s$);function oce(e){e()}let a$=oce;const sce=e=>a$=e,ace=()=>a$,h6=Symbol.for("react-redux-context"),p6=typeof globalThis<"u"?globalThis:{};function lce(){var e;if(!M.createContext)return{};const t=(e=p6[h6])!=null?e:p6[h6]=new Map;let n=t.get(M.createContext);return n||(n=M.createContext(null),t.set(M.createContext,n)),n}const mu=lce();function NE(e=mu){return function(){return M.useContext(e)}}const l$=NE(),uce=()=>{throw new Error("uSES not initialized!")};let u$=uce;const cce=e=>{u$=e},dce=(e,t)=>e===t;function fce(e=mu){const t=e===mu?l$:NE(e);return function(r,i={}){const{equalityFn:o=dce,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:c,stabilityCheck:d,noopCheck:f}=t();M.useRef(!0);const h=M.useCallback({[r.name](m){return r(m)}}[r.name],[r,d,s]),p=u$(u.addNestedSub,l.getState,c||l.getState,h,o);return M.useDebugValue(p),p}}const c$=fce();function r1(){return r1=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},r1.apply(this,arguments)}var d$={exports:{}},ln={};/** @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 ri=typeof Symbol=="function"&&Symbol.for,DE=ri?Symbol.for("react.element"):60103,LE=ri?Symbol.for("react.portal"):60106,sb=ri?Symbol.for("react.fragment"):60107,ab=ri?Symbol.for("react.strict_mode"):60108,lb=ri?Symbol.for("react.profiler"):60114,ub=ri?Symbol.for("react.provider"):60109,cb=ri?Symbol.for("react.context"):60110,$E=ri?Symbol.for("react.async_mode"):60111,db=ri?Symbol.for("react.concurrent_mode"):60111,fb=ri?Symbol.for("react.forward_ref"):60112,hb=ri?Symbol.for("react.suspense"):60113,hce=ri?Symbol.for("react.suspense_list"):60120,pb=ri?Symbol.for("react.memo"):60115,gb=ri?Symbol.for("react.lazy"):60116,pce=ri?Symbol.for("react.block"):60121,gce=ri?Symbol.for("react.fundamental"):60117,mce=ri?Symbol.for("react.responder"):60118,yce=ri?Symbol.for("react.scope"):60119;function Fo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case DE:switch(e=e.type,e){case $E:case db:case sb:case lb:case ab:case hb:return e;default:switch(e=e&&e.$$typeof,e){case cb:case fb:case gb:case pb:case ub:return e;default:return t}}case LE:return t}}}function f$(e){return Fo(e)===db}ln.AsyncMode=$E;ln.ConcurrentMode=db;ln.ContextConsumer=cb;ln.ContextProvider=ub;ln.Element=DE;ln.ForwardRef=fb;ln.Fragment=sb;ln.Lazy=gb;ln.Memo=pb;ln.Portal=LE;ln.Profiler=lb;ln.StrictMode=ab;ln.Suspense=hb;ln.isAsyncMode=function(e){return f$(e)||Fo(e)===$E};ln.isConcurrentMode=f$;ln.isContextConsumer=function(e){return Fo(e)===cb};ln.isContextProvider=function(e){return Fo(e)===ub};ln.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===DE};ln.isForwardRef=function(e){return Fo(e)===fb};ln.isFragment=function(e){return Fo(e)===sb};ln.isLazy=function(e){return Fo(e)===gb};ln.isMemo=function(e){return Fo(e)===pb};ln.isPortal=function(e){return Fo(e)===LE};ln.isProfiler=function(e){return Fo(e)===lb};ln.isStrictMode=function(e){return Fo(e)===ab};ln.isSuspense=function(e){return Fo(e)===hb};ln.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===sb||e===db||e===lb||e===ab||e===hb||e===hce||typeof e=="object"&&e!==null&&(e.$$typeof===gb||e.$$typeof===pb||e.$$typeof===ub||e.$$typeof===cb||e.$$typeof===fb||e.$$typeof===gce||e.$$typeof===mce||e.$$typeof===yce||e.$$typeof===pce)};ln.typeOf=Fo;d$.exports=ln;var vce=d$.exports,h$=vce,_ce={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},bce={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},p$={};p$[h$.ForwardRef]=_ce;p$[h$.Memo]=bce;var vn={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var FE=Symbol.for("react.element"),BE=Symbol.for("react.portal"),mb=Symbol.for("react.fragment"),yb=Symbol.for("react.strict_mode"),vb=Symbol.for("react.profiler"),_b=Symbol.for("react.provider"),bb=Symbol.for("react.context"),Sce=Symbol.for("react.server_context"),Sb=Symbol.for("react.forward_ref"),wb=Symbol.for("react.suspense"),xb=Symbol.for("react.suspense_list"),Cb=Symbol.for("react.memo"),Eb=Symbol.for("react.lazy"),wce=Symbol.for("react.offscreen"),g$;g$=Symbol.for("react.module.reference");function os(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case FE:switch(e=e.type,e){case mb:case vb:case yb:case wb:case xb:return e;default:switch(e=e&&e.$$typeof,e){case Sce:case bb:case Sb:case Eb:case Cb:case _b:return e;default:return t}}case BE:return t}}}vn.ContextConsumer=bb;vn.ContextProvider=_b;vn.Element=FE;vn.ForwardRef=Sb;vn.Fragment=mb;vn.Lazy=Eb;vn.Memo=Cb;vn.Portal=BE;vn.Profiler=vb;vn.StrictMode=yb;vn.Suspense=wb;vn.SuspenseList=xb;vn.isAsyncMode=function(){return!1};vn.isConcurrentMode=function(){return!1};vn.isContextConsumer=function(e){return os(e)===bb};vn.isContextProvider=function(e){return os(e)===_b};vn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===FE};vn.isForwardRef=function(e){return os(e)===Sb};vn.isFragment=function(e){return os(e)===mb};vn.isLazy=function(e){return os(e)===Eb};vn.isMemo=function(e){return os(e)===Cb};vn.isPortal=function(e){return os(e)===BE};vn.isProfiler=function(e){return os(e)===vb};vn.isStrictMode=function(e){return os(e)===yb};vn.isSuspense=function(e){return os(e)===wb};vn.isSuspenseList=function(e){return os(e)===xb};vn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===mb||e===vb||e===yb||e===wb||e===xb||e===wce||typeof e=="object"&&e!==null&&(e.$$typeof===Eb||e.$$typeof===Cb||e.$$typeof===_b||e.$$typeof===bb||e.$$typeof===Sb||e.$$typeof===g$||e.getModuleId!==void 0)};vn.typeOf=os;function xce(){const e=ace();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const g6={notify(){},get:()=>[]};function Cce(e,t){let n,r=g6;function i(d){return l(),r.subscribe(d)}function o(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=xce())}function u(){n&&(n(),n=void 0,r.clear(),r=g6)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const Ece=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tce=Ece?M.useLayoutEffect:M.useEffect;function m6(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function i1(e,t){if(m6(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])||!m6(e[n[i]],t[n[i]]))return!1;return!0}function Ace({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const s=M.useMemo(()=>{const u=Cce(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),a=M.useMemo(()=>e.getState(),[e]);Tce(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,a]);const l=t||mu;return M.createElement(l.Provider,{value:s},n)}function m$(e=mu){const t=e===mu?l$:NE(e);return function(){const{store:r}=t();return r}}const y$=m$();function kce(e=mu){const t=e===mu?y$:m$(e);return function(){return t().dispatch}}const v$=kce();cce(s$.useSyncExternalStoreWithSelector);sce(ws.unstable_batchedUpdates);var Pce=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Rce=Object.defineProperty,Oce=Object.defineProperties,Ice=Object.getOwnPropertyDescriptors,y6=Object.getOwnPropertySymbols,Mce=Object.prototype.hasOwnProperty,Nce=Object.prototype.propertyIsEnumerable,v6=function(e,t,n){return t in e?Rce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ma=function(e,t){for(var n in t||(t={}))Mce.call(t,n)&&v6(e,n,t[n]);if(y6)for(var r=0,i=y6(t);r<i.length;r++){var n=i[r];Nce.call(t,n)&&v6(e,n,t[n])}return e},M0=function(e,t){return Oce(e,Ice(t))};function _6(e,t,n,r){var i=M.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=M.useRef(i);return M.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var ow=Symbol();function sw(e){var t=M.useRef(e);return M.useEffect(function(){i1(t.current,e)||(t.current=e)},[e]),i1(t.current,e)?t.current:e}var My=WeakMap?new WeakMap:void 0,Dce=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=My==null?void 0:My.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return Ns(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});Ns(n)&&(My==null||My.set(n,o)),r=o}return t+"("+r+")"},Lce=typeof window<"u"&&window.document&&window.document.createElement?M.useLayoutEffect:M.useEffect,$ce=function(e){return e},Fce=function(e){return e.isUninitialized?M0(Ma({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:qn.pending}):e};function Bce(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,s=n.useStore,a=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,c=a?function(m){return m()}:M.useEffect;return{buildQueryHooks:h,buildMutationHook:p,usePrefetch:f};function d(m,b,_){if(b!=null&&b.endpointName&&m.isUninitialized){var y=b.endpointName,g=u.endpointDefinitions[y];l({queryArgs:b.originalArgs,endpointDefinition:g,endpointName:y})===l({queryArgs:_,endpointDefinition:g,endpointName:y})&&(b=void 0)}var v=m.isSuccess?m.data:b==null?void 0:b.data;v===void 0&&(v=m.data);var S=v!==void 0,w=m.isLoading,x=!S&&w,C=m.isSuccess||w&&S;return M0(Ma({},m),{data:v,currentData:m.data,isFetching:w,isLoading:x,isSuccess:C})}function f(m,b){var _=i(),y=sw(b);return M.useCallback(function(g,v){return _(t.util.prefetch(m,g,Ma(Ma({},y),v)))},[m,_,y])}function h(m){var b=function(g,v){var S=v===void 0?{}:v,w=S.refetchOnReconnect,x=S.refetchOnFocus,C=S.refetchOnMountOrArgChange,A=S.skip,T=A===void 0?!1:A,k=S.pollingInterval,L=k===void 0?0:k,N=t.endpoints[m].initiate,E=i(),P=_6(T?lc:g,Dce,u.endpointDefinitions[m],m),D=sw({refetchOnReconnect:w,refetchOnFocus:x,pollingInterval:L}),B=M.useRef(!1),R=M.useRef(),O=R.current||{},I=O.queryCacheKey,F=O.requestId,U=!1;if(I&&F){var V=E(t.internalActions.internal_probeSubscription({queryCacheKey:I,requestId:F}));U=!!V}var H=!U&&B.current;return c(function(){B.current=U}),c(function(){H&&(R.current=void 0)},[H]),c(function(){var Y,Q=R.current;if(typeof process<"u",P===lc){Q==null||Q.unsubscribe(),R.current=void 0;return}var j=(Y=R.current)==null?void 0:Y.subscriptionOptions;if(!Q||Q.arg!==P){Q==null||Q.unsubscribe();var K=E(N(P,{subscriptionOptions:D,forceRefetch:C}));R.current=K}else D!==j&&Q.updateSubscriptionOptions(D)},[E,N,C,P,D,H]),M.useEffect(function(){return function(){var Y;(Y=R.current)==null||Y.unsubscribe(),R.current=void 0}},[]),M.useMemo(function(){return{refetch:function(){var Y;if(!R.current)throw new Error("Cannot refetch a query that has not been started yet.");return(Y=R.current)==null?void 0:Y.refetch()}}},[])},_=function(g){var v=g===void 0?{}:g,S=v.refetchOnReconnect,w=v.refetchOnFocus,x=v.pollingInterval,C=x===void 0?0:x,A=t.endpoints[m].initiate,T=i(),k=M.useState(ow),L=k[0],N=k[1],E=M.useRef(),P=sw({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:C});c(function(){var R,O,I=(R=E.current)==null?void 0:R.subscriptionOptions;P!==I&&((O=E.current)==null||O.updateSubscriptionOptions(P))},[P]);var D=M.useRef(P);c(function(){D.current=P},[P]);var B=M.useCallback(function(R,O){O===void 0&&(O=!1);var I;return r(function(){var F;(F=E.current)==null||F.unsubscribe(),E.current=I=T(A(R,{subscriptionOptions:D.current,forceRefetch:!O})),N(R)}),I},[T,A]);return M.useEffect(function(){return function(){var R;(R=E==null?void 0:E.current)==null||R.unsubscribe()}},[]),M.useEffect(function(){L!==ow&&!E.current&&B(L,!0)},[L,B]),M.useMemo(function(){return[B,L]},[B,L])},y=function(g,v){var S=v===void 0?{}:v,w=S.skip,x=w===void 0?!1:w,C=S.selectFromResult,A=t.endpoints[m].select,T=_6(x?lc:g,l,u.endpointDefinitions[m],m),k=M.useRef(),L=M.useMemo(function(){return $i([A(T),function(B,R){return R},function(B){return T}],d)},[A,T]),N=M.useMemo(function(){return C?$i([L],C):L},[L,C]),E=o(function(B){return N(B,k.current)},i1),P=s(),D=L(P.getState(),k.current);return Lce(function(){k.current=D},[D]),E};return{useQueryState:y,useQuerySubscription:b,useLazyQuerySubscription:_,useLazyQuery:function(g){var v=_(g),S=v[0],w=v[1],x=y(w,M0(Ma({},g),{skip:w===ow})),C=M.useMemo(function(){return{lastArg:w}},[w]);return M.useMemo(function(){return[S,x,C]},[S,x,C])},useQuery:function(g,v){var S=b(g,v),w=y(g,Ma({selectFromResult:g===lc||v!=null&&v.skip?void 0:Fce},v)),x=w.data,C=w.status,A=w.isLoading,T=w.isSuccess,k=w.isError,L=w.error;return M.useDebugValue({data:x,status:C,isLoading:A,isSuccess:T,isError:k,error:L}),M.useMemo(function(){return Ma(Ma({},w),S)},[w,S])}}}function p(m){return function(b){var _=b===void 0?{}:b,y=_.selectFromResult,g=y===void 0?$ce:y,v=_.fixedCacheKey,S=t.endpoints[m],w=S.select,x=S.initiate,C=i(),A=M.useState(),T=A[0],k=A[1];M.useEffect(function(){return function(){T!=null&&T.arg.fixedCacheKey||T==null||T.reset()}},[T]);var L=M.useCallback(function(Q){var j=C(x(Q,{fixedCacheKey:v}));return k(j),j},[C,x,v]),N=(T||{}).requestId,E=M.useMemo(function(){return $i([w({fixedCacheKey:v,requestId:T==null?void 0:T.requestId})],g)},[w,T,g,v]),P=o(E,i1),D=v==null?T==null?void 0:T.arg.originalArgs:void 0,B=M.useCallback(function(){r(function(){T&&k(void 0),v&&C(t.internalActions.removeMutationResult({requestId:N,fixedCacheKey:v}))})},[C,v,T,N]),R=P.endpointName,O=P.data,I=P.status,F=P.isLoading,U=P.isSuccess,V=P.isError,H=P.error;M.useDebugValue({endpointName:R,data:O,status:I,isLoading:F,isSuccess:U,isError:V,error:H});var Y=M.useMemo(function(){return M0(Ma({},P),{originalArgs:D,reset:B})},[P,D,B]);return M.useMemo(function(){return[L,Y]},[L,Y])}}}var o1;(function(e){e.query="query",e.mutation="mutation"})(o1||(o1={}));function zce(e){return e.type===o1.query}function Uce(e){return e.type===o1.mutation}function aw(e){return e.replace(e[0],e[0].toUpperCase())}function Ny(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,Pce([e],t))}var jce=Symbol(),Vce=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?ws.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?v$:i,s=t.useSelector,a=s===void 0?c$:s,l=t.useStore,u=l===void 0?y$:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:jce,init:function(f,h,p){var m=h.serializeQueryArgs,b=f,_=Bce({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:a,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:p}),y=_.buildQueryHooks,g=_.buildMutationHook,v=_.usePrefetch;return Ny(b,{usePrefetch:v}),Ny(p,{batch:r}),{injectEndpoint:function(S,w){if(zce(w)){var x=y(S),C=x.useQuery,A=x.useLazyQuery,T=x.useLazyQuerySubscription,k=x.useQueryState,L=x.useQuerySubscription;Ny(b.endpoints[S],{useQuery:C,useLazyQuery:A,useLazyQuerySubscription:T,useQueryState:k,useQuerySubscription:L}),f["use"+aw(S)+"Query"]=C,f["useLazy"+aw(S)+"Query"]=A}else if(Uce(w)){var N=g(S);Ny(b.endpoints[S],{useMutation:N}),f["use"+aw(S)+"Mutation"]=N}}}}}},Gce=Tue(Bue(),Vce());const Hce=["Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","Model"],ft="LIST",qce=async(e,t,n)=>{const r=vg.get(),i=Df.get(),o=_g.get();return _ue({baseUrl:`${r??""}/api/v1`,prepareHeaders:a=>(i&&a.set("Authorization",`Bearer ${i}`),o&&a.set("project-id",o),a)})(e,t,n)},yu=Gce({baseQuery:qce,reducerPath:"api",tagTypes:Hce,endpoints:()=>({})}),Wce=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},_$="%[a-f0-9]{2}",b6=new RegExp("("+_$+")|([^%]+?)","gi"),S6=new RegExp("("+_$+")+","gi");function OC(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([],OC(n),OC(r))}function Kce(e){try{return decodeURIComponent(e)}catch{let t=e.match(b6)||[];for(let n=1;n<t.length;n++)e=OC(t,n).join(""),t=e.match(b6)||[];return e}}function Xce(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=S6.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=Kce(n[0]);i!==n[0]&&(t[n[0]]=i)}n=S6.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 Qce(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Xce(e)}}function b$(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 Yce(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 Zce=e=>e==null,Jce=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),IC=Symbol("encodeFragmentIdentifier");function ede(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,[Er(t,e),"[",i,"]"].join("")]:[...n,[Er(t,e),"[",Er(i,e),"]=",Er(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Er(t,e),"[]"].join("")]:[...n,[Er(t,e),"[]=",Er(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,[Er(t,e),":list="].join("")]:[...n,[Er(t,e),":list=",Er(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?[[Er(n,e),t,Er(i,e)].join("")]:[[r,Er(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Er(t,e)]:[...n,[Er(t,e),"=",Er(r,e)].join("")]}}function tde(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&&Ua(r,e).includes(e.arrayFormatSeparator);r=s?Ua(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>Ua(l,e)):r===null?r:Ua(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Ua(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>Ua(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 S$(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Er(e,t){return t.encode?t.strict?Jce(e):encodeURIComponent(e):e}function Ua(e,t){return t.decode?Qce(e):e}function w$(e){return Array.isArray(e)?e.sort():typeof e=="object"?w$(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function x$(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function nde(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function w6(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 zE(e){e=x$(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function UE(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},S$(t.arrayFormatSeparator);const n=tde(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]=b$(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:Ua(a,t),n(Ua(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]=w6(a,t);else r[i]=w6(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]=w$(s):i[o]=s,i},Object.create(null))}function C$(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},S$(t.arrayFormatSeparator);const n=s=>t.skipNull&&Zce(e[s])||t.skipEmptyString&&e[s]==="",r=ede(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?Er(s,t):Array.isArray(a)?a.length===0&&t.arrayFormat==="bracket-separator"?Er(s,t)+"[]":a.reduce(r(s),[]).join("&"):Er(s,t)+"="+Er(a,t)}).filter(s=>s.length>0).join("&")}function E$(e,t){var i;t={decode:!0,...t};let[n,r]=b$(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:UE(zE(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Ua(r,t)}:{}}}function T$(e,t){t={encode:!0,strict:!0,[IC]:!0,...t};const n=x$(e.url).split("?")[0]||"",r=zE(e.url),i={...UE(r,{sort:!1}),...e.query};let o=C$(i,t);o&&(o=`?${o}`);let s=nde(e.url);if(e.fragmentIdentifier){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[IC]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function A$(e,t,n){n={parseFragmentIdentifier:!0,[IC]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=E$(e,n);return T$({url:r,query:Yce(i,t),fragmentIdentifier:o},n)}function rde(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return A$(e,r,n)}const N0=Object.freeze(Object.defineProperty({__proto__:null,exclude:rde,extract:zE,parse:UE,parseUrl:E$,pick:A$,stringify:C$,stringifyUrl:T$},Symbol.toStringTag,{value:"Module"})),zu=(e,t)=>{if(!e)return!1;const n=s1.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}},zo=e=>Xr.includes(e.image_category)?Xr:jl,Nn=cl({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:Wce(t.created_at,e.created_at)}),s1=Nn.getSelectors(),Co=e=>`images/?${N0.stringify(e,{arrayFormat:"none"})}`,hi=yu.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:ft}];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:ft}];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:Co({board_id:t??"none",categories:Xr,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>t.total}),getBoardAssetsTotal:e.query({query:t=>({url:Co({board_id:t??"none",categories:jl,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>t.total}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:ft}]}),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:jRe,useListAllBoardsQuery:VRe,useGetBoardImagesTotalQuery:GRe,useGetBoardAssetsTotalQuery:HRe,useCreateBoardMutation:qRe,useUpdateBoardMutation:WRe,useListAllImageNamesForBoardQuery:KRe}=hi,he=yu.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:Co(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:Co({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return Co({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Nn.addMany(Nn.getInitialState(),n)},merge:(t,n)=>{Nn.addMany(t,s1.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;s1.selectAll(i).forEach(o=>{n(he.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:Co({is_intermediate:!0})}),providesTags:["IntermediatesCount"],transformResponse:t=>t.total}),getImageDTO:e.query({query:t=>({url:`images/i/${t}`}),providesTags:(t,n,r)=>[{type:"Image",id:r}],keepUnusedDataFor:86400}),getImageMetadata:e.query({query:t=>({url:`images/i/${t}/metadata`}),providesTags:(t,n,r)=>[{type:"ImageMetadata",id:r}],keepUnusedDataFor:86400}),getImageMetadataFromFile:e.query({queryFn:async(t,n,r,i)=>{var o;if(t.shouldFetchMetadataFromApi){let s;const a=await i(`images/i/${t.image.image_name}/metadata`);if(a.data){const l=PD.safeParse((o=a.data)==null?void 0:o.metadata);l.success&&(s=l.data)}return{data:{metadata:s}}}else{const s=Df.get(),a=_g.get(),u=await tre.fetchBaseQuery({baseUrl:"",prepareHeaders:d=>(s&&d.set("Authorization",`Bearer ${s}`),a&&d.set("project-id",a),d),responseHandler:async d=>await d.blob()})(t.image.image_url,n,r);return{data:await sue(u.data)}}},providesTags:(t,n,{image:r})=>[{type:"ImageMetadataFromFile",id:r.image_name}],keepUnusedDataFor:86400}),clearIntermediates:e.mutation({query:()=>({url:"images/clear-intermediates",method:"POST"}),invalidatesTags:["IntermediatesCount"]}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),invalidatesTags:(t,n,{board_id:r})=>[{type:"BoardImagesTotal",id:r??"none"},{type:"BoardAssetsTotal",id:r??"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,s={board_id:o??"none",categories:zo(t)},a=n(he.util.updateQueryData("listImages",s,l=>{Nn.removeOne(l,i)}));try{await r}catch{a.undo()}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{var o;const i=(o=r[0])==null?void 0:o.board_id;return[{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"}]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=mE(t,"image_name");i.deleted_images.forEach(s=>{const a=o[s];if(a){const l={board_id:a.board_id??"none",categories:zo(a)};n(he.util.updateQueryData("listImages",l,u=>{Nn.removeOne(u,s)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),invalidatesTags:(t,n,{imageDTO:r})=>[{type:"BoardImagesTotal",id:r.board_id??"none"},{type:"BoardAssetsTotal",id:r.board_id??"none"}],async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const s=[];s.push(r(he.util.updateQueryData("getImageDTO",t.image_name,l=>{Object.assign(l,{is_intermediate:n})})));const a=zo(t);if(n)s.push(r(he.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:a},l=>{Nn.removeOne(l,t.image_name)})));else{const l={board_id:t.board_id??"none",categories:a},u=he.endpoints.listImages.select(l)(o()),{data:c}=Xr.includes(t.image_category)?hi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):hi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),d=u.data&&u.data.ids.length>=(c??0),f=zu(u.data,t);(d||f)&&s.push(r(he.util.updateQueryData("listImages",l,h=>{Nn.upsertOne(h,t)})))}try{await i}catch{s.forEach(l=>l.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),invalidatesTags:(t,n,{imageDTO:r})=>[{type:"BoardImagesTotal",id:r.board_id??"none"},{type:"BoardAssetsTotal",id:r.board_id??"none"}],async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i}){const o=[];o.push(r(he.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=zo(r[0]),o=r[0].board_id;return[{type:"ImageList",id:Co({board_id:o,categories:i})}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,s=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!s[0])return;const a=zo(s[0]),l=s[0].board_id;s.forEach(u=>{const{image_name:c}=u;n(he.util.updateQueryData("getImageDTO",c,b=>{b.starred=!0}));const d={board_id:l??"none",categories:a},f=he.endpoints.listImages.select(d)(i()),{data:h}=Xr.includes(u.image_category)?hi.endpoints.getBoardImagesTotal.select(l??"none")(i()):hi.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=(h??0),m=(h||0)>=Cy?zu(f.data,u):!0;(p||m)&&n(he.util.updateQueryData("listImages",d,b=>{Nn.upsertOne(b,{...u,starred:!0})}))})}catch{}}}),unstarImages:e.mutation({query:({imageDTOs:t})=>({url:"images/unstar",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=zo(r[0]),o=r[0].board_id;return[{type:"ImageList",id:Co({board_id:o,categories:i})}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,s=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!s[0])return;const a=zo(s[0]),l=s[0].board_id;s.forEach(u=>{const{image_name:c}=u;n(he.util.updateQueryData("getImageDTO",c,b=>{b.starred=!1}));const d={board_id:l??"none",categories:a},f=he.endpoints.listImages.select(d)(i()),{data:h}=Xr.includes(u.image_category)?hi.endpoints.getBoardImagesTotal.select(l??"none")(i()):hi.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=(h??0),m=(h||0)>=Cy?zu(f.data,u):!0;(p||m)&&n(he.util.updateQueryData("listImages",d,b=>{Nn.upsertOne(b,{...u,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(he.util.upsertQueryData("getImageDTO",i.image_name,i));const o=zo(i);n(he.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},s=>{Nn.addOne(s,i)})),n(he.util.invalidateTags([{type:"BoardImagesTotal",id:i.board_id??"none"},{type:"BoardAssetsTotal",id:i.board_id??"none"}]))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:ft},{type:"ImageList",id:Co({board_id:"none",categories:Xr})},{type:"ImageList",id:Co({board_id:"none",categories:jl})},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_board_images:o}=i;o.forEach(l=>{n(he.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))});const s=[{categories:Xr},{categories:jl}],a=o.map(l=>({id:l,changes:{board_id:void 0}}));s.forEach(l=>{n(he.util.updateQueryData("listImages",l,u=>{Nn.updateMany(u,a)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:ft},{type:"ImageList",id:Co({board_id:"none",categories:Xr})},{type:"ImageList",id:Co({board_id:"none",categories:jl})},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_images:o}=i;[{categories:Xr},{categories:jl}].forEach(a=>{n(he.util.updateQueryData("listImages",a,l=>{Nn.removeMany(l,o)}))})}catch{}}}),addImageToBoard:e.mutation({query:({board_id:t,imageDTO:n})=>{const{image_name:r}=n;return{url:"board_images/",method:"POST",body:{board_id:t,image_name:r}}},invalidatesTags:(t,n,{board_id:r,imageDTO:i})=>[{type:"Board",id:r},{type:"BoardImagesTotal",id:r},{type:"BoardAssetsTotal",id:r},{type:"BoardImagesTotal",id:i.board_id??"none"},{type:"BoardAssetsTotal",id:i.board_id??"none"}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const s=[],a=zo(n);if(s.push(r(he.util.updateQueryData("getImageDTO",n.image_name,l=>{l.board_id=t}))),!n.is_intermediate){s.push(r(he.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:a},h=>{Nn.removeOne(h,n.image_name)})));const l={board_id:t??"none",categories:a},u=he.endpoints.listImages.select(l)(o()),{data:c}=Xr.includes(n.image_category)?hi.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):hi.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),d=u.data&&u.data.ids.length>=(c??0),f=zu(u.data,n);(d||f)&&s.push(r(he.util.updateQueryData("listImages",l,h=>{Nn.addOne(h,n)})))}try{await i}catch{s.forEach(l=>l.undo())}}}),removeImageFromBoard:e.mutation({query:({imageDTO:t})=>{const{image_name:n}=t;return{url:"board_images/",method:"DELETE",body:{image_name:n}}},invalidatesTags:(t,n,{imageDTO:r})=>{const{board_id:i}=r;return[{type:"Board",id:i??"none"},{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=zo(t),s=[];s.push(n(he.util.updateQueryData("getImageDTO",t.image_name,f=>{f.board_id=void 0}))),s.push(n(he.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},f=>{Nn.removeOne(f,t.image_name)})));const a={board_id:"none",categories:o},l=he.endpoints.listImages.select(a)(i()),{data:u}=Xr.includes(t.image_category)?hi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):hi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),c=l.data&&l.data.ids.length>=(u??0),d=zu(l.data,t);(c||d)&&s.push(n(he.util.updateQueryData("listImages",a,f=>{Nn.upsertOne(f,t)})));try{await r}catch{s.forEach(f=>f.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{imageDTOs:r,board_id:i})=>{var s;const o=(s=r[0])==null?void 0:s.board_id;return[{type:"Board",id:i??"none"},{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"},{type:"BoardImagesTotal",id:o??"none"},{type:"BoardAssetsTotal",id:o??"none"},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}]},async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:s}=await i,{added_image_names:a}=s;a.forEach(l=>{r(he.util.updateQueryData("getImageDTO",l,_=>{_.board_id=t}));const u=n.find(_=>_.image_name===l);if(!u)return;const c=zo(u),d=u.board_id;r(he.util.updateQueryData("listImages",{board_id:d??"none",categories:c},_=>{Nn.removeOne(_,u.image_name)}));const f={board_id:t,categories:c},h=he.endpoints.listImages.select(f)(o()),{data:p}=Xr.includes(u.image_category)?hi.endpoints.getBoardImagesTotal.select(t??"none")(o()):hi.endpoints.getBoardAssetsTotal.select(t??"none")(o()),m=h.data&&h.data.ids.length>=(p??0),b=(p||0)>=Cy?zu(h.data,u):!0;(m||b)&&r(he.util.updateQueryData("listImages",f,_=>{Nn.upsertOne(_,{...u,board_id:t})}))})}catch{}}}),removeImagesFromBoard:e.mutation({query:({imageDTOs:t})=>({url:"board_images/batch/delete",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{const i=[],o=[{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}];return t==null||t.removed_image_names.forEach(s=>{var l;const a=(l=r.find(u=>u.image_name===s))==null?void 0:l.board_id;!a||i.includes(a)||(o.push({type:"Board",id:a}),o.push({type:"BoardImagesTotal",id:a}),o.push({type:"BoardAssetsTotal",id:a}))}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:s}=o;s.forEach(a=>{n(he.util.updateQueryData("getImageDTO",a,m=>{m.board_id=void 0}));const l=t.find(m=>m.image_name===a);if(!l)return;const u=zo(l);n(he.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},m=>{Nn.removeOne(m,l.image_name)}));const c={board_id:"none",categories:u},d=he.endpoints.listImages.select(c)(i()),{data:f}=Xr.includes(l.image_category)?hi.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):hi.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),h=d.data&&d.data.ids.length>=(f??0),p=(f||0)>=Cy?zu(d.data,l):!0;(h||p)&&n(he.util.updateQueryData("listImages",c,m=>{Nn.upsertOne(m,{...l,board_id:"none"})}))})}catch{}}})})}),{useGetIntermediatesCountQuery:XRe,useListImagesQuery:QRe,useLazyListImagesQuery:YRe,useGetImageDTOQuery:ZRe,useGetImageMetadataQuery:JRe,useDeleteImageMutation:eOe,useDeleteImagesMutation:tOe,useUploadImageMutation:nOe,useClearIntermediatesMutation:rOe,useAddImagesToBoardMutation:iOe,useRemoveImagesFromBoardMutation:oOe,useAddImageToBoardMutation:sOe,useRemoveImageFromBoardMutation:aOe,useChangeImageIsIntermediateMutation:lOe,useChangeImageSessionIdMutation:uOe,useDeleteBoardAndImagesMutation:cOe,useDeleteBoardMutation:dOe,useStarImagesMutation:fOe,useUnstarImagesMutation:hOe,useGetImageMetadataFromFileQuery:pOe}=he,k$=Me("socket/socketConnected"),P$=Me("socket/appSocketConnected"),R$=Me("socket/socketDisconnected"),O$=Me("socket/appSocketDisconnected"),jE=Me("socket/socketSubscribed"),I$=Me("socket/appSocketSubscribed"),M$=Me("socket/socketUnsubscribed"),N$=Me("socket/appSocketUnsubscribed"),D$=Me("socket/socketInvocationStarted"),VE=Me("socket/appSocketInvocationStarted"),GE=Me("socket/socketInvocationComplete"),HE=Me("socket/appSocketInvocationComplete"),L$=Me("socket/socketInvocationError"),Tb=Me("socket/appSocketInvocationError"),$$=Me("socket/socketGraphExecutionStateComplete"),F$=Me("socket/appSocketGraphExecutionStateComplete"),B$=Me("socket/socketGeneratorProgress"),qE=Me("socket/appSocketGeneratorProgress"),z$=Me("socket/socketModelLoadStarted"),ide=Me("socket/appSocketModelLoadStarted"),U$=Me("socket/socketModelLoadCompleted"),ode=Me("socket/appSocketModelLoadCompleted"),j$=Me("socket/socketSessionRetrievalError"),V$=Me("socket/appSocketSessionRetrievalError"),G$=Me("socket/socketInvocationRetrievalError"),H$=Me("socket/appSocketInvocationRetrievalError"),WE=Me("controlNet/imageProcessed"),sde={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 a1{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||sde,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 a1(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new a1(this.logger,t)}}var ra=new a1;class Ab{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 x6(e){return e==null?"":""+e}function ade(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function KE(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 C6(e,t,n){const{obj:r,k:i}=KE(e,t,Object);r[i]=n}function lde(e,t,n,r){const{obj:i,k:o}=KE(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function l1(e,t){const{obj:n,k:r}=KE(e,t);if(n)return n[r]}function ude(e,t,n){const r=l1(e,n);return r!==void 0?r:l1(t,n)}function q$(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]):q$(e[r],t[r],n):e[r]=t[r]);return e}function pd(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cde={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function dde(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>cde[t]):e}const fde=[" ",",","?","!",";"];function hde(e,t,n){t=t||"",n=n||"";const r=fde.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 u1(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let s=2,a=r.slice(o,o+s).join(n),l=i[a];for(;l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}const u=r.slice(o+s).join(n);return u?u1(l,u,n):void 0}i=i[r[o]]}return i}function c1(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class E6 extends Ab{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=l1(this.data,a);return l||!s||typeof r!="string"?l:u1(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),C6(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=l1(this.data,a)||{};i?q$(l,r,o):l={...l,...r},C6(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 W$={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 T6={};class d1 extends Ab{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),ade(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ra.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&&!hde(t,r,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const v=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${v}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l}:`${l}${v}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l}: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),b=["[object Number]","[object Function]","[object RegExp]"],_=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")&&b.indexOf(m)<0&&!(typeof _=="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 v=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=v,d):v}if(o){const v=m==="[object Array]",S=v?[]:{},w=v?p:h;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const C=`${w}${o}${x}`;S[x]=this.translate(C,{...n,joinArrays:!1,ns:a}),S[x]===C&&(S[x]=f[x])}f=S}}else if(y&&typeof _=="string"&&m==="[object Array]")f=f.join(_),f&&(f=this.extendTranslation(f,t,n,r));else{let v=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",x=d1.hasDefaultValue(n),C=w?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&w?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",T=n[`defaultValue${C}`]||n[`defaultValue${A}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=T),this.isValidLookup(f)||(S=!0,f=s);const L=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,N=x&&T!==f&&this.options.updateMissing;if(S||v||N){if(this.logger.log(N?"updateKey":"missingKey",u,l,s,N?T:f),o){const B=this.resolve(s,{...n,keySeparator:!1});B&&B.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 B=0;B<P.length;B++)E.push(P[B]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(n.lng||this.language):E.push(n.lng||this.language);const D=(B,R,O)=>{const I=x&&O!==f?O:L;this.options.missingKeyHandler?this.options.missingKeyHandler(B,l,R,I,N,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(B,l,R,I,N,n),this.emit("missingKey",B,l,R,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach(B=>{this.pluralResolver.getSuffixes(B,n).forEach(R=>{D([B],s+R,n[`defaultValue${R}`]||T)})}):D(E,s,T))}f=this.extendTranslation(f,t,n,d,r),S&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(S||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,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},i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;c<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return o&&o[0]===h[0]&&!r.context?(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=W$.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(b=>{this.isValidLookup(r)||(a=b,!T6[`${m[0]}-${b}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(T6[`${m[0]}-${b}`]=!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(_=>{if(this.isValidLookup(r))return;s=_;const y=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,_,b,n);else{let v;f&&(v=this.pluralResolver.getSuffix(_,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(c+v),n.ordinal&&v.indexOf(w)===0&&y.push(c+v.replace(w,this.options.pluralSeparator)),h&&y.push(c+S)),p){const x=`${c}${this.options.contextSeparator}${n.context}`;y.push(x),f&&(y.push(x+v),n.ordinal&&v.indexOf(w)===0&&y.push(x+v.replace(w,this.options.pluralSeparator)),h&&y.push(x+S))}}let g;for(;g=y.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(_,b,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)}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 lw(e){return e.charAt(0).toUpperCase()+e.slice(1)}class A6{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ra.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]=lw(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]=lw(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=lw(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 pde=[{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}],gde={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 mde=["v1","v2","v3"],yde=["v4"],k6={zero:0,one:1,two:2,few:3,many:4,other:5};function vde(){const e={};return pde.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:gde[t.fc]}})}),e}class _de{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ra.create("pluralResolver"),(!this.options.compatibilityJSON||yde.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=vde()}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)=>k6[i]-k6[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!mde.includes(this.options.compatibilityJSON)}}function P6(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=ude(e,t,n);return!o&&i&&typeof n=="string"&&(o=u1(e,n,r),o===void 0&&(o=u1(t,n,r))),o}class bde{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ra.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:dde,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?pd(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?pd(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?pd(n.nestingPrefix):n.nestingPrefixEscaped||pd("$t("),this.nestingSuffix=n.nestingSuffix?pd(n.nestingSuffix):n.nestingSuffixEscaped||pd(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=P6(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),b=m.shift().trim(),_=m.join(this.formatSeparator).trim();return this.format(P6(n,l,b,this.options.keySeparator,this.options.ignoreJSONStructure),_,r,{...i,...n,interpolationkey:b})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(a=0;o=p.regex.exec(t);){const m=o[1].trim();if(s=c(m),s===void 0)if(typeof d=="function"){const _=d(t,o,i);s=typeof _=="string"?_:""}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=x6(s));const b=p.safeValue(s);if(t=t.replace(o[0],b),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,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,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),u&&(s={...u,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${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 u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=x6(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function Sde(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(!s)return;const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[a.trim()]||(n[a.trim()]=u),u==="false"&&(n[a.trim()]=!1),u==="true"&&(n[a.trim()]=!0),isNaN(u)||(n[a.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function gd(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 wde{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ra.create("formatter"),this.options=t,this.formats={number:gd((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:gd((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:gd((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:gd((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:gd((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()]=gd(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,l)=>{const{formatName:u,formatOptions:c}=Sde(l);if(this.formats[u]){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[u](a,h,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}function xde(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Cde extends Ab{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=ra.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,c=!1,s[f]===void 0&&(s[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(a[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),r&&this.store.addResourceBundle(o,s,r),this.state[t]=n?-1:2;const a={};this.queue.forEach(l=>{lde(l.loaded,[o],s),xde(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{a[u][d]===void 0&&(a[u][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=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function R6(){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 O6(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 Dy(){}function Ede(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Og extends Ab{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=O6(t),this.services={},this.logger=ra,this.modules={external:[]},Ede(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=R6();this.options={...i,...this.options,...O6(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function o(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?ra.init(o(this.modules.logger),this.options):ra.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=wde);const d=new A6(this.options);this.store=new E6(this.options.resources,this.options);const f=this.services;f.logger=ra,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new _de(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new bde(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Cde(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),b=1;b<p;b++)m[b-1]=arguments[b];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 d1(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),b=1;b<p;b++)m[b-1]=arguments[b];t.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Dy),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=Dh(),u=()=>{const c=(d,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dy;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return r();const o=[],s=a=>{if(!a)return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const i=Dh();return t||(t=this.languages),n||(n=this.options.ns),r||(r=Dy),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"&&W$.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,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{s(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,r){var i=this;const o=function(s,a){let l;if(typeof a!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([s,a].concat(c))}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 u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=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 A6(R6());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 Og(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dy;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Og(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 E6(this.store.data,i),o.services.resourceStore=o.store),o.translator=new d1(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];o.emit(a,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gt=Og.createInstance();gt.createInstance=Og.createInstance;gt.createInstance;gt.dir;gt.init;gt.loadResources;gt.reloadResources;gt.use;gt.changeLanguage;gt.getFixedT;const Cp=gt.t;gt.exists;gt.setDefaultNamespace;gt.hasLoadedNamespace;gt.loadNamespaces;gt.loadLanguages;const Pd={none:{type:"none",get label(){return gt.t("controlnet.none")},get description(){return gt.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return gt.t("controlnet.canny")},get description(){return gt.t("controlnet.cannyDescription")},default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",get label(){return gt.t("controlnet.contentShuffle")},get description(){return gt.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 gt.t("controlnet.hed")},get description(){return gt.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 gt.t("controlnet.lineartAnime")},get description(){return gt.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 gt.t("controlnet.lineart")},get description(){return gt.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 gt.t("controlnet.mediapipeFace")},get description(){return gt.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 gt.t("controlnet.depthMidas")},get description(){return gt.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 gt.t("controlnet.mlsd")},get description(){return gt.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 gt.t("controlnet.normalBae")},get description(){return gt.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 gt.t("controlnet.openPose")},get description(){return gt.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 gt.t("controlnet.pidi")},get description(){return gt.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 gt.t("controlnet.depthZoe")},get description(){return gt.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},Ly={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",lineart:"lineart_image_processor",lineart_anime:"lineart_anime_image_processor",softedge:"hed_image_processor",shuffle:"content_shuffle_image_processor",openpose:"openpose_image_processor",mediapipe:"mediapipe_face_processor",pidi:"pidi_image_processor",zoe:"zoe_depth_image_processor"},I6={isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Pd.canny_image_processor.default,shouldAutoConfig:!0},MC={controlNets:{},isEnabled:!1,pendingControlImages:[]},K$=tr({name:"controlNet",initialState:MC,reducers:{isControlNetEnabledToggled:e=>{e.isEnabled=!e.isEnabled},controlNetAdded:(e,t)=>{const{controlNetId:n,controlNet:r}=t.payload;e.controlNets[n]={...r??I6,controlNetId:n}},controlNetDuplicated:(e,t)=>{const{sourceControlNetId:n,newControlNetId:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=Zn(i);o.controlNetId=r,e.controlNets[r]=o},controlNetAddedFromImage:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload;e.controlNets[n]={...I6,controlNetId:n,controlImage:r}},controlNetRemoved:(e,t)=>{const{controlNetId:n}=t.payload;delete e.controlNets[n]},controlNetToggled:(e,t)=>{const{controlNetId:n}=t.payload,r=e.controlNets[n];r&&(r.isEnabled=!r.isEnabled)},controlNetImageChanged:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload,i=e.controlNets[n];i&&(i.controlImage=r,i.processedControlImage=null,r!==null&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlNetProcessedImageChanged:(e,t)=>{const{controlNetId:n,processedControlImage:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=r,e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlNetModelChanged:(e,t)=>{const{controlNetId:n,model:r}=t.payload,i=e.controlNets[n];if(i&&(i.model=r,i.processedControlImage=null,i.shouldAutoConfig)){let o;for(const s in Ly)if(r.model_name.includes(s)){o=Ly[s];break}o?(i.processorType=o,i.processorNode=Pd[o].default):(i.processorType="none",i.processorNode=Pd.none.default)}},controlNetWeightChanged:(e,t)=>{const{controlNetId:n,weight:r}=t.payload,i=e.controlNets[n];i&&(i.weight=r)},controlNetBeginStepPctChanged:(e,t)=>{const{controlNetId:n,beginStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.beginStepPct=r)},controlNetEndStepPctChanged:(e,t)=>{const{controlNetId:n,endStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.endStepPct=r)},controlNetControlModeChanged:(e,t)=>{const{controlNetId:n,controlMode:r}=t.payload,i=e.controlNets[n];i&&(i.controlMode=r)},controlNetResizeModeChanged:(e,t)=>{const{controlNetId:n,resizeMode:r}=t.payload,i=e.controlNets[n];i&&(i.resizeMode=r)},controlNetProcessorParamsChanged:(e,t)=>{const{controlNetId:n,changes:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=i.processorNode;i.processorNode={...o,...r},i.shouldAutoConfig=!1},controlNetProcessorTypeChanged:(e,t)=>{const{controlNetId:n,processorType:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=null,i.processorType=r,i.processorNode=Pd[r].default,i.shouldAutoConfig=!1)},controlNetAutoConfigToggled:(e,t)=>{var o;const{controlNetId:n}=t.payload,r=e.controlNets[n];if(!r)return;const i=!r.shouldAutoConfig;if(i){let s;for(const a in Ly)if((o=r.model)!=null&&o.model_name.includes(a)){s=Ly[a];break}s?(r.processorType=s,r.processorNode=Pd[s].default):(r.processorType="none",r.processorNode=Pd.none.default)}r.shouldAutoConfig=i},controlNetReset:()=>({...MC})},extraReducers:e=>{e.addCase(WE,(t,n)=>{const r=t.controlNets[n.payload.controlNetId];r&&r.controlImage!==null&&t.pendingControlImages.push(n.payload.controlNetId)}),e.addCase(Tb,t=>{t.pendingControlImages=[]}),e.addMatcher(mD,t=>{t.pendingControlImages=[]}),e.addMatcher(he.endpoints.deleteImage.matchFulfilled,(t,n)=>{const{image_name:r}=n.meta.arg.originalArgs;ns(t.controlNets,i=>{i.controlImage===r&&(i.controlImage=null,i.processedControlImage=null),i.processedControlImage===r&&(i.processedControlImage=null)})})}}),{isControlNetEnabledToggled:gOe,controlNetAdded:mOe,controlNetDuplicated:yOe,controlNetAddedFromImage:vOe,controlNetRemoved:X$,controlNetImageChanged:Wc,controlNetProcessedImageChanged:XE,controlNetToggled:_Oe,controlNetModelChanged:M6,controlNetWeightChanged:bOe,controlNetBeginStepPctChanged:SOe,controlNetEndStepPctChanged:wOe,controlNetControlModeChanged:xOe,controlNetResizeModeChanged:COe,controlNetProcessorParamsChanged:Tde,controlNetProcessorTypeChanged:Ade,controlNetReset:kde,controlNetAutoConfigToggled:N6}=K$.actions,Pde=K$.reducer,Rde={imagesToDelete:[],isModalOpen:!1},Q$=tr({name:"deleteImageModal",initialState:Rde,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:QE,imagesToDeleteSelected:Ode,imageDeletionCanceled:EOe}=Q$.actions,Ide=Q$.reducer,Y$={isEnabled:!1,maxPrompts:100,combinatorial:!0},Mde=Y$,Z$=tr({name:"dynamicPrompts",initialState:Mde,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=Y$.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},isEnabledToggled:e=>{e.isEnabled=!e.isEnabled}}}),{isEnabledToggled:TOe,maxPromptsChanged:AOe,maxPromptsReset:kOe,combinatorialToggled:POe}=Z$.actions,Nde=Z$.reducer,J$={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},eF=tr({name:"gallery",initialState:J$,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=t.payload},shouldAutoSwitchChanged:(e,t)=>{e.shouldAutoSwitch=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},autoAssignBoardOnClickChanged:(e,t)=>{e.autoAssignBoardOnClick=t.payload},boardIdSelected:(e,t)=>{e.selectedBoardId=t.payload,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(Lde,(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(hi.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:da,shouldAutoSwitchChanged:ROe,autoAssignBoardOnClickChanged:OOe,setGalleryImageMinimumWidth:IOe,boardIdSelected:NC,autoAddBoardIdChanged:MOe,galleryViewChanged:f1,selectionChanged:tF,boardSearchTextChanged:NOe}=eF.actions,Dde=eF.reducer,Lde=is(he.endpoints.deleteBoard.matchFulfilled,he.endpoints.deleteBoardAndImages.matchFulfilled),D6={weight:.75},$de={loras:{}},nF=tr({name:"lora",initialState:$de,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,...D6}},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=D6.weight)}}}),{loraAdded:DOe,loraRemoved:rF,loraWeightChanged:LOe,loraWeightReset:$Oe,lorasCleared:FOe}=nF.actions,Fde=nF.reducer;function ss(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=ss(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const L6=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},Bde=e=>e?L6(e):L6,{useSyncExternalStoreWithSelector:zde}=ice;function iF(e,t=e.getState,n){const r=zde(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const $6=(e,t)=>{const n=Bde(e),r=(i,o=t)=>iF(n,i,o);return Object.assign(r,n),r},Ude=(e,t)=>e?$6(e,t):$6;function mo(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 jde={value:()=>{}};function kb(){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 D0(n)}function D0(e){this._=e}function Vde(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}})}D0.prototype=kb.prototype={constructor:D0,on:function(e,t){var n=this._,r=Vde(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Gde(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]=F6(n[i],e.name,t);else if(t==null)for(i in n)n[i]=F6(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 D0(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 Gde(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function F6(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=jde,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var DC="http://www.w3.org/1999/xhtml";const B6={svg:"http://www.w3.org/2000/svg",xhtml:DC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),B6.hasOwnProperty(t)?{space:B6[t],local:e}:e}function Hde(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===DC&&t.documentElement.namespaceURI===DC?t.createElement(e):t.createElementNS(n,e)}}function qde(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oF(e){var t=Pb(e);return(t.local?qde:Hde)(t)}function Wde(){}function YE(e){return e==null?Wde:function(){return this.querySelector(e)}}function Kde(e){typeof e!="function"&&(e=YE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),l,u,c=0;c<s;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new No(r,this._parents)}function Xde(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Qde(){return[]}function sF(e){return e==null?Qde:function(){return this.querySelectorAll(e)}}function Yde(e){return function(){return Xde(e.apply(this,arguments))}}function Zde(e){typeof e=="function"?e=Yde(e):e=sF(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),i.push(l));return new No(r,i)}function aF(e){return function(){return this.matches(e)}}function lF(e){return function(t){return t.matches(e)}}var Jde=Array.prototype.find;function efe(e){return function(){return Jde.call(this.children,e)}}function tfe(){return this.firstElementChild}function nfe(e){return this.select(e==null?tfe:efe(typeof e=="function"?e:lF(e)))}var rfe=Array.prototype.filter;function ife(){return Array.from(this.children)}function ofe(e){return function(){return rfe.call(this.children,e)}}function sfe(e){return this.selectAll(e==null?ife:ofe(typeof e=="function"?e:lF(e)))}function afe(e){typeof e!="function"&&(e=aF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new No(r,this._parents)}function uF(e){return new Array(e.length)}function lfe(){return new No(this._enter||this._groups.map(uF),this._parents)}function h1(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}h1.prototype={constructor:h1,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ufe(e){return function(){return e}}function cfe(e,t,n,r,i,o){for(var s=0,a,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new h1(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function dfe(e,t,n,r,i,o,s){var a,l,u=new Map,c=t.length,d=o.length,f=new Array(c),h;for(a=0;a<c;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?i[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,o[a],a,o)+"",(l=u.get(h))?(r[a]=l,l.__data__=o[a],u.delete(h)):n[a]=new h1(e,o[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(i[a]=l)}function ffe(e){return e.__data__}function hfe(e,t){if(!arguments.length)return Array.from(this,ffe);var n=t?dfe:cfe,r=this._parents,i=this._groups;typeof e!="function"&&(e=ufe(e));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],f=d.length,h=pfe(e.call(c,c&&c.__data__,u,r)),p=h.length,m=a[u]=new Array(p),b=s[u]=new Array(p),_=l[u]=new Array(f);n(c,d,m,b,_,h,t);for(var y=0,g=0,v,S;y<p;++y)if(v=m[y]){for(y>=g&&(g=y+1);!(S=b[g])&&++g<p;);v._next=S||null}}return s=new No(s,r),s._enter=a,s._exit=l,s}function pfe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gfe(){return new No(this._exit||this._groups.map(uF),this._parents)}function mfe(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 yfe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<i;++l)a[l]=n[l];return new No(a,this._parents)}function vfe(){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 _fe(e){e||(e=bfe);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),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new No(i,this._parents).order()}function bfe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Sfe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wfe(){return Array.from(this)}function xfe(){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 Cfe(){let e=0;for(const t of this)++e;return e}function Efe(){return!this.node()}function Tfe(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 Afe(e){return function(){this.removeAttribute(e)}}function kfe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pfe(e,t){return function(){this.setAttribute(e,t)}}function Rfe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ofe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ife(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 Mfe(e,t){var n=Pb(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?kfe:Afe:typeof t=="function"?n.local?Ife:Ofe:n.local?Rfe:Pfe)(n,t))}function cF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nfe(e){return function(){this.style.removeProperty(e)}}function Dfe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Lfe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function $fe(e,t,n){return arguments.length>1?this.each((t==null?Nfe:typeof t=="function"?Lfe:Dfe)(e,t,n??"")):Vf(this.node(),e)}function Vf(e,t){return e.style.getPropertyValue(t)||cF(e).getComputedStyle(e,null).getPropertyValue(t)}function Ffe(e){return function(){delete this[e]}}function Bfe(e,t){return function(){this[e]=t}}function zfe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ufe(e,t){return arguments.length>1?this.each((t==null?Ffe:typeof t=="function"?zfe:Bfe)(e,t)):this.node()[e]}function dF(e){return e.trim().split(/^|\s+/)}function ZE(e){return e.classList||new fF(e)}function fF(e){this._node=e,this._names=dF(e.getAttribute("class")||"")}fF.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 hF(e,t){for(var n=ZE(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function pF(e,t){for(var n=ZE(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function jfe(e){return function(){hF(this,e)}}function Vfe(e){return function(){pF(this,e)}}function Gfe(e,t){return function(){(t.apply(this,arguments)?hF:pF)(this,e)}}function Hfe(e,t){var n=dF(e+"");if(arguments.length<2){for(var r=ZE(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Gfe:t?jfe:Vfe)(n,t))}function qfe(){this.textContent=""}function Wfe(e){return function(){this.textContent=e}}function Kfe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Xfe(e){return arguments.length?this.each(e==null?qfe:(typeof e=="function"?Kfe:Wfe)(e)):this.node().textContent}function Qfe(){this.innerHTML=""}function Yfe(e){return function(){this.innerHTML=e}}function Zfe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Jfe(e){return arguments.length?this.each(e==null?Qfe:(typeof e=="function"?Zfe:Yfe)(e)):this.node().innerHTML}function ehe(){this.nextSibling&&this.parentNode.appendChild(this)}function the(){return this.each(ehe)}function nhe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rhe(){return this.each(nhe)}function ihe(e){var t=typeof e=="function"?e:oF(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ohe(){return null}function she(e,t){var n=typeof e=="function"?e:oF(e),r=t==null?ohe:typeof t=="function"?t:YE(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ahe(){var e=this.parentNode;e&&e.removeChild(this)}function lhe(){return this.each(ahe)}function uhe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function che(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dhe(e){return this.select(e?che:uhe)}function fhe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hhe(e){return function(t){e.call(this,t,this.__data__)}}function phe(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 ghe(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 mhe(e,t,n){return function(){var r=this.__on,i,o=hhe(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 yhe(e,t,n){var r=phe(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?mhe:ghe,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function gF(e,t,n){var r=cF(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 vhe(e,t){return function(){return gF(this,e,t)}}function _he(e,t){return function(){return gF(this,e,t.apply(this,arguments))}}function bhe(e,t){return this.each((typeof t=="function"?_he:vhe)(e,t))}function*She(){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 mF=[null];function No(e,t){this._groups=e,this._parents=t}function Nm(){return new No([[document.documentElement]],mF)}function whe(){return this}No.prototype=Nm.prototype={constructor:No,select:Kde,selectAll:Zde,selectChild:nfe,selectChildren:sfe,filter:afe,data:hfe,enter:lfe,exit:gfe,join:mfe,merge:yfe,selection:whe,order:vfe,sort:_fe,call:Sfe,nodes:wfe,node:xfe,size:Cfe,empty:Efe,each:Tfe,attr:Mfe,style:$fe,property:Ufe,classed:Hfe,text:Xfe,html:Jfe,raise:the,lower:rhe,append:ihe,insert:she,remove:lhe,clone:dhe,datum:fhe,on:yhe,dispatch:bhe,[Symbol.iterator]:She};function xs(e){return typeof e=="string"?new No([[document.querySelector(e)]],[document.documentElement]):new No([[e]],mF)}function xhe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xs(e,t){if(e=xhe(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 Che={passive:!1},Ig={capture:!0,passive:!1};function uw(e){e.stopImmediatePropagation()}function ff(e){e.preventDefault(),e.stopImmediatePropagation()}function yF(e){var t=e.document.documentElement,n=xs(e).on("dragstart.drag",ff,Ig);"onselectstart"in t?n.on("selectstart.drag",ff,Ig):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function vF(e,t){var n=e.document.documentElement,r=xs(e).on("dragstart.drag",null);t&&(r.on("click.drag",ff,Ig),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 $y=e=>()=>e;function LC(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}LC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ehe(e){return!e.ctrlKey&&!e.button}function The(){return this.parentNode}function Ahe(e,t){return t??{x:e.x,y:e.y}}function khe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Phe(){var e=Ehe,t=The,n=Ahe,r=khe,i={},o=kb("start","drag","end"),s=0,a,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",b).on("touchmove.drag",_,Che).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(c||!e.call(this,v,S))){var w=g(this,t.call(this,v,S),v,S,"mouse");w&&(xs(v.view).on("mousemove.drag",p,Ig).on("mouseup.drag",m,Ig),yF(v.view),uw(v),u=!1,a=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(ff(v),!u){var S=v.clientX-a,w=v.clientY-l;u=S*S+w*w>d}i.mouse("drag",v)}function m(v){xs(v.view).on("mousemove.drag mouseup.drag",null),vF(v.view,u),ff(v),i.mouse("end",v)}function b(v,S){if(e.call(this,v,S)){var w=v.changedTouches,x=t.call(this,v,S),C=w.length,A,T;for(A=0;A<C;++A)(T=g(this,x,v,S,w[A].identifier,w[A]))&&(uw(v),T("start",v,w[A]))}}function _(v){var S=v.changedTouches,w=S.length,x,C;for(x=0;x<w;++x)(C=i[S[x].identifier])&&(ff(v),C("drag",v,S[x]))}function y(v){var S=v.changedTouches,w=S.length,x,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),x=0;x<w;++x)(C=i[S[x].identifier])&&(uw(v),C("end",v,S[x]))}function g(v,S,w,x,C,A){var T=o.copy(),k=Xs(A||w,S),L,N,E;if((E=n.call(v,new LC("beforestart",{sourceEvent:w,target:f,identifier:C,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:T}),x))!=null)return L=E.x-k[0]||0,N=E.y-k[1]||0,function P(D,B,R){var O=k,I;switch(D){case"start":i[C]=P,I=s++;break;case"end":delete i[C],--s;case"drag":k=Xs(R||B,S),I=s;break}T.call(D,v,new LC(D,{sourceEvent:B,subject:E,target:f,identifier:C,active:I,x:k[0]+L,y:k[1]+N,dx:k[0]-O[0],dy:k[1]-O[1],dispatch:T}),x)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:$y(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:$y(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:$y(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:$y(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function JE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _F(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Dm(){}var Mg=.7,p1=1/Mg,hf="\\s*([+-]?\\d+)\\s*",Ng="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rhe=/^#([0-9a-f]{3,8})$/,Ohe=new RegExp(`^rgb\\(${hf},${hf},${hf}\\)$`),Ihe=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),Mhe=new RegExp(`^rgba\\(${hf},${hf},${hf},${Ng}\\)$`),Nhe=new RegExp(`^rgba\\(${fa},${fa},${fa},${Ng}\\)$`),Dhe=new RegExp(`^hsl\\(${Ng},${fa},${fa}\\)$`),Lhe=new RegExp(`^hsla\\(${Ng},${fa},${fa},${Ng}\\)$`),z6={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};JE(Dm,Dg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:U6,formatHex:U6,formatHex8:$he,formatHsl:Fhe,formatRgb:j6,toString:j6});function U6(){return this.rgb().formatHex()}function $he(){return this.rgb().formatHex8()}function Fhe(){return bF(this).formatHsl()}function j6(){return this.rgb().formatRgb()}function Dg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rhe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?V6(t):n===3?new uo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fy(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=Ohe.exec(e))?new uo(t[1],t[2],t[3],1):(t=Ihe.exec(e))?new uo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mhe.exec(e))?Fy(t[1],t[2],t[3],t[4]):(t=Nhe.exec(e))?Fy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Dhe.exec(e))?q6(t[1],t[2]/100,t[3]/100,1):(t=Lhe.exec(e))?q6(t[1],t[2]/100,t[3]/100,t[4]):z6.hasOwnProperty(e)?V6(z6[e]):e==="transparent"?new uo(NaN,NaN,NaN,0):null}function V6(e){return new uo(e>>16&255,e>>8&255,e&255,1)}function Fy(e,t,n,r){return r<=0&&(e=t=n=NaN),new uo(e,t,n,r)}function Bhe(e){return e instanceof Dm||(e=Dg(e)),e?(e=e.rgb(),new uo(e.r,e.g,e.b,e.opacity)):new uo}function $C(e,t,n,r){return arguments.length===1?Bhe(e):new uo(e,t,n,r??1)}function uo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}JE(uo,$C,_F(Dm,{brighter(e){return e=e==null?p1:Math.pow(p1,e),new uo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mg:Math.pow(Mg,e),new uo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new uo(_c(this.r),_c(this.g),_c(this.b),g1(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:G6,formatHex:G6,formatHex8:zhe,formatRgb:H6,toString:H6}));function G6(){return`#${uc(this.r)}${uc(this.g)}${uc(this.b)}`}function zhe(){return`#${uc(this.r)}${uc(this.g)}${uc(this.b)}${uc((isNaN(this.opacity)?1:this.opacity)*255)}`}function H6(){const e=g1(this.opacity);return`${e===1?"rgb(":"rgba("}${_c(this.r)}, ${_c(this.g)}, ${_c(this.b)}${e===1?")":`, ${e})`}`}function g1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function uc(e){return e=_c(e),(e<16?"0":"")+e.toString(16)}function q6(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cs(e,t,n,r)}function bF(e){if(e instanceof Cs)return new Cs(e.h,e.s,e.l,e.opacity);if(e instanceof Dm||(e=Dg(e)),!e)return new Cs;if(e instanceof Cs)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 Cs(s,a,l,e.opacity)}function Uhe(e,t,n,r){return arguments.length===1?bF(e):new Cs(e,t,n,r??1)}function Cs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}JE(Cs,Uhe,_F(Dm,{brighter(e){return e=e==null?p1:Math.pow(p1,e),new Cs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mg:Math.pow(Mg,e),new Cs(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 uo(cw(e>=240?e-240:e+120,i,r),cw(e,i,r),cw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cs(W6(this.h),By(this.s),By(this.l),g1(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=g1(this.opacity);return`${e===1?"hsl(":"hsla("}${W6(this.h)}, ${By(this.s)*100}%, ${By(this.l)*100}%${e===1?")":`, ${e})`}`}}));function W6(e){return e=(e||0)%360,e<0?e+360:e}function By(e){return Math.max(0,Math.min(1,e||0))}function cw(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 SF=e=>()=>e;function jhe(e,t){return function(n){return e+n*t}}function Vhe(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 Ghe(e){return(e=+e)==1?wF:function(t,n){return n-t?Vhe(t,n,e):SF(isNaN(t)?n:t)}}function wF(e,t){var n=t-e;return n?jhe(e,n):SF(isNaN(e)?t:e)}const K6=function e(t){var n=Ghe(t);function r(i,o){var s=n((i=$C(i)).r,(o=$C(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=wF(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Pl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var FC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dw=new RegExp(FC.source,"g");function Hhe(e){return function(){return e}}function qhe(e){return function(t){return e(t)+""}}function Whe(e,t){var n=FC.lastIndex=dw.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=FC.exec(e))&&(i=dw.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:Pl(r,i)})),n=dw.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?qhe(l[0].x):Hhe(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var X6=180/Math.PI,BC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xF(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)*X6,skewX:Math.atan(l)*X6,scaleX:s,scaleY:a}}var zy;function Khe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?BC:xF(t.a,t.b,t.c,t.d,t.e,t.f)}function Xhe(e){return e==null||(zy||(zy=document.createElementNS("http://www.w3.org/2000/svg","g")),zy.setAttribute("transform",e),!(e=zy.transform.baseVal.consolidate()))?BC:(e=e.matrix,xF(e.a,e.b,e.c,e.d,e.e,e.f))}function CF(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:Pl(u,d)},{i:m-2,x:Pl(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Pl(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Pl(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:Pl(u,d)},{i:m-2,x:Pl(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,m=f.length,b;++p<m;)d[(b=f[p]).i]=b.x(h);return d.join("")}}}var Qhe=CF(Khe,"px, ","px)","deg)"),Yhe=CF(Xhe,", ",")",")"),Zhe=1e-12;function Q6(e){return((e=Math.exp(e))+1/e)/2}function Jhe(e){return((e=Math.exp(e))-1/e)/2}function epe(e){return((e=Math.exp(2*e))-1)/(e+1)}const tpe=function e(t,n,r){function i(o,s){var a=o[0],l=o[1],u=o[2],c=s[0],d=s[1],f=s[2],h=c-a,p=d-l,m=h*h+p*p,b,_;if(m<Zhe)_=Math.log(f/u)/t,b=function(x){return[a+x*h,l+x*p,u*Math.exp(t*x*_)]};else{var y=Math.sqrt(m),g=(f*f-u*u+r*m)/(2*u*n*y),v=(f*f-u*u-r*m)/(2*f*n*y),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(v*v+1)-v);_=(w-S)/t,b=function(x){var C=x*_,A=Q6(S),T=u/(n*y)*(A*epe(t*C+S)-Jhe(S));return[a+T*h,l+T*p,u*A/Q6(t*C+S)]}}return b.duration=_*1e3*t/Math.SQRT2,b}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,rp=0,Lh=0,EF=1e3,m1,ip,y1=0,Mc=0,Rb=0,Lg=typeof performance=="object"&&performance.now?performance:Date,TF=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eT(){return Mc||(TF(npe),Mc=Lg.now()+Rb)}function npe(){Mc=0}function v1(){this._call=this._time=this._next=null}v1.prototype=AF.prototype={constructor:v1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?eT():+n)+(t==null?0:+t),!this._next&&ip!==this&&(ip?ip._next=this:m1=this,ip=this),this._call=e,this._time=n,zC()},stop:function(){this._call&&(this._call=null,this._time=1/0,zC())}};function AF(e,t,n){var r=new v1;return r.restart(e,t,n),r}function rpe(){eT(),++Gf;for(var e=m1,t;e;)(t=Mc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Gf}function Y6(){Mc=(y1=Lg.now())+Rb,Gf=rp=0;try{rpe()}finally{Gf=0,ope(),Mc=0}}function ipe(){var e=Lg.now(),t=e-y1;t>EF&&(Rb-=t,y1=e)}function ope(){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);ip=e,zC(r)}function zC(e){if(!Gf){rp&&(rp=clearTimeout(rp));var t=e-Mc;t>24?(e<1/0&&(rp=setTimeout(Y6,e-Lg.now()-Rb)),Lh&&(Lh=clearInterval(Lh))):(Lh||(y1=Lg.now(),Lh=setInterval(ipe,EF)),Gf=1,TF(Y6))}}function Z6(e,t,n){var r=new v1;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var spe=kb("start","end","cancel","interrupt"),ape=[],kF=0,J6=1,UC=2,L0=3,e8=4,jC=5,$0=6;function Ob(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;lpe(e,n,{name:t,index:r,group:i,on:spe,tween:ape,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:kF})}function tT(e,t){var n=Bs(e,t);if(n.state>kF)throw new Error("too late; already scheduled");return n}function Sa(e,t){var n=Bs(e,t);if(n.state>L0)throw new Error("too late; already running");return n}function Bs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lpe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=AF(o,0,n.time);function o(u){n.state=J6,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==J6)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===L0)return Z6(s);h.state===e8?(h.state=$0,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=$0,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Z6(function(){n.state===L0&&(n.state=e8,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=UC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===UC){for(n.state=L0,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=jC,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===jC&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=$0,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function F0(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>UC&&r.state<jC,r.state=$0,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function upe(e){return this.each(function(){F0(this,e)})}function cpe(e,t){var n,r;return function(){var i=Sa(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 dpe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Sa(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}o.tween=i}}function fpe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Bs(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?cpe:dpe)(n,e,t))}function nT(e,t,n){var r=e._id;return e.each(function(){var i=Sa(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Bs(i,r).value[t]}}function PF(e,t){var n;return(typeof t=="number"?Pl:t instanceof Dg?K6:(n=Dg(t))?(t=n,K6):Whe)(e,t)}function hpe(e){return function(){this.removeAttribute(e)}}function ppe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gpe(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 mpe(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 ype(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 vpe(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 _pe(e,t){var n=Pb(e),r=n==="transform"?Yhe:PF;return this.attrTween(e,typeof t=="function"?(n.local?vpe:ype)(n,r,nT(this,"attr."+e,t)):t==null?(n.local?ppe:hpe)(n):(n.local?mpe:gpe)(n,r,t))}function bpe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Spe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function wpe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Spe(e,o)),n}return i._value=t,i}function xpe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&bpe(e,o)),n}return i._value=t,i}function Cpe(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=Pb(e);return this.tween(n,(r.local?wpe:xpe)(r,t))}function Epe(e,t){return function(){tT(this,e).delay=+t.apply(this,arguments)}}function Tpe(e,t){return t=+t,function(){tT(this,e).delay=t}}function Ape(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Epe:Tpe)(t,e)):Bs(this.node(),t).delay}function kpe(e,t){return function(){Sa(this,e).duration=+t.apply(this,arguments)}}function Ppe(e,t){return t=+t,function(){Sa(this,e).duration=t}}function Rpe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kpe:Ppe)(t,e)):Bs(this.node(),t).duration}function Ope(e,t){if(typeof t!="function")throw new Error;return function(){Sa(this,e).ease=t}}function Ipe(e){var t=this._id;return arguments.length?this.each(Ope(t,e)):Bs(this.node(),t).ease}function Mpe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Sa(this,e).ease=n}}function Npe(e){if(typeof e!="function")throw new Error;return this.each(Mpe(this._id,e))}function Dpe(e){typeof e!="function"&&(e=aF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new sl(r,this._parents,this._name,this._id)}function Lpe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new sl(s,this._parents,this._name,this._id)}function $pe(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 Fpe(e,t,n){var r,i,o=$pe(t)?tT:Sa;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function Bpe(e,t){var n=this._id;return arguments.length<2?Bs(this.node(),n).on.on(e):this.each(Fpe(n,e,t))}function zpe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Upe(){return this.on("end.remove",zpe(this._id))}function jpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=YE(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,u=o[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ob(u[f],t,n,f,u,Bs(c,n)));return new sl(o,this._parents,t,n)}function Vpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=sF(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=Bs(c,n),m=0,b=f.length;m<b;++m)(h=f[m])&&Ob(h,t,n,m,f,p);o.push(f),s.push(c)}return new sl(o,s,t,n)}var Gpe=Nm.prototype.constructor;function Hpe(){return new Gpe(this._groups,this._parents)}function qpe(e,t){var n,r,i;return function(){var o=Vf(this,e),s=(this.style.removeProperty(e),Vf(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function RF(e){return function(){this.style.removeProperty(e)}}function Wpe(e,t,n){var r,i=n+"",o;return function(){var s=Vf(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function Kpe(e,t,n){var r,i,o;return function(){var s=Vf(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Vf(this,e))),s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a))}}function Xpe(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=Sa(this,e),u=l.on,c=l.value[o]==null?a||(a=RF(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(s,i=c),l.on=r}}function Qpe(e,t,n){var r=(e+="")=="transform"?Qhe:PF;return t==null?this.styleTween(e,qpe(e,r)).on("end.style."+e,RF(e)):typeof t=="function"?this.styleTween(e,Kpe(e,r,nT(this,"style."+e,t))).each(Xpe(this._id,e)):this.styleTween(e,Wpe(e,r,t),n).on("end.style."+e,null)}function Ype(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Zpe(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Ype(e,s,n)),r}return o._value=t,o}function Jpe(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,Zpe(e,t,n??""))}function ege(e){return function(){this.textContent=e}}function tge(e){return function(){var t=e(this);this.textContent=t??""}}function nge(e){return this.tween("text",typeof e=="function"?tge(nT(this,"text",e)):ege(e==null?"":e+""))}function rge(e){return function(t){this.textContent=e.call(this,t)}}function ige(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&rge(i)),t}return r._value=e,r}function oge(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,ige(e))}function sge(){for(var e=this._name,t=this._id,n=OF(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Bs(l,t);Ob(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new sl(r,this._parents,e,n)}function age(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};n.each(function(){var u=Sa(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&o()})}var lge=0;function sl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function OF(){return++lge}var Pa=Nm.prototype;sl.prototype={constructor:sl,select:jpe,selectAll:Vpe,selectChild:Pa.selectChild,selectChildren:Pa.selectChildren,filter:Dpe,merge:Lpe,selection:Hpe,transition:sge,call:Pa.call,nodes:Pa.nodes,node:Pa.node,size:Pa.size,empty:Pa.empty,each:Pa.each,on:Bpe,attr:_pe,attrTween:Cpe,style:Qpe,styleTween:Jpe,text:nge,textTween:oge,remove:Upe,tween:fpe,delay:Ape,duration:Rpe,ease:Ipe,easeVarying:Npe,end:age,[Symbol.iterator]:Pa[Symbol.iterator]};function uge(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var cge={time:null,delay:0,duration:250,ease:uge};function dge(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 fge(e){var t,n;e instanceof sl?(t=e._id,e=e._name):(t=OF(),(n=cge).time=eT(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Ob(l,e,t,u,s,n||dge(l,t));return new sl(r,this._parents,e,t)}Nm.prototype.interrupt=upe;Nm.prototype.transition=fge;const Uy=e=>()=>e;function hge(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 Ha(e,t,n){this.k=e,this.x=t,this.y=n}Ha.prototype={constructor:Ha,scale:function(e){return e===1?this:new Ha(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ha(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 ru=new Ha(1,0,0);Ha.prototype;function fw(e){e.stopImmediatePropagation()}function $h(e){e.preventDefault(),e.stopImmediatePropagation()}function pge(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function gge(){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 t8(){return this.__zoom||ru}function mge(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function yge(){return navigator.maxTouchPoints||"ontouchstart"in this}function vge(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 _ge(){var e=pge,t=gge,n=vge,r=mge,i=yge,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=tpe,u=kb("start","zoom","end"),c,d,f,h=500,p=150,m=0,b=10;function _(E){E.property("__zoom",t8).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",k).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(E,P,D,B){var R=E.selection?E.selection():E;R.property("__zoom",t8),E!==R?S(E,P,D,B):R.interrupt().each(function(){w(this,arguments).event(B).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},_.scaleBy=function(E,P,D,B){_.scaleTo(E,function(){var R=this.__zoom.k,O=typeof P=="function"?P.apply(this,arguments):P;return R*O},D,B)},_.scaleTo=function(E,P,D,B){_.transform(E,function(){var R=t.apply(this,arguments),O=this.__zoom,I=D==null?v(R):typeof D=="function"?D.apply(this,arguments):D,F=O.invert(I),U=typeof P=="function"?P.apply(this,arguments):P;return n(g(y(O,U),I,F),R,s)},D,B)},_.translateBy=function(E,P,D,B){_.transform(E,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,B)},_.translateTo=function(E,P,D,B,R){_.transform(E,function(){var O=t.apply(this,arguments),I=this.__zoom,F=B==null?v(O):typeof B=="function"?B.apply(this,arguments):B;return n(ru.translate(F[0],F[1]).scale(I.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof D=="function"?-D.apply(this,arguments):-D),O,s)},B,R)};function y(E,P){return P=Math.max(o[0],Math.min(o[1],P)),P===E.k?E:new Ha(P,E.x,E.y)}function g(E,P,D){var B=P[0]-D[0]*E.k,R=P[1]-D[1]*E.k;return B===E.x&&R===E.y?E:new Ha(E.k,B,R)}function v(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,P,D,B){E.on("start.zoom",function(){w(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(B).end()}).tween("zoom",function(){var R=this,O=arguments,I=w(R,O).event(B),F=t.apply(R,O),U=D==null?v(F):typeof D=="function"?D.apply(R,O):D,V=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),H=R.__zoom,Y=typeof P=="function"?P.apply(R,O):P,Q=l(H.invert(U).concat(V/H.k),Y.invert(U).concat(V/Y.k));return function(j){if(j===1)j=Y;else{var K=Q(j),ee=V/K[2];j=new Ha(ee,U[0]-K[0]*ee,U[1]-K[1]*ee)}I.zoom(null,j)}})}function w(E,P,D){return!D&&E.__zooming||new x(E,P)}function x(E,P){this.that=E,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,P),this.taps=0}x.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=xs(this.that).datum();u.call(E,this.that,new hge(E,{sourceEvent:this.sourceEvent,target:_,type:E,transform:this.that.__zoom,dispatch:u}),P)}};function C(E,...P){if(!e.apply(this,arguments))return;var D=w(this,P).event(E),B=this.__zoom,R=Math.max(o[0],Math.min(o[1],B.k*Math.pow(2,r.apply(this,arguments)))),O=Xs(E);if(D.wheel)(D.mouse[0][0]!==O[0]||D.mouse[0][1]!==O[1])&&(D.mouse[1]=B.invert(D.mouse[0]=O)),clearTimeout(D.wheel);else{if(B.k===R)return;D.mouse=[O,B.invert(O)],F0(this),D.start()}$h(E),D.wheel=setTimeout(I,p),D.zoom("mouse",n(g(y(B,R),D.mouse[0],D.mouse[1]),D.extent,s));function I(){D.wheel=null,D.end()}}function A(E,...P){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,B=w(this,P,!0).event(E),R=xs(E.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",V,!0),O=Xs(E,D),I=E.clientX,F=E.clientY;yF(E.view),fw(E),B.mouse=[O,this.__zoom.invert(O)],F0(this),B.start();function U(H){if($h(H),!B.moved){var Y=H.clientX-I,Q=H.clientY-F;B.moved=Y*Y+Q*Q>m}B.event(H).zoom("mouse",n(g(B.that.__zoom,B.mouse[0]=Xs(H,D),B.mouse[1]),B.extent,s))}function V(H){R.on("mousemove.zoom mouseup.zoom",null),vF(H.view,B.moved),$h(H),B.event(H).end()}}function T(E,...P){if(e.apply(this,arguments)){var D=this.__zoom,B=Xs(E.changedTouches?E.changedTouches[0]:E,this),R=D.invert(B),O=D.k*(E.shiftKey?.5:2),I=n(g(y(D,O),B,R),t.apply(this,P),s);$h(E),a>0?xs(this).transition().duration(a).call(S,I,B,E):xs(this).call(_.transform,I,B,E)}}function k(E,...P){if(e.apply(this,arguments)){var D=E.touches,B=D.length,R=w(this,P,E.changedTouches.length===B).event(E),O,I,F,U;for(fw(E),I=0;I<B;++I)F=D[I],U=Xs(F,this),U=[U,this.__zoom.invert(U),F.identifier],R.touch0?!R.touch1&&R.touch0[2]!==U[2]&&(R.touch1=U,R.taps=0):(R.touch0=U,O=!0,R.taps=1+!!c);c&&(c=clearTimeout(c)),O&&(R.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),F0(this),R.start())}}function L(E,...P){if(this.__zooming){var D=w(this,P).event(E),B=E.changedTouches,R=B.length,O,I,F,U;for($h(E),O=0;O<R;++O)I=B[O],F=Xs(I,this),D.touch0&&D.touch0[2]===I.identifier?D.touch0[0]=F:D.touch1&&D.touch1[2]===I.identifier&&(D.touch1[0]=F);if(I=D.that.__zoom,D.touch1){var V=D.touch0[0],H=D.touch0[1],Y=D.touch1[0],Q=D.touch1[1],j=(j=Y[0]-V[0])*j+(j=Y[1]-V[1])*j,K=(K=Q[0]-H[0])*K+(K=Q[1]-H[1])*K;I=y(I,Math.sqrt(j/K)),F=[(V[0]+Y[0])/2,(V[1]+Y[1])/2],U=[(H[0]+Q[0])/2,(H[1]+Q[1])/2]}else if(D.touch0)F=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(g(I,F,U),D.extent,s))}}function N(E,...P){if(this.__zooming){var D=w(this,P).event(E),B=E.changedTouches,R=B.length,O,I;for(fw(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),O=0;O<R;++O)I=B[O],D.touch0&&D.touch0[2]===I.identifier?delete D.touch0:D.touch1&&D.touch1[2]===I.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(I=Xs(I,this),Math.hypot(d[0]-I[0],d[1]-I[1])<b)){var F=xs(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return _.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Uy(+E),_):r},_.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Uy(!!E),_):e},_.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Uy(!!E),_):i},_.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Uy([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),_):t},_.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],_):[o[0],o[1]]},_.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],_):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},_.constrain=function(E){return arguments.length?(n=E,_):n},_.duration=function(E){return arguments.length?(a=+E,_):a},_.interpolate=function(E){return arguments.length?(l=E,_):l},_.on=function(){var E=u.on.apply(u,arguments);return E===u?_:E},_.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,_):Math.sqrt(m)},_.tapDistance=function(E){return arguments.length?(b=+E,_):b},_}const Ib=M.createContext(null),bge=Ib.Provider,al={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.`},IF=al.error001();function fr(e,t){const n=M.useContext(Ib);if(n===null)throw new Error(IF);return iF(n,e,t)}const ii=()=>{const e=M.useContext(Ib);if(e===null)throw new Error(IF);return M.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Sge=e=>e.userSelectionActive?"none":"all";function wge({position:e,children:t,className:n,style:r,...i}){const o=fr(Sge),s=`${e}`.split("-");return Z.jsx("div",{className:ss(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i,children:t})}function xge({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:Z.jsx(wge,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:Z.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Cge=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c})=>{const d=M.useRef(null),[f,h]=M.useState({x:0,y:0,width:0,height:0}),p=ss(["react-flow__edge-textwrapper",u]);return M.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:Z.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[i&&Z.jsx("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}),Z.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var Ege=M.memo(Cge);const rT=e=>({width:e.offsetWidth,height:e.offsetHeight}),Hf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),iT=(e={x:0,y:0},t)=>({x:Hf(e.x,t[0][0],t[1][0]),y:Hf(e.y,t[0][1],t[1][1])}),n8=(e,t,n)=>e<t?Hf(Math.abs(e-t),1,50)/50:e>n?-Hf(Math.abs(e-n),1,50)/50:0,MF=(e,t)=>{const n=n8(e.x,35,t.width-35)*20,r=n8(e.y,35,t.height-35)*20;return[n,r]},NF=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},DF=(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)}),$g=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),LF=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),r8=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),BOe=(e,t)=>LF(DF($g(e),$g(t))),VC=(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)},Tge=e=>Yo(e.width)&&Yo(e.height)&&Yo(e.x)&&Yo(e.y),Yo=e=>!isNaN(e)&&isFinite(e),zr=Symbol.for("internals"),$F=["Enter"," ","Escape"],Age=(e,t)=>{},kge=e=>"nativeEvent"in e;function GC(e){var i,o;const t=kge(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 FF=e=>"clientX"in e,iu=(e,t)=>{var o,s;const n=FF(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},Lm=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>Z.jsxs(Z.Fragment,{children:[Z.jsx("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&Z.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Yo(n)&&Yo(r)?Z.jsx(Ege,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u}):null]});Lm.displayName="BaseEdge";function Fh(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function BF({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 zF({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Nc;(function(e){e.Strict="strict",e.Loose="loose"})(Nc||(Nc={}));var cc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(cc||(cc={}));var vu;(function(e){e.Partial="partial",e.Full="full"})(vu||(vu={}));var $l;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($l||($l={}));var b1;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(b1||(b1={}));var Ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ye||(Ye={}));function i8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ye.Left||e===Ye.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function UF({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:o=Ye.Top}){const[s,a]=i8({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=i8({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=zF({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${i}`,c,d,f,h]}const oT=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Ye.Bottom,targetPosition:o=Ye.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[b,_,y]=UF({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return Z.jsx(Lm,{path:b,labelX:_,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});oT.displayName="SimpleBezierEdge";const o8={[Ye.Left]:{x:-1,y:0},[Ye.Right]:{x:1,y:0},[Ye.Top]:{x:0,y:-1},[Ye.Bottom]:{x:0,y:1}},Pge=({source:e,sourcePosition:t=Ye.Bottom,target:n})=>t===Ye.Left||t===Ye.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},s8=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Rge({source:e,sourcePosition:t=Ye.Bottom,target:n,targetPosition:r=Ye.Top,center:i,offset:o}){const s=o8[t],a=o8[r],l={x:e.x+s.x*o,y:e.y+s.y*o},u={x:n.x+a.x*o,y:n.y+a.y*o},c=Pge({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],p,m;const b={x:0,y:0},_={x:0,y:0},[y,g,v,S]=BF({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 x=[{x:p,y:l.y},{x:p,y:u.y}],C=[{x:l.x,y:m},{x:u.x,y:m}];s[d]===f?h=d==="x"?x:C:h=d==="x"?C:x}else{const x=[{x:l.x,y:u.y}],C=[{x:u.x,y:l.y}];if(d==="x"?h=s.x===f?C:x:h=s.y===f?x:C,t===r){const N=Math.abs(e[d]-n[d]);if(N<=o){const E=Math.min(o-1,o-N);s[d]===f?b[d]=(l[d]>e[d]?-1:1)*E:_[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const N=d==="x"?"y":"x",E=s[d]===a[N],P=l[N]>u[N],D=l[N]<u[N];(s[d]===1&&(!E&&P||E&&D)||s[d]!==1&&(!E&&D||E&&P))&&(h=d==="x"?x:C)}const A={x:l.x+b.x,y:l.y+b.y},T={x:u.x+_.x,y:u.y+_.y},k=Math.max(Math.abs(A.x-h[0].x),Math.abs(T.x-h[0].x)),L=Math.max(Math.abs(A.y-h[0].y),Math.abs(T.y-h[0].y));k>=L?(p=(A.x+T.x)/2,m=h[0].y):(p=h[0].x,m=(A.y+T.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...h,{x:u.x+_.x,y:u.y+_.y},n],p,m,v,S]}function Oge(e,t,n,r){const i=Math.min(s8(e,t)/2,s8(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*c}`}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 HC({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:o=Ye.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,d,f,h,p]=Rge({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:u});return[c.reduce((b,_,y)=>{let g="";return y>0&&y<c.length-1?g=Oge(c[y-1],_,c[y+1],s):g=`${y===0?"M":"L"}${_.x} ${_.y}`,b+=g,b},""),d,f,h,p]}const Mb=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=Ye.Bottom,targetPosition:f=Ye.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:b})=>{const[_,y,g]=HC({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 Z.jsx(Lm,{path:_,labelX:y,labelY:g,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:b})});Mb.displayName="SmoothStepEdge";const sT=M.memo(e=>{var t;return Z.jsx(Mb,{...e,pathOptions:M.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});sT.displayName="StepEdge";function Ige({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=BF({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const aT=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,m,b]=Ige({sourceX:e,sourceY:t,targetX:n,targetY:r});return Z.jsx(Lm,{path:p,labelX:m,labelY:b,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});aT.displayName="StraightEdge";function jy(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function a8({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case Ye.Left:return[t-jy(t-r,o),n];case Ye.Right:return[t+jy(r-t,o),n];case Ye.Top:return[t,n-jy(n-i,o)];case Ye.Bottom:return[t,n+jy(i-n,o)]}}function jF({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:o=Ye.Top,curvature:s=.25}){const[a,l]=a8({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,c]=a8({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,p]=zF({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${i}`,d,f,h,p]}const S1=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Ye.Bottom,targetPosition:o=Ye.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:b})=>{const[_,y,g]=jF({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return Z.jsx(Lm,{path:_,labelX:y,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:b})});S1.displayName="BezierEdge";const lT=M.createContext(null),Mge=lT.Provider;lT.Consumer;const Nge=()=>M.useContext(lT),Dge=e=>"id"in e&&"source"in e&&"target"in e,VF=e=>"id"in e&&!("source"in e)&&!("target"in e),Lge=(e,t,n)=>{if(!VF(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},$ge=(e,t,n)=>{if(!VF(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},Fge=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,qC=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Bge=(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)),GF=(e,t)=>{if(!e.source||!e.target)return t;let n;return Dge(e)?n={...e}:n={...e,id:Fge(e)},Bge(n,t)?t:t.concat(n)},HF=({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},zge=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),pf=(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}},uT=(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}=pf(i,t).positionAbsolute;return DF(r,$g({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 LF(n)},qF=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=c;if(s&&!h||p)return!1;const{positionAbsolute:m}=pf(c,a),b={x:m.x,y:m.y,width:d||0,height:f||0},_=VC(l,b),y=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&_>0,v=(d||0)*(f||0);(y||g||_>=v||c.dragging)&&u.push(c)}),u},cT=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},WF=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),l=Math.min(s,a),u=Hf(l,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},Qu=(e,t=0)=>e.transition().duration(t);function l8(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 Uge(e,t,n,r,i,o){const{x:s,y:a}=iu(e),u=t.elementsFromPoint(s,a).find(p=>p.classList.contains("react-flow__handle"));if(u){const p=u.getAttribute("data-nodeid");if(p){const m=dT(void 0,u),b=u.getAttribute("data-handleid"),_=o({nodeId:p,id:b,type:m});if(_)return{handle:{id:b,type:m,nodeId:p,x:n.x,y:n.y},validHandleResult:_}}}let c=[],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 b=o(p);m<=d&&(m<d?c=[{handle:p,validHandleResult:b}]:m===d&&c.push({handle:p,validHandleResult:b}),d=m)}}),!c.length)return{handle:null,validHandleResult:KF()};if(c.length===1)return c[0];const f=c.some(({validHandleResult:p})=>p.isValid),h=c.some(({handle:p})=>p.type==="target");return c.find(({handle:p,validHandleResult:m})=>h?p.type==="target":f?m.isValid:!0)||c[0]}const jge={source:null,target:null,sourceHandle:null,targetHandle:null},KF=()=>({handleDomNode:null,isValid:!1,connection:jge,endHandle:null});function XF(e,t,n,r,i,o,s){const a=i==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...KF(),handleDomNode:l};if(l){const c=dT(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};u.connection=m,h&&p&&(t===Nc.Strict?a&&c==="source"||!a&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=o(m))}return u}function Vge({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[zr]){const{handleBounds:s}=o[zr];let a=[],l=[];s&&(a=l8(o,s,"source",`${t}-${n}-${r}`),l=l8(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...l)}return i},[])}function dT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function hw(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Gge(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function QF({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=NF(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:b,getNodes:_,cancelConnection:y}=o();let g=0,v;const{x:S,y:w}=iu(e),x=c==null?void 0:c.elementFromPoint(S,w),C=dT(l,x),A=f==null?void 0:f.getBoundingClientRect();if(!A||!C)return;let T,k=iu(e,A),L=!1,N=null,E=!1,P=null;const D=Vge({nodes:_(),nodeId:n,handleId:t,handleType:C}),B=()=>{if(!h)return;const[I,F]=MF(k,A);b({x:I,y:F}),g=requestAnimationFrame(B)};s({connectionPosition:k,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:C,connectionStartHandle:{nodeId:n,handleId:t,type:C},connectionEndHandle:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:C});function R(I){const{transform:F}=o();k=iu(I,A);const{handle:U,validHandleResult:V}=Uge(I,c,HF(k,F,!1,[1,1]),p,D,H=>XF(H,d,n,t,i?"target":"source",a,c));if(v=U,L||(B(),L=!0),P=V.handleDomNode,N=V.connection,E=V.isValid,s({connectionPosition:v&&E?zge({x:v.x,y:v.y},F):k,connectionStatus:Gge(!!v,E),connectionEndHandle:V.endHandle}),!v&&!E&&!P)return hw(T);N.source!==N.target&&P&&(hw(T),T=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",E),P.classList.toggle("react-flow__handle-valid",E))}function O(I){var F,U;(v||P)&&N&&E&&(r==null||r(N)),(U=(F=o()).onConnectEnd)==null||U.call(F,I),l&&(u==null||u(I)),hw(T),y(),cancelAnimationFrame(g),L=!1,E=!1,N=null,P=null,c.removeEventListener("mousemove",R),c.removeEventListener("mouseup",O),c.removeEventListener("touchmove",R),c.removeEventListener("touchend",O)}c.addEventListener("mousemove",R),c.addEventListener("mouseup",O),c.addEventListener("touchmove",R),c.addEventListener("touchend",O)}const u8=()=>!0,Hge=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),qge=(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}},YF=M.forwardRef(({type:e="source",position:t=Ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var A,T;const p=s||null,m=e==="target",b=ii(),_=Nge(),{connectOnClick:y,noPanClassName:g}=fr(Hge,mo),{connecting:v,clickConnecting:S}=fr(qge(_,p,e),mo);_||(T=(A=b.getState()).onError)==null||T.call(A,"010",al.error010());const w=k=>{const{defaultEdgeOptions:L,onConnect:N,hasDefaultEdges:E}=b.getState(),P={...L,...k};if(E){const{edges:D,setEdges:B}=b.getState();B(GF(P,D))}N==null||N(P),a==null||a(P)},x=k=>{if(!_)return;const L=FF(k);i&&(L&&k.button===0||!L)&&QF({event:k,handleId:p,nodeId:_,onConnect:w,isTarget:m,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||u8}),L?c==null||c(k):d==null||d(k)},C=k=>{const{onClickConnectStart:L,onClickConnectEnd:N,connectionClickStartHandle:E,connectionMode:P,isValidConnection:D}=b.getState();if(!_||!E&&!i)return;if(!E){L==null||L(k,{nodeId:_,handleId:p,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,handleId:p}});return}const B=NF(k.target),R=n||D||u8,{connection:O,isValid:I}=XF({nodeId:_,id:p,type:e},P,E.nodeId,E.handleId||null,E.type,R,B);I&&w(O),N==null||N(k),b.setState({connectionClickStartHandle:null})};return Z.jsx("div",{"data-handleid":p,"data-nodeid":_,"data-handlepos":t,"data-id":`${_}-${p}-${e}`,className:ss(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!v||o&&v)}]),onMouseDown:x,onTouchStart:x,onClick:y?C:void 0,ref:h,...f,children:l})});YF.displayName="Handle";var w1=M.memo(YF);const ZF=({data:e,isConnectable:t,targetPosition:n=Ye.Top,sourcePosition:r=Ye.Bottom})=>Z.jsxs(Z.Fragment,{children:[Z.jsx(w1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,Z.jsx(w1,{type:"source",position:r,isConnectable:t})]});ZF.displayName="DefaultNode";var WC=M.memo(ZF);const JF=({data:e,isConnectable:t,sourcePosition:n=Ye.Bottom})=>Z.jsxs(Z.Fragment,{children:[e==null?void 0:e.label,Z.jsx(w1,{type:"source",position:n,isConnectable:t})]});JF.displayName="InputNode";var eB=M.memo(JF);const tB=({data:e,isConnectable:t,targetPosition:n=Ye.Top})=>Z.jsxs(Z.Fragment,{children:[Z.jsx(w1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});tB.displayName="OutputNode";var nB=M.memo(tB);const fT=()=>null;fT.displayName="GroupNode";const Wge=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Vy=e=>e.id;function Kge(e,t){return mo(e.selectedNodes.map(Vy),t.selectedNodes.map(Vy))&&mo(e.selectedEdges.map(Vy),t.selectedEdges.map(Vy))}const rB=M.memo(({onSelectionChange:e})=>{const t=ii(),{selectedNodes:n,selectedEdges:r}=fr(Wge,Kge);return M.useEffect(()=>{var o,s;const i={nodes:n,edges:r};e==null||e(i),(s=(o=t.getState()).onSelectionChange)==null||s.call(o,i)},[n,r,e]),null});rB.displayName="SelectionListener";const Xge=e=>!!e.onSelectionChange;function Qge({onSelectionChange:e}){const t=fr(Xge);return e||t?Z.jsx(rB,{onSelectionChange:e}):null}const Yge=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function md(e,t){M.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function At(e,t,n){M.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Zge=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:b,nodeExtent:_,onNodesChange:y,onEdgesChange:g,elementsSelectable:v,connectionMode:S,snapGrid:w,snapToGrid:x,translateExtent:C,connectOnClick:A,defaultEdgeOptions:T,fitView:k,fitViewOptions:L,onNodesDelete:N,onEdgesDelete:E,onNodeDrag:P,onNodeDragStart:D,onNodeDragStop:B,onSelectionDrag:R,onSelectionDragStart:O,onSelectionDragStop:I,noPanClassName:F,nodeOrigin:U,rfId:V,autoPanOnConnect:H,autoPanOnNodeDrag:Y,onError:Q,connectionRadius:j,isValidConnection:K})=>{const{setNodes:ee,setEdges:ie,setDefaultNodesAndEdges:ge,setMinZoom:ae,setMaxZoom:dt,setTranslateExtent:et,setNodeExtent:Ne,reset:lt}=fr(Yge,mo),Te=ii();return M.useEffect(()=>{const Ht=r==null?void 0:r.map(br=>({...br,...T}));return ge(n,Ht),()=>{lt()}},[]),At("defaultEdgeOptions",T,Te.setState),At("connectionMode",S,Te.setState),At("onConnect",i,Te.setState),At("onConnectStart",o,Te.setState),At("onConnectEnd",s,Te.setState),At("onClickConnectStart",a,Te.setState),At("onClickConnectEnd",l,Te.setState),At("nodesDraggable",u,Te.setState),At("nodesConnectable",c,Te.setState),At("nodesFocusable",d,Te.setState),At("edgesFocusable",f,Te.setState),At("edgesUpdatable",h,Te.setState),At("elementsSelectable",v,Te.setState),At("elevateNodesOnSelect",p,Te.setState),At("snapToGrid",x,Te.setState),At("snapGrid",w,Te.setState),At("onNodesChange",y,Te.setState),At("onEdgesChange",g,Te.setState),At("connectOnClick",A,Te.setState),At("fitViewOnInit",k,Te.setState),At("fitViewOnInitOptions",L,Te.setState),At("onNodesDelete",N,Te.setState),At("onEdgesDelete",E,Te.setState),At("onNodeDrag",P,Te.setState),At("onNodeDragStart",D,Te.setState),At("onNodeDragStop",B,Te.setState),At("onSelectionDrag",R,Te.setState),At("onSelectionDragStart",O,Te.setState),At("onSelectionDragStop",I,Te.setState),At("noPanClassName",F,Te.setState),At("nodeOrigin",U,Te.setState),At("rfId",V,Te.setState),At("autoPanOnConnect",H,Te.setState),At("autoPanOnNodeDrag",Y,Te.setState),At("onError",Q,Te.setState),At("connectionRadius",j,Te.setState),At("isValidConnection",K,Te.setState),md(e,ee),md(t,ie),md(m,ae),md(b,dt),md(C,et),md(_,Ne),null},c8={display:"none"},Jge={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},iB="react-flow__node-desc",oB="react-flow__edge-desc",eme="react-flow__aria-live",tme=e=>e.ariaLiveMessage;function nme({rfId:e}){const t=fr(tme);return Z.jsx("div",{id:`${eme}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Jge,children:t})}function rme({rfId:e,disableKeyboardA11y:t}){return Z.jsxs(Z.Fragment,{children:[Z.jsxs("div",{id:`${iB}-${e}`,style:c8,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),Z.jsx("div",{id:`${oB}-${e}`,style:c8,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&Z.jsx(nme,{rfId:e})]})}const ime=typeof document<"u"?document:null;var Fg=(e=null,t={target:ime})=>{const[n,r]=M.useState(!1),i=M.useRef(!1),o=M.useRef(new Set([])),[s,a]=M.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return M.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,!i.current&&GC(h))return!1;const p=f8(h.code,a);o.current.add(h[p]),d8(s,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!i.current&&GC(h))return!1;const p=f8(h.code,a);d8(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,p;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(p=t==null?void 0:t.target)==null||p.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function d8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function f8(e,t){return t.includes(e)?"code":"key"}function sB(e,t,n,r){var s,a;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=pf(i,r);return sB(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((s=i[zr])==null?void 0:s.z)??0)>(n.z??0)?((a=i[zr])==null?void 0:a.z)??0:n.z??0},r)}function aB(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}=sB(r,e,{...r.position,z:((i=r[zr])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:s},r[zr].z=a,n!=null&&n[r.id]&&(r[zr].isParent=!0)}})}function pw(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(Yo(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(c.parentNode=a.parentNode,o[a.parentNode]=!0),Object.defineProperty(c,zr,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[zr])==null?void 0:d.handleBounds,z:l}}),i.set(a.id,c)}),aB(i,n,o),i}function lB(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(a&&l&&(f||!t.initial)){const p=n().filter(b=>{var y;const _=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(y=t.nodes)!=null&&y.length?_&&t.nodes.some(g=>g.id===b.id):_}),m=p.every(b=>b.width&&b.height);if(p.length>0&&m){const b=uT(p,d),[_,y,g]=WF(b,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),v=ru.translate(_,y).scale(g);return typeof t.duration=="number"&&t.duration>0?a.transform(Qu(l,t.duration),v):a.transform(l,v),!0}}return!1}function ome(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[zr]:r[zr],selected:n.selected})}),new Map(t)}function sme(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Gy({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:ome(e,i)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:sme(t,o)}),a==null||a(t))}const yd=()=>{},ame={zoomIn:yd,zoomOut:yd,zoomTo:yd,getZoom:()=>1,setViewport:yd,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:yd,fitBounds:yd,project:e=>e,viewportInitialized:!1},lme=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),ume=()=>{const e=ii(),{d3Zoom:t,d3Selection:n}=fr(lme,mo);return M.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Qu(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Qu(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Qu(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,l]=e.getState().transform,u=ru.translate(i.x??s,i.y??a).scale(i.zoom??l);t.transform(Qu(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>lB(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,d=a/2-i*c,f=l/2-o*c,h=ru.translate(d,f).scale(c);t.transform(Qu(n,s==null?void 0:s.duration),h)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=WF(i,s,a,l,u,(o==null?void 0:o.padding)??.1),h=ru.translate(c,d).scale(f);t.transform(Qu(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return HF(i,o,s,a)},viewportInitialized:!0}:ame,[t,n])};function uB(){const e=ume(),t=ii(),n=M.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=M.useCallback(m=>t.getState().nodeInternals.get(m),[]),i=M.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(b=>({...b}))},[]),o=M.useCallback(m=>{const{edges:b=[]}=t.getState();return b.find(_=>_.id===m)},[]),s=M.useCallback(m=>{const{getNodes:b,setNodes:_,hasDefaultNodes:y,onNodesChange:g}=t.getState(),v=b(),S=typeof m=="function"?m(v):m;if(y)_(S);else if(g){const w=S.length===0?v.map(x=>({type:"remove",id:x.id})):S.map(x=>({item:x,type:"reset"}));g(w)}},[]),a=M.useCallback(m=>{const{edges:b=[],setEdges:_,hasDefaultEdges:y,onEdgesChange:g}=t.getState(),v=typeof m=="function"?m(b):m;if(y)_(v);else if(g){const S=v.length===0?b.map(w=>({type:"remove",id:w.id})):v.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=M.useCallback(m=>{const b=Array.isArray(m)?m:[m],{getNodes:_,setNodes:y,hasDefaultNodes:g,onNodesChange:v}=t.getState();if(g){const w=[..._(),...b];y(w)}else if(v){const S=b.map(w=>({item:w,type:"add"}));v(S)}},[]),u=M.useCallback(m=>{const b=Array.isArray(m)?m:[m],{edges:_=[],setEdges:y,hasDefaultEdges:g,onEdgesChange:v}=t.getState();if(g)y([..._,...b]);else if(v){const S=b.map(w=>({item:w,type:"add"}));v(S)}},[]),c=M.useCallback(()=>{const{getNodes:m,edges:b=[],transform:_}=t.getState(),[y,g,v]=_;return{nodes:m().map(S=>({...S})),edges:b.map(S=>({...S})),viewport:{x:y,y:g,zoom:v}}},[]),d=M.useCallback(({nodes:m,edges:b})=>{const{nodeInternals:_,getNodes:y,edges:g,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:x,onNodesChange:C,onEdgesChange:A}=t.getState(),T=(m||[]).map(P=>P.id),k=(b||[]).map(P=>P.id),L=y().reduce((P,D)=>{const B=!T.includes(D.id)&&D.parentNode&&P.find(O=>O.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(T.includes(D.id)||B)&&P.push(D),P},[]),N=g.filter(P=>typeof P.deletable=="boolean"?P.deletable:!0),E=N.filter(P=>k.includes(P.id));if(L||E){const P=cT(L,N),D=[...E,...P],B=D.reduce((R,O)=>(R.includes(O.id)||R.push(O.id),R),[]);if((S||v)&&(S&&t.setState({edges:g.filter(R=>!B.includes(R.id))}),v&&(L.forEach(R=>{_.delete(R.id)}),t.setState({nodeInternals:new Map(_)}))),B.length>0&&(x==null||x(D),A&&A(B.map(R=>({id:R,type:"remove"})))),L.length>0&&(w==null||w(L),C)){const R=L.map(O=>({id:O.id,type:"remove"}));C(R)}}},[]),f=M.useCallback(m=>{const b=Tge(m),_=b?null:t.getState().nodeInternals.get(m.id);return[b?m:r8(_),_,b]},[]),h=M.useCallback((m,b=!0,_)=>{const[y,g,v]=f(m);return y?(_||t.getState().getNodes()).filter(S=>{if(!v&&(S.id===g.id||!S.positionAbsolute))return!1;const w=r8(S),x=VC(w,y);return b&&x>0||x>=m.width*m.height}):[]},[]),p=M.useCallback((m,b,_=!0)=>{const[y]=f(m);if(!y)return!1;const g=VC(y,b);return _&&g>0||g>=m.width*m.height},[]);return M.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,s,a,l,u,c,d,h,p])}var cme=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ii(),{deleteElements:r}=uB(),i=Fg(e),o=Fg(t);M.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),l=a().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),M.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function dme(e){const t=ii();M.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=rT(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",al.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 hT={position:"absolute",width:"100%",height:"100%",top:0,left:0},fme=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Hy=e=>({x:e.x,y:e.y,zoom:e.k}),vd=(e,t)=>e.target.closest(`.${t}`),h8=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),p8=e=>{const t=e.ctrlKey&&_1()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},hme=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),pme=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=cc.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:b,preventScrolling:_=!0,children:y,noWheelClassName:g,noPanClassName:v})=>{const S=M.useRef(),w=ii(),x=M.useRef(!1),C=M.useRef(!1),A=M.useRef(null),T=M.useRef({x:0,y:0,zoom:0}),{d3Zoom:k,d3Selection:L,d3ZoomHandler:N,userSelectionActive:E}=fr(hme,mo),P=Fg(b),D=M.useRef(0),B=M.useRef(!1),R=M.useRef();return dme(A),M.useEffect(()=>{if(A.current){const O=A.current.getBoundingClientRect(),I=_ge().scaleExtent([p,m]).translateExtent(h),F=xs(A.current).call(I),U=ru.translate(f.x,f.y).scale(Hf(f.zoom,p,m)),V=[[0,0],[O.width,O.height]],H=I.constrain()(U,V,h);I.transform(F,H),I.wheelDelta(p8),w.setState({d3Zoom:I,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[H.x,H.y,H.k],domNode:A.current.closest(".react-flow")})}},[]),M.useEffect(()=>{L&&k&&(s&&!P&&!E?L.on("wheel.zoom",O=>{if(vd(O,g))return!1;O.preventDefault(),O.stopImmediatePropagation();const I=L.property("__zoom").k||1,F=_1();if(O.ctrlKey&&o&&F){const ee=Xs(O),ie=p8(O),ge=I*Math.pow(2,ie);k.scaleTo(L,ge,ee,O);return}const U=O.deltaMode===1?20:1;let V=l===cc.Vertical?0:O.deltaX*U,H=l===cc.Horizontal?0:O.deltaY*U;!F&&O.shiftKey&&l!==cc.Vertical&&(V=O.deltaY*U,H=0),k.translateBy(L,-(V/I)*a,-(H/I)*a,{internal:!0});const Y=Hy(L.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:j,onViewportChangeEnd:K}=w.getState();clearTimeout(R.current),B.current||(B.current=!0,t==null||t(O,Y),Q==null||Q(Y)),B.current&&(e==null||e(O,Y),j==null||j(Y),R.current=setTimeout(()=>{n==null||n(O,Y),K==null||K(Y),B.current=!1},150))},{passive:!1}):typeof N<"u"&&L.on("wheel.zoom",function(O,I){if(!_||vd(O,g))return null;O.preventDefault(),N.call(this,O,I)},{passive:!1}))},[E,s,l,L,k,N,P,o,_,g,t,e,n]),M.useEffect(()=>{k&&k.on("start",O=>{var U,V;if(!O.sourceEvent||O.sourceEvent.internal)return null;D.current=(U=O.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:I}=w.getState(),F=Hy(O.transform);x.current=!0,T.current=F,((V=O.sourceEvent)==null?void 0:V.type)==="mousedown"&&w.setState({paneDragging:!0}),I==null||I(F),t==null||t(O.sourceEvent,F)})},[k,t]),M.useEffect(()=>{k&&(E&&!x.current?k.on("zoom",null):E||k.on("zoom",O=>{var F;const{onViewportChange:I}=w.getState();if(w.setState({transform:[O.transform.x,O.transform.y,O.transform.k]}),C.current=!!(r&&h8(d,D.current??0)),(e||I)&&!((F=O.sourceEvent)!=null&&F.internal)){const U=Hy(O.transform);I==null||I(U),e==null||e(O.sourceEvent,U)}}))},[E,k,e,d,r]),M.useEffect(()=>{k&&k.on("end",O=>{if(!O.sourceEvent||O.sourceEvent.internal)return null;const{onViewportChangeEnd:I}=w.getState();if(x.current=!1,w.setState({paneDragging:!1}),r&&h8(d,D.current??0)&&!C.current&&r(O.sourceEvent),C.current=!1,(n||I)&&fme(T.current,O.transform)){const F=Hy(O.transform);T.current=F,clearTimeout(S.current),S.current=setTimeout(()=>{I==null||I(F),n==null||n(O.sourceEvent,F)},s?150:0)}})},[k,s,d,n,r]),M.useEffect(()=>{k&&k.filter(O=>{const I=P||i,F=o&&O.ctrlKey;if(O.button===1&&O.type==="mousedown"&&(vd(O,"react-flow__node")||vd(O,"react-flow__edge")))return!0;if(!d&&!I&&!s&&!u&&!o||E||!u&&O.type==="dblclick"||vd(O,g)&&O.type==="wheel"||vd(O,v)&&O.type!=="wheel"||!o&&O.ctrlKey&&O.type==="wheel"||!I&&!s&&!F&&O.type==="wheel"||!d&&(O.type==="mousedown"||O.type==="touchstart")||Array.isArray(d)&&!d.includes(O.button)&&(O.type==="mousedown"||O.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(O.button)||!O.button||O.button<=1;return(!O.ctrlKey||O.type==="wheel")&&U})},[E,k,i,o,s,u,d,c,P]),Z.jsx("div",{className:"react-flow__renderer",ref:A,style:hT,children:y})},gme=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function mme(){const{userSelectionActive:e,userSelectionRect:t}=fr(gme,mo);return e&&t?Z.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function g8(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 cB(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&&g8(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&&g8(r,s);break}case"remove":return r}return r.push(s),r},n)}function Yu(e,t){return cB(e,t)}function Uu(e,t){return cB(e,t)}const Rl=(e,t)=>({id:e,type:"select",selected:t});function Gd(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Rl(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Rl(r.id,!1))),n},[])}const gw=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},yme=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),dB=M.memo(({isSelecting:e,selectionMode:t=vu.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=M.useRef(null),h=ii(),p=M.useRef(0),m=M.useRef(0),b=M.useRef(),{userSelectionActive:_,elementsSelectable:y,dragging:g}=fr(yme,mo),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},S=N=>{o==null||o(N),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=N=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){N.preventDefault();return}s==null||s(N)},x=a?N=>a(N):void 0,C=N=>{const{resetSelectedElements:E,domNode:P}=h.getState();if(b.current=P==null?void 0:P.getBoundingClientRect(),!y||!e||N.button!==0||N.target!==f.current||!b.current)return;const{x:D,y:B}=iu(N,b.current);E(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:B,x:D,y:B}}),r==null||r(N)},A=N=>{const{userSelectionRect:E,nodeInternals:P,edges:D,transform:B,onNodesChange:R,onEdgesChange:O,nodeOrigin:I,getNodes:F}=h.getState();if(!e||!b.current||!E)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=iu(N,b.current),V=E.startX??0,H=E.startY??0,Y={...E,x:U.x<V?U.x:V,y:U.y<H?U.y:H,width:Math.abs(U.x-V),height:Math.abs(U.y-H)},Q=F(),j=qF(P,Y,B,t===vu.Partial,!0,I),K=cT(j,D).map(ie=>ie.id),ee=j.map(ie=>ie.id);if(p.current!==ee.length){p.current=ee.length;const ie=Gd(Q,ee);ie.length&&(R==null||R(ie))}if(m.current!==K.length){m.current=K.length;const ie=Gd(D,K);ie.length&&(O==null||O(ie))}h.setState({userSelectionRect:Y})},T=N=>{if(N.button!==0)return;const{userSelectionRect:E}=h.getState();!_&&E&&N.target===f.current&&(S==null||S(N)),h.setState({nodesSelectionActive:p.current>0}),v(),i==null||i(N)},k=N=>{_&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(N)),v()},L=y&&(e||_);return Z.jsxs("div",{className:ss(["react-flow__pane",{dragging:g,selection:e}]),onClick:L?void 0:gw(S,f),onContextMenu:gw(w,f),onWheel:gw(x,f),onMouseEnter:L?void 0:l,onMouseDown:L?C:void 0,onMouseMove:L?A:u,onMouseUp:L?T:void 0,onMouseLeave:L?k:c,ref:f,style:hT,children:[d,Z.jsx(mme,{})]})});dB.displayName="Pane";function fB(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:fB(n,t):!1}function m8(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 vme(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!fB(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height}})}function _me(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function hB(e,t,n,r,i=[0,0],o){const s=_me(e,e.extent||r);let a=s;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const c=n.get(e.parentNode),{x:d,y:f}=pf(c,i).positionAbsolute;a=c&&Yo(d)&&Yo(f)&&Yo(c.width)&&Yo(c.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+c.width-e.width+e.width*i[0],f+c.height-e.height+e.height*i[1]]]:a}else o==null||o("005",al.error005()),a=s;else if(e.extent&&e.parentNode){const c=n.get(e.parentNode),{x:d,y:f}=pf(c,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 c=n.get(e.parentNode);l=pf(c,i).positionAbsolute}const u=a&&a!=="parent"?iT(t,a):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function mw({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 y8=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...rT(l)}})};function Bh(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function KC({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",al.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(o({nodes:[u]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function bme(){const e=ii();return M.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 yw(e){return(t,n,r)=>e==null?void 0:e(t,r)}function pB({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=ii(),[l,u]=M.useState(!1),c=M.useRef([]),d=M.useRef({x:null,y:null}),f=M.useRef(0),h=M.useRef(null),p=M.useRef({x:0,y:0}),m=M.useRef(null),b=M.useRef(!1),_=bme();return M.useEffect(()=>{if(e!=null&&e.current){const y=xs(e.current),g=({x:S,y:w})=>{const{nodeInternals:x,onNodeDrag:C,onSelectionDrag:A,updateNodePositions:T,nodeExtent:k,snapGrid:L,snapToGrid:N,nodeOrigin:E,onError:P}=a.getState();d.current={x:S,y:w};let D=!1,B={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&k){const O=uT(c.current,E);B=$g(O)}if(c.current=c.current.map(O=>{const I={x:S-O.distance.x,y:w-O.distance.y};N&&(I.x=L[0]*Math.round(I.x/L[0]),I.y=L[1]*Math.round(I.y/L[1]));const F=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];c.current.length>1&&k&&!O.extent&&(F[0][0]=O.positionAbsolute.x-B.x+k[0][0],F[1][0]=O.positionAbsolute.x+(O.width??0)-B.x2+k[1][0],F[0][1]=O.positionAbsolute.y-B.y+k[0][1],F[1][1]=O.positionAbsolute.y+(O.height??0)-B.y2+k[1][1]);const U=hB(O,I,x,F,E,P);return D=D||O.position.x!==U.position.x||O.position.y!==U.position.y,O.position=U.position,O.positionAbsolute=U.positionAbsolute,O}),!D)return;T(c.current,!0,!0),u(!0);const R=i?C:yw(A);if(R&&m.current){const[O,I]=mw({nodeId:i,dragItems:c.current,nodeInternals:x});R(m.current,O,I)}},v=()=>{if(!h.current)return;const[S,w]=MF(p.current,h.current);if(S!==0||w!==0){const{transform:x,panBy:C}=a.getState();d.current.x=(d.current.x??0)-S/x[2],d.current.y=(d.current.y??0)-w/x[2],C({x:S,y:w})&&g(d.current)}f.current=requestAnimationFrame(v)};if(t)y.on(".drag",null);else{const S=Phe().on("start",w=>{var D;const{nodeInternals:x,multiSelectionActive:C,domNode:A,nodesDraggable:T,unselectNodesAndEdges:k,onNodeDragStart:L,onSelectionDragStart:N}=a.getState(),E=i?L:yw(N);!s&&!C&&i&&((D=x.get(i))!=null&&D.selected||k()),i&&o&&s&&KC({id:i,store:a,nodeRef:e});const P=_(w);if(d.current=P,c.current=vme(x,T,P,i),E&&c.current){const[B,R]=mw({nodeId:i,dragItems:c.current,nodeInternals:x});E(w.sourceEvent,B,R)}h.current=(A==null?void 0:A.getBoundingClientRect())||null,p.current=iu(w.sourceEvent,h.current)}).on("drag",w=>{const x=_(w),{autoPanOnNodeDrag:C}=a.getState();!b.current&&C&&(b.current=!0,v()),(d.current.x!==x.xSnapped||d.current.y!==x.ySnapped)&&c.current&&(m.current=w.sourceEvent,p.current=iu(w.sourceEvent,h.current),g(x))}).on("end",w=>{if(u(!1),b.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:x,nodeInternals:C,onNodeDragStop:A,onSelectionDragStop:T}=a.getState(),k=i?A:yw(T);if(x(c.current,!1,!1),k){const[L,N]=mw({nodeId:i,dragItems:c.current,nodeInternals:C});k(w.sourceEvent,L,N)}}}).filter(w=>{const x=w.target;return!w.button&&(!n||!m8(x,`.${n}`,e))&&(!r||m8(x,r,e))});return y.call(S),()=>{y.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,_]),l}function gB(){const e=ii();return M.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=s().filter(y=>y.selected&&(y.draggable||c&&typeof y.draggable>"u")),f=a?l[0]:5,h=a?l[1]:5,p=n.isShiftPressed?4:1,m=n.x*f*p,b=n.y*h*p,_=d.map(y=>{if(y.positionAbsolute){const g={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+b};a&&(g.x=l[0]*Math.round(g.x/l[0]),g.y=l[1]*Math.round(g.y/l[1]));const{positionAbsolute:v,position:S}=hB(y,g,r,i,void 0,u);y.position=S,y.positionAbsolute=v}return y});o(_,!0,!1)},[])}const gf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var zh=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:b,className:_,isDraggable:y,isSelectable:g,isConnectable:v,isFocusable:S,selectNodesOnDrag:w,sourcePosition:x,targetPosition:C,hidden:A,resizeObserver:T,dragHandle:k,zIndex:L,isParent:N,noDragClassName:E,noPanClassName:P,initialized:D,disableKeyboardA11y:B,ariaLabel:R,rfId:O})=>{const I=ii(),F=M.useRef(null),U=M.useRef(x),V=M.useRef(C),H=M.useRef(r),Y=g||y||c||d||f||h,Q=gB(),j=Bh(n,I.getState,d),K=Bh(n,I.getState,f),ee=Bh(n,I.getState,h),ie=Bh(n,I.getState,p),ge=Bh(n,I.getState,m),ae=Ne=>{if(g&&(!w||!y)&&KC({id:n,store:I,nodeRef:F}),c){const lt=I.getState().nodeInternals.get(n);lt&&c(Ne,{...lt})}},dt=Ne=>{if(!GC(Ne))if($F.includes(Ne.key)&&g){const lt=Ne.key==="Escape";KC({id:n,store:I,unselect:lt,nodeRef:F})}else!B&&y&&u&&Object.prototype.hasOwnProperty.call(gf,Ne.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${Ne.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),Q({x:gf[Ne.key].x,y:gf[Ne.key].y,isShiftPressed:Ne.shiftKey}))};M.useEffect(()=>{if(F.current&&!A){const Ne=F.current;return T==null||T.observe(Ne),()=>T==null?void 0:T.unobserve(Ne)}},[A]),M.useEffect(()=>{const Ne=H.current!==r,lt=U.current!==x,Te=V.current!==C;F.current&&(Ne||lt||Te)&&(Ne&&(H.current=r),lt&&(U.current=x),Te&&(V.current=C),I.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,x,C]);const et=pB({nodeRef:F,disabled:A||!y,noDragClassName:E,handleSelector:k,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return A?null:Z.jsx("div",{className:ss(["react-flow__node",`react-flow__node-${r}`,{[P]:y},_,{selected:u,selectable:g,parent:N,dragging:et}]),ref:F,style:{zIndex:L,transform:`translate(${a}px,${l}px)`,pointerEvents:Y?"all":"none",visibility:D?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:K,onMouseLeave:ee,onContextMenu:ie,onClick:ae,onDoubleClick:ge,onKeyDown:S?dt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":B?void 0:`${iB}-${O}`,"aria-label":R,children:Z.jsx(Mge,{value:n,children:Z.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:u,isConnectable:v,sourcePosition:x,targetPosition:C,dragging:et,dragHandle:k,zIndex:L})})})};return t.displayName="NodeWrapper",M.memo(t)};const Sme=e=>{const t=e.getNodes().filter(n=>n.selected);return{...uT(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function wme({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ii(),{width:i,height:o,x:s,y:a,transformString:l,userSelectionActive:u}=fr(Sme,mo),c=gB(),d=M.useRef(null);if(M.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),pB({nodeRef:d}),u||!i||!o)return null;const f=e?p=>{const m=r.getState().getNodes().filter(b=>b.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(gf,p.key)&&c({x:gf[p.key].x,y:gf[p.key].y,isShiftPressed:p.shiftKey})};return Z.jsx("div",{className:ss(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:Z.jsx("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 xme=M.memo(wme);const Cme=e=>e.nodesSelectionActive,mB=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:b,panActivationKeyCode:_,zoomActivationKeyCode:y,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:A,panOnDrag:T,defaultViewport:k,translateExtent:L,minZoom:N,maxZoom:E,preventScrolling:P,onSelectionContextMenu:D,noWheelClassName:B,noPanClassName:R,disableKeyboardA11y:O})=>{const I=fr(Cme),F=Fg(d),V=Fg(_)||T,H=F||f&&V!==!0;return cme({deleteKeyCode:a,multiSelectionKeyCode:b}),Z.jsx(pme,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:A,panOnDrag:!F&&V,defaultViewport:k,translateExtent:L,minZoom:N,maxZoom:E,zoomActivationKeyCode:y,preventScrolling:P,noWheelClassName:B,noPanClassName:R,children:Z.jsxs(dB,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:V,isSelecting:!!H,selectionMode:h,children:[e,I&&Z.jsx(xme,{onSelectionContextMenu:D,noPanClassName:R,disableKeyboardA11y:O})]})})};mB.displayName="FlowRenderer";var Eme=M.memo(mB);function Tme(e){return fr(M.useCallback(n=>e?qF(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Ame(e){const t={input:zh(e.input||eB),default:zh(e.default||WC),output:zh(e.output||nB),group:zh(e.group||fT)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=zh(e[o]||WC),i),n);return{...t,...r}}const kme=({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]},Pme=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),yB=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=fr(Pme,mo),a=Tme(e.onlyRenderVisibleElements),l=M.useRef(),u=M.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=c,c},[]);return M.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),Z.jsx("div",{className:"react-flow__nodes",style:hT,children:a.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",al.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),p=!!(c.selectable||i&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),b=!!(c.focusable||r&&typeof c.focusable>"u"),_=e.nodeExtent?iT(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,y=(_==null?void 0:_.x)??0,g=(_==null?void 0:_.y)??0,v=kme({x:y,y:g,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return Z.jsx(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Ye.Bottom,targetPosition:c.targetPosition||Ye.Top,hidden:c.hidden,xPos:y,yPos:g,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:p,isConnectable:m,isFocusable:b,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((S=c[zr])==null?void 0:S.z)??0,isParent:!!((w=c[zr])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};yB.displayName="NodeRenderer";var Rme=M.memo(yB);const Ome=(e,t,n)=>n===Ye.Left?e-t:n===Ye.Right?e+t:e,Ime=(e,t,n)=>n===Ye.Top?e-t:n===Ye.Bottom?e+t:e,v8="react-flow__edgeupdater",_8=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>Z.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:ss([v8,`${v8}-${a}`]),cx:Ome(t,r,e),cy:Ime(n,r,e),r,stroke:"transparent",fill:"transparent"}),Mme=()=>!0;var _d=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:b,source:_,target:y,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,elementsSelectable:A,hidden:T,sourceHandleId:k,targetHandleId:L,onContextMenu:N,onMouseEnter:E,onMouseMove:P,onMouseLeave:D,edgeUpdaterRadius:B,onEdgeUpdate:R,onEdgeUpdateStart:O,onEdgeUpdateEnd:I,markerEnd:F,markerStart:U,rfId:V,ariaLabel:H,isFocusable:Y,isUpdatable:Q,pathOptions:j,interactionWidth:K})=>{const ee=M.useRef(null),[ie,ge]=M.useState(!1),[ae,dt]=M.useState(!1),et=ii(),Ne=M.useMemo(()=>`url(#${qC(U,V)})`,[U,V]),lt=M.useMemo(()=>`url(#${qC(F,V)})`,[F,V]);if(T)return null;const Te=Pn=>{const{edges:cn,addSelectedEdges:xi}=et.getState();if(A&&(et.setState({nodesSelectionActive:!1}),xi([n])),s){const oi=cn.find(Ui=>Ui.id===n);s(Pn,oi)}},Ht=Fh(n,et.getState,a),br=Fh(n,et.getState,N),An=Fh(n,et.getState,E),_n=Fh(n,et.getState,P),qt=Fh(n,et.getState,D),kn=(Pn,cn)=>{if(Pn.button!==0)return;const{edges:xi,isValidConnection:oi}=et.getState(),Ui=cn?y:_,fs=(cn?L:k)||null,wr=cn?"target":"source",to=oi||Mme,Ca=cn,_o=xi.find(Wt=>Wt.id===n);dt(!0),O==null||O(Pn,_o,wr);const Ea=Wt=>{dt(!1),I==null||I(Wt,_o,wr)};QF({event:Pn,handleId:fs,nodeId:Ui,onConnect:Wt=>R==null?void 0:R(_o,Wt),isTarget:Ca,getState:et.getState,setState:et.setState,isValidConnection:to,edgeUpdaterType:wr,onEdgeUpdateEnd:Ea})},Sr=Pn=>kn(Pn,!0),eo=Pn=>kn(Pn,!1),Vr=()=>ge(!0),sr=()=>ge(!1),Or=!A&&!s,Gr=Pn=>{var cn;if($F.includes(Pn.key)&&A){const{unselectNodesAndEdges:xi,addSelectedEdges:oi,edges:Ui}=et.getState();Pn.key==="Escape"?((cn=ee.current)==null||cn.blur(),xi({edges:[Ui.find(wr=>wr.id===n)]})):oi([n])}};return Z.jsxs("g",{className:ss(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:Or,updating:ie}]),onClick:Te,onDoubleClick:Ht,onContextMenu:br,onMouseEnter:An,onMouseMove:_n,onMouseLeave:qt,onKeyDown:Y?Gr:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":H===null?void 0:H||`Edge from ${_} to ${y}`,"aria-describedby":Y?`${oB}-${V}`:void 0,ref:ee,children:[!ae&&Z.jsx(e,{id:n,source:_,target:y,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:b,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,sourceHandleId:k,targetHandleId:L,markerStart:Ne,markerEnd:lt,pathOptions:j,interactionWidth:K}),Q&&Z.jsxs(Z.Fragment,{children:[(Q==="source"||Q===!0)&&Z.jsx(_8,{position:x,centerX:g,centerY:v,radius:B,onMouseDown:Sr,onMouseEnter:Vr,onMouseOut:sr,type:"source"}),(Q==="target"||Q===!0)&&Z.jsx(_8,{position:C,centerX:S,centerY:w,radius:B,onMouseDown:eo,onMouseEnter:Vr,onMouseOut:sr,type:"target"})]})]})};return t.displayName="EdgeWrapper",M.memo(t)};function Nme(e){const t={default:_d(e.default||S1),straight:_d(e.bezier||aT),step:_d(e.step||sT),smoothstep:_d(e.step||Mb),simplebezier:_d(e.simplebezier||oT)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=_d(e[o]||S1),i),n);return{...t,...r}}function b8(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 Ye.Top:return{x:r+o/2,y:i};case Ye.Right:return{x:r+o,y:i+s/2};case Ye.Bottom:return{x:r+o/2,y:i+s};case Ye.Left:return{x:r,y:i+s/2}}}function S8(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Dme=(e,t,n,r,i,o)=>{const s=b8(n,e,t),a=b8(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Lme({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:s,height:a,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=$g({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function w8(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[zr])==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 $me=[{level:0,isMaxLevel:!0,edges:[]}];function Fme(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var c,d;const l=Yo(a.zIndex);let u=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(((c=h==null?void 0:h[zr])==null?void 0:c.z)||0,((d=f==null?void 0:f[zr])==null?void 0:d.z)||0,1e3);u=(l?a.zIndex:0)+(p?m:0)}return s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),o=Object.entries(i).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return o.length===0?$me:o}function Bme(e,t,n){const r=fr(M.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)&&Lme({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 Fme(r,t,n)}const zme=({color:e="none",strokeWidth:t=1})=>Z.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),Ume=({color:e="none",strokeWidth:t=1})=>Z.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),x8={[b1.Arrow]:zme,[b1.ArrowClosed]:Ume};function jme(e){const t=ii();return M.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(x8,e)?x8[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",al.error009(e)),null)},[e])}const Vme=({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=jme(t);return l?Z.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:Z.jsx(l,{color:n,strokeWidth:s})}):null},Gme=({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=qC(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))},vB=({defaultColor:e,rfId:t})=>{const n=fr(M.useCallback(Gme({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return Z.jsx("defs",{children:n.map(r=>Z.jsx(Vme,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};vB.displayName="MarkerDefinitions";var Hme=M.memo(vB);const qme=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}),_B=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,children:b})=>{const{edgesFocusable:_,edgesUpdatable:y,elementsSelectable:g,width:v,height:S,connectionMode:w,nodeInternals:x,onError:C}=fr(qme,mo),A=Bme(t,x,n);return v?Z.jsxs(Z.Fragment,{children:[A.map(({level:T,edges:k,isMaxLevel:L})=>Z.jsxs("svg",{style:{zIndex:T},width:v,height:S,className:"react-flow__edges react-flow__container",children:[L&&Z.jsx(Hme,{defaultColor:e,rfId:r}),Z.jsx("g",{children:k.map(N=>{const[E,P,D]=w8(x.get(N.source)),[B,R,O]=w8(x.get(N.target));if(!D||!O)return null;let I=N.type||"default";i[I]||(C==null||C("011",al.error011(I)),I="default");const F=i[I]||i.default,U=w===Nc.Strict?R.target:(R.target??[]).concat(R.source??[]),V=S8(P.source,N.sourceHandle),H=S8(U,N.targetHandle),Y=(V==null?void 0:V.position)||Ye.Bottom,Q=(H==null?void 0:H.position)||Ye.Top,j=!!(N.focusable||_&&typeof N.focusable>"u"),K=typeof s<"u"&&(N.updatable||y&&typeof N.updatable>"u");if(!V||!H)return C==null||C("008",al.error008(V,N)),null;const{sourceX:ee,sourceY:ie,targetX:ge,targetY:ae}=Dme(E,V,Y,B,H,Q);return Z.jsx(F,{id:N.id,className:ss([N.className,o]),type:I,data:N.data,selected:!!N.selected,animated:!!N.animated,hidden:!!N.hidden,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,style:N.style,source:N.source,target:N.target,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerEnd:N.markerEnd,markerStart:N.markerStart,sourceX:ee,sourceY:ie,targetX:ge,targetY:ae,sourcePosition:Y,targetPosition:Q,elementsSelectable:g,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,rfId:r,ariaLabel:N.ariaLabel,isFocusable:j,isUpdatable:K,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth},N.id)})})]},T)),b]}):null};_B.displayName="EdgeRenderer";var Wme=M.memo(_B);const Kme=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Xme({children:e}){const t=fr(Kme);return Z.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function Qme(e){const t=uB(),n=M.useRef(!1);M.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Yme={[Ye.Left]:Ye.Right,[Ye.Right]:Ye.Left,[Ye.Top]:Ye.Bottom,[Ye.Bottom]:Ye.Top},bB=({nodeId:e,handleType:t,style:n,type:r=$l.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,x,C;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=fr(M.useCallback(A=>({fromNode:A.nodeInternals.get(e),handleId:A.connectionHandleId,toX:(A.connectionPosition.x-A.transform[0])/A.transform[2],toY:(A.connectionPosition.y-A.transform[1])/A.transform[2],connectionMode:A.connectionMode}),[e]),mo),d=(w=s==null?void 0:s[zr])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===Nc.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const h=a?f.find(A=>A.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,b=(((x=s.positionAbsolute)==null?void 0:x.x)??0)+p,_=(((C=s.positionAbsolute)==null?void 0:C.y)??0)+m,y=h==null?void 0:h.position,g=y?Yme[y]:null;if(!y||!g)return null;if(i)return Z.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:b,fromY:_,toX:l,toY:u,fromPosition:y,toPosition:g,connectionStatus:o});let v="";const S={sourceX:b,sourceY:_,sourcePosition:y,targetX:l,targetY:u,targetPosition:g};return r===$l.Bezier?[v]=jF(S):r===$l.Step?[v]=HC({...S,borderRadius:0}):r===$l.SmoothStep?[v]=HC(S):r===$l.SimpleBezier?[v]=UF(S):v=`M${b},${_} ${l},${u}`,Z.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};bB.displayName="ConnectionLine";const Zme=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Jme({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:l,connectionStatus:u}=fr(Zme,mo);return!(i&&o&&a&&s)?null:Z.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:Z.jsx("g",{className:ss(["react-flow__connection",u]),children:Z.jsx(bB,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}function C8(e,t){return M.useRef(null),ii(),M.useMemo(()=>t(e),[e])}const SB=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:b,connectionLineType:_,connectionLineStyle:y,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:k,onlyRenderVisibleElements:L,elementsSelectable:N,selectNodesOnDrag:E,defaultViewport:P,translateExtent:D,minZoom:B,maxZoom:R,preventScrolling:O,defaultMarkerColor:I,zoomOnScroll:F,zoomOnPinch:U,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:Y,zoomOnDoubleClick:Q,panOnDrag:j,onPaneClick:K,onPaneMouseEnter:ee,onPaneMouseMove:ie,onPaneMouseLeave:ge,onPaneScroll:ae,onPaneContextMenu:dt,onEdgeUpdate:et,onEdgeContextMenu:Ne,onEdgeMouseEnter:lt,onEdgeMouseMove:Te,onEdgeMouseLeave:Ht,edgeUpdaterRadius:br,onEdgeUpdateStart:An,onEdgeUpdateEnd:_n,noDragClassName:qt,noWheelClassName:kn,noPanClassName:Sr,elevateEdgesOnSelect:eo,disableKeyboardA11y:Vr,nodeOrigin:sr,nodeExtent:Or,rfId:Gr})=>{const Pn=C8(e,Ame),cn=C8(t,Nme);return Qme(o),Z.jsx(Eme,{onPaneClick:K,onPaneMouseEnter:ee,onPaneMouseMove:ie,onPaneMouseLeave:ge,onPaneContextMenu:dt,onPaneScroll:ae,deleteKeyCode:k,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:N,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:F,zoomOnPinch:U,zoomOnDoubleClick:Q,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:Y,panOnDrag:j,defaultViewport:P,translateExtent:D,minZoom:B,maxZoom:R,onSelectionContextMenu:p,preventScrolling:O,noDragClassName:qt,noWheelClassName:kn,noPanClassName:Sr,disableKeyboardA11y:Vr,children:Z.jsxs(Xme,{children:[Z.jsx(Wme,{edgeTypes:cn,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:et,onlyRenderVisibleElements:L,onEdgeContextMenu:Ne,onEdgeMouseEnter:lt,onEdgeMouseMove:Te,onEdgeMouseLeave:Ht,onEdgeUpdateStart:An,onEdgeUpdateEnd:_n,edgeUpdaterRadius:br,defaultMarkerColor:I,noPanClassName:Sr,elevateEdgesOnSelect:!!eo,disableKeyboardA11y:Vr,rfId:Gr,children:Z.jsx(Jme,{style:y,type:_,component:g,containerStyle:v})}),Z.jsx("div",{className:"react-flow__edgelabel-renderer"}),Z.jsx(Rme,{nodeTypes:Pn,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:E,onlyRenderVisibleElements:L,noPanClassName:Sr,noDragClassName:qt,disableKeyboardA11y:Vr,nodeOrigin:sr,nodeExtent:Or,rfId:Gr})]})})};SB.displayName="GraphView";var eye=M.memo(SB);const XC=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],xl={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:XC,nodeExtent:XC,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Nc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Age,isValidConnection:void 0},tye=()=>Ude((e,t)=>({...xl,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:pw(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?pw(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,b)=>{const _=i.get(b.id);if(_){const y=rT(b.nodeElement);!!(y.width&&y.height&&(_.width!==y.width||_.height!==y.height||b.forceUpdate))&&(i.set(_.id,{..._,[zr]:{..._[zr],handleBounds:{source:y8(".source",b.nodeElement,f,u),target:y8(".target",b.nodeElement,f,u)}},...y}),m.push({id:_.id,type:"dimensions",dimensions:y}))}return m},[]);aB(i,u);const p=s||o&&!s&&lB(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 u=Yu(n,a()),c=pw(u,i,s,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>Rl(l,!0)):(s=Gd(o(),n),a=Gd(i,[])),Gy({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=>Rl(l,!0)):(s=Gd(i,n),a=Gd(o(),[])),Gy({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(c=>(c.selected=!1,Rl(c.id,!1))),u=a.map(c=>Rl(c.id,!1));Gy({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(a=>a.selected).map(a=>Rl(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Rl(a.id,!1));Gy({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=iT(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const u=ru.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,o]],d=s==null?void 0:s.constrain()(u,c,l);return s.transform(a,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:xl.connectionNodeId,connectionHandleId:xl.connectionHandleId,connectionHandleType:xl.connectionHandleType,connectionStatus:xl.connectionStatus,connectionStartHandle:xl.connectionStartHandle,connectionEndHandle:xl.connectionEndHandle}),reset:()=>e({...xl})}),Object.is),wB=({children:e})=>{const t=M.useRef(null);return t.current||(t.current=tye()),Z.jsx(bge,{value:t.current,children:e})};wB.displayName="ReactFlowProvider";const xB=({children:e})=>M.useContext(Ib)?Z.jsx(Z.Fragment,{children:e}):Z.jsx(wB,{children:e});xB.displayName="ReactFlowWrapper";const nye={input:eB,default:WC,output:nB,group:fT},rye={default:S1,straight:aT,step:sT,smoothstep:Mb,simplebezier:oT},iye=[0,0],oye=[15,15],sye={x:0,y:0,zoom:1},aye={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},lye=M.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=nye,edgeTypes:s=rye,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:A,onNodesDelete:T,onEdgesDelete:k,onSelectionChange:L,onSelectionDragStart:N,onSelectionDrag:E,onSelectionDragStop:P,onSelectionContextMenu:D,onSelectionStart:B,onSelectionEnd:R,connectionMode:O=Nc.Strict,connectionLineType:I=$l.Bezier,connectionLineStyle:F,connectionLineComponent:U,connectionLineContainerStyle:V,deleteKeyCode:H="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:Q=!1,selectionMode:j=vu.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:ee=_1()?"Meta":"Control",zoomActivationKeyCode:ie=_1()?"Meta":"Control",snapToGrid:ge=!1,snapGrid:ae=oye,onlyRenderVisibleElements:dt=!1,selectNodesOnDrag:et=!0,nodesDraggable:Ne,nodesConnectable:lt,nodesFocusable:Te,nodeOrigin:Ht=iye,edgesFocusable:br,edgesUpdatable:An,elementsSelectable:_n,defaultViewport:qt=sye,minZoom:kn=.5,maxZoom:Sr=2,translateExtent:eo=XC,preventScrolling:Vr=!0,nodeExtent:sr,defaultMarkerColor:Or="#b1b1b7",zoomOnScroll:Gr=!0,zoomOnPinch:Pn=!0,panOnScroll:cn=!1,panOnScrollSpeed:xi=.5,panOnScrollMode:oi=cc.Free,zoomOnDoubleClick:Ui=!0,panOnDrag:fs=!0,onPaneClick:wr,onPaneMouseEnter:to,onPaneMouseMove:Ca,onPaneMouseLeave:_o,onPaneScroll:Ea,onPaneContextMenu:Rn,children:Wt,onEdgeUpdate:Ir,onEdgeContextMenu:xr,onEdgeDoubleClick:Cr,onEdgeMouseEnter:Hr,onEdgeMouseMove:Ci,onEdgeMouseLeave:no,onEdgeUpdateStart:si,onEdgeUpdateEnd:Mr,edgeUpdaterRadius:hs=10,onNodesChange:Us,onEdgesChange:ai,noDragClassName:yl="nodrag",noWheelClassName:Bo="nowheel",noPanClassName:qr="nopan",fitView:Ta=!1,fitViewOptions:W,connectOnClick:J=!0,attributionPosition:te,proOptions:le,defaultEdgeOptions:re,elevateNodesOnSelect:De=!0,elevateEdgesOnSelect:ze=!1,disableKeyboardA11y:rt=!1,autoPanOnConnect:Oe=!0,autoPanOnNodeDrag:Ue=!0,connectionRadius:Ae=20,isValidConnection:ne,onError:ye,style:We,id:Ke,...it},ot)=>{const pt=Ke||"1";return Z.jsx("div",{...it,style:{...We,...aye},ref:ot,className:ss(["react-flow",i]),"data-testid":"rf__wrapper",id:Ke,children:Z.jsxs(xB,{children:[Z.jsx(eye,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:s,connectionLineType:I,connectionLineStyle:F,connectionLineComponent:U,connectionLineContainerStyle:V,selectionKeyCode:Y,selectionOnDrag:Q,selectionMode:j,deleteKeyCode:H,multiSelectionKeyCode:ee,panActivationKeyCode:K,zoomActivationKeyCode:ie,onlyRenderVisibleElements:dt,selectNodesOnDrag:et,defaultViewport:qt,translateExtent:eo,minZoom:kn,maxZoom:Sr,preventScrolling:Vr,zoomOnScroll:Gr,zoomOnPinch:Pn,zoomOnDoubleClick:Ui,panOnScroll:cn,panOnScrollSpeed:xi,panOnScrollMode:oi,panOnDrag:fs,onPaneClick:wr,onPaneMouseEnter:to,onPaneMouseMove:Ca,onPaneMouseLeave:_o,onPaneScroll:Ea,onPaneContextMenu:Rn,onSelectionContextMenu:D,onSelectionStart:B,onSelectionEnd:R,onEdgeUpdate:Ir,onEdgeContextMenu:xr,onEdgeDoubleClick:Cr,onEdgeMouseEnter:Hr,onEdgeMouseMove:Ci,onEdgeMouseLeave:no,onEdgeUpdateStart:si,onEdgeUpdateEnd:Mr,edgeUpdaterRadius:hs,defaultMarkerColor:Or,noDragClassName:yl,noWheelClassName:Bo,noPanClassName:qr,elevateEdgesOnSelect:ze,rfId:pt,disableKeyboardA11y:rt,nodeOrigin:Ht,nodeExtent:sr}),Z.jsx(Zge,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:Ne,nodesConnectable:lt,nodesFocusable:Te,edgesFocusable:br,edgesUpdatable:An,elementsSelectable:_n,elevateNodesOnSelect:De,minZoom:kn,maxZoom:Sr,nodeExtent:sr,onNodesChange:Us,onEdgesChange:ai,snapToGrid:ge,snapGrid:ae,connectionMode:O,translateExtent:eo,connectOnClick:J,defaultEdgeOptions:re,fitView:Ta,fitViewOptions:W,onNodesDelete:T,onEdgesDelete:k,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:A,onSelectionDrag:E,onSelectionDragStart:N,onSelectionDragStop:P,noPanClassName:qr,nodeOrigin:Ht,rfId:pt,autoPanOnConnect:Oe,autoPanOnNodeDrag:Ue,onError:ye,connectionRadius:Ae,isValidConnection:ne}),Z.jsx(Qge,{onSelectionChange:L}),Wt,Z.jsx(xge,{proOptions:le,position:te}),Z.jsx(rme,{rfId:pt,disableKeyboardA11y:rt})]})})});lye.displayName="ReactFlow";const uye=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function zOe({children:e}){const t=fr(uye);return t?ws.createPortal(e,t):null}function UOe(){const e=ii();return M.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 cye(){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 Bg=du("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,cye()))}catch(n){return t({error:n})}});let qy;const dye=new Uint8Array(16);function fye(){if(!qy&&(qy=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qy))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qy(dye)}const fi=[];for(let e=0;e<256;++e)fi.push((e+256).toString(16).slice(1));function hye(e,t=0){return(fi[e[t+0]]+fi[e[t+1]]+fi[e[t+2]]+fi[e[t+3]]+"-"+fi[e[t+4]]+fi[e[t+5]]+"-"+fi[e[t+6]]+fi[e[t+7]]+"-"+fi[e[t+8]]+fi[e[t+9]]+"-"+fi[e[t+10]]+fi[e[t+11]]+fi[e[t+12]]+fi[e[t+13]]+fi[e[t+14]]+fi[e[t+15]]).toLowerCase()}const pye=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),E8={randomUUID:pye};function CB(e,t,n){if(E8.randomUUID&&!t&&!e)return E8.randomUUID();e=e||{};const r=e.random||(e.rng||fye)();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 hye(r)}const jOe=500,VOe=320,gye="node-drag-handle",mye=["ImageField","ImageCollection"],GOe=mye,HOe={input:"inputs",output:"outputs"},qOe=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection"],yye=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic"],WOe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField"],EB={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection"},vye=e=>!!(e&&e in EB),TB={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic"},KOe={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField"},_ye=e=>!!(e&&e in TB),XOe={boolean:{color:"green.500",description:"Booleans are true or false.",title:"Boolean"},BooleanCollection:{color:"green.500",description:"A collection of booleans.",title:"Boolean Collection"},BooleanPolymorphic:{color:"green.500",description:"A collection of booleans.",title:"Boolean Polymorphic"},ClipField:{color:"green.500",description:"Tokenizer and text_encoder submodels.",title:"Clip"},Collection:{color:"base.500",description:"TODO",title:"Collection"},CollectionItem:{color:"base.500",description:"TODO",title:"Collection Item"},ColorCollection:{color:"pink.300",description:"A collection of colors.",title:"Color Collection"},ColorField:{color:"pink.300",description:"A RGBA color.",title:"Color"},ColorPolymorphic:{color:"pink.300",description:"A collection of colors.",title:"Color Polymorphic"},ConditioningCollection:{color:"cyan.500",description:"Conditioning may be passed between nodes.",title:"Conditioning Collection"},ConditioningField:{color:"cyan.500",description:"Conditioning may be passed between nodes.",title:"Conditioning"},ConditioningPolymorphic:{color:"cyan.500",description:"Conditioning may be passed between nodes.",title:"Conditioning Polymorphic"},ControlCollection:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Collection"},ControlField:{color:"teal.500",description:"Control info passed between nodes.",title:"Control"},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:"Denoise Mask may be passed between nodes",title:"Denoise Mask"},enum:{color:"blue.500",description:"Enums are values that may be one of a number of options.",title:"Enum"},float:{color:"orange.500",description:"Floats are numbers with a decimal point.",title:"Float"},FloatCollection:{color:"orange.500",description:"A collection of floats.",title:"Float Collection"},FloatPolymorphic:{color:"orange.500",description:"A collection of floats.",title:"Float Polymorphic"},ImageCollection:{color:"purple.500",description:"A collection of images.",title:"Image Collection"},ImageField:{color:"purple.500",description:"Images may be passed between nodes.",title:"Image"},ImagePolymorphic:{color:"purple.500",description:"A collection of images.",title:"Image Polymorphic"},integer:{color:"red.500",description:"Integers are whole numbers, without a decimal point.",title:"Integer"},IntegerCollection:{color:"red.500",description:"A collection of integers.",title:"Integer Collection"},IntegerPolymorphic:{color:"red.500",description:"A collection of integers.",title:"Integer Polymorphic"},IPAdapterField:{color:"green.300",description:"IP-Adapter info passed between nodes.",title:"IP-Adapter"},IPAdapterModelField:{color:"teal.500",description:"IP-Adapter model",title:"IP-Adapter Model"},LatentsCollection:{color:"pink.500",description:"Latents may be passed between nodes.",title:"Latents Collection"},LatentsField:{color:"pink.500",description:"Latents may be passed between nodes.",title:"Latents"},LatentsPolymorphic:{color:"pink.500",description:"Latents may be passed between nodes.",title:"Latents Polymorphic"},LoRAModelField:{color:"teal.500",description:"TODO",title:"LoRA"},MainModelField:{color:"teal.500",description:"TODO",title:"Model"},ONNXModelField:{color:"teal.500",description:"ONNX model field.",title:"ONNX Model"},Scheduler:{color:"base.500",description:"TODO",title:"Scheduler"},SDXLMainModelField:{color:"teal.500",description:"SDXL model field.",title:"SDXL Model"},SDXLRefinerModelField:{color:"teal.500",description:"TODO",title:"Refiner Model"},string:{color:"yellow.500",description:"Strings are text.",title:"String"},StringCollection:{color:"yellow.500",description:"A collection of strings.",title:"String Collection"},StringPolymorphic:{color:"yellow.500",description:"A collection of strings.",title:"String Polymorphic"},UNetField:{color:"red.500",description:"UNet submodel.",title:"UNet"},VaeField:{color:"blue.500",description:"Vae submodel.",title:"Vae"},VaeModelField:{color:"teal.500",description:"TODO",title:"VAE"}},T8=(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}},bye="1.0.0",vw={status:La.PENDING,error:null,progress:null,progressImage:null,outputs:[]},QC={meta:{version:bye},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},AB={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,currentConnectionFieldType:null,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],workflow:QC,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:vu.Partial},wo=(e,t)=>{var l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(c=>c.id===n),s=(l=e.nodes)==null?void 0:l[o];if(!Wr(s))return;const a=(u=s.data)==null?void 0:u.inputs[r];a&&o>-1&&(a.value=i)},kB=tr({name:"nodes",initialState:AB,reducers:{nodesChanged:(e,t)=>{e.nodes=Yu(t.payload,e.nodes)},nodeAdded:(e,t)=>{const n=t.payload,r=T8(e.nodes,n.position.x,n.position.y);n.position=r,n.selected=!0,e.nodes=Yu(e.nodes.map(i=>({id:i.id,type:"select",selected:!1})),e.nodes),e.edges=Uu(e.edges.map(i=>({id:i.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),Wr(n)&&(e.nodeExecutionStates[n.id]={nodeId:n.id,...vw})},edgesChanged:(e,t)=>{e.edges=Uu(t.payload,e.edges)},connectionStarted:(e,t)=>{var l;e.connectionStartParams=t.payload;const{nodeId:n,handleId:r,handleType:i}=t.payload;if(!n||!r)return;const o=e.nodes.findIndex(u=>u.id===n),s=(l=e.nodes)==null?void 0:l[o];if(!Wr(s))return;const a=i==="source"?s.data.outputs[r]:s.data.inputs[r];e.currentConnectionFieldType=(a==null?void 0:a.type)??null},connectionMade:(e,t)=>{e.currentConnectionFieldType&&(e.edges=GF({...t.payload,type:"default"},e.edges))},connectionEnded:e=>{e.connectionStartParams=null,e.currentConnectionFieldType=null},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=Vk(e.workflow.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`)},workflowExposedFieldRemoved:(e,t)=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(n=>!Sm(n,t.payload))},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(a=>a.id===n);if(!Wr(o))return;const s=o.data.inputs[r];s&&(s.label=i)},nodeEmbedWorkflowChanged:(e,t)=>{var s;const{nodeId:n,embedWorkflow:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Wr(o)&&(o.data.embedWorkflow=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];Wr(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(!Wr(o)&&!Zk(o)||(o.data.isOpen=r,!Wr(o)))return;const s=cT([o],e.edges);if(r)s.forEach(l=>{delete l.hidden}),s.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(u=>u.id!==l.id))});else{const l=$ge(o,e.nodes,e.edges).filter(d=>Wr(d)&&d.data.isOpen===!1),u=Lge(o,e.nodes,e.edges).filter(d=>Wr(d)&&d.data.isOpen===!1),c=[];s.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=c.find(m=>m.source===d.source&&m.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1}})}if(d.source===n&&u.find(p=>p.id===d.target)){const p=c.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}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1}})}}),c.length&&(e.edges=Uu(c.map(d=>({type:"add",item:d})),e.edges))}},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=Uu(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),Wr(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];Wr(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];Wr(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=Yu(e.nodes.map(r=>({id:r.id,type:"select",selected:r.id===n})),e.nodes)},selectedNodesChanged:(e,t)=>{e.selectedNodes=t.payload},selectedEdgesChanged:(e,t)=>{e.selectedEdges=t.payload},fieldStringValueChanged:(e,t)=>{wo(e,t)},fieldNumberValueChanged:(e,t)=>{wo(e,t)},fieldBooleanValueChanged:(e,t)=>{wo(e,t)},fieldImageValueChanged:(e,t)=>{wo(e,t)},fieldColorValueChanged:(e,t)=>{wo(e,t)},fieldMainModelValueChanged:(e,t)=>{wo(e,t)},fieldRefinerModelValueChanged:(e,t)=>{wo(e,t)},fieldVaeModelValueChanged:(e,t)=>{wo(e,t)},fieldLoRAModelValueChanged:(e,t)=>{wo(e,t)},fieldControlNetModelValueChanged:(e,t)=>{wo(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{wo(e,t)},fieldEnumModelValueChanged:(e,t)=>{wo(e,t)},fieldSchedulerValueChanged:(e,t)=>{wo(e,t)},imageCollectionFieldValueChanged:(e,t)=>{var u,c;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n);if(o===-1)return;const s=(u=e.nodes)==null?void 0:u[o];if(!Wr(s))return;const a=(c=s.data)==null?void 0:c.inputs[r];if(!a)return;const l=Zn(a.value);if(!l){a.value=i;return}a.value=Vk(l.concat(i),"image_name")},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];Zk(o)&&(o.data.notes=r)},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[],e.workflow=Zn(QC)},shouldValidateGraphChanged:(e,t)=>{e.shouldValidateGraph=t.payload},shouldAnimateEdgesChanged:(e,t)=>{e.shouldAnimateEdges=t.payload},shouldSnapToGridChanged:(e,t)=>{e.shouldSnapToGrid=t.payload},shouldColorEdgesChanged:(e,t)=>{e.shouldColorEdges=t.payload},nodeOpacityChanged:(e,t)=>{e.nodeOpacity=t.payload},workflowNameChanged:(e,t)=>{e.workflow.name=t.payload},workflowDescriptionChanged:(e,t)=>{e.workflow.description=t.payload},workflowTagsChanged:(e,t)=>{e.workflow.tags=t.payload},workflowAuthorChanged:(e,t)=>{e.workflow.author=t.payload},workflowNotesChanged:(e,t)=>{e.workflow.notes=t.payload},workflowVersionChanged:(e,t)=>{e.workflow.version=t.payload},workflowContactChanged:(e,t)=>{e.workflow.contact=t.payload},workflowLoaded:(e,t)=>{const{nodes:n,edges:r,...i}=t.payload;e.workflow=i,e.nodes=Yu(n.map(o=>({item:{...o,dragHandle:`.${gye}`},type:"add"})),[]),e.edges=Uu(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,s)=>(o[s.id]={nodeId:s.id,...vw},o),{})},workflowReset:e=>{e.workflow=Zn(QC)},viewportChanged:(e,t)=>{e.viewport=t.payload},mouseOverFieldChanged:(e,t)=>{e.mouseOverField=t.payload},mouseOverNodeChanged:(e,t)=>{e.mouseOverNode=t.payload},selectedAll:e=>{e.nodes=Yu(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=Uu(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Zn),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Zn)},selectionPasted:e=>{const t=e.nodesToCopy.map(Zn),n=t.map(l=>l.data.id),r=e.edgesToCopy.filter(l=>n.includes(l.source)&&n.includes(l.target)).map(Zn);r.forEach(l=>l.selected=!0),t.forEach(l=>{const u=CB();r.forEach(d=>{d.source===l.data.id&&(d.source=u,d.id=d.id.replace(l.data.id,u)),d.target===l.data.id&&(d.target=u,d.id=d.id.replace(l.data.id,u))}),l.selected=!0,l.id=u,l.data.id=u;const c=T8(e.nodes,l.position.x,l.position.y);l.position=c});const i=t.map(l=>({item:l,type:"add"})),o=e.nodes.map(l=>({id:l.data.id,type:"select",selected:!1})),s=r.map(l=>({item:l,type:"add"})),a=e.edges.map(l=>({id:l.id,type:"select",selected:!1}));e.nodes=Yu(i.concat(o),e.nodes),e.edges=Uu(s.concat(a),e.edges),t.forEach(l=>{e.nodeExecutionStates[l.id]={nodeId:l.id,...vw}})},addNodePopoverOpened:e=>{e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?vu.Full:vu.Partial}},extraReducers:e=>{e.addCase(Bg.pending,t=>{t.isReady=!1}),e.addCase(VE,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=La.IN_PROGRESS)}),e.addCase(HE,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=La.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(Tb,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=La.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(qE,(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=La.IN_PROGRESS,a.progress=(i+1)/o,a.progressImage=s??null)}),e.addCase(oh.fulfilled,t=>{ns(t.nodeExecutionStates,n=>{n.status=La.PENDING,n.error=null,n.progress=null,n.progressImage=null,n.outputs=[]})}),e.addCase(Pu.fulfilled,t=>{hee(t.nodeExecutionStates,n=>{n.status===La.IN_PROGRESS&&(n.status=La.PENDING)})})}}),{nodesChanged:QOe,edgesChanged:YOe,nodeAdded:ZOe,nodesDeleted:JOe,connectionMade:eIe,connectionStarted:tIe,connectionEnded:nIe,shouldShowFieldTypeLegendChanged:rIe,shouldShowMinimapPanelChanged:iIe,nodeTemplatesBuilt:PB,nodeEditorReset:Sye,imageCollectionFieldValueChanged:oIe,fieldStringValueChanged:sIe,fieldNumberValueChanged:aIe,fieldBooleanValueChanged:lIe,fieldImageValueChanged:Nb,fieldColorValueChanged:uIe,fieldMainModelValueChanged:cIe,fieldVaeModelValueChanged:dIe,fieldLoRAModelValueChanged:fIe,fieldEnumModelValueChanged:hIe,fieldControlNetModelValueChanged:pIe,fieldIPAdapterModelValueChanged:gIe,fieldRefinerModelValueChanged:mIe,fieldSchedulerValueChanged:yIe,nodeIsOpenChanged:vIe,nodeLabelChanged:_Ie,nodeNotesChanged:bIe,edgesDeleted:SIe,shouldValidateGraphChanged:wIe,shouldAnimateEdgesChanged:xIe,nodeOpacityChanged:CIe,shouldSnapToGridChanged:EIe,shouldColorEdgesChanged:TIe,selectedNodesChanged:AIe,selectedEdgesChanged:kIe,workflowNameChanged:PIe,workflowDescriptionChanged:RIe,workflowTagsChanged:OIe,workflowAuthorChanged:IIe,workflowNotesChanged:MIe,workflowVersionChanged:NIe,workflowContactChanged:DIe,workflowLoaded:wye,notesNodeValueChanged:LIe,workflowExposedFieldAdded:xye,workflowExposedFieldRemoved:$Ie,fieldLabelChanged:FIe,viewportChanged:BIe,mouseOverFieldChanged:zIe,selectionCopied:UIe,selectionPasted:jIe,selectedAll:VIe,addNodePopoverOpened:GIe,addNodePopoverClosed:HIe,addNodePopoverToggled:qIe,selectionModeChanged:WIe,nodeEmbedWorkflowChanged:KIe,nodeIsIntermediateChanged:XIe,mouseOverNodeChanged:QIe,nodeExclusivelySelected:YIe}=kB.actions,Cye=kB.reducer,RB={esrganModelName:"RealESRGAN_x4plus.pth"},OB=tr({name:"postprocessing",initialState:RB,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:ZIe}=OB.actions,Eye=OB.reducer,Tye={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},IB=tr({name:"sdxl",initialState:Tye,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:JIe,setNegativeStylePromptSDXL:e9e,setShouldConcatSDXLStylePrompt:t9e,setShouldUseSDXLRefiner:Aye,setSDXLImg2ImgDenoisingStrength:n9e,refinerModelChanged:A8,setRefinerSteps:r9e,setRefinerCFGScale:i9e,setRefinerScheduler:o9e,setRefinerPositiveAestheticScore:s9e,setRefinerNegativeAestheticScore:a9e,setRefinerStart:l9e}=IB.actions,kye=IB.reducer,$m=Me("app/userInvoked"),ia=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},Pye=z.object({status:z.literal(422),error:z.object({detail:z.array(z.object({loc:z.array(z.string()),msg:z.string(),type:z.string()}))})}),MB={isConnected:!1,isProcessing:!1,isGFPGANAvailable:!0,isESRGANAvailable:!0,shouldConfirmOnDelete:!0,currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatusHasSteps:!1,isCancelable:!0,enableImageDebugging:!1,toastQueue:[],progressImage:null,shouldAntialiasProgressImage:!1,sessionId:null,cancelType:"immediate",isCancelScheduled:!1,subscribedNodeIds:[],wereModelsReceived:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,statusTranslationKey:"common.statusDisconnected",canceledSession:"",isPersisted:!1,language:"en",isUploading:!1,shouldUseNSFWChecker:!1,shouldUseWatermarker:!1},NB=tr({name:"system",initialState:MB,reducers:{setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.statusTranslationKey=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},cancelScheduled:e=>{e.isCancelScheduled=!0},scheduledCancelAborted:e=>{e.isCancelScheduled=!1},cancelTypeChanged:(e,t)=>{e.cancelType=t.payload},subscribedNodeIdsSet:(e,t)=>{e.subscribedNodeIds=t.payload},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},isPersistedChanged:(e,t)=>{e.isPersisted=t.payload},languageChanged:(e,t)=>{e.language=t.payload},progressImageSet(e,t){e.progressImage=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload}},extraReducers(e){e.addCase(I$,(t,n)=>{t.sessionId=n.payload.sessionId,t.canceledSession=""}),e.addCase(N$,t=>{t.sessionId=null}),e.addCase(P$,t=>{t.isConnected=!0,t.isCancelable=!0,t.isProcessing=!1,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.statusTranslationKey="common.statusConnected"}),e.addCase(O$,t=>{t.isConnected=!1,t.isProcessing=!1,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusDisconnected"}),e.addCase(VE,t=>{t.isCancelable=!0,t.isProcessing=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusGenerating"}),e.addCase(qE,(t,n)=>{const{step:r,total_steps:i,progress_image:o}=n.payload.data;t.isProcessing=!0,t.isCancelable=!0,t.currentStatusHasSteps=!0,t.currentStep=r+1,t.totalSteps=i,t.progressImage=o??null,t.statusTranslationKey="common.statusGenerating"}),e.addCase(HE,(t,n)=>{const{data:r}=n.payload;t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusProcessingComplete",t.canceledSession===r.graph_execution_state_id&&(t.isProcessing=!1,t.isCancelable=!0)}),e.addCase(F$,t=>{t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null}),e.addCase($m,t=>{t.isProcessing=!0,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.statusTranslationKey="common.statusPreparing"}),e.addCase(Pu.fulfilled,(t,n)=>{t.canceledSession=n.meta.arg.session_id,t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null,t.toastQueue.push(ia({title:Cp("toast.canceled"),status:"warning"}))}),e.addMatcher(mD,(t,n)=>{var o,s,a;t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null;let r;const i=5e3;if(((o=n.payload)==null?void 0:o.status)===422){const l=Pye.safeParse(n.payload);if(l.success){l.data.error.detail.map(u=>{t.toastQueue.push(ia({title:D2(d7(u.msg),{length:128}),status:"error",description:D2(`Path:
${u.loc.join(".")}`,{length:128}),duration:i}))});return}}else(s=n.payload)!=null&&s.error&&(r=(a=n.payload)==null?void 0:a.error);t.toastQueue.push(ia({title:Cp("toast.serverError"),status:"error",description:D2(Iv(r,"detail","Unknown Error"),{length:128}),duration:i}))}),e.addMatcher(Nye,(t,n)=>{t.isProcessing=!1,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusError",t.progressImage=null,t.toastQueue.push(ia({title:Cp("toast.serverError"),status:"error",description:Yee(n.payload.data.error_type)}))})}}),{setIsProcessing:u9e,setShouldConfirmOnDelete:c9e,setCurrentStatus:d9e,setIsCancelable:f9e,setEnableImageDebugging:h9e,addToast:Bn,clearToastQueue:p9e,cancelScheduled:g9e,scheduledCancelAborted:m9e,cancelTypeChanged:y9e,subscribedNodeIdsSet:v9e,consoleLogLevelChanged:_9e,shouldLogToConsoleChanged:b9e,isPersistedChanged:S9e,shouldAntialiasProgressImageChanged:w9e,languageChanged:x9e,progressImageSet:Rye,shouldUseNSFWCheckerChanged:Oye,shouldUseWatermarkerChanged:Iye}=NB.actions,Mye=NB.reducer,Nye=is(Tb,V$,H$),Dye={searchFolder:null,advancedAddScanModel:null},DB=tr({name:"modelmanager",initialState:Dye,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:C9e,setAdvancedAddScanModel:E9e}=DB.actions,Lye=DB.reducer,LB={shift:!1,ctrl:!1,meta:!1},$B=tr({name:"hotkeys",initialState:LB,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:T9e,ctrlKeyPressed:A9e,metaKeyPressed:k9e}=$B.actions,$ye=$B.reducer,FB=["txt2img","img2img","unifiedCanvas","nodes","modelManager","batch"],k8=(e,t)=>{typeof t=="number"?e.activeTab=t:e.activeTab=FB.indexOf(t)},BB={activeTab:0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},zB=tr({name:"ui",initialState:BB,reducers:{setActiveTab:(e,t)=>{k8(e,t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldHidePreview:(e,t)=>{e.shouldHidePreview=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker},setShouldAutoChangeDimensions:(e,t)=>{e.shouldAutoChangeDimensions=t.payload},contextMenusClosed:e=>{e.globalContextMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(N_,t=>{k8(t,"img2img")})}}),{setActiveTab:UB,setShouldShowImageDetails:P9e,setShouldUseCanvasBetaLayout:R9e,setShouldShowExistingModelsInSearch:O9e,setShouldUseSliders:I9e,setShouldHidePreview:M9e,setShouldShowProgressInViewer:N9e,favoriteSchedulersChanged:D9e,toggleEmbeddingPicker:L9e,setShouldAutoChangeDimensions:$9e,contextMenusClosed:F9e,panelsChanged:B9e}=zB.actions,Fye=zB.reducer,Bye=Q1(xq);jB=YC=void 0;var zye=Bye,Uye=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return zye.compose.apply(void 0,n)(c)(d)}}},o=function(){for(var u,c,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(u=n).push.apply(u,f.map(function(p){return p(r)})),(c=t).push.apply(c,f)},s=function(u){var c=t.findIndex(function(d){return d===u});if(c===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(d,f){return f!==c}),n=n.filter(function(d,f){return f!==c})},a=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:s,resetMiddlewares:a}},Db=Uye(),jye=Db.enhancer,Vye=Db.addMiddleware;Db.removeMiddleware;var Gye=Db.resetMiddlewares,YC=Vye,jB=Gye,ZC="@@REMEMBER_REHYDRATED",Hye="@@REMEMBER_PERSISTED";function JC(e){"@babel/helpers - typeof";return JC=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},JC(e)}var VB=function(t,n){if(t===null||JC(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},qye=function(t,n){var r=0,i;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,s);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,s),clearTimeout(i),i=null},u)}},Wye=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 P8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function pT(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){P8(o,r,i,s,a,"next",l)}function a(l){P8(o,r,i,s,a,"throw",l)}s(void 0)})}}var Kye=function(){var e=pT(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?{}:VB(o(s,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),Xye=function(){var e=pT(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,s=yield Promise.all(n.map(function(a){return r.getItem("".concat(i).concat(a))}));return n.reduce(function(a,l,u){return s[u]!==null&&s[u]!==void 0&&(a[l]=o(s[u],l)),a},{})});return function(n){return e.apply(this,arguments)}}(),Qye=function(){var e=pT(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.unserialize,l={};try{var u=s?Kye:Xye;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:a})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:ZC,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function _w(e,t){return Jye(e)||Zye(e,t)||GB(e,t)||Yye()}function Yye(){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 Zye(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Jye(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=GB(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function GB(e,t){if(e){if(typeof e=="string")return R8(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 R8(e,t)}}function R8(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 x1(e){"@babel/helpers - typeof";return x1=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},x1(e)}var O8=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},I8=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},e0e=function e(t,n){if(t===n)return!0;if(x1(t)!=="object"||x1(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(I8(t)&&I8(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=O8(t),s=O8(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 u=_w(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(C){a.e(C)}finally{a.f()}var d=bw(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=_w(f.value,2),p=h[0],m=h[1];if(!e(m,n.get(p)))return!1}}catch(C){d.e(C)}finally{d.f()}return!0}if(o==="Set"&&s==="Set"){if(t.size!==n.size)return!1;var b=bw(t.entries()),_;try{for(b.s();!(_=b.n()).done;){var y=_w(_.value,1),g=y[0];if(!n.has(g))return!1}}catch(C){b.e(C)}finally{b.f()}return!0}if(o==="Date"&&s==="Date")return+t==+n;var v=Object.keys(t);if(v.length!==Object.keys(n).length)return!1;for(var S=v.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,v[S]))return!1;for(var w=v.length;w--!==0;){var x=v[w];if(!e(t[x],n[x]))return!1}return o!=="Object"&&s!=="Object"?t===n:!0};const gT=e0e;function M8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function HB(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){M8(o,r,i,s,a,"next",l)}function a(l){M8(o,r,i,s,a,"throw",l)}s(void 0)})}}var t0e=function(){var e=HB(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)}}(),n0e=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))}))},r0e=function(){var e=HB(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?t0e:n0e;yield l(t,n,{prefix:i,driver:o,serialize:a})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function N8(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function D8(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){N8(o,r,i,s,a,"next",l)}function a(l){N8(o,r,i,s,a,"throw",l)}s(void 0)})}}var i0e=function(){var e=D8(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize,a=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,c=r.persistWholeStore;yield Qye(t,n,{prefix:i,driver:o,unserialize:a,persistWholeStore:c});var d={},f=function(){var h=D8(function*(){var p=VB(t.getState(),n);yield r0e(p,d,{prefix:i,driver:o,serialize:s,persistWholeStore:c}),gT(p,d)||t.dispatch({type:Hye,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(Wye(f,u)):t.subscribe(qye(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const o0e=i0e;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 L8(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 Sw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L8(Object(n),!0).forEach(function(r){s0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s0e(e,t,n){return t=a0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a0e(e){var t=l0e(e,"string");return zg(t)==="symbol"?t:String(t)}function l0e(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 u0e=function(t){var n={state:{}};return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,i=arguments.length>1?arguments[1]:void 0;i.type&&(i.type==="@@INIT"||i.type.startsWith("@@redux/INIT"))&&(n.state=Sw({},r));var o=typeof t=="function"?t:th(t);switch(i.type){case ZC:{var s=Sw(Sw({},n.state),i.payload||{});return n.state=o(s,{type:ZC,payload:s}),n.state}default:return o(r,i)}}},c0e=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(b,_){return JSON.stringify(b)}:s,l=r.unserialize,u=l===void 0?function(b,_){return JSON.parse(b)}:l,c=r.persistThrottle,d=c===void 0?100:c,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h;if(!t)throw Error("redux-remember error: driver required");if(!Array.isArray(n))throw Error("redux-remember error: rememberedKeys needs to be an array");var m=function(_){return function(y,g,v){var S=_(y,g,v);return o0e(S,n,{driver:t,prefix:o,serialize:a,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return m};const z9e=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],d0e="@@invokeai-",f0e=["cursorPosition"],h0e=["pendingControlImages"],p0e=["selection","selectedBoardId","galleryView"],g0e=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy"],m0e=[],y0e=[],v0e=["currentIteration","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","totalIterations","totalSteps","isCancelScheduled","progressImage","wereModelsReceived","isPersisted","isUploading"],_0e=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],b0e={canvas:f0e,gallery:p0e,generation:m0e,nodes:g0e,postprocessing:y0e,system:v0e,ui:_0e,controlNet:h0e},S0e=(e,t)=>{const n=R_(e,b0e[t]??[]);return JSON.stringify(n)},w0e={canvas:vD,gallery:J$,generation:Fs,nodes:AB,postprocessing:RB,system:MB,config:nD,ui:BB,hotkeys:LB,controlNet:MC},x0e=(e,t)=>see(JSON.parse(e),w0e[t]),qB=Me("nodes/textToImageGraphBuilt"),WB=Me("nodes/imageToImageGraphBuilt"),KB=Me("nodes/canvasGraphBuilt"),XB=Me("nodes/nodesGraphBuilt"),C0e=is(qB,WB,KB,XB),E0e=Me("nodes/workflowLoadRequested"),T0e=e=>{if(C0e(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return Bg.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:PB.match(e)?{...e,payload:"<Node templates omitted>"}:e},A0e=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],k0e=e=>e,P0e=()=>{xe({actionCreator:Wne,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),{sessionId:o,isProcessing:s}=i.system,a=e.payload;if(s){if(!a){r.debug("No canvas session, skipping cancel");return}if(a!==o){r.debug({canvasSessionId:a,session_id:o},"Canvas session does not match global session, skipping cancel");return}t(Pu({session_id:o}))}}})};Me("app/appStarted");const R0e=()=>{xe({matcher:he.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==Co({board_id:"none",categories:Xr}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Nn.getSelectors().selectAll(i)[0];t(da(o??null))}}})},mT=yu.injectEndpoints({endpoints:e=>({getAppVersion:e.query({query:()=>({url:"app/version",method:"GET"}),providesTags:["AppVersion"],keepUnusedDataFor:864e5}),getAppConfig:e.query({query:()=>({url:"app/config",method:"GET"}),providesTags:["AppConfig"],keepUnusedDataFor:864e5})})}),{useGetAppVersionQuery:U9e,useGetAppConfigQuery:j9e}=mT,O0e=()=>{xe({matcher:mT.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(Cne(r[0])),i.includes("nsfw_checker")||n(Oye(!1)),o.includes("invisible_watermark")||n(Iye(!1))}})},I0e=Me("app/appStarted"),M0e=()=>{xe({actionCreator:I0e,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},yT={memoizeOptions:{resultEqualityCheck:Sm}},QB=(e,t)=>{var d;const{generation:n,canvas:r,nodes:i,controlNet: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(Wr).some(f=>bp(f.data.inputs,h=>{var p;return h.type==="ImageField"&&((p=h.value)==null?void 0:p.image_name)===t})),u=bp(o.controlNets,f=>f.controlImage===t||f.processedControlImage===t);return{isInitialImage:s,isCanvasImage:a,isNodesImage:l,isControlNetImage:u}},N0e=$i([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>QB(e,r.image_name)):[]},yT),D0e=()=>{xe({matcher:he.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,s=!1,a=!1;const l=n();r.forEach(u=>{const c=QB(l,u);c.isInitialImage&&!i&&(t(vE()),i=!0),c.isCanvasImage&&!o&&(t(_E()),o=!0),c.isNodesImage&&!s&&(t(Sye()),s=!0),c.isControlNetImage&&!a&&(t(kde()),a=!0)})}})},L0e=()=>{xe({matcher:is(NC,f1),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),s=NC.match(e)?e.payload:o.gallery.selectedBoardId,l=(f1.match(e)?e.payload:o.gallery.galleryView)==="images"?Xr:jl,u={board_id:s??"none",categories:l};if(await r(()=>he.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=he.endpoints.listImages.select(u)(t());if(d){const f=s1.selectAll(d)[0];n(da(f??null))}else n(da(null))}else n(da(null))}})},$0e=Me("canvas/canvasSavedToGallery"),F0e=Me("canvas/canvasMaskSavedToGallery"),B0e=Me("canvas/canvasCopiedToClipboard"),z0e=Me("canvas/canvasDownloadedAsImage"),U0e=Me("canvas/canvasMerged"),j0e=Me("canvas/stagingAreaImageSaved"),V0e=Me("canvas/canvasMaskToControlNet"),G0e=Me("canvas/canvasImageToControlNet");let YB=null,ZB=null;const V9e=e=>{YB=e},Lb=()=>YB,G9e=e=>{ZB=e},H0e=()=>ZB,q0e=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),C1=async(e,t)=>await q0e(e.toCanvas(t)),$b=async e=>{const t=Lb();if(!t)return;const{shouldCropToBoundingBoxOnSave:n,boundingBoxCoordinates:r,boundingBoxDimensions:i}=e.canvas,o=t.clone();o.scale({x:1,y:1});const s=o.getAbsolutePosition(),a=n?{x:r.x+s.x,y:r.y+s.y,width:i.width,height:i.height}:o.getClientRect();return C1(o,a)},W0e=e=>{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])},K0e=()=>{xe({actionCreator:B0e,effect:async(e,{dispatch:t,getState:n})=>{const r=ib.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n(),o=await $b(i);if(!o){r.error("Problem getting base layer blob"),t(Bn({title:"Problem Copying Canvas",description:"Unable to export base layer",status:"error"}));return}W0e(o),t(Bn({title:"Canvas Copied to Clipboard",status:"success"}))}})},X0e=(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()},Q0e=()=>{xe({actionCreator:z0e,effect:async(e,{dispatch:t,getState:n})=>{const r=ib.get().child({namespace:"canvasSavedToGalleryListener"}),i=n(),o=await $b(i);if(!o){r.error("Problem getting base layer blob"),t(Bn({title:"Problem Downloading Canvas",description:"Unable to export base layer",status:"error"}));return}X0e(o,"canvas.png"),t(Bn({title:"Canvas Downloaded",status:"success"}))}})},Y0e=()=>{xe({actionCreator:G0e,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await $b(i);if(!o){r.error("Problem getting base layer blob"),t(Bn({title:"Problem Saving Canvas",description:"Unable to export base layer",status:"error"}));return}const{autoAddBoardId:s}=i.gallery,a=await t(he.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:"Canvas Sent to ControlNet & Assets"}}})).unwrap(),{image_name:l}=a;t(Wc({controlNetId:e.payload.controlNet.controlNetId,controlImage:l}))}})};var vT={exports:{}},Fb={},JB={},Tt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof ut<"u"?ut:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.0",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const r=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Tt);var or={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Tt;class n{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var S=this.m;return{x:S[0]*v.x+S[2]*v.y+S[4],y:S[1]*v.x+S[3]*v.y+S[5]}}translate(v,S){return this.m[4]+=this.m[0]*v+this.m[2]*S,this.m[5]+=this.m[1]*v+this.m[3]*S,this}scale(v,S){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=S,this.m[3]*=S,this}rotate(v){var S=Math.cos(v),w=Math.sin(v),x=this.m[0]*S+this.m[2]*w,C=this.m[1]*S+this.m[3]*w,A=this.m[0]*-w+this.m[2]*S,T=this.m[1]*-w+this.m[3]*S;return this.m[0]=x,this.m[1]=C,this.m[2]=A,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,S){var w=this.m[0]+this.m[2]*S,x=this.m[1]+this.m[3]*S,C=this.m[2]+this.m[0]*v,A=this.m[3]+this.m[1]*v;return this.m[0]=w,this.m[1]=x,this.m[2]=C,this.m[3]=A,this}multiply(v){var S=this.m[0]*v.m[0]+this.m[2]*v.m[1],w=this.m[1]*v.m[0]+this.m[3]*v.m[1],x=this.m[0]*v.m[2]+this.m[2]*v.m[3],C=this.m[1]*v.m[2]+this.m[3]*v.m[3],A=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],T=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=A,this.m[5]=T,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*v,w=-this.m[1]*v,x=-this.m[2]*v,C=this.m[0]*v,A=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=A,this.m[5]=T,this}getMatrix(){return this.m}decompose(){var v=this.m[0],S=this.m[1],w=this.m[2],x=this.m[3],C=this.m[4],A=this.m[5],T=v*x-S*w;let k={x:C,y:A,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||S!=0){var L=Math.sqrt(v*v+S*S);k.rotation=S>0?Math.acos(v/L):-Math.acos(v/L),k.scaleX=L,k.scaleY=T/L,k.skewX=(v*w+S*x)/T,k.skewY=0}else if(w!=0||x!=0){var N=Math.sqrt(w*w+x*x);k.rotation=Math.PI/2-(x>0?Math.acos(-w/N):-Math.acos(w/N)),k.scaleX=T/N,k.scaleY=N,k.skewX=0,k.skewY=(v*w+S*x)/T}return k.rotation=e.Util._getRotation(k.rotation),k}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",s="[object Boolean]",a=Math.PI/180,l=180/Math.PI,u="#",c="",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]},b=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,_=[];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 v=g[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){_.push(g),_.length===1&&y(function(){const v=_;_=[],v.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,v){var S=e.Util.createImageElement();S.onload=function(){v(S)},S.src=g},_rgbToHex(g,v,S){return((1<<24)+(g<<16)+(v<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,c);var v=parseInt(g,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return u+g},getRGB(g){var v;return g in m?(v=m[g],{r:v[0],g:v[1],b:v[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(v=b.exec(g.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[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 v=m[g.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var v=g.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var v=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(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[v,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),w=Number(S[0])/360,x=Number(S[1])/100,C=Number(S[2])/100;let A,T,k;if(x===0)return k=C*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};C<.5?A=C*(1+x):A=C+x-C*x;const L=2*C-A,N=[0,0,0];for(let E=0;E<3;E++)T=w+1/3*-(E-1),T<0&&T++,T>1&&T--,6*T<1?k=L+(A-L)*6*T:2*T<1?k=A:3*T<2?k=L+(A-L)*(2/3-T)*6:k=L,N[E]=k*255;return{r:Math.round(N[0]),g:Math.round(N[1]),b:Math.round(N[2]),a:1}}},haveIntersection(g,v){return!(v.x>g.x+g.width||v.x+v.width<g.x||v.y>g.y+g.height||v.y+v.height<g.y)},cloneObject(g){var v={};for(var S in g)this._isPlainObject(g[S])?v[S]=this.cloneObject(g[S]):this._isArray(g[S])?v[S]=this.cloneArray(g[S]):v[S]=g[S];return v},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,v){for(var S in g)v(S,g[S])},_inRange(g,v,S){return v<=g&&g<S},_getProjectionToSegment(g,v,S,w,x,C){var A,T,k,L=(g-S)*(g-S)+(v-w)*(v-w);if(L==0)A=g,T=v,k=(x-S)*(x-S)+(C-w)*(C-w);else{var N=((x-g)*(S-g)+(C-v)*(w-v))/L;N<0?(A=g,T=v,k=(g-x)*(g-x)+(v-C)*(v-C)):N>1?(A=S,T=w,k=(S-x)*(S-x)+(w-C)*(w-C)):(A=g+N*(S-g),T=v+N*(w-v),k=(A-x)*(A-x)+(T-C)*(T-C))}return[A,T,k]},_getProjectionToLine(g,v,S){var w=e.Util.cloneObject(g),x=Number.MAX_VALUE;return v.forEach(function(C,A){if(!(!S&&A===v.length-1)){var T=v[(A+1)%v.length],k=e.Util._getProjectionToSegment(C.x,C.y,T.x,T.y,g.x,g.y),L=k[0],N=k[1],E=k[2];E<x&&(w.x=L,w.y=N,x=E)}}),w},_prepareArrayForTween(g,v,S){var w,x=[],C=[];if(g.length>v.length){var A=v;v=g,g=A}for(w=0;w<g.length;w+=2)x.push({x:g[w],y:g[w+1]});for(w=0;w<v.length;w+=2)C.push({x:v[w],y:v[w+1]});var T=[];return C.forEach(function(k){var L=e.Util._getProjectionToLine(k,x,S);T.push(L.x),T.push(L.y)}),T},_prepareToStringify(g){var v;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(v=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(v.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(v.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,v){for(var S in v)g[S]=v[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(g,v,S,w){let x=0,C=0,A=0,T=0;typeof w=="number"?x=C=A=T=Math.min(w,v/2,S/2):(x=Math.min(w[0]||0,v/2,S/2),C=Math.min(w[1]||0,v/2,S/2),T=Math.min(w[2]||0,v/2,S/2),A=Math.min(w[3]||0,v/2,S/2)),g.moveTo(x,0),g.lineTo(v-C,0),g.arc(v-C,C,C,Math.PI*3/2,0,!1),g.lineTo(v,S-T),g.arc(v-T,S-T,T,0,Math.PI/2,!1),g.lineTo(A,S),g.arc(A,S-A,A,Math.PI/2,Math.PI,!1),g.lineTo(0,x),g.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(or);var Xn={},Ct={},He={};Object.defineProperty(He,"__esModule",{value:!0});He.getComponentValidator=He.getBooleanValidator=He.getNumberArrayValidator=He.getFunctionValidator=He.getStringOrGradientValidator=He.getStringValidator=He.getNumberOrAutoValidator=He.getNumberOrArrayOfNumbersValidator=He.getNumberValidator=He.alphaComponent=He.RGBComponent=void 0;const hl=Tt,dr=or;function pl(e){return dr.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||dr.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Z0e(e){return e>255?255:e<0?0:Math.round(e)}He.RGBComponent=Z0e;function J0e(e){return e>1?1:e<1e-4?1e-4:e}He.alphaComponent=J0e;function eve(){if(hl.Konva.isUnminified)return function(e,t){return dr.Util._isNumber(e)||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}He.getNumberValidator=eve;function tve(e){if(hl.Konva.isUnminified)return function(t,n){let r=dr.Util._isNumber(t),i=dr.Util._isArray(t)&&t.length==e;return!r&&!i&&dr.Util.warn(pl(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}He.getNumberOrArrayOfNumbersValidator=tve;function nve(){if(hl.Konva.isUnminified)return function(e,t){var n=dr.Util._isNumber(e),r=e==="auto";return n||r||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}He.getNumberOrAutoValidator=nve;function rve(){if(hl.Konva.isUnminified)return function(e,t){return dr.Util._isString(e)||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}He.getStringValidator=rve;function ive(){if(hl.Konva.isUnminified)return function(e,t){const n=dr.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}He.getStringOrGradientValidator=ive;function ove(){if(hl.Konva.isUnminified)return function(e,t){return dr.Util._isFunction(e)||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}He.getFunctionValidator=ove;function sve(){if(hl.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(dr.Util._isArray(e)?e.forEach(function(r){dr.Util._isNumber(r)||dr.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}He.getNumberArrayValidator=sve;function ave(){if(hl.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||dr.Util.warn(pl(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}He.getBooleanValidator=ave;function lve(e){if(hl.Konva.isUnminified)return function(t,n){return t==null||dr.Util.isObject(t)||dr.Util.warn(pl(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}He.getComponentValidator=lve;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=or,n=He;var r="get",i="set";e.Factory={addGetterSetter(o,s,a,l,u){e.Factory.addGetter(o,s,a),e.Factory.addSetter(o,s,l,u),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,a){var l=r+t.Util._capitalize(s);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[s];return u===void 0?a:u}},addSetter(o,s,a,l){var u=i+t.Util._capitalize(s);o.prototype[u]||e.Factory.overWriteSetter(o,s,a,l)},overWriteSetter(o,s,a,l){var u=i+t.Util._capitalize(s);o.prototype[u]=function(c){return a&&c!==void 0&&c!==null&&(c=a.call(this,c,s)),this._setAttr(s,c),l&&l.call(this),this}},addComponentsGetterSetter(o,s,a,l,u){var c=a.length,d=t.Util._capitalize,f=r+d(s),h=i+d(s),p,m;o.prototype[f]=function(){var _={};for(p=0;p<c;p++)m=a[p],_[m]=this.getAttr(s+d(m));return _};var b=(0,n.getComponentValidator)(a);o.prototype[h]=function(_){var y=this.attrs[s],g;l&&(_=l.call(this,_)),b&&b.call(this,_,s);for(g in _)_.hasOwnProperty(g)&&this._setAttr(s+d(g),_[g]);return _||a.forEach(v=>{this._setAttr(s+d(v),void 0)}),this._fireChangeEvent(s,y,_),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var a=t.Util._capitalize(s),l=i+a,u=r+a;o.prototype[s]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,s,a,l){t.Util.error("Adding deprecated "+s);var u=r+t.Util._capitalize(s),c=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(c);var d=this.attrs[s];return d===void 0?a:d},e.Factory.addSetter(o,s,l,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){t.Util.each(s,function(a,l){var u=o.prototype[l],c=r+t.Util._capitalize(a),d=i+t.Util._capitalize(a);function f(){u.apply(this,arguments),t.Util.error('"'+a+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[a]=f,o.prototype[c]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(Ct);var Is={},Xa={};Object.defineProperty(Xa,"__esModule",{value:!0});Xa.HitContext=Xa.SceneContext=Xa.Context=void 0;const ez=or,uve=Tt;function cve(e){var t=[],n=e.length,r=ez.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 $8=",",dve="(",fve=")",hve="([",pve="])",gve=";",mve="()",yve="=",F8=["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"],vve=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const _ve=100;class Bb{constructor(t){this.canvas=t,uve.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",s,a,l,u;for(s=0;s<i;s++)a=r[s],l=a.method,l?(u=a.args,o+=l,t?o+=mve:ez.Util._isArray(u[0])?o+=hve+u.join($8)+pve:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=dve+u.join($8)+fve)):(o+=a.property,t||(o+=yve+a.val)),o+=gve;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=_ve&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,s){this._context.arc(t,n,r,i,o,s)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,s){this._context.bezierCurveTo(t,n,r,i,o,s)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,s){return this._context.createRadialGradient(t,n,r,i,o,s)}drawImage(t,n,r,i,o,s,a,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(t,n,r):c.length===5?d.drawImage(t,n,r,i,o):c.length===9&&d.drawImage(t,n,r,i,o,s,a,l,u)}ellipse(t,n,r,i,o,s,a,l){this._context.ellipse(t,n,r,i,o,s,a,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,s){this._context.setTransform(t,n,r,i,o,s)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,s){this._context.transform(t,n,r,i,o,s)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=F8.length,r=this.setAttr,i,o,s=function(a){var l=t[a],u;t[a]=function(){return o=cve(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:a,args:o}),u}};for(i=0;i<n;i++)s(F8[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)}}Xa.Context=Bb;vve.forEach(function(e){Object.defineProperty(Bb.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class bve extends Bb{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const s=t.getFillRadialGradientColorStops();if(s&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):s&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var s=0;s<i.length;s+=2)o.addColorStop(i[s],i[s+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",s=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,a=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),c=l.x*u,d=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",s*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",a.x*c),this.setAttr("shadowOffsetY",a.y*d)}}Xa.SceneContext=bve;class Sve extends Bb{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()}}}Xa.HitContext=Sve;Object.defineProperty(Is,"__esModule",{value:!0});Is.HitCanvas=Is.SceneCanvas=Is.Canvas=void 0;const E1=or,tz=Xa,nz=Tt,wve=Ct,xve=He;var Wy;function Cve(){if(Wy)return Wy;var e=E1.Util.createCanvasElement(),t=e.getContext("2d");return Wy=function(){var n=nz.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),E1.Util.releaseCanvas(e),Wy}class zb{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||nz.Konva.pixelRatio||Cve();this.pixelRatio=r,this._canvas=E1.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 E1.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Is.Canvas=zb;wve.Factory.addGetterSetter(zb,"pixelRatio",void 0,(0,xve.getNumberValidator)());class Eve extends zb{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new tz.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}Is.SceneCanvas=Eve;class Tve extends zb{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new tz.HitContext(this),this.setSize(t.width,t.height)}}Is.HitCanvas=Tve;var Ub={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Tt,n=or;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,s)=>{const{node:a}=o,l=a.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var c=a.dragDistance(),d=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(d<c||(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(c=>c.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&i.indexOf(u)===-1&&i.push(u)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(Ub);Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Node=void 0;const Rt=or,Fm=Ct,Ky=Is,ju=Tt,Uo=Ub,vr=He;var B0="absoluteOpacity",Xy="allEventListeners",Na="absoluteTransform",B8="absoluteScale",Vu="canvas",Ave="Change",kve="children",Pve="konva",e3="listening",z8="mouseenter",U8="mouseleave",j8="set",V8="Shape",z0=" ",G8="stage",El="transform",Rve="Stage",t3="visible",Ove=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(z0);let Ive=1;class at{constructor(t){this._id=Ive++,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===El||t===Na)&&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===El||t===Na,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(z0);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Vu)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Na&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Vu)){const{scene:t,filter:n,hit:r}=this._cache.get(Vu);Rt.Util.releaseCanvas(t,n,r),this._cache.delete(Vu)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),s=n.pixelRatio,a=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){Rt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,a-=u,l-=u;var f=new Ky.SceneCanvas({pixelRatio:s,width:i,height:o}),h=new Ky.SceneCanvas({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),p=new Ky.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),b=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(Vu),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),m.save(),b.save(),m.translate(-a,-l),b.translate(-a,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(B0),this._clearSelfAndDescendantCache(B8),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,m.restore(),b.restore(),c&&(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(Vu,{scene:f,filter:h,hit:p,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Vu)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,s,a,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=s=c.x,o=a=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),s=Math.max(s,c.x),a=Math.max(a,c.y)}),{x:i,y:o,width:s-i,height:a-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),s,a,l,u;if(t){if(!this._filterUpToDate){var c=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()/c,r.getHeight()/c),a=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<s;l++){if(u=t[l],typeof u!="function"){Rt.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,a),o.putImageData(a,0,0)}}catch(d){Rt.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(Xy),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(z0),i=r.length,o,s,a,l,u;for(o=0;o<i;o++)s=r[o],a=s.split("."),l=a[0],u=a[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(z0),i=r.length,o,s,a,l,u,c;if(this._cache&&this._cache.delete(Xy),!t)for(s in this.eventListeners)this._off(s);for(o=0;o<i;o++)if(a=r[o],l=a.split("."),u=l[0],c=l[1],u)this.eventListeners[u]&&this._off(u,c,n);else for(s in this.eventListeners)this._off(s,c,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var s=o.target.findAncestors(n,!0,i),a=0;a<s.length;a++)o=Rt.Util.cloneObject(o),o.currentTarget=s[a],r.call(s[a],o)})}remove(){return this.isDragging()&&this.stopDrag(),Uo.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Na),this._clearSelfAndDescendantCache(B0),this._clearSelfAndDescendantCache(B8),this._clearSelfAndDescendantCache(G8),this._clearSelfAndDescendantCache(t3),this._clearSelfAndDescendantCache(e3)}_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"+Rt.Util._capitalize(t);return Rt.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!==kve&&(r=j8+Rt.Util._capitalize(n),Rt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(e3,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(t3,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;Uo.DD._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(s.node.nodeType==="Stage"||s.node.getLayer()===r)&&(i=!0)});var o=!n&&!ju.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!==V8&&(i=i.concat(a.getChildren().slice())),a._id===n._id&&(s=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==Rve&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(El),this._clearSelfAndDescendantCache(Na)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Rt.Transform,s=this.offset();return o.m=i.slice(),o.translate(s.x,s.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(El);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(El),this._clearSelfAndDescendantCache(Na),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 Rt.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 Rt.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 Rt.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 Rt.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 Rt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Rt.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(B0,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=Rt.Util.isObject(i)&&!Rt.Util._isPlainObject(i)&&!Rt.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(),Rt.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],Rt.Util.isValidSelector(o)||(Rt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Rt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Rt.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(G8,this._getStage)}_getStage(){var t=this.getParent();if(t)return t.getStage()}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Na,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new Rt.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(Na)||new Rt.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(El,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(El)||new Rt.Transform;r.reset();var i=this.x(),o=this.y(),s=ju.Konva.getAngle(this.rotation()),a=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,c=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),(u!==0||c!==0)&&r.skew(u,c),(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=Rt.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(Pve)<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 Ky.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,Rt.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():ju.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+Ave,{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[j8+Rt.Util._capitalize(t)];return Rt.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(ju.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!Rt.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===V8&&(n.target=this);var i=(t===z8||t===U8)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===z8||t===U8)&&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(Xy))!==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(Xy,o)}return s}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Uo.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){Uo.DD._dragElements.has(this._id)||this._createDragElement(t);const r=Uo.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:Rt.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=Uo.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Uo.DD._endDragBefore(t),Uo.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Uo.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||ju.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;Uo.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=Uo.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Uo.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 Rt.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return Rt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=at.prototype.getClassName.call(t),i=t.children,o,s,a;n&&(t.attrs.container=n),ju.Konva[r]||(Rt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=ju.Konva[r];if(o=new l(t.attrs),i)for(s=i.length,a=0;a<s;a++)o.add(at._createNode(i[a]));return o}}Xn.Node=at;at.prototype.nodeType="Node";at.prototype._attrsAffectingSize=[];at.prototype.eventListeners={};at.prototype.on.call(at.prototype,Ove,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(El),this._clearSelfAndDescendantCache(Na)});at.prototype.on.call(at.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(t3)});at.prototype.on.call(at.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(e3)});at.prototype.on.call(at.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(B0)});const wn=Fm.Factory.addGetterSetter;wn(at,"zIndex");wn(at,"absolutePosition");wn(at,"position");wn(at,"x",0,(0,vr.getNumberValidator)());wn(at,"y",0,(0,vr.getNumberValidator)());wn(at,"globalCompositeOperation","source-over",(0,vr.getStringValidator)());wn(at,"opacity",1,(0,vr.getNumberValidator)());wn(at,"name","",(0,vr.getStringValidator)());wn(at,"id","",(0,vr.getStringValidator)());wn(at,"rotation",0,(0,vr.getNumberValidator)());Fm.Factory.addComponentsGetterSetter(at,"scale",["x","y"]);wn(at,"scaleX",1,(0,vr.getNumberValidator)());wn(at,"scaleY",1,(0,vr.getNumberValidator)());Fm.Factory.addComponentsGetterSetter(at,"skew",["x","y"]);wn(at,"skewX",0,(0,vr.getNumberValidator)());wn(at,"skewY",0,(0,vr.getNumberValidator)());Fm.Factory.addComponentsGetterSetter(at,"offset",["x","y"]);wn(at,"offsetX",0,(0,vr.getNumberValidator)());wn(at,"offsetY",0,(0,vr.getNumberValidator)());wn(at,"dragDistance",null,(0,vr.getNumberValidator)());wn(at,"width",0,(0,vr.getNumberValidator)());wn(at,"height",0,(0,vr.getNumberValidator)());wn(at,"listening",!0,(0,vr.getBooleanValidator)());wn(at,"preventDefault",!0,(0,vr.getBooleanValidator)());wn(at,"filters",null,function(e){return this._filterUpToDate=!1,e});wn(at,"visible",!0,(0,vr.getBooleanValidator)());wn(at,"transformsEnabled","all",(0,vr.getStringValidator)());wn(at,"size");wn(at,"dragBoundFunc");wn(at,"draggable",!1,(0,vr.getBooleanValidator)());Fm.Factory.backCompat(at,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.Container=void 0;const uh=Ct,ww=Xn,jb=He;class Xc extends ww.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=ww.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=ww.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),s=this._getCanvasCache(),a=s&&s.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(a){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),s=this._getCanvasCache(),a=s&&s.hit;if(a){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),s=this.clipWidth(),a=this.clipHeight(),l=this.clipFunc(),u=s&&a||l;const c=r===this;if(u){o.save();var d=this.getAbsoluteTransform(r),f=d.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let b;if(l)b=l.call(this,o,this);else{var h=this.clipX(),p=this.clipY();o.rect(h,p,s,a)}o.clip.apply(o,b),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var m=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(b){b[t](n,r)}),m&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,s,a,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(m){if(m.visible()){var b=m.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});b.width===0&&b.height===0||(o===void 0?(o=b.x,s=b.y,a=b.x+b.width,l=b.y+b.height):(o=Math.min(o,b.x),s=Math.min(s,b.y),a=Math.max(a,b.x+b.width),l=Math.max(l,b.y+b.height)))}});for(var d=this.find("Shape"),f=!1,h=0;h<d.length;h++){var p=d[h];if(p._isVisible(this)){f=!0;break}}return f&&o!==void 0?u={x:o,y:s,width:a-o,height:l-s}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}}Kc.Container=Xc;uh.Factory.addComponentsGetterSetter(Xc,"clip",["x","y","width","height"]);uh.Factory.addGetterSetter(Xc,"clipX",void 0,(0,jb.getNumberValidator)());uh.Factory.addGetterSetter(Xc,"clipY",void 0,(0,jb.getNumberValidator)());uh.Factory.addGetterSetter(Xc,"clipWidth",void 0,(0,jb.getNumberValidator)());uh.Factory.addGetterSetter(Xc,"clipHeight",void 0,(0,jb.getNumberValidator)());uh.Factory.addGetterSetter(Xc,"clipFunc");var rz={},Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.releaseCapture=Ao.setPointerCapture=Ao.hasPointerCapture=Ao.createEvent=Ao.getCapturedShape=void 0;const Mve=Tt,Ug=new Map,iz=Mve.Konva._global.PointerEvent!==void 0;function Nve(e){return Ug.get(e)}Ao.getCapturedShape=Nve;function _T(e){return{evt:e,pointerId:e.pointerId}}Ao.createEvent=_T;function Dve(e,t){return Ug.get(e)===t}Ao.hasPointerCapture=Dve;function Lve(e,t){oz(e),t.getStage()&&(Ug.set(e,t),iz&&t._fire("gotpointercapture",_T(new PointerEvent("gotpointercapture"))))}Ao.setPointerCapture=Lve;function oz(e,t){const n=Ug.get(e);if(!n)return;const r=n.getStage();r&&r.content,Ug.delete(e),iz&&n._fire("lostpointercapture",_T(new PointerEvent("lostpointercapture")))}Ao.releaseCapture=oz;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=or,n=Ct,r=Kc,i=Tt,o=Is,s=Ub,a=Tt,l=Ao;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",b="mousemove",_="mousedown",y="mouseup",g="pointermove",v="pointerdown",S="pointerup",w="pointercancel",x="lostpointercapture",C="pointerout",A="pointerleave",T="pointerover",k="pointerenter",L="contextmenu",N="touchstart",E="touchend",P="touchmove",D="touchcancel",B="wheel",R=5,O=[[m,"_pointerenter"],[_,"_pointerdown"],[b,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[N,"_pointerdown"],[P,"_pointermove"],[E,"_pointerup"],[D,"_pointercancel"],[p,"_pointerover"],[B,"_wheel"],[L,"_contextmenu"],[v,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[x,"_lostpointercapture"]];const I={mouse:{[C]:f,[A]:h,[T]:p,[k]:m,[g]:b,[v]:_,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[A]:"touchleave",[T]:"touchover",[k]:"touchenter",[g]:P,[v]:N,[S]:E,[w]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[A]:A,[T]:T,[k]:k,[g]:g,[v]:v,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},F=Q=>Q.indexOf("pointer")>=0?"pointer":Q.indexOf("touch")>=0?"touch":"mouse",U=Q=>{const j=F(Q);if(j==="pointer")return i.Konva.pointerEventsEnabled&&I.pointer;if(j==="touch")return I.touch;if(j==="mouse")return I.mouse};function V(Q={}){return(Q.clipFunc||Q.clipWidth||Q.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Q}const H="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Y extends r.Container{constructor(j){super(V(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",()=>{V(this.attrs)}),this._checkVisibility()}_validateAdd(j){const K=j.getType()==="Layer",ee=j.getType()==="FastLayer";K||ee||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===c){if(j.charAt(0)==="."){var K=j.slice(1);j=document.getElementsByClassName(K)[0]}else{var ee;j.charAt(0)!=="#"?ee=j:ee=j.slice(1),j=document.getElementById(ee)}if(!j)throw"Can not find container in document with id "+ee}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,K=j.length,ee;for(ee=0;ee<K;ee++)j[ee].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 K=e.stages.indexOf(this);return K>-1&&e.stages.splice(K,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const j=this._pointerPositions[0]||this._changedPointerPositions[0];return j?{x:j.x,y:j.y}:(t.Util.warn(H),null)}_getPointerById(j){return this._pointerPositions.find(K=>K.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 K=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),ee=K.getContext()._context,ie=this.children;return(j.x||j.y)&&ee.translate(-1*j.x,-1*j.y),ie.forEach(function(ge){if(ge.isVisible()){var ae=ge._toKonvaCanvas(j);ee.drawImage(ae._canvas,j.x,j.y,ae.getWidth()/ae.getPixelRatio(),ae.getHeight()/ae.getPixelRatio())}}),K}getIntersection(j){if(!j)return null;var K=this.children,ee=K.length,ie=ee-1,ge;for(ge=ie;ge>=0;ge--){const ae=K[ge].getIntersection(j);if(ae)return ae}return null}_resizeDOM(){var j=this.width(),K=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=K+d),this.bufferCanvas.setSize(j,K),this.bufferHitCanvas.setSize(j,K),this.children.forEach(ee=>{ee.setSize({width:j,height:K}),ee.draw()})}add(j,...K){if(arguments.length>1){for(var ee=0;ee<arguments.length;ee++)this.add(arguments[ee]);return this}super.add(j);var ie=this.children.length;return ie>R&&t.Util.warn("The stage has "+ie+" 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&&O.forEach(([j,K])=>{this.content.addEventListener(j,ee=>{this[K](ee)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const K=U(j.type);this._fire(K.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const K=U(j.type);this._fire(K.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let K=this[j+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(j){const K=U(j.type),ee=F(j.type);if(K){this.setPointersPositions(j);var ie=this._getTargetShape(ee),ge=!s.DD.isDragging||i.Konva.hitOnDragEnabled;ie&&ge?(ie._fireAndBubble(K.pointerout,{evt:j}),ie._fireAndBubble(K.pointerleave,{evt:j}),this._fire(K.pointerleave,{evt:j,target:this,currentTarget:this}),this[ee+"targetShape"]=null):ge&&(this._fire(K.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(j){const K=U(j.type),ee=F(j.type);if(K){this.setPointersPositions(j);var ie=!1;this._changedPointerPositions.forEach(ge=>{var ae=this.getIntersection(ge);if(s.DD.justDragged=!1,i.Konva["_"+ee+"ListenClick"]=!0,!(ae&&ae.isListening()))return;i.Konva.capturePointerEventsEnabled&&ae.setPointerCapture(ge.id),this[ee+"ClickStartShape"]=ae,ae._fireAndBubble(K.pointerdown,{evt:j,pointerId:ge.id}),ie=!0;const et=j.type.indexOf("touch")>=0;ae.preventDefault()&&j.cancelable&&et&&j.preventDefault()}),ie||this._fire(K.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const K=U(j.type),ee=F(j.type);if(!K)return;s.DD.isDragging&&s.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var ie=!s.DD.isDragging||i.Konva.hitOnDragEnabled;if(!ie)return;var ge={};let ae=!1;var dt=this._getTargetShape(ee);this._changedPointerPositions.forEach(et=>{const Ne=l.getCapturedShape(et.id)||this.getIntersection(et),lt=et.id,Te={evt:j,pointerId:lt};var Ht=dt!==Ne;if(Ht&&dt&&(dt._fireAndBubble(K.pointerout,Object.assign({},Te),Ne),dt._fireAndBubble(K.pointerleave,Object.assign({},Te),Ne)),Ne){if(ge[Ne._id])return;ge[Ne._id]=!0}Ne&&Ne.isListening()?(ae=!0,Ht&&(Ne._fireAndBubble(K.pointerover,Object.assign({},Te),dt),Ne._fireAndBubble(K.pointerenter,Object.assign({},Te),dt),this[ee+"targetShape"]=Ne),Ne._fireAndBubble(K.pointermove,Object.assign({},Te))):dt&&(this._fire(K.pointerover,{evt:j,target:this,currentTarget:this,pointerId:lt}),this[ee+"targetShape"]=null)}),ae||this._fire(K.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const K=U(j.type),ee=F(j.type);if(!K)return;this.setPointersPositions(j);const ie=this[ee+"ClickStartShape"],ge=this[ee+"ClickEndShape"];var ae={};let dt=!1;this._changedPointerPositions.forEach(et=>{const Ne=l.getCapturedShape(et.id)||this.getIntersection(et);if(Ne){if(Ne.releaseCapture(et.id),ae[Ne._id])return;ae[Ne._id]=!0}const lt=et.id,Te={evt:j,pointerId:lt};let Ht=!1;i.Konva["_"+ee+"InDblClickWindow"]?(Ht=!0,clearTimeout(this[ee+"DblTimeout"])):s.DD.justDragged||(i.Konva["_"+ee+"InDblClickWindow"]=!0,clearTimeout(this[ee+"DblTimeout"])),this[ee+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ee+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Ne&&Ne.isListening()?(dt=!0,this[ee+"ClickEndShape"]=Ne,Ne._fireAndBubble(K.pointerup,Object.assign({},Te)),i.Konva["_"+ee+"ListenClick"]&&ie&&ie===Ne&&(Ne._fireAndBubble(K.pointerclick,Object.assign({},Te)),Ht&&ge&&ge===Ne&&Ne._fireAndBubble(K.pointerdblclick,Object.assign({},Te)))):(this[ee+"ClickEndShape"]=null,i.Konva["_"+ee+"ListenClick"]&&this._fire(K.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:lt}),Ht&&this._fire(K.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:lt}))}),dt||this._fire(K.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ee+"ListenClick"]=!1,j.cancelable&&ee!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(B,{evt:j}):this._fire(B,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const K=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var K=this._getContentPosition(),ee=null,ie=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,ge=>{this._pointerPositions.push({id:ge.identifier,x:(ge.clientX-K.left)/K.scaleX,y:(ge.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,ge=>{this._changedPointerPositions.push({id:ge.identifier,x:(ge.clientX-K.left)/K.scaleX,y:(ge.clientY-K.top)/K.scaleY})})):(ee=(j.clientX-K.left)/K.scaleX,ie=(j.clientY-K.top)/K.scaleY,this.pointerPos={x:ee,y:ie},this._pointerPositions=[{x:ee,y:ie,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:ee,y:ie,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=Y,Y.prototype.nodeType=u,(0,a._registerNode)(Y),n.Factory.addGetterSetter(Y,"container")})(rz);var Bm={},Ur={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Tt,n=or,r=Ct,i=Xn,o=He,s=Tt,a=Ao;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(A){const T=this.attrs.fillRule;T?A.fill(T):A.fill()}function b(A){A.stroke()}function _(A){A.fill()}function y(A){A.stroke()}function g(){this._clearCache(l)}function v(){this._clearCache(u)}function S(){this._clearCache(c)}function w(){this._clearCache(d)}function x(){this._clearCache(f)}class C extends i.Node{constructor(T){super(T);let k;for(;k=n.Util.getRandomColor(),!(k&&!(k in e.shapes)););this.colorKey=k,e.shapes[k]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var T=p();const k=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(k&&k.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 N=L.getMatrix(),E=typeof DOMMatrix>"u"?{a:N[0],b:N[1],c:N[2],d:N[3],e:N[4],f:N[5]}:new DOMMatrix(N);k.setTransform(E)}return k}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var k=p(),L=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),E=k.createLinearGradient(L.x,L.y,N.x,N.y),P=0;P<T.length;P+=2)E.addColorStop(T[P],T[P+1]);return E}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var k=p(),L=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),E=k.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius()),P=0;P<T.length;P+=2)E.addColorStop(T[P],T[P+1]);return E}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var T=n.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.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 T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){var k=this.getStage(),L=k.bufferHitCanvas,N;return L.getContext().clear(),this.drawHit(L,null,!0),N=L.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data,N[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var k;if(!this.getStage()||!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const N=T||this.hasFill(),E=this.hasStroke(),P=this.getAbsoluteOpacity()!==1;if(N&&E&&P)return!0;const D=this.hasShadow(),B=this.shadowForStrokeEnabled();return!!(N&&E&&D&&B)}setStrokeHitEnabled(T){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){const k=T.skipTransform,L=T.relativeTo,N=this.getSelfRect(),P=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=N.width+P,B=N.height+P,R=!T.skipShadow&&this.hasShadow(),O=R?this.shadowOffsetX():0,I=R?this.shadowOffsetY():0,F=D+Math.abs(O),U=B+Math.abs(I),V=R&&this.shadowBlur()||0,H=F+V*2,Y=U+V*2,Q={width:H,height:Y,x:-(P/2+V)+Math.min(O,0)+N.x,y:-(P/2+V)+Math.min(I,0)+N.y};return k?Q:this._transformedRect(Q,L)}drawScene(T,k){var L=this.getLayer(),N=T||L.getCanvas(),E=N.getContext(),P=this._getCanvasCache(),D=this.getSceneFunc(),B=this.hasShadow(),R,O,I,F=N.isCache,U=k===this;if(!this.isVisible()&&!U)return this;if(P){E.save();var V=this.getAbsoluteTransform(k).getMatrix();return E.transform(V[0],V[1],V[2],V[3],V[4],V[5]),this._drawCachedSceneCanvas(E),E.restore(),this}if(!D)return this;if(E.save(),this._useBufferCanvas()&&!F){R=this.getStage(),O=R.bufferCanvas,I=O.getContext(),I.clear(),I.save(),I._applyLineJoin(this);var H=this.getAbsoluteTransform(k).getMatrix();I.transform(H[0],H[1],H[2],H[3],H[4],H[5]),D.call(this,I,this),I.restore();var Y=O.pixelRatio;B&&E._applyShadow(this),E._applyOpacity(this),E._applyGlobalCompositeOperation(this),E.drawImage(O._canvas,0,0,O.width/Y,O.height/Y)}else{if(E._applyLineJoin(this),!U){var H=this.getAbsoluteTransform(k).getMatrix();E.transform(H[0],H[1],H[2],H[3],H[4],H[5]),E._applyOpacity(this),E._applyGlobalCompositeOperation(this)}B&&E._applyShadow(this),D.call(this,E,this)}return E.restore(),this}drawHit(T,k,L=!1){if(!this.shouldDrawHit(k,L))return this;var N=this.getLayer(),E=T||N.hitCanvas,P=E&&E.getContext(),D=this.hitFunc()||this.sceneFunc(),B=this._getCanvasCache(),R=B&&B.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()"),R){P.save();var O=this.getAbsoluteTransform(k).getMatrix();return P.transform(O[0],O[1],O[2],O[3],O[4],O[5]),this._drawCachedHitCanvas(P),P.restore(),this}if(!D)return this;if(P.save(),P._applyLineJoin(this),!(this===k)){var F=this.getAbsoluteTransform(k).getMatrix();P.transform(F[0],F[1],F[2],F[3],F[4],F[5])}return D.call(this,P,this),P.restore(),this}drawHitFromCache(T=0){var k=this._getCanvasCache(),L=this._getCachedSceneCanvas(),N=k.hit,E=N.getContext(),P=N.getWidth(),D=N.getHeight(),B,R,O,I,F,U;E.clear(),E.drawImage(L._canvas,0,0,P,D);try{for(B=E.getImageData(0,0,P,D),R=B.data,O=R.length,I=n.Util._hexToRgb(this.colorKey),F=0;F<O;F+=4)U=R[F+3],U>T?(R[F]=I.r,R[F+1]=I.g,R[F+2]=I.b,R[F+3]=255):R[F+3]=0;E.putImageData(B,0,0)}catch(V){n.Util.error("Unable to draw hit graph from cached scene canvas. "+V.message)}return this}hasPointerCapture(T){return a.hasPointerCapture(T,this)}setPointerCapture(T){a.setPointerCapture(T,this)}releaseCapture(T){a.releaseCapture(T,this)}}e.Shape=C,C.prototype._fillFunc=m,C.prototype._strokeFunc=b,C.prototype._fillFuncHit=_,C.prototype._strokeFuncHit=y,C.prototype._centroid=!1,C.prototype.nodeType="Shape",(0,s._registerNode)(C),C.prototype.eventListeners={},C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",S),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),r.Factory.addGetterSetter(C,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(C,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(C,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"lineJoin"),r.Factory.addGetterSetter(C,"lineCap"),r.Factory.addGetterSetter(C,"sceneFunc"),r.Factory.addGetterSetter(C,"hitFunc"),r.Factory.addGetterSetter(C,"dash"),r.Factory.addGetterSetter(C,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(C,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(C,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternImage"),r.Factory.addGetterSetter(C,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(C,"fillEnabled",!0),r.Factory.addGetterSetter(C,"strokeEnabled",!0),r.Factory.addGetterSetter(C,"shadowEnabled",!0),r.Factory.addGetterSetter(C,"dashEnabled",!0),r.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(C,"fillPriority","color"),r.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(C,"fillPatternRotation",0),r.Factory.addGetterSetter(C,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Ur);Object.defineProperty(Bm,"__esModule",{value:!0});Bm.Layer=void 0;const Ra=or,xw=Kc,bd=Xn,bT=Ct,H8=Is,$ve=He,Fve=Ur,Bve=Tt;var zve="#",Uve="beforeDraw",jve="draw",sz=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Vve=sz.length;class ch extends xw.Container{constructor(t){super(t),this.canvas=new H8.SceneCanvas,this.hitCanvas=new H8.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(){bd.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=bd.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(bd.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(bd.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 bd.Node.prototype.remove.call(this),t&&t.parentNode&&Ra.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"&&Ra.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(),bd.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(){Ra.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ra.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ra.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<Vve;i++){const o=sz[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=Ra.Util._rgbToHex(r[0],r[1],r[2]),s=Fve.shapes[zve+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(Uve,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),xw.Container.prototype.drawScene.call(this,i,n),this._fire(jve,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),xw.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Ra.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Ra.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 Ra.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Bm.Layer=ch;ch.prototype.nodeType="Layer";(0,Bve._registerNode)(ch);bT.Factory.addGetterSetter(ch,"imageSmoothingEnabled",!0);bT.Factory.addGetterSetter(ch,"clearBeforeDraw",!0);bT.Factory.addGetterSetter(ch,"hitGraphEnabled",!0,(0,$ve.getBooleanValidator)());var Vb={};Object.defineProperty(Vb,"__esModule",{value:!0});Vb.FastLayer=void 0;const Gve=or,Hve=Bm,qve=Tt;class ST extends Hve.Layer{constructor(t){super(t),this.listening(!1),Gve.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Vb.FastLayer=ST;ST.prototype.nodeType="FastLayer";(0,qve._registerNode)(ST);var dh={};Object.defineProperty(dh,"__esModule",{value:!0});dh.Group=void 0;const Wve=or,Kve=Kc,Xve=Tt;class wT extends Kve.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&Wve.Util.throw("You may only add groups and shapes to groups.")}}dh.Group=wT;wT.prototype.nodeType="Group";(0,Xve._registerNode)(wT);var fh={};Object.defineProperty(fh,"__esModule",{value:!0});fh.Animation=void 0;const Cw=Tt,q8=or;var Ew=function(){return Cw.glob.performance&&Cw.glob.performance.now?function(){return Cw.glob.performance.now()}:function(){return new Date().getTime()}}();class ea{constructor(t,n){this.id=ea.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Ew(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t=ea,n=t.animations,r=n.length,i;for(i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Ew(),ea._addAnimation(this),this}stop(){return ea._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var n=t.id,r=this.animations,i=r.length,o;for(o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){var t={},n=this.animations,r,i,o,s,a,l,u,c,d;for(s=0;s<n.length;s++)if(r=n[s],i=r.layers,o=r.func,r._updateFrameObject(Ew()),l=i.length,o?d=o.call(r,r.frame)!==!1:d=!0,!!d)for(a=0;a<l;a++)u=i[a],u._id!==void 0&&(t[u._id]=u);for(c in t)t.hasOwnProperty(c)&&t[c].batchDraw()}static _animationLoop(){var t=ea;t.animations.length?(t._runFrames(),q8.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,q8.Util.requestAnimFrame(this._animationLoop))}}fh.Animation=ea;ea.animations=[];ea.animIdCounter=0;ea.animRunning=!1;var az={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=or,n=fh,r=Xn,i=Tt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,a=2,l=3,u=0,c=["fill","stroke","shadowColor"];class d{constructor(p,m,b,_,y,g,v){this.prop=p,this.propFunc=m,this.begin=_,this._pos=_,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=b,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,b=p.node,_=b._id,y,g=p.easing||e.Easings.Linear,v=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=b,this._id=u++;var w=b.getLayer()||(b instanceof i.Konva.Stage?b.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(x){m._tweenFunc(x)},g,0,1,y*1e3,v),this._addListeners(),f.attrs[_]||(f.attrs[_]={}),f.attrs[_][this._id]||(f.attrs[_][this._id]={}),f.tweens[_]||(f.tweens[_]={});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 b=this.node,_=b._id,y,g,v,S,w,x,C,A;if(v=f.tweens[_][p],v&&delete f.attrs[_][v][p],y=b.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?(C=y,y=t.Util._prepareArrayForTween(y,m,b.closed())):(x=m,m=t.Util._prepareArrayForTween(m,y,b.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-y[S]);else{var T=t.Util.colorToRGBA(y[S]);A=t.Util.colorToRGBA(m[S]),y[S]=T,g.push({r:A.r-T.r,g:A.g-T.g,b:A.b-T.b,a:A.a-T.a})}else for(S=0;S<w;S++)g.push(m[S]-y[S]);else c.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),A=t.Util.colorToRGBA(m),g={r:A.r-y.r,g:A.g-y.g,b:A.b-y.b,a:A.a-y.a}):g=m-y;f.attrs[_][this._id][p]={start:y,diff:g,end:m,trueEnd:x,trueStart:C},f.tweens[_][p]=this._id}_tweenFunc(p){var m=this.node,b=f.attrs[m._id][this._id],_,y,g,v,S,w,x,C;for(_ in b){if(y=b[_],g=y.start,v=y.diff,C=y.end,t.Util._isArray(g))if(S=[],x=Math.max(g.length,C.length),_.indexOf("fill")===0)for(w=0;w<x;w++)w%2===0?S.push((g[w]||0)+v[w]*p):S.push("rgba("+Math.round(g[w].r+v[w].r*p)+","+Math.round(g[w].g+v[w].g*p)+","+Math.round(g[w].b+v[w].b*p)+","+(g[w].a+v[w].a*p)+")");else for(w=0;w<x;w++)S.push((g[w]||0)+v[w]*p);else c.indexOf(_)!==-1?S="rgba("+Math.round(g.r+v.r*p)+","+Math.round(g.g+v.g*p)+","+Math.round(g.b+v.b*p)+","+(g.a+v.a*p)+")":S=g+v*p;m.setAttr(_,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,b=f.tweens[p],_;this.pause();for(_ in b)delete f.tweens[p][_];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,b){var _=1.70158;return m*(h/=b)*h*((_+1)*h-_)+p},BackEaseOut(h,p,m,b){var _=1.70158;return m*((h=h/b-1)*h*((_+1)*h+_)+1)+p},BackEaseInOut(h,p,m,b){var _=1.70158;return(h/=b/2)<1?m/2*(h*h*(((_*=1.525)+1)*h-_))+p:m/2*((h-=2)*h*(((_*=1.525)+1)*h+_)+2)+p},ElasticEaseIn(h,p,m,b,_,y){var g=0;return h===0?p:(h/=b)===1?p+m:(y||(y=b*.3),!_||_<Math.abs(m)?(_=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/_),-(_*Math.pow(2,10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,m,b,_,y){var g=0;return h===0?p:(h/=b)===1?p+m:(y||(y=b*.3),!_||_<Math.abs(m)?(_=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/_),_*Math.pow(2,-10*h)*Math.sin((h*b-g)*(2*Math.PI)/y)+m+p)},ElasticEaseInOut(h,p,m,b,_,y){var g=0;return h===0?p:(h/=b/2)===2?p+m:(y||(y=b*(.3*1.5)),!_||_<Math.abs(m)?(_=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/_),h<1?-.5*(_*Math.pow(2,10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/y))+p:_*Math.pow(2,-10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/y)*.5+m+p)},BounceEaseOut(h,p,m,b){return(h/=b)<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,b){return m-e.Easings.BounceEaseOut(b-h,0,m,b)+p},BounceEaseInOut(h,p,m,b){return h<b/2?e.Easings.BounceEaseIn(h*2,0,m,b)*.5+p:e.Easings.BounceEaseOut(h*2-b,0,m,b)*.5+m*.5+p},EaseIn(h,p,m,b){return m*(h/=b)*h+p},EaseOut(h,p,m,b){return-m*(h/=b)*(h-2)+p},EaseInOut(h,p,m,b){return(h/=b/2)<1?m/2*h*h+p:-m/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,m,b){return m*(h/=b)*h*h*h*h+p},StrongEaseOut(h,p,m,b){return m*((h=h/b-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,m,b){return(h/=b/2)<1?m/2*h*h*h*h*h+p:m/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,m,b){return m*h/b+p}}})(az);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Tt,n=or,r=Xn,i=Kc,o=rz,s=Bm,a=Vb,l=dh,u=Ub,c=Ur,d=fh,f=az,h=Xa,p=Is;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:a.FastLayer,Group:l.Group,DD:u.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(JB);var Gb={};Object.defineProperty(Gb,"__esModule",{value:!0});Gb.Arc=void 0;const Hb=Ct,Qve=Ur,W8=Tt,qb=He,Yve=Tt;class gl extends Qve.Shape{_sceneFunc(t){var n=W8.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=W8.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),s=1,a=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),u=o*(o>0?t:n),c=s*n,d=a*(a>0?t:n),f=l*(l>0?n:t);return{x:u,y:r?-1*f:d,width:c-u,height:f-d}}}Gb.Arc=gl;gl.prototype._centroid=!0;gl.prototype.className="Arc";gl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Yve._registerNode)(gl);Hb.Factory.addGetterSetter(gl,"innerRadius",0,(0,qb.getNumberValidator)());Hb.Factory.addGetterSetter(gl,"outerRadius",0,(0,qb.getNumberValidator)());Hb.Factory.addGetterSetter(gl,"angle",0,(0,qb.getNumberValidator)());Hb.Factory.addGetterSetter(gl,"clockwise",!1,(0,qb.getBooleanValidator)());var Wb={},zm={};Object.defineProperty(zm,"__esModule",{value:!0});zm.Line=void 0;const Kb=Ct,Zve=Ur,lz=He,Jve=Tt;function n3(e,t,n,r,i,o,s){var a=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=s*a/(a+l),c=s*l/(a+l),d=n-u*(i-e),f=r-u*(o-t),h=n+c*(i-e),p=r+c*(o-t);return[d,f,h,p]}function K8(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=n3(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 Ou extends Zve.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),s=this.bezier(),a,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(a=this.getTensionPoints(),l=a.length,u=o?0:4,o||t.quadraticCurveTo(a[0],a[1],a[2],a[3]);u<l-2;)t.bezierCurveTo(a[u++],a[u++],a[u++],a[u++],a[u++],a[u++]);o||t.quadraticCurveTo(a[l-2],a[l-1],n[r-2],n[r-1])}else if(s)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():K8(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=n3(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=n3(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),s=K8(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}}}zm.Line=Ou;Ou.prototype.className="Line";Ou.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Jve._registerNode)(Ou);Kb.Factory.addGetterSetter(Ou,"closed",!1);Kb.Factory.addGetterSetter(Ou,"bezier",!1);Kb.Factory.addGetterSetter(Ou,"tension",0,(0,lz.getNumberValidator)());Kb.Factory.addGetterSetter(Ou,"points",[],(0,lz.getNumberArrayValidator)());var hh={},uz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(s,a,l)=>{let u,c,d;u=l/2,c=0;for(let h=0;h<20;h++)d=u*e.tValues[20][h]+u,c+=e.cValues[20][h]*r(s,a,d);return u*c};e.getCubicArcLength=t;const n=(s,a,l)=>{l===void 0&&(l=1);const u=s[0]-2*s[1]+s[2],c=a[0]-2*a[1]+a[2],d=2*s[1]-2*s[0],f=2*a[1]-2*a[0],h=4*(u*u+c*c),p=4*(u*d+c*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 b=p/(2*h),_=m/h,y=l+b,g=_-b*b,v=y*y+g>0?Math.sqrt(y*y+g):0,S=b*b+g>0?Math.sqrt(b*b+g):0,w=b+Math.sqrt(b*b+g)!==0?g*Math.log(Math.abs((y+v)/(b+S))):0;return Math.sqrt(h)/2*(y*v-b*S+w)};e.getQuadraticArcLength=n;function r(s,a,l){const u=i(1,l,s),c=i(1,l,a),d=u*u+c*c;return Math.sqrt(d)}const i=(s,a,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(s===0){d=0;for(let f=0;f<=u;f++)d+=e.binomialCoefficients[u][f]*Math.pow(1-a,u-f)*Math.pow(a,f)*l[f];return d}else{c=new Array(u);for(let f=0;f<u;f++)c[f]=u*(l[f+1]-l[f]);return i(s-1,a,c)}},o=(s,a,l)=>{let u=1,c=s/a,d=(s-l(c))/a,f=0;for(;u>.001;){const h=l(c+d),p=Math.abs(s-h)/a;if(p<u)u=p,c+=d;else{const m=l(c-d),b=Math.abs(s-m)/a;b<u?(u=b,c-=d):d/=2}if(f++,f>500)break}return c};e.t2length=o})(uz);Object.defineProperty(hh,"__esModule",{value:!0});hh.Path=void 0;const e1e=Ct,t1e=Ur,n1e=Tt,Sd=uz;class Nr extends t1e.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Nr.parsePathData(this.data()),this.pathLength=Nr.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,s=n[i].points;switch(o){case"L":t.lineTo(s[0],s[1]);break;case"M":t.moveTo(s[0],s[1]);break;case"C":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"Q":t.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case"A":var a=s[0],l=s[1],u=s[2],c=s[3],d=s[4],f=s[5],h=s[6],p=s[7],m=u>c?u:c,b=u>c?1:u/c,_=u>c?c/u:1;t.translate(a,l),t.rotate(h),t.scale(b,_),t.arc(0,0,m,d,d+f,1-p),t.scale(1/b,1/_),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(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],f=u.points[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),d<0)for(let p=c-h;p>f;p-=h){const m=Nr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}else for(let p=c+h;p<f;p+=h){const m=Nr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}}else if(u.command==="C")for(let p=0;p<=1;p+=.01){const m=Nr.getPointOnCubicBezier(p,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(m.x,m.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],isNaN(s)||(n=Math.min(n,s),r=Math.max(r,s)),isNaN(a)||(i=Math.min(i,a),o=Math.max(o,a));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return Nr.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 Nr.getPointOnLine(t,s.start.x,s.start.y,a[0],a[1]);case"C":return Nr.getPointOnCubicBezier((0,Sd.t2length)(t,Nr.getPathLength(n),m=>(0,Sd.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 Nr.getPointOnQuadraticBezier((0,Sd.t2length)(t,Nr.getPathLength(n),m=>(0,Sd.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],u=a[1],c=a[2],d=a[3],f=a[4],h=a[5],p=a[6];return f+=h*t/s.pathLength,Nr.getPointOnEllipticalArc(l,u,c,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),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var c=l*u,d;if(i===n)d={x:s,y:a+c};else if((a-r)/(s-n+1e-8)===l)d={x:s+u,y:a+c};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 b=this.getLineLength(s,a,f,h),_=Math.sqrt(t*t-b*b);u=Math.sqrt(_*_/(1+l*l)),i<n&&(u*=-1),c=l*u,d={x:f+u,y:h+c}}return d}static getPointOnCubicBezier(t,n,r,i,o,s,a,l,u){function c(b){return b*b*b}function d(b){return 3*b*b*(1-b)}function f(b){return 3*b*(1-b)*(1-b)}function h(b){return(1-b)*(1-b)*(1-b)}var p=l*c(t)+s*d(t)+i*f(t)+n*h(t),m=u*c(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 u(h){return 2*h*(1-h)}function c(h){return(1-h)*(1-h)}var d=s*l(t)+i*u(t)+n*c(t),f=a*l(t)+o*u(t)+r*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,s){var a=Math.cos(s),l=Math.sin(s),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*a-u.y*l),y:n+(u.x*l+u.y*a)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var o=n.split("|"),s=[],a=[],l=0,u=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(i=1;i<o.length;i++){var f=o[i],h=f.charAt(0);for(f=f.slice(1),a.length=0;d=c.exec(f);)a.push(d[0]);for(var p=[],m=0,b=a.length;m<b;m++){if(a[m]==="00"){p.push(0,0);continue}var _=parseFloat(a[m]);isNaN(_)?p.push(0):p.push(_)}for(;p.length>0&&!isNaN(p[0]);){var y=null,g=[],v=l,S=u,w,x,C,A,T,k,L,N,E,P;switch(h){case"l":l+=p.shift(),u+=p.shift(),y="L",g.push(l,u);break;case"L":l=p.shift(),u=p.shift(),g.push(l,u);break;case"m":var D=p.shift(),B=p.shift();if(l+=D,u+=B,y="M",s.length>2&&s[s.length-1].command==="z"){for(var R=s.length-2;R>=0;R--)if(s[R].command==="M"){l=s[R].points[0]+D,u=s[R].points[1]+B;break}}g.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),y="M",g.push(l,u),h="L";break;case"h":l+=p.shift(),y="L",g.push(l,u);break;case"H":l=p.shift(),y="L",g.push(l,u);break;case"v":u+=p.shift(),y="L",g.push(l,u);break;case"V":u=p.shift(),y="L",g.push(l,u);break;case"C":g.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"c":g.push(l+p.shift(),u+p.shift(),l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"S":x=l,C=u,w=s[s.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,p.shift(),p.shift()),l=p.shift(),u=p.shift(),y="C",g.push(l,u);break;case"s":x=l,C=u,w=s[s.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"Q":g.push(p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"q":g.push(l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="Q",g.push(l,u);break;case"T":x=l,C=u,w=s[s.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l=p.shift(),u=p.shift(),y="Q",g.push(x,C,l,u);break;case"t":x=l,C=u,w=s[s.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l+=p.shift(),u+=p.shift(),y="Q",g.push(x,C,l,u);break;case"A":A=p.shift(),T=p.shift(),k=p.shift(),L=p.shift(),N=p.shift(),E=l,P=u,l=p.shift(),u=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,P,l,u,L,N,A,T,k);break;case"a":A=p.shift(),T=p.shift(),k=p.shift(),L=p.shift(),N=p.shift(),E=l,P=u,l+=p.shift(),u+=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,P,l,u,L,N,A,T,k);break}s.push({command:y||h,points:g,start:{x:v,y:S},pathLength:this.calcLength(v,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,u=Nr;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,Sd.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Sd.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var c=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),d<0)for(l=c-h;l>f;l-=h)a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),s=a;else for(l=c+h;l<f;l+=h)a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),s=a;return a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,s,a,l,u){var c=u*(Math.PI/180),d=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,f=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,h=d*d/(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,b=p*-l*d/a,_=(t+r)/2+Math.cos(c)*m-Math.sin(c)*b,y=(n+i)/2+Math.sin(c)*m+Math.cos(c)*b,g=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},v=function(T,k){return(T[0]*k[0]+T[1]*k[1])/(g(T)*g(k))},S=function(T,k){return(T[0]*k[1]<T[1]*k[0]?-1:1)*Math.acos(v(T,k))},w=S([1,0],[(d-m)/a,(f-b)/l]),x=[(d-m)/a,(f-b)/l],C=[(-1*d-m)/a,(-1*f-b)/l],A=S(x,C);return v(x,C)<=-1&&(A=Math.PI),v(x,C)>=1&&(A=0),s===0&&A>0&&(A=A-2*Math.PI),s===1&&A<0&&(A=A+2*Math.PI),[_,y,a,l,w,A,c,s]}}hh.Path=Nr;Nr.prototype.className="Path";Nr.prototype._attrsAffectingSize=["data"];(0,n1e._registerNode)(Nr);e1e.Factory.addGetterSetter(Nr,"data");Object.defineProperty(Wb,"__esModule",{value:!0});Wb.Arrow=void 0;const Xb=Ct,r1e=zm,cz=He,i1e=Tt,X8=hh;class Qc extends r1e.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var s=this.pointerLength(),a=r.length,l,u;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[a-2],r[a-1]],h=X8.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=X8.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,u=r[a-1]-p.y}else l=r[a-2]-r[a-4],u=r[a-1]-r[a-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[a-2],r[a-1]),t.rotate(c),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],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-s,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}}}Wb.Arrow=Qc;Qc.prototype.className="Arrow";(0,i1e._registerNode)(Qc);Xb.Factory.addGetterSetter(Qc,"pointerLength",10,(0,cz.getNumberValidator)());Xb.Factory.addGetterSetter(Qc,"pointerWidth",10,(0,cz.getNumberValidator)());Xb.Factory.addGetterSetter(Qc,"pointerAtBeginning",!1);Xb.Factory.addGetterSetter(Qc,"pointerAtEnding",!0);var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0});Qb.Circle=void 0;const o1e=Ct,s1e=Ur,a1e=He,l1e=Tt;let ph=class extends s1e.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)}};Qb.Circle=ph;ph.prototype._centroid=!0;ph.prototype.className="Circle";ph.prototype._attrsAffectingSize=["radius"];(0,l1e._registerNode)(ph);o1e.Factory.addGetterSetter(ph,"radius",0,(0,a1e.getNumberValidator)());var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0});Yb.Ellipse=void 0;const xT=Ct,u1e=Ur,dz=He,c1e=Tt;class Iu extends u1e.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)}}Yb.Ellipse=Iu;Iu.prototype.className="Ellipse";Iu.prototype._centroid=!0;Iu.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,c1e._registerNode)(Iu);xT.Factory.addComponentsGetterSetter(Iu,"radius",["x","y"]);xT.Factory.addGetterSetter(Iu,"radiusX",0,(0,dz.getNumberValidator)());xT.Factory.addGetterSetter(Iu,"radiusY",0,(0,dz.getNumberValidator)());var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0});Zb.Image=void 0;const Tw=or,Yc=Ct,d1e=Ur,f1e=Tt,Um=He;let wa=class fz extends d1e.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?Tw.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?Tw.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=Tw.Util.createImageElement();i.onload=function(){var o=new fz({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};Zb.Image=wa;wa.prototype.className="Image";(0,f1e._registerNode)(wa);Yc.Factory.addGetterSetter(wa,"cornerRadius",0,(0,Um.getNumberOrArrayOfNumbersValidator)(4));Yc.Factory.addGetterSetter(wa,"image");Yc.Factory.addComponentsGetterSetter(wa,"crop",["x","y","width","height"]);Yc.Factory.addGetterSetter(wa,"cropX",0,(0,Um.getNumberValidator)());Yc.Factory.addGetterSetter(wa,"cropY",0,(0,Um.getNumberValidator)());Yc.Factory.addGetterSetter(wa,"cropWidth",0,(0,Um.getNumberValidator)());Yc.Factory.addGetterSetter(wa,"cropHeight",0,(0,Um.getNumberValidator)());var qf={};Object.defineProperty(qf,"__esModule",{value:!0});qf.Tag=qf.Label=void 0;const Jb=Ct,h1e=Ur,p1e=dh,CT=He,hz=Tt;var pz=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],g1e="Change.konva",m1e="none",r3="up",i3="right",o3="down",s3="left",y1e=pz.length;class ET extends p1e.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<y1e;r++)t.on(pz[r]+g1e,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,s,a,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),s=n.pointerWidth(),u=n.pointerHeight(),a=0,l=0,o){case r3:a=r/2,l=-1*u;break;case i3:a=r+s,l=i/2;break;case o3:a=r/2,l=i+u;break;case s3: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})}}}qf.Label=ET;ET.prototype.className="Label";(0,hz._registerNode)(ET);class Zc extends h1e.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),s=this.pointerHeight(),a=this.cornerRadius();let l=0,u=0,c=0,d=0;typeof a=="number"?l=u=c=d=Math.min(a,n/2,r/2):(l=Math.min(a[0]||0,n/2,r/2),u=Math.min(a[1]||0,n/2,r/2),d=Math.min(a[2]||0,n/2,r/2),c=Math.min(a[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===r3&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*s),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===i3&&(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===o3&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+s),t.lineTo((n-o)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===s3&&(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===r3?(n-=i,a+=i):o===o3?a+=i:o===s3?(t-=r*1.5,s+=r):o===i3&&(s+=r*1.5),{x:t,y:n,width:s,height:a}}}qf.Tag=Zc;Zc.prototype.className="Tag";(0,hz._registerNode)(Zc);Jb.Factory.addGetterSetter(Zc,"pointerDirection",m1e);Jb.Factory.addGetterSetter(Zc,"pointerWidth",0,(0,CT.getNumberValidator)());Jb.Factory.addGetterSetter(Zc,"pointerHeight",0,(0,CT.getNumberValidator)());Jb.Factory.addGetterSetter(Zc,"cornerRadius",0,(0,CT.getNumberOrArrayOfNumbersValidator)(4));var jm={};Object.defineProperty(jm,"__esModule",{value:!0});jm.Rect=void 0;const v1e=Ct,_1e=Ur,b1e=Tt,S1e=or,w1e=He;let eS=class extends _1e.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?S1e.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};jm.Rect=eS;eS.prototype.className="Rect";(0,b1e._registerNode)(eS);v1e.Factory.addGetterSetter(eS,"cornerRadius",0,(0,w1e.getNumberOrArrayOfNumbersValidator)(4));var tS={};Object.defineProperty(tS,"__esModule",{value:!0});tS.RegularPolygon=void 0;const gz=Ct,x1e=Ur,mz=He,C1e=Tt;class Jc extends x1e.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)}}tS.RegularPolygon=Jc;Jc.prototype.className="RegularPolygon";Jc.prototype._centroid=!0;Jc.prototype._attrsAffectingSize=["radius"];(0,C1e._registerNode)(Jc);gz.Factory.addGetterSetter(Jc,"radius",0,(0,mz.getNumberValidator)());gz.Factory.addGetterSetter(Jc,"sides",0,(0,mz.getNumberValidator)());var nS={};Object.defineProperty(nS,"__esModule",{value:!0});nS.Ring=void 0;const yz=Ct,E1e=Ur,vz=He,T1e=Tt;var Q8=Math.PI*2;class ed extends E1e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,Q8,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),Q8,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)}}nS.Ring=ed;ed.prototype.className="Ring";ed.prototype._centroid=!0;ed.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,T1e._registerNode)(ed);yz.Factory.addGetterSetter(ed,"innerRadius",0,(0,vz.getNumberValidator)());yz.Factory.addGetterSetter(ed,"outerRadius",0,(0,vz.getNumberValidator)());var rS={};Object.defineProperty(rS,"__esModule",{value:!0});rS.Sprite=void 0;const td=Ct,A1e=Ur,k1e=fh,_z=He,P1e=Tt;class xa extends A1e.Shape{constructor(t){super(t),this._updated=!0,this.anim=new k1e.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),d)if(s){var f=s[n],h=r*2;t.drawImage(d,a,l,u,c,f[h+0],f[h+1],u,c)}else t.drawImage(d,a,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+2],l=o[i+3];if(t.beginPath(),s){var u=s[n],c=r*2;t.rect(u[c+0],u[c+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)}}rS.Sprite=xa;xa.prototype.className="Sprite";(0,P1e._registerNode)(xa);td.Factory.addGetterSetter(xa,"animation");td.Factory.addGetterSetter(xa,"animations");td.Factory.addGetterSetter(xa,"frameOffsets");td.Factory.addGetterSetter(xa,"image");td.Factory.addGetterSetter(xa,"frameIndex",0,(0,_z.getNumberValidator)());td.Factory.addGetterSetter(xa,"frameRate",17,(0,_z.getNumberValidator)());td.Factory.backCompat(xa,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var iS={};Object.defineProperty(iS,"__esModule",{value:!0});iS.Star=void 0;const TT=Ct,R1e=Ur,AT=He,O1e=Tt;class Mu extends R1e.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)}}iS.Star=Mu;Mu.prototype.className="Star";Mu.prototype._centroid=!0;Mu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,O1e._registerNode)(Mu);TT.Factory.addGetterSetter(Mu,"numPoints",5,(0,AT.getNumberValidator)());TT.Factory.addGetterSetter(Mu,"innerRadius",0,(0,AT.getNumberValidator)());TT.Factory.addGetterSetter(Mu,"outerRadius",0,(0,AT.getNumberValidator)());var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.Text=Dc.stringToArray=void 0;const a3=or,Zi=Ct,I1e=Ur,Nu=He,M1e=Tt;function bz(e){return Array.from(e)}Dc.stringToArray=bz;var wd="auto",N1e="center",Uh="justify",D1e="Change.konva",L1e="2d",Y8="-",Sz="left",$1e="text",F1e="Text",B1e="top",z1e="bottom",Z8="middle",wz="normal",U1e="px ",Qy=" ",j1e="right",V1e="word",G1e="char",J8="none",Aw="…",xz=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],H1e=xz.length;function q1e(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 Yy;function kw(){return Yy||(Yy=a3.Util.createCanvasElement().getContext(L1e),Yy)}function W1e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function K1e(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function X1e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let _r=class extends I1e.Shape{constructor(t){super(X1e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<H1e;n++)this.on(xz[n]+D1e,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),s=this.lineHeight()*o,a=this.verticalAlign(),l=0,u=this.align(),c=this.getWidth(),d=this.letterSpacing(),f=this.fill(),h=this.textDecoration(),p=h.indexOf("underline")!==-1,m=h.indexOf("line-through")!==-1,b,_=0,_=s/2,y=0,g=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",Z8),t.setAttr("textAlign",Sz),a===Z8?l=(this.getHeight()-r*s-i*2)/2:a===z1e&&(l=this.getHeight()-r*s-i*2),t.translate(i,l+i),b=0;b<r;b++){var y=0,g=0,v=n[b],S=v.text,w=v.width,x=v.lastInParagraph,C,A,T;if(t.save(),u===j1e?y+=c-w-i*2:u===N1e&&(y+=(c-w-i*2)/2),p){t.save(),t.beginPath(),t.moveTo(y,_+g+Math.round(o/2)),C=S.split(" ").length-1,A=C===0,T=u===Uh&&!x?c-i*2:w,t.lineTo(y+Math.round(T),_+g+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(m){t.save(),t.beginPath(),t.moveTo(y,_+g),C=S.split(" ").length-1,A=C===0,T=u===Uh&&x&&!A?c-i*2:w,t.lineTo(y+Math.round(T),_+g),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(d!==0||u===Uh){C=S.split(" ").length-1;for(var k=bz(S),L=0;L<k.length;L++){var N=k[L];N===" "&&!x&&u===Uh&&(y+=(c-i*2-w)/C),this._partialTextX=y,this._partialTextY=_+g,this._partialText=N,t.fillStrokeShape(this),y+=this.measureSize(N).width+d}}else this._partialTextX=y,this._partialTextY=_+g,this._partialText=S,t.fillStrokeShape(this);t.restore(),r>1&&(_+=s)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=a3.Util._isString(t)?t:t==null?"":t+"";return this._setAttr($1e,n),this}getWidth(){var t=this.attrs.width===wd||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===wd||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 a3.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=kw(),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()+Qy+this.fontVariant()+Qy+(this.fontSize()+U1e)+q1e(this.fontFamily())}_addTextLine(t){this.align()===Uh&&(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 kw().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!==wd&&o!==void 0,l=s!==wd&&s!==void 0,u=this.padding(),c=o-u*2,d=s-u*2,f=0,h=this.wrap(),p=h!==J8,m=h!==G1e&&p,b=this.ellipsis();this.textArr=[],kw().font=this._getContextFont();for(var _=b?this._getTextWidth(Aw):0,y=0,g=t.length;y<g;++y){var v=t[y],S=this._getTextWidth(v);if(a&&S>c)for(;v.length>0;){for(var w=0,x=v.length,C="",A=0;w<x;){var T=w+x>>>1,k=v.slice(0,T+1),L=this._getTextWidth(k)+_;L<=c?(w=T+1,C=k,A=L):x=T}if(C){if(m){var N,E=v[C.length],P=E===Qy||E===Y8;P&&A<=c?N=C.length:N=Math.max(C.lastIndexOf(Qy),C.lastIndexOf(Y8))+1,N>0&&(w=N,C=C.slice(0,w),A=this._getTextWidth(C))}C=C.trimRight(),this._addTextLine(C),r=Math.max(r,A),f+=i;var D=this._shouldHandleEllipsis(f);if(D){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(w),v=v.trimLeft(),v.length>0&&(S=this._getTextWidth(v),S<=c)){this._addTextLine(v),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(v),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<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!==wd&&i!==void 0,s=this.padding(),a=i-s*2,l=this.wrap(),u=l!==J8;return!u||o&&t+r>a}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==wd&&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+Aw)<i;a||(s.text=s.text.slice(0,s.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(s.text+Aw)}}getStrokeScaleEnabled(){return!0}};Dc.Text=_r;_r.prototype._fillFunc=W1e;_r.prototype._strokeFunc=K1e;_r.prototype.className=F1e;_r.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,M1e._registerNode)(_r);Zi.Factory.overWriteSetter(_r,"width",(0,Nu.getNumberOrAutoValidator)());Zi.Factory.overWriteSetter(_r,"height",(0,Nu.getNumberOrAutoValidator)());Zi.Factory.addGetterSetter(_r,"fontFamily","Arial");Zi.Factory.addGetterSetter(_r,"fontSize",12,(0,Nu.getNumberValidator)());Zi.Factory.addGetterSetter(_r,"fontStyle",wz);Zi.Factory.addGetterSetter(_r,"fontVariant",wz);Zi.Factory.addGetterSetter(_r,"padding",0,(0,Nu.getNumberValidator)());Zi.Factory.addGetterSetter(_r,"align",Sz);Zi.Factory.addGetterSetter(_r,"verticalAlign",B1e);Zi.Factory.addGetterSetter(_r,"lineHeight",1,(0,Nu.getNumberValidator)());Zi.Factory.addGetterSetter(_r,"wrap",V1e);Zi.Factory.addGetterSetter(_r,"ellipsis",!1,(0,Nu.getBooleanValidator)());Zi.Factory.addGetterSetter(_r,"letterSpacing",0,(0,Nu.getNumberValidator)());Zi.Factory.addGetterSetter(_r,"text","",(0,Nu.getStringValidator)());Zi.Factory.addGetterSetter(_r,"textDecoration","");var oS={};Object.defineProperty(oS,"__esModule",{value:!0});oS.TextPath=void 0;const Pw=or,zs=Ct,Q1e=Ur,jh=hh,Rw=Dc,Cz=He,Y1e=Tt;var Z1e="",Ez="normal";function Tz(e){e.fillText(this.partialText,0,0)}function Az(e){e.strokeText(this.partialText,0,0)}class jr extends Q1e.Shape{constructor(t){super(t),this.dummyCanvas=Pw.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 jh.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:jh.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=jh.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 Pw.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 Rw.Text.prototype.setText.call(this,t)}_getContextFont(){return Rw.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,Rw.stringToArray)(this.text());let u=a;for(var c=0;c<l.length;c++){const d=this._getPointAtLength(u);if(!d)return;let f=this._getTextSize(l[c]).width+r;if(l[c]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-s)/y}const h=this._getPointAtLength(u+f);if(!h)return;const p=jh.Path.getLineLength(d.x,d.y,h.x,h.y);let m=0;if(o)try{m=o(l[c-1],l[c])*this.fontSize()}catch{m=0}d.x+=m,h.x+=m,this.textWidth+=m;const b=jh.Path.getPointOnLine(m+p/2,d.x,d.y,h.x,h.y),_=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:b.x,transposeY:b.y,text:l[c],rotation:_,p0:d,p1:h}),u+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,a),o=Math.max(o,a);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return Pw.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}oS.TextPath=jr;jr.prototype._fillFunc=Tz;jr.prototype._strokeFunc=Az;jr.prototype._fillFuncHit=Tz;jr.prototype._strokeFuncHit=Az;jr.prototype.className="TextPath";jr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,Y1e._registerNode)(jr);zs.Factory.addGetterSetter(jr,"data");zs.Factory.addGetterSetter(jr,"fontFamily","Arial");zs.Factory.addGetterSetter(jr,"fontSize",12,(0,Cz.getNumberValidator)());zs.Factory.addGetterSetter(jr,"fontStyle",Ez);zs.Factory.addGetterSetter(jr,"align","left");zs.Factory.addGetterSetter(jr,"letterSpacing",0,(0,Cz.getNumberValidator)());zs.Factory.addGetterSetter(jr,"textBaseline","middle");zs.Factory.addGetterSetter(jr,"fontVariant",Ez);zs.Factory.addGetterSetter(jr,"text",Z1e);zs.Factory.addGetterSetter(jr,"textDecoration",null);zs.Factory.addGetterSetter(jr,"kerningFunc",null);var sS={};Object.defineProperty(sS,"__esModule",{value:!0});sS.Transformer=void 0;const pn=or,un=Ct,eR=Xn,J1e=Ur,e_e=jm,tR=dh,ms=Tt,Du=He,t_e=Tt;var kz="tr-konva",n_e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${kz}`).join(" "),nR="nodesRect",r_e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],i_e={"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 o_e="ontouchstart"in ms.Konva._global;function s_e(e,t){if(e==="rotater")return"crosshair";t+=pn.Util.degToRad(i_e[e]||0);var n=(pn.Util.radToDeg(t)%360+360)%360;return pn.Util._inRange(n,315+22.5,360)||pn.Util._inRange(n,0,22.5)?"ns-resize":pn.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":pn.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":pn.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":pn.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":pn.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":pn.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":pn.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(pn.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var T1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],rR=1e8;function a_e(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 Pz(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function l_e(e,t){const n=a_e(e);return Pz(e,t,n)}function u_e(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=ms.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 Gt extends tR.Group{constructor(t){super(t),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(n_e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return pn.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 kz+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(pn.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(r_e.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(nR),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(nR,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),s=t.getAbsolutePosition(r),a=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(ms.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:s.x+a*Math.cos(u)+l*Math.sin(-u),y:s.y+l*Math.cos(u)+a*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return Pz(c,-ms.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-rR,y:-rR,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=u.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new pn.Transform;r.rotate(-ms.Konva.getAngle(this.rotation()));var i,o,s,a;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=s=c.x,o=a=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),s=Math.max(s,c.x),a=Math.max(a,c.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:ms.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(),T1.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new e_e.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:o_e?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=ms.Konva.getAngle(this.rotation()),o=s_e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new J1e.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*pn.Util._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var s=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-s.x,y:a.y-s.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),s=o.getStage();s.setPointersPositions(t);const a=s.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();n=o.x()-d.width/2,r=-o.y()+d.height/2;let N=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(N-=Math.PI);var f=ms.Konva.getAngle(this.rotation());const E=f+N,P=ms.Konva.getAngle(this.rotationSnapTolerance()),B=u_e(this.rotationSnaps(),E,P)-d.rotation,R=l_e(d,B);this._fitNodesInto(R,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 b=this.findOne(".top-left").x()>m.x?-1:1,_=this.findOne(".top-left").y()>m.y?-1:1;n=i*this.cos*b,r=i*this.sin*_,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 b=this.findOne(".top-right").x()<m.x?-1:1,_=this.findOne(".top-right").y()>m.y?-1:1;n=i*this.cos*b,r=i*this.sin*_,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 b=m.x<o.x()?-1:1,_=o.y()<m.y?-1:1;n=i*this.cos*b,r=i*this.sin*_,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 b=this.findOne(".bottom-right").x()<m.x?-1:1,_=this.findOne(".bottom-right").y()<m.y?-1:1;n=i*this.cos*b,r=i*this.sin*_,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 v=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=v.x(),x=v.y(),C=this.getWidth()-S.x(),A=this.getHeight()-S.y();S.move({x:-w,y:-x}),v.move({x:C,y:A})}var T=this.findOne(".top-left").getAbsolutePosition();n=T.x,r=T.y;var k=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:k,height:L,rotation:ms.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(pn.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(pn.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var s=new pn.Transform;if(s.rotate(ms.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=s.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=s.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=s.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=s.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(r,t);d?t=d:pn.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,l=new pn.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/a,r.height/a);const u=new pn.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/a,t.height/a);const c=u.multiply(l.invert());this._nodes.forEach(d=>{var f;const h=d.getParent().getAbsoluteTransform(),p=d.getTransform().copy();p.translate(d.offsetX(),d.offsetY());const m=new pn.Transform;m.multiply(h.copy().invert()).multiply(c).multiply(h).multiply(p);const b=m.decompose();d.setAttrs(b),this._fire("transform",{evt:n,target:d}),d._fire("transform",{evt:n,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(pn.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(pn.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),s=this.resizeEnabled(),a=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(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()*pn.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 c=this.anchorStyleFunc();c&&u.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),tR.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return eR.Node.prototype.toObject.call(this)}clone(t){var n=eR.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}sS.Transformer=Gt;function c_e(e){return e instanceof Array||pn.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){T1.indexOf(t)===-1&&pn.Util.warn("Unknown anchor name: "+t+". Available names are: "+T1.join(", "))}),e||[]}Gt.prototype.className="Transformer";(0,t_e._registerNode)(Gt);un.Factory.addGetterSetter(Gt,"enabledAnchors",T1,c_e);un.Factory.addGetterSetter(Gt,"flipEnabled",!0,(0,Du.getBooleanValidator)());un.Factory.addGetterSetter(Gt,"resizeEnabled",!0);un.Factory.addGetterSetter(Gt,"anchorSize",10,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"rotateEnabled",!0);un.Factory.addGetterSetter(Gt,"rotationSnaps",[]);un.Factory.addGetterSetter(Gt,"rotateAnchorOffset",50,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"rotationSnapTolerance",5,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"borderEnabled",!0);un.Factory.addGetterSetter(Gt,"anchorStroke","rgb(0, 161, 255)");un.Factory.addGetterSetter(Gt,"anchorStrokeWidth",1,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"anchorFill","white");un.Factory.addGetterSetter(Gt,"anchorCornerRadius",0,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"borderStroke","rgb(0, 161, 255)");un.Factory.addGetterSetter(Gt,"borderStrokeWidth",1,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"borderDash");un.Factory.addGetterSetter(Gt,"keepRatio",!0);un.Factory.addGetterSetter(Gt,"shiftBehavior","default");un.Factory.addGetterSetter(Gt,"centeredScaling",!1);un.Factory.addGetterSetter(Gt,"ignoreStroke",!1);un.Factory.addGetterSetter(Gt,"padding",0,(0,Du.getNumberValidator)());un.Factory.addGetterSetter(Gt,"node");un.Factory.addGetterSetter(Gt,"nodes");un.Factory.addGetterSetter(Gt,"boundBoxFunc");un.Factory.addGetterSetter(Gt,"anchorDragBoundFunc");un.Factory.addGetterSetter(Gt,"anchorStyleFunc");un.Factory.addGetterSetter(Gt,"shouldOverdrawWholeArea",!1);un.Factory.addGetterSetter(Gt,"useSingleNodeRotation",!0);un.Factory.backCompat(Gt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var aS={};Object.defineProperty(aS,"__esModule",{value:!0});aS.Wedge=void 0;const lS=Ct,d_e=Ur,f_e=Tt,Rz=He,h_e=Tt;class ml extends d_e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,f_e.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)}}aS.Wedge=ml;ml.prototype.className="Wedge";ml.prototype._centroid=!0;ml.prototype._attrsAffectingSize=["radius"];(0,h_e._registerNode)(ml);lS.Factory.addGetterSetter(ml,"radius",0,(0,Rz.getNumberValidator)());lS.Factory.addGetterSetter(ml,"angle",0,(0,Rz.getNumberValidator)());lS.Factory.addGetterSetter(ml,"clockwise",!1);lS.Factory.backCompat(ml,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var uS={};Object.defineProperty(uS,"__esModule",{value:!0});uS.Blur=void 0;const iR=Ct,p_e=Xn,g_e=He;function oR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var m_e=[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],y_e=[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 v_e(e,t){var n=e.data,r=e.width,i=e.height,o,s,a,l,u,c,d,f,h,p,m,b,_,y,g,v,S,w,x,C,A,T,k,L,N=t+t+1,E=r-1,P=i-1,D=t+1,B=D*(D+1)/2,R=new oR,O=null,I=R,F=null,U=null,V=m_e[t],H=y_e[t];for(a=1;a<N;a++)I=I.next=new oR,a===D&&(O=I);for(I.next=R,d=c=0,s=0;s<i;s++){for(v=S=w=x=f=h=p=m=0,b=D*(C=n[c]),_=D*(A=n[c+1]),y=D*(T=n[c+2]),g=D*(k=n[c+3]),f+=B*C,h+=B*A,p+=B*T,m+=B*k,I=R,a=0;a<D;a++)I.r=C,I.g=A,I.b=T,I.a=k,I=I.next;for(a=1;a<D;a++)l=c+((E<a?E:a)<<2),f+=(I.r=C=n[l])*(L=D-a),h+=(I.g=A=n[l+1])*L,p+=(I.b=T=n[l+2])*L,m+=(I.a=k=n[l+3])*L,v+=C,S+=A,w+=T,x+=k,I=I.next;for(F=R,U=O,o=0;o<r;o++)n[c+3]=k=m*V>>H,k!==0?(k=255/k,n[c]=(f*V>>H)*k,n[c+1]=(h*V>>H)*k,n[c+2]=(p*V>>H)*k):n[c]=n[c+1]=n[c+2]=0,f-=b,h-=_,p-=y,m-=g,b-=F.r,_-=F.g,y-=F.b,g-=F.a,l=d+((l=o+t+1)<E?l:E)<<2,v+=F.r=n[l],S+=F.g=n[l+1],w+=F.b=n[l+2],x+=F.a=n[l+3],f+=v,h+=S,p+=w,m+=x,F=F.next,b+=C=U.r,_+=A=U.g,y+=T=U.b,g+=k=U.a,v-=C,S-=A,w-=T,x-=k,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=x=v=h=p=m=f=0,c=o<<2,b=D*(C=n[c]),_=D*(A=n[c+1]),y=D*(T=n[c+2]),g=D*(k=n[c+3]),f+=B*C,h+=B*A,p+=B*T,m+=B*k,I=R,a=0;a<D;a++)I.r=C,I.g=A,I.b=T,I.a=k,I=I.next;for(u=r,a=1;a<=t;a++)c=u+o<<2,f+=(I.r=C=n[c])*(L=D-a),h+=(I.g=A=n[c+1])*L,p+=(I.b=T=n[c+2])*L,m+=(I.a=k=n[c+3])*L,v+=C,S+=A,w+=T,x+=k,I=I.next,a<P&&(u+=r);for(c=o,F=R,U=O,s=0;s<i;s++)l=c<<2,n[l+3]=k=m*V>>H,k>0?(k=255/k,n[l]=(f*V>>H)*k,n[l+1]=(h*V>>H)*k,n[l+2]=(p*V>>H)*k):n[l]=n[l+1]=n[l+2]=0,f-=b,h-=_,p-=y,m-=g,b-=F.r,_-=F.g,y-=F.b,g-=F.a,l=o+((l=s+D)<P?l:P)*r<<2,f+=v+=F.r=n[l],h+=S+=F.g=n[l+1],p+=w+=F.b=n[l+2],m+=x+=F.a=n[l+3],F=F.next,b+=C=U.r,_+=A=U.g,y+=T=U.b,g+=k=U.a,v-=C,S-=A,w-=T,x-=k,U=U.next,c+=r}}const __e=function(t){var n=Math.round(this.blurRadius());n>0&&v_e(t,n)};uS.Blur=__e;iR.Factory.addGetterSetter(p_e.Node,"blurRadius",0,(0,g_e.getNumberValidator)(),iR.Factory.afterSetFilter);var cS={};Object.defineProperty(cS,"__esModule",{value:!0});cS.Brighten=void 0;const sR=Ct,b_e=Xn,S_e=He,w_e=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};cS.Brighten=w_e;sR.Factory.addGetterSetter(b_e.Node,"brightness",0,(0,S_e.getNumberValidator)(),sR.Factory.afterSetFilter);var dS={};Object.defineProperty(dS,"__esModule",{value:!0});dS.Contrast=void 0;const aR=Ct,x_e=Xn,C_e=He,E_e=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};dS.Contrast=E_e;aR.Factory.addGetterSetter(x_e.Node,"contrast",0,(0,C_e.getNumberValidator)(),aR.Factory.afterSetFilter);var fS={};Object.defineProperty(fS,"__esModule",{value:!0});fS.Emboss=void 0;const _u=Ct,hS=Xn,T_e=or,Oz=He,A_e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,s=0,a=e.data,l=e.width,u=e.height,c=l*4,d=u;switch(r){case"top-left":o=-1,s=-1;break;case"top":o=-1,s=0;break;case"top-right":o=-1,s=1;break;case"right":o=0,s=1;break;case"bottom-right":o=1,s=1;break;case"bottom":o=1,s=0;break;case"bottom-left":o=1,s=-1;break;case"left":o=0,s=-1;break;default:T_e.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=o;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,m=l;do{var b=f+(m-1)*4,_=s;m+_<1&&(_=0),m+_>l&&(_=0);var y=p+(m-1+_)*4,g=a[b]-a[y],v=a[b+1]-a[y+1],S=a[b+2]-a[y+2],w=g,x=w>0?w:-w,C=v>0?v:-v,A=S>0?S:-S;if(C>x&&(w=v),A>x&&(w=S),w*=t,i){var T=a[b]+w,k=a[b+1]+w,L=a[b+2]+w;a[b]=T>255?255:T<0?0:T,a[b+1]=k>255?255:k<0?0:k,a[b+2]=L>255?255:L<0?0:L}else{var N=n-w;N<0?N=0:N>255&&(N=255),a[b]=a[b+1]=a[b+2]=N}}while(--m)}while(--d)};fS.Emboss=A_e;_u.Factory.addGetterSetter(hS.Node,"embossStrength",.5,(0,Oz.getNumberValidator)(),_u.Factory.afterSetFilter);_u.Factory.addGetterSetter(hS.Node,"embossWhiteLevel",.5,(0,Oz.getNumberValidator)(),_u.Factory.afterSetFilter);_u.Factory.addGetterSetter(hS.Node,"embossDirection","top-left",null,_u.Factory.afterSetFilter);_u.Factory.addGetterSetter(hS.Node,"embossBlend",!1,null,_u.Factory.afterSetFilter);var pS={};Object.defineProperty(pS,"__esModule",{value:!0});pS.Enhance=void 0;const lR=Ct,k_e=Xn,P_e=He;function Ow(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 R_e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,s=t[1],a=s,l,u=t[2],c=u,d,f,h=this.enhance();if(h!==0){for(f=0;f<n;f+=4)o=t[f+0],o<r?r=o:o>i&&(i=o),l=t[f+1],l<s?s=l:l>a&&(a=l),d=t[f+2],d<u?u=d:d>c&&(c=d);i===r&&(i=255,r=0),a===s&&(a=255,s=0),c===u&&(c=255,u=0);var p,m,b,_,y,g,v,S,w;for(h>0?(m=i+h*(255-i),b=r-h*(r-0),y=a+h*(255-a),g=s-h*(s-0),S=c+h*(255-c),w=u-h*(u-0)):(p=(i+r)*.5,m=i+h*(i-p),b=r+h*(r-p),_=(a+s)*.5,y=a+h*(a-_),g=s+h*(s-_),v=(c+u)*.5,S=c+h*(c-v),w=u+h*(u-v)),f=0;f<n;f+=4)t[f+0]=Ow(t[f+0],r,i,b,m),t[f+1]=Ow(t[f+1],s,a,g,y),t[f+2]=Ow(t[f+2],u,c,w,S)}};pS.Enhance=R_e;lR.Factory.addGetterSetter(k_e.Node,"enhance",0,(0,P_e.getNumberValidator)(),lR.Factory.afterSetFilter);var gS={};Object.defineProperty(gS,"__esModule",{value:!0});gS.Grayscale=void 0;const O_e=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};gS.Grayscale=O_e;var mS={};Object.defineProperty(mS,"__esModule",{value:!0});mS.HSL=void 0;const Wf=Ct,kT=Xn,PT=He;Wf.Factory.addGetterSetter(kT.Node,"hue",0,(0,PT.getNumberValidator)(),Wf.Factory.afterSetFilter);Wf.Factory.addGetterSetter(kT.Node,"saturation",0,(0,PT.getNumberValidator)(),Wf.Factory.afterSetFilter);Wf.Factory.addGetterSetter(kT.Node,"luminance",0,(0,PT.getNumberValidator)(),Wf.Factory.afterSetFilter);const I_e=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s=this.luminance()*127,a,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*l+.167*u,d=.587*r-.587*l+.33*u,f=.114*r-.114*l-.497*u,h=.299*r-.299*l-.328*u,p=.587*r+.413*l+.035*u,m=.114*r-.114*l+.293*u,b=.299*r-.3*l+1.25*u,_=.587*r-.586*l-1.05*u,y=.114*r+.886*l-.2*u,g,v,S,w;for(a=0;a<n;a+=4)g=t[a+0],v=t[a+1],S=t[a+2],w=t[a+3],t[a+0]=c*g+d*v+f*S+s,t[a+1]=h*g+p*v+m*S+s,t[a+2]=b*g+_*v+y*S+s,t[a+3]=w};mS.HSL=I_e;var yS={};Object.defineProperty(yS,"__esModule",{value:!0});yS.HSV=void 0;const Kf=Ct,RT=Xn,OT=He,M_e=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s,a=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*a+.167*l,c=.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,b=.587*r-.586*a-1.05*l,_=.114*r+.886*a-.2*l,y,g,v,S;for(s=0;s<n;s+=4)y=t[s+0],g=t[s+1],v=t[s+2],S=t[s+3],t[s+0]=u*y+c*g+d*v,t[s+1]=f*y+h*g+p*v,t[s+2]=m*y+b*g+_*v,t[s+3]=S};yS.HSV=M_e;Kf.Factory.addGetterSetter(RT.Node,"hue",0,(0,OT.getNumberValidator)(),Kf.Factory.afterSetFilter);Kf.Factory.addGetterSetter(RT.Node,"saturation",0,(0,OT.getNumberValidator)(),Kf.Factory.afterSetFilter);Kf.Factory.addGetterSetter(RT.Node,"value",0,(0,OT.getNumberValidator)(),Kf.Factory.afterSetFilter);var vS={};Object.defineProperty(vS,"__esModule",{value:!0});vS.Invert=void 0;const N_e=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]};vS.Invert=N_e;var _S={};Object.defineProperty(_S,"__esModule",{value:!0});_S.Kaleidoscope=void 0;const A1=Ct,Iz=Xn,uR=or,Mz=He;var D_e=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,u,c,d,f=0,h=0,p=0,m=0,b,_=Math.sqrt(a*a+l*l);c=o-a,d=s-l,b=Math.sqrt(c*c+d*d),_=b>_?b:_;var y=s,g=o,v,S,w=360/g*Math.PI/180,x,C;for(S=0;S<g;S+=1)for(x=Math.sin(S*w),C=Math.cos(S*w),v=0;v<y;v+=1)c=Math.floor(a+_*v/y*C),d=Math.floor(l+_*v/y*x),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],m=r[u+3],u=(S+v*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=m},L_e=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,u,c,d,f,h,p=0,m=0,b=0,_=0,y,g=Math.sqrt(a*a+l*l);c=o-a,d=s-l,y=Math.sqrt(c*c+d*d),g=y>g?y:g;var v=s,S=o,w,x,C=n.polarRotation||0,A,T;for(c=0;c<o;c+=1)for(d=0;d<s;d+=1)f=c-a,h=d-l,w=Math.sqrt(f*f+h*h)*v/g,x=(Math.atan2(h,f)*180/Math.PI+360+C)%360,x=x*S/360,A=Math.floor(x),T=Math.floor(w),u=(T*o+A)*4,p=r[u+0],m=r[u+1],b=r[u+2],_=r[u+3],u=(d*o+c)*4,i[u+0]=p,i[u+1]=m,i[u+2]=b,i[u+3]=_};const $_e=function(e){var t=e.width,n=e.height,r,i,o,s,a,l,u,c,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(p%360)/360);if(!(h<1)){var b=uR.Util.createCanvasElement();b.width=t,b.height=n;var _=b.getContext("2d").getImageData(0,0,t,n);uR.Util.releaseCanvas(b),D_e(e,_,{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,v=0,S=g,w=1;for(m+y>t&&(v=g,S=0,w=-1),i=0;i<n;i+=1)for(r=v;r!==S;r+=w)o=Math.round(r+m)%t,d=(t*i+o)*4,a=_.data[d+0],l=_.data[d+1],u=_.data[d+2],c=_.data[d+3],f=(t*i+r)*4,_.data[f+0]=a,_.data[f+1]=l,_.data[f+2]=u,_.data[f+3]=c;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=_.data[d+0],l=_.data[d+1],u=_.data[d+2],c=_.data[d+3],f=(t*i+g*2-r-1)*4,_.data[f+0]=a,_.data[f+1]=l,_.data[f+2]=u,_.data[f+3]=c;g*=2}L_e(_,e,{polarRotation:0})}};_S.Kaleidoscope=$_e;A1.Factory.addGetterSetter(Iz.Node,"kaleidoscopePower",2,(0,Mz.getNumberValidator)(),A1.Factory.afterSetFilter);A1.Factory.addGetterSetter(Iz.Node,"kaleidoscopeAngle",0,(0,Mz.getNumberValidator)(),A1.Factory.afterSetFilter);var bS={};Object.defineProperty(bS,"__esModule",{value:!0});bS.Mask=void 0;const cR=Ct,F_e=Xn,B_e=He;function Zy(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 Vh(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 z_e(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 U_e(e,t){var n=Zy(e,0,0),r=Zy(e,e.width-1,0),i=Zy(e,0,e.height-1),o=Zy(e,e.width-1,e.height-1),s=t||10;if(Vh(n,r)<s&&Vh(r,o)<s&&Vh(o,i)<s&&Vh(i,n)<s){for(var a=z_e([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var c=Vh(a,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=c<s?0:255}return l}}function j_e(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function V_e(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,c=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,b=r[d*i+f];c+=e[m]*b}}s[u]=c===255*8?255:0}return s}function G_e(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,c=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,b=r[d*i+f];c+=e[m]*b}}s[u]=c>=255*4?255:0}return s}function H_e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,c=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,b=r[d*i+f];c+=e[m]*b}}s[u]=c}return s}const q_e=function(e){var t=this.threshold(),n=U_e(e,t);return n&&(n=V_e(n,e.width,e.height),n=G_e(n,e.width,e.height),n=H_e(n,e.width,e.height),j_e(e,n)),e};bS.Mask=q_e;cR.Factory.addGetterSetter(F_e.Node,"threshold",0,(0,B_e.getNumberValidator)(),cR.Factory.afterSetFilter);var SS={};Object.defineProperty(SS,"__esModule",{value:!0});SS.Noise=void 0;const dR=Ct,W_e=Xn,K_e=He,X_e=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()};SS.Noise=X_e;dR.Factory.addGetterSetter(W_e.Node,"noise",.2,(0,K_e.getNumberValidator)(),dR.Factory.afterSetFilter);var wS={};Object.defineProperty(wS,"__esModule",{value:!0});wS.Pixelate=void 0;const fR=Ct,Q_e=or,Y_e=Xn,Z_e=He,J_e=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,s,a,l,u,c,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,m,b,_,y,g,v=e.data;if(t<=0){Q_e.Util.error("pixelSize value can not be <= 0");return}for(_=0;_<d;_+=1)for(y=0;y<f;y+=1){for(a=0,l=0,u=0,c=0,h=_*t,p=h+t,m=y*t,b=m+t,g=0,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<b;o+=1)o>=r||(s=(n*o+i)*4,a+=v[s+0],l+=v[s+1],u+=v[s+2],c+=v[s+3],g+=1);for(a=a/g,l=l/g,u=u/g,c=c/g,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<b;o+=1)o>=r||(s=(n*o+i)*4,v[s+0]=a,v[s+1]=l,v[s+2]=u,v[s+3]=c)}};wS.Pixelate=J_e;fR.Factory.addGetterSetter(Y_e.Node,"pixelSize",8,(0,Z_e.getNumberValidator)(),fR.Factory.afterSetFilter);var xS={};Object.defineProperty(xS,"__esModule",{value:!0});xS.Posterize=void 0;const hR=Ct,ebe=Xn,tbe=He,nbe=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};xS.Posterize=nbe;hR.Factory.addGetterSetter(ebe.Node,"levels",.5,(0,tbe.getNumberValidator)(),hR.Factory.afterSetFilter);var CS={};Object.defineProperty(CS,"__esModule",{value:!0});CS.RGB=void 0;const k1=Ct,IT=Xn,rbe=He,ibe=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]};CS.RGB=ibe;k1.Factory.addGetterSetter(IT.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});k1.Factory.addGetterSetter(IT.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});k1.Factory.addGetterSetter(IT.Node,"blue",0,rbe.RGBComponent,k1.Factory.afterSetFilter);var ES={};Object.defineProperty(ES,"__esModule",{value:!0});ES.RGBA=void 0;const jg=Ct,TS=Xn,obe=He,sbe=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};ES.RGBA=sbe;jg.Factory.addGetterSetter(TS.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});jg.Factory.addGetterSetter(TS.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});jg.Factory.addGetterSetter(TS.Node,"blue",0,obe.RGBComponent,jg.Factory.afterSetFilter);jg.Factory.addGetterSetter(TS.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var AS={};Object.defineProperty(AS,"__esModule",{value:!0});AS.Sepia=void 0;const abe=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)};AS.Sepia=abe;var kS={};Object.defineProperty(kS,"__esModule",{value:!0});kS.Solarize=void 0;const lbe=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var s=(o-1)*i,a=n;do{var l=s+(a-1)*4,u=t[l],c=t[l+1],d=t[l+2];u>127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),t[l]=u,t[l+1]=c,t[l+2]=d}while(--a)}while(--o)};kS.Solarize=lbe;var PS={};Object.defineProperty(PS,"__esModule",{value:!0});PS.Threshold=void 0;const pR=Ct,ube=Xn,cbe=He,dbe=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};PS.Threshold=dbe;pR.Factory.addGetterSetter(ube.Node,"threshold",.5,(0,cbe.getNumberValidator)(),pR.Factory.afterSetFilter);Object.defineProperty(Fb,"__esModule",{value:!0});Fb.Konva=void 0;const gR=JB,fbe=Gb,hbe=Wb,pbe=Qb,gbe=Yb,mbe=Zb,mR=qf,ybe=zm,vbe=hh,_be=jm,bbe=tS,Sbe=nS,wbe=rS,xbe=iS,Cbe=Dc,Ebe=oS,Tbe=sS,Abe=aS,kbe=uS,Pbe=cS,Rbe=dS,Obe=fS,Ibe=pS,Mbe=gS,Nbe=mS,Dbe=yS,Lbe=vS,$be=_S,Fbe=bS,Bbe=SS,zbe=wS,Ube=xS,jbe=CS,Vbe=ES,Gbe=AS,Hbe=kS,qbe=PS;Fb.Konva=gR.Konva.Util._assign(gR.Konva,{Arc:fbe.Arc,Arrow:hbe.Arrow,Circle:pbe.Circle,Ellipse:gbe.Ellipse,Image:mbe.Image,Label:mR.Label,Tag:mR.Tag,Line:ybe.Line,Path:vbe.Path,Rect:_be.Rect,RegularPolygon:bbe.RegularPolygon,Ring:Sbe.Ring,Sprite:wbe.Sprite,Star:xbe.Star,Text:Cbe.Text,TextPath:Ebe.TextPath,Transformer:Tbe.Transformer,Wedge:Abe.Wedge,Filters:{Blur:kbe.Blur,Brighten:Pbe.Brighten,Contrast:Rbe.Contrast,Emboss:Obe.Emboss,Enhance:Ibe.Enhance,Grayscale:Mbe.Grayscale,HSL:Nbe.HSL,HSV:Dbe.HSV,Invert:Lbe.Invert,Kaleidoscope:$be.Kaleidoscope,Mask:Fbe.Mask,Noise:Bbe.Noise,Pixelate:zbe.Pixelate,Posterize:Ube.Posterize,RGB:jbe.RGB,RGBA:Vbe.RGBA,Sepia:Gbe.Sepia,Solarize:Hbe.Solarize,Threshold:qbe.Threshold}});var Wbe=vT.exports;Object.defineProperty(Wbe,"__esModule",{value:!0});const Kbe=Fb;vT.exports=Kbe.Konva;var Xbe=vT.exports;const Gh=Fc(Xbe),Qbe=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),s=new Gh.Stage({container:o,width:r,height:i}),a=new Gh.Layer,l=new Gh.Layer;return a.add(new Gh.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new Gh.Line({points:u.points,stroke:n?"white":"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),s.add(a),s.add(l),o.remove(),s},Ybe=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}),yR=async(e,t)=>{const n=e.toDataURL(t);return await Ybe(n,t.width,t.height)},MT=async(e,t,n,r,i)=>{const o=pe("canvas"),s=Lb(),a=H0e();if(!s||!a){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=s.clone();u.scale({x:1,y:1});const c=u.getAbsolutePosition(),d={x:l.x+c.x,y:l.y+c.y,width:l.width,height:l.height},f=await C1(u,d),h=await yR(u,d),p=await Qbe(r?e.objects.filter(yD):[],l,i),m=await C1(p,l),b=await yR(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:b}},Zbe=()=>{xe({actionCreator:F0e,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await MT(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(Bn({title:"Problem Saving Mask",description:"Unable to export mask",status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(he.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:"Mask Saved to Assets"}}}))}})},Jbe=()=>{xe({actionCreator:V0e,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await MT(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(Bn({title:"Problem Importing Mask",description:"Unable to export mask",status:"error"}));return}const{autoAddBoardId:a}=i.gallery,l=await t(he.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:"Mask Sent to ControlNet & Assets"}}})).unwrap(),{image_name:u}=l;t(Wc({controlNetId:e.payload.controlNet.controlNetId,controlImage:u}))}})},eSe=async()=>{const e=Lb();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),C1(t,t.getClientRect())},tSe=()=>{xe({actionCreator:U0e,effect:async(e,{dispatch:t})=>{const n=ib.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await eSe();if(!r){n.error("Problem getting base layer blob"),t(Bn({title:"Problem Merging Canvas",description:"Unable to export base layer",status:"error"}));return}const i=Lb();if(!i){n.error("Problem getting canvas base layer"),t(Bn({title:"Problem Merging Canvas",description:"Unable to export base layer",status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),s=await t(he.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:"Canvas Merged"}}})).unwrap(),{image_name:a}=s;t(Kne({kind:"image",layer:"base",imageName:a,...o}))}})},nSe=()=>{xe({actionCreator:$0e,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await $b(i);if(!o){r.error("Problem getting base layer blob"),t(Bn({title:"Problem Saving Canvas",description:"Unable to export base layer",status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(he.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:"Canvas Saved to Gallery"}}}))}})},rSe=(e,t,n)=>{var d;if(!(Tde.match(e)||M6.match(e)||Wc.match(e)||Ade.match(e)||N6.match(e))||N6.match(e)&&((d=n.controlNet.controlNets[e.payload.controlNetId])==null?void 0:d.shouldAutoConfig)===!0)return!1;const i=t.controlNet.controlNets[e.payload.controlNetId];if(!i)return!1;const{controlImage:o,processorType:s,shouldAutoConfig:a}=i;if(M6.match(e)&&!a)return!1;const l=s!=="none",u=t.system.isProcessing;return l&&!u&&!!o},iSe=()=>{xe({predicate:rSe,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=pe("session"),{controlNetId:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(WE({controlNetId:o}))}})},nd=Me("system/sessionReadyToInvoke"),Nz=e=>(e==null?void 0:e.type)==="image_output",oSe=()=>{xe({actionCreator:WE,effect:async(e,{dispatch:t,getState:n,take:r})=>{const i=pe("session"),{controlNetId:o}=e.payload,s=n().controlNet.controlNets[o];if(!(s!=null&&s.controlImage)){i.error("Unable to process ControlNet image");return}const a={nodes:{[s.processorNode.id]:{...s.processorNode,is_intermediate:!0,image:{image_name:s.controlImage}}}},l=t(wi({graph:a})),[u]=await r(f=>wi.fulfilled.match(f)&&f.meta.requestId===l.requestId),c=u.payload.id;t(nd());const[d]=await r(f=>GE.match(f)&&f.payload.data.graph_execution_state_id===c);if(Nz(d.payload.data.result)){const{image_name:f}=d.payload.data.result.image,[{payload:h}]=await r(m=>he.endpoints.getImageDTO.matchFulfilled(m)&&m.payload.image_name===f),p=h;i.debug({controlNetId:e.payload,processedControlImage:p},"ControlNet image processed"),t(XE({controlNetId:o,processedControlImage:p.image_name}))}}})},sSe=()=>{xe({matcher:he.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=pe("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},aSe=()=>{xe({matcher:he.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=pe("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},NT=Me("deleteImageModal/imageDeletionConfirmed"),K9e=$i(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],yT),Dz=$i([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?Xr:jl,offset:0,limit:nre,is_intermediate:!1}},yT),lSe=()=>{xe({actionCreator:NT,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(QE(!1));const l=n(),u=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(s&&(s==null?void 0:s.image_name)===u){const{image_name:h}=s,p=Dz(l),{data:m}=he.endpoints.listImages.select(p)(l),b=m?Nn.getSelectors().selectAll(m):[],_=b.findIndex(S=>S.image_name===h),y=b.filter(S=>S.image_name!==h),g=zl(_,0,y.length-1),v=y[g];t(da(v||null))}a.isCanvasImage&&t(_E()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(vE()),ns(n().controlNet.controlNets,m=>{(m.controlImage===h.image_name||m.processedControlImage===h.image_name)&&(t(Wc({controlNetId:m.controlNetId,controlImage:null})),t(XE({controlNetId:m.controlNetId,processedControlImage:null})))}),n().nodes.nodes.forEach(m=>{Wr(m)&&ns(m.data.inputs,b=>{var _;b.type==="ImageField"&&((_=b.value)==null?void 0:_.image_name)===h.image_name&&t(Nb({nodeId:m.data.id,fieldName:b.name,value:void 0}))})})});const{requestId:c}=t(he.endpoints.deleteImage.initiate(s));await r(h=>he.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t(yu.util.invalidateTags([{type:"Board",id:s.board_id}]))}})},uSe=()=>{xe({actionCreator:NT,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(he.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),s=Dz(o),{data:a}=he.endpoints.listImages.select(s)(o),l=a?Nn.getSelectors().selectAll(a)[0]:void 0;t(da(l||null)),t(QE(!1)),i.some(u=>u.isCanvasImage)&&t(_E()),r.forEach(u=>{var c;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(vE()),ns(n().controlNet.controlNets,d=>{(d.controlImage===u.image_name||d.processedControlImage===u.image_name)&&(t(Wc({controlNetId:d.controlNetId,controlImage:null})),t(XE({controlNetId:d.controlNetId,processedControlImage:null})))}),n().nodes.nodes.forEach(d=>{Wr(d)&&ns(d.data.inputs,f=>{var h;f.type==="ImageField"&&((h=f.value)==null?void 0:h.image_name)===u.image_name&&t(Nb({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},cSe=()=>{xe({matcher:he.endpoints.deleteImage.matchPending,effect:()=>{}})},dSe=()=>{xe({matcher:he.endpoints.deleteImage.matchFulfilled,effect:e=>{pe("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},fSe=()=>{xe({matcher:he.endpoints.deleteImage.matchRejected,effect:e=>{pe("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},Lz=Me("dnd/dndDropped"),hSe=()=>{xe({actionCreator:Lz,effect:async(e,{dispatch:t})=>{const n=pe("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:gn(r),overData:gn(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(xye({nodeId:o,fieldName:s.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(da(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(N_(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROLNET_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{controlNetId:o}=i.context;t(Wc({controlImage:r.payload.imageDTO.image_name,controlNetId:o}));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(bD(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(Nb({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(he.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(he.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(he.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(he.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},pSe=()=>{xe({matcher:he.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=pe("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},gSe=()=>{xe({matcher:he.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=pe("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},mSe=()=>{xe({actionCreator:Ode,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,s=N0e(n()),a=s.some(l=>l.isCanvasImage)||s.some(l=>l.isInitialImage)||s.some(l=>l.isControlNetImage)||s.some(l=>l.isNodesImage);if(o||a){t(QE(!0));return}t(NT({imageDTOs:r,imagesUsage:s}))}})},xd={title:"Image Uploaded",status:"success"},ySe=()=>{xe({matcher:he.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=pe("images"),i=e.payload,o=n(),{autoAddBoardId:s}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:a}=e.meta.arg.originalArgs;if(!(e.payload.is_intermediate&&!a)){if((a==null?void 0:a.type)==="TOAST"){const{toastOptions:l}=a;if(!s||s==="none")t(Bn({...xd,...l}));else{t(he.endpoints.addImageToBoard.initiate({board_id:s,imageDTO:i}));const{data:u}=hi.endpoints.listAllBoards.select()(o),c=u==null?void 0:u.find(f=>f.board_id===s),d=c?`Added to board ${c.board_name}`:`Added to board ${s}`;t(Bn({...xd,description:d}))}return}if((a==null?void 0:a.type)==="SET_CANVAS_INITIAL_IMAGE"){t(bD(i)),t(Bn({...xd,description:"Set as canvas initial image"}));return}if((a==null?void 0:a.type)==="SET_CONTROLNET_IMAGE"){const{controlNetId:l}=a;t(Wc({controlNetId:l,controlImage:i.image_name})),t(Bn({...xd,description:"Set as control image"}));return}if((a==null?void 0:a.type)==="SET_INITIAL_IMAGE"){t(N_(i)),t(Bn({...xd,description:"Set as initial image"}));return}if((a==null?void 0:a.type)==="SET_NODES_IMAGE"){const{nodeId:l,fieldName:u}=a;t(Nb({nodeId:l,fieldName:u,value:i})),t(Bn({...xd,description:`Set as node field ${u}`}));return}}}})},vSe=()=>{xe({matcher:he.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=pe("images"),r={arg:{...R_(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(Bn({title:"Image Upload Failed",description:e.error.message,status:"error"}))}})},_Se=()=>{xe({matcher:he.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(tF(s))}})},bSe=()=>{xe({matcher:he.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(tF(s))}})},SSe=Me("generation/initialImageSelected"),wSe=Me("generation/modelSelected"),xSe=()=>{xe({actionCreator:SSe,effect:(e,{dispatch:t})=>{if(!e.payload){t(Bn(ia({title:Cp("toast.imageNotLoadedDesc"),status:"error"})));return}t(N_(e.payload)),t(Bn(ia(Cp("toast.sentToImageToImage"))))}})},CSe=()=>{xe({actionCreator:wSe,effect:(e,{getState:t,dispatch:n})=>{var l,u;const r=pe("models"),i=t(),o=xm.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 c=0;ns(i.lora.loras,(h,p)=>{h.base_model!==a&&(n(rF(p)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==a&&(n(gD(null)),c+=1);const{controlNets:f}=i.controlNet;ns(f,(h,p)=>{var m;((m=h.model)==null?void 0:m.base_model)!==a&&(n(X$({controlNetId:p})),c+=1)}),c>0&&n(Bn(ia({title:`Base model changed, cleared ${c} incompatible submodel${c===1?"":"s"}`,status:"warning"})))}((u=i.generation.model)==null?void 0:u.base_model)!==s.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(s.base_model)?(n(qk(1024)),n(Wk(1024)),n(Kk({width:1024,height:1024}))):(n(qk(512)),n(Wk(512)),n(Kk({width:512,height:512})))),n(Ul(s))}})},Vg=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),vR=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),_R=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),bR=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),SR=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),wR=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),l3=cl({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),ESe=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,Gu=e=>{const t=[];return e.forEach(n=>{const r={...Zn(n),id:ESe(n)};t.push(r)}),t},ja=yu.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${N0.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return vR.setAll(vR.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${N0.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return Vg.setAll(Vg.getInitialState(),n)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),convertMainModels:e.mutation({query:({base_model:t,model_name:n,convert_dest_directory:r})=>({url:`models/convert/${t}/main/${n}`,method:"PUT",params:{convert_dest_directory:r}}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:[{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"OnnxModel",id:ft}]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return _R.setAll(_R.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:ft}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:ft}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return bR.setAll(bR.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return SR.setAll(SR.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return l3.setAll(l3.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:ft}];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=Gu(t.models);return wR.setAll(wR.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${N0.stringify(t,{})}`}),providesTags:t=>{const n=[{type:"ScannedModels",id:ft}];return t&&n.push(...t.map(r=>({type:"ScannedModels",id:r}))),n}}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:X9e,useGetOnnxModelsQuery:Q9e,useGetControlNetModelsQuery:Y9e,useGetIPAdapterModelsQuery:Z9e,useGetLoRAModelsQuery:J9e,useGetTextualInversionModelsQuery:eMe,useGetVaeModelsQuery:tMe,useUpdateMainModelsMutation:nMe,useDeleteMainModelsMutation:rMe,useImportMainModelsMutation:iMe,useAddMainModelsMutation:oMe,useConvertMainModelsMutation:sMe,useMergeMainModelsMutation:aMe,useDeleteLoRAModelsMutation:lMe,useUpdateLoRAModelsMutation:uMe,useSyncModelsMutation:cMe,useGetModelsInFolderQuery:dMe,useGetCheckpointConfigsQuery:fMe}=ja,TSe=()=>{xe({predicate:e=>ja.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=pe("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=Vg.getSelectors().selectAll(e.payload);if(o.length===0){n(Ul(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=xm.safeParse(o[0]);if(!a.success){r.error({error:a.error.format()},"Failed to parse main model");return}n(Ul(a.data))}}),xe({predicate:e=>ja.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=pe("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=Vg.getSelectors().selectAll(e.payload);if(o.length===0){n(A8(null)),n(Aye(!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=yE.safeParse(o[0]);if(!a.success){r.error({error:a.error.format()},"Failed to parse SDXL Refiner Model");return}n(A8(a.data))}}),xe({matcher:ja.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=pe("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||bp(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=l3.getSelectors().selectAll(e.payload)[0];if(!s){n(Ul(null));return}const a=vne.safeParse(s);if(!a.success){r.error({error:a.error.format()},"Failed to parse VAE model");return}n(gD(a.data))}}),xe({matcher:ja.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{pe("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;ns(i,(o,s)=>{bp(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(rF(s))})}}),xe({matcher:ja.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{pe("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`);const i=t().controlNet.controlNets;ns(i,(o,s)=>{bp(e.payload.entities,l=>{var u,c;return(l==null?void 0:l.model_name)===((u=o==null?void 0:o.model)==null?void 0:u.model_name)&&(l==null?void 0:l.base_model)===((c=o==null?void 0:o.model)==null?void 0:c.base_model)})||n(X$({controlNetId:s}))})}}),xe({matcher:ja.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{pe("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},Cd=e=>e.$ref.split("/").slice(-1)[0],ASe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},kSe=({schemaObject:e,baseField:t})=>{const n={...t,type:"IntegerPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},PSe=({schemaObject:e,baseField:t})=>{const n=W7(e.item_default)&&vee(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},RSe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},OSe=({schemaObject:e,baseField:t})=>{const n={...t,type:"FloatPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},ISe=({schemaObject:e,baseField:t})=>{const n=W7(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},MSe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},NSe=({schemaObject:e,baseField:t})=>{const n={...t,type:"StringPolymorphic",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},DSe=({schemaObject:e,baseField:t})=>{const n=q7(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},LSe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),$Se=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),FSe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&yee(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},BSe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),zSe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),USe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),jSe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),VSe=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),GSe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),HSe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),qSe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),WSe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),KSe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),XSe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),QSe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),YSe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),ZSe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),JSe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),e2e=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),t2e=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),n2e=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),r2e=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),i2e=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),o2e=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),s2e=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),a2e=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),l2e=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),u2e=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",options:n,ui_choice_labels:e.ui_choice_labels,default:e.default??n[0]}},c2e=({baseField:e})=>({...e,type:"Collection",default:[]}),d2e=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),f2e=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),h2e=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),p2e=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),g2e=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),xR=e=>{if(e!=null&&e.ui_type)return e.ui_type;if(e.type){if(e.enum)return"enum";if(e.type){if(e.type==="number")return"float";if(e.type==="array"){const t=sie(e.items)?e.items.type:Cd(e.items);return vye(t)?EB[t]:void 0}else return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&Ih(t[0]))return Cd(t[0])}else if(e.anyOf){const t=e.anyOf;let n,r;if(Qk(t[0])){const i=t[0].items,o=t[1];Ih(i)&&Ih(o)?(n=Cd(i),r=Cd(o)):Ey(i)&&Ey(o)&&(n=i.type,r=o.type)}else if(Qk(t[1])){const i=t[0],o=t[1].items;Ih(i)&&Ih(o)?(n=Cd(i),r=Cd(o)):Ey(i)&&Ey(o)&&(n=i.type,r=o.type)}if(n===r&&_ye(n))return TB[n]}},$z={boolean:LSe,BooleanCollection:FSe,BooleanPolymorphic:$Se,ClipField:r2e,Collection:c2e,CollectionItem:d2e,ColorCollection:p2e,ColorField:f2e,ColorPolymorphic:h2e,ConditioningCollection:t2e,ConditioningField:JSe,ConditioningPolymorphic:e2e,ControlCollection:a2e,ControlField:o2e,ControlNetModelField:GSe,ControlPolymorphic:s2e,DenoiseMaskField:XSe,enum:u2e,float:RSe,FloatCollection:ISe,FloatPolymorphic:OSe,ImageCollection:KSe,ImageField:qSe,ImagePolymorphic:WSe,integer:ASe,IntegerCollection:PSe,IntegerPolymorphic:kSe,IPAdapterField:l2e,IPAdapterModelField:HSe,LatentsCollection:ZSe,LatentsField:QSe,LatentsPolymorphic:YSe,LoRAModelField:VSe,MainModelField:BSe,Scheduler:g2e,SDXLMainModelField:zSe,SDXLRefinerModelField:USe,string:MSe,StringCollection:DSe,StringPolymorphic:NSe,UNetField:n2e,VaeField:i2e,VaeModelField:jSe},m2e=e=>!!(e&&e in $z),y2e=(e,t,n,r)=>{var d;const{input:i,ui_hidden:o,ui_component:s,ui_type:a,ui_order:l}=t,u={input:yye.includes(r)?"connection":i,ui_hidden:o,ui_component:s,ui_type:a,required:((d=e.required)==null?void 0:d.includes(n))??!1,ui_order:l},c={name:n,title:t.title??"",description:t.description??"",fieldKind:"input",...u};if(m2e(r))return $z[r]({schemaObject:t,baseField:c})},v2e=["id","type","metadata"],_2e=["type"],b2e=["WorkflowField","MetadataField","IsIntermediate"],S2e=["graph","metadata_accumulator"],w2e=(e,t)=>!!(v2e.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),x2e=e=>!!b2e.includes(e),C2e=(e,t)=>!_2e.includes(t),E2e=e=>!S2e.includes(e.properties.type.default),T2e=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(aie).filter(E2e).filter(s=>t?t.includes(s.properties.type.default):!0).filter(s=>n?!n.includes(s.properties.type.default):!0).reduce((s,a)=>{var g,v;const l=a.properties.type.default,u=a.title.replace("Invocation",""),c=a.tags??[],d=a.description??"",f=a.version,h=dC(a.properties,(S,w,x)=>{if(w2e(l,x))return pe("nodes").trace({node:l,fieldName:x,field:gn(w)},"Skipped reserved input field"),S;if(!Yk(w))return pe("nodes").warn({node:l,propertyName:x,property:gn(w)},"Unhandled input property"),S;const C=xR(w);if(!Xk(C))return pe("nodes").warn({node:l,fieldName:x,fieldType:C,field:gn(w)},"Skipping unknown input field type"),S;if(x2e(C))return pe("nodes").trace({node:l,fieldName:x,fieldType:C,field:gn(w)},"Skipping reserved field type"),S;const A=y2e(a,w,x,C);return A?(S[x]=A,S):(pe("nodes").debug({node:l,fieldName:x,fieldType:C,field:gn(w)},"Skipping input field with no template"),S)},{}),p=a.output.$ref.split("/").pop();if(!p)return pe("nodes").warn({outputRefObject:gn(a.output)},"No output schema name found in ref object"),s;const m=(v=(g=e.components)==null?void 0:g.schemas)==null?void 0:v[p];if(!m)return pe("nodes").warn({outputSchemaName:p},"Output schema not found"),s;if(!lie(m))return pe("nodes").error({outputSchema:gn(m)},"Invalid output schema"),s;const b=m.properties.type.default,_=dC(m.properties,(S,w,x)=>{if(!C2e(l,x))return pe("nodes").trace({type:l,propertyName:x,property:gn(w)},"Skipped reserved output field"),S;if(!Yk(w))return pe("nodes").warn({type:l,propertyName:x,property:gn(w)},"Unhandled output property"),S;const C=xR(w);return Xk(C)?(S[x]={fieldKind:"output",name:x,title:w.title??"",description:w.description??"",type:C,ui_hidden:w.ui_hidden??!1,ui_type:w.ui_type,ui_order:w.ui_order},S):(pe("nodes").warn({fieldName:x,fieldType:C,field:gn(w)},"Skipping unknown output field type"),S)},{}),y={title:u,type:l,version:f,tags:c,description:d,outputType:b,inputs:h,outputs:_};return Object.assign(s,{[l]:y}),s},{})},A2e=()=>{xe({actionCreator:Bg.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=pe("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:s}=n().config,a=T2e(i,o,s);r.debug({nodeTemplates:gn(a)},`Built ${O_(a)} node templates`),t(PB(a))}}),xe({actionCreator:Bg.rejected,effect:e=>{pe("system").error({error:gn(e.error)},"Problem retrieving OpenAPI Schema")}})},k2e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),P2e=new Map(k2e),R2e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],u3=new WeakSet,O2e=e=>{u3.add(e);const t=e.toJSON();return u3.delete(e),t},I2e=e=>P2e.get(e)??Error,Fz=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:i,depth:o,useToJSON:s,serialize:a})=>{if(!n)if(Array.isArray(e))n=[];else if(!a&&CR(e)){const u=I2e(e.name);n=new u}else n={};if(t.push(e),o>=i)return n;if(s&&typeof e.toJSON=="function"&&!u3.has(e))return O2e(e);const l=u=>Fz({from:u,seen:[...t],forceEnumerable:r,maxDepth:i,depth:o,useToJSON:s,serialize:a});for(const[u,c]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(c)){n[u]="[object Buffer]";continue}if(c!==null&&typeof c=="object"&&typeof c.pipe=="function"){n[u]="[object Stream]";continue}if(typeof c!="function"){if(!c||typeof c!="object"){n[u]=c;continue}if(!t.includes(e[u])){o++,n[u]=l(e[u]);continue}n[u]="[Circular]"}}for(const{property:u,enumerable:c}of R2e)typeof e[u]<"u"&&e[u]!==null&&Object.defineProperty(n,u,{value:CR(e[u])?l(e[u]):e[u],enumerable:r?!0:c,configurable:!0,writable:!0});return n};function DT(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?Fz({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function CR(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const M2e=()=>{xe({actionCreator:Pu.pending,effect:()=>{}})},N2e=()=>{xe({actionCreator:Pu.fulfilled,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session canceled (${n})`)}})},D2e=()=>{xe({actionCreator:Pu.rejected,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;if(e.payload){const{error:r}=e.payload;t.error({session_id:n,error:DT(r)},"Problem canceling session")}}})},L2e=()=>{xe({actionCreator:wi.pending,effect:()=>{}})},$2e=()=>{xe({actionCreator:wi.fulfilled,effect:e=>{const t=pe("session"),n=e.payload;t.debug({session:gn(n)},`Session created (${n.id})`)}})},F2e=()=>{xe({actionCreator:wi.rejected,effect:e=>{const t=pe("session");if(e.payload){const{error:n,status:r}=e.payload,i=gn(e.meta.arg);t.error({graph:i,status:r,error:DT(n)},"Problem creating session")}}})},B2e=()=>{xe({actionCreator:oh.pending,effect:()=>{}})},z2e=()=>{xe({actionCreator:oh.fulfilled,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session invoked (${n})`)}})},U2e=()=>{xe({actionCreator:oh.rejected,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;if(e.payload){const{error:r}=e.payload;t.error({session_id:n,error:DT(r)},"Problem invoking session")}}})},j2e=()=>{xe({actionCreator:nd,effect:(e,{getState:t,dispatch:n})=>{const r=pe("session"),{sessionId:i}=t().system;i&&(r.debug({session_id:i},`Session ready to invoke (${i})})`),n(oh({session_id:i})))}})},V2e=()=>{xe({actionCreator:k$,effect:(e,{dispatch:t,getState:n})=>{pe("socketio").debug("Connected");const{nodes:i,config:o}=n(),{disabledTabs:s}=o;!O_(i.nodeTemplates)&&!s.includes("nodes")&&t(Bg()),t(P$(e.payload)),t(ja.util.invalidateTags([{type:"MainModel",id:ft},{type:"SDXLRefinerModel",id:ft},{type:"LoRAModel",id:ft},{type:"ControlNetModel",id:ft},{type:"VaeModel",id:ft},{type:"TextualInversionModel",id:ft},{type:"ScannedModels",id:ft}])),t(mT.util.invalidateTags(["AppConfig","AppVersion"]))}})},G2e=()=>{xe({actionCreator:R$,effect:(e,{dispatch:t})=>{pe("socketio").debug("Disconnected"),t(O$(e.payload))}})},H2e=()=>{xe({actionCreator:B$,effect:(e,{dispatch:t,getState:n})=>{const r=pe("socketio");if(n().system.canceledSession===e.payload.data.graph_execution_state_id){r.trace(e.payload,"Ignored generator progress for canceled session");return}r.trace(e.payload,`Generator progress (${e.payload.data.node.type})`),t(qE(e.payload))}})},q2e=()=>{xe({actionCreator:$$,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Session complete"),t(F$(e.payload))}})},Be="positive_conditioning",Ve="negative_conditioning",Fe="denoise_latents",qe="latents_to_image",Hd="nsfw_checker",Hh="invisible_watermark",we="noise",Lr="rand_int",Kn="range_of_size",on="iterate",Lu="main_model_loader",RS="onnx_model_loader",Gs="vae_loader",Bz="lora_loader",Vt="clip_skip",Ln="image_to_latents",ta="resize_image",mf="img2img_resize",me="canvas_output",zn="inpaint_image",_i="inpaint_image_resize_up",Ni="inpaint_image_resize_down",zt="inpaint_infill",Gl="inpaint_infill_resize_down",$n="inpaint_create_mask",vt="canvas_coherence_denoise_latents",mn="canvas_coherence_noise",Di="canvas_coherence_noise_increment",ur="canvas_coherence_mask_edge",Dt="canvas_coherence_inpaint_create_mask",yf="tomask",Oi="mask_blur",yi="mask_combine",Fn="mask_resize_up",Li="mask_resize_down",Jy="control_net_collect",Iw="dynamic_prompt",kt="metadata_accumulator",ER="esrgan",Ii="sdxl_model_loader",Re="sdxl_denoise_latents",Hu="sdxl_refiner_model_loader",e0="sdxl_refiner_positive_conditioning",t0="sdxl_refiner_negative_conditioning",Hs="sdxl_refiner_denoise_latents",$a="refiner_inpaint_create_mask",Fr="seamless",Es="refiner_seamless",zz="text_to_image_graph",c3="image_to_image_graph",Uz="canvas_text_to_image_graph",d3="canvas_image_to_image_graph",OS="canvas_inpaint_graph",IS="canvas_outpaint_graph",LT="sdxl_text_to_image_graph",P1="sxdl_image_to_image_graph",MS="sdxl_canvas_text_to_image_graph",Gg="sdxl_canvas_image_to_image_graph",Lc="sdxl_canvas_inpaint_graph",$c="sdxl_canvas_outpaint_graph",W2e=["load_image"],K2e=()=>{xe({actionCreator:GE,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("socketio"),{data:i}=e.payload;r.debug({data:gn(i)},`Invocation complete (${e.payload.data.node.type})`);const o=e.payload.data.graph_execution_state_id,{cancelType:s,isCancelScheduled:a}=n().system;s==="scheduled"&&a&&t(Pu({session_id:o}));const{result:l,node:u,graph_execution_state_id:c}=i;if(Nz(l)&&!W2e.includes(u.type)){const{image_name:d}=l.image,{canvas:f,gallery:h}=n(),p=await t(he.endpoints.getImageDTO.initiate(d)).unwrap();if(c===f.layerState.stagingArea.sessionId&&[me].includes(i.source_node_id)&&t(qne(p)),!p.is_intermediate){const{autoAddBoardId:m}=h;t(m&&m!=="none"?he.endpoints.addImageToBoard.initiate({board_id:m,imageDTO:p}):he.util.updateQueryData("listImages",{board_id:"none",categories:Xr},y=>{Nn.addOne(y,p)})),t(he.util.invalidateTags([{type:"BoardImagesTotal",id:m},{type:"BoardAssetsTotal",id:m}]));const{selectedBoardId:b,shouldAutoSwitch:_}=h;_&&(m&&m!==b?(t(NC(m)),t(f1("images"))):m||t(f1("images")),t(da(p)))}t(Rye(null))}t(HE(e.payload))}})},X2e=()=>{xe({actionCreator:L$,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(Tb(e.payload))}})},Q2e=()=>{xe({actionCreator:G$,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(H$(e.payload))}})},Y2e=()=>{xe({actionCreator:D$,effect:(e,{dispatch:t,getState:n})=>{const r=pe("socketio");if(n().system.canceledSession===e.payload.data.graph_execution_state_id){r.trace(e.payload,"Ignored invocation started for canceled session");return}r.debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(VE(e.payload))}})},Z2e=()=>{xe({actionCreator:z$,effect:(e,{dispatch:t})=>{const n=pe("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(ide(e.payload))}}),xe({actionCreator:U$,effect:(e,{dispatch:t})=>{const n=pe("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(ode(e.payload))}})},J2e=()=>{xe({actionCreator:j$,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(V$(e.payload))}})},ewe=()=>{xe({actionCreator:jE,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Subscribed"),t(I$(e.payload))}})},twe=()=>{xe({actionCreator:M$,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Unsubscribed"),t(N$(e.payload))}})},nwe=()=>{xe({actionCreator:j0e,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(he.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(he.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(Bn({title:"Image Saved",status:"success"}))}catch(i){t(Bn({title:"Image Saving Failed",description:i==null?void 0:i.message,status:"error"}))}}})},hMe=["sd-1","sd-2","sdxl","sdxl-refiner"],rwe=["sd-1","sd-2","sdxl"],pMe=["sdxl"],gMe=["sd-1","sd-2"],mMe=["sdxl-refiner"],iwe=()=>{xe({actionCreator:UB,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(ja.endpoints.getMainModels.initiate(rwe)),a=await s.unwrap();if(s.unsubscribe(),!a.ids.length){n(Ul(null));return}const u=Vg.getSelectors().selectAll(a).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n(Ul(null));return}const{base_model:c,model_name:d,model_type:f}=u;n(Ul({base_model:c,model_name:d,model_type:f}))}catch{n(Ul(null))}}}})},owe=({image_name:e,esrganModelName:t})=>{const n={id:ER,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!1};return{id:"adhoc-esrgan-graph",nodes:{[ER]:n},edges:[]}},swe=Me("upscale/upscaleRequested"),awe=()=>{xe({actionCreator:swe,effect:async(e,{dispatch:t,getState:n,take:r})=>{const{image_name:i}=e.payload,{esrganModelName:o}=n().postprocessing,s=owe({image_name:i,esrganModelName:o});t(wi({graph:s})),await r(wi.fulfilled.match),t(nd())}})},lwe=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>")})},TR=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)}),uwe=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}},cwe=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},dwe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=uwe(e.data),i=cwe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},fwe=e=>dee(e,n=>n.isEnabled&&(!!n.processedControlImage||n.processorType==="none"&&!!n.controlImage)),as=(e,t,n)=>{const{isEnabled:r,controlNets:i}=e.controlNet,o=fwe(i),s=t.nodes[kt];if(r&&o.length&&o.length){const a={id:Jy,type:"collect",is_intermediate:!0};t.nodes[Jy]=a,t.edges.push({source:{node_id:Jy,field:"collection"},destination:{node_id:n,field:"control"}}),o.forEach(l=>{const{controlNetId:u,controlImage:c,processedControlImage:d,beginStepPct:f,endStepPct:h,controlMode:p,resizeMode:m,model:b,processorType:_,weight:y}=l,g={id:`control_net_${u}`,type:"controlnet",is_intermediate:!0,begin_step_percent:f,end_step_percent:h,control_mode:p,resize_mode:m,control_model:b,control_weight:y};if(d&&_!=="none")g.image={image_name:d};else if(c)g.image={image_name:c};else return;if(t.nodes[g.id]=g,s!=null&&s.controlnets){const v=R_(g,["id","type"]);s.controlnets.push(v)}t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:Jy,field:"item"}})})}},$u=(e,t)=>{const{positivePrompt:n,iterations:r,seed:i,shouldRandomizeSeed:o}=e.generation,{combinatorial:s,isEnabled:a,maxPrompts:l}=e.dynamicPrompts,u=t.nodes[kt];if(a){ste(t.nodes[Be],"prompt");const c={id:Iw,type:"dynamic_prompt",is_intermediate:!0,max_prompts:s?l:r,combinatorial:s,prompt:n},d={id:on,type:"iterate",is_intermediate:!0};if(t.nodes[Iw]=c,t.nodes[on]=d,t.edges.push({source:{node_id:Iw,field:"collection"},destination:{node_id:on,field:"collection"}},{source:{node_id:on,field:"item"},destination:{node_id:Be,field:"prompt"}}),u&&t.edges.push({source:{node_id:on,field:"item"},destination:{node_id:kt,field:"positive_prompt"}}),o){const f={id:Lr,type:"rand_int",is_intermediate:!0};t.nodes[Lr]=f,t.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:we,field:"seed"}}),u&&t.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:kt,field:"seed"}})}else t.nodes[we].seed=i,u&&(u.seed=i)}else{u&&(u.positive_prompt=n);const c={id:Kn,type:"range_of_size",is_intermediate:!0,size:r,step:1},d={id:on,type:"iterate",is_intermediate:!0};if(t.nodes[on]=d,t.nodes[Kn]=c,t.edges.push({source:{node_id:Kn,field:"collection"},destination:{node_id:on,field:"collection"}}),t.edges.push({source:{node_id:on,field:"item"},destination:{node_id:we,field:"seed"}}),u&&t.edges.push({source:{node_id:on,field:"item"},destination:{node_id:kt,field:"seed"}}),o){const f={id:Lr,type:"rand_int",is_intermediate:!0};t.nodes[Lr]=f,t.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:Kn,field:"start"}})}else c.start=i}},gh=(e,t,n,r=Lu)=>{const{loras:i}=e.lora,o=O_(i),s=t.nodes[kt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))),t.edges=t.edges.filter(u=>!(u.source.node_id===Vt&&["clip"].includes(u.source.field))));let a="",l=0;ns(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${Bz}_${c.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:c,base_model:d},weight:f};s!=null&&s.loras&&s.loras.push({lora:{model_name:c,base_model:d},weight:f}),t.nodes[h]=p,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:Vt,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:a,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:a,field:"clip"},destination:{node_id:h,field:"clip"}})),l===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[OS,IS].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:vt,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Ve,field:"clip"}})),a=h,l+=1})},$T=$i(e=>e.ui,e=>FB[e.activeTab],{memoizeOptions:{equalityCheck:Sm}}),yMe=$i(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Sm}}),vMe=$i(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Sm}}),ls=(e,t,n=qe)=>{const i=$T(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[kt];if(!o)return;o.is_intermediate=!0;const a={id:Hd,type:"img_nsfw",is_intermediate:i};t.nodes[Hd]=a,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Hd,field:"image"}}),s&&t.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:Hd,field:"metadata"}})},us=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[Fr]={id:Fr,type:"seamless",seamless_x:r,seamless_y:i};let o=Fe;(t.id===LT||t.id===P1||t.id===MS||t.id===Gg||t.id===Lc||t.id===$c)&&(o=Re),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:Fr,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:Fr,field:"vae"}},{source:{node_id:Fr,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==OS||t.id===IS||t.id===Lc||t.id===$c)&&t.edges.push({source:{node_id:Fr,field:"unet"},destination:{node_id:vt,field:"unet"}})},cs=(e,t,n=Lu)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:s}=e.sdxl,a=["auto","manual"].includes(o),l=!r,u=t.nodes[kt];l||(t.nodes[Gs]={type:"vae_loader",id:Gs,is_intermediate:!0,vae_model:r});const c=n==RS;(t.id===zz||t.id===c3||t.id===LT||t.id===P1)&&t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:qe,field:"vae"}}),(t.id===Uz||t.id===d3||t.id===MS||t.id==Gg)&&t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:a?qe:me,field:"vae"}}),(t.id===c3||t.id===P1||t.id===d3||t.id===Gg)&&t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ln,field:"vae"}}),(t.id===OS||t.id===IS||t.id===Lc||t.id===$c)&&(t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:zn,field:"vae"}},{source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:$n,field:"vae"}},{source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:qe,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Dt,field:"vae"}})),s&&(t.id===Lc||t.id===$c)&&t.edges.push({source:{node_id:l?n:Gs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:$a,field:"vae"}}),r&&u&&(u.vae=r)},ds=(e,t,n=qe)=>{const i=$T(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[Hd],a=t.nodes[kt];if(!o)return;const l={id:Hh,type:"img_watermark",is_intermediate:i};t.nodes[Hh]=l,o.is_intermediate=!0,s?(s.is_intermediate=!0,t.edges.push({source:{node_id:Hd,field:"image"},destination:{node_id:Hh,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Hh,field:"image"}}),a&&t.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:Hh,field:"metadata"}})},hwe=(e,t)=>{const n=pe("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,steps:l,img2imgStrength:u,vaePrecision:c,clipSkip:d,shouldUseCpuNoise:f,shouldUseNoiseSettings:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{width:b,height:_}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:g,shouldAutoSave:v}=e.canvas,S=c==="fp32",w=["auto","manual"].includes(g);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=Lu;const C=h?f:Fs.shouldUseCpuNoise,A={id:d3,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:!0,model:o},[Vt]:{type:"clip_skip",id:Vt,is_intermediate:!0,skipped_layers:d},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:r},[Ve]:{type:"compel",id:Ve,is_intermediate:!0,prompt:i},[we]:{type:"noise",id:we,is_intermediate:!0,use_cpu:C,width:w?y.width:b,height:w?y.height:_},[Ln]:{type:"i2l",id:Ln,is_intermediate:!0},[Fe]:{type:"denoise_latents",id:Fe,is_intermediate:!0,cfg_scale:s,scheduler:a,steps:l,denoising_start:1-u,denoising_end:1},[me]:{type:"l2i",id:me,is_intermediate:!v}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}},{source:{node_id:Ln,field:"latents"},destination:{node_id:Fe,field:"latents"}}]};return w?(A.nodes[mf]={id:mf,type:"img_resize",is_intermediate:!0,image:t,width:y.width,height:y.height},A.nodes[qe]={id:qe,type:"l2i",is_intermediate:!0,fp32:S},A.nodes[me]={id:me,type:"img_resize",is_intermediate:!v,width:b,height:_},A.edges.push({source:{node_id:mf,field:"image"},destination:{node_id:Ln,field:"image"}},{source:{node_id:Fe,field:"latents"},destination:{node_id:qe,field:"latents"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}})):(A.nodes[me]={type:"l2i",id:me,is_intermediate:!v,fp32:S},A.nodes[Ln].image=t,A.edges.push({source:{node_id:Fe,field:"latents"},destination:{node_id:me,field:"latents"}})),A.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,width:w?y.width:b,height:w?y.height:_,positive_prompt:"",negative_prompt:i,model:o,seed:0,steps:l,rand_device:C?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:d,strength:u,init_image:t.image_name},A.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(p||m)&&(us(e,A,x),x=Fr),gh(e,A,Fe),cs(e,A,x),$u(e,A),as(e,A,Fe),e.system.shouldUseNSFWChecker&&ls(e,A,me),e.system.shouldUseWatermarker&&ds(e,A,me),A},pwe=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:c,iterations:d,seed:f,shouldRandomizeSeed:h,vaePrecision:p,shouldUseNoiseSettings:m,shouldUseCpuNoise:b,maskBlur:_,maskBlurMethod:y,canvasCoherenceMode:g,canvasCoherenceSteps:v,canvasCoherenceStrength:S,clipSkip:w,seamlessXAxis:x,seamlessYAxis:C}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:A,height:T}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:k,boundingBoxScaleMethod:L,shouldAutoSave:N}=e.canvas,E=p==="fp32",P=["auto","manual"].includes(L);let D=Lu;const B=b,R={id:OS,nodes:{[D]:{type:"main_model_loader",id:D,is_intermediate:!0,model:s},[Vt]:{type:"clip_skip",id:Vt,is_intermediate:!0,skipped_layers:w},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:i},[Ve]:{type:"compel",id:Ve,is_intermediate:!0,prompt:o},[Oi]:{type:"img_blur",id:Oi,is_intermediate:!0,radius:_,blur_type:y},[zn]:{type:"i2l",id:zn,is_intermediate:!0,fp32:E},[we]:{type:"noise",id:we,use_cpu:B,is_intermediate:!0},[$n]:{type:"create_denoise_mask",id:$n,is_intermediate:!0,fp32:E},[Fe]:{type:"denoise_latents",id:Fe,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-c,denoising_end:1},[mn]:{type:"noise",id:we,use_cpu:B,is_intermediate:!0},[Di]:{type:"add",id:Di,b:1,is_intermediate:!0},[vt]:{type:"denoise_latents",id:vt,is_intermediate:!0,steps:v,cfg_scale:a,scheduler:l,denoising_start:1-S,denoising_end:1},[qe]:{type:"l2i",id:qe,is_intermediate:!0,fp32:E},[me]:{type:"color_correct",id:me,is_intermediate:!N,reference:t},[Kn]:{type:"range_of_size",id:Kn,is_intermediate:!0,size:d,step:1},[on]:{type:"iterate",id:on,is_intermediate:!0}},edges:[{source:{node_id:D,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:D,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Fe,field:"latents"}},{source:{node_id:Oi,field:"image"},destination:{node_id:$n,field:"mask"}},{source:{node_id:$n,field:"denoise_mask"},destination:{node_id:Fe,field:"denoise_mask"}},{source:{node_id:Kn,field:"collection"},destination:{node_id:on,field:"collection"}},{source:{node_id:on,field:"item"},destination:{node_id:we,field:"seed"}},{source:{node_id:on,field:"item"},destination:{node_id:Di,field:"a"}},{source:{node_id:Di,field:"value"},destination:{node_id:mn,field:"seed"}},{source:{node_id:D,field:"unet"},destination:{node_id:vt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:vt,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:vt,field:"negative_conditioning"}},{source:{node_id:mn,field:"noise"},destination:{node_id:vt,field:"noise"}},{source:{node_id:Fe,field:"latents"},destination:{node_id:vt,field:"latents"}},{source:{node_id:vt,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(P){const O=k.width,I=k.height;R.nodes[_i]={type:"img_resize",id:_i,is_intermediate:!0,width:O,height:I,image:t},R.nodes[Fn]={type:"img_resize",id:Fn,is_intermediate:!0,width:O,height:I,image:n},R.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:A,height:T},R.nodes[Li]={type:"img_resize",id:Li,is_intermediate:!0,width:A,height:T},R.nodes[we].width=O,R.nodes[we].height=I,R.nodes[mn].width=O,R.nodes[mn].height=I,R.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:Fn,field:"image"},destination:{node_id:Oi,field:"image"}},{source:{node_id:_i,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:qe,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Oi,field:"image"},destination:{node_id:Li,field:"image"}},{source:{node_id:Li,field:"image"},destination:{node_id:me,field:"mask"}})}else R.nodes[we].width=A,R.nodes[we].height=T,R.nodes[mn].width=A,R.nodes[mn].height=T,R.nodes[zn]={...R.nodes[zn],image:t},R.nodes[Oi]={...R.nodes[Oi],image:n},R.nodes[$n]={...R.nodes[$n],image:t},R.edges.push({source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Oi,field:"image"},destination:{node_id:me,field:"mask"}});if(g!=="unmasked"&&(R.nodes[Dt]={type:"create_denoise_mask",id:Dt,is_intermediate:!0,fp32:E},P?R.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:Dt,field:"image"}}):R.nodes[Dt]={...R.nodes[Dt],image:t},g==="mask"&&(P?R.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:Dt,field:"mask"}}):R.nodes[Dt]={...R.nodes[Dt],mask:n}),g==="edge"&&(R.nodes[ur]={type:"mask_edge",id:ur,is_intermediate:!0,edge_blur:_,edge_size:_*2,low_threshold:100,high_threshold:200},P?R.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:ur,field:"image"}}):R.nodes[ur]={...R.nodes[ur],image:n},R.edges.push({source:{node_id:ur,field:"image"},destination:{node_id:Dt,field:"mask"}})),R.edges.push({source:{node_id:Dt,field:"denoise_mask"},destination:{node_id:vt,field:"denoise_mask"}})),h){const O={id:Lr,type:"rand_int"};R.nodes[Lr]=O,R.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:Kn,field:"start"}})}else R.nodes[Kn].start=f;return(x||C)&&(us(e,R,D),D=Fr),cs(e,R,D),gh(e,R,Fe,D),as(e,R,Fe),e.system.shouldUseNSFWChecker&&ls(e,R,me),e.system.shouldUseWatermarker&&ds(e,R,me),R},gwe=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:c,iterations:d,seed:f,shouldRandomizeSeed:h,vaePrecision:p,shouldUseNoiseSettings:m,shouldUseCpuNoise:b,maskBlur:_,canvasCoherenceMode:y,canvasCoherenceSteps:g,canvasCoherenceStrength:v,infillTileSize:S,infillPatchmatchDownscaleSize:w,infillMethod:x,clipSkip:C,seamlessXAxis:A,seamlessYAxis:T}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:k,height:L}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:N,boundingBoxScaleMethod:E,shouldAutoSave:P}=e.canvas,D=p==="fp32",B=["auto","manual"].includes(E);let R=Lu;const O=b,I={id:IS,nodes:{[R]:{type:"main_model_loader",id:R,is_intermediate:!0,model:s},[Vt]:{type:"clip_skip",id:Vt,is_intermediate:!0,skipped_layers:C},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:i},[Ve]:{type:"compel",id:Ve,is_intermediate:!0,prompt:o},[yf]:{type:"tomask",id:yf,is_intermediate:!0,image:t},[yi]:{type:"mask_combine",id:yi,is_intermediate:!0,mask2:n},[zn]:{type:"i2l",id:zn,is_intermediate:!0,fp32:D},[we]:{type:"noise",id:we,use_cpu:O,is_intermediate:!0},[$n]:{type:"create_denoise_mask",id:$n,is_intermediate:!0,fp32:D},[Fe]:{type:"denoise_latents",id:Fe,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-c,denoising_end:1},[mn]:{type:"noise",id:we,use_cpu:O,is_intermediate:!0},[Di]:{type:"add",id:Di,b:1,is_intermediate:!0},[vt]:{type:"denoise_latents",id:vt,is_intermediate:!0,steps:g,cfg_scale:a,scheduler:l,denoising_start:1-v,denoising_end:1},[qe]:{type:"l2i",id:qe,is_intermediate:!0,fp32:D},[me]:{type:"color_correct",id:me,is_intermediate:!P},[Kn]:{type:"range_of_size",id:Kn,is_intermediate:!0,size:d,step:1},[on]:{type:"iterate",id:on,is_intermediate:!0}},edges:[{source:{node_id:R,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:R,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:zt,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:yf,field:"image"},destination:{node_id:yi,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Fe,field:"latents"}},{source:{node_id:B?Fn:yi,field:"image"},destination:{node_id:$n,field:"mask"}},{source:{node_id:$n,field:"denoise_mask"},destination:{node_id:Fe,field:"denoise_mask"}},{source:{node_id:Kn,field:"collection"},destination:{node_id:on,field:"collection"}},{source:{node_id:on,field:"item"},destination:{node_id:we,field:"seed"}},{source:{node_id:on,field:"item"},destination:{node_id:Di,field:"a"}},{source:{node_id:Di,field:"value"},destination:{node_id:mn,field:"seed"}},{source:{node_id:R,field:"unet"},destination:{node_id:vt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:vt,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:vt,field:"negative_conditioning"}},{source:{node_id:mn,field:"noise"},destination:{node_id:vt,field:"noise"}},{source:{node_id:Fe,field:"latents"},destination:{node_id:vt,field:"latents"}},{source:{node_id:zt,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:vt,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(x==="patchmatch"&&(I.nodes[zt]={type:"infill_patchmatch",id:zt,is_intermediate:!0,downscale:w}),x==="lama"&&(I.nodes[zt]={type:"infill_lama",id:zt,is_intermediate:!0}),x==="cv2"&&(I.nodes[zt]={type:"infill_cv2",id:zt,is_intermediate:!0}),x==="tile"&&(I.nodes[zt]={type:"infill_tile",id:zt,is_intermediate:!0,tile_size:S}),B){const F=N.width,U=N.height;I.nodes[_i]={type:"img_resize",id:_i,is_intermediate:!0,width:F,height:U,image:t},I.nodes[Fn]={type:"img_resize",id:Fn,is_intermediate:!0,width:F,height:U},I.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:k,height:L},I.nodes[Gl]={type:"img_resize",id:Gl,is_intermediate:!0,width:k,height:L},I.nodes[Li]={type:"img_resize",id:Li,is_intermediate:!0,width:k,height:L},I.nodes[we].width=F,I.nodes[we].height=U,I.nodes[mn].width=F,I.nodes[mn].height=U,I.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:zt,field:"image"}},{source:{node_id:yi,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:qe,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Fn,field:"image"},destination:{node_id:Li,field:"image"}},{source:{node_id:zt,field:"image"},destination:{node_id:Gl,field:"image"}},{source:{node_id:Gl,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Li,field:"image"},destination:{node_id:me,field:"mask"}})}else I.nodes[zt]={...I.nodes[zt],image:t},I.nodes[we].width=k,I.nodes[we].height=L,I.nodes[mn].width=k,I.nodes[mn].height=L,I.nodes[zn]={...I.nodes[zn],image:t},I.edges.push({source:{node_id:zt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:yi,field:"image"},destination:{node_id:me,field:"mask"}});if(y!=="unmasked"&&(I.nodes[Dt]={type:"create_denoise_mask",id:Dt,is_intermediate:!0,fp32:D},I.edges.push({source:{node_id:zt,field:"image"},destination:{node_id:Dt,field:"image"}}),y==="mask"&&(B?I.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:Dt,field:"mask"}}):I.edges.push({source:{node_id:yi,field:"image"},destination:{node_id:Dt,field:"mask"}})),y==="edge"&&(I.nodes[ur]={type:"mask_edge",id:ur,is_intermediate:!0,edge_blur:_,edge_size:_*2,low_threshold:100,high_threshold:200},B?I.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:ur,field:"image"}}):I.edges.push({source:{node_id:yi,field:"image"},destination:{node_id:ur,field:"image"}}),I.edges.push({source:{node_id:ur,field:"image"},destination:{node_id:Dt,field:"mask"}})),I.edges.push({source:{node_id:Dt,field:"denoise_mask"},destination:{node_id:vt,field:"denoise_mask"}})),h){const F={id:Lr,type:"rand_int"};I.nodes[Lr]=F,I.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:Kn,field:"start"}})}else I.nodes[Kn].start=f;return(A||T)&&(us(e,I,R),R=Fr),cs(e,I,R),gh(e,I,Fe,R),as(e,I,Fe),e.system.shouldUseNSFWChecker&&ls(e,I,me),e.system.shouldUseWatermarker&&ds(e,I,me),I},mh=(e,t,n,r=Ii)=>{const{loras:i}=e.lora,o=O_(i),s=t.nodes[kt],a=r;let l=r;[Fr,$a].includes(r)&&(l=Ii),o>0&&(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 u="",c=0;ns(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${Bz}_${f.replace(".","_")}`,b={type:"sdxl_lora_loader",id:m,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};s&&(s.loras||(s.loras=[]),s.loras.push({lora:{model_name:f,base_model:h},weight:p})),t.nodes[m]=b,c===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:u,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:u,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:u,field:"clip2"},destination:{node_id:m,field:"clip2"}})),c===o-1&&(t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[Lc,$c].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:vt,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Ve,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Be,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Ve,field:"clip2"}})),u=m,c+=1})},rd=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o}=e.sdxl;let s=i,a=o;return t&&(i.length>0?s=`${n} ${i}`:s=n,o.length>0?a=`${r} ${o}`:a=r),{craftedPositiveStylePrompt:s,craftedNegativeStylePrompt:a}},yh=(e,t,n,r,i)=>{const{refinerModel:o,refinerPositiveAestheticScore:s,refinerNegativeAestheticScore:a,refinerSteps:l,refinerScheduler:u,refinerCFGScale:c,refinerStart:d}=e.sdxl,{seamlessXAxis:f,seamlessYAxis:h,vaePrecision:p}=e.generation,{boundingBoxScaleMethod:m}=e.canvas,b=p==="fp32",_=["auto","manual"].includes(m);if(!o)return;const y=t.nodes[kt];y&&(y.refiner_model=o,y.refiner_positive_aesthetic_score=s,y.refiner_negative_aesthetic_score=a,y.refiner_cfg_scale=c,y.refiner_scheduler=u,y.refiner_start=d,y.refiner_steps=l);const g=r||Ii,{craftedPositiveStylePrompt:v,craftedNegativeStylePrompt:S}=rd(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[Hu]={type:"sdxl_refiner_model_loader",id:Hu,model:o},t.nodes[e0]={type:"sdxl_refiner_compel_prompt",id:e0,style:v,aesthetic_score:s},t.nodes[t0]={type:"sdxl_refiner_compel_prompt",id:t0,style:S,aesthetic_score:a},t.nodes[Hs]={type:"denoise_latents",id:Hs,cfg_scale:c,steps:l,scheduler:u,denoising_start:d,denoising_end:1},f||h?(t.nodes[Es]={id:Es,type:"seamless",seamless_x:f,seamless_y:h},t.edges.push({source:{node_id:Hu,field:"unet"},destination:{node_id:Es,field:"unet"}},{source:{node_id:Hu,field:"vae"},destination:{node_id:Es,field:"vae"}},{source:{node_id:Es,field:"unet"},destination:{node_id:Hs,field:"unet"}})):t.edges.push({source:{node_id:Hu,field:"unet"},destination:{node_id:Hs,field:"unet"}}),t.edges.push({source:{node_id:Hu,field:"clip2"},destination:{node_id:e0,field:"clip2"}},{source:{node_id:Hu,field:"clip2"},destination:{node_id:t0,field:"clip2"}},{source:{node_id:e0,field:"conditioning"},destination:{node_id:Hs,field:"positive_conditioning"}},{source:{node_id:t0,field:"conditioning"},destination:{node_id:Hs,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:Hs,field:"latents"}}),(t.id===Lc||t.id===$c)&&(t.nodes[$a]={type:"create_denoise_mask",id:$a,is_intermediate:!0,fp32:b},_?t.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:$a,field:"image"}}):t.nodes[$a]={...t.nodes[$a],image:i},t.edges.push({source:{node_id:_?Fn:yi,field:"image"},destination:{node_id:$a,field:"mask"}},{source:{node_id:$a,field:"denoise_mask"},destination:{node_id:Hs,field:"denoise_mask"}})),t.id===MS||t.id===Gg?t.edges.push({source:{node_id:Hs,field:"latents"},destination:{node_id:_?qe:me,field:"latents"}}):t.edges.push({source:{node_id:Hs,field:"latents"},destination:{node_id:qe,field:"latents"}})},mwe=(e,t)=>{const n=pe("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,shouldUseNoiseSettings:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{shouldUseSDXLRefiner:m,refinerStart:b,sdxlImg2ImgDenoisingStrength:_,shouldConcatSDXLStylePrompt:y}=e.sdxl,{width:g,height:v}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:S,boundingBoxScaleMethod:w,shouldAutoSave:x}=e.canvas,C=u==="fp32",A=["auto","manual"].includes(w);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let T=Ii;const k=f?d:Fs.shouldUseCpuNoise,{craftedPositiveStylePrompt:L,craftedNegativeStylePrompt:N}=rd(e,y),E={id:Gg,nodes:{[T]:{type:"sdxl_model_loader",id:T,model:o},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:L},[Ve]:{type:"sdxl_compel_prompt",id:Ve,prompt:i,style:N},[we]:{type:"noise",id:we,is_intermediate:!0,use_cpu:k,width:A?S.width:g,height:A?S.height:v},[Ln]:{type:"i2l",id:Ln,is_intermediate:!0,fp32:C},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,cfg_scale:s,scheduler:a,steps:l,denoising_start:m?Math.min(b,1-_):1-_,denoising_end:m?b:1}},edges:[{source:{node_id:T,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:T,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:T,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Ln,field:"latents"},destination:{node_id:Re,field:"latents"}}]};return A?(E.nodes[mf]={id:mf,type:"img_resize",is_intermediate:!0,image:t,width:S.width,height:S.height},E.nodes[qe]={id:qe,type:"l2i",is_intermediate:!0,fp32:C},E.nodes[me]={id:me,type:"img_resize",is_intermediate:!x,width:g,height:v},E.edges.push({source:{node_id:mf,field:"image"},destination:{node_id:Ln,field:"image"}},{source:{node_id:Re,field:"latents"},destination:{node_id:qe,field:"latents"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}})):(E.nodes[me]={type:"l2i",id:me,is_intermediate:!x,fp32:C},E.nodes[Ln].image=t,E.edges.push({source:{node_id:Re,field:"latents"},destination:{node_id:me,field:"latents"}})),E.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,width:A?S.width:g,height:A?S.height:v,positive_prompt:"",negative_prompt:i,model:o,seed:0,steps:l,rand_device:k?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:c,strength:_,init_image:t.image_name},E.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(h||p)&&(us(e,E,T),T=Fr),m&&(yh(e,E,Re,T),(h||p)&&(T=Es)),cs(e,E,T),mh(e,E,Re,T),$u(e,E),as(e,E,Re),e.system.shouldUseNSFWChecker&&ls(e,E,me),e.system.shouldUseWatermarker&&ds(e,E,me),E},ywe=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,iterations:c,seed:d,shouldRandomizeSeed:f,vaePrecision:h,shouldUseNoiseSettings:p,shouldUseCpuNoise:m,maskBlur:b,maskBlurMethod:_,canvasCoherenceMode:y,canvasCoherenceSteps:g,canvasCoherenceStrength:v,seamlessXAxis:S,seamlessYAxis:w}=e.generation,{sdxlImg2ImgDenoisingStrength:x,shouldUseSDXLRefiner:C,refinerStart:A,shouldConcatSDXLStylePrompt:T}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:k,height:L}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:N,boundingBoxScaleMethod:E,shouldAutoSave:P}=e.canvas,D=h==="fp32",B=["auto","manual"].includes(E);let R=Ii;const O=m,{craftedPositiveStylePrompt:I,craftedNegativeStylePrompt:F}=rd(e,T),U={id:Lc,nodes:{[R]:{type:"sdxl_model_loader",id:R,model:s},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:I},[Ve]:{type:"sdxl_compel_prompt",id:Ve,prompt:o,style:F},[Oi]:{type:"img_blur",id:Oi,is_intermediate:!0,radius:b,blur_type:_},[zn]:{type:"i2l",id:zn,is_intermediate:!0,fp32:D},[we]:{type:"noise",id:we,use_cpu:O,is_intermediate:!0},[$n]:{type:"create_denoise_mask",id:$n,is_intermediate:!0,fp32:D},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:C?Math.min(A,1-x):1-x,denoising_end:C?A:1},[mn]:{type:"noise",id:we,use_cpu:O,is_intermediate:!0},[Di]:{type:"add",id:Di,b:1,is_intermediate:!0},[vt]:{type:"denoise_latents",id:vt,is_intermediate:!0,steps:g,cfg_scale:a,scheduler:l,denoising_start:1-v,denoising_end:1},[qe]:{type:"l2i",id:qe,is_intermediate:!0,fp32:D},[me]:{type:"color_correct",id:me,is_intermediate:!P,reference:t},[Kn]:{type:"range_of_size",id:Kn,is_intermediate:!0,size:c,step:1},[on]:{type:"iterate",id:on,is_intermediate:!0}},edges:[{source:{node_id:R,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:R,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:R,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:R,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:R,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Oi,field:"image"},destination:{node_id:$n,field:"mask"}},{source:{node_id:$n,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}},{source:{node_id:Kn,field:"collection"},destination:{node_id:on,field:"collection"}},{source:{node_id:on,field:"item"},destination:{node_id:we,field:"seed"}},{source:{node_id:on,field:"item"},destination:{node_id:Di,field:"a"}},{source:{node_id:Di,field:"value"},destination:{node_id:mn,field:"seed"}},{source:{node_id:R,field:"unet"},destination:{node_id:vt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:vt,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:vt,field:"negative_conditioning"}},{source:{node_id:mn,field:"noise"},destination:{node_id:vt,field:"noise"}},{source:{node_id:Re,field:"latents"},destination:{node_id:vt,field:"latents"}},{source:{node_id:vt,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(B){const V=N.width,H=N.height;U.nodes[_i]={type:"img_resize",id:_i,is_intermediate:!0,width:V,height:H,image:t},U.nodes[Fn]={type:"img_resize",id:Fn,is_intermediate:!0,width:V,height:H,image:n},U.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:k,height:L},U.nodes[Li]={type:"img_resize",id:Li,is_intermediate:!0,width:k,height:L},U.nodes[we].width=V,U.nodes[we].height=H,U.nodes[mn].width=V,U.nodes[mn].height=H,U.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:Fn,field:"image"},destination:{node_id:Oi,field:"image"}},{source:{node_id:_i,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:qe,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Oi,field:"image"},destination:{node_id:Li,field:"image"}},{source:{node_id:Li,field:"image"},destination:{node_id:me,field:"mask"}})}else U.nodes[we].width=k,U.nodes[we].height=L,U.nodes[mn].width=k,U.nodes[mn].height=L,U.nodes[zn]={...U.nodes[zn],image:t},U.nodes[Oi]={...U.nodes[Oi],image:n},U.nodes[$n]={...U.nodes[$n],image:t},U.edges.push({source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Oi,field:"image"},destination:{node_id:me,field:"mask"}});if(y!=="unmasked"&&(U.nodes[Dt]={type:"create_denoise_mask",id:Dt,is_intermediate:!0,fp32:D},B?U.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:Dt,field:"image"}}):U.nodes[Dt]={...U.nodes[Dt],image:t},y==="mask"&&(B?U.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:Dt,field:"mask"}}):U.nodes[Dt]={...U.nodes[Dt],mask:n}),y==="edge"&&(U.nodes[ur]={type:"mask_edge",id:ur,is_intermediate:!0,edge_blur:b,edge_size:b*2,low_threshold:100,high_threshold:200},B?U.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:ur,field:"image"}}):U.nodes[ur]={...U.nodes[ur],image:n},U.edges.push({source:{node_id:ur,field:"image"},destination:{node_id:Dt,field:"mask"}})),U.edges.push({source:{node_id:Dt,field:"denoise_mask"},destination:{node_id:vt,field:"denoise_mask"}})),f){const V={id:Lr,type:"rand_int"};U.nodes[Lr]=V,U.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:Kn,field:"start"}})}else U.nodes[Kn].start=d;return(S||w)&&(us(e,U,R),R=Fr),C&&(yh(e,U,vt,R,t),(S||w)&&(R=Es)),cs(e,U,R),mh(e,U,Re,R),as(e,U,Re),e.system.shouldUseNSFWChecker&&ls(e,U,me),e.system.shouldUseWatermarker&&ds(e,U,me),U},vwe=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,iterations:c,seed:d,shouldRandomizeSeed:f,vaePrecision:h,shouldUseNoiseSettings:p,shouldUseCpuNoise:m,maskBlur:b,canvasCoherenceMode:_,canvasCoherenceSteps:y,canvasCoherenceStrength:g,infillTileSize:v,infillPatchmatchDownscaleSize:S,infillMethod:w,seamlessXAxis:x,seamlessYAxis:C}=e.generation,{sdxlImg2ImgDenoisingStrength:A,shouldUseSDXLRefiner:T,refinerStart:k,shouldConcatSDXLStylePrompt:L}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:N,height:E}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:D,shouldAutoSave:B}=e.canvas,R=h==="fp32",O=["auto","manual"].includes(D);let I=Ii;const F=m,{craftedPositiveStylePrompt:U,craftedNegativeStylePrompt:V}=rd(e,L),H={id:$c,nodes:{[Ii]:{type:"sdxl_model_loader",id:Ii,model:s},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:U},[Ve]:{type:"sdxl_compel_prompt",id:Ve,prompt:o,style:V},[yf]:{type:"tomask",id:yf,is_intermediate:!0,image:t},[yi]:{type:"mask_combine",id:yi,is_intermediate:!0,mask2:n},[zn]:{type:"i2l",id:zn,is_intermediate:!0,fp32:R},[we]:{type:"noise",id:we,use_cpu:F,is_intermediate:!0},[$n]:{type:"create_denoise_mask",id:$n,is_intermediate:!0,fp32:R},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:T?Math.min(k,1-A):1-A,denoising_end:T?k:1},[mn]:{type:"noise",id:we,use_cpu:F,is_intermediate:!0},[Di]:{type:"add",id:Di,b:1,is_intermediate:!0},[vt]:{type:"denoise_latents",id:vt,is_intermediate:!0,steps:y,cfg_scale:a,scheduler:l,denoising_start:1-g,denoising_end:1},[qe]:{type:"l2i",id:qe,is_intermediate:!0,fp32:R},[me]:{type:"color_correct",id:me,is_intermediate:!B},[Kn]:{type:"range_of_size",id:Kn,is_intermediate:!0,size:c,step:1},[on]:{type:"iterate",id:on,is_intermediate:!0}},edges:[{source:{node_id:Ii,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:Ii,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Ii,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:Ii,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Ii,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:zt,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:yf,field:"image"},destination:{node_id:yi,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:O?Fn:yi,field:"image"},destination:{node_id:$n,field:"mask"}},{source:{node_id:$n,field:"denoise_mask"},destination:{node_id:Re,field:"denoise_mask"}},{source:{node_id:Kn,field:"collection"},destination:{node_id:on,field:"collection"}},{source:{node_id:on,field:"item"},destination:{node_id:we,field:"seed"}},{source:{node_id:on,field:"item"},destination:{node_id:Di,field:"a"}},{source:{node_id:Di,field:"value"},destination:{node_id:mn,field:"seed"}},{source:{node_id:I,field:"unet"},destination:{node_id:vt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:vt,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:vt,field:"negative_conditioning"}},{source:{node_id:mn,field:"noise"},destination:{node_id:vt,field:"noise"}},{source:{node_id:Re,field:"latents"},destination:{node_id:vt,field:"latents"}},{source:{node_id:zt,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:vt,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(w==="patchmatch"&&(H.nodes[zt]={type:"infill_patchmatch",id:zt,is_intermediate:!0,downscale:S}),w==="lama"&&(H.nodes[zt]={type:"infill_lama",id:zt,is_intermediate:!0}),w==="cv2"&&(H.nodes[zt]={type:"infill_cv2",id:zt,is_intermediate:!0}),w==="tile"&&(H.nodes[zt]={type:"infill_tile",id:zt,is_intermediate:!0,tile_size:v}),O){const Y=P.width,Q=P.height;H.nodes[_i]={type:"img_resize",id:_i,is_intermediate:!0,width:Y,height:Q,image:t},H.nodes[Fn]={type:"img_resize",id:Fn,is_intermediate:!0,width:Y,height:Q},H.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:N,height:E},H.nodes[Gl]={type:"img_resize",id:Gl,is_intermediate:!0,width:N,height:E},H.nodes[Li]={type:"img_resize",id:Li,is_intermediate:!0,width:N,height:E},H.nodes[we].width=Y,H.nodes[we].height=Q,H.nodes[mn].width=Y,H.nodes[mn].height=Q,H.edges.push({source:{node_id:_i,field:"image"},destination:{node_id:zt,field:"image"}},{source:{node_id:yi,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:qe,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Fn,field:"image"},destination:{node_id:Li,field:"image"}},{source:{node_id:zt,field:"image"},destination:{node_id:Gl,field:"image"}},{source:{node_id:Gl,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Li,field:"image"},destination:{node_id:me,field:"mask"}})}else H.nodes[zt]={...H.nodes[zt],image:t},H.nodes[we].width=N,H.nodes[we].height=E,H.nodes[mn].width=N,H.nodes[mn].height=E,H.nodes[zn]={...H.nodes[zn],image:t},H.edges.push({source:{node_id:zt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:yi,field:"image"},destination:{node_id:me,field:"mask"}});if(_!=="unmasked"&&(H.nodes[Dt]={type:"create_denoise_mask",id:Dt,is_intermediate:!0,fp32:R},H.edges.push({source:{node_id:zt,field:"image"},destination:{node_id:Dt,field:"image"}}),_==="mask"&&(O?H.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:Dt,field:"mask"}}):H.edges.push({source:{node_id:yi,field:"image"},destination:{node_id:Dt,field:"mask"}})),_==="edge"&&(H.nodes[ur]={type:"mask_edge",id:ur,is_intermediate:!0,edge_blur:b,edge_size:b*2,low_threshold:100,high_threshold:200},O?H.edges.push({source:{node_id:Fn,field:"image"},destination:{node_id:ur,field:"image"}}):H.edges.push({source:{node_id:yi,field:"image"},destination:{node_id:ur,field:"image"}}),H.edges.push({source:{node_id:ur,field:"image"},destination:{node_id:Dt,field:"mask"}})),H.edges.push({source:{node_id:Dt,field:"denoise_mask"},destination:{node_id:vt,field:"denoise_mask"}})),f){const Y={id:Lr,type:"rand_int"};H.nodes[Lr]=Y,H.edges.push({source:{node_id:Lr,field:"value"},destination:{node_id:Kn,field:"start"}})}else H.nodes[Kn].start=d;return(x||C)&&(us(e,H,I),I=Fr),T&&(yh(e,H,vt,I,t),(x||C)&&(I=Es)),cs(e,H,I),mh(e,H,Re,I),as(e,H,Re),e.system.shouldUseNSFWChecker&&ls(e,H,me),e.system.shouldUseWatermarker&&ds(e,H,me),H},_we=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,vaePrecision:l,clipSkip:u,shouldUseCpuNoise:c,shouldUseNoiseSettings:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:b,boundingBoxScaleMethod:_,shouldAutoSave:y}=e.canvas,g=l==="fp32",v=["auto","manual"].includes(_),{shouldUseSDXLRefiner:S,refinerStart:w,shouldConcatSDXLStylePrompt:x}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const C=d?c:Fs.shouldUseCpuNoise,A=i.model_type==="onnx";let T=A?RS:Ii;const k=A?"onnx_model_loader":"sdxl_model_loader",L=A?{type:"t2l_onnx",id:Re,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Re,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:S?w:1},{craftedPositiveStylePrompt:N,craftedNegativeStylePrompt:E}=rd(e,x),P={id:MS,nodes:{[T]:{type:k,id:T,is_intermediate:!0,model:i},[Be]:{type:A?"prompt_onnx":"sdxl_compel_prompt",id:Be,is_intermediate:!0,prompt:n,style:N},[Ve]:{type:A?"prompt_onnx":"sdxl_compel_prompt",id:Ve,is_intermediate:!0,prompt:r,style:E},[we]:{type:"noise",id:we,is_intermediate:!0,width:v?b.width:p,height:v?b.height:m,use_cpu:C},[L.id]:L},edges:[{source:{node_id:T,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:T,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:T,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:T,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}}]};return v?(P.nodes[qe]={id:qe,type:A?"l2i_onnx":"l2i",is_intermediate:!0,fp32:g},P.nodes[me]={id:me,type:"img_resize",is_intermediate:!y,width:p,height:m},P.edges.push({source:{node_id:Re,field:"latents"},destination:{node_id:qe,field:"latents"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}})):(P.nodes[me]={type:A?"l2i_onnx":"l2i",id:me,is_intermediate:!y,fp32:g},P.edges.push({source:{node_id:Re,field:"latents"},destination:{node_id:me,field:"latents"}})),P.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:v?b.width:p,height:v?b.height:m,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:C?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:u},P.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(us(e,P,T),T=Fr),S&&(yh(e,P,Re,T),(f||h)&&(T=Es)),mh(e,P,Re,T),cs(e,P,T),$u(e,P),as(e,P,Re),e.system.shouldUseNSFWChecker&&ls(e,P,me),e.system.shouldUseWatermarker&&ds(e,P,me),P},bwe=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,vaePrecision:l,clipSkip:u,shouldUseCpuNoise:c,shouldUseNoiseSettings:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:b,boundingBoxScaleMethod:_,shouldAutoSave:y}=e.canvas,g=l==="fp32",v=["auto","manual"].includes(_);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d?c:Fs.shouldUseCpuNoise,w=i.model_type==="onnx";let x=w?RS:Lu;const C=w?"onnx_model_loader":"main_model_loader",A=w?{type:"t2l_onnx",id:Fe,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Fe,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:1},T={id:Uz,nodes:{[x]:{type:C,id:x,is_intermediate:!0,model:i},[Vt]:{type:"clip_skip",id:Vt,is_intermediate:!0,skipped_layers:u},[Be]:{type:w?"prompt_onnx":"compel",id:Be,is_intermediate:!0,prompt:n},[Ve]:{type:w?"prompt_onnx":"compel",id:Ve,is_intermediate:!0,prompt:r},[we]:{type:"noise",id:we,is_intermediate:!0,width:v?b.width:p,height:v?b.height:m,use_cpu:S},[A.id]:A},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}}]};return v?(T.nodes[qe]={id:qe,type:w?"l2i_onnx":"l2i",is_intermediate:!0,fp32:g},T.nodes[me]={id:me,type:"img_resize",is_intermediate:!y,width:p,height:m},T.edges.push({source:{node_id:Fe,field:"latents"},destination:{node_id:qe,field:"latents"}},{source:{node_id:qe,field:"image"},destination:{node_id:me,field:"image"}})):(T.nodes[me]={type:w?"l2i_onnx":"l2i",id:me,is_intermediate:!y,fp32:g},T.edges.push({source:{node_id:Fe,field:"latents"},destination:{node_id:me,field:"latents"}})),T.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:v?b.width:p,height:v?b.height:m,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:S?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:u},T.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(us(e,T,x),x=Fr),cs(e,T,x),gh(e,T,Fe,x),$u(e,T),as(e,T,Fe),e.system.shouldUseNSFWChecker&&ls(e,T,me),e.system.shouldUseWatermarker&&ds(e,T,me),T},Swe=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=_we(e):i=bwe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=mwe(e,n):i=hwe(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=ywe(e,n,r):i=pwe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=vwe(e,n,r):i=gwe(e,n,r)}return i},wwe=()=>{xe({predicate:e=>$m.match(e)&&e.payload==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=pe("session"),o=t(),{layerState:s,boundingBoxCoordinates:a,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await MT(s,a,l,u,c);if(!d){i.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,b=dwe(h,m);if(o.system.enableImageDebugging){const x=await TR(f),C=await TR(p);lwe([{base64:C,caption:"mask b64"},{base64:x,caption:"image b64"}])}i.debug(`Generation mode: ${b}`);let _,y;["img2img","inpaint","outpaint"].includes(b)&&(_=await n(he.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(b)&&(y=await n(he.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const g=Swe(o,b,_,y);i.debug({graph:gn(g)},"Canvas graph built"),n(KB(g));const{requestId:v}=n(wi({graph:g})),[S]=await r(x=>wi.fulfilled.match(x)&&x.meta.requestId===v),w=S.payload.id;["img2img","inpaint"].includes(b)&&_&&n(he.endpoints.changeImageSessionId.initiate({imageDTO:_,session_id:w})),["inpaint"].includes(b)&&y&&n(he.endpoints.changeImageSessionId.initiate({imageDTO:y,session_id:w})),o.canvas.layerState.stagingArea.boundingBox||n(Xne({sessionId:w,boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(Qne(w)),n(nd())}})},xwe=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,initialImage:l,img2imgStrength:u,shouldFitToWidthHeight:c,width:d,height:f,clipSkip:h,shouldUseCpuNoise:p,shouldUseNoiseSettings:m,vaePrecision:b,seamlessXAxis:_,seamlessYAxis:y}=e.generation;if(!l)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const g=b==="fp32";let v=Lu;const S=m?p:Fs.shouldUseCpuNoise,w={id:c3,nodes:{[v]:{type:"main_model_loader",id:v,model:i},[Vt]:{type:"clip_skip",id:Vt,skipped_layers:h},[Be]:{type:"compel",id:Be,prompt:n},[Ve]:{type:"compel",id:Ve,prompt:r},[we]:{type:"noise",id:we,use_cpu:S},[qe]:{type:"l2i",id:qe,fp32:g},[Fe]:{type:"denoise_latents",id:Fe,cfg_scale:o,scheduler:s,steps:a,denoising_start:1-u,denoising_end:1},[Ln]:{type:"i2l",id:Ln,fp32:g}},edges:[{source:{node_id:v,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:v,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}},{source:{node_id:Ln,field:"latents"},destination:{node_id:Fe,field:"latents"}},{source:{node_id:Fe,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(c&&(l.width!==d||l.height!==f)){const x={id:ta,type:"img_resize",image:{image_name:l.imageName},is_intermediate:!0,width:d,height:f};w.nodes[ta]=x,w.edges.push({source:{node_id:ta,field:"image"},destination:{node_id:Ln,field:"image"}}),w.edges.push({source:{node_id:ta,field:"width"},destination:{node_id:we,field:"width"}}),w.edges.push({source:{node_id:ta,field:"height"},destination:{node_id:we,field:"height"}})}else w.nodes[Ln].image={image_name:l.imageName},w.edges.push({source:{node_id:Ln,field:"width"},destination:{node_id:we,field:"width"}}),w.edges.push({source:{node_id:Ln,field:"height"},destination:{node_id:we,field:"height"}});return w.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:f,width:d,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:S?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:h,strength:u,init_image:l.imageName},w.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:qe,field:"metadata"}}),(_||y)&&(us(e,w,v),v=Fr),cs(e,w,v),gh(e,w,Fe,v),$u(e,w),as(e,w,Fe),e.system.shouldUseNSFWChecker&&ls(e,w),e.system.shouldUseWatermarker&&ds(e,w),w},Cwe=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,initialImage:l,shouldFitToWidthHeight:u,width:c,height:d,clipSkip:f,shouldUseCpuNoise:h,shouldUseNoiseSettings:p,vaePrecision:m,seamlessXAxis:b,seamlessYAxis:_}=e.generation,{positiveStylePrompt:y,negativeStylePrompt:g,shouldConcatSDXLStylePrompt:v,shouldUseSDXLRefiner:S,refinerStart:w,sdxlImg2ImgDenoisingStrength:x}=e.sdxl;if(!l)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const C=m==="fp32";let A=Ii;const T=p?h:Fs.shouldUseCpuNoise,{craftedPositiveStylePrompt:k,craftedNegativeStylePrompt:L}=rd(e,v),N={id:P1,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:i},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:k},[Ve]:{type:"sdxl_compel_prompt",id:Ve,prompt:r,style:L},[we]:{type:"noise",id:we,use_cpu:T},[qe]:{type:"l2i",id:qe,fp32:C},[Re]:{type:"denoise_latents",id:Re,cfg_scale:o,scheduler:s,steps:a,denoising_start:S?Math.min(w,1-x):1-x,denoising_end:S?w:1},[Ln]:{type:"i2l",id:Ln,fp32:C}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Ln,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Re,field:"latents"},destination:{node_id:qe,field:"latents"}}]};if(u&&(l.width!==c||l.height!==d)){const E={id:ta,type:"img_resize",image:{image_name:l.imageName},is_intermediate:!0,width:c,height:d};N.nodes[ta]=E,N.edges.push({source:{node_id:ta,field:"image"},destination:{node_id:Ln,field:"image"}}),N.edges.push({source:{node_id:ta,field:"width"},destination:{node_id:we,field:"width"}}),N.edges.push({source:{node_id:ta,field:"height"},destination:{node_id:we,field:"height"}})}else N.nodes[Ln].image={image_name:l.imageName},N.edges.push({source:{node_id:Ln,field:"width"},destination:{node_id:we,field:"width"}}),N.edges.push({source:{node_id:Ln,field:"height"},destination:{node_id:we,field:"height"}});return N.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:d,width:c,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:T?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:f,strength:x,init_image:l.imageName,positive_style_prompt:y,negative_style_prompt:g},N.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:qe,field:"metadata"}}),(b||_)&&(us(e,N,A),A=Fr),S&&(yh(e,N,Re),(b||_)&&(A=Es)),cs(e,N,A),mh(e,N,Re,A),as(e,N,Re),$u(e,N),e.system.shouldUseNSFWChecker&&ls(e,N),e.system.shouldUseWatermarker&&ds(e,N),N},Ewe=()=>{xe({predicate:e=>$m.match(e)&&e.payload==="img2img",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=pe("session"),o=t(),s=o.generation.model;let a;s&&s.base_model==="sdxl"?a=Cwe(o):a=xwe(o),n(WB(a)),i.debug({graph:gn(a)},"Image to Image graph built"),n(wi({graph:a})),await r(wi.fulfilled.match),n(nd())}})},Twe=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function Awe(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+'["'+kwe(n)+'"]';if(!Twe.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function kwe(e){return e.replace(/"/g,'\\"')}function Pwe(e){return e.length!==0}const Rwe=99,jz="; ",Vz=", or ",FT="Validation error",Gz=": ";class Hz extends Error{constructor(n,r=[]){super(n);ZS(this,"details");ZS(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function BT(e,t,n){if(e.code==="invalid_union")return e.unionErrors.reduce((r,i)=>{const o=i.issues.map(s=>BT(s,t,n)).join(t);return r.includes(o)||r.push(o),r},[]).join(n);if(Pwe(e.path)){if(e.path.length===1){const r=e.path[0];if(typeof r=="number")return`${e.message} at index ${r}`}return`${e.message} at "${Awe(e.path)}"`}return e.message}function qz(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:FT}function _Me(e,t={}){const{issueSeparator:n=jz,unionSeparator:r=Vz,prefixSeparator:i=Gz,prefix:o=FT}=t,s=BT(e,n,r),a=qz(s,o,i);return new Hz(a,[e])}function AR(e,t={}){const{maxIssuesInMessage:n=Rwe,issueSeparator:r=jz,unionSeparator:i=Vz,prefixSeparator:o=Gz,prefix:s=FT}=t,a=e.errors.slice(0,n).map(u=>BT(u,r,i)).join(r),l=qz(a,s,o);return new Hz(l,e.errors)}const Owe=e=>{const{workflow:t,nodes:n,edges:r}=e,i={...t,nodes:[],edges:[]};return n.filter(o=>["invocation","notes"].includes(o.type??"__UNKNOWN_NODE_TYPE__")).forEach(o=>{const s=ID.safeParse(o);if(!s.success){const{message:a}=AR(s.error,{prefix:"Unable to parse node"});pe("nodes").warn({node:gn(o)},a);return}i.nodes.push(s.data)}),r.forEach(o=>{const s=MD.safeParse(o);if(!s.success){const{message:a}=AR(s.error,{prefix:"Unable to parse edge"});pe("nodes").warn({edge:gn(o)},a);return}i.edges.push(s.data)}),i},Iwe=e=>{if(e.type==="ColorField"&&e.value){const t=Zn(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},Mwe=e=>{const{nodes:t,edges:n}=e,r=t.filter(Wr),i=JSON.stringify(Owe(e)),o=r.reduce((u,c)=>{const{id:d,data:f}=c,{type:h,inputs:p,isIntermediate:m,embedWorkflow:b}=f,_=dC(p,(g,v,S)=>{const w=Iwe(v);return g[S]=w,g},{}),y={type:h,id:d,..._,is_intermediate:m};return b&&Object.assign(y,{workflow:i}),Object.assign(u,{[d]:y}),u},{}),a=n.filter(u=>u.type!=="collapsed").reduce((u,c)=>{const{source:d,target:f,sourceHandle:h,targetHandle:p}=c;return u.push({source:{node_id:d,field:h},destination:{node_id:f,field:p}}),u},[]);return a.forEach(u=>{const c=o[u.destination.node_id],d=u.destination.field;o[u.destination.node_id]=R_(c,d)}),{id:CB(),nodes:o,edges:a}},Nwe=()=>{xe({predicate:e=>$m.match(e)&&e.payload==="nodes",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=pe("session"),o=t(),s=Mwe(o.nodes);n(XB(s)),i.debug({graph:gn(s)},"Nodes graph built"),n(wi({graph:s})),await r(wi.fulfilled.match),n(nd())}})},Dwe=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,shouldUseNoiseSettings:f,vaePrecision:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:_,shouldUseSDXLRefiner:y,shouldConcatSDXLStylePrompt:g,refinerStart:v}=e.sdxl,S=f?d:Fs.shouldUseCpuNoise;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=h==="fp32",{craftedPositiveStylePrompt:x,craftedNegativeStylePrompt:C}=rd(e,g);let A=Ii;const T={id:LT,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:i},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:x},[Ve]:{type:"sdxl_compel_prompt",id:Ve,prompt:r,style:C},[we]:{type:"noise",id:we,width:l,height:u,use_cpu:S},[Re]:{type:"denoise_latents",id:Re,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:y?v:1},[qe]:{type:"l2i",id:qe,fp32:w}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:Ve,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Re,field:"latents"},destination:{node_id:qe,field:"latents"}}]};return T.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:u,width:l,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:S?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:c,positive_style_prompt:b,negative_style_prompt:_},T.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:qe,field:"metadata"}}),(p||m)&&(us(e,T,A),A=Fr),y&&(yh(e,T,Re),(p||m)&&(A=Es)),cs(e,T,A),mh(e,T,Re,A),as(e,T,Re),$u(e,T),e.system.shouldUseNSFWChecker&&ls(e,T),e.system.shouldUseWatermarker&&ds(e,T),T},Lwe=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,shouldUseNoiseSettings:f,vaePrecision:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,b=f?d:Fs.shouldUseCpuNoise;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const _=h==="fp32",y=i.model_type==="onnx";let g=y?RS:Lu;const v=y?"onnx_model_loader":"main_model_loader",S=y?{type:"t2l_onnx",id:Fe,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Fe,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:1},w={id:zz,nodes:{[g]:{type:v,id:g,is_intermediate:!0,model:i},[Vt]:{type:"clip_skip",id:Vt,skipped_layers:c,is_intermediate:!0},[Be]:{type:y?"prompt_onnx":"compel",id:Be,prompt:n,is_intermediate:!0},[Ve]:{type:y?"prompt_onnx":"compel",id:Ve,prompt:r,is_intermediate:!0},[we]:{type:"noise",id:we,width:l,height:u,use_cpu:b,is_intermediate:!0},[S.id]:S,[qe]:{type:y?"l2i_onnx":"l2i",id:qe,fp32:_}},edges:[{source:{node_id:g,field:"unet"},destination:{node_id:Fe,field:"unet"}},{source:{node_id:g,field:"clip"},destination:{node_id:Vt,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vt,field:"clip"},destination:{node_id:Ve,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Fe,field:"positive_conditioning"}},{source:{node_id:Ve,field:"conditioning"},destination:{node_id:Fe,field:"negative_conditioning"}},{source:{node_id:we,field:"noise"},destination:{node_id:Fe,field:"noise"}},{source:{node_id:Fe,field:"latents"},destination:{node_id:qe,field:"latents"}}]};return w.nodes[kt]={id:kt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:b?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:c},w.edges.push({source:{node_id:kt,field:"metadata"},destination:{node_id:qe,field:"metadata"}}),(p||m)&&(us(e,w,g),g=Fr),cs(e,w,g),gh(e,w,Fe,g),$u(e,w),as(e,w,Fe),e.system.shouldUseNSFWChecker&&ls(e,w),e.system.shouldUseWatermarker&&ds(e,w),w},$we=()=>{xe({predicate:e=>$m.match(e)&&e.payload==="txt2img",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=pe("session"),o=t(),s=o.generation.model;let a;s&&s.base_model==="sdxl"?a=Dwe(o):a=Lwe(o),n(qB(a)),i.debug({graph:gn(a)},"Text to Image graph built"),n(wi({graph:a})),await r(wi.fulfilled.match),n(nd())}})},Fwe=ku(null),Bwe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,kR=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Bwe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},PR=e=>e==="*"||e==="x"||e==="X",RR=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},zwe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Uwe=(e,t)=>{if(PR(e)||PR(t))return 0;const[n,r]=zwe(RR(e),RR(t));return n>r?1:n<r?-1:0},OR=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=Uwe(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},jwe=(e,t)=>{const n=kR(e),r=kR(t),i=n.pop(),o=r.pop(),s=OR(n,r);return s!==0?s:i&&o?OR(i.split("."),o.split(".")):i||o?i?-1:1:0},Vwe=(e,t)=>{const n=Zn(e),{nodes:r,edges:i}=n,o=[],s=r.filter(mC),a=mE(s,"id");return r.forEach(l=>{if(!mC(l))return;const u=t[l.data.type];if(!u){o.push({message:`Node "${l.data.type}" skipped`,issues:[`Node type "${l.data.type}" does not exist`],data:l});return}if(u.version&&l.data.version&&jwe(u.version,l.data.version)!==0){o.push({message:`Node "${l.data.type}" has mismatched version`,issues:[`Node "${l.data.type}" v${l.data.version} may be incompatible with installed v${u.version}`],data:{node:l,nodeTemplate:gn(u)}});return}}),i.forEach((l,u)=>{const c=a[l.source],d=a[l.target],f=[];if(c?l.type==="default"&&!(l.sourceHandle in c.data.outputs)&&f.push(`Output field "${l.source}.${l.sourceHandle}" does not exist`):f.push(`Output node ${l.source} does not exist`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`Input field "${l.target}.${l.targetHandle}" does not exist`):f.push(`Input node ${l.target} does not exist`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`Source node "${l.source}" missing template "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`Source node "${l.target}" missing template "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},Gwe=()=>{xe({actionCreator:E0e,effect:(e,{dispatch:t,getState:n})=>{const r=pe("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:s,errors:a}=Vwe(i,o);t(wye(s)),a.length?(t(Bn(ia({title:"Workflow Loaded with Warnings",status:"warning"}))),a.forEach(({message:l,...u})=>{r.warn(u,l)})):t(Bn(ia({title:"Workflow Loaded",status:"success"}))),t(UB("nodes")),requestAnimationFrame(()=>{var l;(l=Fwe.get())==null||l.fitView()})}})},Wz=IN(),xe=Wz.startListening;ySe();vSe();xSe();lSe();uSe();cSe();dSe();fSe();D0e();mSe();_Se();bSe();wwe();Nwe();$we();Ewe();j2e();nSe();Zbe();Y0e();Jbe();Q0e();K0e();tSe();nwe();P0e();H2e();q2e();K2e();X2e();Y2e();V2e();G2e();ewe();twe();Z2e();J2e();Q2e();L2e();$2e();F2e();B2e();z2e();U2e();M2e();N2e();D2e();oSe();iSe();sSe();aSe();pSe();gSe();L0e();A2e();Gwe();hSe();CSe();M0e();TSe();O0e();R0e();awe();iwe();const Hwe={canvas:Yne,gallery:Dde,generation:Ane,nodes:Cye,postprocessing:Eye,system:Mye,config:lte,ui:Fye,hotkeys:$ye,controlNet:Pde,dynamicPrompts:Nde,deleteImageModal:Ide,changeBoardModal:Jne,lora:Fde,modelmanager:Lye,sdxl:kye,[yu.reducerPath]:yu.reducer},qwe=th(Hwe),Wwe=u0e(qwe),Kwe=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlNet","dynamicPrompts","lora","modelmanager"],Xwe=fN({reducer:Wwe,enhancers:e=>e.concat(c0e(window.localStorage,Kwe,{persistDebounce:300,serialize:S0e,unserialize:x0e,prefix:d0e})).concat(NN()),middleware:e=>e({immutableCheck:!1}).concat(yu.middleware).concat(jye).prepend(Wz.middleware),devTools:{actionSanitizer:T0e,stateSanitizer:k0e,trace:!0,predicate:(e,t)=>!A0e.includes(t.type)}}),Qwe=e=>e,Ywe=e=>{const{socket:t,storeApi:n}=e,{dispatch:r,getState:i}=n;t.on("connect",()=>{pe("socketio").debug("Connected"),r(k$());const{sessionId:s}=i().system;s&&(t.emit("subscribe",{session:s}),r(jE({sessionId:s})))}),t.on("connect_error",o=>{o&&o.message&&o.data==="ERR_UNAUTHENTICATED"&&r(Bn(ia({title:o.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(R$())}),t.on("invocation_started",o=>{r(D$({data:o}))}),t.on("generator_progress",o=>{r(B$({data:o}))}),t.on("invocation_error",o=>{r(L$({data:o}))}),t.on("invocation_complete",o=>{r(GE({data:o}))}),t.on("graph_execution_state_complete",o=>{r($$({data:o}))}),t.on("model_load_started",o=>{r(z$({data:o}))}),t.on("model_load_completed",o=>{r(U$({data:o}))}),t.on("session_retrieval_error",o=>{r(j$({data:o}))}),t.on("invocation_retrieval_error",o=>{r(G$({data:o}))})},va=Object.create(null);va.open="0";va.close="1";va.ping="2";va.pong="3";va.message="4";va.upgrade="5";va.noop="6";const U0=Object.create(null);Object.keys(va).forEach(e=>{U0[va[e]]=e});const f3={type:"error",data:"parser error"},Kz=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Xz=typeof ArrayBuffer=="function",Qz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,zT=({type:e,data:t},n,r)=>Kz&&t instanceof Blob?n?r(t):IR(t,r):Xz&&(t instanceof ArrayBuffer||Qz(t))?n?r(t):IR(new Blob([t]),r):r(va[e]+(t||"")),IR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function MR(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Mw;function Zwe(e,t){if(Kz&&e.data instanceof Blob)return e.data.arrayBuffer().then(MR).then(t);if(Xz&&(e.data instanceof ArrayBuffer||Qz(e.data)))return t(MR(e.data));zT(e,!1,n=>{Mw||(Mw=new TextEncoder),t(Mw.encode(n))})}const NR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",op=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<NR.length;e++)op[NR.charCodeAt(e)]=e;const Jwe=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=op[e.charCodeAt(r)],s=op[e.charCodeAt(r+1)],a=op[e.charCodeAt(r+2)],l=op[e.charCodeAt(r+3)],c[i++]=o<<2|s>>4,c[i++]=(s&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},exe=typeof ArrayBuffer=="function",UT=(e,t)=>{if(typeof e!="string")return{type:"message",data:Yz(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:txe(e.substring(1),t)}:U0[n]?e.length>1?{type:U0[n],data:e.substring(1)}:{type:U0[n]}:f3},txe=(e,t)=>{if(exe){const n=Jwe(e);return Yz(n,t)}else return{base64:!0,data:e}},Yz=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Zz=String.fromCharCode(30),nxe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{zT(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Zz))})})},rxe=(e,t)=>{const n=e.split(Zz),r=[];for(let i=0;i<n.length;i++){const o=UT(n[i],t);if(r.push(o),o.type==="error")break}return r};function ixe(){return new TransformStream({transform(e,t){Zwe(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 Nw;function n0(e){return e.reduce((t,n)=>t+n.length,0)}function r0(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 oxe(e,t){Nw||(Nw=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=r0(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=r0(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=r0(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){a.enqueue(f3);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(n0(n)<i)break;const l=r0(n,i);a.enqueue(UT(o?l:Nw.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(f3);break}}}})}const Jz=4;function Pr(e){if(e)return sxe(e)}function sxe(e){for(var t in Pr.prototype)e[t]=Pr.prototype[t];return e}Pr.prototype.on=Pr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Pr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Pr.prototype.off=Pr.prototype.removeListener=Pr.prototype.removeAllListeners=Pr.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};Pr.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};Pr.prototype.emitReserved=Pr.prototype.emit;Pr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Pr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ko=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function eU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const axe=Ko.setTimeout,lxe=Ko.clearTimeout;function NS(e,t){t.useNativeTimers?(e.setTimeoutFn=axe.bind(Ko),e.clearTimeoutFn=lxe.bind(Ko)):(e.setTimeoutFn=Ko.setTimeout.bind(Ko),e.clearTimeoutFn=Ko.clearTimeout.bind(Ko))}const uxe=1.33;function cxe(e){return typeof e=="string"?dxe(e):Math.ceil((e.byteLength||e.size)*uxe)}function dxe(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 fxe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function hxe(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 pxe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class jT extends Pr{constructor(t){super(),this.writable=!1,NS(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new pxe(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=UT(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=fxe(t);return n.length?"?"+n:""}}const tU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),h3=64,gxe={};let DR=0,i0=0,LR;function $R(e){let t="";do t=tU[e%h3]+t,e=Math.floor(e/h3);while(e>0);return t}function nU(){const e=$R(+new Date);return e!==LR?(DR=0,LR=e):e+"."+$R(DR++)}for(;i0<h3;i0++)gxe[tU[i0]]=i0;let rU=!1;try{rU=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const mxe=rU;function iU(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||mxe))return new XMLHttpRequest}catch{}if(!t)try{return new Ko[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function yxe(){}const vxe=function(){return new iU({xdomain:!1}).responseType!=null}();class _xe extends jT{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=vxe&&!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)};rxe(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,nxe(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]=nU()),!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 vf(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 vf=class j0 extends Pr{constructor(t,n){super(),NS(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=eU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new iU(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=j0.requestsCount++,j0.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=yxe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete j0.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()}};vf.requestsCount=0;vf.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",FR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ko?"pagehide":"unload";addEventListener(e,FR,!1)}}function FR(){for(let e in vf.requests)vf.requests.hasOwnProperty(e)&&vf.requests[e].abort()}const VT=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),o0=Ko.WebSocket||Ko.MozWebSocket,BR=!0,bxe="arraybuffer",zR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Sxe extends jT{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=zR?{}:eU(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=BR&&!zR?n?new o0(t,n):new o0(t):new o0(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;zT(r,this.supportsBinary,o=>{const s={};try{BR&&this.ws.send(o)}catch{}i&&VT(()=>{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]=nU()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!o0}}class wxe extends jT{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=oxe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=ixe();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&&VT(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const xxe={websocket:Sxe,webtransport:wxe,polling:_xe},Cxe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Exe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function p3(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=Cxe.exec(e||""),o={},s=14;for(;s--;)o[Exe[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=Txe(o,o.path),o.queryKey=Axe(o,o.query),o}function Txe(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 Axe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let oU=class Rd extends Pr{constructor(t,n={}){super(),this.binaryType=bxe,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=p3(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=p3(n.host).host),NS(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=hxe(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=Jz,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 xxe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Rd.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;Rd.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;Rd.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const 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 u(d){n&&d.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Rd.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+=cxe(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){Rd.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}};oU.protocol=Jz;function kxe(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=p3(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 Pxe=typeof ArrayBuffer=="function",Rxe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,sU=Object.prototype.toString,Oxe=typeof Blob=="function"||typeof Blob<"u"&&sU.call(Blob)==="[object BlobConstructor]",Ixe=typeof File=="function"||typeof File<"u"&&sU.call(File)==="[object FileConstructor]";function GT(e){return Pxe&&(e instanceof ArrayBuffer||Rxe(e))||Oxe&&e instanceof Blob||Ixe&&e instanceof File}function V0(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(V0(e[n]))return!0;return!1}if(GT(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return V0(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&V0(e[n]))return!0;return!1}function Mxe(e){const t=[],n=e.data,r=e;return r.data=g3(n,t),r.attachments=t.length,{packet:r,buffers:t}}function g3(e,t){if(!e)return e;if(GT(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]=g3(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]=g3(e[r],t));return n}return e}function Nxe(e,t){return e.data=m3(e.data,t),delete e.attachments,e}function m3(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]=m3(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=m3(e[n],t));return e}const Dxe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Lxe=5;var Mt;(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"})(Mt||(Mt={}));class $xe{constructor(t){this.replacer=t}encode(t){return(t.type===Mt.EVENT||t.type===Mt.ACK)&&V0(t)?this.encodeAsBinary({type:t.type===Mt.EVENT?Mt.BINARY_EVENT:Mt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Mt.BINARY_EVENT||t.type===Mt.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=Mxe(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function UR(e){return Object.prototype.toString.call(e)==="[object Object]"}class HT extends Pr{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===Mt.BINARY_EVENT;r||n.type===Mt.BINARY_ACK?(n.type=r?Mt.EVENT:Mt.ACK,this.reconstructor=new Fxe(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(GT(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(Mt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Mt.BINARY_EVENT||r.type===Mt.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(HT.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 Mt.CONNECT:return UR(n);case Mt.DISCONNECT:return n===void 0;case Mt.CONNECT_ERROR:return typeof n=="string"||UR(n);case Mt.EVENT:case Mt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Dxe.indexOf(n[0])===-1);case Mt.ACK:case Mt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Fxe{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=Nxe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Bxe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:HT,Encoder:$xe,get PacketType(){return Mt},protocol:Lxe},Symbol.toStringTag,{value:"Module"}));function _s(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zxe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class aU extends Pr{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=[_s(t,"open",this.onopen.bind(this)),_s(t,"packet",this.onpacket.bind(this)),_s(t,"error",this.onerror.bind(this)),_s(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(zxe.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:Mt.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:Mt.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 Mt.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 Mt.EVENT:case Mt.BINARY_EVENT:this.onevent(t);break;case Mt.ACK:case Mt.BINARY_ACK:this.onack(t);break;case Mt.DISCONNECT:this.ondisconnect();break;case Mt.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:Mt.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:Mt.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 vh(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}vh.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};vh.prototype.reset=function(){this.attempts=0};vh.prototype.setMin=function(e){this.ms=e};vh.prototype.setMax=function(e){this.max=e};vh.prototype.setJitter=function(e){this.jitter=e};class y3 extends Pr{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,NS(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 vh({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||Bxe;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 oU(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=_s(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=_s(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(_s(t,"ping",this.onping.bind(this)),_s(t,"data",this.ondata.bind(this)),_s(t,"error",this.onerror.bind(this)),_s(t,"close",this.onclose.bind(this)),_s(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){VT(()=>{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 aU(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 qh={};function G0(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=kxe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=qh[i]&&o in qh[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new y3(r,t):(qh[i]||(qh[i]=new y3(r,t)),l=qh[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(G0,{Manager:y3,Socket:aU,io:G0,connect:G0});const jR=()=>{let e=!1,n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;const r={timeout:6e4,path:"/ws/socket.io",autoConnect:!1};if(["nodes","package"].includes("production")){const s=vg.get();s&&(n=s.replace(/^https?\:\/\//i,""));const a=Df.get();a&&(r.auth={token:a}),r.transports=["websocket","polling"]}const i=G0(n,r);return s=>a=>l=>{const{dispatch:u,getState:c}=s;if(e||(Ywe({storeApi:s,socket:i}),e=!0,i.connect()),wi.fulfilled.match(l)){const d=l.payload.id,f=c().system.sessionId;f&&(i.emit("unsubscribe",{session:f}),u(M$({sessionId:f}))),i.emit("subscribe",{session:d}),u(jE({sessionId:d}))}a(l)}};function Uxe(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 jxe(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 Vxe=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(jxe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Uxe(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}(),Pi="-ms-",R1="-moz-",Zt="-webkit-",lU="comm",qT="rule",WT="decl",Gxe="@import",uU="@keyframes",Hxe="@layer",qxe=Math.abs,DS=String.fromCharCode,Wxe=Object.assign;function Kxe(e,t){return vi(e,0)^45?(((t<<2^vi(e,0))<<2^vi(e,1))<<2^vi(e,2))<<2^vi(e,3):0}function cU(e){return e.trim()}function Xxe(e,t){return(e=t.exec(e))?e[0]:e}function Jt(e,t,n){return e.replace(t,n)}function v3(e,t){return e.indexOf(t)}function vi(e,t){return e.charCodeAt(t)|0}function Hg(e,t,n){return e.slice(t,n)}function Qs(e){return e.length}function KT(e){return e.length}function s0(e,t){return t.push(e),e}function Qxe(e,t){return e.map(t).join("")}var LS=1,Xf=1,dU=0,yo=0,Ar=0,_h="";function $S(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:LS,column:Xf,length:s,return:""}}function Wh(e,t){return Wxe($S("",null,null,"",null,null,0),e,{length:-e.length},t)}function Yxe(){return Ar}function Zxe(){return Ar=yo>0?vi(_h,--yo):0,Xf--,Ar===10&&(Xf=1,LS--),Ar}function Oo(){return Ar=yo<dU?vi(_h,yo++):0,Xf++,Ar===10&&(Xf=1,LS++),Ar}function ha(){return vi(_h,yo)}function H0(){return yo}function Vm(e,t){return Hg(_h,e,t)}function qg(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 fU(e){return LS=Xf=1,dU=Qs(_h=e),yo=0,[]}function hU(e){return _h="",e}function q0(e){return cU(Vm(yo-1,_3(e===91?e+2:e===40?e+1:e)))}function Jxe(e){for(;(Ar=ha())&&Ar<33;)Oo();return qg(e)>2||qg(Ar)>3?"":" "}function eCe(e,t){for(;--t&&Oo()&&!(Ar<48||Ar>102||Ar>57&&Ar<65||Ar>70&&Ar<97););return Vm(e,H0()+(t<6&&ha()==32&&Oo()==32))}function _3(e){for(;Oo();)switch(Ar){case e:return yo;case 34:case 39:e!==34&&e!==39&&_3(Ar);break;case 40:e===41&&_3(e);break;case 92:Oo();break}return yo}function tCe(e,t){for(;Oo()&&e+Ar!==47+10;)if(e+Ar===42+42&&ha()===47)break;return"/*"+Vm(t,yo-1)+"*"+DS(e===47?e:Oo())}function nCe(e){for(;!qg(ha());)Oo();return Vm(e,yo)}function rCe(e){return hU(W0("",null,null,null,[""],e=fU(e),0,[0],e))}function W0(e,t,n,r,i,o,s,a,l){for(var u=0,c=0,d=s,f=0,h=0,p=0,m=1,b=1,_=1,y=0,g="",v=i,S=o,w=r,x=g;b;)switch(p=y,y=Oo()){case 40:if(p!=108&&vi(x,d-1)==58){v3(x+=Jt(q0(y),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:x+=q0(y);break;case 9:case 10:case 13:case 32:x+=Jxe(p);break;case 92:x+=eCe(H0()-1,7);continue;case 47:switch(ha()){case 42:case 47:s0(iCe(tCe(Oo(),H0()),t,n),l);break;default:x+="/"}break;case 123*m:a[u++]=Qs(x)*_;case 125*m:case 59:case 0:switch(y){case 0:case 125:b=0;case 59+c:_==-1&&(x=Jt(x,/\f/g,"")),h>0&&Qs(x)-d&&s0(h>32?GR(x+";",r,n,d-1):GR(Jt(x," ","")+";",r,n,d-2),l);break;case 59:x+=";";default:if(s0(w=VR(x,t,n,u,c,i,a,g,v=[],S=[],d),o),y===123)if(c===0)W0(x,t,w,w,v,o,d,a,S);else switch(f===99&&vi(x,3)===110?100:f){case 100:case 108:case 109:case 115:W0(e,w,w,r&&s0(VR(e,w,w,0,0,i,a,g,i,v=[],d),S),i,S,d,a,r?v:S);break;default:W0(x,w,w,w,[""],S,0,a,S)}}u=c=h=0,m=_=1,g=x="",d=s;break;case 58:d=1+Qs(x),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&Zxe()==125)continue}switch(x+=DS(y),y*m){case 38:_=c>0?1:(x+="\f",-1);break;case 44:a[u++]=(Qs(x)-1)*_,_=1;break;case 64:ha()===45&&(x+=q0(Oo())),f=ha(),c=d=Qs(g=x+=nCe(H0())),y++;break;case 45:p===45&&Qs(x)==2&&(m=0)}}return o}function VR(e,t,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],h=KT(f),p=0,m=0,b=0;p<r;++p)for(var _=0,y=Hg(e,d+1,d=qxe(m=s[p])),g=e;_<h;++_)(g=cU(m>0?f[_]+" "+y:Jt(y,/&\f/g,f[_])))&&(l[b++]=g);return $S(e,t,n,i===0?qT:a,l,u,c)}function iCe(e,t,n){return $S(e,t,n,lU,DS(Yxe()),Hg(e,2,-2),0)}function GR(e,t,n,r){return $S(e,t,n,WT,Hg(e,0,r),Hg(e,r+1,-1),r)}function _f(e,t){for(var n="",r=KT(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function oCe(e,t,n,r){switch(e.type){case Hxe:if(e.children.length)break;case Gxe:case WT:return e.return=e.return||e.value;case lU:return"";case uU:return e.return=e.value+"{"+_f(e.children,r)+"}";case qT:e.value=e.props.join(",")}return Qs(n=_f(e.children,r))?e.return=e.value+"{"+n+"}":""}function sCe(e){var t=KT(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 aCe(e){return function(t){t.root||(t=t.return)&&e(t)}}var HR=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 pU(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var lCe=function(t,n,r){for(var i=0,o=0;i=o,o=ha(),i===38&&o===12&&(n[r]=1),!qg(o);)Oo();return Vm(t,yo)},uCe=function(t,n){var r=-1,i=44;do switch(qg(i)){case 0:i===38&&ha()===12&&(n[r]=1),t[r]+=lCe(yo-1,n,r);break;case 2:t[r]+=q0(i);break;case 4:if(i===44){t[++r]=ha()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=DS(i)}while(i=Oo());return t},cCe=function(t,n){return hU(uCe(fU(t),n))},qR=new WeakMap,dCe=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&&!qR.get(r))&&!i){qR.set(t,!0);for(var o=[],s=cCe(n,o),a=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<a.length;c++,u++)t.props[u]=o[l]?s[l].replace(/&\f/g,a[c]):a[c]+" "+s[l]}}},fCe=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function gU(e,t){switch(Kxe(e,t)){case 5103:return Zt+"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 Zt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Zt+e+R1+e+Pi+e+e;case 6828:case 4268:return Zt+e+Pi+e+e;case 6165:return Zt+e+Pi+"flex-"+e+e;case 5187:return Zt+e+Jt(e,/(\w+).+(:[^]+)/,Zt+"box-$1$2"+Pi+"flex-$1$2")+e;case 5443:return Zt+e+Pi+"flex-item-"+Jt(e,/flex-|-self/,"")+e;case 4675:return Zt+e+Pi+"flex-line-pack"+Jt(e,/align-content|flex-|-self/,"")+e;case 5548:return Zt+e+Pi+Jt(e,"shrink","negative")+e;case 5292:return Zt+e+Pi+Jt(e,"basis","preferred-size")+e;case 6060:return Zt+"box-"+Jt(e,"-grow","")+Zt+e+Pi+Jt(e,"grow","positive")+e;case 4554:return Zt+Jt(e,/([^-])(transform)/g,"$1"+Zt+"$2")+e;case 6187:return Jt(Jt(Jt(e,/(zoom-|grab)/,Zt+"$1"),/(image-set)/,Zt+"$1"),e,"")+e;case 5495:case 3959:return Jt(e,/(image-set\([^]*)/,Zt+"$1$`$1");case 4968:return Jt(Jt(e,/(.+:)(flex-)?(.*)/,Zt+"box-pack:$3"+Pi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Zt+e+e;case 4095:case 3583:case 4068:case 2532:return Jt(e,/(.+)-inline(.+)/,Zt+"$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(Qs(e)-1-t>6)switch(vi(e,t+1)){case 109:if(vi(e,t+4)!==45)break;case 102:return Jt(e,/(.+:)(.+)-([^]+)/,"$1"+Zt+"$2-$3$1"+R1+(vi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~v3(e,"stretch")?gU(Jt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(vi(e,t+1)!==115)break;case 6444:switch(vi(e,Qs(e)-3-(~v3(e,"!important")&&10))){case 107:return Jt(e,":",":"+Zt)+e;case 101:return Jt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Zt+(vi(e,14)===45?"inline-":"")+"box$3$1"+Zt+"$2$3$1"+Pi+"$2box$3")+e}break;case 5936:switch(vi(e,t+11)){case 114:return Zt+e+Pi+Jt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Zt+e+Pi+Jt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Zt+e+Pi+Jt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Zt+e+Pi+e+e}return e}var hCe=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case WT:t.return=gU(t.value,t.length);break;case uU:return _f([Wh(t,{value:Jt(t.value,"@","@"+Zt)})],i);case qT:if(t.length)return Qxe(t.props,function(o){switch(Xxe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _f([Wh(t,{props:[Jt(o,/:(read-\w+)/,":"+R1+"$1")]})],i);case"::placeholder":return _f([Wh(t,{props:[Jt(o,/:(plac\w+)/,":"+Zt+"input-$1")]}),Wh(t,{props:[Jt(o,/:(plac\w+)/,":"+R1+"$1")]}),Wh(t,{props:[Jt(o,/:(plac\w+)/,Pi+"input-$1")]})],i)}return""})}},pCe=[hCe],gCe=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 b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||pCe,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),_=1;_<b.length;_++)o[b[_]]=!0;a.push(m)});var l,u=[dCe,fCe];{var c,d=[oCe,aCe(function(m){c.insert(m)})],f=sCe(u.concat(i,d)),h=function(b){return _f(rCe(b),f)};l=function(b,_,y,g){c=y,h(b?b+"{"+_.styles+"}":_.styles),g&&(p.inserted[_.name]=!0)}}var p={key:n,sheet:new Vxe({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},mCe=!0;function yCe(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var mU=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||mCe===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},yU=function(t,n,r){mU(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 vCe(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 _Ce={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},bCe=/[A-Z]|^ms/g,SCe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,vU=function(t){return t.charCodeAt(1)===45},WR=function(t){return t!=null&&typeof t!="boolean"},Dw=pU(function(e){return vU(e)?e:e.replace(bCe,"-$&").toLowerCase()}),KR=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(SCe,function(r,i,o){return Ys={name:i,styles:o,next:Ys},i})}return _Ce[t]!==1&&!vU(t)&&typeof n=="number"&&n!==0?n+"px":n};function Wg(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 Ys={name:n.name,styles:n.styles,next:Ys},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Ys={name:r.name,styles:r.styles,next:Ys},r=r.next;var i=n.styles+";";return i}return wCe(e,t,n)}case"function":{if(e!==void 0){var o=Ys,s=n(e);return Ys=o,Wg(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function wCe(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Wg(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]+"}":WR(s)&&(r+=Dw(o)+":"+KR(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++)WR(s[a])&&(r+=Dw(o)+":"+KR(o,s[a])+";");else{var l=Wg(e,t,s);switch(o){case"animation":case"animationName":{r+=Dw(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var XR=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ys,XT=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="";Ys=void 0;var s=t[0];s==null||s.raw===void 0?(i=!1,o+=Wg(r,n,s)):o+=s[0];for(var a=1;a<t.length;a++)o+=Wg(r,n,t[a]),i&&(o+=s[a]);XR.lastIndex=0;for(var l="",u;(u=XR.exec(o))!==null;)l+="-"+u[1];var c=vCe(o)+l;return{name:c,styles:o,next:Ys}},xCe=function(t){return t()},_U=L4["useInsertionEffect"]?L4["useInsertionEffect"]:!1,CCe=_U||xCe,QR=_U||M.useLayoutEffect,bU=M.createContext(typeof HTMLElement<"u"?gCe({key:"css"}):null);bU.Provider;var SU=function(t){return M.forwardRef(function(n,r){var i=M.useContext(bU);return t(n,i,r)})},Kg=M.createContext({}),ECe=function(t,n){if(typeof n=="function"){var r=n(t);return r}return r1({},t,n)},TCe=HR(function(e){return HR(function(t){return ECe(e,t)})}),bMe=function(t){var n=M.useContext(Kg);return t.theme!==n&&(n=TCe(n)(t.theme)),M.createElement(Kg.Provider,{value:n},t.children)},SMe=SU(function(e,t){var n=e.styles,r=XT([n],void 0,M.useContext(Kg)),i=M.useRef();return QR(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]),QR(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&yU(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 ACe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return XT(t)}var kCe=function(){var t=ACe.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_"}}},PCe=globalThis!=null&&globalThis.document?M.useLayoutEffect:M.useEffect;function wU(){const e=M.useContext(Kg);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var xU=M.createContext({});xU.displayName="ColorModeContext";function QT(){const e=M.useContext(xU);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function wMe(e,t){const{colorMode:n}=QT();return n==="dark"?t:e}function RCe(){const e=QT(),t=wU();return{...e,theme:t}}function OCe(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 ICe(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 xMe(e,t,n){const r=wU();return MCe(e,t,n)(r)}function MCe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const s=i.filter(Boolean),a=r.map((l,u)=>{var c,d;if(e==="breakpoints")return OCe(o,l,(c=s[u])!=null?c:l);const f=`${e}.${l}`;return ICe(o,f,(d=s[u])!=null?d:l)});return Array.isArray(t)?a:a[0]}}var YT=(...e)=>e.filter(Boolean).join(" ");function NCe(){return!1}function Qa(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var CMe=e=>{const{condition:t,message:n}=e;t&&NCe()&&console.warn(n)};function dc(e,...t){return DCe(e)?e(...t):e}var DCe=e=>typeof e=="function",EMe=e=>e?"":void 0,TMe=e=>e?!0:void 0;function AMe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function kMe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var O1={exports:{}};O1.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",b="[object Number]",_="[object Null]",y="[object Object]",g="[object Proxy]",v="[object RegExp]",S="[object Set]",w="[object String]",x="[object Undefined]",C="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",k="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",E="[object Int16Array]",P="[object Int32Array]",D="[object Uint8Array]",B="[object Uint8ClampedArray]",R="[object Uint16Array]",O="[object Uint32Array]",I=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,V={};V[k]=V[L]=V[N]=V[E]=V[P]=V[D]=V[B]=V[R]=V[O]=!0,V[a]=V[l]=V[A]=V[c]=V[T]=V[d]=V[f]=V[h]=V[m]=V[b]=V[y]=V[v]=V[S]=V[w]=V[C]=!1;var H=typeof ut=="object"&&ut&&ut.Object===Object&&ut,Y=typeof self=="object"&&self&&self.Object===Object&&self,Q=H||Y||Function("return this")(),j=t&&!t.nodeType&&t,K=j&&!0&&e&&!e.nodeType&&e,ee=K&&K.exports===j,ie=ee&&H.process,ge=function(){try{var $=K&&K.require&&K.require("util").types;return $||ie&&ie.binding&&ie.binding("util")}catch{}}(),ae=ge&&ge.isTypedArray;function dt($,G,X){switch(X.length){case 0:return $.call(G);case 1:return $.call(G,X[0]);case 2:return $.call(G,X[0],X[1]);case 3:return $.call(G,X[0],X[1],X[2])}return $.apply(G,X)}function et($,G){for(var X=-1,de=Array($);++X<$;)de[X]=G(X);return de}function Ne($){return function(G){return $(G)}}function lt($,G){return $==null?void 0:$[G]}function Te($,G){return function(X){return $(G(X))}}var Ht=Array.prototype,br=Function.prototype,An=Object.prototype,_n=Q["__core-js_shared__"],qt=br.toString,kn=An.hasOwnProperty,Sr=function(){var $=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),eo=An.toString,Vr=qt.call(Object),sr=RegExp("^"+qt.call(kn).replace(I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Or=ee?Q.Buffer:void 0,Gr=Q.Symbol,Pn=Q.Uint8Array,cn=Or?Or.allocUnsafe:void 0,xi=Te(Object.getPrototypeOf,Object),oi=Object.create,Ui=An.propertyIsEnumerable,fs=Ht.splice,wr=Gr?Gr.toStringTag:void 0,to=function(){try{var $=Qn(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Ca=Or?Or.isBuffer:void 0,_o=Math.max,Ea=Date.now,Rn=Qn(Q,"Map"),Wt=Qn(Object,"create"),Ir=function(){function $(){}return function(G){if(!Ge(G))return{};if(oi)return oi(G);$.prototype=G;var X=new $;return $.prototype=void 0,X}}();function xr($){var G=-1,X=$==null?0:$.length;for(this.clear();++G<X;){var de=$[G];this.set(de[0],de[1])}}function Cr(){this.__data__=Wt?Wt(null):{},this.size=0}function Hr($){var G=this.has($)&&delete this.__data__[$];return this.size-=G?1:0,G}function Ci($){var G=this.__data__;if(Wt){var X=G[$];return X===r?void 0:X}return kn.call(G,$)?G[$]:void 0}function no($){var G=this.__data__;return Wt?G[$]!==void 0:kn.call(G,$)}function si($,G){var X=this.__data__;return this.size+=this.has($)?0:1,X[$]=Wt&&G===void 0?r:G,this}xr.prototype.clear=Cr,xr.prototype.delete=Hr,xr.prototype.get=Ci,xr.prototype.has=no,xr.prototype.set=si;function Mr($){var G=-1,X=$==null?0:$.length;for(this.clear();++G<X;){var de=$[G];this.set(de[0],de[1])}}function hs(){this.__data__=[],this.size=0}function Us($){var G=this.__data__,X=We(G,$);if(X<0)return!1;var de=G.length-1;return X==de?G.pop():fs.call(G,X,1),--this.size,!0}function ai($){var G=this.__data__,X=We(G,$);return X<0?void 0:G[X][1]}function yl($){return We(this.__data__,$)>-1}function Bo($,G){var X=this.__data__,de=We(X,$);return de<0?(++this.size,X.push([$,G])):X[de][1]=G,this}Mr.prototype.clear=hs,Mr.prototype.delete=Us,Mr.prototype.get=ai,Mr.prototype.has=yl,Mr.prototype.set=Bo;function qr($){var G=-1,X=$==null?0:$.length;for(this.clear();++G<X;){var de=$[G];this.set(de[0],de[1])}}function Ta(){this.size=0,this.__data__={hash:new xr,map:new(Rn||Mr),string:new xr}}function W($){var G=Kt(this,$).delete($);return this.size-=G?1:0,G}function J($){return Kt(this,$).get($)}function te($){return Kt(this,$).has($)}function le($,G){var X=Kt(this,$),de=X.size;return X.set($,G),this.size+=X.size==de?0:1,this}qr.prototype.clear=Ta,qr.prototype.delete=W,qr.prototype.get=J,qr.prototype.has=te,qr.prototype.set=le;function re($){var G=this.__data__=new Mr($);this.size=G.size}function De(){this.__data__=new Mr,this.size=0}function ze($){var G=this.__data__,X=G.delete($);return this.size=G.size,X}function rt($){return this.__data__.get($)}function Oe($){return this.__data__.has($)}function Ue($,G){var X=this.__data__;if(X instanceof Mr){var de=X.__data__;if(!Rn||de.length<n-1)return de.push([$,G]),this.size=++X.size,this;X=this.__data__=new qr(de)}return X.set($,G),this.size=X.size,this}re.prototype.clear=De,re.prototype.delete=ze,re.prototype.get=rt,re.prototype.has=Oe,re.prototype.set=Ue;function Ae($,G){var X=se($),de=!X&&_e($),bt=!X&&!de&&fe($),rn=!X&&!de&&!bt&&Lt($),Sn=X||de||bt||rn,Et=Sn?et($.length,String):[],hn=Et.length;for(var ci in $)(G||kn.call($,ci))&&!(Sn&&(ci=="length"||bt&&(ci=="offset"||ci=="parent")||rn&&(ci=="buffer"||ci=="byteLength"||ci=="byteOffset")||dn(ci,hn)))&&Et.push(ci);return Et}function ne($,G,X){(X!==void 0&&!$e($[G],X)||X===void 0&&!(G in $))&&Ke($,G,X)}function ye($,G,X){var de=$[G];(!(kn.call($,G)&&$e(de,X))||X===void 0&&!(G in $))&&Ke($,G,X)}function We($,G){for(var X=$.length;X--;)if($e($[X][0],G))return X;return-1}function Ke($,G,X){G=="__proto__"&&to?to($,G,{configurable:!0,enumerable:!0,value:X,writable:!0}):$[G]=X}var it=nn();function ot($){return $==null?$===void 0?x:_:wr&&wr in Object($)?pr($):ve($)}function pt($){return Ee($)&&ot($)==a}function _t($){if(!Ge($)||fn($))return!1;var G=be($)?sr:F;return G.test(st($))}function wt($){return Ee($)&&Qe($.length)&&!!V[ot($)]}function en($){if(!Ge($))return sn($);var G=Xt($),X=[];for(var de in $)de=="constructor"&&(G||!kn.call($,de))||X.push(de);return X}function tn($,G,X,de,bt){$!==G&&it(G,function(rn,Sn){if(bt||(bt=new re),Ge(rn))Ei($,G,Sn,X,tn,de,bt);else{var Et=de?de(Le($,Sn),rn,Sn+"",$,G,bt):void 0;Et===void 0&&(Et=rn),ne($,Sn,Et)}},Yn)}function Ei($,G,X,de,bt,rn,Sn){var Et=Le($,X),hn=Le(G,X),ci=Sn.get(hn);if(ci){ne($,X,ci);return}var Vn=rn?rn(Et,hn,X+"",$,G,Sn):void 0,vl=Vn===void 0;if(vl){var sd=se(hn),_l=!sd&&fe(hn),ad=!sd&&!_l&&Lt(hn);Vn=hn,sd||_l||ad?se(Et)?Vn=Et:ue(Et)?Vn=ro(Et):_l?(vl=!1,Vn=hr(hn,!0)):ad?(vl=!1,Vn=jn(hn,!0)):Vn=[]:xt(hn)||_e(hn)?(Vn=Et,_e(Et)?Vn=$t(Et):(!Ge(Et)||be(Et))&&(Vn=ui(hn))):vl=!1}vl&&(Sn.set(hn,Vn),bt(Vn,hn,de,rn,Sn),Sn.delete(hn)),ne($,X,Vn)}function bo($,G){return Ce(Xe($,G,bn),$+"")}var Ti=to?function($,G){return to($,"toString",{configurable:!0,enumerable:!1,value:On(G),writable:!0})}:bn;function hr($,G){if(G)return $.slice();var X=$.length,de=cn?cn(X):new $.constructor(X);return $.copy(de),de}function li($){var G=new $.constructor($.byteLength);return new Pn(G).set(new Pn($)),G}function jn($,G){var X=G?li($.buffer):$.buffer;return new $.constructor(X,$.byteOffset,$.length)}function ro($,G){var X=-1,de=$.length;for(G||(G=Array(de));++X<de;)G[X]=$[X];return G}function ps($,G,X,de){var bt=!X;X||(X={});for(var rn=-1,Sn=G.length;++rn<Sn;){var Et=G[rn],hn=de?de(X[Et],$[Et],Et,X,$):void 0;hn===void 0&&(hn=$[Et]),bt?Ke(X,Et,hn):ye(X,Et,hn)}return X}function Je($){return bo(function(G,X){var de=-1,bt=X.length,rn=bt>1?X[bt-1]:void 0,Sn=bt>2?X[2]:void 0;for(rn=$.length>3&&typeof rn=="function"?(bt--,rn):void 0,Sn&&Pt(X[0],X[1],Sn)&&(rn=bt<3?void 0:rn,bt=1),G=Object(G);++de<bt;){var Et=X[de];Et&&$(G,Et,de,rn)}return G})}function nn($){return function(G,X,de){for(var bt=-1,rn=Object(G),Sn=de(G),Et=Sn.length;Et--;){var hn=Sn[$?Et:++bt];if(X(rn[hn],hn,rn)===!1)break}return G}}function Kt($,G){var X=$.__data__;return Bt(G)?X[typeof G=="string"?"string":"hash"]:X.map}function Qn($,G){var X=lt($,G);return _t(X)?X:void 0}function pr($){var G=kn.call($,wr),X=$[wr];try{$[wr]=void 0;var de=!0}catch{}var bt=eo.call($);return de&&(G?$[wr]=X:delete $[wr]),bt}function ui($){return typeof $.constructor=="function"&&!Xt($)?Ir(xi($)):{}}function dn($,G){var X=typeof $;return G=G??s,!!G&&(X=="number"||X!="symbol"&&U.test($))&&$>-1&&$%1==0&&$<G}function Pt($,G,X){if(!Ge(X))return!1;var de=typeof G;return(de=="number"?Se(X)&&dn(G,X.length):de=="string"&&G in X)?$e(X[G],$):!1}function Bt($){var G=typeof $;return G=="string"||G=="number"||G=="symbol"||G=="boolean"?$!=="__proto__":$===null}function fn($){return!!Sr&&Sr in $}function Xt($){var G=$&&$.constructor,X=typeof G=="function"&&G.prototype||An;return $===X}function sn($){var G=[];if($!=null)for(var X in Object($))G.push(X);return G}function ve($){return eo.call($)}function Xe($,G,X){return G=_o(G===void 0?$.length-1:G,0),function(){for(var de=arguments,bt=-1,rn=_o(de.length-G,0),Sn=Array(rn);++bt<rn;)Sn[bt]=de[G+bt];bt=-1;for(var Et=Array(G+1);++bt<G;)Et[bt]=de[bt];return Et[G]=X(Sn),dt($,this,Et)}}function Le($,G){if(!(G==="constructor"&&typeof $[G]=="function")&&G!="__proto__")return $[G]}var Ce=je(Ti);function je($){var G=0,X=0;return function(){var de=Ea(),bt=o-(de-X);if(X=de,bt>0){if(++G>=i)return arguments[0]}else G=0;return $.apply(void 0,arguments)}}function st($){if($!=null){try{return qt.call($)}catch{}try{return $+""}catch{}}return""}function $e($,G){return $===G||$!==$&&G!==G}var _e=pt(function(){return arguments}())?pt:function($){return Ee($)&&kn.call($,"callee")&&!Ui.call($,"callee")},se=Array.isArray;function Se($){return $!=null&&Qe($.length)&&!be($)}function ue($){return Ee($)&&Se($)}var fe=Ca||ji;function be($){if(!Ge($))return!1;var G=ot($);return G==h||G==p||G==u||G==g}function Qe($){return typeof $=="number"&&$>-1&&$%1==0&&$<=s}function Ge($){var G=typeof $;return $!=null&&(G=="object"||G=="function")}function Ee($){return $!=null&&typeof $=="object"}function xt($){if(!Ee($)||ot($)!=y)return!1;var G=xi($);if(G===null)return!0;var X=kn.call(G,"constructor")&&G.constructor;return typeof X=="function"&&X instanceof X&&qt.call(X)==Vr}var Lt=ae?Ne(ae):wt;function $t($){return ps($,Yn($))}function Yn($){return Se($)?Ae($,!0):en($)}var ar=Je(function($,G,X,de){tn($,G,X,de)});function On($){return function(){return $}}function bn($){return $}function ji(){return!1}e.exports=ar})(O1,O1.exports);var LCe=O1.exports;const oa=Fc(LCe);var $Ce=e=>/!(important)?$/.test(e),YR=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,FCe=(e,t)=>n=>{const r=String(t),i=$Ce(r),o=YR(r),s=e?`${e}.${o}`:o;let a=Qa(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=YR(a),i?`${a} !important`:a};function ZT(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{var a;const l=FCe(t,o)(s);let u=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(u=r(u,s)),u}}var a0=(...e)=>t=>e.reduce((n,r)=>r(n),t);function jo(e,t){return n=>{const r={property:n,scale:e};return r.transform=ZT({scale:e,transform:t}),r}}var BCe=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function zCe(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:BCe(t),transform:n?ZT({scale:n,compose:r}):r}}var CU=["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 UCe(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...CU].join(" ")}function jCe(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...CU].join(" ")}var VCe={"--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(" ")},GCe={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 HCe(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 qCe={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},b3={"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"},WCe=new Set(Object.values(b3)),S3=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),KCe=e=>e.trim();function XCe(e,t){if(e==null||S3.has(e))return e;if(!(w3(e)||S3.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!o||!s)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=s.split(",").map(KCe).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in b3?b3[l]:l;u.unshift(c);const d=u.map(f=>{if(WCe.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],b=w3(m)?m:m&&m.split(" "),_=`colors.${p}`,y=_ in t.__cssMap?t.__cssMap[_].varRef:p;return b?[y,...Array.isArray(b)?b:[b]].join(" "):y});return`${a}(${d.join(", ")})`}var w3=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),QCe=(e,t)=>XCe(e,t??{});function YCe(e){return/^var\(--.+\)$/.test(e)}var ZCe=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},qs=e=>t=>`${e}(${t})`,Ut={filter(e){return e!=="auto"?e:VCe},backdropFilter(e){return e!=="auto"?e:GCe},ring(e){return HCe(Ut.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?UCe():e==="auto-gpu"?jCe():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=ZCe(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(YCe(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:QCe,blur:qs("blur"),opacity:qs("opacity"),brightness:qs("brightness"),contrast:qs("contrast"),dropShadow:qs("drop-shadow"),grayscale:qs("grayscale"),hueRotate:qs("hue-rotate"),invert:qs("invert"),saturate:qs("saturate"),sepia:qs("sepia"),bgImage(e){return e==null||w3(e)||S3.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=qCe[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},q={borderWidths:jo("borderWidths"),borderStyles:jo("borderStyles"),colors:jo("colors"),borders:jo("borders"),gradients:jo("gradients",Ut.gradient),radii:jo("radii",Ut.px),space:jo("space",a0(Ut.vh,Ut.px)),spaceT:jo("space",a0(Ut.vh,Ut.px)),degreeT(e){return{property:e,transform:Ut.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:ZT({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:jo("sizes",a0(Ut.vh,Ut.px)),sizesT:jo("sizes",a0(Ut.vh,Ut.fraction)),shadows:jo("shadows"),logical:zCe,blur:jo("blur",Ut.blur)},K0={background:q.colors("background"),backgroundColor:q.colors("backgroundColor"),backgroundImage:q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ut.bgClip},bgSize:q.prop("backgroundSize"),bgPosition:q.prop("backgroundPosition"),bg:q.colors("background"),bgColor:q.colors("backgroundColor"),bgPos:q.prop("backgroundPosition"),bgRepeat:q.prop("backgroundRepeat"),bgAttachment:q.prop("backgroundAttachment"),bgGradient:q.gradients("backgroundImage"),bgClip:{transform:Ut.bgClip}};Object.assign(K0,{bgImage:K0.backgroundImage,bgImg:K0.backgroundImage});var Yt={border:q.borders("border"),borderWidth:q.borderWidths("borderWidth"),borderStyle:q.borderStyles("borderStyle"),borderColor:q.colors("borderColor"),borderRadius:q.radii("borderRadius"),borderTop:q.borders("borderTop"),borderBlockStart:q.borders("borderBlockStart"),borderTopLeftRadius:q.radii("borderTopLeftRadius"),borderStartStartRadius:q.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:q.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:q.radii("borderTopRightRadius"),borderStartEndRadius:q.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:q.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:q.borders("borderRight"),borderInlineEnd:q.borders("borderInlineEnd"),borderBottom:q.borders("borderBottom"),borderBlockEnd:q.borders("borderBlockEnd"),borderBottomLeftRadius:q.radii("borderBottomLeftRadius"),borderBottomRightRadius:q.radii("borderBottomRightRadius"),borderLeft:q.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:q.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:q.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:q.borders(["borderLeft","borderRight"]),borderInline:q.borders("borderInline"),borderY:q.borders(["borderTop","borderBottom"]),borderBlock:q.borders("borderBlock"),borderTopWidth:q.borderWidths("borderTopWidth"),borderBlockStartWidth:q.borderWidths("borderBlockStartWidth"),borderTopColor:q.colors("borderTopColor"),borderBlockStartColor:q.colors("borderBlockStartColor"),borderTopStyle:q.borderStyles("borderTopStyle"),borderBlockStartStyle:q.borderStyles("borderBlockStartStyle"),borderBottomWidth:q.borderWidths("borderBottomWidth"),borderBlockEndWidth:q.borderWidths("borderBlockEndWidth"),borderBottomColor:q.colors("borderBottomColor"),borderBlockEndColor:q.colors("borderBlockEndColor"),borderBottomStyle:q.borderStyles("borderBottomStyle"),borderBlockEndStyle:q.borderStyles("borderBlockEndStyle"),borderLeftWidth:q.borderWidths("borderLeftWidth"),borderInlineStartWidth:q.borderWidths("borderInlineStartWidth"),borderLeftColor:q.colors("borderLeftColor"),borderInlineStartColor:q.colors("borderInlineStartColor"),borderLeftStyle:q.borderStyles("borderLeftStyle"),borderInlineStartStyle:q.borderStyles("borderInlineStartStyle"),borderRightWidth:q.borderWidths("borderRightWidth"),borderInlineEndWidth:q.borderWidths("borderInlineEndWidth"),borderRightColor:q.colors("borderRightColor"),borderInlineEndColor:q.colors("borderInlineEndColor"),borderRightStyle:q.borderStyles("borderRightStyle"),borderInlineEndStyle:q.borderStyles("borderInlineEndStyle"),borderTopRadius:q.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:q.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:q.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:q.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Yt,{rounded:Yt.borderRadius,roundedTop:Yt.borderTopRadius,roundedTopLeft:Yt.borderTopLeftRadius,roundedTopRight:Yt.borderTopRightRadius,roundedTopStart:Yt.borderStartStartRadius,roundedTopEnd:Yt.borderStartEndRadius,roundedBottom:Yt.borderBottomRadius,roundedBottomLeft:Yt.borderBottomLeftRadius,roundedBottomRight:Yt.borderBottomRightRadius,roundedBottomStart:Yt.borderEndStartRadius,roundedBottomEnd:Yt.borderEndEndRadius,roundedLeft:Yt.borderLeftRadius,roundedRight:Yt.borderRightRadius,roundedStart:Yt.borderInlineStartRadius,roundedEnd:Yt.borderInlineEndRadius,borderStart:Yt.borderInlineStart,borderEnd:Yt.borderInlineEnd,borderTopStartRadius:Yt.borderStartStartRadius,borderTopEndRadius:Yt.borderStartEndRadius,borderBottomStartRadius:Yt.borderEndStartRadius,borderBottomEndRadius:Yt.borderEndEndRadius,borderStartRadius:Yt.borderInlineStartRadius,borderEndRadius:Yt.borderInlineEndRadius,borderStartWidth:Yt.borderInlineStartWidth,borderEndWidth:Yt.borderInlineEndWidth,borderStartColor:Yt.borderInlineStartColor,borderEndColor:Yt.borderInlineEndColor,borderStartStyle:Yt.borderInlineStartStyle,borderEndStyle:Yt.borderInlineEndStyle});var JCe={color:q.colors("color"),textColor:q.colors("color"),fill:q.colors("fill"),stroke:q.colors("stroke")},x3={boxShadow:q.shadows("boxShadow"),mixBlendMode:!0,blendMode:q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:q.prop("backgroundBlendMode"),opacity:!0};Object.assign(x3,{shadow:x3.boxShadow});var e3e={filter:{transform:Ut.filter},blur:q.blur("--chakra-blur"),brightness:q.propT("--chakra-brightness",Ut.brightness),contrast:q.propT("--chakra-contrast",Ut.contrast),hueRotate:q.degreeT("--chakra-hue-rotate"),invert:q.propT("--chakra-invert",Ut.invert),saturate:q.propT("--chakra-saturate",Ut.saturate),dropShadow:q.propT("--chakra-drop-shadow",Ut.dropShadow),backdropFilter:{transform:Ut.backdropFilter},backdropBlur:q.blur("--chakra-backdrop-blur"),backdropBrightness:q.propT("--chakra-backdrop-brightness",Ut.brightness),backdropContrast:q.propT("--chakra-backdrop-contrast",Ut.contrast),backdropHueRotate:q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:q.propT("--chakra-backdrop-invert",Ut.invert),backdropSaturate:q.propT("--chakra-backdrop-saturate",Ut.saturate)},I1={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ut.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:q.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:q.space("gap"),rowGap:q.space("rowGap"),columnGap:q.space("columnGap")};Object.assign(I1,{flexDir:I1.flexDirection});var EU={gridGap:q.space("gridGap"),gridColumnGap:q.space("gridColumnGap"),gridRowGap:q.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},t3e={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ut.outline},outlineOffset:!0,outlineColor:q.colors("outlineColor")},Go={width:q.sizesT("width"),inlineSize:q.sizesT("inlineSize"),height:q.sizes("height"),blockSize:q.sizes("blockSize"),boxSize:q.sizes(["width","height"]),minWidth:q.sizes("minWidth"),minInlineSize:q.sizes("minInlineSize"),minHeight:q.sizes("minHeight"),minBlockSize:q.sizes("minBlockSize"),maxWidth:q.sizes("maxWidth"),maxInlineSize:q.sizes("maxInlineSize"),maxHeight:q.sizes("maxHeight"),maxBlockSize:q.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (min-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?i:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (max-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?i:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:q.propT("float",Ut.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Go,{w:Go.width,h:Go.height,minW:Go.minWidth,maxW:Go.maxWidth,minH:Go.minHeight,maxH:Go.maxHeight,overscroll:Go.overscrollBehavior,overscrollX:Go.overscrollBehaviorX,overscrollY:Go.overscrollBehaviorY});var n3e={listStyleType:!0,listStylePosition:!0,listStylePos:q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:q.prop("listStyleImage")};function r3e(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 i3e=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}},o3e=i3e(r3e),s3e={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},a3e={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Lw=(e,t,n)=>{const r={},i=o3e(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},l3e={srOnly:{transform(e){return e===!0?s3e:e==="focusable"?a3e:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Lw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Lw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Lw(t,e,n)}},Ep={position:!0,pos:q.prop("position"),zIndex:q.prop("zIndex","zIndices"),inset:q.spaceT("inset"),insetX:q.spaceT(["left","right"]),insetInline:q.spaceT("insetInline"),insetY:q.spaceT(["top","bottom"]),insetBlock:q.spaceT("insetBlock"),top:q.spaceT("top"),insetBlockStart:q.spaceT("insetBlockStart"),bottom:q.spaceT("bottom"),insetBlockEnd:q.spaceT("insetBlockEnd"),left:q.spaceT("left"),insetInlineStart:q.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:q.spaceT("right"),insetInlineEnd:q.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Ep,{insetStart:Ep.insetInlineStart,insetEnd:Ep.insetInlineEnd});var u3e={ring:{transform:Ut.ring},ringColor:q.colors("--chakra-ring-color"),ringOffset:q.prop("--chakra-ring-offset-width"),ringOffsetColor:q.colors("--chakra-ring-offset-color"),ringInset:q.prop("--chakra-ring-inset")},Mn={margin:q.spaceT("margin"),marginTop:q.spaceT("marginTop"),marginBlockStart:q.spaceT("marginBlockStart"),marginRight:q.spaceT("marginRight"),marginInlineEnd:q.spaceT("marginInlineEnd"),marginBottom:q.spaceT("marginBottom"),marginBlockEnd:q.spaceT("marginBlockEnd"),marginLeft:q.spaceT("marginLeft"),marginInlineStart:q.spaceT("marginInlineStart"),marginX:q.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:q.spaceT("marginInline"),marginY:q.spaceT(["marginTop","marginBottom"]),marginBlock:q.spaceT("marginBlock"),padding:q.space("padding"),paddingTop:q.space("paddingTop"),paddingBlockStart:q.space("paddingBlockStart"),paddingRight:q.space("paddingRight"),paddingBottom:q.space("paddingBottom"),paddingBlockEnd:q.space("paddingBlockEnd"),paddingLeft:q.space("paddingLeft"),paddingInlineStart:q.space("paddingInlineStart"),paddingInlineEnd:q.space("paddingInlineEnd"),paddingX:q.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:q.space("paddingInline"),paddingY:q.space(["paddingTop","paddingBottom"]),paddingBlock:q.space("paddingBlock")};Object.assign(Mn,{m:Mn.margin,mt:Mn.marginTop,mr:Mn.marginRight,me:Mn.marginInlineEnd,marginEnd:Mn.marginInlineEnd,mb:Mn.marginBottom,ml:Mn.marginLeft,ms:Mn.marginInlineStart,marginStart:Mn.marginInlineStart,mx:Mn.marginX,my:Mn.marginY,p:Mn.padding,pt:Mn.paddingTop,py:Mn.paddingY,px:Mn.paddingX,pb:Mn.paddingBottom,pl:Mn.paddingLeft,ps:Mn.paddingInlineStart,paddingStart:Mn.paddingInlineStart,pr:Mn.paddingRight,pe:Mn.paddingInlineEnd,paddingEnd:Mn.paddingInlineEnd});var c3e={textDecorationColor:q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:q.shadows("textShadow")},d3e={clipPath:!0,transform:q.propT("transform",Ut.transform),transformOrigin:!0,translateX:q.spaceT("--chakra-translate-x"),translateY:q.spaceT("--chakra-translate-y"),skewX:q.degreeT("--chakra-skew-x"),skewY:q.degreeT("--chakra-skew-y"),scaleX:q.prop("--chakra-scale-x"),scaleY:q.prop("--chakra-scale-y"),scale:q.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:q.degreeT("--chakra-rotate")},f3e={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:q.prop("transitionDuration","transition.duration"),transitionProperty:q.prop("transitionProperty","transition.property"),transitionTimingFunction:q.prop("transitionTimingFunction","transition.easing")},h3e={fontFamily:q.prop("fontFamily","fonts"),fontSize:q.prop("fontSize","fontSizes",Ut.px),fontWeight:q.prop("fontWeight","fontWeights"),lineHeight:q.prop("lineHeight","lineHeights"),letterSpacing:q.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},p3e={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:q.spaceT("scrollMargin"),scrollMarginTop:q.spaceT("scrollMarginTop"),scrollMarginBottom:q.spaceT("scrollMarginBottom"),scrollMarginLeft:q.spaceT("scrollMarginLeft"),scrollMarginRight:q.spaceT("scrollMarginRight"),scrollMarginX:q.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:q.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:q.spaceT("scrollPadding"),scrollPaddingTop:q.spaceT("scrollPaddingTop"),scrollPaddingBottom:q.spaceT("scrollPaddingBottom"),scrollPaddingLeft:q.spaceT("scrollPaddingLeft"),scrollPaddingRight:q.spaceT("scrollPaddingRight"),scrollPaddingX:q.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:q.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function TU(e){return Qa(e)&&e.reference?e.reference:String(e)}var FS=(e,...t)=>t.map(TU).join(` ${e} `).replace(/calc/g,""),ZR=(...e)=>`calc(${FS("+",...e)})`,JR=(...e)=>`calc(${FS("-",...e)})`,C3=(...e)=>`calc(${FS("*",...e)})`,eO=(...e)=>`calc(${FS("/",...e)})`,tO=e=>{const t=TU(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:C3(t,-1)},ec=Object.assign(e=>({add:(...t)=>ec(ZR(e,...t)),subtract:(...t)=>ec(JR(e,...t)),multiply:(...t)=>ec(C3(e,...t)),divide:(...t)=>ec(eO(e,...t)),negate:()=>ec(tO(e)),toString:()=>e.toString()}),{add:ZR,subtract:JR,multiply:C3,divide:eO,negate:tO});function g3e(e,t="-"){return e.replace(/\s+/g,t)}function m3e(e){const t=g3e(e.toString());return v3e(y3e(t))}function y3e(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function v3e(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function _3e(e,t=""){return[t,e].filter(Boolean).join("-")}function b3e(e,t){return`var(${e}${t?`, ${t}`:""})`}function S3e(e,t=""){return m3e(`--${_3e(e,t)}`)}function E3(e,t,n){const r=S3e(e,n);return{variable:r,reference:b3e(r,t)}}function PMe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=E3(`${e}-${i}`,o);continue}n[r]=E3(`${e}-${r}`)}return n}function w3e(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function x3e(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function T3(e){if(e==null)return e;const{unitless:t}=x3e(e);return t||typeof e=="number"?`${e}px`:e}var AU=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,JT=e=>Object.fromEntries(Object.entries(e).sort(AU));function nO(e){const t=JT(e);return Object.assign(Object.values(t),t)}function C3e(e){const t=Object.keys(JT(e));return new Set(t)}function rO(e){var t;if(!e)return e;e=(t=T3(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function sp(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${T3(e)})`),t&&n.push("and",`(max-width: ${T3(t)})`),n.join(" ")}function E3e(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=nO(e),r=Object.entries(e).sort(AU).map(([s,a],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?rO(d):void 0,{_minW:rO(a),breakpoint:s,minW:a,maxW:d,maxWQuery:sp(null,d),minWQuery:sp(a),minMaxQuery:sp(a,d)}}),i=C3e(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:JT(e),asArray:nO(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>sp(s)).slice(1)],toArrayValue(s){if(!Qa(s))throw new Error("toArrayValue: value must be an object");const a=o.map(l=>{var u;return(u=s[l])!=null?u:null});for(;w3e(a)===null;)a.pop();return a},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((a,l,u)=>{const c=o[u];return c!=null&&l!=null&&(a[c]=l),a},{})}}}var di={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}`},Cl=e=>kU(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Oa=e=>kU(t=>e(t,"~ &"),"[data-peer]",".peer"),kU=(e,...t)=>t.map(e).join(", "),BS={_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:Cl(di.hover),_peerHover:Oa(di.hover),_groupFocus:Cl(di.focus),_peerFocus:Oa(di.focus),_groupFocusVisible:Cl(di.focusVisible),_peerFocusVisible:Oa(di.focusVisible),_groupActive:Cl(di.active),_peerActive:Oa(di.active),_groupDisabled:Cl(di.disabled),_peerDisabled:Oa(di.disabled),_groupInvalid:Cl(di.invalid),_peerInvalid:Oa(di.invalid),_groupChecked:Cl(di.checked),_peerChecked:Oa(di.checked),_groupFocusWithin:Cl(di.focusWithin),_peerFocusWithin:Oa(di.focusWithin),_peerPlaceholderShown:Oa(di.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]"},PU=Object.keys(BS);function iO(e,t){return E3(String(e).replace(/\./g,"-"),void 0,t)}function T3e(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:s,value:a}=o,{variable:l,reference:u}=iO(i,t==null?void 0:t.cssVarPrefix);if(!s){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,m=`${h}.-${p.join(".")}`,b=ec.negate(a),_=ec.negate(u);r[m]={value:b,var:l,varRef:_}}n[l]=a,r[i]={value:a,var:l,varRef:u};continue}const c=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:b}=iO(p,t==null?void 0:t.cssVarPrefix);return b},d=Qa(a)?a:{default:a};n=oa(n,Object.entries(d).reduce((f,[h,p])=>{var m,b;if(!p)return f;const _=c(`${p}`);if(h==="default")return f[l]=_,f;const y=(b=(m=BS)==null?void 0:m[h])!=null?b:h;return f[y]={[l]:_},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function A3e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function k3e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function P3e(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function oO(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){var l;if(P3e(s)||Array.isArray(s)){const u={};for(const[c,d]of Object.entries(s)){const f=(l=i==null?void 0:i(c))!=null?l:c,h=[...a,f];if(r!=null&&r(s,h))return t(s,a);u[f]=o(d,h)}return u}return t(s,a)}return o(e)}var R3e=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function O3e(e){return k3e(e,R3e)}function I3e(e){return e.semanticTokens}function M3e(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var N3e=e=>PU.includes(e)||e==="default";function D3e({tokens:e,semanticTokens:t}){const n={};return oO(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),oO(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(N3e)}),n}function RMe(e){var t;const n=M3e(e),r=O3e(n),i=I3e(n),o=D3e({tokens:r,semanticTokens:i}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=T3e(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:E3e(n.breakpoints)}),n}var e4=oa({},K0,Yt,JCe,I1,Go,e3e,u3e,t3e,EU,l3e,Ep,x3,Mn,p3e,h3e,c3e,d3e,n3e,f3e),L3e=Object.assign({},Mn,Go,I1,EU,Ep),OMe=Object.keys(L3e),$3e=[...Object.keys(e4),...PU],F3e={...e4,...BS},B3e=e=>e in F3e,z3e=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=dc(e[s],t);if(a==null)continue;if(a=Qa(a)&&n(a)?r(a):a,!Array.isArray(a)){o[s]=a;continue}const l=a.slice(0,i.length).length;for(let u=0;u<l;u+=1){const c=i==null?void 0:i[u];if(!c){o[s]=a[u];continue}o[c]=o[c]||{},a[u]!=null&&(o[c][s]=a[u])}}return o};function U3e(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 j3e(e){return/^var\(--.+\)$/.test(e)}var V3e=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!j3e(t),G3e=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[s,a]=U3e(t);return t=(r=(n=i(s))!=null?n:o(a))!=null?r:o(t),t};function H3e(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var a,l,u;const c=dc(o,r),d=z3e(c)(r);let f={};for(let h in d){const p=d[h];let m=dc(p,r);h in n&&(h=n[h]),V3e(h,m)&&(m=G3e(r,m));let b=t[h];if(b===!0&&(b={property:h}),Qa(m)){f[h]=(a=f[h])!=null?a:{},f[h]=oa({},f[h],i(m,!0));continue}let _=(u=(l=b==null?void 0:b.transform)==null?void 0:l.call(b,m,r,c))!=null?u:m;_=b!=null&&b.processResult?i(_,!0):_;const y=dc(b==null?void 0:b.property,r);if(!s&&(b!=null&&b.static)){const g=dc(b.static,r);f=oa({},f,g)}if(y&&Array.isArray(y)){for(const g of y)f[g]=_;continue}if(y){y==="&"&&Qa(_)?f=oa({},f,_):f[y]=_;continue}if(Qa(_)){f=oa({},f,_);continue}f[h]=_}return f};return i}var q3e=e=>t=>H3e({theme:t,pseudos:BS,configs:e4})(e);function IMe(e){return e}function MMe(e){return e}function NMe(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function W3e(e,t){if(Array.isArray(e))return e;if(Qa(e))return t(e);if(e!=null)return[e]}function K3e(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function X3e(e){const t=e.__breakpoints;return function(r,i,o,s){var a,l;if(!t)return;const u={},c=W3e(o,t.toArrayValue);if(!c)return u;const d=c.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const m=t.details[p],b=t.details[K3e(c,p)],_=sp(m.minW,b==null?void 0:b._minW),y=dc((a=r[i])==null?void 0:a[c[p]],s);if(y){if(h){(l=r.parts)==null||l.forEach(g=>{oa(u,{[g]:f?y[g]:{[_]:y[g]}})});continue}if(!h){f?oa(u,y):u[_]=y;continue}u[_]=y}}return u}}function Q3e(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,s=X3e(o);return oa({},dc((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",i,t),s(e,"variants",r,t))}}function DMe(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 t4(e){return A3e(e,["styleConfig","size","variant","colorScheme"])}function Y3e(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function Z3e(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 J3e=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}},e5e=J3e(Z3e);function RU(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var OU=e=>RU(e,t=>t!=null);function t5e(e){return typeof e=="function"}function n5e(e,...t){return t5e(e)?e(...t):e}function LMe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var r5e=typeof Element<"u",i5e=typeof Map=="function",o5e=typeof Set=="function",s5e=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function X0(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(!X0(e[r],t[r]))return!1;return!0}var o;if(i5e&&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(!X0(r.value[1],t.get(r.value[0])))return!1;return!0}if(o5e&&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(s5e&&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(r5e&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!X0(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var a5e=function(t,n){try{return X0(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 l5e=Fc(a5e);function IU(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:s}=RCe(),a=e?e5e(o,`components.${e}`):void 0,l=r||a,u=oa({theme:o,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},OU(Y3e(i,["children"]))),c=M.useRef({});if(l){const f=Q3e(l)(u);l5e(c.current,f)||(c.current=f)}return c.current}function n4(e,t={}){return IU(e,t)}function $Me(e,t={}){return IU(e,t)}var u5e=new Set([...$3e,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),c5e=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function d5e(e){return c5e.has(e)||!u5e.has(e)}function f5e(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 h5e(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var p5e=/^((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)-.*))$/,g5e=pU(function(e){return p5e.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),m5e=g5e,y5e=function(t){return t!=="theme"},sO=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?m5e:y5e},aO=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},v5e=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return mU(n,r,i),CCe(function(){return yU(n,r,i)}),null},_5e=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=aO(t,n,r),l=a||sO(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var p=SU(function(m,b,_){var y=u&&m.as||i,g="",v=[],S=m;if(m.theme==null){S={};for(var w in m)S[w]=m[w];S.theme=M.useContext(Kg)}typeof m.className=="string"?g=yCe(b.registered,v,m.className):m.className!=null&&(g=m.className+" ");var x=XT(d.concat(v),b.registered,S);g+=b.key+"-"+x.name,s!==void 0&&(g+=" "+s);var C=u&&a===void 0?sO(y):l,A={};for(var T in m)u&&T==="as"||C(T)&&(A[T]=m[T]);return A.className=g,A.ref=_,M.createElement(M.Fragment,null,M.createElement(v5e,{cache:b,serialized:x,isStringTag:typeof y=="string"}),M.createElement(y,A))});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,b){return e(m,r1({},n,b,{shouldForwardProp:aO(p,b,!0)})).apply(void 0,d)},p}},b5e=["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"],M1=_5e.bind();b5e.forEach(function(e){M1[e]=M1(e)});var lO,S5e=(lO=M1.default)!=null?lO:M1,w5e=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=RU(s,(d,f)=>B3e(f)),l=n5e(e,t),u=f5e({},i,l,OU(a),o),c=q3e(u)(t.theme);return r?[c,r]:c};function $w(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=d5e);const i=w5e({baseStyle:n}),o=S5e(e,r)(i);return yn.forwardRef(function(l,u){const{colorMode:c,forced:d}=QT();return yn.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function x5e(){const e=new Map;return new Proxy($w,{apply(t,n,r){return $w(...r)},get(t,n){return e.has(n)||e.set(n,$w(n)),e.get(n)}})}var bu=x5e();function Fu(e){return M.forwardRef(e)}const MU=M.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),zS=M.createContext({}),Gm=M.createContext(null),US=typeof document<"u",r4=US?M.useLayoutEffect:M.useEffect,NU=M.createContext({strict:!1});function C5e(e,t,n,r){const{visualElement:i}=M.useContext(zS),o=M.useContext(NU),s=M.useContext(Gm),a=M.useContext(MU).reducedMotion,l=M.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;M.useInsertionEffect(()=>{u&&u.update(n,s)});const c=M.useRef(!!window.HandoffAppearAnimations);return r4(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),M.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function qd(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function E5e(e,t,n){return M.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):qd(n)&&(n.current=r))},[t])}function Xg(e){return typeof e=="string"||Array.isArray(e)}function jS(e){return typeof e=="object"&&typeof e.start=="function"}const i4=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],o4=["initial",...i4];function VS(e){return jS(e.animate)||o4.some(t=>Xg(e[t]))}function DU(e){return!!(VS(e)||e.variants)}function T5e(e,t){if(VS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Xg(n)?n:void 0,animate:Xg(r)?r:void 0}}return e.inherit!==!1?t:{}}function A5e(e){const{initial:t,animate:n}=T5e(e,M.useContext(zS));return M.useMemo(()=>({initial:t,animate:n}),[uO(t),uO(n)])}function uO(e){return Array.isArray(e)?e.join(" "):e}const cO={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"]},Qg={};for(const e in cO)Qg[e]={isEnabled:t=>cO[e].some(n=>!!t[n])};function k5e(e){for(const t in e)Qg[t]={...Qg[t],...e[t]}}const s4=M.createContext({}),LU=M.createContext({}),P5e=Symbol.for("motionComponentSymbol");function R5e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&k5e(e);function o(a,l){let u;const c={...M.useContext(MU),...a,layoutId:O5e(a)},{isStatic:d}=c,f=A5e(a),h=r(a,d);if(!d&&US){f.visualElement=C5e(i,h,c,t);const p=M.useContext(LU),m=M.useContext(NU).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,m,e,p))}return M.createElement(zS.Provider,{value:f},u&&f.visualElement?M.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,a,E5e(h,f.visualElement,l),h,d,f.visualElement))}const s=M.forwardRef(o);return s[P5e]=i,s}function O5e({layoutId:e}){const t=M.useContext(s4).id;return t&&e!==void 0?t+"-"+e:e}function I5e(e){function t(r,i={}){return R5e(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 M5e=["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 a4(e){return typeof e!="string"||e.includes("-")?!1:!!(M5e.indexOf(e)>-1||/[A-Z]/.test(e))}const N1={};function N5e(e){Object.assign(N1,e)}const Hm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],id=new Set(Hm);function $U(e,{layout:t,layoutId:n}){return id.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!N1[e]||e==="opacity")}const vo=e=>!!(e&&e.getVelocity),D5e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},L5e=Hm.length;function $5e(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let s=0;s<L5e;s++){const a=Hm[s];if(e[a]!==void 0){const l=D5e[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),BU=FU("--"),A3=FU("var(--"),F5e=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,B5e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Su=(e,t,n)=>Math.min(Math.max(n,e),t),od={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tp={...od,transform:e=>Su(0,1,e)},l0={...od,default:1},Ap=e=>Math.round(e*1e5)/1e5,GS=/(-)?([\d]*\.?[\d])+/g,zU=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,z5e=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qm(e){return typeof e=="string"}const Wm=e=>({test:t=>qm(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Tl=Wm("deg"),pa=Wm("%"),tt=Wm("px"),U5e=Wm("vh"),j5e=Wm("vw"),dO={...pa,parse:e=>pa.parse(e)/100,transform:e=>pa.transform(e*100)},fO={...od,transform:Math.round},UU={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,size:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,rotate:Tl,rotateX:Tl,rotateY:Tl,rotateZ:Tl,scale:l0,scaleX:l0,scaleY:l0,scaleZ:l0,skew:Tl,skewX:Tl,skewY:Tl,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:Tp,originX:dO,originY:dO,originZ:tt,zIndex:fO,fillOpacity:Tp,strokeOpacity:Tp,numOctaves:fO};function l4(e,t,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if(BU(d)){o[d]=f;continue}const h=UU[d],p=B5e(f,h);if(id.has(d)){if(l=!0,s[d]=p,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,a[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=$5e(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=a;i.transformOrigin=`${d} ${f} ${h}`}}const u4=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jU(e,t,n){for(const r in t)!vo(t[r])&&!$U(r,n)&&(e[r]=t[r])}function V5e({transformTemplate:e},t,n){return M.useMemo(()=>{const r=u4();return l4(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function G5e(e,t,n){const r=e.style||{},i={};return jU(i,r,e),Object.assign(i,V5e(e,t,n)),e.transformValues?e.transformValues(i):i}function H5e(e,t,n){const r={},i=G5e(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 q5e=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 D1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||q5e.has(e)}let VU=e=>!D1(e);function W5e(e){e&&(VU=t=>t.startsWith("on")?!D1(t):e(t))}try{W5e(require("@emotion/is-prop-valid").default)}catch{}function K5e(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(VU(i)||n===!0&&D1(i)||!t&&!D1(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function hO(e,t,n){return typeof e=="string"?e:tt.transform(t+n*e)}function X5e(e,t,n){const r=hO(t,e.x,e.width),i=hO(n,e.y,e.height);return`${r} ${i}`}const Q5e={offset:"stroke-dashoffset",array:"stroke-dasharray"},Y5e={offset:"strokeDashoffset",array:"strokeDasharray"};function Z5e(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Q5e:Y5e;e[o.offset]=tt.transform(-r);const s=tt.transform(t),a=tt.transform(n);e[o.array]=`${s} ${a}`}function c4(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,f){if(l4(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=X5e(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&&Z5e(h,s,a,l,!1)}const GU=()=>({...u4(),attrs:{}}),d4=e=>typeof e=="string"&&e.toLowerCase()==="svg";function J5e(e,t,n,r){const i=M.useMemo(()=>{const o=GU();return c4(o,t,{enableHardwareAcceleration:!1},d4(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};jU(o,e.style,e),i.style={...o,...i.style}}return i}function eEe(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(a4(n)?J5e:H5e)(r,o,s,n),c={...K5e(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=M.useMemo(()=>vo(d)?d.get():d,[d]);return M.createElement(n,{...c,children:f})}}const f4=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function HU(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 qU=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 WU(e,t,n,r){HU(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(qU.has(i)?i:f4(i),t.attrs[i])}function h4(e,t){const{style:n}=e,r={};for(const i in n)(vo(n[i])||t.style&&vo(t.style[i])||$U(i,e))&&(r[i]=n[i]);return r}function KU(e,t){const n=h4(e,t);for(const r in e)if(vo(e[r])||vo(t[r])){const i=Hm.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function p4(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 XU(e){const t=M.useRef(null);return t.current===null&&(t.current=e()),t.current}const L1=e=>Array.isArray(e),tEe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),nEe=e=>L1(e)?e[e.length-1]||0:e;function Q0(e){const t=vo(e)?e.get():e;return tEe(t)?t.toValue():t}function rEe({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:iEe(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const QU=e=>(t,n)=>{const r=M.useContext(zS),i=M.useContext(Gm),o=()=>rEe(e,t,r,i);return n?o():XU(o)};function iEe(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=Q0(o[f]);let{initial:s,animate:a}=e;const l=VS(e),u=DU(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const d=c?a:s;return d&&typeof d!="boolean"&&!jS(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=p4(e,h);if(!p)return;const{transitionEnd:m,transition:b,..._}=p;for(const y in _){let g=_[y];if(Array.isArray(g)){const v=c?g.length-1:0;g=g[v]}g!==null&&(i[y]=g)}for(const y in m)i[y]=m[y]}),i}const cr=e=>e;function oEe(e){let t=[],n=[],r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&s.add(l),f.indexOf(l)===-1&&(f.push(l),d&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),s.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u<r;u++){const c=t[u];c(l),s.has(c)&&(a.schedule(c),e())}i=!1,o&&(o=!1,a.process(l))}};return a}const u0=["prepare","read","update","preRender","render","postRender"],sEe=40;function aEe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=u0.reduce((d,f)=>(d[f]=oEe(()=>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,sEe),1),i.timestamp=d,i.isProcessing=!0,u0.forEach(s),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:u0.reduce((d,f)=>{const h=o[f];return d[f]=(p,m=!1,b=!1)=>(n||l(),h.schedule(p,m,b)),d},{}),cancel:d=>u0.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Tn,cancel:ll,state:Ri,steps:Fw}=aEe(typeof requestAnimationFrame<"u"?requestAnimationFrame:cr,!0),lEe={useVisualState:QU({scrapeMotionValuesFromProps:KU,createRenderState:GU,onMount:(e,t,{renderState:n,latestValues:r})=>{Tn.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Tn.render(()=>{c4(n,r,{enableHardwareAcceleration:!1},d4(t.tagName),e.transformTemplate),WU(t,n)})}})},uEe={useVisualState:QU({scrapeMotionValuesFromProps:h4,createRenderState:u4})};function cEe(e,{forwardMotionProps:t=!1},n,r){return{...a4(e)?lEe:uEe,preloadedFeatures:n,useRender:eEe(t),createVisualElement:r,Component:e}}function qa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const YU=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function HS(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const dEe=e=>t=>YU(t)&&e(t,HS(t));function Ya(e,t,n,r){return qa(e,t,dEe(n),r)}const fEe=(e,t)=>n=>t(e(n)),ou=(...e)=>e.reduce(fEe);function ZU(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const pO=ZU("dragHorizontal"),gO=ZU("dragVertical");function JU(e){let t=!1;if(e==="y")t=gO();else if(e==="x")t=pO();else{const n=pO(),r=gO();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function ej(){const e=JU(!0);return e?(e(),!1):!0}class Bu{constructor(t){this.isMounted=!1,this.node=t}update(){}}function mO(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,s)=>{if(o.type==="touch"||ej())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Tn.update(()=>a[r](o,s))};return Ya(e.current,n,i,{passive:!e.getProps()[r]})}class hEe extends Bu{mount(){this.unmount=ou(mO(this.node,!0),mO(this.node,!1))}unmount(){}}class pEe extends Bu{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=ou(qa(this.node.current,"focus",()=>this.onFocus()),qa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const tj=(e,t)=>t?e===t?!0:tj(e,t.parentElement):!1;function Bw(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,HS(n))}class gEe extends Bu{constructor(){super(...arguments),this.removeStartListeners=cr,this.removeEndListeners=cr,this.removeAccessibleListeners=cr,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Ya(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Tn.update(()=>{tj(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=Ya(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ou(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()||Bw("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Tn.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=qa(this.node.current,"keyup",s),Bw("down",(a,l)=>{this.startPress(a,l)})},n=qa(this.node.current,"keydown",t),r=()=>{this.isPressing&&Bw("cancel",(o,s)=>this.cancelPress(o,s))},i=qa(this.node.current,"blur",r);this.removeAccessibleListeners=ou(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&&Tn.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!ej()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Tn.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ya(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=qa(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ou(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const k3=new WeakMap,zw=new WeakMap,mEe=e=>{const t=k3.get(e.target);t&&t(e)},yEe=e=>{e.forEach(mEe)};function vEe({root:e,...t}){const n=e||document;zw.has(n)||zw.set(n,{});const r=zw.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(yEe,{root:e,...t})),r[i]}function _Ee(e,t,n){const r=vEe(t);return k3.set(e,n),r.observe(e),()=>{k3.delete(e),r.unobserve(e)}}const bEe={some:0,all:1};class SEe extends Bu{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:bEe[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return _Ee(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(wEe(t,n))&&this.startObserver()}unmount(){}}function wEe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xEe={inView:{Feature:SEe},tap:{Feature:gEe},focus:{Feature:pEe},hover:{Feature:hEe}};function nj(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 CEe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function EEe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function qS(e,t,n){const r=e.getProps();return p4(r,t,n!==void 0?n:r.custom,CEe(e),EEe(e))}const TEe="framerAppearId",AEe="data-"+f4(TEe);let kEe=cr,g4=cr;const su=e=>e*1e3,Za=e=>e/1e3,PEe={current:!1},rj=e=>Array.isArray(e)&&typeof e[0]=="number";function ij(e){return!!(!e||typeof e=="string"&&oj[e]||rj(e)||Array.isArray(e)&&e.every(ij))}const ap=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,oj={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ap([0,.65,.55,1]),circOut:ap([.55,0,1,.45]),backIn:ap([.31,.01,.66,-.59]),backOut:ap([.33,1.53,.69,.99])};function sj(e){if(e)return rj(e)?ap(e):Array.isArray(e)?e.map(sj):oj[e]}function REe(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=sj(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function OEe(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const aj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,IEe=1e-7,MEe=12;function NEe(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=aj(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>IEe&&++a<MEe);return s}function Km(e,t,n,r){if(e===t&&n===r)return cr;const i=o=>NEe(o,0,1,e,n);return o=>o===0||o===1?o:aj(i(o),t,r)}const DEe=Km(.42,0,1,1),LEe=Km(0,0,.58,1),lj=Km(.42,0,.58,1),$Ee=e=>Array.isArray(e)&&typeof e[0]!="number",uj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,cj=e=>t=>1-e(1-t),dj=e=>1-Math.sin(Math.acos(e)),m4=cj(dj),FEe=uj(m4),fj=Km(.33,1.53,.69,.99),y4=cj(fj),BEe=uj(y4),zEe=e=>(e*=2)<1?.5*y4(e):.5*(2-Math.pow(2,-10*(e-1))),UEe={linear:cr,easeIn:DEe,easeInOut:lj,easeOut:LEe,circIn:dj,circInOut:FEe,circOut:m4,backIn:y4,backInOut:BEe,backOut:fj,anticipate:zEe},yO=e=>{if(Array.isArray(e)){g4(e.length===4);const[t,n,r,i]=e;return Km(t,n,r,i)}else if(typeof e=="string")return UEe[e];return e},v4=(e,t)=>n=>!!(qm(n)&&z5e.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),hj=(e,t,n)=>r=>{if(!qm(r))return r;const[i,o,s,a]=r.match(GS);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},jEe=e=>Su(0,255,e),Uw={...od,transform:e=>Math.round(jEe(e))},fc={test:v4("rgb","red"),parse:hj("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Uw.transform(e)+", "+Uw.transform(t)+", "+Uw.transform(n)+", "+Ap(Tp.transform(r))+")"};function VEe(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 P3={test:v4("#"),parse:VEe,transform:fc.transform},Wd={test:v4("hsl","hue"),parse:hj("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pa.transform(Ap(t))+", "+pa.transform(Ap(n))+", "+Ap(Tp.transform(r))+")"},Gi={test:e=>fc.test(e)||P3.test(e)||Wd.test(e),parse:e=>fc.test(e)?fc.parse(e):Wd.test(e)?Wd.parse(e):P3.parse(e),transform:e=>qm(e)?e:e.hasOwnProperty("red")?fc.transform(e):Wd.transform(e)},nr=(e,t,n)=>-n*e+n*t+e;function jw(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 GEe({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=jw(l,a,e+1/3),o=jw(l,a,e),s=jw(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}const Vw=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},HEe=[P3,fc,Wd],qEe=e=>HEe.find(t=>t.test(e));function vO(e){const t=qEe(e);let n=t.parse(e);return t===Wd&&(n=GEe(n)),n}const pj=(e,t)=>{const n=vO(e),r=vO(t),i={...n};return o=>(i.red=Vw(n.red,r.red,o),i.green=Vw(n.green,r.green,o),i.blue=Vw(n.blue,r.blue,o),i.alpha=nr(n.alpha,r.alpha,o),fc.transform(i))};function WEe(e){var t,n;return isNaN(e)&&qm(e)&&(((t=e.match(GS))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(zU))===null||n===void 0?void 0:n.length)||0)>0}const gj={regex:F5e,countKey:"Vars",token:"${v}",parse:cr},mj={regex:zU,countKey:"Colors",token:"${c}",parse:Gi.parse},yj={regex:GS,countKey:"Numbers",token:"${n}",parse:od.parse};function Gw(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 $1(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Gw(n,gj),Gw(n,mj),Gw(n,yj),n}function vj(e){return $1(e).values}function _j(e){const{values:t,numColors:n,numVars:r,tokenised:i}=$1(e),o=t.length;return s=>{let a=i;for(let l=0;l<o;l++)l<r?a=a.replace(gj.token,s[l]):l<r+n?a=a.replace(mj.token,Gi.transform(s[l])):a=a.replace(yj.token,Ap(s[l]));return a}}const KEe=e=>typeof e=="number"?0:e;function XEe(e){const t=vj(e);return _j(e)(t.map(KEe))}const wu={test:WEe,parse:vj,createTransformer:_j,getAnimatableNone:XEe},bj=(e,t)=>n=>`${n>0?t:e}`;function Sj(e,t){return typeof e=="number"?n=>nr(e,t,n):Gi.test(e)?pj(e,t):e.startsWith("var(")?bj(e,t):xj(e,t)}const wj=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,s)=>Sj(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}},QEe=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Sj(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},xj=(e,t)=>{const n=wu.createTransformer(t),r=$1(e),i=$1(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?ou(wj(r.values,i.values),n):bj(e,t)},Yg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},_O=(e,t)=>n=>nr(e,t,n);function YEe(e){return typeof e=="number"?_O:typeof e=="string"?Gi.test(e)?pj:xj:Array.isArray(e)?wj:typeof e=="object"?QEe:_O}function ZEe(e,t,n){const r=[],i=n||YEe(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]||cr:t;a=ou(l,a)}r.push(a)}return r}function Cj(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(g4(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=ZEe(t,r,i),a=s.length,l=u=>{let c=0;if(a>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=Yg(e[c],e[c+1],u);return s[c](d)};return n?u=>l(Su(e[0],e[o-1],u)):l}function JEe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Yg(0,t,r);e.push(nr(n,1,i))}}function eTe(e){const t=[0];return JEe(t,e.length-1),t}function tTe(e,t){return e.map(n=>n*t)}function nTe(e,t){return e.map(()=>t||lj).splice(0,e.length-1)}function F1({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=$Ee(r)?r.map(yO):yO(r),o={done:!1,value:t[0]},s=tTe(n&&n.length===t.length?n:eTe(t),e),a=Cj(s,t,{ease:Array.isArray(i)?i:nTe(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}function Ej(e,t){return t?e*(1e3/t):0}const rTe=5;function Tj(e,t,n){const r=Math.max(t-rTe,0);return Ej(n-e(r),t-r)}const Hw=.001,iTe=.01,bO=10,oTe=.05,sTe=1;function aTe({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;kEe(e<=su(bO));let s=1-t;s=Su(oTe,sTe,s),e=Su(iTe,bO,Za(e)),s<1?(i=u=>{const c=u*s,d=c*e,f=c-n,h=R3(u,s),p=Math.exp(-d);return Hw-f/h*p},o=u=>{const d=u*s*e,f=d*n+n,h=Math.pow(s,2)*Math.pow(u,2)*e,p=Math.exp(-d),m=R3(Math.pow(u,2),s);return(-i(u)+Hw>0?-1:1)*((f-h)*p)/m}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Hw+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=uTe(i,o,a);if(e=su(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const lTe=12;function uTe(e,t,n){let r=n;for(let i=1;i<lTe;i++)r=r-e(r)/t(r);return r}function R3(e,t){return e*Math.sqrt(1-t*t)}const cTe=["duration","bounce"],dTe=["stiffness","damping","mass"];function SO(e,t){return t.some(n=>e[n]!==void 0)}function fTe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!SO(e,dTe)&&SO(e,cTe)){const n=aTe(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function Aj({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=fTe(r),h=c?-Za(c):0,p=l/(2*Math.sqrt(a*u)),m=o-i,b=Za(Math.sqrt(a/u)),_=Math.abs(m)<5;n||(n=_?.01:2),t||(t=_?.005:.5);let y;if(p<1){const g=R3(b,p);y=v=>{const S=Math.exp(-p*b*v);return o-S*((h+p*b*m)/g*Math.sin(g*v)+m*Math.cos(g*v))}}else if(p===1)y=g=>o-Math.exp(-b*g)*(m+(h+b*m)*g);else{const g=b*Math.sqrt(p*p-1);y=v=>{const S=Math.exp(-p*b*v),w=Math.min(g*v,300);return o-S*((h+p*b*m)*Math.sinh(w)+g*m*Math.cosh(w))/g}}return{calculatedDuration:f&&d||null,next:g=>{const v=y(g);if(f)s.done=g>=d;else{let S=h;g!==0&&(p<1?S=Tj(y,g,v):S=0);const w=Math.abs(S)<=n,x=Math.abs(o-v)<=t;s.done=w&&x}return s.value=s.done?o:v,s}}}function wO({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=C=>a!==void 0&&C<a||l!==void 0&&C>l,p=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l;let m=n*t;const b=d+m,_=s===void 0?b:s(b);_!==b&&(m=_-d);const y=C=>-m*Math.exp(-C/r),g=C=>_+y(C),v=C=>{const A=y(C),T=g(C);f.done=Math.abs(A)<=u,f.value=f.done?_:T};let S,w;const x=C=>{h(f.value)&&(S=C,w=Aj({keyframes:[f.value,p(f.value)],velocity:Tj(g,C,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:C=>{let A=!1;return!w&&S===void 0&&(A=!0,v(C),x(C)),S!==void 0&&C>S?w.next(C-S):(!A&&v(C),f)}}}const hTe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Tn.update(t,!0),stop:()=>ll(t),now:()=>Ri.isProcessing?Ri.timestamp:performance.now()}},xO=2e4;function CO(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<xO;)t+=n,r=e.next(t);return t>=xO?1/0:t}const pTe={decay:wO,inertia:wO,tween:F1,keyframes:F1,spring:Aj};function B1({autoplay:e=!0,delay:t=0,driver:n=hTe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,p=!1,m,b;const _=()=>{b=new Promise(F=>{m=F})};_();let y;const g=pTe[i]||F1;let v;g!==F1&&typeof r[0]!="number"&&(v=Cj([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 x="idle",C=null,A=null,T=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=CO(S));const{calculatedDuration:k}=S;let L=1/0,N=1/0;k!==null&&(L=k+s,N=L*(o+1)-s);let E=0;const P=F=>{if(A===null)return;h>0&&(A=Math.min(A,F)),h<0&&(A=Math.min(F-N/h,A)),C!==null?E=C:E=Math.round(F-A)*h;const U=E-t*(h>=0?1:-1),V=h>=0?U<0:U>N;E=Math.max(U,0),x==="finished"&&C===null&&(E=N);let H=E,Y=S;if(o){const ee=E/L;let ie=Math.floor(ee),ge=ee%1;!ge&&ee>=1&&(ge=1),ge===1&&ie--,ie=Math.min(ie,o+1);const ae=!!(ie%2);ae&&(a==="reverse"?(ge=1-ge,s&&(ge-=s/L)):a==="mirror"&&(Y=w));let dt=Su(0,1,ge);E>N&&(dt=a==="reverse"&&ae?1:0),H=dt*L}const Q=V?{done:!1,value:r[0]}:Y.next(H);v&&(Q.value=v(Q.value));let{done:j}=Q;!V&&k!==null&&(j=h>=0?E>=N:E<=0);const K=C===null&&(x==="finished"||x==="running"&&j);return d&&d(Q.value),K&&R(),Q},D=()=>{y&&y.stop(),y=void 0},B=()=>{x="idle",D(),m(),_(),A=T=null},R=()=>{x="finished",c&&c(),D(),m()},O=()=>{if(p)return;y||(y=n(P));const F=y.now();l&&l(),C!==null?A=F-C:(!A||x==="finished")&&(A=F),x==="finished"&&_(),T=A,C=null,x="running",y.start()};e&&O();const I={then(F,U){return b.then(F,U)},get time(){return Za(E)},set time(F){F=su(F),E=F,C!==null||!y||h===0?C=F:A=y.now()-F/h},get duration(){const F=S.calculatedDuration===null?CO(S):S.calculatedDuration;return Za(F)},get speed(){return h},set speed(F){F===h||!y||(h=F,I.time=Za(E))},get state(){return x},play:O,pause:()=>{x="paused",C=E},stop:()=>{p=!0,x!=="idle"&&(x="idle",u&&u(),B())},cancel:()=>{T!==null&&P(T),B()},complete:()=>{x="finished"},sample:F=>(A=0,P(F))};return I}function gTe(e){let t;return()=>(t===void 0&&(t=e()),t)}const mTe=gTe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yTe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),c0=10,vTe=2e4,_Te=(e,t)=>t.type==="spring"||e==="backgroundColor"||!ij(t.ease);function bTe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(mTe()&&yTe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let s=!1,a,l;const u=()=>{l=new Promise(y=>{a=y})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(_Te(t,i)){const y=B1({...i,repeat:0,delay:0});let g={done:!1,value:c[0]};const v=[];let S=0;for(;!g.done&&S<vTe;)g=y.sample(S),v.push(g.value),S+=c0;h=void 0,c=v,d=S-c0,f="linear"}const p=REe(e.owner.current,t,c,{...i,duration:d,ease:f,times:h}),m=()=>p.cancel(),b=()=>{Tn.update(m),a(),u()};return p.onfinish=()=>{e.set(OEe(c,i)),r&&r(),b()},{then(y,g){return l.then(y,g)},attachTimeline(y){return p.timeline=y,p.onfinish=null,cr},get time(){return Za(p.currentTime||0)},set time(y){p.currentTime=su(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return Za(d)},play:()=>{s||(p.play(),ll(m))},pause:()=>p.pause(),stop:()=>{if(s=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const g=B1({...i,autoplay:!1});e.setWithVelocity(g.sample(y-c0).value,g.sample(y).value,c0)}b()},complete:()=>p.finish(),cancel:b}}function STe({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:cr,pause:cr,stop:cr,then:o=>(o(),Promise.resolve()),cancel:cr,complete:cr});return t?B1({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const wTe={type:"spring",stiffness:500,damping:25,restSpeed:10},xTe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),CTe={type:"keyframes",duration:.8},ETe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},TTe=(e,{keyframes:t})=>t.length>2?CTe:id.has(e)?e.startsWith("scale")?xTe(t[1]):wTe:ETe,O3=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(wu.test(t)||t==="0")&&!t.startsWith("url(")),ATe=new Set(["brightness","contrast","saturate","opacity"]);function kTe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(GS)||[];if(!r)return e;const i=n.replace(r,"");let o=ATe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const PTe=/([a-z-]*)\(.*?\)/g,I3={...wu,getAnimatableNone:e=>{const t=e.match(PTe);return t?t.map(kTe).join(" "):e}},RTe={...UU,color:Gi,backgroundColor:Gi,outlineColor:Gi,fill:Gi,stroke:Gi,borderColor:Gi,borderTopColor:Gi,borderRightColor:Gi,borderBottomColor:Gi,borderLeftColor:Gi,filter:I3,WebkitFilter:I3},_4=e=>RTe[e];function kj(e,t){let n=_4(e);return n!==I3&&(n=wu),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Pj=e=>/^0[^.\s]+$/.test(e);function OTe(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||Pj(e)}function ITe(e,t,n,r){const i=O3(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const s=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?s:o[u-1]),OTe(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(a=o[u]);if(i&&l.length&&a)for(let u=0;u<l.length;u++){const c=l[u];o[c]=kj(t,a)}return o}function MTe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Rj(e,t){return e[t]||e.default||e}const b4=(e,t,n,r={})=>i=>{const o=Rj(r,e)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a=a-su(s);const l=ITe(t,e,n,o),u=l[0],c=l[l.length-1],d=O3(e,u),f=O3(e,c);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(MTe(o)||(h={...h,...TTe(e,h)}),h.duration&&(h.duration=su(h.duration)),h.repeatDelay&&(h.repeatDelay=su(h.repeatDelay)),!d||!f||PEe.current||o.type===!1)return STe(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=bTe(t,e,h);if(p)return p}return B1(h)};function z1(e){return!!(vo(e)&&e.add)}const Oj=e=>/^\-?\d*\.?\d+$/.test(e);function S4(e,t){e.indexOf(t)===-1&&e.push(t)}function w4(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class x4{constructor(){this.subscriptions=[]}add(t){return S4(this.subscriptions,t),()=>w4(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 NTe=e=>!isNaN(parseFloat(e));class DTe{constructor(t,n={}){this.version="10.16.1",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}=Ri;this.lastUpdated!==s&&(this.timeDelta=o,this.lastUpdated=s,Tn.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=()=>Tn.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=NTe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new x4);const r=this.events[t].add(n);return t==="change"?()=>{r(),Tn.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?Ej(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 Qf(e,t){return new DTe(e,t)}const Ij=e=>t=>t.test(e),LTe={test:e=>e==="auto",parse:e=>e},Mj=[od,tt,pa,Tl,j5e,U5e,LTe],Kh=e=>Mj.find(Ij(e)),$Te=[...Mj,Gi,wu],FTe=e=>$Te.find(Ij(e));function BTe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qf(n))}function zTe(e,t){const n=qS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const s in o){const a=nEe(o[s]);BTe(e,s,a)}}function UTe(e,t,n){var r,i;const o=Object.keys(t).filter(a=>!e.hasValue(a)),s=o.length;if(s)for(let a=0;a<s;a++){const l=o[a],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(Oj(c)||Pj(c))?c=parseFloat(c):!FTe(c)&&wu.test(u)&&(c=kj(l,u)),e.addValue(l,Qf(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function jTe(e,t){return t?(t[e]||t.default||t).from:void 0}function VTe(e,t,n){const r={};for(const i in e){const o=jTe(i,t);if(o!==void 0)r[i]=o;else{const s=n.getValue(i);s&&(r[i]=s.get())}}return r}function GTe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Nj(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],c=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||c&&GTe(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const b=e.getProps()[AEe];b&&(p.elapsed=window.HandoffAppearAnimations(b,d,f,Tn))}f.start(b4(d,f,h,e.shouldReduceMotion&&id.has(d)?{type:!1}:p));const m=f.animation;z1(l)&&(l.add(d),m.then(()=>l.remove(d))),u.push(m)}return s&&Promise.all(u).then(()=>{s&&zTe(e,s)}),u}function M3(e,t,n={}){const r=qS(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Nj(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return HTe(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[o,s]:[s,o];return l().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function HTe(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(qTe).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(M3(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function qTe(e,t){return e.sortNodePosition(t)}function WTe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>M3(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=M3(e,t,n);else{const i=typeof t=="function"?qS(e,t,n.custom):t;r=Promise.all(Nj(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const KTe=[...i4].reverse(),XTe=i4.length;function QTe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>WTe(e,n,r)))}function YTe(e){let t=QTe(e);const n=JTe();let r=!0;const i=(l,u)=>{const c=qS(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function o(l){t=l(e)}function s(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},m=1/0;for(let _=0;_<XTe;_++){const y=KTe[_],g=n[y],v=c[y]!==void 0?c[y]:d[y],S=Xg(v),w=y===u?g.isActive:null;w===!1&&(m=_);let x=v===d[y]&&v!==c[y]&&S;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...p},!g.isActive&&w===null||!v&&!g.prevProp||jS(v)||typeof v=="boolean")continue;const C=ZTe(g.prevProp,v);let A=C||y===u&&g.isActive&&!x&&S||_>m&&S;const T=Array.isArray(v)?v:[v];let k=T.reduce(i,{});w===!1&&(k={});const{prevResolvedValues:L={}}=g,N={...L,...k},E=P=>{A=!0,h.delete(P),g.needsAnimating[P]=!0};for(const P in N){const D=k[P],B=L[P];p.hasOwnProperty(P)||(D!==B?L1(D)&&L1(B)?!nj(D,B)||C?E(P):g.protectedKeys[P]=!0:D!==void 0?E(P):h.add(P):D!==void 0&&h.has(P)?E(P):g.protectedKeys[P]=!0)}g.prevProp=v,g.prevResolvedValues=k,g.isActive&&(p={...p,...k}),r&&e.blockInitialAnimation&&(A=!1),A&&!x&&f.push(...T.map(P=>({animation:P,options:{type:y,...l}})))}if(h.size){const _={};h.forEach(y=>{const g=e.getBaseTarget(y);g!==void 0&&(_[y]=g)}),f.push({animation:_})}let b=!!f.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function a(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=s(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n}}function ZTe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nj(t,e):!1}function qu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function JTe(){return{animate:qu(!0),whileInView:qu(),whileHover:qu(),whileTap:qu(),whileDrag:qu(),whileFocus:qu(),exit:qu()}}class e4e extends Bu{constructor(t){super(t),t.animationState||(t.animationState=YTe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jS(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 t4e=0;class n4e extends Bu{constructor(){super(...arguments),this.id=t4e++}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 r4e={animation:{Feature:e4e},exit:{Feature:n4e}},EO=(e,t)=>Math.abs(e-t);function i4e(e,t){const n=EO(e.x,t.x),r=EO(e.y,t.y);return Math.sqrt(n**2+r**2)}class Dj{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Ww(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=i4e(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=Ri;this.history.push({...f,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=qw(c,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=Ww(u.type==="pointercancel"?this.lastMoveEventInfo:qw(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!YU(t))return;this.handlers=n,this.transformPagePoint=r;const i=HS(t),o=qw(i,this.transformPagePoint),{point:s}=o,{timestamp:a}=Ri;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,Ww(o,this.history)),this.removeListeners=ou(Ya(window,"pointermove",this.handlePointerMove),Ya(window,"pointerup",this.handlePointerUp),Ya(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ll(this.updatePoint)}}function qw(e,t){return t?{point:t(e.point)}:e}function TO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ww({point:e},t){return{point:e,delta:TO(e,Lj(t)),offset:TO(e,o4e(t)),velocity:s4e(t,.1)}}function o4e(e){return e[0]}function Lj(e){return e[e.length-1]}function s4e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Lj(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>su(t)));)n--;if(!r)return{x:0,y:0};const o=Za(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 Do(e){return e.max-e.min}function N3(e,t=0,n=.01){return Math.abs(e-t)<=n}function AO(e,t,n,r=.5){e.origin=r,e.originPoint=nr(t.min,t.max,e.origin),e.scale=Do(n)/Do(t),(N3(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=nr(n.min,n.max,e.origin)-e.originPoint,(N3(e.translate)||isNaN(e.translate))&&(e.translate=0)}function kp(e,t,n,r){AO(e.x,t.x,n.x,r?r.originX:void 0),AO(e.y,t.y,n.y,r?r.originY:void 0)}function kO(e,t,n){e.min=n.min+t.min,e.max=e.min+Do(t)}function a4e(e,t,n){kO(e.x,t.x,n.x),kO(e.y,t.y,n.y)}function PO(e,t,n){e.min=t.min-n.min,e.max=e.min+Do(t)}function Pp(e,t,n){PO(e.x,t.x,n.x),PO(e.y,t.y,n.y)}function l4e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?nr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?nr(n,e,r.max):Math.min(e,n)),e}function RO(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 u4e(e,{top:t,left:n,bottom:r,right:i}){return{x:RO(e.x,n,i),y:RO(e.y,t,r)}}function OO(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 c4e(e,t){return{x:OO(e.x,t.x),y:OO(e.y,t.y)}}function d4e(e,t){let n=.5;const r=Do(e),i=Do(t);return i>r?n=Yg(t.min,t.max-r,e.min):r>i&&(n=Yg(e.min,e.max-i,t.min)),Su(0,1,n)}function f4e(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 D3=.35;function h4e(e=D3){return e===!1?e=0:e===!0&&(e=D3),{x:IO(e,"left","right"),y:IO(e,"top","bottom")}}function IO(e,t,n){return{min:MO(e,t),max:MO(e,n)}}function MO(e,t){return typeof e=="number"?e:e[t]||0}const NO=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kd=()=>({x:NO(),y:NO()}),DO=()=>({min:0,max:0}),Tr=()=>({x:DO(),y:DO()});function Ks(e){return[e("x"),e("y")]}function $j({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function p4e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g4e(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 Kw(e){return e===void 0||e===1}function L3({scale:e,scaleX:t,scaleY:n}){return!Kw(e)||!Kw(t)||!Kw(n)}function Zu(e){return L3(e)||Fj(e)||e.z||e.rotate||e.rotateX||e.rotateY}function Fj(e){return LO(e.x)||LO(e.y)}function LO(e){return e&&e!=="0%"}function U1(e,t,n){const r=e-n,i=t*r;return n+i}function $O(e,t,n,r,i){return i!==void 0&&(e=U1(e,i,r)),U1(e,n,r)+t}function $3(e,t=0,n=1,r,i){e.min=$O(e.min,t,n,r,i),e.max=$O(e.max,t,n,r,i)}function Bj(e,{x:t,y:n}){$3(e.x,t.translate,t.scale,t.originPoint),$3(e.y,n.translate,n.scale,n.originPoint)}function m4e(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&&Xd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Bj(e,s)),r&&Zu(o.latestValues)&&Xd(e,o.latestValues))}t.x=FO(t.x),t.y=FO(t.y)}function FO(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Ol(e,t){e.min=e.min+t,e.max=e.max+t}function BO(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,s=nr(e.min,e.max,o);$3(e,t[n],t[r],s,t.scale)}const y4e=["x","scaleX","originX"],v4e=["y","scaleY","originY"];function Xd(e,t){BO(e.x,t,y4e),BO(e.y,t,v4e)}function zj(e,t){return $j(g4e(e.getBoundingClientRect(),t))}function _4e(e,t,n){const r=zj(e,n),{scroll:i}=t;return i&&(Ol(r.x,i.offset.x),Ol(r.y,i.offset.y)),r}const b4e=new WeakMap;class S4e{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=Tr(),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(HS(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=JU(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ks(p=>{let m=this.getAxisMotionValue(p).get()||0;if(pa.test(m)){const{projection:b}=this.visualElement;if(b&&b.layout){const _=b.layout.layoutBox[p];_&&(m=Do(_)*(parseFloat(m)/100))}}this.originPoint[p]=m}),f&&Tn.update(()=>f(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},s=(l,u)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(d&&this.currentDirection===null){this.currentDirection=w4e(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new Dj(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Tn.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||!d0(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=l4e(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&qd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=u4e(r.layoutBox,t):this.constraints=!1,this.elastic=h4e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ks(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=f4e(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!qd(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=_4e(r,i.root,this.visualElement.getTransformPagePoint());let s=c4e(i.layout.layoutBox,o);if(n){const a=n(p4e(s));this.hasMutatedConstraints=!!a,a&&(s=$j(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ks(c=>{if(!d0(c,n,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(b4(t,r,0,n))}stopAnimation(){Ks(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){Ks(n=>{const{drag:r}=this.getProps();if(!d0(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]-nr(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!qd(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ks(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();i[s]=d4e({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(),Ks(s=>{if(!d0(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];a.set(nr(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;b4e.set(this.visualElement,this);const t=this.visualElement.current,n=Ya(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();qd(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=qa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ks(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].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=D3,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function d0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function w4e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class x4e extends Bu{constructor(t){super(t),this.removeGroupControls=cr,this.removeListeners=cr,this.controls=new S4e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const zO=e=>(t,n)=>{e&&Tn.update(()=>e(t,n))};class C4e extends Bu{constructor(){super(...arguments),this.removePointerDownListener=cr}onPointerDown(t){this.session=new Dj(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:zO(t),onStart:zO(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Tn.update(()=>i(o,s))}}}mount(){this.removePointerDownListener=Ya(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 E4e(){const e=M.useContext(Gm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=M.useId();return M.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function FMe(){return T4e(M.useContext(Gm))}function T4e(e){return e===null?!0:e.isPresent}const Y0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function UO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Xh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(tt.test(e))e=parseFloat(e);else return e;const n=UO(e,t.target.x),r=UO(e,t.target.y);return`${n}% ${r}%`}},A4e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=wu.parse(e);if(i.length>5)return r;const o=wu.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const u=nr(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),o(i)}};class k4e extends yn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;N5e(P4e),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()})),Y0.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()||Tn.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 Uj(e){const[t,n]=E4e(),r=M.useContext(s4);return yn.createElement(k4e,{...e,layoutGroup:r,switchLayoutGroup:M.useContext(LU),isPresent:t,safeToRemove:n})}const P4e={borderRadius:{...Xh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xh,borderTopRightRadius:Xh,borderBottomLeftRadius:Xh,borderBottomRightRadius:Xh,boxShadow:A4e},jj=["TopLeft","TopRight","BottomLeft","BottomRight"],R4e=jj.length,jO=e=>typeof e=="string"?parseFloat(e):e,VO=e=>typeof e=="number"||tt.test(e);function O4e(e,t,n,r,i,o){i?(e.opacity=nr(0,n.opacity!==void 0?n.opacity:1,I4e(r)),e.opacityExit=nr(t.opacity!==void 0?t.opacity:1,0,M4e(r))):o&&(e.opacity=nr(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<R4e;s++){const a=`border${jj[s]}Radius`;let l=GO(t,a),u=GO(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||VO(l)===VO(u)?(e[a]=Math.max(nr(jO(l),jO(u),r),0),(pa.test(u)||pa.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=nr(t.rotate||0,n.rotate||0,r))}function GO(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const I4e=Vj(0,.5,m4),M4e=Vj(.5,.95,cr);function Vj(e,t,n){return r=>r<e?0:r>t?1:n(Yg(e,t,r))}function HO(e,t){e.min=t.min,e.max=t.max}function Vo(e,t){HO(e.x,t.x),HO(e.y,t.y)}function qO(e,t,n,r,i){return e-=t,e=U1(e,1/n,r),i!==void 0&&(e=U1(e,1/i,r)),e}function N4e(e,t=0,n=1,r=.5,i,o=e,s=e){if(pa.test(t)&&(t=parseFloat(t),t=nr(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=nr(o.min,o.max,r);e===o&&(a-=t),e.min=qO(e.min,t,n,a,i),e.max=qO(e.max,t,n,a,i)}function WO(e,t,[n,r,i],o,s){N4e(e,t[n],t[r],t[i],t.scale,o,s)}const D4e=["x","scaleX","originX"],L4e=["y","scaleY","originY"];function KO(e,t,n,r){WO(e.x,t,D4e,n?n.x:void 0,r?r.x:void 0),WO(e.y,t,L4e,n?n.y:void 0,r?r.y:void 0)}function XO(e){return e.translate===0&&e.scale===1}function Gj(e){return XO(e.x)&&XO(e.y)}function $4e(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 Hj(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 QO(e){return Do(e.x)/Do(e.y)}class F4e{constructor(){this.members=[]}add(t){S4(this.members,t),t.scheduleRender()}remove(t){if(w4(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 YO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const s=e.x.scale*t.x,a=e.y.scale*t.y;return(s!==1||a!==1)&&(r+=`scale(${s}, ${a})`),r||"none"}const B4e=(e,t)=>e.depth-t.depth;class z4e{constructor(){this.children=[],this.isDirty=!1}add(t){S4(this.children,t),this.isDirty=!0}remove(t){w4(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(B4e),this.isDirty=!1,this.children.forEach(t)}}function U4e(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(ll(r),e(o-t))};return Tn.read(r,!0),()=>ll(r)}function j4e(e){window.MotionDebug&&window.MotionDebug.record(e)}function V4e(e){return e instanceof SVGElement&&e.tagName!=="svg"}function G4e(e,t,n){const r=vo(e)?e:Qf(e);return r.start(b4("",r,t,n)),r.animation}const ZO=["","X","Y","Z"],JO=1e3;let H4e=0;const Ju={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function qj({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=H4e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Ju.totalNodes=Ju.resolvedTargetDeltas=Ju.recalculatedProjection=0,this.nodes.forEach(K4e),this.nodes.forEach(J4e),this.nodes.forEach(eAe),this.nodes.forEach(X4e),j4e(Ju)},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 z4e)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new x4),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=V4e(s),this.instance=s;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=U4e(f,250),Y0.hasAnimatedSinceResize&&(Y0.hasAnimatedSinceResize=!1,this.nodes.forEach(tI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||oAe,{onLayoutAnimationStart:b,onLayoutAnimationComplete:_}=c.getProps(),y=!this.targetLayout||!Hj(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 v={...Rj(m,"layout"),onPlay:b,onComplete:_};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else f||tI(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,ll(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(tAe),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 c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(eI);return}this.isUpdating||this.nodes.forEach(Y4e),this.isUpdating=!1,this.nodes.forEach(Z4e),this.nodes.forEach(q4e),this.nodes.forEach(W4e),this.clearAllSnapshots();const a=performance.now();Ri.delta=Su(0,1e3/60,a-Ri.timestamp),Ri.timestamp=a,Ri.isProcessing=!0,Fw.update.process(Ri),Fw.preRender.process(Ri),Fw.render.process(Ri),Ri.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Q4e),this.sharedNodes.forEach(nAe)}scheduleUpdateProjection(){Tn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Tn.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=Tr(),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&&!Gj(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(a||Zu(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),sAe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Tr();const a=s.measureViewportBox(),{scroll:l}=this.root;return l&&(Ol(a.x,l.offset.x),Ol(a.y,l.offset.y)),a}removeElementScroll(s){const a=Tr();Vo(a,s);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:d}=u;if(u!==this.root&&c&&d.layoutScroll){if(c.isRoot){Vo(a,s);const{scroll:f}=this.root;f&&(Ol(a.x,-f.offset.x),Ol(a.y,-f.offset.y))}Ol(a.x,c.offset.x),Ol(a.y,c.offset.y)}}return a}applyTransform(s,a=!1){const l=Tr();Vo(l,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Xd(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Zu(c.latestValues)&&Xd(l,c.latestValues)}return Zu(this.latestValues)&&Xd(l,this.latestValues),l}removeTransform(s){const a=Tr();Vo(a,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Zu(u.latestValues))continue;L3(u.latestValues)&&u.updateSnapshot();const c=Tr(),d=u.measurePageBox();Vo(c,d),KO(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Zu(this.latestValues)&&KO(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!==Ri.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Ri.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tr(),this.relativeTargetOrigin=Tr(),Pp(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Vo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Tr(),this.targetWithTransforms=Tr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a4e(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vo(this.target,this.layout.layoutBox),Bj(this.target,this.targetDelta)):Vo(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=Tr(),this.relativeTargetOrigin=Tr(),Pp(this.relativeTargetOrigin,this.target,h.target),Vo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ju.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||L3(this.parent.latestValues)||Fj(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ri.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Vo(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;m4e(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=Kd(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Kd(),this.projectionDeltaWithTransform=Kd());const m=this.projectionTransform;kp(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=YO(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Ju.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(s,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Kd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Tr(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,b=this.getStack(),_=!b||b.members.length<=1,y=!!(m&&!_&&this.options.crossfade===!0&&!this.path.some(iAe));this.animationProgress=0;let g;this.mixTargetDelta=v=>{const S=v/1e3;nI(d.x,s.x,S),nI(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pp(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rAe(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&$4e(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Tr()),Vo(g,this.relativeTarget)),m&&(this.animationValues=c,O4e(c,u,this.latestValues,S,y,_)),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&&(ll(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tn.update(()=>{Y0.hasAnimatedSinceResize=!0,this.currentAnimation=G4e(0,JO,{...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(JO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=s;if(!(!a||!l||!u)){if(this!==s&&this.layout&&u&&Wj(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Tr();const d=Do(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Do(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Vo(a,l),Xd(a,c),kp(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new F4e),this.sharedNodes.get(s).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c<ZO.length;c++){const d="rotate"+ZO[c];l[d]&&(u[d]=l[d],s.setStaticValue(d,0))}s.render();for(const c in u)s.setStaticValue(c,u[c]);s.scheduleRender()}getProjectionStyles(s={}){var a,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Q0(s.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;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=Q0(s.pointerEvents)||""),this.hasProjected&&!Zu(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=YO(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in N1){if(f[m]===void 0)continue;const{correct:b,applyTo:_}=N1[m],y=u.transform==="none"?f[m]:b(f[m],d);if(_){const g=_.length;for(let v=0;v<g;v++)u[_[v]]=y}else u[m]=y}return this.options.layoutId&&(u.pointerEvents=d===this?Q0(s.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(eI),this.root.sharedNodes.clear()}}}function q4e(e){e.updateLayout()}function W4e(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"?Ks(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=Do(f);f.min=r[d].min,f.max=f.min+h}):Wj(o,n.layoutBox,r)&&Ks(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=Do(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=Kd();kp(a,r,n.layoutBox);const l=Kd();s?kp(l,e.applyTransform(i,!0),n.measuredBox):kp(l,r,n.layoutBox);const u=!Gj(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=Tr();Pp(p,n.layoutBox,f.layoutBox);const m=Tr();Pp(m,r,h.layoutBox),Hj(p,m)||(c=!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:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function K4e(e){Ju.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 X4e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Q4e(e){e.clearSnapshot()}function eI(e){e.clearMeasurements()}function Y4e(e){e.isLayoutDirty=!1}function Z4e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function J4e(e){e.resolveTargetDelta()}function eAe(e){e.calcProjection()}function tAe(e){e.resetRotation()}function nAe(e){e.removeLeadSnapshot()}function nI(e,t,n){e.translate=nr(t.translate,0,n),e.scale=nr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rI(e,t,n,r){e.min=nr(t.min,n.min,r),e.max=nr(t.max,n.max,r)}function rAe(e,t,n,r){rI(e.x,t.x,n.x,r),rI(e.y,t.y,n.y,r)}function iAe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const oAe={duration:.45,ease:[.4,0,.1,1]},iI=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),oI=iI("applewebkit/")&&!iI("chrome/")?Math.round:cr;function sI(e){e.min=oI(e.min),e.max=oI(e.max)}function sAe(e){sI(e.x),sI(e.y)}function Wj(e,t,n){return e==="position"||e==="preserve-aspect"&&!N3(QO(t),QO(n),.2)}const aAe=qj({attachResizeListener:(e,t)=>qa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xw={current:void 0},Kj=qj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xw.current){const e=new aAe({});e.mount(window),e.setOptions({layoutScroll:!0}),Xw.current=e}return Xw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lAe={pan:{Feature:C4e},drag:{Feature:x4e,ProjectionNode:Kj,MeasureLayout:Uj}},uAe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function cAe(e){const t=uAe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function F3(e,t,n=1){const[r,i]=cAe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return Oj(s)?parseFloat(s):s}else return A3(i)?F3(i,t,n+1):i}function dAe(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(!A3(o))return;const s=F3(o,r);s&&i.set(s)});for(const i in t){const o=t[i];if(!A3(o))continue;const s=F3(o,r);s&&(t[i]=s,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const fAe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Xj=e=>fAe.has(e),hAe=e=>Object.keys(e).some(Xj),aI=e=>e===od||e===tt,lI=(e,t)=>parseFloat(e.split(", ")[t]),uI=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return lI(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?lI(o[1],e):0}},pAe=new Set(["x","y","z"]),gAe=Hm.filter(e=>!pAe.has(e));function mAe(e){const t=[];return gAe.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 Yf={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:uI(4,13),y:uI(5,14)};Yf.translateX=Yf.x;Yf.translateY=Yf.y;const yAe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:s}=o,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{a[u]=Yf[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(a[u]),e[u]=Yf[u](l,o)}),e},vAe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(Xj);let o=[],s=!1;const a=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=Kh(c);const f=t[l];let h;if(L1(f)){const p=f.length,m=f[0]===null?1:0;c=f[m],d=Kh(c);for(let b=m;b<p&&f[b]!==null;b++)h?g4(Kh(f[b])===h):h=Kh(f[b])}else h=Kh(f);if(d!==h)if(aI(d)&&aI(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===tt&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(c===0||f===0)?c===0?u.set(h.transform(c)):t[l]=d.transform(f):(s||(o=mAe(e),s=!0),a.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(f))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,u=yAe(t,e,a);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),US&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function _Ae(e,t,n,r){return hAe(t)?vAe(e,t,n,r):{target:t,transitionEnd:r}}const bAe=(e,t,n,r)=>{const i=dAe(e,t,r);return t=i.target,r=i.transitionEnd,_Ae(e,t,n,r)},B3={current:null},Qj={current:!1};function SAe(){if(Qj.current=!0,!!US)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>B3.current=e.matches;e.addListener(t),t()}else B3.current=!1}function wAe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],s=n[i];if(vo(o))e.addValue(i,o),z1(r)&&r.add(i);else if(vo(s))e.addValue(i,Qf(o,{owner:e})),z1(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,Qf(a!==void 0?a:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const cI=new WeakMap,Yj=Object.keys(Qg),xAe=Yj.length,dI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],CAe=o4.length;class EAe{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=()=>Tn.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=VS(n),this.isVariantNode=DU(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const f=c[d];a[d]!==void 0&&vo(f)&&(f.set(a[d],!1),z1(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,cI.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)),Qj.current||SAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:B3.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){cI.delete(this.current),this.projection&&this.projection.unmount(),ll(this.notifyUpdate),ll(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=id.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Tn.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<xAe;l++){const u=Yj[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=Qg[u];f&&(s=f),c(n)&&(!this.features[u]&&d&&(this.features[u]=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:u,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&qd(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"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):Tr()}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<dI.length;r++){const i=dI[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=wAe(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<CAe;r++){const i=o4[r],o=this.props[i];(Xg(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=Qf(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=p4(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&&!vo(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 x4),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Zj extends EAe{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=VTe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),s&&(s=i(s))),o){UTe(this,r,s);const a=bAe(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function TAe(e){return window.getComputedStyle(e)}class AAe extends Zj{readValueFromInstance(t,n){if(id.has(n)){const r=_4(n);return r&&r.default||0}else{const r=TAe(t),i=(BU(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zj(t,n)}build(t,n,r,i){l4(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return h4(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;vo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){HU(t,n,r,i)}}class kAe extends Zj{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(id.has(n)){const r=_4(n);return r&&r.default||0}return n=qU.has(n)?n:f4(n),t.getAttribute(n)}measureInstanceViewportBox(){return Tr()}scrapeMotionValuesFromProps(t,n){return KU(t,n)}build(t,n,r,i){c4(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){WU(t,n,r,i)}mount(t){this.isSVGTag=d4(t.tagName),super.mount(t)}}const PAe=(e,t)=>a4(e)?new kAe(t,{enableHardwareAcceleration:!1}):new AAe(t,{enableHardwareAcceleration:!0}),RAe={layout:{ProjectionNode:Kj,MeasureLayout:Uj}},OAe={...r4e,...xEe,...lAe,...RAe},IAe=I5e((e,t)=>cEe(e,t,OAe,PAe));function Jj(){const e=M.useRef(!1);return r4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function MAe(){const e=Jj(),[t,n]=M.useState(0),r=M.useCallback(()=>{e.current&&n(t+1)},[t]);return[M.useCallback(()=>Tn.postRender(r),[r]),t]}class NAe extends M.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 DAe({children:e,isPresent:t}){const n=M.useId(),r=M.useRef(null),i=M.useRef({width:0,height:0,top:0,left:0});return M.useInsertionEffect(()=>{const{width:o,height:s,top:a,left:l}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
[data-motion-pop-id="${n}"] {
position: absolute !important;
width: ${o}px !important;
height: ${s}px !important;
top: ${a}px !important;
left: ${l}px !important;
}
`),()=>{document.head.removeChild(u)}},[t]),M.createElement(NAe,{isPresent:t,childRef:r,sizeRef:i},M.cloneElement(e,{ref:r}))}const Qw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=XU(LAe),l=M.useId(),u=M.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{a.set(c,!0);for(const d of a.values())if(!d)return;r&&r()},register:c=>(a.set(c,!1),()=>a.delete(c))}),o?void 0:[n]);return M.useMemo(()=>{a.forEach((c,d)=>a.set(d,!1))},[n]),M.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=M.createElement(DAe,{isPresent:n},e)),M.createElement(Gm.Provider,{value:u},e)};function LAe(){return new Map}function $Ae(e){return M.useEffect(()=>()=>e(),[])}const Od=e=>e.key||"";function FAe(e,t){e.forEach(n=>{const r=Od(n);t.set(r,n)})}function BAe(e){const t=[];return M.Children.forEach(e,n=>{M.isValidElement(n)&&t.push(n)}),t}const zAe=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=M.useContext(s4).forceRender||MAe()[0],l=Jj(),u=BAe(e);let c=u;const d=M.useRef(new Map).current,f=M.useRef(c),h=M.useRef(new Map).current,p=M.useRef(!0);if(r4(()=>{p.current=!1,FAe(u,h),f.current=c}),$Ae(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return M.createElement(M.Fragment,null,c.map(y=>M.createElement(Qw,{key:Od(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:s},y)));c=[...c];const m=f.current.map(Od),b=u.map(Od),_=m.length;for(let y=0;y<_;y++){const g=m[y];b.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return s==="wait"&&d.size&&(c=[]),d.forEach((y,g)=>{if(b.indexOf(g)!==-1)return;const v=h.get(g);if(!v)return;const S=m.indexOf(g);let w=y;if(!w){const x=()=>{h.delete(g),d.delete(g);const C=f.current.findIndex(A=>A.key===g);if(f.current.splice(C,1),!d.size){if(f.current=u,l.current===!1)return;a(),r&&r()}};w=M.createElement(Qw,{key:Od(v),isPresent:!1,onExitComplete:x,custom:t,presenceAffectsLayout:o,mode:s},v),d.set(g,w)}c.splice(S,0,w)}),c=c.map(y=>{const g=y.key;return d.has(g)?y:M.createElement(Qw,{key:Od(y),isPresent:!0,presenceAffectsLayout:o,mode:s},y)}),M.createElement(M.Fragment,null,d.size?c:c.map(y=>M.cloneElement(y)))};var UAe=kCe({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),eV=Fu((e,t)=>{const n=n4("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=t4(e),u=YT("chakra-spinner",a),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${UAe} ${o} linear infinite`,...n};return Z.jsx(bu.div,{ref:t,__css:c,className:u,...l,children:r&&Z.jsx(bu.span,{srOnly:!0,children:r})})});eV.displayName="Spinner";var z3=Fu(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...s}=t;return Z.jsx("img",{width:r,height:i,ref:n,alt:o,...s})});z3.displayName="NativeImage";function jAe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:s,sizes:a,ignoreFallback:l}=e,[u,c]=M.useState("pending");M.useEffect(()=>{c(n?"loading":"pending")},[n]);const d=M.useRef(),f=M.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(),c("loaded"),i==null||i(m)},p.onerror=m=>{h(),c("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 PCe(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var VAe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function GAe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var C4=Fu(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:s,align:a,fit:l,loading:u,ignoreFallback:c,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||i!==void 0,b=u!=null||c||!m,_=jAe({...t,crossOrigin:d,ignoreFallback:b}),y=VAe(_,f),g={ref:n,objectFit:l,objectPosition:a,...b?p:GAe(p,["onError","onLoad"])};return y?i||Z.jsx(bu.img,{as:z3,className:"chakra-image__placeholder",src:r,...g}):Z.jsx(bu.img,{as:z3,src:o,srcSet:s,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...g})});C4.displayName="Image";var tV=Fu(function(t,n){const r=n4("Text",t),{className:i,align:o,decoration:s,casing:a,...l}=t4(t),u=h5e({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return Z.jsx(bu.p,{ref:n,className:YT("chakra-text",t.className),...u,...l,__css:r})});tV.displayName="Text";var U3=Fu(function(t,n){const r=n4("Heading",t),{className:i,...o}=t4(t);return Z.jsx(bu.h2,{ref:n,className:YT("chakra-heading",t.className),...o,__css:r})});U3.displayName="Heading";var j1=bu("div");j1.displayName="Box";var nV=Fu(function(t,n){const{size:r,centerContent:i=!0,...o}=t,s=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return Z.jsx(j1,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});nV.displayName="Square";var HAe=Fu(function(t,n){const{size:r,...i}=t;return Z.jsx(nV,{size:r,ref:n,borderRadius:"9999px",...i})});HAe.displayName="Circle";var E4=Fu(function(t,n){const{direction:r,align:i,justify:o,wrap:s,basis:a,grow:l,shrink:u,...c}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:u};return Z.jsx(bu.div,{ref:n,__css:d,...c})});E4.displayName="Flex";const qAe=""+new URL("logo-13003d72.png",import.meta.url).href,WAe=()=>Z.jsxs(E4,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[Z.jsx(C4,{src:qAe,w:"8rem",h:"8rem"}),Z.jsx(eV,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),KAe=M.memo(WAe);function j3(e){"@babel/helpers - typeof";return j3=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},j3(e)}var rV=[],XAe=rV.forEach,QAe=rV.slice;function V3(e){return XAe.call(QAe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function iV(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":j3(XMLHttpRequest))==="object"}function YAe(e){return!!e&&typeof e.then=="function"}function ZAe(e){return YAe(e)?e:Promise.resolve(e)}function JAe(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 G3={exports:{}},f0={exports:{}},fI;function eke(){return fI||(fI=1,function(e,t){var n=typeof self<"u"?self:ut,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(s){var a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function d(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function f(E){return typeof E!="string"&&(E=String(E)),E}function h(E){var P={next:function(){var D=E.shift();return{done:D===void 0,value:D}}};return a.iterable&&(P[Symbol.iterator]=function(){return P}),P}function p(E){this.map={},E instanceof p?E.forEach(function(P,D){this.append(D,P)},this):Array.isArray(E)?E.forEach(function(P){this.append(P[0],P[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(P){this.append(P,E[P])},this)}p.prototype.append=function(E,P){E=d(E),P=f(P);var D=this.map[E];this.map[E]=D?D+", "+P:P},p.prototype.delete=function(E){delete this.map[d(E)]},p.prototype.get=function(E){return E=d(E),this.has(E)?this.map[E]:null},p.prototype.has=function(E){return this.map.hasOwnProperty(d(E))},p.prototype.set=function(E,P){this.map[d(E)]=f(P)},p.prototype.forEach=function(E,P){for(var D in this.map)this.map.hasOwnProperty(D)&&E.call(P,this.map[D],D,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(P,D){E.push(D)}),h(E)},p.prototype.values=function(){var E=[];return this.forEach(function(P){E.push(P)}),h(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(P,D){E.push([D,P])}),h(E)},a.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function b(E){return new Promise(function(P,D){E.onload=function(){P(E.result)},E.onerror=function(){D(E.error)}})}function _(E){var P=new FileReader,D=b(P);return P.readAsArrayBuffer(E),D}function y(E){var P=new FileReader,D=b(P);return P.readAsText(E),D}function g(E){for(var P=new Uint8Array(E),D=new Array(P.length),B=0;B<P.length;B++)D[B]=String.fromCharCode(P[B]);return D.join("")}function v(E){if(E.slice)return E.slice(0);var P=new Uint8Array(E.byteLength);return P.set(new Uint8Array(E)),P.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:a.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:a.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():a.arrayBuffer&&a.blob&&l(E)?(this._bodyArrayBuffer=v(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||c(E))?this._bodyArrayBuffer=v(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var E=m(this);if(E)return E;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var E=m(this);if(E)return E;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(g(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(E){var P=E.toUpperCase();return w.indexOf(P)>-1?P:E}function C(E,P){P=P||{};var D=P.body;if(E instanceof C){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,P.headers||(this.headers=new p(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!D&&E._bodyInit!=null&&(D=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new p(P.headers)),this.method=x(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function A(E){var P=new FormData;return E.trim().split("&").forEach(function(D){if(D){var B=D.split("="),R=B.shift().replace(/\+/g," "),O=B.join("=").replace(/\+/g," ");P.append(decodeURIComponent(R),decodeURIComponent(O))}}),P}function T(E){var P=new p,D=E.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(B){var R=B.split(":"),O=R.shift().trim();if(O){var I=R.join(":").trim();P.append(O,I)}}),P}S.call(C.prototype);function k(E,P){P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in P?P.statusText:"OK",this.headers=new p(P.headers),this.url=P.url||"",this._initBody(E)}S.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},k.error=function(){var E=new k(null,{status:0,statusText:""});return E.type="error",E};var L=[301,302,303,307,308];k.redirect=function(E,P){if(L.indexOf(P)===-1)throw new RangeError("Invalid status code");return new k(null,{status:P,headers:{location:E}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(P,D){this.message=P,this.name=D;var B=Error(P);this.stack=B.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function N(E,P){return new Promise(function(D,B){var R=new C(E,P);if(R.signal&&R.signal.aborted)return B(new s.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function I(){O.abort()}O.onload=function(){var F={status:O.status,statusText:O.statusText,headers:T(O.getAllResponseHeaders()||"")};F.url="responseURL"in O?O.responseURL:F.headers.get("X-Request-URL");var U="response"in O?O.response:O.responseText;D(new k(U,F))},O.onerror=function(){B(new TypeError("Network request failed"))},O.ontimeout=function(){B(new TypeError("Network request failed"))},O.onabort=function(){B(new s.DOMException("Aborted","AbortError"))},O.open(R.method,R.url,!0),R.credentials==="include"?O.withCredentials=!0:R.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&a.blob&&(O.responseType="blob"),R.headers.forEach(function(F,U){O.setRequestHeader(U,F)}),R.signal&&(R.signal.addEventListener("abort",I),O.onreadystatechange=function(){O.readyState===4&&R.signal.removeEventListener("abort",I)}),O.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return N.polyfill=!0,o.fetch||(o.fetch=N,o.Headers=p,o.Request=C,o.Response=k),s.Headers=p,s.Request=C,s.Response=k,s.fetch=N,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(f0,f0.exports)),f0.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof ut<"u"&&ut.fetch?n=ut.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof JAe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||eke();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(G3,G3.exports);var oV=G3.exports;const sV=Fc(oV),hI=II({__proto__:null,default:sV},[oV]);function V1(e){"@babel/helpers - typeof";return V1=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},V1(e)}var Ja;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Ja=global.fetch:typeof window<"u"&&window.fetch?Ja=window.fetch:Ja=fetch);var Zg;iV()&&(typeof global<"u"&&global.XMLHttpRequest?Zg=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Zg=window.XMLHttpRequest));var G1;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?G1=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(G1=window.ActiveXObject));!Ja&&hI&&!Zg&&!G1&&(Ja=sV||hI);typeof Ja!="function"&&(Ja=void 0);var H3=function(t,n){if(n&&V1(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},pI=function(t,n,r){Ja(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},gI=!1,tke=function(t,n,r,i){t.queryStringParams&&(n=H3(n,t.queryStringParams));var o=V3({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=V3({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},gI?{}:s);try{pI(n,a,i)}catch(l){if(!s||Object.keys(s).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(s).forEach(function(u){delete a[u]}),pI(n,a,i),gI=!0}catch(u){i(u)}}},nke=function(t,n,r,i){r&&V1(r)==="object"&&(r=H3("",r).slice(1)),t.queryStringParams&&(n=H3(n,t.queryStringParams));try{var o;Zg?o=new Zg:o=new G1("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)}},rke=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Ja&&n.indexOf("file:")!==0)return tke(t,n,r,i);if(iV()||typeof ActiveXObject=="function")return nke(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Jg(e){"@babel/helpers - typeof";return Jg=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},Jg(e)}function ike(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mI(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,aV(r.key),r)}}function oke(e,t,n){return t&&mI(e.prototype,t),n&&mI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ske(e,t,n){return t=aV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aV(e){var t=ake(e,"string");return Jg(t)==="symbol"?t:String(t)}function ake(e,t){if(Jg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lke=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return ske({},r,i||"")},parseLoadPayload:function(n,r){},request:rke,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},lV=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]:{};ike(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return oke(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=V3(i,this.options||{},lke()),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=ZAe(l),l.then(function(u){if(!u)return s(null,{});var c=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(c,s,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,h;try{typeof d.data=="string"?f=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),u=0,c=[],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,b){u+=1,c.push(m),d.push(b),u===n.length&&typeof s=="function"&&s(c,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=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,h){f&&s.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&h&&s.log("loaded namespace ".concat(d," for language ").concat(c),h),i.loaded("".concat(c,"|").concat(d),f,h)})})})}}}]),e}();lV.type="backend";const uke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,cke={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},dke=e=>cke[e],fke=e=>e.replace(uke,dke);let q3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:fke};function hke(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q3={...q3,...e}}function zMe(){return q3}let uV;function pke(e){uV=e}function UMe(){return uV}const gke={type:"3rdParty",init(e){hke(e.options.react),pke(e)}};gt.use(lV).use(gke).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const WS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function bh(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function T4(e){return"nodeType"in e}function Ji(e){var t,n;return e?bh(e)?e:T4(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function A4(e){const{Document:t}=Ji(e);return e instanceof t}function Xm(e){return bh(e)?!1:e instanceof Ji(e).HTMLElement}function mke(e){return e instanceof Ji(e).SVGElement}function Sh(e){return e?bh(e)?e.document:T4(e)?A4(e)?e:Xm(e)?e.ownerDocument:document:document:document}const _a=WS?M.useLayoutEffect:M.useEffect;function KS(e){const t=M.useRef(e);return _a(()=>{t.current=e}),M.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 yke(){const e=M.useRef(null),t=M.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=M.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function em(e,t){t===void 0&&(t=[e]);const n=M.useRef(e);return _a(()=>{n.current!==e&&(n.current=e)},t),n}function Qm(e,t){const n=M.useRef();return M.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function H1(e){const t=KS(e),n=M.useRef(null),r=M.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function q1(e){const t=M.useRef();return M.useEffect(()=>{t.current=e},[e]),t.current}let Yw={};function XS(e,t){return M.useMemo(()=>{if(t)return t;const n=Yw[e]==null?0:Yw[e]+1;return Yw[e]=n,e+"-"+n},[e,t])}function cV(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>{const a=Object.entries(s);for(const[l,u]of a){const c=o[l];c!=null&&(o[l]=c+e*u)}return o},{...t})}}const bf=cV(1),W1=cV(-1);function vke(e){return"clientX"in e&&"clientY"in e}function k4(e){if(!e)return!1;const{KeyboardEvent:t}=Ji(e.target);return t&&e instanceof t}function _ke(e){if(!e)return!1;const{TouchEvent:t}=Ji(e.target);return t&&e instanceof t}function tm(e){if(_ke(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 vke(e)?{x:e.clientX,y:e.clientY}:null}const nm=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[nm.Translate.toString(e),nm.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),yI="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function bke(e){return e.matches(yI)?e:e.querySelector(yI)}const Ske={display:"none"};function wke(e){let{id:t,value:n}=e;return yn.createElement("div",{id:t,style:Ske},n)}const xke={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function Cke(e){let{id:t,announcement:n}=e;return yn.createElement("div",{id:t,style:xke,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function Eke(){const[e,t]=M.useState("");return{announce:M.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const dV=M.createContext(null);function Tke(e){const t=M.useContext(dV);M.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ake(){const[e]=M.useState(()=>new Set),t=M.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[M.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 kke={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.
`},Pke={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 Rke(e){let{announcements:t=Pke,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=kke}=e;const{announce:o,announcement:s}=Eke(),a=XS("DndLiveRegion"),[l,u]=M.useState(!1);if(M.useEffect(()=>{u(!0)},[]),Tke(M.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const c=yn.createElement(yn.Fragment,null,yn.createElement(wke,{id:r,value:i.draggable}),yn.createElement(Cke,{id:a,announcement:s}));return n?ws.createPortal(c,n):c}var $r;(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"})($r||($r={}));function K1(){}function vI(e,t){return M.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Oke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return M.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ls=Object.freeze({x:0,y:0});function Ike(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mke(e,t){const n=tm(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 Nke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Dke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Lke(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 $ke(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function Fke(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,c=s*a,d=c/(l+u-c);return Number(d.toFixed(4))}return 0}const Bke=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=Fke(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Dke)};function zke(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 Uke=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&&zke(r,a)){const u=Lke(a).reduce((d,f)=>d+Ike(r,f),0),c=Number((u/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:c}})}}return i.sort(Nke)};function jke(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function fV(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ls}function Vke(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 Gke=Vke(1);function hV(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 Hke(e,t,n){const r=hV(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),u=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const qke={ignoreTransform:!1};function Ym(e,t){t===void 0&&(t=qke);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=Ji(e).getComputedStyle(e);u&&(n=Hke(n,u,c))}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 _I(e){return Ym(e,{ignoreTransform:!0})}function Wke(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Kke(e,t){return t===void 0&&(t=Ji(e).getComputedStyle(e)),t.position==="fixed"}function Xke(e,t){t===void 0&&(t=Ji(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 P4(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(A4(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Xm(i)||mke(i)||n.includes(i))return n;const o=Ji(e).getComputedStyle(i);return i!==e&&Xke(i,o)&&n.push(i),Kke(i,o)?n:r(i.parentNode)}return e?r(e):n}function pV(e){const[t]=P4(e,1);return t??null}function Zw(e){return!WS||!e?null:bh(e)?e:T4(e)?A4(e)||e===Sh(e).scrollingElement?window:Xm(e)?e:null:null}function gV(e){return bh(e)?e.scrollX:e.scrollLeft}function mV(e){return bh(e)?e.scrollY:e.scrollTop}function W3(e){return{x:gV(e),y:mV(e)}}var ei;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ei||(ei={}));function yV(e){return!WS||!e?!1:e===document.scrollingElement}function vV(e){const t={x:0,y:0},n=yV(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 Qke={x:.2,y:.2};function Yke(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Qke);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=vV(e),h={x:0,y:0},p={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(h.y=ei.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!c&&l>=t.bottom-m.height&&(h.y=ei.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&a>=t.right-m.width?(h.x=ei.Forward,p.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&s<=t.left+m.width&&(h.x=ei.Backward,p.x=r*Math.abs((t.left+m.width-s)/m.width)),{direction:h,speed:p}}function Zke(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 _V(e){return e.reduce((t,n)=>bf(t,W3(n)),Ls)}function Jke(e){return e.reduce((t,n)=>t+gV(n),0)}function ePe(e){return e.reduce((t,n)=>t+mV(n),0)}function bV(e,t){if(t===void 0&&(t=Ym),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);pV(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const tPe=[["x",["left","right"],Jke],["y",["top","bottom"],ePe]];class R4{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=P4(n),i=_V(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of tPe)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),c=i[o]-u;return this.rect[l]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Rp{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 nPe(e){const{EventTarget:t}=Ji(e);return e instanceof t?e:Sh(e)}function Jw(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 Ho;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ho||(Ho={}));function bI(e){e.preventDefault()}function rPe(e){e.stopPropagation()}var Cn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Cn||(Cn={}));const SV={start:[Cn.Space,Cn.Enter],cancel:[Cn.Esc],end:[Cn.Space,Cn.Enter]},iPe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Cn.Right:return{...n,x:n.x+25};case Cn.Left:return{...n,x:n.x-25};case Cn.Down:return{...n,y:n.y+25};case Cn.Up:return{...n,y:n.y-25}}};class wV{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 Rp(Sh(n)),this.windowListeners=new Rp(Ji(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ho.Resize,this.handleCancel),this.windowListeners.add(Ho.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ho.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&bV(r),n(Ls)}handleKeyDown(t){if(k4(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=SV,coordinateGetter:s=iPe,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:Ls;this.referenceCoordinates||(this.referenceCoordinates=c);const d=s(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=W1(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const b=t.code,{isTop:_,isRight:y,isLeft:g,isBottom:v,maxScroll:S,minScroll:w}=vV(m),x=Zke(m),C={x:Math.min(b===Cn.Right?x.right-x.width/2:x.right,Math.max(b===Cn.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(b===Cn.Down?x.bottom-x.height/2:x.bottom,Math.max(b===Cn.Down?x.top:x.top+x.height/2,d.y))},A=b===Cn.Right&&!y||b===Cn.Left&&!g,T=b===Cn.Down&&!v||b===Cn.Up&&!_;if(A&&C.x!==d.x){const k=m.scrollLeft+f.x,L=b===Cn.Right&&k<=S.x||b===Cn.Left&&k>=w.x;if(L&&!f.y){m.scrollTo({left:k,behavior:a});return}L?h.x=m.scrollLeft-k:h.x=b===Cn.Right?m.scrollLeft-S.x:m.scrollLeft-w.x,h.x&&m.scrollBy({left:-h.x,behavior:a});break}else if(T&&C.y!==d.y){const k=m.scrollTop+f.y,L=b===Cn.Down&&k<=S.y||b===Cn.Up&&k>=w.y;if(L&&!f.x){m.scrollTo({top:k,behavior:a});return}L?h.y=m.scrollTop-k:h.y=b===Cn.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,bf(W1(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()}}wV.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=SV,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 SI(e){return!!(e&&"distance"in e)}function wI(e){return!!(e&&"delay"in e)}class O4{constructor(t,n,r){var i;r===void 0&&(r=nPe(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=Sh(s),this.documentListeners=new Rp(this.document),this.listeners=new Rp(r),this.windowListeners=new Rp(Ji(s)),this.initialCoordinates=(i=tm(o))!=null?i:Ls,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Ho.Resize,this.handleCancel),this.windowListeners.add(Ho.DragStart,bI),this.windowListeners.add(Ho.VisibilityChange,this.handleCancel),this.windowListeners.add(Ho.ContextMenu,bI),this.documentListeners.add(Ho.Keydown,this.handleKeydown),n){if(SI(n))return;if(wI(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ho.Click,rPe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ho.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=tm(t))!=null?n:Ls,u=W1(i,l);if(!r&&a){if(wI(a))return Jw(u,a.tolerance)?this.handleCancel():void 0;if(SI(a))return a.tolerance!=null&&Jw(u,a.tolerance)?this.handleCancel():Jw(u,a.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Cn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const oPe={move:{name:"pointermove"},end:{name:"pointerup"}};class xV extends O4{constructor(t){const{event:n}=t,r=Sh(n.target);super(t,oPe,r)}}xV.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 sPe={move:{name:"mousemove"},end:{name:"mouseup"}};var K3;(function(e){e[e.RightClick=2]="RightClick"})(K3||(K3={}));class CV extends O4{constructor(t){super(t,sPe,Sh(t.event.target))}}CV.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===K3.RightClick?!1:(r==null||r({event:n}),!0)}}];const ex={move:{name:"touchmove"},end:{name:"touchend"}};class EV extends O4{constructor(t){super(t,ex)}static setup(){return window.addEventListener(ex.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ex.move.name,t)};function t(){}}}EV.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 Op;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Op||(Op={}));var X1;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(X1||(X1={}));function aPe(e){let{acceleration:t,activator:n=Op.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=X1.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const h=uPe({delta:d,disabled:!o}),[p,m]=yke(),b=M.useRef({x:0,y:0}),_=M.useRef({x:0,y:0}),y=M.useMemo(()=>{switch(n){case Op.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Op.DraggableRect:return i}},[n,i,l]),g=M.useRef(null),v=M.useCallback(()=>{const w=g.current;if(!w)return;const x=b.current.x*_.current.x,C=b.current.y*_.current.y;w.scrollBy(x,C)},[]),S=M.useMemo(()=>a===X1.TreeOrder?[...u].reverse():u,[a,u]);M.useEffect(()=>{if(!o||!u.length||!y){m();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const x=u.indexOf(w),C=c[x];if(!C)continue;const{direction:A,speed:T}=Yke(w,C,y,t,f);for(const k of["x","y"])h[k][A[k]]||(T[k]=0,A[k]=0);if(T.x>0||T.y>0){m(),g.current=w,p(v,s),b.current=T,_.current=A;return}}b.current={x:0,y:0},_.current={x:0,y:0},m()},[t,v,r,m,o,s,JSON.stringify(y),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const lPe={x:{[ei.Backward]:!1,[ei.Forward]:!1},y:{[ei.Backward]:!1,[ei.Forward]:!1}};function uPe(e){let{delta:t,disabled:n}=e;const r=q1(t);return Qm(i=>{if(n||!r||!i)return lPe;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ei.Backward]:i.x[ei.Backward]||o.x===-1,[ei.Forward]:i.x[ei.Forward]||o.x===1},y:{[ei.Backward]:i.y[ei.Backward]||o.y===-1,[ei.Forward]:i.y[ei.Forward]||o.y===1}}},[n,t,r])}function cPe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Qm(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function dPe(e,t){return M.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 rm;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(rm||(rm={}));var X3;(function(e){e.Optimized="optimized"})(X3||(X3={}));const xI=new Map;function fPe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=M.useState(null),{frequency:a,measure:l,strategy:u}=i,c=M.useRef(e),d=b(),f=em(d),h=M.useCallback(function(_){_===void 0&&(_=[]),!f.current&&s(y=>y===null?_:y.concat(_.filter(g=>!y.includes(g))))},[f]),p=M.useRef(null),m=Qm(_=>{if(d&&!n)return xI;if(!_||_===xI||c.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 v=g.node.current,S=v?new R4(l(v),v):null;g.rect.current=S,S&&y.set(g.id,S)}return y}return _},[e,o,n,d,l]);return M.useEffect(()=>{c.current=e},[e]),M.useEffect(()=>{d||h()},[n,d]),M.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),M.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 b(){switch(u){case rm.Always:return!1;case rm.BeforeDragging:return n;default:return!n}}}function I4(e,t){return Qm(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function hPe(e,t){return I4(e,t)}function pPe(e){let{callback:t,disabled:n}=e;const r=KS(t),i=M.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return M.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function QS(e){let{callback:t,disabled:n}=e;const r=KS(t),i=M.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return M.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function gPe(e){return new R4(Ym(e),e)}function CI(e,t,n){t===void 0&&(t=gPe);const[r,i]=M.useReducer(a,null),o=pPe({callback(l){if(e)for(const u of l){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),s=QS({callback:i});return _a(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const c=t(e);return JSON.stringify(l)===JSON.stringify(c)?l:c}}function mPe(e){const t=I4(e);return fV(e,t)}const EI=[];function yPe(e){const t=M.useRef(e),n=Qm(r=>e?r&&r!==EI&&e&&t.current&&e.parentNode===t.current.parentNode?r:P4(e):EI,[e]);return M.useEffect(()=>{t.current=e},[e]),n}function vPe(e){const[t,n]=M.useState(null),r=M.useRef(e),i=M.useCallback(o=>{const s=Zw(o.target);s&&n(a=>a?(a.set(s,W3(s)),new Map(a)):null)},[]);return M.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const u=Zw(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,W3(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const u=Zw(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),M.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>bf(o,s),Ls):_V(e):Ls,[e,t])}function TI(e,t){t===void 0&&(t=[]);const n=M.useRef(null);return M.useEffect(()=>{n.current=null},t),M.useEffect(()=>{const r=e!==Ls;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?W1(e,n.current):Ls}function _Pe(e){M.useEffect(()=>{if(!WS)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 bPe(e,t){return M.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function TV(e){return M.useMemo(()=>e?Wke(e):null,[e])}const tx=[];function SPe(e,t){t===void 0&&(t=Ym);const[n]=e,r=TV(n?Ji(n):null),[i,o]=M.useReducer(a,tx),s=QS({callback:o});return e.length>0&&i===tx&&o(),_a(()=>{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=>yV(l)?r:new R4(t(l),l)):tx}}function AV(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xm(t)?t:e}function wPe(e){let{measure:t}=e;const[n,r]=M.useState(null),i=M.useCallback(u=>{for(const{target:c}of u)if(Xm(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=QS({callback:i}),s=M.useCallback(u=>{const c=AV(u);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[a,l]=H1(s);return M.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const xPe=[{sensor:xV,options:{}},{sensor:wV,options:{}}],CPe={current:{}},Z0={draggable:{measure:_I},droppable:{measure:_I,strategy:rm.WhileDragging,frequency:X3.Optimized},dragOverlay:{measure:Ym}};class Ip 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 EPe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ip,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:K1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Z0,measureDroppableContainers:K1,windowRect:null,measuringScheduled:!1},kV={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:K1,draggableNodes:new Map,over:null,measureDroppableContainers:K1},Zm=M.createContext(kV),PV=M.createContext(EPe);function TPe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ip}}}function APe(e,t){switch(t.type){case $r.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $r.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 $r.DragEnd:case $r.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $r.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Ip(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case $r.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 Ip(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case $r.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Ip(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function kPe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=M.useContext(Zm),o=q1(r),s=q1(n==null?void 0:n.id);return M.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!k4(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[l.current,u.current]){if(!c)continue;const d=bke(c);if(d){d.focus();break}}})}},[r,t,i,s,o]),null}function RV(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function PPe(e){return M.useMemo(()=>({draggable:{...Z0.draggable,...e==null?void 0:e.draggable},droppable:{...Z0.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Z0.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 RPe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=M.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;_a(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=fV(c,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=pV(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const YS=M.createContext({...Ls,scaleX:1,scaleY:1});var Il;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Il||(Il={}));const OPe=M.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:c=xPe,collisionDetection:d=Bke,measuring:f,modifiers:h,...p}=t;const m=M.useReducer(APe,void 0,TPe),[b,_]=m,[y,g]=Ake(),[v,S]=M.useState(Il.Uninitialized),w=v===Il.Initialized,{draggable:{active:x,nodes:C,translate:A},droppable:{containers:T}}=b,k=x?C.get(x):null,L=M.useRef({initial:null,translated:null}),N=M.useMemo(()=>{var Rn;return x!=null?{id:x,data:(Rn=k==null?void 0:k.data)!=null?Rn:CPe,rect:L}:null},[x,k]),E=M.useRef(null),[P,D]=M.useState(null),[B,R]=M.useState(null),O=em(p,Object.values(p)),I=XS("DndDescribedBy",s),F=M.useMemo(()=>T.getEnabled(),[T]),U=PPe(f),{droppableRects:V,measureDroppableContainers:H,measuringScheduled:Y}=fPe(F,{dragging:w,dependencies:[A.x,A.y],config:U.droppable}),Q=cPe(C,x),j=M.useMemo(()=>B?tm(B):null,[B]),K=Ea(),ee=hPe(Q,U.draggable.measure);RPe({activeNode:x?C.get(x):null,config:K.layoutShiftCompensation,initialRect:ee,measure:U.draggable.measure});const ie=CI(Q,U.draggable.measure,ee),ge=CI(Q?Q.parentElement:null),ae=M.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),dt=T.getNodeFor((n=ae.current.over)==null?void 0:n.id),et=wPe({measure:U.dragOverlay.measure}),Ne=(r=et.nodeRef.current)!=null?r:Q,lt=w?(i=et.rect)!=null?i:ie:null,Te=!!(et.nodeRef.current&&et.rect),Ht=mPe(Te?null:ie),br=TV(Ne?Ji(Ne):null),An=yPe(w?dt??Q:null),_n=SPe(An),qt=RV(h,{transform:{x:A.x-Ht.x,y:A.y-Ht.y,scaleX:1,scaleY:1},activatorEvent:B,active:N,activeNodeRect:ie,containerNodeRect:ge,draggingNodeRect:lt,over:ae.current.over,overlayNodeRect:et.rect,scrollableAncestors:An,scrollableAncestorRects:_n,windowRect:br}),kn=j?bf(j,A):null,Sr=vPe(An),eo=TI(Sr),Vr=TI(Sr,[ie]),sr=bf(qt,eo),Or=lt?Gke(lt,qt):null,Gr=N&&Or?d({active:N,collisionRect:Or,droppableRects:V,droppableContainers:F,pointerCoordinates:kn}):null,Pn=$ke(Gr,"id"),[cn,xi]=M.useState(null),oi=Te?qt:bf(qt,Vr),Ui=jke(oi,(o=cn==null?void 0:cn.rect)!=null?o:null,ie),fs=M.useCallback((Rn,Wt)=>{let{sensor:Ir,options:xr}=Wt;if(E.current==null)return;const Cr=C.get(E.current);if(!Cr)return;const Hr=Rn.nativeEvent,Ci=new Ir({active:E.current,activeNode:Cr,event:Hr,options:xr,context:ae,onStart(si){const Mr=E.current;if(Mr==null)return;const hs=C.get(Mr);if(!hs)return;const{onDragStart:Us}=O.current,ai={active:{id:Mr,data:hs.data,rect:L}};ws.unstable_batchedUpdates(()=>{Us==null||Us(ai),S(Il.Initializing),_({type:$r.DragStart,initialCoordinates:si,active:Mr}),y({type:"onDragStart",event:ai})})},onMove(si){_({type:$r.DragMove,coordinates:si})},onEnd:no($r.DragEnd),onCancel:no($r.DragCancel)});ws.unstable_batchedUpdates(()=>{D(Ci),R(Rn.nativeEvent)});function no(si){return async function(){const{active:hs,collisions:Us,over:ai,scrollAdjustedTranslate:yl}=ae.current;let Bo=null;if(hs&&yl){const{cancelDrop:qr}=O.current;Bo={activatorEvent:Hr,active:hs,collisions:Us,delta:yl,over:ai},si===$r.DragEnd&&typeof qr=="function"&&await Promise.resolve(qr(Bo))&&(si=$r.DragCancel)}E.current=null,ws.unstable_batchedUpdates(()=>{_({type:si}),S(Il.Uninitialized),xi(null),D(null),R(null);const qr=si===$r.DragEnd?"onDragEnd":"onDragCancel";if(Bo){const Ta=O.current[qr];Ta==null||Ta(Bo),y({type:qr,event:Bo})}})}}},[C]),wr=M.useCallback((Rn,Wt)=>(Ir,xr)=>{const Cr=Ir.nativeEvent,Hr=C.get(xr);if(E.current!==null||!Hr||Cr.dndKit||Cr.defaultPrevented)return;const Ci={active:Hr};Rn(Ir,Wt.options,Ci)===!0&&(Cr.dndKit={capturedBy:Wt.sensor},E.current=xr,fs(Ir,Wt))},[C,fs]),to=dPe(c,wr);_Pe(c),_a(()=>{ie&&v===Il.Initializing&&S(Il.Initialized)},[ie,v]),M.useEffect(()=>{const{onDragMove:Rn}=O.current,{active:Wt,activatorEvent:Ir,collisions:xr,over:Cr}=ae.current;if(!Wt||!Ir)return;const Hr={active:Wt,activatorEvent:Ir,collisions:xr,delta:{x:sr.x,y:sr.y},over:Cr};ws.unstable_batchedUpdates(()=>{Rn==null||Rn(Hr),y({type:"onDragMove",event:Hr})})},[sr.x,sr.y]),M.useEffect(()=>{const{active:Rn,activatorEvent:Wt,collisions:Ir,droppableContainers:xr,scrollAdjustedTranslate:Cr}=ae.current;if(!Rn||E.current==null||!Wt||!Cr)return;const{onDragOver:Hr}=O.current,Ci=xr.get(Pn),no=Ci&&Ci.rect.current?{id:Ci.id,rect:Ci.rect.current,data:Ci.data,disabled:Ci.disabled}:null,si={active:Rn,activatorEvent:Wt,collisions:Ir,delta:{x:Cr.x,y:Cr.y},over:no};ws.unstable_batchedUpdates(()=>{xi(no),Hr==null||Hr(si),y({type:"onDragOver",event:si})})},[Pn]),_a(()=>{ae.current={activatorEvent:B,active:N,activeNode:Q,collisionRect:Or,collisions:Gr,droppableRects:V,draggableNodes:C,draggingNode:Ne,draggingNodeRect:lt,droppableContainers:T,over:cn,scrollableAncestors:An,scrollAdjustedTranslate:sr},L.current={initial:lt,translated:Or}},[N,Q,Gr,Or,C,Ne,lt,V,T,cn,An,sr]),aPe({...K,delta:A,draggingRect:Or,pointerCoordinates:kn,scrollableAncestors:An,scrollableAncestorRects:_n});const Ca=M.useMemo(()=>({active:N,activeNode:Q,activeNodeRect:ie,activatorEvent:B,collisions:Gr,containerNodeRect:ge,dragOverlay:et,draggableNodes:C,droppableContainers:T,droppableRects:V,over:cn,measureDroppableContainers:H,scrollableAncestors:An,scrollableAncestorRects:_n,measuringConfiguration:U,measuringScheduled:Y,windowRect:br}),[N,Q,ie,B,Gr,ge,et,C,T,V,cn,H,An,_n,U,Y,br]),_o=M.useMemo(()=>({activatorEvent:B,activators:to,active:N,activeNodeRect:ie,ariaDescribedById:{draggable:I},dispatch:_,draggableNodes:C,over:cn,measureDroppableContainers:H}),[B,to,N,ie,_,I,C,cn,H]);return yn.createElement(dV.Provider,{value:g},yn.createElement(Zm.Provider,{value:_o},yn.createElement(PV.Provider,{value:Ca},yn.createElement(YS.Provider,{value:Ui},u)),yn.createElement(kPe,{disabled:(a==null?void 0:a.restoreFocus)===!1})),yn.createElement(Rke,{...a,hiddenTextDescribedById:I}));function Ea(){const Rn=(P==null?void 0:P.autoScrollEnabled)===!1,Wt=typeof l=="object"?l.enabled===!1:l===!1,Ir=w&&!Rn&&!Wt;return typeof l=="object"?{...l,enabled:Ir}:{enabled:Ir}}}),IPe=M.createContext(null),AI="button",MPe="Droppable";function jMe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=XS(MPe),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=M.useContext(Zm),{role:h=AI,roleDescription:p="draggable",tabIndex:m=0}=i??{},b=(l==null?void 0:l.id)===t,_=M.useContext(b?YS:IPe),[y,g]=H1(),[v,S]=H1(),w=bPe(s,t),x=em(n);_a(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:v,data:x}),()=>{const A=d.get(t);A&&A.key===o&&d.delete(t)}),[d,t]);const C=M.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&h===AI?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[r,h,m,b,p,c.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:C,isDragging:b,listeners:r?void 0:w,node:y,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:_}}function NPe(){return M.useContext(PV)}const DPe="Droppable",LPe={timeout:25};function VMe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=XS(DPe),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=M.useContext(Zm),c=M.useRef({disabled:n}),d=M.useRef(!1),f=M.useRef(null),h=M.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:b}={...LPe,...i},_=em(m??r),y=M.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(_.current)?_.current:[_.current]),h.current=null},b)},[b]),g=QS({callback:y,disabled:p||!s}),v=M.useCallback((C,A)=>{g&&(A&&(g.unobserve(A),d.current=!1),C&&g.observe(C))},[g]),[S,w]=H1(v),x=em(t);return M.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),_a(()=>(a({type:$r.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:x}}),()=>a({type:$r.UnregisterDroppable,key:o,id:r})),[r]),M.useEffect(()=>{n!==c.current.disabled&&(a({type:$r.SetDroppableDisabled,id:r,key:o,disabled:n}),c.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 $Pe(e){let{animation:t,children:n}=e;const[r,i]=M.useState(null),[o,s]=M.useState(null),a=q1(n);return!n&&!r&&a&&i(a),_a(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),yn.createElement(yn.Fragment,null,n,r?M.cloneElement(r,{ref:s}):null)}const FPe={x:0,y:0,scaleX:1,scaleY:1};function BPe(e){let{children:t}=e;return yn.createElement(Zm.Provider,{value:kV},yn.createElement(YS.Provider,{value:FPe},t))}const zPe={position:"fixed",touchAction:"none"},UPe=e=>k4(e)?"transform 250ms ease":void 0,jPe=M.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:s,rect:a,style:l,transform:u,transition:c=UPe}=e;if(!a)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...zPe,width:a.width,height:a.height,top:a.top,left:a.left,transform:nm.Transform.toString(d),transformOrigin:i&&r?Mke(r,a):void 0,transition:typeof c=="function"?c(r):c,...l};return yn.createElement(n,{className:s,style:f,ref:t},o)}),VPe=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:s}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},GPe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:nm.Transform.toString(t)},{transform:nm.Transform.toString(n)}]},HPe={duration:250,easing:"ease",keyframes:GPe,sideEffects:VPe({styles:{active:{opacity:"0"}}})};function qPe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return KS((o,s)=>{if(t===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const u=AV(s);if(!u)return;const{transform:c}=Ji(s).getComputedStyle(s),d=hV(c);if(!d)return;const f=typeof t=="function"?t:WPe(t);return bV(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(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function WPe(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...HPe,...e};return o=>{let{active:s,dragOverlay:a,transform:l,...u}=o;if(!t)return;const c={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-c.x,y:l.y-c.y,...d},h=i({...u,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 b=r==null?void 0:r({active:s,dragOverlay:a,...u}),_=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{_.onfinish=()=>{b==null||b(),y()}})}}let kI=0;function KPe(e){return M.useMemo(()=>{if(e!=null)return kI++,kI},[e])}const XPe=yn.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:s,wrapperElement:a="div",className:l,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:m,dragOverlay:b,over:_,measuringConfiguration:y,scrollableAncestors:g,scrollableAncestorRects:v,windowRect:S}=NPe(),w=M.useContext(YS),x=KPe(d==null?void 0:d.id),C=RV(s,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:b.rect,over:_,overlayNodeRect:b.rect,scrollableAncestors:g,scrollableAncestorRects:v,transform:w,windowRect:S}),A=I4(f),T=qPe({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:y}),k=A?b.setRef:void 0;return yn.createElement(BPe,null,yn.createElement($Pe,{animation:T},d&&x?yn.createElement(jPe,{key:x,id:d.id,ref:k,as:a,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:A,style:{zIndex:u,...i},transform:C},n):null))}),QPe=()=>v$(),YPe=c$,ZPe=$i([Qwe,$T],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),JPe=()=>{const e=YPe(ZPe);return M.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=tm(n);if(!o)return i;const s=o.x-r.left,a=o.y-r.top,l=i.x+s-r.width/2,u=i.y+a-r.height/2,c=i.scaleX*e,d=i.scaleY*e;return{x:l,y:u,scaleX:c,scaleY:d}}return i},[e])};function e6e(e){return Z.jsx(OPe,{...e})}const h0=28,PI={w:h0,h:h0,maxW:h0,maxH:h0,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},t6e=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return Z.jsx(j1,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:Z.jsx(tV,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return Z.jsx(j1,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:Z.jsx(C4,{sx:{...PI},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?Z.jsxs(E4,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...PI},children:[Z.jsx(U3,{children:e.dragData.payload.imageDTOs.length}),Z.jsx(U3,{size:"sm",children:"Images"})]}):null},n6e=M.memo(t6e),r6e=e=>{const[t,n]=M.useState(null),r=pe("images"),i=QPe(),o=M.useCallback(d=>{r.trace({dragData:gn(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),s=M.useCallback(d=>{var h;r.trace({dragData:gn(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(Lz({overData:f,activeData:t})),n(null))},[t,i,r]),a=vI(CV,{activationConstraint:{distance:10}}),l=vI(EV,{activationConstraint:{distance:10}}),u=Oke(a,l),c=JPe();return Z.jsxs(e6e,{onDragStart:o,onDragEnd:s,sensors:u,collisionDetection:Uke,autoScroll:!1,children:[e.children,Z.jsx(XPe,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"none",userSelect:"none",padding:"10rem"},children:Z.jsx(zAe,{children:t&&Z.jsx(IAe.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:Z.jsx(n6e,{dragData:t})},"overlay-drag-image")})})]})},i6e=M.memo(r6e),RI=ku(void 0),OI=ku(void 0),o6e=M.lazy(()=>qM(()=>import("./App-3afcb7b5.js"),["./App-3afcb7b5.js","./menu-5f867375.js","./App-6125620a.css"],import.meta.url)),s6e=M.lazy(()=>qM(()=>import("./ThemeLocaleProvider-ee6f7a9a.js"),["./ThemeLocaleProvider-ee6f7a9a.js","./menu-5f867375.js","./ThemeLocaleProvider-90f0fcd3.css"],import.meta.url)),a6e=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,selectedImage:s,customStarUi:a})=>(M.useEffect(()=>(t&&Df.set(t),e&&vg.set(e),o&&_g.set(o),jB(),i&&i.length>0?YC(jR(),...i):YC(jR()),()=>{vg.set(void 0),Df.set(void 0),_g.set(void 0)}),[e,t,i,o]),M.useEffect(()=>(a&&RI.set(a),()=>{RI.set(void 0)}),[a]),M.useEffect(()=>(r&&OI.set(r),()=>{OI.set(void 0)}),[r]),Z.jsx(yn.StrictMode,{children:Z.jsx(Ace,{store:Xwe,children:Z.jsx(yn.Suspense,{fallback:Z.jsx(KAe,{}),children:Z.jsx(s6e,{children:Z.jsx(i6e,{children:Z.jsx(o6e,{config:n,selectedImage:s})})})})})})),l6e=M.memo(a6e);nx.createRoot(document.getElementById("root")).render(Z.jsx(l6e,{}));export{dc as $,xs as A,_ge as B,mo as C,ru as D,Xs as E,BOe as F,uT as G,jwe as H,Fu as I,RCe as J,bu as K,YT as L,AMe as M,CMe as N,zAe as O,wge as P,IAe as Q,$Me as R,og as S,t4 as T,eV as U,n4 as V,EMe as W,TMe as X,PCe as Y,kCe as Z,kMe as _,nE as a,hee as a$,Fc as a0,r1 as a1,bq as a2,yn as a3,n5e as a4,LMe as a5,h5e as a6,Qa as a7,wU as a8,E4e as a9,yU as aA,yCe as aB,ws as aC,L4 as aD,QT as aE,T9e as aF,VRe as aG,iOe as aH,oOe as aI,MRe as aJ,ORe as aK,tV as aL,bp as aM,N0e as aN,QB as aO,c9e as aP,EOe as aQ,QE as aR,NT as aS,U9e as aT,C4 as aU,qAe as aV,gt as aW,XRe as aX,rOe as aY,kde as aZ,_E as a_,OMe as aa,E3 as ab,xMe as ac,DMe as ad,$i as ae,yT as af,Sm as ag,YPe as ah,URe as ai,Im as aj,bL as ak,qL as al,ib as am,pe as an,QPe as ao,p9e as ap,Bn as aq,ia as ar,j1 as as,E4 as at,U3 as au,Qwe as av,$T as aw,nOe as ax,gCe as ay,XT as az,x_ as b,A6e as b$,w6e as b0,D9e as b1,b9e as b2,j9e as b3,z9e as b4,d0e as b5,_9e as b6,x9e as b7,Ene as b8,Oye as b9,OOe as bA,c6e as bB,g6e as bC,m6e as bD,y6e as bE,v6e as bF,V6e as bG,G6e as bH,JIe as bI,e9e as bJ,x6e as bK,Y6e as bL,b6e as bM,F6e as bN,T6e as bO,wSe as bP,S6e as bQ,H6e as bR,_6e as bS,n8e as bT,C6e as bU,qk as bV,E6e as bW,Wk as bX,O6e as bY,z6e as bZ,SSe as b_,Iye as ba,I9e as bb,N9e as bc,w9e as bd,$9e as be,zRe as bf,h9e as bg,KRe as bh,tre as bi,dOe as bj,cOe as bk,qRe as bl,NOe as bm,VMe as bn,jMe as bo,CB as bp,MOe as bq,GRe as br,HRe as bs,ZRe as bt,NC as bu,WRe as bv,zl as bw,yy as bx,IOe as by,ROe as bz,bK as c,J9e as c$,A8 as c0,r9e as c1,i9e as c2,o9e as c3,I6e as c4,s9e as c5,M6e as c6,a9e as c7,N6e as c8,l9e as c9,B9e as cA,q7 as cB,PIe as cC,IIe as cD,DIe as cE,NIe as cF,RIe as cG,OIe as cH,MIe as cI,Owe as cJ,QIe as cK,HOe as cL,DRe as cM,NRe as cN,XOe as cO,Yee as cP,FIe as cQ,jOe as cR,lIe as cS,uIe as cT,P6e as cU,Y9e as cV,pIe as cW,d6e as cX,hIe as cY,Nb as cZ,k6e as c_,Me as ca,RI as cb,pOe as cc,fOe as cd,hOe as ce,Ode as cf,E0e as cg,UB as ch,bD as ci,IRe as cj,Dz as ck,QRe as cl,s1 as cm,tF as cn,wMe as co,YRe as cp,Cy as cq,f1 as cr,g9e as cs,Pu as ct,y9e as cu,Wr as cv,cT as cw,ns as cx,D6e as cy,$m as cz,aee as d,Aye as d$,fIe as d0,xm as d1,cMe as d2,Q9e as d3,gMe as d4,X9e as d5,cIe as d6,aIe as d7,mMe as d8,mIe as d9,Kk as dA,Tde as dB,Pd as dC,N6 as dD,G0e as dE,V0e as dF,SOe as dG,wOe as dH,xOe as dI,Ade as dJ,COe as dK,X$ as dL,yOe as dM,_Oe as dN,gOe as dO,fwe as dP,bR as dQ,mOe as dR,p8e as dS,r8e as dT,c8e as dU,j6e as dV,d8e as dW,f8e as dX,eMe as dY,t9e as dZ,yE as d_,pMe as da,yIe as db,sIe as dc,vne as dd,tMe as de,dIe as df,R6e as dg,Z9e as dh,gIe as di,$Ie as dj,POe as dk,TOe as dl,AOe as dm,kOe as dn,LOe as dp,$Oe as dq,rF as dr,DOe as ds,O_ as dt,M6 as du,bOe as dv,lOe as dw,sOe as dx,aOe as dy,Wc as dz,B7 as e,yye as e$,U6e as e0,rwe as e1,gD as e2,vMe as e3,m8e as e4,Tne as e5,g8e as e6,Ss as e7,B6e as e8,J6e as e9,hi as eA,Nn as eB,da as eC,K9e as eD,fMe as eE,oMe as eF,E9e as eG,iMe as eH,hMe as eI,dMe as eJ,C9e as eK,aMe as eL,sMe as eM,nMe as eN,uMe as eO,h6e as eP,rMe as eQ,lMe as eR,f6e as eS,uB as eT,VOe as eU,dC as eV,gye as eW,ZOe as eX,HIe as eY,GIe as eZ,qOe as e_,p6e as ea,cte as eb,t8e as ec,n9e as ed,K6e as ee,X6e as ef,Q6e as eg,q6e as eh,W6e as ei,Cne as ej,o8e as ek,i8e as el,x8e as em,G8e as en,ARe as eo,H8e as ep,h8e as eq,ute as er,l8e as es,u8e as et,a8e as eu,vE as ev,ZIe as ew,swe as ex,P9e as ey,he as ez,GN as f,I8e as f$,KOe as f0,EB as f1,jF as f2,Lm as f3,zOe as f4,La as f5,YIe as f6,F9e as f7,c$ as f8,mye as f9,jIe as fA,lye as fB,_Me as fC,ND as fD,AR as fE,gn as fF,Sye as fG,Bg as fH,vu as fI,wIe as fJ,xIe as fK,EIe as fL,TIe as fM,WIe as fN,CIe as fO,iIe as fP,wB as fQ,JB as fR,eG as fS,Tt as fT,nRe as fU,SRe as fV,bRe as fW,z8e as fX,dRe as fY,xRe as fZ,H0e as f_,KIe as fa,XIe as fb,UOe as fc,vIe as fd,_Ie as fe,LRe as ff,w1 as fg,Ye as fh,bIe as fi,WOe as fj,xye as fk,GOe as fl,LIe as fm,QOe as fn,YOe as fo,tIe as fp,eIe as fq,nIe as fr,SIe as fs,JOe as ft,AIe as fu,kIe as fv,BIe as fw,Fwe as fx,UIe as fy,VIe as fz,JN as g,z0e as g$,Y8e as g0,Gh as g1,K8e as g2,M8e as g3,Lb as g4,Q8e as g5,P8e as g6,X8e as g7,R8e as g8,L8e as g9,RRe as gA,G9e as gB,V9e as gC,cRe as gD,oRe as gE,iRe as gF,F0e as gG,B8e as gH,O8e as gI,yRe as gJ,mRe as gK,lRe as gL,sRe as gM,aRe as gN,kRe as gO,pRe as gP,PRe as gQ,W8e as gR,q8e as gS,k8e as gT,A8e as gU,TRe as gV,w8e as gW,U8e as gX,U0e as gY,$0e as gZ,B0e as g_,_8e as ga,v8e as gb,y8e as gc,wRe as gd,W7 as ge,yD as gf,Df as gg,Gne as gh,C8e as gi,E8e as gj,T8e as gk,_Re as gl,F8e as gm,$8e as gn,Wne as go,vRe as gp,j0e as gq,N8e as gr,MT as gs,dwe as gt,j8e as gu,rRe as gv,tRe as gw,Z8e as gx,b8e as gy,S8e as gz,Bi as h,yMe as h0,FB as h1,JRe as h2,Cp as h3,DT as h4,A9e as h5,k9e as h6,ate as h7,I0e as h8,OI as h9,SMe as ha,xU as hb,NMe as hc,IMe as hd,PMe as he,MMe as hf,oa as hg,RMe as hh,bMe as hi,e5e as hj,q3e as hk,FMe as hl,zMe as hm,UMe as hn,eee as i,T_ as j,vm as k,iE as l,jN as m,cE as n,I7 as o,rh as p,HN as q,BW as r,ote as s,bm as t,M as u,Z as v,ss as w,fr as x,pf as y,ii as z};