mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
129 lines
1.3 MiB
129 lines
1.3 MiB
var HV=Object.defineProperty;var WV=(e,t,n)=>t in e?HV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var n2=(e,t,n)=>(WV(e,typeof t!="symbol"?t+"":t,n),n);function GO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const 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 ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Y1(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 qO={exports:{}},Z1={},HO={exports:{}},Nt={};/**
|
||
* @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"),KV=Symbol.for("react.portal"),QV=Symbol.for("react.fragment"),XV=Symbol.for("react.strict_mode"),YV=Symbol.for("react.profiler"),ZV=Symbol.for("react.provider"),JV=Symbol.for("react.context"),eG=Symbol.for("react.forward_ref"),tG=Symbol.for("react.suspense"),nG=Symbol.for("react.memo"),rG=Symbol.for("react.lazy"),V4=Symbol.iterator;function iG(e){return e===null||typeof e!="object"?null:(e=V4&&e[V4]||e["@@iterator"],typeof e=="function"?e:null)}var WO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},KO=Object.assign,QO={};function Zf(e,t,n){this.props=e,this.context=t,this.refs=QO,this.updater=n||WO}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 XO(){}XO.prototype=Zf.prototype;function nE(e,t,n){this.props=e,this.context=t,this.refs=QO,this.updater=n||WO}var rE=nE.prototype=new XO;rE.constructor=nE;KO(rE,Zf.prototype);rE.isPureReactComponent=!0;var G4=Array.isArray,YO=Object.prototype.hasOwnProperty,iE={current:null},ZO={key:!0,ref:!0,__self:!0,__source:!0};function JO(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)YO.call(t,r)&&!ZO.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:iE.current}}function oG(e,t){return{$$typeof:im,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function oE(e){return typeof e=="object"&&e!==null&&e.$$typeof===im}function sG(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var q4=/\/+/g;function r2(e,t){return typeof e=="object"&&e!==null&&e.key!=null?sG(""+e.key):t.toString(36)}function m0(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 KV:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+r2(s,0):r,G4(i)?(n="",e!=null&&(n=e.replace(q4,"$&/")+"/"),m0(i,t,n,"",function(u){return u})):i!=null&&(oE(i)&&(i=oG(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(q4,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",G4(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+r2(o,a);s+=m0(o,t,n,l,i)}else if(l=iG(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+r2(o,a++),s+=m0(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 ty(e,t,n){if(e==null)return e;var r=[],i=0;return m0(e,r,"","",function(o){return t.call(n,o,i++)}),r}function aG(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 Ki={current:null},y0={transition:null},lG={ReactCurrentDispatcher:Ki,ReactCurrentBatchConfig:y0,ReactCurrentOwner:iE};Nt.Children={map:ty,forEach:function(e,t,n){ty(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ty(e,function(){t++}),t},toArray:function(e){return ty(e,function(t){return t})||[]},only:function(e){if(!oE(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Nt.Component=Zf;Nt.Fragment=QV;Nt.Profiler=YV;Nt.PureComponent=nE;Nt.StrictMode=XV;Nt.Suspense=tG;Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lG;Nt.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=KO({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=iE.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)YO.call(t,l)&&!ZO.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}};Nt.createContext=function(e){return e={$$typeof:JV,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ZV,_context:e},e.Consumer=e};Nt.createElement=JO;Nt.createFactory=function(e){var t=JO.bind(null,e);return t.type=e,t};Nt.createRef=function(){return{current:null}};Nt.forwardRef=function(e){return{$$typeof:eG,render:e}};Nt.isValidElement=oE;Nt.lazy=function(e){return{$$typeof:rG,_payload:{_status:-1,_result:e},_init:aG}};Nt.memo=function(e,t){return{$$typeof:nG,type:e,compare:t===void 0?null:t}};Nt.startTransition=function(e){var t=y0.transition;y0.transition={};try{e()}finally{y0.transition=t}};Nt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Nt.useCallback=function(e,t){return Ki.current.useCallback(e,t)};Nt.useContext=function(e){return Ki.current.useContext(e)};Nt.useDebugValue=function(){};Nt.useDeferredValue=function(e){return Ki.current.useDeferredValue(e)};Nt.useEffect=function(e,t){return Ki.current.useEffect(e,t)};Nt.useId=function(){return Ki.current.useId()};Nt.useImperativeHandle=function(e,t,n){return Ki.current.useImperativeHandle(e,t,n)};Nt.useInsertionEffect=function(e,t){return Ki.current.useInsertionEffect(e,t)};Nt.useLayoutEffect=function(e,t){return Ki.current.useLayoutEffect(e,t)};Nt.useMemo=function(e,t){return Ki.current.useMemo(e,t)};Nt.useReducer=function(e,t,n){return Ki.current.useReducer(e,t,n)};Nt.useRef=function(e){return Ki.current.useRef(e)};Nt.useState=function(e){return Ki.current.useState(e)};Nt.useSyncExternalStore=function(e,t,n){return Ki.current.useSyncExternalStore(e,t,n)};Nt.useTransition=function(){return Ki.current.useTransition()};Nt.version="18.2.0";HO.exports=Nt;var M=HO.exports;const vn=jc(M),H4=GO({__proto__:null,default:vn},[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 uG=M,cG=Symbol.for("react.element"),dG=Symbol.for("react.fragment"),fG=Object.prototype.hasOwnProperty,hG=uG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pG={key:!0,ref:!0,__self:!0,__source:!0};function e9(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)fG.call(t,r)&&!pG.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:cG,type:e,key:o,ref:s,props:i,_owner:hG.current}}Z1.Fragment=dG;Z1.jsx=e9;Z1.jsxs=e9;qO.exports=Z1;var J=qO.exports,lx={},t9={exports:{}},Lo={},n9={exports:{}},r9={};/**
|
||
* @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(O,I){var N=O.length;O.push(I);e:for(;0<N;){var B=N-1>>>1,U=O[B];if(0<i(U,I))O[B]=I,O[N]=U,N=B;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var I=O[0],N=O.pop();if(N!==I){O[0]=N;e:for(var B=0,U=O.length,G=U>>>1;B<G;){var Q=2*(B+1)-1,Z=O[Q],Y=Q+1,j=O[Y];if(0>i(Z,N))Y<U&&0>i(j,Z)?(O[B]=j,O[Y]=N,B=Y):(O[B]=Z,O[Q]=N,B=Q);else if(Y<U&&0>i(j,N))O[B]=j,O[Y]=N,B=Y;else break e}}return I}function i(O,I){var N=O.sortIndex-I.sortIndex;return N!==0?N:O.id-I.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,v=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(O){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=O)r(u),I.sortIndex=I.expirationTime,t(l,I);else break;I=n(u)}}function y(O){if(m=!1,g(O),!p)if(n(l)!==null)p=!0,D(S);else{var I=n(u);I!==null&&$(y,I.startTime-O)}}function S(O,I){p=!1,m&&(m=!1,_(C),C=-1),h=!0;var N=f;try{for(g(I),d=n(l);d!==null&&(!(d.expirationTime>I)||O&&!P());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var U=B(d.expirationTime<=I);I=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),g(I)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var Q=n(u);Q!==null&&$(y,Q.startTime-I),G=!1}return G}finally{d=null,f=N,h=!1}}var w=!1,x=null,C=-1,A=5,T=-1;function P(){return!(e.unstable_now()-T<A)}function L(){if(x!==null){var O=e.unstable_now();T=O;var I=!0;try{I=x(!0,O)}finally{I?R():(w=!1,x=null)}}else w=!1}var R;if(typeof v=="function")R=function(){v(L)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,k=E.port2;E.port1.onmessage=L,R=function(){k.postMessage(null)}}else R=function(){b(L,0)};function D(O){x=O,w||(w=!0,R())}function $(O,I){C=b(function(){O(e.unstable_now())},I)}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(O){O.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,D(S))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(f){case 1:case 2:case 3:var I=3;break;default:I=f}var N=f;f=I;try{return O()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var N=f;f=O;try{return I()}finally{f=N}},e.unstable_scheduleCallback=function(O,I,N){var B=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?B+N:B):N=B,O){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=N+U,O={id:c++,callback:I,priorityLevel:O,startTime:N,expirationTime:U,sortIndex:-1},N>B?(O.sortIndex=N,t(u,O),n(l)===null&&O===n(u)&&(m?(_(C),C=-1):m=!0,$(y,N-B))):(O.sortIndex=U,t(l,O),p||h||(p=!0,D(S))),O},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(O){var I=f;return function(){var N=f;f=I;try{return O.apply(this,arguments)}finally{f=N}}}})(r9);n9.exports=r9;var gG=n9.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 i9=M,Io=gG;function se(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 o9=new Set,Mp={};function Uc(e,t){wf(e,t),wf(e+"Capture",t)}function wf(e,t){for(Mp[e]=t,e=0;e<t.length;e++)o9.add(t[e])}var nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ux=Object.prototype.hasOwnProperty,mG=/^[: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]*$/,W4={},K4={};function yG(e){return ux.call(K4,e)?!0:ux.call(W4,e)?!1:mG.test(e)?K4[e]=!0:(W4[e]=!0,!1)}function vG(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 _G(e,t,n,r){if(t===null||typeof t>"u"||vG(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 Qi(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 Qi(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 Qi(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Si[e]=new Qi(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Si[e]=new Qi(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 Qi(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Si[e]=new Qi(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Si[e]=new Qi(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Si[e]=new Qi(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Si[e]=new Qi(e,5,!1,e.toLowerCase(),null,!1,!1)});var sE=/[\-:]([a-z])/g;function aE(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(sE,aE);Si[t]=new Qi(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(sE,aE);Si[t]=new Qi(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(sE,aE);Si[t]=new Qi(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Si[e]=new Qi(e,1,!1,e.toLowerCase(),null,!1,!1)});Si.xlinkHref=new Qi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Si[e]=new Qi(e,1,!1,e.toLowerCase(),null,!0,!0)});function lE(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")&&(_G(t,n,i,r)&&(n=null),r||i===null?yG(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 dl=i9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ny=Symbol.for("react.element"),Md=Symbol.for("react.portal"),Nd=Symbol.for("react.fragment"),uE=Symbol.for("react.strict_mode"),cx=Symbol.for("react.profiler"),s9=Symbol.for("react.provider"),a9=Symbol.for("react.context"),cE=Symbol.for("react.forward_ref"),dx=Symbol.for("react.suspense"),fx=Symbol.for("react.suspense_list"),dE=Symbol.for("react.memo"),kl=Symbol.for("react.lazy"),l9=Symbol.for("react.offscreen"),Q4=Symbol.iterator;function Sh(e){return e===null||typeof e!="object"?null:(e=Q4&&e[Q4]||e["@@iterator"],typeof e=="function"?e:null)}var rr=Object.assign,i2;function Qh(e){if(i2===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);i2=t&&t[1]||""}return`
|
||
`+i2+e}var o2=!1;function s2(e,t){if(!e||o2)return"";o2=!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{o2=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qh(e):""}function bG(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=s2(e.type,!1),e;case 11:return e=s2(e.type.render,!1),e;case 1:return e=s2(e.type,!0),e;default:return""}}function hx(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 Nd:return"Fragment";case Md:return"Portal";case cx:return"Profiler";case uE:return"StrictMode";case dx:return"Suspense";case fx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a9:return(e.displayName||"Context")+".Consumer";case s9:return(e._context.displayName||"Context")+".Provider";case cE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dE:return t=e.displayName||null,t!==null?t:hx(e.type)||"Memo";case kl:t=e._payload,e=e._init;try{return hx(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 hx(t);case 8:return t===uE?"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 uu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function u9(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wG(e){var t=u9(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 ry(e){e._valueTracker||(e._valueTracker=wG(e))}function c9(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=u9(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ev(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 px(e,t){var n=t.checked;return rr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function X4(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=uu(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 d9(e,t){t=t.checked,t!=null&&lE(e,"checked",t,!1)}function gx(e,t){d9(e,t);var n=uu(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")?mx(e,t.type,n):t.hasOwnProperty("defaultValue")&&mx(e,t.type,uu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Y4(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 mx(e,t,n){(t!=="number"||ev(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xh=Array.isArray;function Xd(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+uu(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 yx(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return rr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z4(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(Xh(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:uu(n)}}function f9(e,t){var n=uu(t.value),r=uu(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 J4(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function h9(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 vx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?h9(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var iy,p9=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(iy=iy||document.createElement("div"),iy.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=iy.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 ap={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},xG=["Webkit","ms","Moz","O"];Object.keys(ap).forEach(function(e){xG.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ap[t]=ap[e]})});function g9(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ap.hasOwnProperty(e)&&ap[e]?(""+t).trim():t+"px"}function m9(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=g9(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var CG=rr({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 _x(e,t){if(t){if(CG[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function bx(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 Sx=null;function fE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wx=null,Yd=null,Zd=null;function eA(e){if(e=am(e)){if(typeof wx!="function")throw Error(se(280));var t=e.stateNode;t&&(t=r_(t),wx(e.stateNode,e.type,t))}}function y9(e){Yd?Zd?Zd.push(e):Zd=[e]:Yd=e}function v9(){if(Yd){var e=Yd,t=Zd;if(Zd=Yd=null,eA(e),t)for(e=0;e<t.length;e++)eA(t[e])}}function _9(e,t){return e(t)}function b9(){}var a2=!1;function S9(e,t,n){if(a2)return e(t,n);a2=!0;try{return _9(e,t,n)}finally{a2=!1,(Yd!==null||Zd!==null)&&(b9(),v9())}}function Dp(e,t){var n=e.stateNode;if(n===null)return null;var r=r_(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(se(231,t,typeof n));return n}var xx=!1;if(nl)try{var wh={};Object.defineProperty(wh,"passive",{get:function(){xx=!0}}),window.addEventListener("test",wh,wh),window.removeEventListener("test",wh,wh)}catch{xx=!1}function EG(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 lp=!1,tv=null,nv=!1,Cx=null,TG={onError:function(e){lp=!0,tv=e}};function AG(e,t,n,r,i,o,s,a,l){lp=!1,tv=null,EG.apply(TG,arguments)}function kG(e,t,n,r,i,o,s,a,l){if(AG.apply(this,arguments),lp){if(lp){var u=tv;lp=!1,tv=null}else throw Error(se(198));nv||(nv=!0,Cx=u)}}function Vc(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 w9(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 tA(e){if(Vc(e)!==e)throw Error(se(188))}function PG(e){var t=e.alternate;if(!t){if(t=Vc(e),t===null)throw Error(se(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 tA(i),e;if(o===r)return tA(i),t;o=o.sibling}throw Error(se(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(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function x9(e){return e=PG(e),e!==null?C9(e):null}function C9(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=C9(e);if(t!==null)return t;e=e.sibling}return null}var E9=Io.unstable_scheduleCallback,nA=Io.unstable_cancelCallback,RG=Io.unstable_shouldYield,IG=Io.unstable_requestPaint,yr=Io.unstable_now,OG=Io.unstable_getCurrentPriorityLevel,hE=Io.unstable_ImmediatePriority,T9=Io.unstable_UserBlockingPriority,rv=Io.unstable_NormalPriority,MG=Io.unstable_LowPriority,A9=Io.unstable_IdlePriority,J1=null,aa=null;function NG(e){if(aa&&typeof aa.onCommitFiberRoot=="function")try{aa.onCommitFiberRoot(J1,e,void 0,(e.current.flags&128)===128)}catch{}}var ks=Math.clz32?Math.clz32:$G,DG=Math.log,LG=Math.LN2;function $G(e){return e>>>=0,e===0?32:31-(DG(e)/LG|0)|0}var oy=64,sy=4194304;function Yh(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function iv(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Yh(a):(o&=s,o!==0&&(r=Yh(o)))}else s=n&~i,s!==0?r=Yh(s):o!==0&&(r=Yh(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-ks(t),i=1<<n,r|=e[n],t&=~i;return r}function FG(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 BG(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-ks(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=FG(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function Ex(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function k9(){var e=oy;return oy<<=1,!(oy&4194240)&&(oy=64),e}function l2(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-ks(t),e[t]=n}function zG(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-ks(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function pE(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ks(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var cn=0;function P9(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var R9,gE,I9,O9,M9,Tx=!1,ay=[],Wl=null,Kl=null,Ql=null,Lp=new Map,$p=new Map,Dl=[],jG="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 rA(e,t){switch(e){case"focusin":case"focusout":Wl=null;break;case"dragenter":case"dragleave":Kl=null;break;case"mouseover":case"mouseout":Ql=null;break;case"pointerover":case"pointerout":Lp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$p.delete(t.pointerId)}}function xh(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=am(t),t!==null&&gE(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function UG(e,t,n,r,i){switch(t){case"focusin":return Wl=xh(Wl,e,t,n,r,i),!0;case"dragenter":return Kl=xh(Kl,e,t,n,r,i),!0;case"mouseover":return Ql=xh(Ql,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Lp.set(o,xh(Lp.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,$p.set(o,xh($p.get(o)||null,e,t,n,r,i)),!0}return!1}function N9(e){var t=rc(e.target);if(t!==null){var n=Vc(t);if(n!==null){if(t=n.tag,t===13){if(t=w9(n),t!==null){e.blockedOn=t,M9(e.priority,function(){I9(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 v0(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ax(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sx=r,n.target.dispatchEvent(r),Sx=null}else return t=am(n),t!==null&&gE(t),e.blockedOn=n,!1;t.shift()}return!0}function iA(e,t,n){v0(e)&&n.delete(t)}function VG(){Tx=!1,Wl!==null&&v0(Wl)&&(Wl=null),Kl!==null&&v0(Kl)&&(Kl=null),Ql!==null&&v0(Ql)&&(Ql=null),Lp.forEach(iA),$p.forEach(iA)}function Ch(e,t){e.blockedOn===t&&(e.blockedOn=null,Tx||(Tx=!0,Io.unstable_scheduleCallback(Io.unstable_NormalPriority,VG)))}function Fp(e){function t(i){return Ch(i,e)}if(0<ay.length){Ch(ay[0],e);for(var n=1;n<ay.length;n++){var r=ay[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Wl!==null&&Ch(Wl,e),Kl!==null&&Ch(Kl,e),Ql!==null&&Ch(Ql,e),Lp.forEach(t),$p.forEach(t),n=0;n<Dl.length;n++)r=Dl[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Dl.length&&(n=Dl[0],n.blockedOn===null);)N9(n),n.blockedOn===null&&Dl.shift()}var Jd=dl.ReactCurrentBatchConfig,ov=!0;function GG(e,t,n,r){var i=cn,o=Jd.transition;Jd.transition=null;try{cn=1,mE(e,t,n,r)}finally{cn=i,Jd.transition=o}}function qG(e,t,n,r){var i=cn,o=Jd.transition;Jd.transition=null;try{cn=4,mE(e,t,n,r)}finally{cn=i,Jd.transition=o}}function mE(e,t,n,r){if(ov){var i=Ax(e,t,n,r);if(i===null)v2(e,t,r,sv,n),rA(e,r);else if(UG(i,e,t,n,r))r.stopPropagation();else if(rA(e,r),t&4&&-1<jG.indexOf(e)){for(;i!==null;){var o=am(i);if(o!==null&&R9(o),o=Ax(e,t,n,r),o===null&&v2(e,t,r,sv,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else v2(e,t,r,null,n)}}var sv=null;function Ax(e,t,n,r){if(sv=null,e=fE(r),e=rc(e),e!==null)if(t=Vc(e),t===null)e=null;else if(n=t.tag,n===13){if(e=w9(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 sv=e,null}function D9(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(OG()){case hE:return 1;case T9:return 4;case rv:case MG:return 16;case A9:return 536870912;default:return 16}default:return 16}}var zl=null,yE=null,_0=null;function L9(){if(_0)return _0;var e,t=yE,n=t.length,r,i="value"in zl?zl.value:zl.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 _0=i.slice(e,1<r?1-r:void 0)}function b0(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 ly(){return!0}function oA(){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)?ly:oA,this.isPropagationStopped=oA,this}return rr(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=ly)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ly)},persist:function(){},isPersistent:ly}),t}var Jf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vE=$o(Jf),sm=rr({},Jf,{view:0,detail:0}),HG=$o(sm),u2,c2,Eh,e_=rr({},sm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_E,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!==Eh&&(Eh&&e.type==="mousemove"?(u2=e.screenX-Eh.screenX,c2=e.screenY-Eh.screenY):c2=u2=0,Eh=e),u2)},movementY:function(e){return"movementY"in e?e.movementY:c2}}),sA=$o(e_),WG=rr({},e_,{dataTransfer:0}),KG=$o(WG),QG=rr({},sm,{relatedTarget:0}),d2=$o(QG),XG=rr({},Jf,{animationName:0,elapsedTime:0,pseudoElement:0}),YG=$o(XG),ZG=rr({},Jf,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JG=$o(ZG),eq=rr({},Jf,{data:0}),aA=$o(eq),tq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nq={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"},rq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iq(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rq[e])?!!t[e]:!1}function _E(){return iq}var oq=rr({},sm,{key:function(e){if(e.key){var t=tq[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=b0(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nq[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_E,charCode:function(e){return e.type==="keypress"?b0(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?b0(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sq=$o(oq),aq=rr({},e_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lA=$o(aq),lq=rr({},sm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_E}),uq=$o(lq),cq=rr({},Jf,{propertyName:0,elapsedTime:0,pseudoElement:0}),dq=$o(cq),fq=rr({},e_,{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}),hq=$o(fq),pq=[9,13,27,32],bE=nl&&"CompositionEvent"in window,up=null;nl&&"documentMode"in document&&(up=document.documentMode);var gq=nl&&"TextEvent"in window&&!up,$9=nl&&(!bE||up&&8<up&&11>=up),uA=String.fromCharCode(32),cA=!1;function F9(e,t){switch(e){case"keyup":return pq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B9(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dd=!1;function mq(e,t){switch(e){case"compositionend":return B9(t);case"keypress":return t.which!==32?null:(cA=!0,uA);case"textInput":return e=t.data,e===uA&&cA?null:e;default:return null}}function yq(e,t){if(Dd)return e==="compositionend"||!bE&&F9(e,t)?(e=L9(),_0=yE=zl=null,Dd=!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 $9&&t.locale!=="ko"?null:t.data;default:return null}}var vq={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 dA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vq[e.type]:t==="textarea"}function z9(e,t,n,r){y9(r),t=av(t,"onChange"),0<t.length&&(n=new vE("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var cp=null,Bp=null;function _q(e){Y9(e,0)}function t_(e){var t=Fd(e);if(c9(t))return e}function bq(e,t){if(e==="change")return t}var j9=!1;if(nl){var f2;if(nl){var h2="oninput"in document;if(!h2){var fA=document.createElement("div");fA.setAttribute("oninput","return;"),h2=typeof fA.oninput=="function"}f2=h2}else f2=!1;j9=f2&&(!document.documentMode||9<document.documentMode)}function hA(){cp&&(cp.detachEvent("onpropertychange",U9),Bp=cp=null)}function U9(e){if(e.propertyName==="value"&&t_(Bp)){var t=[];z9(t,Bp,e,fE(e)),S9(_q,t)}}function Sq(e,t,n){e==="focusin"?(hA(),cp=t,Bp=n,cp.attachEvent("onpropertychange",U9)):e==="focusout"&&hA()}function wq(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return t_(Bp)}function xq(e,t){if(e==="click")return t_(t)}function Cq(e,t){if(e==="input"||e==="change")return t_(t)}function Eq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ns=typeof Object.is=="function"?Object.is:Eq;function zp(e,t){if(Ns(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(!ux.call(t,i)||!Ns(e[i],t[i]))return!1}return!0}function pA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gA(e,t){var n=pA(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=pA(n)}}function V9(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?V9(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G9(){for(var e=window,t=ev();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ev(e.document)}return t}function SE(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 Tq(e){var t=G9(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&V9(n.ownerDocument.documentElement,n)){if(r!==null&&SE(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=gA(n,o);var s=gA(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 Aq=nl&&"documentMode"in document&&11>=document.documentMode,Ld=null,kx=null,dp=null,Px=!1;function mA(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Px||Ld==null||Ld!==ev(r)||(r=Ld,"selectionStart"in r&&SE(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}),dp&&zp(dp,r)||(dp=r,r=av(kx,"onSelect"),0<r.length&&(t=new vE("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ld)))}function uy(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $d={animationend:uy("Animation","AnimationEnd"),animationiteration:uy("Animation","AnimationIteration"),animationstart:uy("Animation","AnimationStart"),transitionend:uy("Transition","TransitionEnd")},p2={},q9={};nl&&(q9=document.createElement("div").style,"AnimationEvent"in window||(delete $d.animationend.animation,delete $d.animationiteration.animation,delete $d.animationstart.animation),"TransitionEvent"in window||delete $d.transitionend.transition);function n_(e){if(p2[e])return p2[e];if(!$d[e])return e;var t=$d[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in q9)return p2[e]=t[n];return e}var H9=n_("animationend"),W9=n_("animationiteration"),K9=n_("animationstart"),Q9=n_("transitionend"),X9=new Map,yA="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 Eu(e,t){X9.set(e,t),Uc(t,[e])}for(var g2=0;g2<yA.length;g2++){var m2=yA[g2],kq=m2.toLowerCase(),Pq=m2[0].toUpperCase()+m2.slice(1);Eu(kq,"on"+Pq)}Eu(H9,"onAnimationEnd");Eu(W9,"onAnimationIteration");Eu(K9,"onAnimationStart");Eu("dblclick","onDoubleClick");Eu("focusin","onFocus");Eu("focusout","onBlur");Eu(Q9,"onTransitionEnd");wf("onMouseEnter",["mouseout","mouseover"]);wf("onMouseLeave",["mouseout","mouseover"]);wf("onPointerEnter",["pointerout","pointerover"]);wf("onPointerLeave",["pointerout","pointerover"]);Uc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Uc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Uc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Uc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Uc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Uc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Rq=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zh));function vA(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,kG(r,t,void 0,e),e.currentTarget=null}function Y9(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;vA(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;vA(i,a,u),o=l}}}if(nv)throw e=Cx,nv=!1,Cx=null,e}function Mn(e,t){var n=t[Nx];n===void 0&&(n=t[Nx]=new Set);var r=e+"__bubble";n.has(r)||(Z9(t,e,2,!1),n.add(r))}function y2(e,t,n){var r=0;t&&(r|=4),Z9(n,e,r,t)}var cy="_reactListening"+Math.random().toString(36).slice(2);function jp(e){if(!e[cy]){e[cy]=!0,o9.forEach(function(n){n!=="selectionchange"&&(Rq.has(n)||y2(n,!1,e),y2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cy]||(t[cy]=!0,y2("selectionchange",!1,t))}}function Z9(e,t,n,r){switch(D9(t)){case 1:var i=GG;break;case 4:i=qG;break;default:i=mE}n=i.bind(null,t,n,e),i=void 0,!xx||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 v2(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=rc(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}S9(function(){var u=o,c=fE(n),d=[];e:{var f=X9.get(e);if(f!==void 0){var h=vE,p=e;switch(e){case"keypress":if(b0(n)===0)break e;case"keydown":case"keyup":h=sq;break;case"focusin":p="focus",h=d2;break;case"focusout":p="blur",h=d2;break;case"beforeblur":case"afterblur":h=d2;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=sA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=KG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=uq;break;case H9:case W9:case K9:h=YG;break;case Q9:h=dq;break;case"scroll":h=HG;break;case"wheel":h=hq;break;case"copy":case"cut":case"paste":h=JG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=lA}var m=(t&4)!==0,b=!m&&e==="scroll",_=m?f!==null?f+"Capture":null:f;m=[];for(var v=u,g;v!==null;){g=v;var y=g.stateNode;if(g.tag===5&&y!==null&&(g=y,_!==null&&(y=Dp(v,_),y!=null&&m.push(Up(v,y,g)))),b)break;v=v.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!==Sx&&(p=n.relatedTarget||n.fromElement)&&(rc(p)||p[rl]))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?rc(p):null,p!==null&&(b=Vc(p),p!==b||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(m=sA,y="onMouseLeave",_="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=lA,y="onPointerLeave",_="onPointerEnter",v="pointer"),b=h==null?f:Fd(h),g=p==null?f:Fd(p),f=new m(y,v+"leave",h,n,c),f.target=b,f.relatedTarget=g,y=null,rc(c)===u&&(m=new m(_,v+"enter",p,n,c),m.target=g,m.relatedTarget=b,y=m),b=y,h&&p)t:{for(m=h,_=p,v=0,g=m;g;g=dd(g))v++;for(g=0,y=_;y;y=dd(y))g++;for(;0<v-g;)m=dd(m),v--;for(;0<g-v;)_=dd(_),g--;for(;v--;){if(m===_||_!==null&&m===_.alternate)break t;m=dd(m),_=dd(_)}m=null}else m=null;h!==null&&_A(d,f,h,m,!1),p!==null&&b!==null&&_A(d,b,p,m,!0)}}e:{if(f=u?Fd(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=bq;else if(dA(f))if(j9)S=Cq;else{S=wq;var w=Sq}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=xq);if(S&&(S=S(e,u))){z9(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&mx(f,"number",f.value)}switch(w=u?Fd(u):window,e){case"focusin":(dA(w)||w.contentEditable==="true")&&(Ld=w,kx=u,dp=null);break;case"focusout":dp=kx=Ld=null;break;case"mousedown":Px=!0;break;case"contextmenu":case"mouseup":case"dragend":Px=!1,mA(d,n,c);break;case"selectionchange":if(Aq)break;case"keydown":case"keyup":mA(d,n,c)}var x;if(bE)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 Dd?F9(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&($9&&n.locale!=="ko"&&(Dd||C!=="onCompositionStart"?C==="onCompositionEnd"&&Dd&&(x=L9()):(zl=c,yE="value"in zl?zl.value:zl.textContent,Dd=!0)),w=av(u,C),0<w.length&&(C=new aA(C,e,null,n,c),d.push({event:C,listeners:w}),x?C.data=x:(x=B9(n),x!==null&&(C.data=x)))),(x=gq?mq(e,n):yq(e,n))&&(u=av(u,"onBeforeInput"),0<u.length&&(c=new aA("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}Y9(d,t)})}function Up(e,t,n){return{instance:e,listener:t,currentTarget:n}}function av(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Dp(e,n),o!=null&&r.unshift(Up(e,o,i)),o=Dp(e,t),o!=null&&r.push(Up(e,o,i))),e=e.return}return r}function dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _A(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(Up(n,l,a))):i||(l=Dp(n,o),l!=null&&s.push(Up(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Iq=/\r\n?/g,Oq=/\u0000|\uFFFD/g;function bA(e){return(typeof e=="string"?e:""+e).replace(Iq,`
|
||
`).replace(Oq,"")}function dy(e,t,n){if(t=bA(t),bA(e)!==t&&n)throw Error(se(425))}function lv(){}var Rx=null,Ix=null;function Ox(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 Mx=typeof setTimeout=="function"?setTimeout:void 0,Mq=typeof clearTimeout=="function"?clearTimeout:void 0,SA=typeof Promise=="function"?Promise:void 0,Nq=typeof queueMicrotask=="function"?queueMicrotask:typeof SA<"u"?function(e){return SA.resolve(null).then(e).catch(Dq)}:Mx;function Dq(e){setTimeout(function(){throw e})}function _2(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 Xl(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 wA(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),ea="__reactFiber$"+eh,Vp="__reactProps$"+eh,rl="__reactContainer$"+eh,Nx="__reactEvents$"+eh,Lq="__reactListeners$"+eh,$q="__reactHandles$"+eh;function rc(e){var t=e[ea];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rl]||n[ea]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wA(e);e!==null;){if(n=e[ea])return n;e=wA(e)}return t}e=n,n=e.parentNode}return null}function am(e){return e=e[ea]||e[rl],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fd(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function r_(e){return e[Vp]||null}var Dx=[],Bd=-1;function Tu(e){return{current:e}}function jn(e){0>Bd||(e.current=Dx[Bd],Dx[Bd]=null,Bd--)}function Tn(e,t){Bd++,Dx[Bd]=e.current,e.current=t}var cu={},Li=Tu(cu),uo=Tu(!1),xc=cu;function xf(e,t){var n=e.type.contextTypes;if(!n)return cu;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 co(e){return e=e.childContextTypes,e!=null}function uv(){jn(uo),jn(Li)}function xA(e,t,n){if(Li.current!==cu)throw Error(se(168));Tn(Li,t),Tn(uo,n)}function J9(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(se(108,SG(e)||"Unknown",i));return rr({},n,r)}function cv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cu,xc=Li.current,Tn(Li,e),Tn(uo,uo.current),!0}function CA(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=J9(e,t,xc),r.__reactInternalMemoizedMergedChildContext=e,jn(uo),jn(Li),Tn(Li,e)):jn(uo),Tn(uo,n)}var za=null,i_=!1,b2=!1;function eM(e){za===null?za=[e]:za.push(e)}function Fq(e){i_=!0,eM(e)}function Au(){if(!b2&&za!==null){b2=!0;var e=0,t=cn;try{var n=za;for(cn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}za=null,i_=!1}catch(i){throw za!==null&&(za=za.slice(e+1)),E9(hE,Au),i}finally{cn=t,b2=!1}}return null}var zd=[],jd=0,dv=null,fv=0,Ho=[],Wo=0,Cc=null,Ga=1,qa="";function Wu(e,t){zd[jd++]=fv,zd[jd++]=dv,dv=e,fv=t}function tM(e,t,n){Ho[Wo++]=Ga,Ho[Wo++]=qa,Ho[Wo++]=Cc,Cc=e;var r=Ga;e=qa;var i=32-ks(r)-1;r&=~(1<<i),n+=1;var o=32-ks(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Ga=1<<32-ks(t)+i|n<<i|r,qa=o+e}else Ga=1<<o|n<<i|r,qa=e}function wE(e){e.return!==null&&(Wu(e,1),tM(e,1,0))}function xE(e){for(;e===dv;)dv=zd[--jd],zd[jd]=null,fv=zd[--jd],zd[jd]=null;for(;e===Cc;)Cc=Ho[--Wo],Ho[Wo]=null,qa=Ho[--Wo],Ho[Wo]=null,Ga=Ho[--Wo],Ho[Wo]=null}var Po=null,Ao=null,Wn=!1,bs=null;function nM(e,t){var n=Xo(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 EA(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,Po=e,Ao=Xl(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Po=e,Ao=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Cc!==null?{id:Ga,overflow:qa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xo(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Po=e,Ao=null,!0):!1;default:return!1}}function Lx(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $x(e){if(Wn){var t=Ao;if(t){var n=t;if(!EA(e,t)){if(Lx(e))throw Error(se(418));t=Xl(n.nextSibling);var r=Po;t&&EA(e,t)?nM(r,n):(e.flags=e.flags&-4097|2,Wn=!1,Po=e)}}else{if(Lx(e))throw Error(se(418));e.flags=e.flags&-4097|2,Wn=!1,Po=e}}}function TA(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Po=e}function fy(e){if(e!==Po)return!1;if(!Wn)return TA(e),Wn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ox(e.type,e.memoizedProps)),t&&(t=Ao)){if(Lx(e))throw rM(),Error(se(418));for(;t;)nM(e,t),t=Xl(t.nextSibling)}if(TA(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ao=Xl(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ao=null}}else Ao=Po?Xl(e.stateNode.nextSibling):null;return!0}function rM(){for(var e=Ao;e;)e=Xl(e.nextSibling)}function Cf(){Ao=Po=null,Wn=!1}function CE(e){bs===null?bs=[e]:bs.push(e)}var Bq=dl.ReactCurrentBatchConfig;function ys(e,t){if(e&&e.defaultProps){t=rr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var hv=Tu(null),pv=null,Ud=null,EE=null;function TE(){EE=Ud=pv=null}function AE(e){var t=hv.current;jn(hv),e._currentValue=t}function Fx(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){pv=e,EE=Ud=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(oo=!0),e.firstContext=null)}function Jo(e){var t=e._currentValue;if(EE!==e)if(e={context:e,memoizedValue:t,next:null},Ud===null){if(pv===null)throw Error(se(308));Ud=e,pv.dependencies={lanes:0,firstContext:e}}else Ud=Ud.next=e;return t}var ic=null;function kE(e){ic===null?ic=[e]:ic.push(e)}function iM(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,kE(t)):(n.next=i.next,i.next=n),t.interleaved=n,il(e,r)}function il(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 Pl=!1;function PE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oM(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 Ka(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ut&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,il(e,n)}return i=r.interleaved,i===null?(t.next=t,kE(r)):(t.next=i.next,i.next=t),r.interleaved=t,il(e,n)}function S0(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,pE(e,n)}}function AA(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 gv(e,t,n,r){var i=e.updateQueue;Pl=!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=rr({},d,f);break e;case 2:Pl=!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);Tc|=s,e.lanes=s,e.memoizedState=d}}function kA(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(se(191,i));i.call(r)}}}var sM=new i9.Component().refs;function Bx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:rr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var o_={isMounted:function(e){return(e=e._reactInternals)?Vc(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qi(),i=Jl(e),o=Ka(r,i);o.payload=t,n!=null&&(o.callback=n),t=Yl(e,o,i),t!==null&&(Ps(t,e,i,r),S0(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qi(),i=Jl(e),o=Ka(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Yl(e,o,i),t!==null&&(Ps(t,e,i,r),S0(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qi(),r=Jl(e),i=Ka(n,r);i.tag=2,t!=null&&(i.callback=t),t=Yl(e,i,r),t!==null&&(Ps(t,e,r,n),S0(t,e,r))}};function PA(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 aM(e,t,n){var r=!1,i=cu,o=t.contextType;return typeof o=="object"&&o!==null?o=Jo(o):(i=co(t)?xc:Li.current,r=t.contextTypes,o=(r=r!=null)?xf(e,i):cu),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=o_,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function RA(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&&o_.enqueueReplaceState(t,t.state,null)}function zx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=sM,PE(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Jo(o):(o=co(t)?xc:Li.current,i.context=xf(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Bx(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&&o_.enqueueReplaceState(i,i.state,null),gv(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Th(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(se(309));var r=n.stateNode}if(!r)throw Error(se(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===sM&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(se(284));if(!n._owner)throw Error(se(290,e))}return e}function hy(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function IA(e){var t=e._init;return t(e._payload)}function lM(e){function t(_,v){if(e){var g=_.deletions;g===null?(_.deletions=[v],_.flags|=16):g.push(v)}}function n(_,v){if(!e)return null;for(;v!==null;)t(_,v),v=v.sibling;return null}function r(_,v){for(_=new Map;v!==null;)v.key!==null?_.set(v.key,v):_.set(v.index,v),v=v.sibling;return _}function i(_,v){return _=eu(_,v),_.index=0,_.sibling=null,_}function o(_,v,g){return _.index=g,e?(g=_.alternate,g!==null?(g=g.index,g<v?(_.flags|=2,v):g):(_.flags|=2,v)):(_.flags|=1048576,v)}function s(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,v,g,y){return v===null||v.tag!==6?(v=A2(g,_.mode,y),v.return=_,v):(v=i(v,g),v.return=_,v)}function l(_,v,g,y){var S=g.type;return S===Nd?c(_,v,g.props.children,y,g.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===kl&&IA(S)===v.type)?(y=i(v,g.props),y.ref=Th(_,v,g),y.return=_,y):(y=A0(g.type,g.key,g.props,null,_.mode,y),y.ref=Th(_,v,g),y.return=_,y)}function u(_,v,g,y){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=k2(g,_.mode,y),v.return=_,v):(v=i(v,g.children||[]),v.return=_,v)}function c(_,v,g,y,S){return v===null||v.tag!==7?(v=mc(g,_.mode,y,S),v.return=_,v):(v=i(v,g),v.return=_,v)}function d(_,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=A2(""+v,_.mode,g),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ny:return g=A0(v.type,v.key,v.props,null,_.mode,g),g.ref=Th(_,null,v),g.return=_,g;case Md:return v=k2(v,_.mode,g),v.return=_,v;case kl:var y=v._init;return d(_,y(v._payload),g)}if(Xh(v)||Sh(v))return v=mc(v,_.mode,g,null),v.return=_,v;hy(_,v)}return null}function f(_,v,g,y){var S=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:a(_,v,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ny:return g.key===S?l(_,v,g,y):null;case Md:return g.key===S?u(_,v,g,y):null;case kl:return S=g._init,f(_,v,S(g._payload),y)}if(Xh(g)||Sh(g))return S!==null?null:c(_,v,g,y,null);hy(_,g)}return null}function h(_,v,g,y,S){if(typeof y=="string"&&y!==""||typeof y=="number")return _=_.get(g)||null,a(v,_,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ny:return _=_.get(y.key===null?g:y.key)||null,l(v,_,y,S);case Md:return _=_.get(y.key===null?g:y.key)||null,u(v,_,y,S);case kl:var w=y._init;return h(_,v,g,w(y._payload),S)}if(Xh(y)||Sh(y))return _=_.get(g)||null,c(v,_,y,S,null);hy(v,y)}return null}function p(_,v,g,y){for(var S=null,w=null,x=v,C=v=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],y);if(T===null){x===null&&(x=A);break}e&&x&&T.alternate===null&&t(_,x),v=o(T,v,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],y),x!==null&&(v=o(x,v,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],y),A!==null&&(e&&A.alternate!==null&&x.delete(A.key===null?C:A.key),v=o(A,v,C),w===null?S=A:w.sibling=A,w=A);return e&&x.forEach(function(P){return t(_,P)}),Wn&&Wu(_,C),S}function m(_,v,g,y){var S=Sh(g);if(typeof S!="function")throw Error(se(150));if(g=S.call(g),g==null)throw Error(se(151));for(var w=S=null,x=v,C=v=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 P=f(_,x,T.value,y);if(P===null){x===null&&(x=A);break}e&&x&&P.alternate===null&&t(_,x),v=o(P,v,C),w===null?S=P:w.sibling=P,w=P,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,y),T!==null&&(v=o(T,v,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,y),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?C:T.key),v=o(T,v,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(_,v,g,y){if(typeof g=="object"&&g!==null&&g.type===Nd&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ny:e:{for(var S=g.key,w=v;w!==null;){if(w.key===S){if(S=g.type,S===Nd){if(w.tag===7){n(_,w.sibling),v=i(w,g.props.children),v.return=_,_=v;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===kl&&IA(S)===w.type){n(_,w.sibling),v=i(w,g.props),v.ref=Th(_,w,g),v.return=_,_=v;break e}n(_,w);break}else t(_,w);w=w.sibling}g.type===Nd?(v=mc(g.props.children,_.mode,y,g.key),v.return=_,_=v):(y=A0(g.type,g.key,g.props,null,_.mode,y),y.ref=Th(_,v,g),y.return=_,_=y)}return s(_);case Md:e:{for(w=g.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(_,v.sibling),v=i(v,g.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=k2(g,_.mode,y),v.return=_,_=v}return s(_);case kl:return w=g._init,b(_,v,w(g._payload),y)}if(Xh(g))return p(_,v,g,y);if(Sh(g))return m(_,v,g,y);hy(_,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(_,v.sibling),v=i(v,g),v.return=_,_=v):(n(_,v),v=A2(g,_.mode,y),v.return=_,_=v),s(_)):n(_,v)}return b}var Ef=lM(!0),uM=lM(!1),lm={},la=Tu(lm),Gp=Tu(lm),qp=Tu(lm);function oc(e){if(e===lm)throw Error(se(174));return e}function RE(e,t){switch(Tn(qp,t),Tn(Gp,e),Tn(la,lm),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vx(t,e)}jn(la),Tn(la,t)}function Tf(){jn(la),jn(Gp),jn(qp)}function cM(e){oc(qp.current);var t=oc(la.current),n=vx(t,e.type);t!==n&&(Tn(Gp,e),Tn(la,n))}function IE(e){Gp.current===e&&(jn(la),jn(Gp))}var er=Tu(0);function mv(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 S2=[];function OE(){for(var e=0;e<S2.length;e++)S2[e]._workInProgressVersionPrimary=null;S2.length=0}var w0=dl.ReactCurrentDispatcher,w2=dl.ReactCurrentBatchConfig,Ec=0,nr=null,Lr=null,Zr=null,yv=!1,fp=!1,Hp=0,zq=0;function Ti(){throw Error(se(321))}function ME(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ns(e[n],t[n]))return!1;return!0}function NE(e,t,n,r,i,o){if(Ec=o,nr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w0.current=e===null||e.memoizedState===null?Gq:qq,e=n(r,i),fp){o=0;do{if(fp=!1,Hp=0,25<=o)throw Error(se(301));o+=1,Zr=Lr=null,t.updateQueue=null,w0.current=Hq,e=n(r,i)}while(fp)}if(w0.current=vv,t=Lr!==null&&Lr.next!==null,Ec=0,Zr=Lr=nr=null,yv=!1,t)throw Error(se(300));return e}function DE(){var e=Hp!==0;return Hp=0,e}function Ks(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zr===null?nr.memoizedState=Zr=e:Zr=Zr.next=e,Zr}function es(){if(Lr===null){var e=nr.alternate;e=e!==null?e.memoizedState:null}else e=Lr.next;var t=Zr===null?nr.memoizedState:Zr.next;if(t!==null)Zr=t,Lr=e;else{if(e===null)throw Error(se(310));Lr=e,e={memoizedState:Lr.memoizedState,baseState:Lr.baseState,baseQueue:Lr.baseQueue,queue:Lr.queue,next:null},Zr===null?nr.memoizedState=Zr=e:Zr=Zr.next=e}return Zr}function Wp(e,t){return typeof t=="function"?t(e):t}function x2(e){var t=es(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=Lr,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((Ec&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,nr.lanes|=c,Tc|=c}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,Ns(r,t.memoizedState)||(oo=!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,nr.lanes|=o,Tc|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function C2(e){var t=es(),n=t.queue;if(n===null)throw Error(se(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);Ns(o,t.memoizedState)||(oo=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function dM(){}function fM(e,t){var n=nr,r=es(),i=t(),o=!Ns(r.memoizedState,i);if(o&&(r.memoizedState=i,oo=!0),r=r.queue,LE(gM.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Zr!==null&&Zr.memoizedState.tag&1){if(n.flags|=2048,Kp(9,pM.bind(null,n,r,i,t),void 0,null),ti===null)throw Error(se(349));Ec&30||hM(n,t,i)}return i}function hM(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nr.updateQueue,t===null?(t={lastEffect:null,stores:null},nr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function pM(e,t,n,r){t.value=n,t.getSnapshot=r,mM(t)&&yM(e)}function gM(e,t,n){return n(function(){mM(t)&&yM(e)})}function mM(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ns(e,n)}catch{return!0}}function yM(e){var t=il(e,1);t!==null&&Ps(t,e,1,-1)}function OA(e){var t=Ks();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=Vq.bind(null,nr,e),[t.memoizedState,e]}function Kp(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=nr.updateQueue,t===null?(t={lastEffect:null,stores:null},nr.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 vM(){return es().memoizedState}function x0(e,t,n,r){var i=Ks();nr.flags|=e,i.memoizedState=Kp(1|t,n,void 0,r===void 0?null:r)}function s_(e,t,n,r){var i=es();r=r===void 0?null:r;var o=void 0;if(Lr!==null){var s=Lr.memoizedState;if(o=s.destroy,r!==null&&ME(r,s.deps)){i.memoizedState=Kp(t,n,o,r);return}}nr.flags|=e,i.memoizedState=Kp(1|t,n,o,r)}function MA(e,t){return x0(8390656,8,e,t)}function LE(e,t){return s_(2048,8,e,t)}function _M(e,t){return s_(4,2,e,t)}function bM(e,t){return s_(4,4,e,t)}function SM(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 wM(e,t,n){return n=n!=null?n.concat([e]):null,s_(4,4,SM.bind(null,t,e),n)}function $E(){}function xM(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ME(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function CM(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ME(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function EM(e,t,n){return Ec&21?(Ns(n,t)||(n=k9(),nr.lanes|=n,Tc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,oo=!0),e.memoizedState=n)}function jq(e,t){var n=cn;cn=n!==0&&4>n?n:4,e(!0);var r=w2.transition;w2.transition={};try{e(!1),t()}finally{cn=n,w2.transition=r}}function TM(){return es().memoizedState}function Uq(e,t,n){var r=Jl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},AM(e))kM(t,n);else if(n=iM(e,t,n,r),n!==null){var i=qi();Ps(n,e,r,i),PM(n,t,r)}}function Vq(e,t,n){var r=Jl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(AM(e))kM(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,Ns(a,s)){var l=t.interleaved;l===null?(i.next=i,kE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=iM(e,t,i,r),n!==null&&(i=qi(),Ps(n,e,r,i),PM(n,t,r))}}function AM(e){var t=e.alternate;return e===nr||t!==null&&t===nr}function kM(e,t){fp=yv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function PM(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pE(e,n)}}var vv={readContext:Jo,useCallback:Ti,useContext:Ti,useEffect:Ti,useImperativeHandle:Ti,useInsertionEffect:Ti,useLayoutEffect:Ti,useMemo:Ti,useReducer:Ti,useRef:Ti,useState:Ti,useDebugValue:Ti,useDeferredValue:Ti,useTransition:Ti,useMutableSource:Ti,useSyncExternalStore:Ti,useId:Ti,unstable_isNewReconciler:!1},Gq={readContext:Jo,useCallback:function(e,t){return Ks().memoizedState=[e,t===void 0?null:t],e},useContext:Jo,useEffect:MA,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,x0(4194308,4,SM.bind(null,t,e),n)},useLayoutEffect:function(e,t){return x0(4194308,4,e,t)},useInsertionEffect:function(e,t){return x0(4,2,e,t)},useMemo:function(e,t){var n=Ks();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ks();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=Uq.bind(null,nr,e),[r.memoizedState,e]},useRef:function(e){var t=Ks();return e={current:e},t.memoizedState=e},useState:OA,useDebugValue:$E,useDeferredValue:function(e){return Ks().memoizedState=e},useTransition:function(){var e=OA(!1),t=e[0];return e=jq.bind(null,e[1]),Ks().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nr,i=Ks();if(Wn){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),ti===null)throw Error(se(349));Ec&30||hM(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,MA(gM.bind(null,r,o,e),[e]),r.flags|=2048,Kp(9,pM.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ks(),t=ti.identifierPrefix;if(Wn){var n=qa,r=Ga;n=(r&~(1<<32-ks(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Hp++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=zq++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},qq={readContext:Jo,useCallback:xM,useContext:Jo,useEffect:LE,useImperativeHandle:wM,useInsertionEffect:_M,useLayoutEffect:bM,useMemo:CM,useReducer:x2,useRef:vM,useState:function(){return x2(Wp)},useDebugValue:$E,useDeferredValue:function(e){var t=es();return EM(t,Lr.memoizedState,e)},useTransition:function(){var e=x2(Wp)[0],t=es().memoizedState;return[e,t]},useMutableSource:dM,useSyncExternalStore:fM,useId:TM,unstable_isNewReconciler:!1},Hq={readContext:Jo,useCallback:xM,useContext:Jo,useEffect:LE,useImperativeHandle:wM,useInsertionEffect:_M,useLayoutEffect:bM,useMemo:CM,useReducer:C2,useRef:vM,useState:function(){return C2(Wp)},useDebugValue:$E,useDeferredValue:function(e){var t=es();return Lr===null?t.memoizedState=e:EM(t,Lr.memoizedState,e)},useTransition:function(){var e=C2(Wp)[0],t=es().memoizedState;return[e,t]},useMutableSource:dM,useSyncExternalStore:fM,useId:TM,unstable_isNewReconciler:!1};function Af(e,t){try{var n="",r=t;do n+=bG(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 E2(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jx(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Wq=typeof WeakMap=="function"?WeakMap:Map;function RM(e,t,n){n=Ka(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bv||(bv=!0,Yx=r),jx(e,t)},n}function IM(e,t,n){n=Ka(-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(){jx(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){jx(e,t),typeof r!="function"&&(Zl===null?Zl=new Set([this]):Zl.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function NA(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wq;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=aH.bind(null,e,t,n),t.then(e,e))}function DA(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 LA(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=Ka(-1,1),t.tag=2,Yl(n,t,1))),n.lanes|=1),e)}var Kq=dl.ReactCurrentOwner,oo=!1;function Vi(e,t,n,r){t.child=e===null?uM(t,null,n,r):Ef(t,e.child,n,r)}function $A(e,t,n,r,i){n=n.render;var o=t.ref;return ef(t,i),r=NE(e,t,n,r,o,i),n=DE(),e!==null&&!oo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ol(e,t,i)):(Wn&&n&&wE(t),t.flags|=1,Vi(e,t,r,i),t.child)}function FA(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!qE(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,OM(e,t,o,r,i)):(e=A0(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 ol(e,t,i)}return t.flags|=1,e=eu(o,r),e.ref=t.ref,e.return=t,t.child=e}function OM(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(zp(o,r)&&e.ref===t.ref)if(oo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(oo=!0);else return t.lanes=e.lanes,ol(e,t,i)}return Ux(e,t,n,r,i)}function MM(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},Tn(Gd,Co),Co|=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,Tn(Gd,Co),Co|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Tn(Gd,Co),Co|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Tn(Gd,Co),Co|=r;return Vi(e,t,i,n),t.child}function NM(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ux(e,t,n,r,i){var o=co(n)?xc:Li.current;return o=xf(t,o),ef(t,i),n=NE(e,t,n,r,o,i),r=DE(),e!==null&&!oo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ol(e,t,i)):(Wn&&r&&wE(t),t.flags|=1,Vi(e,t,n,i),t.child)}function BA(e,t,n,r,i){if(co(n)){var o=!0;cv(t)}else o=!1;if(ef(t,i),t.stateNode===null)C0(e,t),aM(t,n,r),zx(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=co(n)?xc:Li.current,u=xf(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)&&RA(t,s,r,u),Pl=!1;var f=t.memoizedState;s.state=f,gv(t,r,s,i),l=t.memoizedState,a!==r||f!==l||uo.current||Pl?(typeof c=="function"&&(Bx(t,n,c,r),l=t.memoizedState),(a=Pl||PA(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,oM(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=co(n)?xc:Li.current,l=xf(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)&&RA(t,s,r,l),Pl=!1,f=t.memoizedState,s.state=f,gv(t,r,s,i);var p=t.memoizedState;a!==d||f!==p||uo.current||Pl?(typeof h=="function"&&(Bx(t,n,h,r),p=t.memoizedState),(u=Pl||PA(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 Vx(e,t,n,r,o,i)}function Vx(e,t,n,r,i,o){NM(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&CA(t,n,!1),ol(e,t,o);r=t.stateNode,Kq.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ef(t,e.child,null,o),t.child=Ef(t,null,a,o)):Vi(e,t,a,o),t.memoizedState=r.state,i&&CA(t,n,!0),t.child}function DM(e){var t=e.stateNode;t.pendingContext?xA(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xA(e,t.context,!1),RE(e,t.containerInfo)}function zA(e,t,n,r,i){return Cf(),CE(i),t.flags|=256,Vi(e,t,n,r),t.child}var Gx={dehydrated:null,treeContext:null,retryLane:0};function qx(e){return{baseLanes:e,cachePool:null,transitions:null}}function LM(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),Tn(er,i&1),e===null)return $x(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=u_(s,r,0,null),e=mc(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=qx(n),t.memoizedState=Gx,e):FE(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Qq(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=eu(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=eu(a,o):(o=mc(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?qx(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Gx,r}return o=e.child,e=o.sibling,r=eu(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 FE(e,t){return t=u_({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function py(e,t,n,r){return r!==null&&CE(r),Ef(t,e.child,null,n),e=FE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qq(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=E2(Error(se(422))),py(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=u_({mode:"visible",children:r.children},i,0,null),o=mc(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Ef(t,e.child,null,s),t.child.memoizedState=qx(s),t.memoizedState=Gx,o);if(!(t.mode&1))return py(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(se(419)),r=E2(o,r,void 0),py(e,t,s,r)}if(a=(s&e.childLanes)!==0,oo||a){if(r=ti,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,il(e,i),Ps(r,e,i,-1))}return GE(),r=E2(Error(se(421))),py(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=lH.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Ao=Xl(i.nextSibling),Po=t,Wn=!0,bs=null,e!==null&&(Ho[Wo++]=Ga,Ho[Wo++]=qa,Ho[Wo++]=Cc,Ga=e.id,qa=e.overflow,Cc=t),t=FE(t,r.children),t.flags|=4096,t)}function jA(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Fx(e.return,t,n)}function T2(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 $M(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Vi(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&&jA(e,n,t);else if(e.tag===19)jA(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(Tn(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&&mv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),T2(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&&mv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}T2(t,!0,n,null,o);break;case"together":T2(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function C0(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Tc|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=eu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xq(e,t,n){switch(t.tag){case 3:DM(t),Cf();break;case 5:cM(t);break;case 1:co(t.type)&&cv(t);break;case 4:RE(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Tn(hv,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Tn(er,er.current&1),t.flags|=128,null):n&t.child.childLanes?LM(e,t,n):(Tn(er,er.current&1),e=ol(e,t,n),e!==null?e.sibling:null);Tn(er,er.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $M(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Tn(er,er.current),r)break;return null;case 22:case 23:return t.lanes=0,MM(e,t,n)}return ol(e,t,n)}var FM,Hx,BM,zM;FM=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}};Hx=function(){};BM=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,oc(la.current);var o=null;switch(n){case"input":i=px(e,i),r=px(e,r),o=[];break;case"select":i=rr({},i,{value:void 0}),r=rr({},r,{value:void 0}),o=[];break;case"textarea":i=yx(e,i),r=yx(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lv)}_x(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"&&Mn("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)}};zM=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ah(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 Ai(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 Yq(e,t,n){var r=t.pendingProps;switch(xE(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ai(t),null;case 1:return co(t.type)&&uv(),Ai(t),null;case 3:return r=t.stateNode,Tf(),jn(uo),jn(Li),OE(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(fy(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bs!==null&&(eC(bs),bs=null))),Hx(e,t),Ai(t),null;case 5:IE(t);var i=oc(qp.current);if(n=t.type,e!==null&&t.stateNode!=null)BM(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return Ai(t),null}if(e=oc(la.current),fy(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[ea]=t,r[Vp]=o,e=(t.mode&1)!==0,n){case"dialog":Mn("cancel",r),Mn("close",r);break;case"iframe":case"object":case"embed":Mn("load",r);break;case"video":case"audio":for(i=0;i<Zh.length;i++)Mn(Zh[i],r);break;case"source":Mn("error",r);break;case"img":case"image":case"link":Mn("error",r),Mn("load",r);break;case"details":Mn("toggle",r);break;case"input":X4(r,o),Mn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Mn("invalid",r);break;case"textarea":Z4(r,o),Mn("invalid",r)}_x(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&&dy(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&dy(r.textContent,a,e),i=["children",""+a]):Mp.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Mn("scroll",r)}switch(n){case"input":ry(r),Y4(r,o,!0);break;case"textarea":ry(r),J4(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=lv)}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=h9(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[ea]=t,e[Vp]=r,FM(e,t,!1,!1),t.stateNode=e;e:{switch(s=bx(n,r),n){case"dialog":Mn("cancel",e),Mn("close",e),i=r;break;case"iframe":case"object":case"embed":Mn("load",e),i=r;break;case"video":case"audio":for(i=0;i<Zh.length;i++)Mn(Zh[i],e);i=r;break;case"source":Mn("error",e),i=r;break;case"img":case"image":case"link":Mn("error",e),Mn("load",e),i=r;break;case"details":Mn("toggle",e),i=r;break;case"input":X4(e,r),i=px(e,r),Mn("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=rr({},r,{value:void 0}),Mn("invalid",e);break;case"textarea":Z4(e,r),i=yx(e,r),Mn("invalid",e);break;default:i=r}_x(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?m9(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&p9(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"&&Mn("scroll",e):l!=null&&lE(e,o,l,s))}switch(n){case"input":ry(e),Y4(e,r,!1);break;case"textarea":ry(e),J4(e);break;case"option":r.value!=null&&e.setAttribute("value",""+uu(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Xd(e,!!r.multiple,o,!1):r.defaultValue!=null&&Xd(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=lv)}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 Ai(t),null;case 6:if(e&&t.stateNode!=null)zM(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=oc(qp.current),oc(la.current),fy(t)){if(r=t.stateNode,n=t.memoizedProps,r[ea]=t,(o=r.nodeValue!==n)&&(e=Po,e!==null))switch(e.tag){case 3:dy(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&dy(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ea]=t,t.stateNode=r}return Ai(t),null;case 13:if(jn(er),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Wn&&Ao!==null&&t.mode&1&&!(t.flags&128))rM(),Cf(),t.flags|=98560,o=!1;else if(o=fy(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(se(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(se(317));o[ea]=t}else Cf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ai(t),o=!1}else bs!==null&&(eC(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):GE())),t.updateQueue!==null&&(t.flags|=4),Ai(t),null);case 4:return Tf(),Hx(e,t),e===null&&jp(t.stateNode.containerInfo),Ai(t),null;case 10:return AE(t.type._context),Ai(t),null;case 17:return co(t.type)&&uv(),Ai(t),null;case 19:if(jn(er),o=t.memoizedState,o===null)return Ai(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Ah(o,!1);else{if(Br!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=mv(e),s!==null){for(t.flags|=128,Ah(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 Tn(er,er.current&1|2),t.child}e=e.sibling}o.tail!==null&&yr()>kf&&(t.flags|=128,r=!0,Ah(o,!1),t.lanes=4194304)}else{if(!r)if(e=mv(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ah(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Wn)return Ai(t),null}else 2*yr()-o.renderingStartTime>kf&&n!==1073741824&&(t.flags|=128,r=!0,Ah(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,Tn(er,r?n&1|2:n&1),t):(Ai(t),null);case 22:case 23:return VE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Co&1073741824&&(Ai(t),t.subtreeFlags&6&&(t.flags|=8192)):Ai(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function Zq(e,t){switch(xE(t),t.tag){case 1:return co(t.type)&&uv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tf(),jn(uo),jn(Li),OE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return IE(t),null;case 13:if(jn(er),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));Cf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jn(er),null;case 4:return Tf(),null;case 10:return AE(t.type._context),null;case 22:case 23:return VE(),null;case 24:return null;default:return null}}var gy=!1,Oi=!1,Jq=typeof WeakSet=="function"?WeakSet:Set,De=null;function Vd(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ar(e,t,r)}else n.current=null}function Wx(e,t,n){try{n()}catch(r){ar(e,t,r)}}var UA=!1;function eH(e,t){if(Rx=ov,e=G9(),SE(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(Ix={focusedElem:e,selectionRange:n},ov=!1,De=t;De!==null;)if(t=De,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,De=e;else for(;De!==null;){t=De;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,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?m:ys(t.type,m),b);_.__reactInternalSnapshotBeforeUpdate=v}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(se(163))}}catch(y){ar(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,De=e;break}De=t.return}return p=UA,UA=!1,p}function hp(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&&Wx(t,n,o)}i=i.next}while(i!==r)}}function a_(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 Kx(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 jM(e){var t=e.alternate;t!==null&&(e.alternate=null,jM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ea],delete t[Vp],delete t[Nx],delete t[Lq],delete t[$q])),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 UM(e){return e.tag===5||e.tag===3||e.tag===4}function VA(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||UM(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 Qx(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=lv));else if(r!==4&&(e=e.child,e!==null))for(Qx(e,t,n),e=e.sibling;e!==null;)Qx(e,t,n),e=e.sibling}function Xx(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(Xx(e,t,n),e=e.sibling;e!==null;)Xx(e,t,n),e=e.sibling}var hi=null,vs=!1;function Sl(e,t,n){for(n=n.child;n!==null;)VM(e,t,n),n=n.sibling}function VM(e,t,n){if(aa&&typeof aa.onCommitFiberUnmount=="function")try{aa.onCommitFiberUnmount(J1,n)}catch{}switch(n.tag){case 5:Oi||Vd(n,t);case 6:var r=hi,i=vs;hi=null,Sl(e,t,n),hi=r,vs=i,hi!==null&&(vs?(e=hi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):hi.removeChild(n.stateNode));break;case 18:hi!==null&&(vs?(e=hi,n=n.stateNode,e.nodeType===8?_2(e.parentNode,n):e.nodeType===1&&_2(e,n),Fp(e)):_2(hi,n.stateNode));break;case 4:r=hi,i=vs,hi=n.stateNode.containerInfo,vs=!0,Sl(e,t,n),hi=r,vs=i;break;case 0:case 11:case 14:case 15:if(!Oi&&(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)&&Wx(n,t,s),i=i.next}while(i!==r)}Sl(e,t,n);break;case 1:if(!Oi&&(Vd(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ar(n,t,a)}Sl(e,t,n);break;case 21:Sl(e,t,n);break;case 22:n.mode&1?(Oi=(r=Oi)||n.memoizedState!==null,Sl(e,t,n),Oi=r):Sl(e,t,n);break;default:Sl(e,t,n)}}function GA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Jq),t.forEach(function(r){var i=uH.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:hi=a.stateNode,vs=!1;break e;case 3:hi=a.stateNode.containerInfo,vs=!0;break e;case 4:hi=a.stateNode.containerInfo,vs=!0;break e}a=a.return}if(hi===null)throw Error(se(160));VM(o,s,i),hi=null,vs=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){ar(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)GM(t,e),t=t.sibling}function GM(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gs(t,e),Vs(e),r&4){try{hp(3,e,e.return),a_(3,e)}catch(m){ar(e,e.return,m)}try{hp(5,e,e.return)}catch(m){ar(e,e.return,m)}}break;case 1:gs(t,e),Vs(e),r&512&&n!==null&&Vd(n,n.return);break;case 5:if(gs(t,e),Vs(e),r&512&&n!==null&&Vd(n,n.return),e.flags&32){var i=e.stateNode;try{Np(i,"")}catch(m){ar(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&&d9(i,o),bx(a,s);var u=bx(a,o);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?m9(i,d):c==="dangerouslySetInnerHTML"?p9(i,d):c==="children"?Np(i,d):lE(i,c,d,u)}switch(a){case"input":gx(i,o);break;case"textarea":f9(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Xd(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Xd(i,!!o.multiple,o.defaultValue,!0):Xd(i,!!o.multiple,o.multiple?[]:"",!1))}i[Vp]=o}catch(m){ar(e,e.return,m)}}break;case 6:if(gs(t,e),Vs(e),r&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){ar(e,e.return,m)}}break;case 3:if(gs(t,e),Vs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(m){ar(e,e.return,m)}break;case 4:gs(t,e),Vs(e);break;case 13:gs(t,e),Vs(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(jE=yr())),r&4&&GA(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Oi=(u=Oi)||c,gs(t,e),Oi=u):gs(t,e),Vs(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(De=e,c=e.child;c!==null;){for(d=De=c;De!==null;){switch(f=De,h=f.child,f.tag){case 0:case 11:case 14:case 15:hp(4,f,f.return);break;case 1:Vd(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){ar(r,n,m)}}break;case 5:Vd(f,f.return);break;case 22:if(f.memoizedState!==null){HA(d);continue}}h!==null?(h.return=f,De=h):HA(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=g9("display",s))}catch(m){ar(e,e.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){ar(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),Vs(e),r&4&&GA(e);break;case 21:break;default:gs(t,e),Vs(e)}}function Vs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(UM(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Np(i,""),r.flags&=-33);var o=VA(e);Xx(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=VA(e);Qx(e,a,s);break;default:throw Error(se(161))}}catch(l){ar(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tH(e,t,n){De=e,qM(e)}function qM(e,t,n){for(var r=(e.mode&1)!==0;De!==null;){var i=De,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||gy;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Oi;a=gy;var u=Oi;if(gy=s,(Oi=l)&&!u)for(De=i;De!==null;)s=De,l=s.child,s.tag===22&&s.memoizedState!==null?WA(i):l!==null?(l.return=s,De=l):WA(i);for(;o!==null;)De=o,qM(o),o=o.sibling;De=i,gy=a,Oi=u}qA(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,De=o):qA(e)}}function qA(e){for(;De!==null;){var t=De;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oi||a_(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oi)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&&kA(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}kA(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(se(163))}Oi||t.flags&512&&Kx(t)}catch(f){ar(t,t.return,f)}}if(t===e){De=null;break}if(n=t.sibling,n!==null){n.return=t.return,De=n;break}De=t.return}}function HA(e){for(;De!==null;){var t=De;if(t===e){De=null;break}var n=t.sibling;if(n!==null){n.return=t.return,De=n;break}De=t.return}}function WA(e){for(;De!==null;){var t=De;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{a_(4,t)}catch(l){ar(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){ar(t,i,l)}}var o=t.return;try{Kx(t)}catch(l){ar(t,o,l)}break;case 5:var s=t.return;try{Kx(t)}catch(l){ar(t,s,l)}}}catch(l){ar(t,t.return,l)}if(t===e){De=null;break}var a=t.sibling;if(a!==null){a.return=t.return,De=a;break}De=t.return}}var nH=Math.ceil,_v=dl.ReactCurrentDispatcher,BE=dl.ReactCurrentOwner,Zo=dl.ReactCurrentBatchConfig,Ut=0,ti=null,kr=null,_i=0,Co=0,Gd=Tu(0),Br=0,Qp=null,Tc=0,l_=0,zE=0,pp=null,ro=null,jE=0,kf=1/0,Fa=null,bv=!1,Yx=null,Zl=null,my=!1,jl=null,Sv=0,gp=0,Zx=null,E0=-1,T0=0;function qi(){return Ut&6?yr():E0!==-1?E0:E0=yr()}function Jl(e){return e.mode&1?Ut&2&&_i!==0?_i&-_i:Bq.transition!==null?(T0===0&&(T0=k9()),T0):(e=cn,e!==0||(e=window.event,e=e===void 0?16:D9(e.type)),e):1}function Ps(e,t,n,r){if(50<gp)throw gp=0,Zx=null,Error(se(185));om(e,n,r),(!(Ut&2)||e!==ti)&&(e===ti&&(!(Ut&2)&&(l_|=n),Br===4&&Ll(e,_i)),fo(e,r),n===1&&Ut===0&&!(t.mode&1)&&(kf=yr()+500,i_&&Au()))}function fo(e,t){var n=e.callbackNode;BG(e,t);var r=iv(e,e===ti?_i:0);if(r===0)n!==null&&nA(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&nA(n),t===1)e.tag===0?Fq(KA.bind(null,e)):eM(KA.bind(null,e)),Nq(function(){!(Ut&6)&&Au()}),n=null;else{switch(P9(r)){case 1:n=hE;break;case 4:n=T9;break;case 16:n=rv;break;case 536870912:n=A9;break;default:n=rv}n=JM(n,HM.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function HM(e,t){if(E0=-1,T0=0,Ut&6)throw Error(se(327));var n=e.callbackNode;if(tf()&&e.callbackNode!==n)return null;var r=iv(e,e===ti?_i:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=wv(e,r);else{t=r;var i=Ut;Ut|=2;var o=KM();(ti!==e||_i!==t)&&(Fa=null,kf=yr()+500,gc(e,t));do try{oH();break}catch(a){WM(e,a)}while(1);TE(),_v.current=o,Ut=i,kr!==null?t=0:(ti=null,_i=0,t=Br)}if(t!==0){if(t===2&&(i=Ex(e),i!==0&&(r=i,t=Jx(e,i))),t===1)throw n=Qp,gc(e,0),Ll(e,r),fo(e,yr()),n;if(t===6)Ll(e,r);else{if(i=e.current.alternate,!(r&30)&&!rH(i)&&(t=wv(e,r),t===2&&(o=Ex(e),o!==0&&(r=o,t=Jx(e,o))),t===1))throw n=Qp,gc(e,0),Ll(e,r),fo(e,yr()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:Ku(e,ro,Fa);break;case 3:if(Ll(e,r),(r&130023424)===r&&(t=jE+500-yr(),10<t)){if(iv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){qi(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Mx(Ku.bind(null,e,ro,Fa),t);break}Ku(e,ro,Fa);break;case 4:if(Ll(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ks(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*nH(r/1960))-r,10<r){e.timeoutHandle=Mx(Ku.bind(null,e,ro,Fa),r);break}Ku(e,ro,Fa);break;case 5:Ku(e,ro,Fa);break;default:throw Error(se(329))}}}return fo(e,yr()),e.callbackNode===n?HM.bind(null,e):null}function Jx(e,t){var n=pp;return e.current.memoizedState.isDehydrated&&(gc(e,t).flags|=256),e=wv(e,t),e!==2&&(t=ro,ro=n,t!==null&&eC(t)),e}function eC(e){ro===null?ro=e:ro.push.apply(ro,e)}function rH(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(!Ns(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 Ll(e,t){for(t&=~zE,t&=~l_,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ks(t),r=1<<n;e[n]=-1,t&=~r}}function KA(e){if(Ut&6)throw Error(se(327));tf();var t=iv(e,0);if(!(t&1))return fo(e,yr()),null;var n=wv(e,t);if(e.tag!==0&&n===2){var r=Ex(e);r!==0&&(t=r,n=Jx(e,r))}if(n===1)throw n=Qp,gc(e,0),Ll(e,t),fo(e,yr()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ku(e,ro,Fa),fo(e,yr()),null}function UE(e,t){var n=Ut;Ut|=1;try{return e(t)}finally{Ut=n,Ut===0&&(kf=yr()+500,i_&&Au())}}function Ac(e){jl!==null&&jl.tag===0&&!(Ut&6)&&tf();var t=Ut;Ut|=1;var n=Zo.transition,r=cn;try{if(Zo.transition=null,cn=1,e)return e()}finally{cn=r,Zo.transition=n,Ut=t,!(Ut&6)&&Au()}}function VE(){Co=Gd.current,jn(Gd)}function gc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Mq(n)),kr!==null)for(n=kr.return;n!==null;){var r=n;switch(xE(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&uv();break;case 3:Tf(),jn(uo),jn(Li),OE();break;case 5:IE(r);break;case 4:Tf();break;case 13:jn(er);break;case 19:jn(er);break;case 10:AE(r.type._context);break;case 22:case 23:VE()}n=n.return}if(ti=e,kr=e=eu(e.current,null),_i=Co=t,Br=0,Qp=null,zE=l_=Tc=0,ro=pp=null,ic!==null){for(t=0;t<ic.length;t++)if(n=ic[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}ic=null}return e}function WM(e,t){do{var n=kr;try{if(TE(),w0.current=vv,yv){for(var r=nr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}yv=!1}if(Ec=0,Zr=Lr=nr=null,fp=!1,Hp=0,BE.current=null,n===null||n.return===null){Br=1,Qp=t,kr=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=_i,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=DA(s);if(h!==null){h.flags&=-257,LA(h,s,a,o,t),h.mode&1&&NA(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)){NA(o,u,t),GE();break e}l=Error(se(426))}}else if(Wn&&a.mode&1){var b=DA(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),LA(b,s,a,o,t),CE(Af(l,a));break e}}o=l=Af(l,a),Br!==4&&(Br=2),pp===null?pp=[o]:pp.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var _=RM(o,l,t);AA(o,_);break e;case 1:a=l;var v=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Zl===null||!Zl.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var y=IM(o,a,t);AA(o,y);break e}}o=o.return}while(o!==null)}XM(n)}catch(S){t=S,kr===n&&n!==null&&(kr=n=n.return);continue}break}while(1)}function KM(){var e=_v.current;return _v.current=vv,e===null?vv:e}function GE(){(Br===0||Br===3||Br===2)&&(Br=4),ti===null||!(Tc&268435455)&&!(l_&268435455)||Ll(ti,_i)}function wv(e,t){var n=Ut;Ut|=2;var r=KM();(ti!==e||_i!==t)&&(Fa=null,gc(e,t));do try{iH();break}catch(i){WM(e,i)}while(1);if(TE(),Ut=n,_v.current=r,kr!==null)throw Error(se(261));return ti=null,_i=0,Br}function iH(){for(;kr!==null;)QM(kr)}function oH(){for(;kr!==null&&!RG();)QM(kr)}function QM(e){var t=ZM(e.alternate,e,Co);e.memoizedProps=e.pendingProps,t===null?XM(e):kr=t,BE.current=null}function XM(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Zq(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=Yq(n,t,Co),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=cn,i=Zo.transition;try{Zo.transition=null,cn=1,sH(e,t,n,r)}finally{Zo.transition=i,cn=r}return null}function sH(e,t,n,r){do tf();while(jl!==null);if(Ut&6)throw Error(se(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(se(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(zG(e,o),e===ti&&(kr=ti=null,_i=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||my||(my=!0,JM(rv,function(){return tf(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Zo.transition,Zo.transition=null;var s=cn;cn=1;var a=Ut;Ut|=4,BE.current=null,eH(e,n),GM(n,e),Tq(Ix),ov=!!Rx,Ix=Rx=null,e.current=n,tH(n),IG(),Ut=a,cn=s,Zo.transition=o}else e.current=n;if(my&&(my=!1,jl=e,Sv=i),o=e.pendingLanes,o===0&&(Zl=null),NG(n.stateNode),fo(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(bv)throw bv=!1,e=Yx,Yx=null,e;return Sv&1&&e.tag!==0&&tf(),o=e.pendingLanes,o&1?e===Zx?gp++:(gp=0,Zx=e):gp=0,Au(),null}function tf(){if(jl!==null){var e=P9(Sv),t=Zo.transition,n=cn;try{if(Zo.transition=null,cn=16>e?16:e,jl===null)var r=!1;else{if(e=jl,jl=null,Sv=0,Ut&6)throw Error(se(331));var i=Ut;for(Ut|=4,De=e.current;De!==null;){var o=De,s=o.child;if(De.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(De=u;De!==null;){var c=De;switch(c.tag){case 0:case 11:case 15:hp(8,c,o)}var d=c.child;if(d!==null)d.return=c,De=d;else for(;De!==null;){c=De;var f=c.sibling,h=c.return;if(jM(c),c===u){De=null;break}if(f!==null){f.return=h,De=f;break}De=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)}}De=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,De=s;else e:for(;De!==null;){if(o=De,o.flags&2048)switch(o.tag){case 0:case 11:case 15:hp(9,o,o.return)}var _=o.sibling;if(_!==null){_.return=o.return,De=_;break e}De=o.return}}var v=e.current;for(De=v;De!==null;){s=De;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,De=g;else e:for(s=v;De!==null;){if(a=De,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:a_(9,a)}}catch(S){ar(a,a.return,S)}if(a===s){De=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,De=y;break e}De=a.return}}if(Ut=i,Au(),aa&&typeof aa.onPostCommitFiberRoot=="function")try{aa.onPostCommitFiberRoot(J1,e)}catch{}r=!0}return r}finally{cn=n,Zo.transition=t}}return!1}function QA(e,t,n){t=Af(n,t),t=RM(e,t,1),e=Yl(e,t,1),t=qi(),e!==null&&(om(e,1,t),fo(e,t))}function ar(e,t,n){if(e.tag===3)QA(e,e,n);else for(;t!==null;){if(t.tag===3){QA(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zl===null||!Zl.has(r))){e=Af(n,e),e=IM(t,e,1),t=Yl(t,e,1),e=qi(),t!==null&&(om(t,1,e),fo(t,e));break}}t=t.return}}function aH(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qi(),e.pingedLanes|=e.suspendedLanes&n,ti===e&&(_i&n)===n&&(Br===4||Br===3&&(_i&130023424)===_i&&500>yr()-jE?gc(e,0):zE|=n),fo(e,t)}function YM(e,t){t===0&&(e.mode&1?(t=sy,sy<<=1,!(sy&130023424)&&(sy=4194304)):t=1);var n=qi();e=il(e,t),e!==null&&(om(e,t,n),fo(e,n))}function lH(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),YM(e,n)}function uH(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(se(314))}r!==null&&r.delete(t),YM(e,n)}var ZM;ZM=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||uo.current)oo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return oo=!1,Xq(e,t,n);oo=!!(e.flags&131072)}else oo=!1,Wn&&t.flags&1048576&&tM(t,fv,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;C0(e,t),e=t.pendingProps;var i=xf(t,Li.current);ef(t,n),i=NE(null,t,r,e,i,n);var o=DE();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,co(r)?(o=!0,cv(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,PE(t),i.updater=o_,t.stateNode=i,i._reactInternals=t,zx(t,r,e,n),t=Vx(null,t,r,!0,o,n)):(t.tag=0,Wn&&o&&wE(t),Vi(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(C0(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dH(r),e=ys(r,e),i){case 0:t=Ux(null,t,r,e,n);break e;case 1:t=BA(null,t,r,e,n);break e;case 11:t=$A(null,t,r,e,n);break e;case 14:t=FA(null,t,r,ys(r.type,e),n);break e}throw Error(se(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),Ux(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),BA(e,t,r,i,n);case 3:e:{if(DM(t),e===null)throw Error(se(387));r=t.pendingProps,o=t.memoizedState,i=o.element,oM(e,t),gv(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=Af(Error(se(423)),t),t=zA(e,t,r,n,i);break e}else if(r!==i){i=Af(Error(se(424)),t),t=zA(e,t,r,n,i);break e}else for(Ao=Xl(t.stateNode.containerInfo.firstChild),Po=t,Wn=!0,bs=null,n=uM(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cf(),r===i){t=ol(e,t,n);break e}Vi(e,t,r,n)}t=t.child}return t;case 5:return cM(t),e===null&&$x(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ox(r,i)?s=null:o!==null&&Ox(r,o)&&(t.flags|=32),NM(e,t),Vi(e,t,s,n),t.child;case 6:return e===null&&$x(t),null;case 13:return LM(e,t,n);case 4:return RE(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ef(t,null,r,n):Vi(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),$A(e,t,r,i,n);case 7:return Vi(e,t,t.pendingProps,n),t.child;case 8:return Vi(e,t,t.pendingProps.children,n),t.child;case 12:return Vi(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,Tn(hv,r._currentValue),r._currentValue=s,o!==null)if(Ns(o.value,s)){if(o.children===i.children&&!uo.current){t=ol(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=Ka(-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),Fx(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(se(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Fx(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}Vi(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,Vi(e,t,r,n),t.child;case 14:return r=t.type,i=ys(r,t.pendingProps),i=ys(r.type,i),FA(e,t,r,i,n);case 15:return OM(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ys(r,i),C0(e,t),t.tag=1,co(r)?(e=!0,cv(t)):e=!1,ef(t,n),aM(t,r,i),zx(t,r,i,n),Vx(null,t,r,!0,e,n);case 19:return $M(e,t,n);case 22:return MM(e,t,n)}throw Error(se(156,t.tag))};function JM(e,t){return E9(e,t)}function cH(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 Xo(e,t,n,r){return new cH(e,t,n,r)}function qE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dH(e){if(typeof e=="function")return qE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cE)return 11;if(e===dE)return 14}return 2}function eu(e,t){var n=e.alternate;return n===null?(n=Xo(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 A0(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")qE(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Nd:return mc(n.children,i,o,t);case uE:s=8,i|=8;break;case cx:return e=Xo(12,n,t,i|2),e.elementType=cx,e.lanes=o,e;case dx:return e=Xo(13,n,t,i),e.elementType=dx,e.lanes=o,e;case fx:return e=Xo(19,n,t,i),e.elementType=fx,e.lanes=o,e;case l9:return u_(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case s9:s=10;break e;case a9:s=9;break e;case cE:s=11;break e;case dE:s=14;break e;case kl:s=16,r=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=Xo(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function mc(e,t,n,r){return e=Xo(7,e,r,t),e.lanes=n,e}function u_(e,t,n,r){return e=Xo(22,e,r,t),e.elementType=l9,e.lanes=n,e.stateNode={isHidden:!1},e}function A2(e,t,n){return e=Xo(6,e,null,t),e.lanes=n,e}function k2(e,t,n){return t=Xo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fH(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=l2(0),this.expirationTimes=l2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=l2(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function HE(e,t,n,r,i,o,s,a,l){return e=new fH(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Xo(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},PE(o),e}function hH(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Md,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function eN(e){if(!e)return cu;e=e._reactInternals;e:{if(Vc(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(co(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(co(n))return J9(e,n,t)}return t}function tN(e,t,n,r,i,o,s,a,l){return e=HE(n,r,!0,e,i,o,s,a,l),e.context=eN(null),n=e.current,r=qi(),i=Jl(n),o=Ka(r,i),o.callback=t??null,Yl(n,o,i),e.current.lanes=i,om(e,i,r),fo(e,r),e}function c_(e,t,n,r){var i=t.current,o=qi(),s=Jl(i);return n=eN(n),t.context===null?t.context=n:t.pendingContext=n,t=Ka(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Yl(i,t,s),e!==null&&(Ps(e,i,s,o),S0(e,i,s)),s}function xv(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function XA(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function WE(e,t){XA(e,t),(e=e.alternate)&&XA(e,t)}function pH(){return null}var nN=typeof reportError=="function"?reportError:function(e){console.error(e)};function KE(e){this._internalRoot=e}d_.prototype.render=KE.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));c_(e,t,null,null)};d_.prototype.unmount=KE.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ac(function(){c_(null,e,null,null)}),t[rl]=null}};function d_(e){this._internalRoot=e}d_.prototype.unstable_scheduleHydration=function(e){if(e){var t=O9();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dl.length&&t!==0&&t<Dl[n].priority;n++);Dl.splice(n,0,e),n===0&&N9(e)}};function QE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function YA(){}function gH(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=xv(s);o.call(u)}}var s=tN(t,r,e,0,null,!1,!1,"",YA);return e._reactRootContainer=s,e[rl]=s.current,jp(e.nodeType===8?e.parentNode:e),Ac(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=xv(l);a.call(u)}}var l=HE(e,0,!1,null,null,!1,!1,"",YA);return e._reactRootContainer=l,e[rl]=l.current,jp(e.nodeType===8?e.parentNode:e),Ac(function(){c_(t,l,n,r)}),l}function h_(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=xv(s);a.call(l)}}c_(t,s,e,i)}else s=gH(n,t,e,i,r);return xv(s)}R9=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yh(t.pendingLanes);n!==0&&(pE(t,n|1),fo(t,yr()),!(Ut&6)&&(kf=yr()+500,Au()))}break;case 13:Ac(function(){var r=il(e,1);if(r!==null){var i=qi();Ps(r,e,1,i)}}),WE(e,1)}};gE=function(e){if(e.tag===13){var t=il(e,134217728);if(t!==null){var n=qi();Ps(t,e,134217728,n)}WE(e,134217728)}};I9=function(e){if(e.tag===13){var t=Jl(e),n=il(e,t);if(n!==null){var r=qi();Ps(n,e,t,r)}WE(e,t)}};O9=function(){return cn};M9=function(e,t){var n=cn;try{return cn=e,t()}finally{cn=n}};wx=function(e,t,n){switch(t){case"input":if(gx(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=r_(r);if(!i)throw Error(se(90));c9(r),gx(r,i)}}}break;case"textarea":f9(e,n);break;case"select":t=n.value,t!=null&&Xd(e,!!n.multiple,t,!1)}};_9=UE;b9=Ac;var mH={usingClientEntryPoint:!1,Events:[am,Fd,r_,y9,v9,UE]},kh={findFiberByHostInstance:rc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},yH={bundleType:kh.bundleType,version:kh.version,rendererPackageName:kh.rendererPackageName,rendererConfig:kh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:dl.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=x9(e),e===null?null:e.stateNode},findFiberByHostInstance:kh.findFiberByHostInstance||pH,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 yy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yy.isDisabled&&yy.supportsFiber)try{J1=yy.inject(yH),aa=yy}catch{}}Lo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mH;Lo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!QE(t))throw Error(se(200));return hH(e,t,null,n)};Lo.createRoot=function(e,t){if(!QE(e))throw Error(se(299));var n=!1,r="",i=nN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=HE(e,1,!1,null,null,n,!1,r,i),e[rl]=t.current,jp(e.nodeType===8?e.parentNode:e),new KE(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(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=x9(t),e=e===null?null:e.stateNode,e};Lo.flushSync=function(e){return Ac(e)};Lo.hydrate=function(e,t,n){if(!f_(t))throw Error(se(200));return h_(null,e,t,!0,n)};Lo.hydrateRoot=function(e,t,n){if(!QE(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=nN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=tN(t,null,e,1,n??null,i,!1,o,s),e[rl]=t.current,jp(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 d_(t)};Lo.render=function(e,t,n){if(!f_(t))throw Error(se(200));return h_(null,e,t,!1,n)};Lo.unmountComponentAtNode=function(e){if(!f_(e))throw Error(se(40));return e._reactRootContainer?(Ac(function(){h_(null,null,e,!1,function(){e._reactRootContainer=null,e[rl]=null})}),!0):!1};Lo.unstable_batchedUpdates=UE;Lo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!f_(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return h_(e,t,n,!1,r)};Lo.version="18.2.0-next-9e3b772b8-20220608";function rN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rN)}catch(e){console.error(e)}}rN(),t9.exports=Lo;var ws=t9.exports;const u8e=jc(ws);var ZA=ws;lx.createRoot=ZA.createRoot,lx.hydrateRoot=ZA.hydrateRoot;const vH="modulepreload",_H=function(e,t){return new URL(e,t).href},JA={},iN=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=_H(o,r),o in JA)return;JA[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":vH,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 ei(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 Hi(e){return!!e&&!!e[yt]}function ho(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)===AH}(e)||Array.isArray(e)||!!e[nf]||!!(!((t=e.constructor)===null||t===void 0)&&t[nf])||p_(e)||g_(e))}function XE(e){return Hi(e)||ei(23,e),e[yt].t}function sl(e,t,n){n===void 0&&(n=!1),du(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 du(e){var t=e[yt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:p_(e)?2:g_(e)?3:0}function tu(e,t){return du(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k0(e,t){return du(e)===2?e.get(t):e[t]}function oN(e,t,n){var r=du(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function sN(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function p_(e){return EH&&e instanceof Map}function g_(e){return TH&&e instanceof Set}function Wr(e){return e.o||e.t}function YE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=lN(e);delete t[yt];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),ZE(e)||Hi(e)||!ho(e)||(du(e)>1&&(e.set=e.add=e.clear=e.delete=bH),Object.freeze(e),t&&sl(e,function(n,r){return um(r,!0)},!0)),e}function bH(){ei(2)}function ZE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ua(e){var t=nC[e];return t||ei(18,e),t}function JE(e,t){nC[e]||(nC[e]=t)}function Xp(){return Zp}function P2(e,t){t&&(ua("Patches"),e.u=[],e.s=[],e.v=t)}function Cv(e){tC(e),e.p.forEach(SH),e.p=null}function tC(e){e===Zp&&(Zp=e.l)}function ek(e){return Zp={p:[],l:Zp,h:e,m:!0,_:0}}function SH(e){var t=e[yt];t.i===0||t.i===1?t.j():t.g=!0}function R2(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||ua("ES5").S(t,e,r),r?(n[yt].P&&(Cv(t),ei(4)),ho(e)&&(e=Ev(t,e),t.l||Tv(t,e)),t.u&&ua("Patches").M(n[yt].t,e,t.u,t.s)):e=Ev(t,n,[]),Cv(t),t.u&&t.v(t.u,t.s),e!==y_?e:void 0}function Ev(e,t,n){if(ZE(t))return t;var r=t[yt];if(!r)return sl(t,function(a,l){return tk(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Tv(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=YE(r.k):r.o,o=i,s=!1;r.i===3&&(o=new Set(i),i.clear(),s=!0),sl(o,function(a,l){return tk(e,r,i,a,l,n,s)}),Tv(e,i,!1),n&&e.u&&ua("Patches").N(r,n,e.u,e.s)}return r.o}function tk(e,t,n,r,i,o,s){if(Hi(i)){var a=Ev(e,i,o&&t&&t.i!==3&&!tu(t.R,r)?o.concat(r):void 0);if(oN(n,r,a),!Hi(a))return;e.m=!1}else s&&n.add(i);if(ho(i)&&!ZE(i)){if(!e.h.D&&e._<1)return;Ev(e,i),t&&t.A.l||Tv(e,i)}}function Tv(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&um(t,n)}function I2(e,t){var n=e[yt];return(n?Wr(n):e)[t]}function nk(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 io(e){e.P||(e.P=!0,e.l&&io(e.l))}function O2(e){e.o||(e.o=YE(e.t))}function Yp(e,t,n){var r=p_(t)?ua("MapSet").F(t,n):g_(t)?ua("MapSet").T(t,n):e.O?function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:Xp(),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=Jh);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return a.k=f,a.j=d,f}(t,n):ua("ES5").J(t,n);return(n?n.A:Xp()).p.push(r),r}function m_(e){return Hi(e)||ei(22,e),function t(n){if(!ho(n))return n;var r,i=n[yt],o=du(n);if(i){if(!i.P&&(i.i<4||!ua("ES5").K(i)))return i.t;i.I=!0,r=rk(n,o),i.I=!1}else r=rk(n,o);return sl(r,function(s,a){i&&k0(i.t,s)===a||oN(r,s,t(a))}),o===3?new Set(r):r}(e)}function rk(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return YE(e)}function eT(){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[yt];return Jp.get(l,o)},set:function(l){var u=this[yt];Jp.set(u,o,l)}},a}function t(o){for(var s=o.length-1;s>=0;s--){var a=o[s][yt];if(!a.P)switch(a.i){case 5:r(a)&&io(a);break;case 4:n(a)&&io(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!==yt){var d=s[c];if(d===void 0&&!tu(s,c))return!0;var f=a[c],h=f&&f[yt];if(h?h.t!==d:!sN(f,d))return!0}}var p=!!s[yt];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={};JE("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=lN(d);delete p[yt];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:Xp(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,yt,{value:u,writable:!0}),l},S:function(o,s,a){a?Hi(s)&&s[yt].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[yt];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)sl(f,function(g){g!==yt&&(d[g]!==void 0||tu(d,g)?h[g]||l(f[g]):(h[g]=!0,io(c)))}),sl(d,function(g){f[g]!==void 0||tu(f,g)||(h[g]=!1,io(c))});else if(p===5){if(r(c)&&(io(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),v=0;v<_;v++)f.hasOwnProperty(v)||(h[v]=!0),h[v]===void 0&&l(f[v])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function tT(){function e(r){if(!ho(r))return r;if(Array.isArray(r))return r.map(e);if(p_(r))return new Map(Array.from(r.entries()).map(function(s){return[s[0],e(s[1])]}));if(g_(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 tu(r,nf)&&(i[nf]=r[nf]),i}function t(r){return Hi(r)?e(r):r}var n="add";JE("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=du(l),d=s[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||ei(24),typeof l=="function"&&d==="prototype"&&ei(24),typeof(l=k0(l,d))!="object"&&ei(15,s.join("/"))}var f=du(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:ei(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:ei(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;sl(a.R,function(h,p){var m=k0(d,h),b=k0(f,h),_=p?tu(d,h)?"replace":n:"remove";if(m!==b||_!=="replace"){var v=l.concat(h);u.push(_==="remove"?{op:_,path:v}:{op:_,path:v,value:b}),c.push(_===n?{op:"remove",path:v}:_==="remove"?{op:n,path:v,value:t(m)}:{op:"replace",path:v,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 v=d.length;v<h.length;v++){var g=l.concat([v]);u.push({op:n,path:g,value:t(h[v])})}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===y_?void 0:i}),s.push({op:"replace",path:[],value:r})}})}function aN(){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(ho(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&&ei(3,JSON.stringify(Wr(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[yt]={i:2,l:c,A:c?c.A:Xp(),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 Wr(this[yt]).size}}),l.has=function(u){return Wr(this[yt]).has(u)},l.set=function(u,c){var d=this[yt];return r(d),Wr(d).has(u)&&Wr(d).get(u)===c||(t(d),io(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[yt];return r(c),t(c),io(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[yt];r(u),Wr(u).size&&(t(u),io(u),u.R=new Map,sl(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;Wr(this[yt]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[yt];r(c);var d=Wr(c).get(u);if(c.I||!ho(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 Wr(this[yt]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[vy]=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={})[vy]=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[vy]=function(){return this.entries()},a}(),s=function(){function a(u,c){return this[yt]={i:3,l:c,A:c?c.A:Xp(),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 Wr(this[yt]).size}}),l.has=function(u){var c=this[yt];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[yt];return r(c),this.has(u)||(n(c),io(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[yt];return r(c),n(c),io(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[yt];r(u),Wr(u).size&&(n(u),io(u),u.o.clear())},l.values=function(){var u=this[yt];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[yt];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[vy]=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}();JE("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function wH(){eT(),aN(),tT()}function xH(e){return e}function CH(e){return e}var ik,Zp,nT=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",EH=typeof Map<"u",TH=typeof Set<"u",ok=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",y_=nT?Symbol.for("immer-nothing"):((ik={})["immer-nothing"]=!0,ik),nf=nT?Symbol.for("immer-draftable"):"__$immer_draftable",yt=nT?Symbol.for("immer-state"):"__$immer_state",vy=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",AH=""+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,lN=Object.getOwnPropertyDescriptors||function(e){var t={};return rf(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},nC={},Jp={get:function(e,t){if(t===yt)return e;var n=Wr(e);if(!tu(n,t))return function(i,o,s){var a,l=nk(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||!ho(r)?r:r===I2(e.t,t)?(O2(e),e.o[t]=Yp(e.A.h,r,e)):r},has:function(e,t){return t in Wr(e)},ownKeys:function(e){return Reflect.ownKeys(Wr(e))},set:function(e,t,n){var r=nk(Wr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=I2(Wr(e),t),o=i==null?void 0:i[yt];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(sN(n,i)&&(n!==void 0||tu(e.t,t)))return!0;O2(e),io(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 I2(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,O2(e),io(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Wr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){ei(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ei(12)}},Jh={};sl(Jp,function(e,t){Jh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Jh.deleteProperty=function(e,t){return Jh.set.call(this,e,t,void 0)},Jh.set=function(e,t,n){return Jp.set.call(this,e[0],t,n,e[0])};var uN=function(){function e(n){var r=this;this.O=ok,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,v=Array(_>1?_-1:0),g=1;g<_;g++)v[g-1]=arguments[g];return l.produce(m,function(y){var S;return(S=o).call.apply(S,[b,y].concat(v))})}}var u;if(typeof o!="function"&&ei(6),s!==void 0&&typeof s!="function"&&ei(7),ho(i)){var c=ek(r),d=Yp(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?Cv(c):tC(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(m){return P2(c,s),R2(m,c)},function(m){throw Cv(c),m}):(P2(c,s),R2(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===y_&&(u=void 0),r.D&&um(u,!0),s){var h=[],p=[];ua("Patches").M(i,u,h,p),s(h,p)}return u}ei(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){ho(n)||ei(8),Hi(n)&&(n=m_(n));var r=ek(this),i=Yp(this,n,void 0);return i[yt].C=!0,tC(r),i},t.finishDraft=function(n,r){var i=n&&n[yt],o=i.A;return P2(o,r),R2(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!ok&&ei(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=ua("Patches").$;return Hi(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Oo=new uN,cN=Oo.produce,rT=Oo.produceWithPatches.bind(Oo),kH=Oo.setAutoFreeze.bind(Oo),PH=Oo.setUseProxies.bind(Oo),rC=Oo.applyPatches.bind(Oo),RH=Oo.createDraft.bind(Oo),IH=Oo.finishDraft.bind(Oo);const ku=cN,OH=Object.freeze(Object.defineProperty({__proto__:null,Immer:uN,applyPatches:rC,castDraft:xH,castImmutable:CH,createDraft:RH,current:m_,default:ku,enableAllPlugins:wH,enableES5:eT,enableMapSet:aN,enablePatches:tT,finishDraft:IH,freeze:um,immerable:nf,isDraft:Hi,isDraftable:ho,nothing:y_,original:XE,produce:cN,produceWithPatches:rT,setAutoFreeze:kH,setUseProxies:PH},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 MH(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 NH(e){var t=MH(e,"string");return eg(t)==="symbol"?t:String(t)}function DH(e,t,n){return t=NH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(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 ak(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sk(Object(n),!0).forEach(function(r){DH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pi(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 lk=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),M2=function(){return Math.random().toString(36).substring(7).split("").join(".")},Pf={INIT:"@@redux/INIT"+M2(),REPLACE:"@@redux/REPLACE"+M2(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+M2()}};function LH(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(pi(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(pi(1));return n(cm)(e,t)}if(typeof e!="function")throw new Error(pi(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(pi(3));return o}function d(m){if(typeof m!="function")throw new Error(pi(4));if(l)throw new Error(pi(5));var b=!0;return u(),a.push(m),function(){if(b){if(l)throw new Error(pi(6));b=!1,u();var v=a.indexOf(m);a.splice(v,1),s=null}}}function f(m){if(!LH(m))throw new Error(pi(7));if(typeof m.type>"u")throw new Error(pi(8));if(l)throw new Error(pi(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var b=s=a,_=0;_<b.length;_++){var v=b[_];v()}return m}function h(m){if(typeof m!="function")throw new Error(pi(10));i=m,f({type:Pf.REPLACE})}function p(){var m,b=d;return m={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(pi(11));function g(){v.next&&v.next(c())}g();var y=b(g);return{unsubscribe:y}}},m[lk]=function(){return this},m}return f({type:Pf.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[lk]=p,r}var dN=cm;function $H(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Pf.INIT});if(typeof r>"u")throw new Error(pi(12));if(typeof n(void 0,{type:Pf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pi(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{$H(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(pi(14));d[h]=b,c=c||b!==m}return c=c||o.length!==Object.keys(l).length,c?d:l}}function uk(e,t){return function(){return t(e.apply(this,arguments))}}function fN(e,t){if(typeof e=="function")return uk(e,t);if(typeof e!="object"||e===null)throw new Error(pi(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=uk(i,t))}return n}function Rf(){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 iT(){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(pi(15))},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return o=Rf.apply(void 0,a)(i.dispatch),ak(ak({},i),{},{dispatch:o})}}}const FH=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:Pf,applyMiddleware:iT,bindActionCreators:fN,combineReducers:th,compose:Rf,createStore:cm,legacy_createStore:dN},Symbol.toStringTag,{value:"Module"}));var Av="NOT_FOUND";function BH(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Av},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function zH(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 Av}function i(a,l){r(a)===Av&&(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 hN=function(t,n){return t===n};function jH(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function kv(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?hN:r,o=n.maxSize,s=o===void 0?1:o,a=n.resultEqualityCheck,l=jH(i),u=s===1?BH(l):zH(s,l);function c(){var d=u.get(arguments);if(d===Av){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 UH(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 pN(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],_=UH(a),v=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=v.apply(null,S),c});return Object.assign(g,{resultFunc:f,memoizedResultFunc:v,dependencies:_,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),g};return i}var Di=pN(kv),VH=function(t,n){if(n===void 0&&(n=Di),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 GH=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Di,createSelectorCreator:pN,createStructuredSelector:VH,defaultEqualityCheck:hN,defaultMemoize:kv},Symbol.toStringTag,{value:"Module"}));function gN(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 mN=gN();mN.withExtraArgument=gN;const ck=mN;var yN=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}}},fu=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},qH=Object.defineProperty,HH=Object.defineProperties,WH=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,KH=Object.prototype.hasOwnProperty,QH=Object.prototype.propertyIsEnumerable,fk=function(e,t,n){return t in e?qH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},so=function(e,t){for(var n in t||(t={}))KH.call(t,n)&&fk(e,n,t[n]);if(dk)for(var r=0,i=dk(t);r<i.length;r++){var n=i[r];QH.call(t,n)&&fk(e,n,t[n])}return e},N2=function(e,t){return HH(e,WH(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())})},Da=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Di.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,fu([Hi(i)?m_(i):i],o))};return r},XH=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Rf:Rf.apply(null,arguments)};function Ds(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 vN=function(e){yN(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,fu([void 0],n[0].concat(this)))):new(t.bind.apply(t,fu([void 0],n.concat(this))))},t}(Array),_N=function(e){yN(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,fu([void 0],n[0].concat(this)))):new(t.bind.apply(t,fu([void 0],n.concat(this))))},t}(Array);function iC(e){return ho(e)?ku(e,function(){}):e}function YH(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function ZH(e){return function(){return function(t){return function(n){return t(n)}}}}function bN(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||Ds(e)}function SN(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=bN),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 v=t?t+"."+b:b;if(l){var g=i.some(function(y){return y instanceof RegExp?y.test(v):v===y});if(g)return"continue"}if(!n(_))return{value:{keyPath:v,value:_}};if(typeof _=="object"&&(s=SN(_,v,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&&wN(e)&&o.add(e),!1}function wN(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)&&!wN(r))return!1}return!0}function JH(e){return function(){return function(t){return function(n){return t(n)}}}}function eW(e){return typeof e=="boolean"}function tW(){return function(t){return xN(t)}}function xN(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new vN;return n&&(eW(n)?r.push(ck):r.push(ck.withExtraArgument(n.extraArgument))),r}var nW=!0;function CN(e){var t=tW(),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(Ds(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=iT.apply(void 0,p),b=Rf;l&&(b=XH(so({trace:!nW},typeof l=="object"&&l)));var _=new _N(m),v=_;Array.isArray(f)?v=fu([m],f):typeof f=="function"&&(v=f(_));var g=b.apply(void 0,v);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 so(so({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 oT(e){return Ds(e)&&"type"in e}function EN(e){return oT(e)&&typeof e.type=="string"&&Object.keys(e).every(rW)}function rW(e){return["type","payload","error","meta"].indexOf(e)>-1}function iW(e){return""+e}function TN(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 oW(e){return typeof e=="function"}function AN(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?TN(t):[t,n,r],o=i[0],s=i[1],a=i[2],l;if(oW(e))l=function(){return iC(e())};else{var u=iC(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=fu([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(Hi(p)){var b=p,_=m(b,f);return _===void 0?p:_}else{if(ho(p))return ku(p,function(v){return m(v,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 sW(e,t){return e+"/"+t}function Kn(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:iC(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},s={},a={};i.forEach(function(c){var d=r[c],f=sW(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"?TN(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,_=so(so({},f),s);return AN(n,function(v){for(var g in _)v.addCase(g,_[g]);for(var y=0,S=p;y<S.length;y++){var w=S[y];v.addMatcher(w.matcher,w.reducer)}b&&v.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 aW(){return{ids:[],entities:{}}}function lW(){function e(t){return t===void 0&&(t={}),Object.assign(aW(),t)}return{getInitialState:e}}function uW(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=Da(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=Da(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:a,selectById:Da(r,o,s)};var l=Da(t,r);return{selectIds:Da(t,n),selectEntities:l,selectAll:Da(t,i),selectTotal:Da(t,a),selectById:Da(l,o,s)}}return{getSelectors:e}}function cW(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 EN(s)}var o=function(s){i(r)?e(r.payload,s):e(r,s)};return Hi(n)?(o(n),n):ku(n,o)}}function mp(e,t){var n=t(e);return n}function yc(e){return Array.isArray(e)||(e=Object.values(e)),e}function kN(e,t,n){e=yc(e);for(var r=[],i=[],o=0,s=e;o<s.length;o++){var a=s[o],l=mp(a,t);l in n.entities?i.push({id:l,changes:a}):r.push(a)}return[r,i]}function PN(e){function t(p,m){var b=mp(p,e);b in m.entities||(m.ids.push(b),m.entities[b]=p)}function n(p,m){p=yc(p);for(var b=0,_=p;b<_.length;b++){var v=_[b];t(v,m)}}function r(p,m){var b=mp(p,e);b in m.entities||m.ids.push(b),m.entities[b]=p}function i(p,m){p=yc(p);for(var b=0,_=p;b<_.length;b++){var v=_[b];r(v,m)}}function o(p,m){p=yc(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],v=Object.assign({},_,m.changes),g=mp(v,e),y=g!==m.id;return y&&(p[m.id]=g,delete b.entities[m.id]),b.entities[g]=v,y}function c(p,m){return d([p],m)}function d(p,m){var b={},_={};p.forEach(function(y){y.id in m.entities&&(_[y.id]={id:y.id,changes:so(so({},_[y.id]?_[y.id].changes:null),y.changes)})}),p=Object.values(_);var v=p.length>0;if(v){var g=p.filter(function(y){return u(b,y,m)}).length>0;g&&(m.ids=Object.keys(m.entities))}}function f(p,m){return h([p],m)}function h(p,m){var b=kN(p,e,m),_=b[0],v=b[1];d(v,m),n(_,m)}return{removeAll:cW(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 dW(e,t){var n=PN(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function s(v,g){return a([v],g)}function a(v,g){v=yc(v);var y=v.filter(function(S){return!(mp(S,e)in g.entities)});y.length!==0&&b(y,g)}function l(v,g){return u([v],g)}function u(v,g){v=yc(v),v.length!==0&&b(v,g)}function c(v,g){v=yc(v),g.entities={},g.ids=[],a(v,g)}function d(v,g){return f([v],g)}function f(v,g){for(var y=!1,S=0,w=v;S<w.length;S++){var x=w[S],C=g.entities[x.id];if(C){y=!0,Object.assign(C,x.changes);var A=e(C);x.id!==A&&(delete g.entities[x.id],g.entities[A]=C)}}y&&_(g)}function h(v,g){return p([v],g)}function p(v,g){var y=kN(v,e,g),S=y[0],w=y[1];f(w,g),a(S,g)}function m(v,g){if(v.length!==g.length)return!1;for(var y=0;y<v.length&&y<g.length;y++)if(v[y]!==g[y])return!1;return!0}function b(v,g){v.forEach(function(y){g.entities[e(y)]=y}),_(g)}function _(v){var g=Object.values(v.entities);g.sort(t);var y=g.map(e),S=v.ids;m(S,y)||(v.ids=y)}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 Sa(e){e===void 0&&(e={});var t=so({sortComparer:!1,selectId:function(a){return a.id}},e),n=t.selectId,r=t.sortComparer,i=lW(),o=uW(),s=r?dW(n,r):PN(n);return so(so(so({selectId:n,sortComparer:r},i),o),s)}var fW="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",v_=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=fW[Math.random()*64|0];return t},hW=["name","message","stack","code"],D2=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),hk=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),RN=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=hW;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},hu=function(){function e(t,n,r){var i=Me(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:N2(so({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=Me(t+"/pending",function(u,c,d){return{payload:void 0,meta:N2(so({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),s=Me(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||RN)(u||"Rejected"),meta:N2(so({},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):v_(),p=new a,m;function b(v){m=v,p.abort()}var _=function(){return fm(this,null,function(){var v,g,y,S,w,x,C;return dm(this,function(A){switch(A.label){case 0:return A.trys.push([0,4,,5]),S=(v=r==null?void 0:r.condition)==null?void 0:v.call(r,u,{getState:d,extra:f}),pW(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,P){return p.signal.addEventListener("abort",function(){return P({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,P){return new D2(T,P)},fulfillWithValue:function(T,P){return new hk(T,P)}})).then(function(T){if(T instanceof D2)throw T;return T instanceof hk?i(T.payload,h,u,T.meta):i(T,h,u)})])];case 3:return y=A.sent(),[3,5];case 4:return x=A.sent(),y=x instanceof D2?s(null,h,u,x.payload,x.meta):s(x,h,u),[3,5];case 5:return C=r&&!r.dispatchConditionRejection&&s.match(y)&&y.meta.condition,C||c(y),[2,y]}})})}();return Object.assign(_,{abort:b,requestId:h,arg:u,unwrap:function(){return _.then(IN)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function IN(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function pW(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gW=function(e){return e&&typeof e.match=="function"},ON=function(e,t){return gW(e)?e.match(t):e(t)};function Xi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return ON(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 ON(r,n)})}}function __(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 b_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return __(n,["pending"])}:hm(e)?function(n){var r=e.map(function(o){return o.pending}),i=Xi.apply(void 0,r);return i(n)}:b_()(e[0])}function If(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return __(n,["rejected"])}:hm(e)?function(n){var r=e.map(function(o){return o.rejected}),i=Xi.apply(void 0,r);return i(n)}:If()(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(If.apply(void 0,e),n);return i(r)}:hm(e)?function(r){var i=of(If.apply(void 0,e),n);return i(r)}:pm()(e[0])}function Pu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return __(n,["fulfilled"])}:hm(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=Xi.apply(void 0,r);return i(n)}:Pu()(e[0])}function Pv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return __(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=Xi.apply(void 0,r);return a(n)}:Pv()(e[0])}var sT=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},oC=function(){},MN=function(e,t){return t===void 0&&(t=oC),e.catch(t),e},NN=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))},mW="task",DN="listener",LN="completed",aT="cancelled",yW="task-"+aT,vW="task-"+LN,$N=DN+"-"+aT,_W=DN+"-"+LN,gm=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=mW+" "+aT+" (reason: "+t+")"}return e}(),af=function(e){if(e.aborted)throw new gm(e.reason)};function FN(e,t){var n=oC;return new Promise(function(r,i){var o=function(){return i(new gm(e.reason))};if(e.aborted){o();return}n=NN(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=oC})}var bW=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]}})})},Rv=function(e){return function(t){return MN(FN(e,t).then(function(n){return af(e),n}))}},BN=function(e){var t=Rv(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},SW=Object.assign,pk={},mm="listenerMiddleware",wW=function(e){var t=function(n){return NN(e,function(){return sf(n,e.reason)})};return function(n){sT(n,"taskExecutor");var r=new AbortController;t(r);var i=bW(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:Rv(r.signal),delay:BN(r.signal),signal:r.signal})];case 1:return o=s.sent(),af(r.signal),[2,o]}})})},function(){return sf(r,vW)});return{result:Rv(e)(i),cancel:function(){sf(r,yW)}}}},xW=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,FN(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 MN(n(r,i))}},zN=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 sT(o,"options.listener"),{predicate:i,type:t,effect:o}},CW=function(e){var t=zN(e),n=t.type,r=t.predicate,i=t.effect,o=v_(),s={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},sC=function(e){e.pending.forEach(function(t){sf(t,$N)})},EW=function(e){return function(){e.forEach(sC),e.clear()}},gk=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},jN=Me(mm+"/add"),UN=Me(mm+"/removeAll"),VN=Me(mm+"/remove"),TW=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,fu([mm+"/error"],e))};function GN(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?TW:i;sT(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&&sC(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=CW(h)),s(p)},u=function(h){var p=zN(h),m=p.type,b=p.effect,_=p.predicate,v=a(function(g){var y=typeof m=="string"?g.type===m:g.predicate===_;return y&&g.effect===b});return v&&(v.unsubscribe(),h.cancelActive&&sC(v)),!!v},c=function(h,p,m,b){return fm(t,null,function(){var _,v,g;return dm(this,function(y){switch(y.label){case 0:_=new AbortController,v=xW(l,_.signal),y.label=1;case 1:return y.trys.push([1,3,4,5]),h.pending.add(_),[4,Promise.resolve(h.effect(p,SW({},m,{getOriginalState:b,condition:function(S,w){return v(S,w).then(Boolean)},take:v,delay:BN(_.signal),pause:Rv(_.signal),extra:r,signal:_.signal,fork:wW(_.signal),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(S,w,x){S!==_&&(sf(S,$N),x.delete(S))})}})))];case 2:return y.sent(),[3,5];case 3:return g=y.sent(),g instanceof gm||gk(o,g,{raisedBy:"effect"}),[3,5];case 4:return sf(_,_W),h.pending.delete(_),[7];case 5:return[2]}})})},d=EW(n),f=function(h){return function(p){return function(m){if(!oT(m))return p(m);if(jN.match(m))return l(m.payload);if(UN.match(m)){d();return}if(VN.match(m))return u(m.payload);var b=h.getState(),_=function(){if(b===pk)throw new Error(mm+": getOriginalState can only be called synchronously");return b},v;try{if(v=p(m),n.size>0)for(var g=h.getState(),y=Array.from(n.values()),S=0,w=y;S<w.length;S++){var x=w[S],C=!1;try{C=x.predicate(m,g,b)}catch(A){C=!1,gk(o,A,{raisedBy:"predicate"})}C&&c(x,m,h,_)}}finally{b=pk}return v}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var sc="RTK_autoBatch",P0=function(){return function(e){var t;return{payload:e,meta:(t={},t[sc]=!0,t)}}},mk,AW=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(mk||(mk=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},qN=function(e){return function(t){setTimeout(t,e)}},kW=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:qN(10),HN=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"?AW:e.type==="raf"?kW:e.type==="callback"?e.queueNotification:qN(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[sc]),s=!o,s&&(a||(a=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};eT();const PW=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:_N,MiddlewareArray:vN,SHOULD_AUTOBATCH:sc,TaskAbortError:gm,__DO_NOT_USE__ActionTypes:Pf,addListener:jN,applyMiddleware:iT,autoBatchEnhancer:HN,bindActionCreators:fN,clearAllListeners:UN,combineReducers:th,compose:Rf,configureStore:CN,createAction:Me,createAsyncThunk:hu,createDraftSafeSelector:Da,createEntityAdapter:Sa,createImmutableStateInvariantMiddleware:ZH,createListenerMiddleware:GN,createNextState:ku,createReducer:AN,createSelector:Di,createSerializableStateInvariantMiddleware:JH,createSlice:Kn,createStore:cm,current:m_,findNonSerializableValue:SN,freeze:um,getDefaultMiddleware:xN,getType:iW,isAction:oT,isAllOf:of,isAnyOf:Xi,isAsyncThunkAction:Pv,isDraft:Hi,isFluxStandardAction:EN,isFulfilled:Pu,isImmutableDefault:YH,isPending:b_,isPlain:bN,isPlainObject:Ds,isRejected:If,isRejectedWithValue:pm,legacy_createStore:dN,miniSerializeError:RN,nanoid:v_,original:XE,prepareAutoBatched:P0,removeListener:VN,unwrapResult:IN},Symbol.toStringTag,{value:"Module"})),_y=(e,t)=>Math.floor(e/t)*t,Ss=(e,t)=>Math.round(e/t)*t;var RW=typeof global=="object"&&global&&global.Object===Object&&global;const WN=RW;var IW=typeof self=="object"&&self&&self.Object===Object&&self,OW=WN||IW||Function("return this")();const wa=OW;var MW=wa.Symbol;const ts=MW;var KN=Object.prototype,NW=KN.hasOwnProperty,DW=KN.toString,Ph=ts?ts.toStringTag:void 0;function LW(e){var t=NW.call(e,Ph),n=e[Ph];try{e[Ph]=void 0;var r=!0}catch{}var i=DW.call(e);return r&&(t?e[Ph]=n:delete e[Ph]),i}var $W=Object.prototype,FW=$W.toString;function BW(e){return FW.call(e)}var zW="[object Null]",jW="[object Undefined]",yk=ts?ts.toStringTag:void 0;function Bs(e){return e==null?e===void 0?jW:zW:yk&&yk in Object(e)?LW(e):BW(e)}function po(e){return e!=null&&typeof e=="object"}var UW="[object Symbol]";function S_(e){return typeof e=="symbol"||po(e)&&Bs(e)==UW}function lT(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 VW=Array.isArray;const Rr=VW;var GW=1/0,vk=ts?ts.prototype:void 0,_k=vk?vk.toString:void 0;function Iv(e){if(typeof e=="string")return e;if(Rr(e))return lT(e,Iv)+"";if(S_(e))return _k?_k.call(e):"";var t=e+"";return t=="0"&&1/e==-GW?"-0":t}var qW=/\s/;function HW(e){for(var t=e.length;t--&&qW.test(e.charAt(t)););return t}var WW=/^\s+/;function KW(e){return e&&e.slice(0,HW(e)+1).replace(WW,"")}function $i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bk=0/0,QW=/^[-+]0x[0-9a-f]+$/i,XW=/^0b[01]+$/i,YW=/^0o[0-7]+$/i,ZW=parseInt;function R0(e){if(typeof e=="number")return e;if(S_(e))return bk;if($i(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$i(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KW(e);var n=XW.test(e);return n||YW.test(e)?ZW(e.slice(2),n?2:8):QW.test(e)?bk:+e}var Sk=1/0,JW=17976931348623157e292;function lf(e){if(!e)return e===0?e:0;if(e=R0(e),e===Sk||e===-Sk){var t=e<0?-1:1;return t*JW}return e===e?e:0}function QN(e){var t=lf(e),n=t%1;return t===t?n?t-n:t:0}function w_(e){return e}var eK="[object AsyncFunction]",tK="[object Function]",nK="[object GeneratorFunction]",rK="[object Proxy]";function uT(e){if(!$i(e))return!1;var t=Bs(e);return t==tK||t==nK||t==eK||t==rK}var iK=wa["__core-js_shared__"];const L2=iK;var wk=function(){var e=/[^.]+$/.exec(L2&&L2.keys&&L2.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function oK(e){return!!wk&&wk in e}var sK=Function.prototype,aK=sK.toString;function Gc(e){if(e!=null){try{return aK.call(e)}catch{}try{return e+""}catch{}}return""}var lK=/[\\^$.*+?()[\]{}|]/g,uK=/^\[object .+?Constructor\]$/,cK=Function.prototype,dK=Object.prototype,fK=cK.toString,hK=dK.hasOwnProperty,pK=RegExp("^"+fK.call(hK).replace(lK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gK(e){if(!$i(e)||oK(e))return!1;var t=uT(e)?pK:uK;return t.test(Gc(e))}function mK(e,t){return e==null?void 0:e[t]}function qc(e,t){var n=mK(e,t);return gK(n)?n:void 0}var yK=qc(wa,"WeakMap");const aC=yK;var xk=Object.create,vK=function(){function e(){}return function(t){if(!$i(t))return{};if(xk)return xk(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const _K=vK;function XN(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 bK(){}function YN(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var SK=800,wK=16,xK=Date.now;function CK(e){var t=0,n=0;return function(){var r=xK(),i=wK-(r-n);if(n=r,i>0){if(++t>=SK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function EK(e){return function(){return e}}var TK=function(){try{var e=qc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ov=TK;var AK=Ov?function(e,t){return Ov(e,"toString",{configurable:!0,enumerable:!1,value:EK(t),writable:!0})}:w_;const kK=AK;var PK=CK(kK);const ZN=PK;function JN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function RK(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 IK(e){return e!==e}function OK(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function MK(e,t,n){return t===t?OK(e,t,n):RK(e,IK,n)}function NK(e,t){var n=e==null?0:e.length;return!!n&&MK(e,t,0)>-1}var DK=9007199254740991,LK=/^(?:0|[1-9]\d*)$/;function cT(e,t){var n=typeof e;return t=t??DK,!!t&&(n=="number"||n!="symbol"&&LK.test(e))&&e>-1&&e%1==0&&e<t}function x_(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 $K=Object.prototype,FK=$K.hasOwnProperty;function e7(e,t,n){var r=e[t];(!(FK.call(e,t)&&ym(r,n))||n===void 0&&!(t in e))&&x_(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?x_(n,a,l):e7(n,a,l)}return n}var Ck=Math.max;function t7(e,t,n){return t=Ck(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Ck(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),XN(e,this,a)}}function n7(e,t){return ZN(t7(e,t,w_),e+"")}var BK=9007199254740991;function dT(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BK}function Hc(e){return e!=null&&dT(e.length)&&!uT(e)}function C_(e,t,n){if(!$i(n))return!1;var r=typeof t;return(r=="number"?Hc(n)&&cT(t,n.length):r=="string"&&t in n)?ym(n[t],e):!1}function r7(e){return n7(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&&C_(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 zK=Object.prototype;function fT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zK;return e===n}function jK(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var UK="[object Arguments]";function Ek(e){return po(e)&&Bs(e)==UK}var i7=Object.prototype,VK=i7.hasOwnProperty,GK=i7.propertyIsEnumerable,qK=Ek(function(){return arguments}())?Ek:function(e){return po(e)&&VK.call(e,"callee")&&!GK.call(e,"callee")};const tg=qK;function HK(){return!1}var o7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tk=o7&&typeof module=="object"&&module&&!module.nodeType&&module,WK=Tk&&Tk.exports===o7,Ak=WK?wa.Buffer:void 0,KK=Ak?Ak.isBuffer:void 0,QK=KK||HK;const ng=QK;var XK="[object Arguments]",YK="[object Array]",ZK="[object Boolean]",JK="[object Date]",eQ="[object Error]",tQ="[object Function]",nQ="[object Map]",rQ="[object Number]",iQ="[object Object]",oQ="[object RegExp]",sQ="[object Set]",aQ="[object String]",lQ="[object WeakMap]",uQ="[object ArrayBuffer]",cQ="[object DataView]",dQ="[object Float32Array]",fQ="[object Float64Array]",hQ="[object Int8Array]",pQ="[object Int16Array]",gQ="[object Int32Array]",mQ="[object Uint8Array]",yQ="[object Uint8ClampedArray]",vQ="[object Uint16Array]",_Q="[object Uint32Array]",Ln={};Ln[dQ]=Ln[fQ]=Ln[hQ]=Ln[pQ]=Ln[gQ]=Ln[mQ]=Ln[yQ]=Ln[vQ]=Ln[_Q]=!0;Ln[XK]=Ln[YK]=Ln[uQ]=Ln[ZK]=Ln[cQ]=Ln[JK]=Ln[eQ]=Ln[tQ]=Ln[nQ]=Ln[rQ]=Ln[iQ]=Ln[oQ]=Ln[sQ]=Ln[aQ]=Ln[lQ]=!1;function bQ(e){return po(e)&&dT(e.length)&&!!Ln[Bs(e)]}function E_(e){return function(t){return e(t)}}var s7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yp=s7&&typeof module=="object"&&module&&!module.nodeType&&module,SQ=yp&&yp.exports===s7,$2=SQ&&WN.process,wQ=function(){try{var e=yp&&yp.require&&yp.require("util").types;return e||$2&&$2.binding&&$2.binding("util")}catch{}}();const pu=wQ;var kk=pu&&pu.isTypedArray,xQ=kk?E_(kk):bQ;const hT=xQ;var CQ=Object.prototype,EQ=CQ.hasOwnProperty;function a7(e,t){var n=Rr(e),r=!n&&tg(e),i=!n&&!r&&ng(e),o=!n&&!r&&!i&&hT(e),s=n||r||i||o,a=s?jK(e.length,String):[],l=a.length;for(var u in e)(t||EQ.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||cT(u,l)))&&a.push(u);return a}function l7(e,t){return function(n){return e(t(n))}}var TQ=l7(Object.keys,Object);const AQ=TQ;var kQ=Object.prototype,PQ=kQ.hasOwnProperty;function u7(e){if(!fT(e))return AQ(e);var t=[];for(var n in Object(e))PQ.call(e,n)&&n!="constructor"&&t.push(n);return t}function vm(e){return Hc(e)?a7(e):u7(e)}function RQ(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var IQ=Object.prototype,OQ=IQ.hasOwnProperty;function MQ(e){if(!$i(e))return RQ(e);var t=fT(e),n=[];for(var r in e)r=="constructor"&&(t||!OQ.call(e,r))||n.push(r);return n}function _m(e){return Hc(e)?a7(e,!0):MQ(e)}var NQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DQ=/^\w*$/;function pT(e,t){if(Rr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||S_(e)?!0:DQ.test(e)||!NQ.test(e)||t!=null&&e in Object(t)}var LQ=qc(Object,"create");const rg=LQ;function $Q(){this.__data__=rg?rg(null):{},this.size=0}function FQ(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var BQ="__lodash_hash_undefined__",zQ=Object.prototype,jQ=zQ.hasOwnProperty;function UQ(e){var t=this.__data__;if(rg){var n=t[e];return n===BQ?void 0:n}return jQ.call(t,e)?t[e]:void 0}var VQ=Object.prototype,GQ=VQ.hasOwnProperty;function qQ(e){var t=this.__data__;return rg?t[e]!==void 0:GQ.call(t,e)}var HQ="__lodash_hash_undefined__";function WQ(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rg&&t===void 0?HQ:t,this}function kc(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])}}kc.prototype.clear=$Q;kc.prototype.delete=FQ;kc.prototype.get=UQ;kc.prototype.has=qQ;kc.prototype.set=WQ;function KQ(){this.__data__=[],this.size=0}function T_(e,t){for(var n=e.length;n--;)if(ym(e[n][0],t))return n;return-1}var QQ=Array.prototype,XQ=QQ.splice;function YQ(e){var t=this.__data__,n=T_(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XQ.call(t,n,1),--this.size,!0}function ZQ(e){var t=this.__data__,n=T_(t,e);return n<0?void 0:t[n][1]}function JQ(e){return T_(this.__data__,e)>-1}function eX(e,t){var n=this.__data__,r=T_(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function 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=KQ;fl.prototype.delete=YQ;fl.prototype.get=ZQ;fl.prototype.has=JQ;fl.prototype.set=eX;var tX=qc(wa,"Map");const ig=tX;function nX(){this.size=0,this.__data__={hash:new kc,map:new(ig||fl),string:new kc}}function rX(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function A_(e,t){var n=e.__data__;return rX(t)?n[typeof t=="string"?"string":"hash"]:n.map}function iX(e){var t=A_(this,e).delete(e);return this.size-=t?1:0,t}function oX(e){return A_(this,e).get(e)}function sX(e){return A_(this,e).has(e)}function aX(e,t){var n=A_(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function hl(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])}}hl.prototype.clear=nX;hl.prototype.delete=iX;hl.prototype.get=oX;hl.prototype.has=sX;hl.prototype.set=aX;var lX="Expected a function";function gT(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lX);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(gT.Cache||hl),n}gT.Cache=hl;var uX=500;function cX(e){var t=gT(e,function(r){return n.size===uX&&n.clear(),r}),n=t.cache;return t}var dX=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fX=/\\(\\)?/g,hX=cX(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dX,function(n,r,i,o){t.push(i?o.replace(fX,"$1"):r||n)}),t});const pX=hX;function Of(e){return e==null?"":Iv(e)}function k_(e,t){return Rr(e)?e:pT(e,t)?[e]:pX(Of(e))}var gX=1/0;function bm(e){if(typeof e=="string"||S_(e))return e;var t=e+"";return t=="0"&&1/e==-gX?"-0":t}function mT(e,t){t=k_(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 Mv(e,t,n){var r=e==null?void 0:mT(e,t);return r===void 0?n:r}function yT(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Pk=ts?ts.isConcatSpreadable:void 0;function mX(e){return Rr(e)||tg(e)||!!(Pk&&e&&e[Pk])}function c7(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=mX),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?c7(a,t-1,n,r,i):yT(i,a):r||(i[i.length]=a)}return i}function yX(e){var t=e==null?0:e.length;return t?c7(e,1):[]}function vX(e){return ZN(t7(e,void 0,yX),e+"")}var _X=l7(Object.getPrototypeOf,Object);const vT=_X;var bX="[object Object]",SX=Function.prototype,wX=Object.prototype,d7=SX.toString,xX=wX.hasOwnProperty,CX=d7.call(Object);function f7(e){if(!po(e)||Bs(e)!=bX)return!1;var t=vT(e);if(t===null)return!0;var n=xX.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&d7.call(n)==CX}function h7(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 p7(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:h7(e,t,n)}var EX="\\ud800-\\udfff",TX="\\u0300-\\u036f",AX="\\ufe20-\\ufe2f",kX="\\u20d0-\\u20ff",PX=TX+AX+kX,RX="\\ufe0e\\ufe0f",IX="\\u200d",OX=RegExp("["+IX+EX+PX+RX+"]");function P_(e){return OX.test(e)}function MX(e){return e.split("")}var g7="\\ud800-\\udfff",NX="\\u0300-\\u036f",DX="\\ufe20-\\ufe2f",LX="\\u20d0-\\u20ff",$X=NX+DX+LX,FX="\\ufe0e\\ufe0f",BX="["+g7+"]",lC="["+$X+"]",uC="\\ud83c[\\udffb-\\udfff]",zX="(?:"+lC+"|"+uC+")",m7="[^"+g7+"]",y7="(?:\\ud83c[\\udde6-\\uddff]){2}",v7="[\\ud800-\\udbff][\\udc00-\\udfff]",jX="\\u200d",_7=zX+"?",b7="["+FX+"]?",UX="(?:"+jX+"(?:"+[m7,y7,v7].join("|")+")"+b7+_7+")*",VX=b7+_7+UX,GX="(?:"+[m7+lC+"?",lC,y7,v7,BX].join("|")+")",qX=RegExp(uC+"(?="+uC+")|"+GX+VX,"g");function HX(e){return e.match(qX)||[]}function S7(e){return P_(e)?HX(e):MX(e)}function WX(e){return function(t){t=Of(t);var n=P_(t)?S7(t):void 0,r=n?n[0]:t.charAt(0),i=n?p7(n,1).join(""):t.slice(1);return r[e]()+i}}var KX=WX("toUpperCase");const w7=KX;function x7(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 QX(e){return function(t){return e==null?void 0:e[t]}}var XX={À:"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"},YX=QX(XX);const ZX=YX;var JX=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eY="\\u0300-\\u036f",tY="\\ufe20-\\ufe2f",nY="\\u20d0-\\u20ff",rY=eY+tY+nY,iY="["+rY+"]",oY=RegExp(iY,"g");function sY(e){return e=Of(e),e&&e.replace(JX,ZX).replace(oY,"")}var aY=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function lY(e){return e.match(aY)||[]}var uY=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cY(e){return uY.test(e)}var C7="\\ud800-\\udfff",dY="\\u0300-\\u036f",fY="\\ufe20-\\ufe2f",hY="\\u20d0-\\u20ff",pY=dY+fY+hY,E7="\\u2700-\\u27bf",T7="a-z\\xdf-\\xf6\\xf8-\\xff",gY="\\xac\\xb1\\xd7\\xf7",mY="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yY="\\u2000-\\u206f",vY=" \\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",A7="A-Z\\xc0-\\xd6\\xd8-\\xde",_Y="\\ufe0e\\ufe0f",k7=gY+mY+yY+vY,P7="['’]",Rk="["+k7+"]",bY="["+pY+"]",R7="\\d+",SY="["+E7+"]",I7="["+T7+"]",O7="[^"+C7+k7+R7+E7+T7+A7+"]",wY="\\ud83c[\\udffb-\\udfff]",xY="(?:"+bY+"|"+wY+")",CY="[^"+C7+"]",M7="(?:\\ud83c[\\udde6-\\uddff]){2}",N7="[\\ud800-\\udbff][\\udc00-\\udfff]",Td="["+A7+"]",EY="\\u200d",Ik="(?:"+I7+"|"+O7+")",TY="(?:"+Td+"|"+O7+")",Ok="(?:"+P7+"(?:d|ll|m|re|s|t|ve))?",Mk="(?:"+P7+"(?:D|LL|M|RE|S|T|VE))?",D7=xY+"?",L7="["+_Y+"]?",AY="(?:"+EY+"(?:"+[CY,M7,N7].join("|")+")"+L7+D7+")*",kY="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",PY="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",RY=L7+D7+AY,IY="(?:"+[SY,M7,N7].join("|")+")"+RY,OY=RegExp([Td+"?"+I7+"+"+Ok+"(?="+[Rk,Td,"$"].join("|")+")",TY+"+"+Mk+"(?="+[Rk,Td+Ik,"$"].join("|")+")",Td+"?"+Ik+"+"+Ok,Td+"+"+Mk,PY,kY,R7,IY].join("|"),"g");function MY(e){return e.match(OY)||[]}function NY(e,t,n){return e=Of(e),t=n?void 0:t,t===void 0?cY(e)?MY(e):lY(e):e.match(t)||[]}var DY="['’]",LY=RegExp(DY,"g");function $Y(e){return function(t){return x7(NY(sY(t).replace(LY,"")),e,"")}}function FY(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Ul(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=R0(n),n=n===n?n:0),t!==void 0&&(t=R0(t),t=t===t?t:0),FY(R0(e),t,n)}function BY(){this.__data__=new fl,this.size=0}function zY(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function jY(e){return this.__data__.get(e)}function UY(e){return this.__data__.has(e)}var VY=200;function GY(e,t){var n=this.__data__;if(n instanceof fl){var r=n.__data__;if(!ig||r.length<VY-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new hl(r)}return n.set(e,t),this.size=n.size,this}function Rs(e){var t=this.__data__=new fl(e);this.size=t.size}Rs.prototype.clear=BY;Rs.prototype.delete=zY;Rs.prototype.get=jY;Rs.prototype.has=UY;Rs.prototype.set=GY;function qY(e,t){return e&&nh(t,vm(t),e)}function HY(e,t){return e&&nh(t,_m(t),e)}var $7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nk=$7&&typeof module=="object"&&module&&!module.nodeType&&module,WY=Nk&&Nk.exports===$7,Dk=WY?wa.Buffer:void 0,Lk=Dk?Dk.allocUnsafe:void 0;function F7(e,t){if(t)return e.slice();var n=e.length,r=Lk?Lk(n):new e.constructor(n);return e.copy(r),r}function B7(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 z7(){return[]}var KY=Object.prototype,QY=KY.propertyIsEnumerable,$k=Object.getOwnPropertySymbols,XY=$k?function(e){return e==null?[]:(e=Object(e),B7($k(e),function(t){return QY.call(e,t)}))}:z7;const _T=XY;function YY(e,t){return nh(e,_T(e),t)}var ZY=Object.getOwnPropertySymbols,JY=ZY?function(e){for(var t=[];e;)yT(t,_T(e)),e=vT(e);return t}:z7;const j7=JY;function eZ(e,t){return nh(e,j7(e),t)}function U7(e,t,n){var r=t(e);return Rr(e)?r:yT(r,n(e))}function cC(e){return U7(e,vm,_T)}function V7(e){return U7(e,_m,j7)}var tZ=qc(wa,"DataView");const dC=tZ;var nZ=qc(wa,"Promise");const fC=nZ;var rZ=qc(wa,"Set");const uf=rZ;var Fk="[object Map]",iZ="[object Object]",Bk="[object Promise]",zk="[object Set]",jk="[object WeakMap]",Uk="[object DataView]",oZ=Gc(dC),sZ=Gc(ig),aZ=Gc(fC),lZ=Gc(uf),uZ=Gc(aC),Qu=Bs;(dC&&Qu(new dC(new ArrayBuffer(1)))!=Uk||ig&&Qu(new ig)!=Fk||fC&&Qu(fC.resolve())!=Bk||uf&&Qu(new uf)!=zk||aC&&Qu(new aC)!=jk)&&(Qu=function(e){var t=Bs(e),n=t==iZ?e.constructor:void 0,r=n?Gc(n):"";if(r)switch(r){case oZ:return Uk;case sZ:return Fk;case aZ:return Bk;case lZ:return zk;case uZ:return jk}return t});const Mf=Qu;var cZ=Object.prototype,dZ=cZ.hasOwnProperty;function fZ(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dZ.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var hZ=wa.Uint8Array;const Nv=hZ;function bT(e){var t=new e.constructor(e.byteLength);return new Nv(t).set(new Nv(e)),t}function pZ(e,t){var n=t?bT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gZ=/\w*$/;function mZ(e){var t=new e.constructor(e.source,gZ.exec(e));return t.lastIndex=e.lastIndex,t}var Vk=ts?ts.prototype:void 0,Gk=Vk?Vk.valueOf:void 0;function yZ(e){return Gk?Object(Gk.call(e)):{}}function G7(e,t){var n=t?bT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var vZ="[object Boolean]",_Z="[object Date]",bZ="[object Map]",SZ="[object Number]",wZ="[object RegExp]",xZ="[object Set]",CZ="[object String]",EZ="[object Symbol]",TZ="[object ArrayBuffer]",AZ="[object DataView]",kZ="[object Float32Array]",PZ="[object Float64Array]",RZ="[object Int8Array]",IZ="[object Int16Array]",OZ="[object Int32Array]",MZ="[object Uint8Array]",NZ="[object Uint8ClampedArray]",DZ="[object Uint16Array]",LZ="[object Uint32Array]";function $Z(e,t,n){var r=e.constructor;switch(t){case TZ:return bT(e);case vZ:case _Z:return new r(+e);case AZ:return pZ(e,n);case kZ:case PZ:case RZ:case IZ:case OZ:case MZ:case NZ:case DZ:case LZ:return G7(e,n);case bZ:return new r;case SZ:case CZ:return new r(e);case wZ:return mZ(e);case xZ:return new r;case EZ:return yZ(e)}}function q7(e){return typeof e.constructor=="function"&&!fT(e)?_K(vT(e)):{}}var FZ="[object Map]";function BZ(e){return po(e)&&Mf(e)==FZ}var qk=pu&&pu.isMap,zZ=qk?E_(qk):BZ;const jZ=zZ;var UZ="[object Set]";function VZ(e){return po(e)&&Mf(e)==UZ}var Hk=pu&&pu.isSet,GZ=Hk?E_(Hk):VZ;const qZ=GZ;var HZ=1,WZ=2,KZ=4,H7="[object Arguments]",QZ="[object Array]",XZ="[object Boolean]",YZ="[object Date]",ZZ="[object Error]",W7="[object Function]",JZ="[object GeneratorFunction]",eJ="[object Map]",tJ="[object Number]",K7="[object Object]",nJ="[object RegExp]",rJ="[object Set]",iJ="[object String]",oJ="[object Symbol]",sJ="[object WeakMap]",aJ="[object ArrayBuffer]",lJ="[object DataView]",uJ="[object Float32Array]",cJ="[object Float64Array]",dJ="[object Int8Array]",fJ="[object Int16Array]",hJ="[object Int32Array]",pJ="[object Uint8Array]",gJ="[object Uint8ClampedArray]",mJ="[object Uint16Array]",yJ="[object Uint32Array]",Cn={};Cn[H7]=Cn[QZ]=Cn[aJ]=Cn[lJ]=Cn[XZ]=Cn[YZ]=Cn[uJ]=Cn[cJ]=Cn[dJ]=Cn[fJ]=Cn[hJ]=Cn[eJ]=Cn[tJ]=Cn[K7]=Cn[nJ]=Cn[rJ]=Cn[iJ]=Cn[oJ]=Cn[pJ]=Cn[gJ]=Cn[mJ]=Cn[yJ]=!0;Cn[ZZ]=Cn[W7]=Cn[sJ]=!1;function vp(e,t,n,r,i,o){var s,a=t&HZ,l=t&WZ,u=t&KZ;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!$i(e))return e;var c=Rr(e);if(c){if(s=fZ(e),!a)return YN(e,s)}else{var d=Mf(e),f=d==W7||d==JZ;if(ng(e))return F7(e,a);if(d==K7||d==H7||f&&!i){if(s=l||f?{}:q7(e),!a)return l?eZ(e,HY(s,e)):YY(e,qY(s,e))}else{if(!Cn[d])return i?e:{};s=$Z(e,d,a)}}o||(o=new Rs);var h=o.get(e);if(h)return h;o.set(e,s),qZ(e)?e.forEach(function(b){s.add(vp(b,t,n,b,e,o))}):jZ(e)&&e.forEach(function(b,_){s.set(_,vp(b,t,n,_,e,o))});var p=u?l?V7:cC:l?_m:vm,m=c?void 0:p(e);return JN(m||e,function(b,_){m&&(_=b,b=e[_]),e7(s,_,vp(b,t,n,_,e,o))}),s}var vJ=1,_J=4;function Zn(e){return vp(e,vJ|_J)}var bJ="__lodash_hash_undefined__";function SJ(e){return this.__data__.set(e,bJ),this}function wJ(e){return this.__data__.has(e)}function og(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new hl;++t<n;)this.add(e[t])}og.prototype.add=og.prototype.push=SJ;og.prototype.has=wJ;function Q7(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 X7(e,t){return e.has(t)}var xJ=1,CJ=2;function Y7(e,t,n,r,i,o){var s=n&xJ,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(!Q7(t,function(_,v){if(!X7(h,v)&&(p===_||i(p,_,n,r,o)))return h.push(v)})){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 EJ(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function ST(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var TJ=1,AJ=2,kJ="[object Boolean]",PJ="[object Date]",RJ="[object Error]",IJ="[object Map]",OJ="[object Number]",MJ="[object RegExp]",NJ="[object Set]",DJ="[object String]",LJ="[object Symbol]",$J="[object ArrayBuffer]",FJ="[object DataView]",Wk=ts?ts.prototype:void 0,F2=Wk?Wk.valueOf:void 0;function BJ(e,t,n,r,i,o,s){switch(n){case FJ:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $J:return!(e.byteLength!=t.byteLength||!o(new Nv(e),new Nv(t)));case kJ:case PJ:case OJ:return ym(+e,+t);case RJ:return e.name==t.name&&e.message==t.message;case MJ:case DJ:return e==t+"";case IJ:var a=EJ;case NJ:var l=r&TJ;if(a||(a=ST),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=AJ,s.set(e,t);var c=Y7(a(e),a(t),r,i,o,s);return s.delete(e),c;case LJ:if(F2)return F2.call(e)==F2.call(t)}return!1}var zJ=1,jJ=Object.prototype,UJ=jJ.hasOwnProperty;function VJ(e,t,n,r,i,o){var s=n&zJ,a=cC(e),l=a.length,u=cC(t),c=u.length;if(l!=c&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in t:UJ.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],v=t[f];if(r)var g=s?r(v,_,f,t,e,o):r(_,v,f,e,t,o);if(!(g===void 0?_===v||i(_,v,n,r,o):g)){m=!1;break}b||(b=f=="constructor")}if(m&&!b){var y=e.constructor,S=t.constructor;y!=S&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var GJ=1,Kk="[object Arguments]",Qk="[object Array]",by="[object Object]",qJ=Object.prototype,Xk=qJ.hasOwnProperty;function HJ(e,t,n,r,i,o){var s=Rr(e),a=Rr(t),l=s?Qk:Mf(e),u=a?Qk:Mf(t);l=l==Kk?by:l,u=u==Kk?by:u;var c=l==by,d=u==by,f=l==u;if(f&&ng(e)){if(!ng(t))return!1;s=!0,c=!1}if(f&&!c)return o||(o=new Rs),s||hT(e)?Y7(e,t,n,r,i,o):BJ(e,t,l,n,r,i,o);if(!(n&GJ)){var h=c&&Xk.call(e,"__wrapped__"),p=d&&Xk.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,b=p?t.value():t;return o||(o=new Rs),i(m,b,n,r,o)}}return f?(o||(o=new Rs),VJ(e,t,n,r,i,o)):!1}function R_(e,t,n,r,i){return e===t?!0:e==null||t==null||!po(e)&&!po(t)?e!==e&&t!==t:HJ(e,t,n,r,R_,i)}var WJ=1,KJ=2;function QJ(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 Rs;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?R_(c,u,WJ|KJ,r,d):f))return!1}}return!0}function Z7(e){return e===e&&!$i(e)}function XJ(e){for(var t=vm(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Z7(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 YJ(e){var t=XJ(e);return t.length==1&&t[0][2]?J7(t[0][0],t[0][1]):function(n){return n===e||QJ(n,e,t)}}function ZJ(e,t){return e!=null&&t in Object(e)}function eD(e,t,n){t=k_(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&&dT(i)&&cT(s,i)&&(Rr(e)||tg(e)))}function JJ(e,t){return e!=null&&eD(e,t,ZJ)}var eee=1,tee=2;function nee(e,t){return pT(e)&&Z7(t)?J7(bm(e),t):function(n){var r=Mv(n,e);return r===void 0&&r===t?JJ(n,e):R_(t,r,eee|tee)}}function tD(e){return function(t){return t==null?void 0:t[e]}}function ree(e){return function(t){return mT(t,e)}}function iee(e){return pT(e)?tD(bm(e)):ree(e)}function rh(e){return typeof e=="function"?e:e==null?w_:typeof e=="object"?Rr(e)?nee(e[0],e[1]):YJ(e):iee(e)}function oee(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 see(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 aee=see();const nD=aee;function lee(e,t){return e&&nD(e,t,vm)}function uee(e,t){return function(n,r){if(n==null)return n;if(!Hc(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 cee=uee(lee);const ih=cee;function dee(e,t,n,r){return ih(e,function(i,o,s){t(r,i,n(i),s)}),r}function fee(e,t){return function(n,r){var i=Rr(n)?oee:dee,o=t?t():{};return i(n,e,rh(r),o)}}function hC(e,t,n){(n!==void 0&&!ym(e[t],n)||n===void 0&&!(t in e))&&x_(e,t,n)}function hee(e){return po(e)&&Hc(e)}function pC(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function pee(e){return nh(e,_m(e))}function gee(e,t,n,r,i,o,s){var a=pC(e,n),l=pC(t,n),u=s.get(l);if(u){hC(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&&hT(l);c=l,f||h||p?Rr(a)?c=a:hee(a)?c=YN(a):h?(d=!1,c=F7(l,!0)):p?(d=!1,c=G7(l,!0)):c=[]:f7(l)||tg(l)?(c=a,tg(a)?c=pee(a):(!$i(a)||uT(a))&&(c=q7(l))):d=!1}d&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),hC(e,n,c)}function I_(e,t,n,r,i){e!==t&&nD(t,function(o,s){if(i||(i=new Rs),$i(o))gee(e,t,s,n,I_,r,i);else{var a=r?r(pC(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),hC(e,s,a)}},_m)}function rD(e,t,n,r,i,o){return $i(e)&&$i(t)&&(o.set(t,e),I_(e,t,void 0,rD,o),o.delete(t)),e}var mee=r7(function(e,t,n,r){I_(e,t,n,r)});const yee=mee;var vee=n7(function(e){return e.push(void 0,rD),XN(yee,void 0,e)});const _ee=vee;function bee(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 See(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function wee(e){return typeof e=="function"?e:w_}function Mo(e,t){var n=Rr(e)?JN:ih;return n(e,wee(t))}function xee(e,t){var n=[];return ih(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}function Cee(e,t){var n=Rr(e)?B7:xee;return n(e,rh(t))}function Eee(e,t){var n=-1,r=Hc(e)?Array(e.length):[];return ih(e,function(i,o,s){r[++n]=t(i,o,s)}),r}function Tee(e,t){var n=Rr(e)?lT:Eee;return n(e,rh(t))}var Aee=Object.prototype,kee=Aee.hasOwnProperty;function Pee(e,t){return e!=null&&kee.call(e,t)}function Ree(e,t){return e!=null&&eD(e,t,Pee)}var Iee="[object String]";function iD(e){return typeof e=="string"||!Rr(e)&&po(e)&&Bs(e)==Iee}function Oee(e,t){return t.length<2?e:mT(e,h7(t,0,-1))}var Mee="[object Boolean]";function Nee(e){return e===!0||e===!1||po(e)&&Bs(e)==Mee}function Sm(e,t){return R_(e,t)}function Dee(e){return typeof e=="number"&&e==QN(e)}var Lee="[object Number]";function oD(e){return typeof e=="number"||po(e)&&Bs(e)==Lee}var $ee="[object RegExp]";function Fee(e){return po(e)&&Bs(e)==$ee}var Yk=pu&&pu.isRegExp,Bee=Yk?E_(Yk):Fee;const zee=Bee;var jee=fee(function(e,t,n){x_(e,n,t)});const wT=jee;var Uee=r7(function(e,t,n){I_(e,t,n)});const Vee=Uee;function sD(e,t){return t=k_(t,e),e=Oee(e,t),e==null||delete e[bm(See(t))]}function Gee(e){return f7(e)?void 0:e}var qee=1,Hee=2,Wee=4,Kee=vX(function(e,t){var n={};if(e==null)return n;var r=!1;t=lT(t,function(o){return o=k_(o,e),r||(r=o.length>1),o}),nh(e,V7(e),n),r&&(n=vp(n,qee|Hee|Wee,Gee));for(var i=t.length;i--;)sD(n,t[i]);return n});const O_=Kee;var Qee=tD("length");const Xee=Qee;var aD="\\ud800-\\udfff",Yee="\\u0300-\\u036f",Zee="\\ufe20-\\ufe2f",Jee="\\u20d0-\\u20ff",ete=Yee+Zee+Jee,tte="\\ufe0e\\ufe0f",nte="["+aD+"]",gC="["+ete+"]",mC="\\ud83c[\\udffb-\\udfff]",rte="(?:"+gC+"|"+mC+")",lD="[^"+aD+"]",uD="(?:\\ud83c[\\udde6-\\uddff]){2}",cD="[\\ud800-\\udbff][\\udc00-\\udfff]",ite="\\u200d",dD=rte+"?",fD="["+tte+"]?",ote="(?:"+ite+"(?:"+[lD,uD,cD].join("|")+")"+fD+dD+")*",ste=fD+dD+ote,ate="(?:"+[lD+gC+"?",gC,uD,cD,nte].join("|")+")",Zk=RegExp(mC+"(?="+mC+")|"+ate+ste,"g");function lte(e){for(var t=Zk.lastIndex=0;Zk.test(e);)++t;return t}function hD(e){return P_(e)?lte(e):Xee(e)}var ute=Math.floor,cte=Math.random;function dte(e,t){return e+ute(cte()*(t-e+1))}var fte=parseFloat,hte=Math.min,pte=Math.random;function gte(e,t,n){if(n&&typeof n!="boolean"&&C_(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=lf(e),t===void 0?(t=e,e=0):t=lf(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=pte();return hte(e+i*(t-e+fte("1e-"+((i+"").length-1))),t)}return dte(e,t)}var mte=Math.ceil,yte=Math.max;function vte(e,t,n,r){for(var i=-1,o=yte(mte((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}function _te(e){return function(t,n,r){return r&&typeof r!="number"&&C_(t,n,r)&&(n=r=void 0),t=lf(t),n===void 0?(n=t,t=0):n=lf(n),r=r===void 0?t<n?1:-1:lf(r),vte(t,n,r,e)}}var bte=_te();const Ste=bte;function wte(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}function yC(e,t,n){var r=Rr(e)?x7:wte,i=arguments.length<3;return r(e,rh(t),n,i,ih)}var xte="[object Map]",Cte="[object Set]";function M_(e){if(e==null)return 0;if(Hc(e))return iD(e)?hD(e):e.length;var t=Mf(e);return t==xte||t==Cte?e.size:u7(e).length}function Ete(e,t){var n;return ih(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function _p(e,t,n){var r=Rr(e)?Q7:Ete;return n&&C_(e,t,n)&&(t=void 0),r(e,rh(t))}var Tte=$Y(function(e,t,n){return e+(n?" ":"")+w7(t)});const Ate=Tte;var kte=30,Pte="...",Rte=/\w*$/;function B2(e,t){var n=kte,r=Pte;if($i(t)){var i="separator"in t?t.separator:i;n="length"in t?QN(t.length):n,r="omission"in t?Iv(t.omission):r}e=Of(e);var o=e.length;if(P_(e)){var s=S7(e);o=s.length}if(n>=o)return e;var a=n-hD(r);if(a<1)return r;var l=s?p7(s,0,a).join(""):e.slice(0,a);if(i===void 0)return l+r;if(s&&(a+=l.length-a),zee(i)){if(e.slice(a).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Of(Rte.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(Iv(i),a)!=a){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Ite=1/0,Ote=uf&&1/ST(new uf([,-0]))[1]==Ite?function(e){return new uf(e)}:bK;const Mte=Ote;var Nte=200;function Dte(e,t,n){var r=-1,i=NK,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=bee;else if(o>=Nte){var u=t?null:Mte(e);if(u)return ST(u);s=!1,i=X7,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 Jk(e,t){return e&&e.length?Dte(e,rh(t)):[]}function eP(e,t){return e==null?!0:sD(e,t)}const pD={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:1e3,inputMax:1e4,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},gD=Kn({name:"config",initialState:pD,reducers:{configChanged:(e,t)=>{Vee(e,t.payload)}}}),{configChanged:Lte}=gD.actions,$te=gD.reducer,c8e={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},d8e={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Fte={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]}},f8e={lycoris:"LyCORIS",diffusers:"Diffusers"},Bte=0,bp=4294967295;var Ht;(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})(Ht||(Ht={}));var vC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(vC||(vC={}));const Re=Ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$l=e=>{switch(typeof e){case"undefined":return Re.undefined;case"string":return Re.string;case"number":return isNaN(e)?Re.nan:Re.number;case"boolean":return Re.boolean;case"function":return Re.function;case"bigint":return Re.bigint;case"symbol":return Re.symbol;case"object":return Array.isArray(e)?Re.array:e===null?Re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Re.promise:typeof Map<"u"&&e instanceof Map?Re.map:typeof Set<"u"&&e instanceof Set?Re.set:typeof Date<"u"&&e instanceof Date?Re.date:Re.object;default:return Re.unknown}},de=Ht.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"]),zte=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Is 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,Ht.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()}}Is.create=e=>new Is(e);const sg=(e,t)=>{let n;switch(e.code){case de.invalid_type:e.received===Re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case de.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ht.jsonStringifyReplacer)}`;break;case de.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ht.joinValues(e.keys,", ")}`;break;case de.invalid_union:n="Invalid input";break;case de.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ht.joinValues(e.options)}`;break;case de.invalid_enum_value:n=`Invalid enum value. Expected ${Ht.joinValues(e.options)}, received '${e.received}'`;break;case de.invalid_arguments:n="Invalid function arguments";break;case de.invalid_return_type:n="Invalid function return type";break;case de.invalid_date:n="Invalid date";break;case de.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}"`:Ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case de.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 de.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 de.custom:n="Invalid input";break;case de.invalid_intersection_types:n="Intersection results could not be merged";break;case de.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case de.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ht.assertNever(e)}return{message:n}};let mD=sg;function jte(e){mD=e}function Dv(){return mD}const Lv=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}},Ute=[];function Oe(e,t){const n=Lv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Dv(),sg].filter(r=>!!r)});e.common.issues.push(n)}class Fi{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 ht;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 Fi.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 ht;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 ht=Object.freeze({status:"aborted"}),yD=e=>({status:"dirty",value:e}),Wi=e=>({status:"valid",value:e}),_C=e=>e.status==="aborted",bC=e=>e.status==="dirty",ag=e=>e.status==="valid",$v=e=>typeof Promise<"u"&&e instanceof Promise;var et;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(et||(et={}));class ma{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 tP=(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 Is(e.common.issues);return this._error=n,this._error}}};function vt(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 wt{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 $l(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:$l(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fi,ctx:{common:t.parent.common,data:t.data,parsedType:$l(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($v(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:$l(t)},o=this._parseSync({data:t,path:i.path,parent:i});return tP(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:$l(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await($v(i)?i:Promise.resolve(i));return tP(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:de.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 Ls({schema:this,typeName:it.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Qa.create(this,this._def)}nullable(){return Ic.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Os.create(this,this._def)}promise(){return Df.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 Ls({...vt(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new yg({...vt(this._def),innerType:this,defaultValue:n,typeName:it.ZodDefault})}brand(){return new _D({typeName:it.ZodBranded,type:this,...vt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new jv({...vt(this._def),innerType:this,catchValue:n,typeName:it.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return wm.create(this,t)}readonly(){return Vv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vte=/^c[^\s-]{8,}$/i,Gte=/^[a-z][a-z0-9]*$/,qte=/[0-9A-HJKMNP-TV-Z]{26}/,Hte=/^[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,Wte=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kte=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,Qte=/^(((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}))$/,Xte=/^(([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})))$/,Yte=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 Zte(e,t){return!!((t==="v4"||!t)&&Qte.test(e)||(t==="v6"||!t)&&Xte.test(e))}class Ts extends wt{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:de.invalid_string,...et.errToObj(r)}),this.nonempty=t=>this.min(1,et.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)!==Re.string){const o=this._getOrReturnCtx(t);return Oe(o,{code:de.invalid_type,expected:Re.string,received:o.parsedType}),ht}const r=new Fi;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Oe(i,{code:de.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),Oe(i,{code:de.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?Oe(i,{code:de.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Oe(i,{code:de.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Wte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"email",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Kte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"emoji",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Hte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"uuid",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Vte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"cuid",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Gte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"cuid2",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")qte.test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"ulid",code:de.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Oe(i,{validation:"url",code:de.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),Oe(i,{validation:"regex",code:de.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),Oe(i,{code:de.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),Oe(i,{code:de.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Oe(i,{code:de.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Yte(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Oe(i,{code:de.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Zte(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Oe(i,{validation:"ip",code:de.invalid_string,message:o.message}),r.dirty()):Ht.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",...et.errToObj(t)})}url(t){return this._addCheck({kind:"url",...et.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...et.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...et.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...et.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...et.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...et.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...et.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,...et.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...et.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...et.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...et.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...et.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...et.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...et.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:it.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...vt(e)})};function Jte(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 gu extends wt{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)!==Re.number){const o=this._getOrReturnCtx(t);return Oe(o,{code:de.invalid_type,expected:Re.number,received:o.parsedType}),ht}let r;const i=new Fi;for(const o of this._def.checks)o.kind==="int"?Ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:de.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),Oe(r,{code:de.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),Oe(r,{code:de.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Jte(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:de.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:de.not_finite,message:o.message}),i.dirty()):Ht.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,i){return new gu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(t){return new gu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:et.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:et.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.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"&&Ht.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)}}gu.create=e=>new gu({checks:[],typeName:it.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...vt(e)});class mu extends wt{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)!==Re.bigint){const o=this._getOrReturnCtx(t);return Oe(o,{code:de.invalid_type,expected:Re.bigint,received:o.parsedType}),ht}let r;const i=new Fi;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),Oe(r,{code:de.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),Oe(r,{code:de.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),Oe(r,{code:de.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ht.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,i){return new mu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(t){return new mu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.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}}mu.create=e=>{var t;return new mu({checks:[],typeName:it.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...vt(e)})};class lg extends wt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Re.boolean){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.boolean,received:r.parsedType}),ht}return Wi(t.data)}}lg.create=e=>new lg({typeName:it.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...vt(e)});class Pc extends wt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Re.date){const o=this._getOrReturnCtx(t);return Oe(o,{code:de.invalid_type,expected:Re.date,received:o.parsedType}),ht}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Oe(o,{code:de.invalid_date}),ht}const r=new Fi;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Oe(i,{code:de.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),Oe(i,{code:de.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ht.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Pc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:et.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:et.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}}Pc.create=e=>new Pc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:it.ZodDate,...vt(e)});class Fv extends wt{_parse(t){if(this._getType(t)!==Re.symbol){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.symbol,received:r.parsedType}),ht}return Wi(t.data)}}Fv.create=e=>new Fv({typeName:it.ZodSymbol,...vt(e)});class ug extends wt{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.undefined,received:r.parsedType}),ht}return Wi(t.data)}}ug.create=e=>new ug({typeName:it.ZodUndefined,...vt(e)});class cg extends wt{_parse(t){if(this._getType(t)!==Re.null){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.null,received:r.parsedType}),ht}return Wi(t.data)}}cg.create=e=>new cg({typeName:it.ZodNull,...vt(e)});class Nf extends wt{constructor(){super(...arguments),this._any=!0}_parse(t){return Wi(t.data)}}Nf.create=e=>new Nf({typeName:it.ZodAny,...vt(e)});class vc extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Wi(t.data)}}vc.create=e=>new vc({typeName:it.ZodUnknown,...vt(e)});class al extends wt{_parse(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:de.invalid_type,expected:Re.never,received:n.parsedType}),ht}}al.create=e=>new al({typeName:it.ZodNever,...vt(e)});class Bv extends wt{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.void,received:r.parsedType}),ht}return Wi(t.data)}}Bv.create=e=>new Bv({typeName:it.ZodVoid,...vt(e)});class Os extends wt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Re.array)return Oe(n,{code:de.invalid_type,expected:Re.array,received:n.parsedType}),ht;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Oe(n,{code:s?de.too_big:de.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&&(Oe(n,{code:de.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&&(Oe(n,{code:de.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 ma(n,s,n.path,a)))).then(s=>Fi.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new ma(n,s,n.path,a)));return Fi.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Os({...this._def,minLength:{value:t,message:et.toString(n)}})}max(t,n){return new Os({...this._def,maxLength:{value:t,message:et.toString(n)}})}length(t,n){return new Os({...this._def,exactLength:{value:t,message:et.toString(n)}})}nonempty(t){return this.min(1,t)}}Os.create=(e,t)=>new Os({type:e,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...vt(t)});function Ad(e){if(e instanceof Jn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Qa.create(Ad(r))}return new Jn({...e._def,shape:()=>t})}else return e instanceof Os?new Os({...e._def,type:Ad(e.element)}):e instanceof Qa?Qa.create(Ad(e.unwrap())):e instanceof Ic?Ic.create(Ad(e.unwrap())):e instanceof ya?ya.create(e.items.map(t=>Ad(t))):e}class Jn extends wt{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=Ht.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Re.object){const u=this._getOrReturnCtx(t);return Oe(u,{code:de.invalid_type,expected:Re.object,received:u.parsedType}),ht}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof al&&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 ma(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof al){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&&(Oe(i,{code:de.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 ma(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=>Fi.mergeObjectSync(r,u)):Fi.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return et.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=et.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:it.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Jn({...this._def,catchall:t})}pick(t){const n={};return Ht.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 Ht.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Jn({...this._def,shape:()=>n})}deepPartial(){return Ad(this)}partial(t){const n={};return Ht.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 Ht.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Qa;)o=o._def.innerType;n[r]=o}}),new Jn({...this._def,shape:()=>n})}keyof(){return vD(Ht.objectKeys(this.shape))}}Jn.create=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strip",catchall:al.create(),typeName:it.ZodObject,...vt(t)});Jn.strictCreate=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strict",catchall:al.create(),typeName:it.ZodObject,...vt(t)});Jn.lazycreate=(e,t)=>new Jn({shape:e,unknownKeys:"strip",catchall:al.create(),typeName:it.ZodObject,...vt(t)});class dg extends wt{_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 Is(a.ctx.common.issues));return Oe(n,{code:de.invalid_union,unionErrors:s}),ht}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 Is(l));return Oe(n,{code:de.invalid_union,unionErrors:a}),ht}}get options(){return this._def.options}}dg.create=(e,t)=>new dg({options:e,typeName:it.ZodUnion,...vt(t)});const I0=e=>e instanceof pg?I0(e.schema):e instanceof Ls?I0(e.innerType()):e instanceof gg?[e.value]:e instanceof yu?e.options:e instanceof mg?Object.keys(e.enum):e instanceof yg?I0(e._def.innerType):e instanceof ug?[void 0]:e instanceof cg?[null]:null;class N_ extends wt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.object)return Oe(n,{code:de.invalid_type,expected:Re.object,received:n.parsedType}),ht;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}):(Oe(n,{code:de.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ht)}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=I0(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 N_({typeName:it.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...vt(r)})}}function SC(e,t){const n=$l(e),r=$l(t);if(e===t)return{valid:!0,data:e};if(n===Re.object&&r===Re.object){const i=Ht.objectKeys(t),o=Ht.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=SC(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Re.array&&r===Re.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=SC(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Re.date&&r===Re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fg extends wt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(_C(o)||_C(s))return ht;const a=SC(o.value,s.value);return a.valid?((bC(o)||bC(s))&&n.dirty(),{status:n.value,value:a.data}):(Oe(r,{code:de.invalid_intersection_types}),ht)};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:it.ZodIntersection,...vt(n)});class ya extends wt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.array)return Oe(r,{code:de.invalid_type,expected:Re.array,received:r.parsedType}),ht;if(r.data.length<this._def.items.length)return Oe(r,{code:de.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ht;!this._def.rest&&r.data.length>this._def.items.length&&(Oe(r,{code:de.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 ma(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Fi.mergeArray(n,s)):Fi.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ya({...this._def,rest:t})}}ya.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ya({items:e,typeName:it.ZodTuple,rest:null,...vt(t)})};class hg extends wt{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!==Re.object)return Oe(r,{code:de.invalid_type,expected:Re.object,received:r.parsedType}),ht;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new ma(r,a,r.path,a)),value:s._parse(new ma(r,r.data[a],r.path,a))});return r.common.async?Fi.mergeObjectAsync(n,i):Fi.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof wt?new hg({keyType:t,valueType:n,typeName:it.ZodRecord,...vt(r)}):new hg({keyType:Ts.create(),valueType:t,typeName:it.ZodRecord,...vt(n)})}}class zv extends wt{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!==Re.map)return Oe(r,{code:de.invalid_type,expected:Re.map,received:r.parsedType}),ht;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new ma(r,a,r.path,[u,"key"])),value:o._parse(new ma(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 ht;(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 ht;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}zv.create=(e,t,n)=>new zv({valueType:t,keyType:e,typeName:it.ZodMap,...vt(n)});class Rc extends wt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.set)return Oe(r,{code:de.invalid_type,expected:Re.set,received:r.parsedType}),ht;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Oe(r,{code:de.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&&(Oe(r,{code:de.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 ht;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 ma(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new Rc({...this._def,minSize:{value:t,message:et.toString(n)}})}max(t,n){return new Rc({...this._def,maxSize:{value:t,message:et.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Rc.create=(e,t)=>new Rc({valueType:e,minSize:null,maxSize:null,typeName:it.ZodSet,...vt(t)});class cf extends wt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.function)return Oe(n,{code:de.invalid_type,expected:Re.function,received:n.parsedType}),ht;function r(a,l){return Lv({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dv(),sg].filter(u=>!!u),issueData:{code:de.invalid_arguments,argumentsError:l}})}function i(a,l){return Lv({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dv(),sg].filter(u=>!!u),issueData:{code:de.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Df){const a=this;return Wi(async function(...l){const u=new Is([]),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 Wi(function(...l){const u=a._def.args.safeParse(l,o);if(!u.success)throw new Is([r(l,u.error)]);const c=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(c,o);if(!d.success)throw new Is([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new cf({...this._def,args:ya.create(t).rest(vc.create())})}returns(t){return new cf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new cf({args:t||ya.create([]).rest(vc.create()),returns:n||vc.create(),typeName:it.ZodFunction,...vt(r)})}}class pg extends wt{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:it.ZodLazy,...vt(t)});class gg extends wt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Oe(n,{received:n.data,code:de.invalid_literal,expected:this._def.value}),ht}return{status:"valid",value:t.data}}get value(){return this._def.value}}gg.create=(e,t)=>new gg({value:e,typeName:it.ZodLiteral,...vt(t)});function vD(e,t){return new yu({values:e,typeName:it.ZodEnum,...vt(t)})}class yu extends wt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{expected:Ht.joinValues(r),received:n.parsedType,code:de.invalid_type}),ht}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{received:n.data,code:de.invalid_enum_value,options:r}),ht}return Wi(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 yu.create(t)}exclude(t){return yu.create(this.options.filter(n=>!t.includes(n)))}}yu.create=vD;class mg extends wt{_parse(t){const n=Ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Re.string&&r.parsedType!==Re.number){const i=Ht.objectValues(n);return Oe(r,{expected:Ht.joinValues(i),received:r.parsedType,code:de.invalid_type}),ht}if(n.indexOf(t.data)===-1){const i=Ht.objectValues(n);return Oe(r,{received:r.data,code:de.invalid_enum_value,options:i}),ht}return Wi(t.data)}get enum(){return this._def.values}}mg.create=(e,t)=>new mg({values:e,typeName:it.ZodNativeEnum,...vt(t)});class Df extends wt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.promise&&n.common.async===!1)return Oe(n,{code:de.invalid_type,expected:Re.promise,received:n.parsedType}),ht;const r=n.parsedType===Re.promise?n.data:Promise.resolve(n.data);return Wi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Df.create=(e,t)=>new Df({type:e,typeName:it.ZodPromise,...vt(t)});class Ls extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===it.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=>{Oe(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"?ht:(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"?ht:(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);Ht.assertNever(i)}}Ls.create=(e,t,n)=>new Ls({schema:e,typeName:it.ZodEffects,effect:t,...vt(n)});Ls.createWithPreprocess=(e,t,n)=>new Ls({schema:t,effect:{type:"preprocess",transform:e},typeName:it.ZodEffects,...vt(n)});class Qa extends wt{_parse(t){return this._getType(t)===Re.undefined?Wi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Qa.create=(e,t)=>new Qa({innerType:e,typeName:it.ZodOptional,...vt(t)});class Ic extends wt{_parse(t){return this._getType(t)===Re.null?Wi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ic.create=(e,t)=>new Ic({innerType:e,typeName:it.ZodNullable,...vt(t)});class yg extends wt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Re.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:it.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...vt(t)});class jv extends wt{_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 $v(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Is(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Is(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}jv.create=(e,t)=>new jv({innerType:e,typeName:it.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...vt(t)});class Uv extends wt{_parse(t){if(this._getType(t)!==Re.nan){const r=this._getOrReturnCtx(t);return Oe(r,{code:de.invalid_type,expected:Re.nan,received:r.parsedType}),ht}return{status:"valid",value:t.data}}}Uv.create=e=>new Uv({typeName:it.ZodNaN,...vt(e)});const ene=Symbol("zod_brand");class _D extends wt{_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 wt{_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"?ht:o.status==="dirty"?(n.dirty(),yD(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"?ht: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:it.ZodPipeline})}}class Vv extends wt{_parse(t){const n=this._def.innerType._parse(t);return ag(n)&&(n.value=Object.freeze(n.value)),n}}Vv.create=(e,t)=>new Vv({innerType:e,typeName:it.ZodReadonly,...vt(t)});const bD=(e,t={},n)=>e?Nf.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})}}):Nf.create(),tne={object:Jn.lazycreate};var it;(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"})(it||(it={}));const nne=(e,t={message:`Input not instance of ${e.name}`})=>bD(n=>n instanceof e,t),SD=Ts.create,wD=gu.create,rne=Uv.create,ine=mu.create,xD=lg.create,one=Pc.create,sne=Fv.create,ane=ug.create,lne=cg.create,une=Nf.create,cne=vc.create,dne=al.create,fne=Bv.create,hne=Os.create,pne=Jn.create,gne=Jn.strictCreate,mne=dg.create,yne=N_.create,vne=fg.create,_ne=ya.create,bne=hg.create,Sne=zv.create,wne=Rc.create,xne=cf.create,Cne=pg.create,Ene=gg.create,Tne=yu.create,Ane=mg.create,kne=Df.create,nP=Ls.create,Pne=Qa.create,Rne=Ic.create,Ine=Ls.createWithPreprocess,One=wm.create,Mne=()=>SD().optional(),Nne=()=>wD().optional(),Dne=()=>xD().optional(),Lne={string:e=>Ts.create({...e,coerce:!0}),number:e=>gu.create({...e,coerce:!0}),boolean:e=>lg.create({...e,coerce:!0}),bigint:e=>mu.create({...e,coerce:!0}),date:e=>Pc.create({...e,coerce:!0})},$ne=ht;var z=Object.freeze({__proto__:null,defaultErrorMap:sg,setErrorMap:jte,getErrorMap:Dv,makeIssue:Lv,EMPTY_PATH:Ute,addIssueToContext:Oe,ParseStatus:Fi,INVALID:ht,DIRTY:yD,OK:Wi,isAborted:_C,isDirty:bC,isValid:ag,isAsync:$v,get util(){return Ht},get objectUtil(){return vC},ZodParsedType:Re,getParsedType:$l,ZodType:wt,ZodString:Ts,ZodNumber:gu,ZodBigInt:mu,ZodBoolean:lg,ZodDate:Pc,ZodSymbol:Fv,ZodUndefined:ug,ZodNull:cg,ZodAny:Nf,ZodUnknown:vc,ZodNever:al,ZodVoid:Bv,ZodArray:Os,ZodObject:Jn,ZodUnion:dg,ZodDiscriminatedUnion:N_,ZodIntersection:fg,ZodTuple:ya,ZodRecord:hg,ZodMap:zv,ZodSet:Rc,ZodFunction:cf,ZodLazy:pg,ZodLiteral:gg,ZodEnum:yu,ZodNativeEnum:mg,ZodPromise:Df,ZodEffects:Ls,ZodTransformer:Ls,ZodOptional:Qa,ZodNullable:Ic,ZodDefault:yg,ZodCatch:jv,ZodNaN:Uv,BRAND:ene,ZodBranded:_D,ZodPipeline:wm,ZodReadonly:Vv,custom:bD,Schema:wt,ZodSchema:wt,late:tne,get ZodFirstPartyTypeKind(){return it},coerce:Lne,any:une,array:hne,bigint:ine,boolean:xD,date:one,discriminatedUnion:yne,effect:nP,enum:Tne,function:xne,instanceof:nne,intersection:vne,lazy:Cne,literal:Ene,map:Sne,nan:rne,nativeEnum:Ane,never:dne,null:lne,nullable:Rne,number:wD,object:pne,oboolean:Dne,onumber:Nne,optional:Pne,ostring:Mne,pipeline:One,preprocess:Ine,promise:kne,record:bne,set:wne,strictObject:gne,string:SD,symbol:sne,transformer:nP,tuple:_ne,undefined:ane,union:mne,unknown:cne,void:fne,NEVER:$ne,ZodIssueCode:de,quotelessJson:zte,ZodError:Is});const Fne=z.string(),h8e=e=>Fne.safeParse(e).success,Bne=z.string(),p8e=e=>Bne.safeParse(e).success,zne=z.string(),g8e=e=>zne.safeParse(e).success,jne=z.string(),m8e=e=>jne.safeParse(e).success,Une=z.number().int().min(1),y8e=e=>Une.safeParse(e).success,Vne=z.number().min(1),v8e=e=>Vne.safeParse(e).success,CD=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"]),_8e=e=>CD.safeParse(e).success,b8e={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(bp),S8e=e=>Gne.safeParse(e).success,qne=z.number().multipleOf(8).min(64),w8e=e=>qne.safeParse(e).success,Hne=z.number().multipleOf(8).min(64),x8e=e=>Hne.safeParse(e).success,Wc=z.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),D_=z.object({model_name:z.string().min(1),base_model:Wc,model_type:z.literal("main")}),C8e=e=>D_.safeParse(e).success,xT=z.object({model_name:z.string().min(1),base_model:z.literal("sdxl-refiner"),model_type:z.literal("main")}),E8e=e=>xT.safeParse(e).success,ED=z.object({model_name:z.string().min(1),base_model:Wc,model_type:z.literal("onnx")}),xm=z.union([D_,ED]),Wne=z.object({model_name:z.string().min(1),base_model:Wc}),Kne=z.object({model_name:z.string().min(1),base_model:Wc}),T8e=e=>Kne.safeParse(e).success,A8e=z.object({model_name:z.string().min(1),base_model:Wc}),k8e=z.object({model_name:z.string().min(1),base_model:Wc}),Qne=z.number().min(0).max(1),P8e=e=>Qne.safeParse(e).success;z.enum(["fp16","fp32"]);const Xne=z.number().min(1).max(10),R8e=e=>Xne.safeParse(e).success,Yne=z.number().min(1).max(10),I8e=e=>Yne.safeParse(e).success,Zne=z.number().min(0).max(1),O8e=e=>Zne.safeParse(e).success;z.enum(["box","gaussian"]);z.enum(["unmasked","mask","edge"]);const CT={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"unmasked",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,infillTileSize:32,infillPatchmatchDownscaleSize:1,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0,model:null,vae:null,vaePrecision:"fp32",seamlessXAxis:!1,seamlessYAxis:!1,clipSkip:0,shouldUseCpuNoise:!0,shouldShowAdvancedOptions:!1,aspectRatio:null,shouldLockAspectRatio:!1},Jne=CT,TD=Kn({name:"generation",initialState:Jne,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=Ul(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=Ul(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,...CT}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setMaskBlur:(e,t)=>{e.maskBlur=t.payload},setMaskBlurMethod:(e,t)=>{e.maskBlurMethod=t.payload},setCanvasCoherenceMode:(e,t)=>{e.canvasCoherenceMode=t.payload},setCanvasCoherenceSteps:(e,t)=>{e.canvasCoherenceSteps=t.payload},setCanvasCoherenceStrength:(e,t)=>{e.canvasCoherenceStrength=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setInfillTileSize:(e,t)=>{e.infillTileSize=t.payload},setInfillPatchmatchDownscaleSize:(e,t)=>{e.infillPatchmatchDownscaleSize=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=Fte[e.model.base_model];e.clipSkip=Ul(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},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(Lte,(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=D_.safeParse({model_name:a,base_model:o,model_type:s});l.success&&(t.model=l.data)}})}}),{clampSymmetrySteps:M8e,clearInitialImage:ET,resetParametersState:N8e,resetSeed:D8e,setCfgScale:L8e,setWidth:rP,setHeight:iP,toggleSize:$8e,setImg2imgStrength:F8e,setInfillMethod:ere,setIterations:B8e,setPerlin:z8e,setPositivePrompt:tre,setNegativePrompt:j8e,setScheduler:U8e,setMaskBlur:V8e,setMaskBlurMethod:G8e,setCanvasCoherenceMode:q8e,setCanvasCoherenceSteps:H8e,setCanvasCoherenceStrength:W8e,setSeed:K8e,setSeedWeights:Q8e,setShouldFitToWidthHeight:X8e,setShouldGenerateVariations:Y8e,setShouldRandomizeSeed:Z8e,setSteps:J8e,setThreshold:eRe,setInfillTileSize:tRe,setInfillPatchmatchDownscaleSize:nRe,setVariationAmount:rRe,setShouldUseSymmetry:iRe,setHorizontalSymmetrySteps:oRe,setVerticalSymmetrySteps:sRe,initialImageChanged:L_,modelChanged:Vl,vaeSelected:AD,setSeamlessXAxis:aRe,setSeamlessYAxis:lRe,setClipSkip:uRe,shouldUseCpuNoiseChanged:cRe,setAspectRatio:nre,setShouldLockAspectRatio:dRe,vaePrecisionChanged:fRe}=TD.actions,rre=TD.reducer;let ji=[],xa=(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=!ji.length;for(let s=0;s<n.length;s+=2)ji.push(n[s],r.value,i,n[s+1]);if(o){for(let s=0;s<ji.length;s+=4){let a=!1;for(let l=s+7;l<ji.length;l+=4)if(ji[l]<ji[s+3]){a=!0;break}a?ji.push(ji[s],ji[s+1],ji[s+2],ji[s+3]):ji[s](ji[s+1],ji[s+2])}ji.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 ire=5,Sy=6,wy=10;let ore=(e,t,n,r)=>(e.events=e.events||{},e.events[n+wy]||(e.events[n+wy]=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+wy](),delete e.events[n+wy])}),sre=1e3,are=(e,t)=>ore(e,r=>{let i=t(r);i&&e.events[Sy].push(i)},ire,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[Sy]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let s of e.events[Sy])s();e.events[Sy]=[]}},sre)},()=>{e.listen=i,e.off=o}}),lre=(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=xa(void 0,Math.max(...e.map(o=>o.l))+1);return are(i,()=>{let o=e.map(s=>s.listen(r,i.l));return r(),()=>{for(let s of o)s()}}),i};const kD="default",pr=xa(kD),ure={"Content-Type":"application/json"},cre=/\/*$/;function dre(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??fre,bodySerializer:h=r??hre,...p}=a||{},m=pre(s,{baseUrl:i.baseUrl,params:c,querySerializer:f}),b=gre(ure,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 v=await t(m,_);if(v.status===204||v.headers.get("Content-Length")==="0")return v.ok?{data:{},response:v}:{error:{},response:v};if(v.ok){let y=v.body;if(d!=="stream"){const S=v.clone();y=typeof S[d]=="function"?await S[d]():await S.text()}return{data:y,response:v}}let g={};try{g=await v.clone().json()}catch{g=await v.clone().text()}return{error:g,response:v}}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 fre(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 hre(e){return JSON.stringify(e)}function pre(e,t){let n=`${t.baseUrl?t.baseUrl.replace(cre,""):""}${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 gre(...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 Lf=xa(),vg=xa(),_g=xa(),$_=lre([Lf,vg,_g],(e,t,n)=>dre({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`})),F_=hu("api/sessionCreated",async(e,{rejectWithValue:t})=>{const{graph:n}=e,{POST:r}=$_.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/",{body:n,params:{query:{queue_id:pr.get()}}});return o?t({arg:e,status:s.status,error:o}):i}),mre=e=>$i(e)&&"status"in e,yre=e=>$i(e)&&"detail"in e,Cm=hu("api/sessionInvoked",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{PUT:r}=$_.get(),{error:i,response:o}=await r("/api/v1/sessions/{session_id}/invoke",{params:{query:{queue_id:pr.get(),all:!0},path:{session_id:n}}});if(i){if(mre(i)&&i.status===403)return t({arg:e,status:o.status,error:i.body.detail});if(yre(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})}}),Em=hu("api/sessionCanceled",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{DELETE:r}=$_.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});hu("api/listSessions",async(e,{rejectWithValue:t})=>{const{params:n}=e,{GET:r}=$_.get(),{data:i,error:o}=await r("/api/v1/sessions/",{params:n});return o?t({arg:e,error:o}):i});const PD=Xi(F_.rejected,Cm.rejected),xy=(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}},Cy=(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},hRe=.999,pRe=.1,gRe=20,Ey=.95,mRe=30,yRe=10,vre=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),fd=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},_re=e=>({width:Ss(e.width,64),height:Ss(e.height,64)}),vRe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],_Re=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],RD=e=>e.kind==="line"&&e.layer==="mask",bRe=e=>e.kind==="line"&&e.layer==="base",bre=e=>e.kind==="image"&&e.layer==="base",SRe=e=>e.kind==="fillRect"&&e.layer==="base",wRe=e=>e.kind==="eraseRect"&&e.layer==="base",Sre=e=>e.kind==="line",kd={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},ID={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:kd,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAntialias:!0,shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush",batchIds:[]},OD=Kn({name:"canvas",initialState:ID,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=>!RD(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:_y(Ul(r,64,512),64),height:_y(Ul(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=fd(s);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=s,e.boundingBoxCoordinates=a,e.pastLayerStates.push(Zn(e.layerState)),e.layerState={...kd,objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[];const l=Cy(o.width,o.height,r,i,Ey),u=xy(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=_re(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=fd(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=vre(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},canvasBatchIdAdded:(e,t)=>{e.batchIds.push(t.payload)},canvasBatchIdsReset:e=>{e.batchIds=[]},stagingAreaInitialized:(e,t)=>{const{boundingBox:n}=t.payload;e.layerState.stagingArea={boundingBox:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(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={...kd.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(Sre);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=kd,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(bre)){const o=Cy(i.width,i.height,512,512,Ey),s=xy(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=fd(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:Cy(i,o,l,u,Ey),d=xy(i,o,s,a,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=Cy(i,o,512,512,Ey),d=xy(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=fd(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=>{if(!e.layerState.stagingArea.images.length)return;const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Zn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea={...kd.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:_y(Ul(o,64,512),64),height:_y(Ul(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=fd(a);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=fd(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(Em.pending,t=>{t.layerState.stagingArea.images.length||(t.layerState.stagingArea=kd.stagingArea)}),e.addCase(nre,(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:xRe,addFillRect:CRe,addImageToStagingArea:wre,addLine:ERe,addPointToCurrentLine:TRe,clearCanvasHistory:ARe,clearMask:kRe,commitColorPickerColor:PRe,commitStagingAreaImage:xre,discardStagedImages:Cre,fitBoundingBoxToStage:RRe,mouseLeftCanvas:IRe,nextStagingAreaImage:ORe,prevStagingAreaImage:MRe,redo:NRe,resetCanvas:TT,resetCanvasInteractionState:DRe,resetCanvasView:LRe,setBoundingBoxCoordinates:$Re,setBoundingBoxDimensions:oP,setBoundingBoxPreviewFill:FRe,setBoundingBoxScaleMethod:BRe,flipBoundingBoxAxes:zRe,setBrushColor:jRe,setBrushSize:URe,setColorPickerColor:VRe,setCursorPosition:GRe,setInitialCanvasImage:MD,setIsDrawing:qRe,setIsMaskEnabled:HRe,setIsMouseOverBoundingBox:WRe,setIsMoveBoundingBoxKeyHeld:KRe,setIsMoveStageKeyHeld:QRe,setIsMovingBoundingBox:XRe,setIsMovingStage:YRe,setIsTransformingBoundingBox:ZRe,setLayer:JRe,setMaskColor:eIe,setMergedCanvas:Ere,setShouldAutoSave:tIe,setShouldCropToBoundingBoxOnSave:nIe,setShouldDarkenOutsideBoundingBox:rIe,setShouldLockBoundingBox:iIe,setShouldPreserveMaskedArea:oIe,setShouldShowBoundingBox:sIe,setShouldShowBrush:aIe,setShouldShowBrushPreview:lIe,setShouldShowCanvasDebugInfo:uIe,setShouldShowCheckboardTransparency:cIe,setShouldShowGrid:dIe,setShouldShowIntermediates:fIe,setShouldShowStagingImage:hIe,setShouldShowStagingOutline:pIe,setShouldSnapToGrid:gIe,setStageCoordinates:mIe,setStageScale:yIe,setTool:vIe,toggleShouldLockBoundingBox:_Ie,toggleTool:bIe,undo:SIe,setScaledBoundingBoxDimensions:wIe,setShouldRestrictStrokesToBox:xIe,stagingAreaInitialized:Tre,setShouldAntialias:CIe,canvasResized:EIe,canvasBatchIdAdded:Are,canvasBatchIdsReset:kre}=OD.actions,Pre=OD.reducer,Rre={isModalOpen:!1,imagesToChange:[]},ND=Kn({name:"changeBoardModal",initialState:Rre,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:TIe,imagesToChangeSelected:AIe,changeBoardReset:kIe}=ND.actions,Ire=ND.reducer;var DD={exports:{}},LD={};const bo=Y1(PW),Rh=Y1(OH),Ore=Y1(GH);(function(e){var t,n,r=ft&&ft.__generator||function(H,ee){var ne,ue,ie,Be,Ue={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return Be={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Be[Symbol.iterator]=function(){return this}),Be;function ot(Ne){return function(Ve){return function(Pe){if(ne)throw new TypeError("Generator is already executing.");for(;Ue;)try{if(ne=1,ue&&(ie=2&Pe[0]?ue.return:Pe[0]?ue.throw||((ie=ue.return)&&ie.call(ue),0):ue.next)&&!(ie=ie.call(ue,Pe[1])).done)return ie;switch(ue=0,ie&&(Pe=[2&Pe[0],ie.value]),Pe[0]){case 0:case 1:ie=Pe;break;case 4:return Ue.label++,{value:Pe[1],done:!1};case 5:Ue.label++,ue=Pe[1],Pe=[0];continue;case 7:Pe=Ue.ops.pop(),Ue.trys.pop();continue;default:if(!((ie=(ie=Ue.trys).length>0&&ie[ie.length-1])||Pe[0]!==6&&Pe[0]!==2)){Ue=0;continue}if(Pe[0]===3&&(!ie||Pe[1]>ie[0]&&Pe[1]<ie[3])){Ue.label=Pe[1];break}if(Pe[0]===6&&Ue.label<ie[1]){Ue.label=ie[1],ie=Pe;break}if(ie&&Ue.label<ie[2]){Ue.label=ie[2],Ue.ops.push(Pe);break}ie[2]&&Ue.ops.pop(),Ue.trys.pop();continue}Pe=ee.call(H,Ue)}catch(re){Pe=[6,re],ue=0}finally{ne=ie=0}if(5&Pe[0])throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}([Ne,Ve])}}},i=ft&&ft.__spreadArray||function(H,ee){for(var ne=0,ue=ee.length,ie=H.length;ne<ue;ne++,ie++)H[ie]=ee[ne];return H},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(H,ee,ne){return ee in H?s(H,ee,{enumerable:!0,configurable:!0,writable:!0,value:ne}):H[ee]=ne},b=function(H,ee){for(var ne in ee||(ee={}))h.call(ee,ne)&&m(H,ne,ee[ne]);if(d)for(var ue=0,ie=d(ee);ue<ie.length;ue++)p.call(ee,ne=ie[ue])&&m(H,ne,ee[ne]);return H},_=function(H,ee){return a(H,u(ee))},v=function(H){return s(H,"__esModule",{value:!0})},g=function(H,ee){var ne={};for(var ue in H)h.call(H,ue)&&ee.indexOf(ue)<0&&(ne[ue]=H[ue]);if(H!=null&&d)for(var ie=0,Be=d(H);ie<Be.length;ie++)ee.indexOf(ue=Be[ie])<0&&p.call(H,ue)&&(ne[ue]=H[ue]);return ne},y=function(H){return function(ee,ne,ue){if(ne&&typeof ne=="object"||typeof ne=="function")for(var ie=function(ot){h.call(ee,ot)||ot==="default"||s(ee,ot,{get:function(){return ne[ot]},enumerable:!(ue=l(ne,ot))||ue.enumerable})},Be=0,Ue=c(ne);Be<Ue.length;Be++)ie(Ue[Be]);return ee}(v(s(H!=null?o(f(H)):{},"default",H&&H.__esModule&&"default"in H?{get:function(){return H.default},enumerable:!0}:{value:H,enumerable:!0})),H)},S=function(H,ee,ne){return new Promise(function(ue,ie){var Be=function(Ne){try{ot(ne.next(Ne))}catch(Ve){ie(Ve)}},Ue=function(Ne){try{ot(ne.throw(Ne))}catch(Ve){ie(Ve)}},ot=function(Ne){return Ne.done?ue(Ne.value):Promise.resolve(Ne.value).then(Be,Ue)};ot((ne=ne.apply(H,ee)).next())})};v(e),function(H,ee){for(var ne in ee)s(H,ne,{get:ee[ne],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return eo},copyWithStructuralSharing:function(){return C},coreModule:function(){return Hr},createApi:function(){return Pa},defaultSerializeQueryArgs:function(){return Bi},fakeBaseQuery:function(){return Aa},fetchBaseQuery:function(){return E},retry:function(){return O},setupListeners:function(){return Z},skipSelector:function(){return Ir},skipToken:function(){return or}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var w=function(H){return[].concat.apply([],H)},x=y(bo).isPlainObject;function C(H,ee){if(H===ee||!(x(H)&&x(ee)||Array.isArray(H)&&Array.isArray(ee)))return ee;for(var ne=Object.keys(ee),ue=Object.keys(H),ie=ne.length===ue.length,Be=Array.isArray(ee)?[]:{},Ue=0,ot=ne;Ue<ot.length;Ue++){var Ne=ot[Ue];Be[Ne]=C(H[Ne],ee[Ne]),ie&&(ie=H[Ne]===Be[Ne])}return ie?H:Be}var A=y(bo),T=function(){for(var H=[],ee=0;ee<arguments.length;ee++)H[ee]=arguments[ee];return fetch.apply(void 0,H)},P=function(H){return H.status>=200&&H.status<=299},L=function(H){return/ion\/(vnd\.api\+)?json/.test(H.get("content-type")||"")};function R(H){if(!(0,A.isPlainObject)(H))return H;for(var ee=b({},H),ne=0,ue=Object.entries(ee);ne<ue.length;ne++){var ie=ue[ne];ie[1]===void 0&&delete ee[ie[0]]}return ee}function E(H){var ee=this;H===void 0&&(H={});var ne=H.baseUrl,ue=H.prepareHeaders,ie=ue===void 0?function(bt){return bt}:ue,Be=H.fetchFn,Ue=Be===void 0?T:Be,ot=H.paramsSerializer,Ne=H.isJsonContentType,Ve=Ne===void 0?L:Ne,Pe=H.jsonContentType,re=Pe===void 0?"application/json":Pe,ve=H.jsonReplacer,Qe=H.timeout,Xe=H.responseHandler,st=H.validateStatus,at=g(H,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&Ue===T&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(bt,xt){return S(ee,null,function(){var on,sn,Ci,_o,Ei,fr,ai,Un,no,ps,tt,an,Zt,Xn,hr,li,pn,Pt,Vt,gn,Jt,un,_e,Ye,ze,Te,Ge,lt,je,be,ae,xe,ce,he,Se,Ze;return r(this,function(We){switch(We.label){case 0:return on=xt.signal,sn=xt.getState,Ci=xt.extra,_o=xt.endpoint,Ei=xt.forced,fr=xt.type,no=(Un=typeof bt=="string"?{url:bt}:bt).url,tt=(ps=Un.headers)===void 0?new Headers(at.headers):ps,Zt=(an=Un.params)===void 0?void 0:an,hr=(Xn=Un.responseHandler)===void 0?Xe??"json":Xn,pn=(li=Un.validateStatus)===void 0?st??P:li,Vt=(Pt=Un.timeout)===void 0?Qe:Pt,gn=g(Un,["url","headers","params","responseHandler","validateStatus","timeout"]),Jt=b(_(b({},at),{signal:on}),gn),tt=new Headers(R(tt)),un=Jt,[4,ie(tt,{getState:sn,extra:Ci,endpoint:_o,forced:Ei,type:fr})];case 1:un.headers=We.sent()||tt,_e=function(Ae){return typeof Ae=="object"&&((0,A.isPlainObject)(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function")},!Jt.headers.has("content-type")&&_e(Jt.body)&&Jt.headers.set("content-type",re),_e(Jt.body)&&Ve(Jt.headers)&&(Jt.body=JSON.stringify(Jt.body,ve)),Zt&&(Ye=~no.indexOf("?")?"&":"?",ze=ot?ot(Zt):new URLSearchParams(R(Zt)),no+=Ye+ze),no=function(Ae,Ct){if(!Ae)return Ct;if(!Ct)return Ae;if(function(jt){return new RegExp("(^|:)//").test(jt)}(Ct))return Ct;var Bt=Ae.endsWith("/")||!Ct.startsWith("?")?"/":"";return Ae=function(jt){return jt.replace(/\/$/,"")}(Ae),""+Ae+Bt+function(jt){return jt.replace(/^\//,"")}(Ct)}(ne,no),Te=new Request(no,Jt),Ge=Te.clone(),ai={request:Ge},je=!1,be=Vt&&setTimeout(function(){je=!0,xt.abort()},Vt),We.label=2;case 2:return We.trys.push([2,4,5,6]),[4,Ue(Te)];case 3:return lt=We.sent(),[3,6];case 4:return ae=We.sent(),[2,{error:{status:je?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ae)},meta:ai}];case 5:return be&&clearTimeout(be),[7];case 6:xe=lt.clone(),ai.response=xe,he="",We.label=7;case 7:return We.trys.push([7,9,,10]),[4,Promise.all([mt(lt,hr).then(function(Ae){return ce=Ae},function(Ae){return Se=Ae}),xe.text().then(function(Ae){return he=Ae},function(){})])];case 8:if(We.sent(),Se)throw Se;return[3,10];case 9:return Ze=We.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:lt.status,data:he,error:String(Ze)},meta:ai}];case 10:return[2,pn(lt,ce)?{data:ce,meta:ai}:{error:{status:lt.status,data:ce},meta:ai}]}})})};function mt(bt,xt){return S(this,null,function(){var on;return r(this,function(sn){switch(sn.label){case 0:return typeof xt=="function"?[2,xt(bt)]:(xt==="content-type"&&(xt=Ve(bt.headers)?"json":"text"),xt!=="json"?[3,2]:[4,bt.text()]);case 1:return[2,(on=sn.sent()).length?JSON.parse(on):null];case 2:return[2,bt.text()]}})})}}var k=function(H,ee){ee===void 0&&(ee=void 0),this.value=H,this.meta=ee};function D(H,ee){return H===void 0&&(H=0),ee===void 0&&(ee=5),S(this,null,function(){var ne,ue;return r(this,function(ie){switch(ie.label){case 0:return ne=Math.min(H,ee),ue=~~((Math.random()+.4)*(300<<ne)),[4,new Promise(function(Be){return setTimeout(function(Ue){return Be(Ue)},ue)})];case 1:return ie.sent(),[2]}})})}var $={},O=Object.assign(function(H,ee){return function(ne,ue,ie){return S(void 0,null,function(){var Be,Ue,ot,Ne,Ve,Pe,re;return r(this,function(ve){switch(ve.label){case 0:Be=[5,(ee||$).maxRetries,(ie||$).maxRetries].filter(function(Qe){return Qe!==void 0}),Ue=Be.slice(-1)[0],ot=function(Qe,Xe,st){return st.attempt<=Ue},Ne=b(b({maxRetries:Ue,backoff:D,retryCondition:ot},ee),ie),Ve=0,ve.label=1;case 1:ve.label=2;case 2:return ve.trys.push([2,4,,6]),[4,H(ne,ue,ie)];case 3:if((Pe=ve.sent()).error)throw new k(Pe);return[2,Pe];case 4:if(re=ve.sent(),Ve++,re.throwImmediately){if(re instanceof k)return[2,re.value];throw re}return re instanceof k&&!Ne.retryCondition(re.value.error,ne,{attempt:Ve,baseQueryApi:ue,extraOptions:ie})?[2,re.value]:[4,Ne.backoff(Ve,Ne.maxRetries)];case 5:return ve.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(H){throw Object.assign(new k({error:H}),{throwImmediately:!0})}}),I=y(bo),N=(0,I.createAction)("__rtkq/focused"),B=(0,I.createAction)("__rtkq/unfocused"),U=(0,I.createAction)("__rtkq/online"),G=(0,I.createAction)("__rtkq/offline"),Q=!1;function Z(H,ee){return ee?ee(H,{onFocus:N,onFocusLost:B,onOffline:G,onOnline:U}):(ne=function(){return H(N())},ue=function(){return H(U())},ie=function(){return H(G())},Be=function(){window.document.visibilityState==="visible"?ne():H(B())},Q||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",Be,!1),window.addEventListener("focus",ne,!1),window.addEventListener("online",ue,!1),window.addEventListener("offline",ie,!1),Q=!0),function(){window.removeEventListener("focus",ne),window.removeEventListener("visibilitychange",Be),window.removeEventListener("online",ue),window.removeEventListener("offline",ie),Q=!1});var ne,ue,ie,Be}var Y,j,W=y(bo);function te(H){return H.type===Y.query}function oe(H,ee,ne,ue,ie,Be){return typeof H=="function"?H(ee,ne,ue,ie).map(ye).map(Be):Array.isArray(H)?H.map(ye).map(Be):[]}function ye(H){return typeof H=="string"?{type:H}:H}(j=Y||(Y={})).query="query",j.mutation="mutation";var le=y(bo);function pt(H){return H!=null}var nt=Symbol("forceQueryFn"),Fe=function(H){return typeof H[nt]=="function"},ct=y(bo),ke=y(Rh),Qt=y(bo);function br(H){return H}function kn(H,ee,ne,ue){return oe(ne[H.meta.arg.endpointName][ee],(0,ct.isFulfilled)(H)?H.payload:void 0,(0,ct.isRejectedWithValue)(H)?H.payload:void 0,H.meta.arg.originalArgs,"baseQueryMeta"in H.meta?H.meta.baseQueryMeta:void 0,ue)}var bn=y(Rh),Xt=y(Rh);function Pn(H,ee,ne){var ue=H[ee];ue&&ne(ue)}function Sr(H){var ee;return(ee="arg"in H?H.arg.fixedCacheKey:H.fixedCacheKey)!=null?ee:H.requestId}function Ji(H,ee,ne){var ue=H[Sr(ee)];ue&&ne(ue)}var Vr={},or=Symbol.for("RTKQ/skipToken"),Ir=or,Gr={status:t.uninitialized},Rn=(0,W.createNextState)(Gr,function(){}),hn=(0,W.createNextState)(Gr,function(){}),wi=y(bo),ii=WeakMap?new WeakMap:void 0,Bi=function(H){var ee=H.endpointName,ne=H.queryArgs,ue="",ie=ii==null?void 0:ii.get(ne);if(typeof ie=="string")ue=ie;else{var Be=JSON.stringify(ne,function(Ue,ot){return(0,wi.isPlainObject)(ot)?Object.keys(ot).sort().reduce(function(Ne,Ve){return Ne[Ve]=ot[Ve],Ne},{}):ot});(0,wi.isPlainObject)(ne)&&(ii==null||ii.set(ne,Be)),ue=Be}return ee+"("+ue+")"},fs=y(bo),wr=y(Ore);function eo(){for(var H=[],ee=0;ee<arguments.length;ee++)H[ee]=arguments[ee];return function(ne){var ue=(0,wr.defaultMemoize)(function(Ne){var Ve,Pe;return(Pe=ne.extractRehydrationInfo)==null?void 0:Pe.call(ne,Ne,{reducerPath:(Ve=ne.reducerPath)!=null?Ve:"api"})}),ie=_(b({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},ne),{extractRehydrationInfo:ue,serializeQueryArgs:function(Ne){var Ve=Bi;if("serializeQueryArgs"in Ne.endpointDefinition){var Pe=Ne.endpointDefinition.serializeQueryArgs;Ve=function(re){var ve=Pe(re);return typeof ve=="string"?ve:Bi(_(b({},re),{queryArgs:ve}))}}else ne.serializeQueryArgs&&(Ve=ne.serializeQueryArgs);return Ve(Ne)},tagTypes:i([],ne.tagTypes||[])}),Be={endpointDefinitions:{},batch:function(Ne){Ne()},apiUid:(0,fs.nanoid)(),extractRehydrationInfo:ue,hasRehydrationInfo:(0,wr.defaultMemoize)(function(Ne){return ue(Ne)!=null})},Ue={injectEndpoints:function(Ne){for(var Ve=Ne.endpoints({query:function(mt){return _(b({},mt),{type:Y.query})},mutation:function(mt){return _(b({},mt),{type:Y.mutation})}}),Pe=0,re=Object.entries(Ve);Pe<re.length;Pe++){var ve=re[Pe],Qe=ve[0],Xe=ve[1];if(Ne.overrideExisting||!(Qe in Be.endpointDefinitions)){Be.endpointDefinitions[Qe]=Xe;for(var st=0,at=ot;st<at.length;st++)at[st].injectEndpoint(Qe,Xe)}}return Ue},enhanceEndpoints:function(Ne){var Ve=Ne.addTagTypes,Pe=Ne.endpoints;if(Ve)for(var re=0,ve=Ve;re<ve.length;re++){var Qe=ve[re];ie.tagTypes.includes(Qe)||ie.tagTypes.push(Qe)}if(Pe)for(var Xe=0,st=Object.entries(Pe);Xe<st.length;Xe++){var at=st[Xe],mt=at[0],bt=at[1];typeof bt=="function"?bt(Be.endpointDefinitions[mt]):Object.assign(Be.endpointDefinitions[mt]||{},bt)}return Ue}},ot=H.map(function(Ne){return Ne.init(Ue,ie,Be)});return Ue.injectEndpoints({endpoints:ne.endpoints})}}function Aa(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var vo,ka=y(bo),In=function(H){var ee=H.reducerPath,ne=H.api,ue=H.context,ie=H.internalState,Be=ne.internalActions,Ue=Be.removeQueryResult,ot=Be.unsubscribeQueryResult;function Ne(re){var ve=ie.currentSubscriptions[re];return!!ve&&!function(Qe){for(var Xe in Qe)return!1;return!0}(ve)}var Ve={};function Pe(re,ve,Qe,Xe){var st,at=ue.endpointDefinitions[ve],mt=(st=at==null?void 0:at.keepUnusedDataFor)!=null?st:Xe.keepUnusedDataFor;if(mt!==1/0){var bt=Math.max(0,Math.min(mt,2147482647e-3));if(!Ne(re)){var xt=Ve[re];xt&&clearTimeout(xt),Ve[re]=setTimeout(function(){Ne(re)||Qe.dispatch(Ue({queryCacheKey:re})),delete Ve[re]},1e3*bt)}}}return function(re,ve,Qe){var Xe;if(ot.match(re)){var st=ve.getState()[ee];Pe(Ei=re.payload.queryCacheKey,(Xe=st.queries[Ei])==null?void 0:Xe.endpointName,ve,st.config)}if(ne.util.resetApiState.match(re))for(var at=0,mt=Object.entries(Ve);at<mt.length;at++){var bt=mt[at],xt=bt[0],on=bt[1];on&&clearTimeout(on),delete Ve[xt]}if(ue.hasRehydrationInfo(re)){st=ve.getState()[ee];for(var sn=ue.extractRehydrationInfo(re).queries,Ci=0,_o=Object.entries(sn);Ci<_o.length;Ci++){var Ei,fr=_o[Ci],ai=fr[1];Pe(Ei=fr[0],ai==null?void 0:ai.endpointName,ve,st.config)}}}},Yt=y(bo),Or=function(H){var ee=H.reducerPath,ne=H.context,ue=H.context.endpointDefinitions,ie=H.mutationThunk,Be=H.api,Ue=H.assertTagType,ot=H.refetchQuery,Ne=Be.internalActions.removeQueryResult,Ve=(0,Yt.isAnyOf)((0,Yt.isFulfilled)(ie),(0,Yt.isRejectedWithValue)(ie));function Pe(re,ve){var Qe=ve.getState(),Xe=Qe[ee],st=Be.util.selectInvalidatedBy(Qe,re);ne.batch(function(){for(var at,mt=0,bt=Array.from(st.values());mt<bt.length;mt++){var xt=bt[mt].queryCacheKey,on=Xe.queries[xt],sn=(at=Xe.subscriptions[xt])!=null?at:{};on&&(Object.keys(sn).length===0?ve.dispatch(Ne({queryCacheKey:xt})):on.status!==t.uninitialized&&ve.dispatch(ot(on,xt)))}})}return function(re,ve){Ve(re)&&Pe(kn(re,"invalidatesTags",ue,Ue),ve),Be.util.invalidateTags.match(re)&&Pe(oe(re.payload,void 0,void 0,void 0,void 0,Ue),ve)}},xr=function(H){var ee=H.reducerPath,ne=H.queryThunk,ue=H.api,ie=H.refetchQuery,Be=H.internalState,Ue={};function ot(re,ve){var Qe=re.queryCacheKey,Xe=ve.getState()[ee].queries[Qe];if(Xe&&Xe.status!==t.uninitialized){var st=Pe(Be.currentSubscriptions[Qe]);if(Number.isFinite(st)){var at=Ue[Qe];at!=null&&at.timeout&&(clearTimeout(at.timeout),at.timeout=void 0);var mt=Date.now()+st,bt=Ue[Qe]={nextPollTimestamp:mt,pollingInterval:st,timeout:setTimeout(function(){bt.timeout=void 0,ve.dispatch(ie(Xe,Qe))},st)}}}}function Ne(re,ve){var Qe=re.queryCacheKey,Xe=ve.getState()[ee].queries[Qe];if(Xe&&Xe.status!==t.uninitialized){var st=Pe(Be.currentSubscriptions[Qe]);if(Number.isFinite(st)){var at=Ue[Qe],mt=Date.now()+st;(!at||mt<at.nextPollTimestamp)&&ot({queryCacheKey:Qe},ve)}else Ve(Qe)}}function Ve(re){var ve=Ue[re];ve!=null&&ve.timeout&&clearTimeout(ve.timeout),delete Ue[re]}function Pe(re){re===void 0&&(re={});var ve=Number.POSITIVE_INFINITY;for(var Qe in re)re[Qe].pollingInterval&&(ve=Math.min(re[Qe].pollingInterval,ve));return ve}return function(re,ve){(ue.internalActions.updateSubscriptionOptions.match(re)||ue.internalActions.unsubscribeQueryResult.match(re))&&Ne(re.payload,ve),(ne.pending.match(re)||ne.rejected.match(re)&&re.meta.condition)&&Ne(re.meta.arg,ve),(ne.fulfilled.match(re)||ne.rejected.match(re)&&!re.meta.condition)&&ot(re.meta.arg,ve),ue.util.resetApiState.match(re)&&function(){for(var Qe=0,Xe=Object.keys(Ue);Qe<Xe.length;Qe++)Ve(Xe[Qe])}()}},Cr=y(bo),qr=new Error("Promise never resolved before cacheEntryRemoved."),xi=function(H){var ee=H.api,ne=H.reducerPath,ue=H.context,ie=H.queryThunk,Be=H.mutationThunk,Ue=(0,Cr.isAsyncThunkAction)(ie),ot=(0,Cr.isAsyncThunkAction)(Be),Ne=(0,Cr.isFulfilled)(ie,Be),Ve={};function Pe(re,ve,Qe,Xe,st){var at=ue.endpointDefinitions[re],mt=at==null?void 0:at.onCacheEntryAdded;if(mt){var bt={},xt=new Promise(function(fr){bt.cacheEntryRemoved=fr}),on=Promise.race([new Promise(function(fr){bt.valueResolved=fr}),xt.then(function(){throw qr})]);on.catch(function(){}),Ve[Qe]=bt;var sn=ee.endpoints[re].select(at.type===Y.query?ve:Qe),Ci=Xe.dispatch(function(fr,ai,Un){return Un}),_o=_(b({},Xe),{getCacheEntry:function(){return sn(Xe.getState())},requestId:st,extra:Ci,updateCachedData:at.type===Y.query?function(fr){return Xe.dispatch(ee.util.updateQueryData(re,ve,fr))}:void 0,cacheDataLoaded:on,cacheEntryRemoved:xt}),Ei=mt(ve,_o);Promise.resolve(Ei).catch(function(fr){if(fr!==qr)throw fr})}}return function(re,ve,Qe){var Xe=function(sn){return Ue(sn)?sn.meta.arg.queryCacheKey:ot(sn)?sn.meta.requestId:ee.internalActions.removeQueryResult.match(sn)?sn.payload.queryCacheKey:ee.internalActions.removeMutationResult.match(sn)?Sr(sn.payload):""}(re);if(ie.pending.match(re)){var st=Qe[ne].queries[Xe],at=ve.getState()[ne].queries[Xe];!st&&at&&Pe(re.meta.arg.endpointName,re.meta.arg.originalArgs,Xe,ve,re.meta.requestId)}else if(Be.pending.match(re))(at=ve.getState()[ne].mutations[Xe])&&Pe(re.meta.arg.endpointName,re.meta.arg.originalArgs,Xe,ve,re.meta.requestId);else if(Ne(re))(on=Ve[Xe])!=null&&on.valueResolved&&(on.valueResolved({data:re.payload,meta:re.meta.baseQueryMeta}),delete on.valueResolved);else if(ee.internalActions.removeQueryResult.match(re)||ee.internalActions.removeMutationResult.match(re))(on=Ve[Xe])&&(delete Ve[Xe],on.cacheEntryRemoved());else if(ee.util.resetApiState.match(re))for(var mt=0,bt=Object.entries(Ve);mt<bt.length;mt++){var xt=bt[mt],on=xt[1];delete Ve[xt[0]],on.cacheEntryRemoved()}}},to=y(bo),oi=function(H){var ee=H.api,ne=H.context,ue=H.queryThunk,ie=H.mutationThunk,Be=(0,to.isPending)(ue,ie),Ue=(0,to.isRejected)(ue,ie),ot=(0,to.isFulfilled)(ue,ie),Ne={};return function(Ve,Pe){var re,ve,Qe;if(Be(Ve)){var Xe=Ve.meta,st=Xe.requestId,at=Xe.arg,mt=at.endpointName,bt=at.originalArgs,xt=ne.endpointDefinitions[mt],on=xt==null?void 0:xt.onQueryStarted;if(on){var sn={},Ci=new Promise(function(ps,tt){sn.resolve=ps,sn.reject=tt});Ci.catch(function(){}),Ne[st]=sn;var _o=ee.endpoints[mt].select(xt.type===Y.query?bt:st),Ei=Pe.dispatch(function(ps,tt,an){return an}),fr=_(b({},Pe),{getCacheEntry:function(){return _o(Pe.getState())},requestId:st,extra:Ei,updateCachedData:xt.type===Y.query?function(ps){return Pe.dispatch(ee.util.updateQueryData(mt,bt,ps))}:void 0,queryFulfilled:Ci});on(bt,fr)}}else if(ot(Ve)){var ai=Ve.meta,Un=ai.baseQueryMeta;(re=Ne[st=ai.requestId])==null||re.resolve({data:Ve.payload,meta:Un}),delete Ne[st]}else if(Ue(Ve)){var no=Ve.meta;Un=no.baseQueryMeta,(Qe=Ne[st=no.requestId])==null||Qe.reject({error:(ve=Ve.payload)!=null?ve:Ve.error,isUnhandledError:!no.rejectedWithValue,meta:Un}),delete Ne[st]}}},Mr=function(H){var ee=H.api,ne=H.context.apiUid;return function(ue,ie){ee.util.resetApiState.match(ue)&&ie.dispatch(ee.internalActions.middlewareRegistered(ne))}},hs=y(Rh),Us=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof ft<"u"?ft:globalThis):function(H){return(vo||(vo=Promise.resolve())).then(H).catch(function(ee){return setTimeout(function(){throw ee},0)})};function si(H){for(var ee=[],ne=1;ne<arguments.length;ne++)ee[ne-1]=arguments[ne];Object.assign.apply(Object,i([H],ee))}var vl=y(Rh),Bo=Symbol(),Hr=function(){return{name:Bo,init:function(H,ee,ne){var ue=ee.baseQuery,ie=ee.reducerPath,Be=ee.serializeQueryArgs,Ue=ee.keepUnusedDataFor,ot=ee.refetchOnMountOrArgChange,Ne=ee.refetchOnFocus,Ve=ee.refetchOnReconnect;(0,vl.enablePatches)();var Pe=function(tt){return tt};Object.assign(H,{reducerPath:ie,endpoints:{},internalActions:{onOnline:U,onOffline:G,onFocus:N,onFocusLost:B},util:{}});var re=function(tt){var an=this,Zt=tt.reducerPath,Xn=tt.baseQuery,hr=tt.context.endpointDefinitions,li=tt.serializeQueryArgs,pn=tt.api,Pt=function(_e,Ye){return S(an,[_e,Ye],function(ze,Te){var Ge,lt,je,be,ae,xe,ce,he,Se,Ze,We,Ae,Ct,Bt=Te.signal,jt=Te.abort,Yn=Te.rejectWithValue,sr=Te.fulfillWithValue,On=Te.dispatch,Sn=Te.getState,zi=Te.extra;return r(this,function(F){switch(F.label){case 0:Ge=hr[ze.endpointName],F.label=1;case 1:return F.trys.push([1,8,,13]),lt=br,je=void 0,be={signal:Bt,abort:jt,dispatch:On,getState:Sn,extra:zi,endpoint:ze.endpointName,type:ze.type,forced:ze.type==="query"?Vt(ze,Sn()):void 0},(ae=ze.type==="query"?ze[nt]:void 0)?(je=ae(),[3,6]):[3,2];case 2:return Ge.query?[4,Xn(Ge.query(ze.originalArgs),be,Ge.extraOptions)]:[3,4];case 3:return je=F.sent(),Ge.transformResponse&&(lt=Ge.transformResponse),[3,6];case 4:return[4,Ge.queryFn(ze.originalArgs,be,Ge.extraOptions,function(V){return Xn(V,be,Ge.extraOptions)})];case 5:je=F.sent(),F.label=6;case 6:if(je.error)throw new k(je.error,je.meta);return xe=sr,[4,lt(je.data,je.meta,ze.originalArgs)];case 7:return[2,xe.apply(void 0,[F.sent(),(Ae={fulfilledTimeStamp:Date.now(),baseQueryMeta:je.meta},Ae[Qt.SHOULD_AUTOBATCH]=!0,Ae)])];case 8:if(ce=F.sent(),!((he=ce)instanceof k))return[3,12];Se=br,Ge.query&&Ge.transformErrorResponse&&(Se=Ge.transformErrorResponse),F.label=9;case 9:return F.trys.push([9,11,,12]),Ze=Yn,[4,Se(he.value,he.meta,ze.originalArgs)];case 10:return[2,Ze.apply(void 0,[F.sent(),(Ct={baseQueryMeta:he.meta},Ct[Qt.SHOULD_AUTOBATCH]=!0,Ct)])];case 11:return We=F.sent(),he=We,[3,12];case 12:throw console.error(he),he;case 13:return[2]}})})};function Vt(_e,Ye){var ze,Te,Ge,lt,je=(Te=(ze=Ye[Zt])==null?void 0:ze.queries)==null?void 0:Te[_e.queryCacheKey],be=(Ge=Ye[Zt])==null?void 0:Ge.config.refetchOnMountOrArgChange,ae=je==null?void 0:je.fulfilledTimeStamp,xe=(lt=_e.forceRefetch)!=null?lt:_e.subscribe&&be;return!!xe&&(xe===!0||(Number(new Date)-Number(ae))/1e3>=xe)}var gn=(0,Qt.createAsyncThunk)(Zt+"/executeQuery",Pt,{getPendingMeta:function(){var _e;return(_e={startedTimeStamp:Date.now()})[Qt.SHOULD_AUTOBATCH]=!0,_e},condition:function(_e,Ye){var ze,Te,Ge,lt=(0,Ye.getState)(),je=(Te=(ze=lt[Zt])==null?void 0:ze.queries)==null?void 0:Te[_e.queryCacheKey],be=je==null?void 0:je.fulfilledTimeStamp,ae=_e.originalArgs,xe=je==null?void 0:je.originalArgs,ce=hr[_e.endpointName];return!(!Fe(_e)&&((je==null?void 0:je.status)==="pending"||!Vt(_e,lt)&&(!te(ce)||!((Ge=ce==null?void 0:ce.forceRefetch)!=null&&Ge.call(ce,{currentArg:ae,previousArg:xe,endpointState:je,state:lt})))&&be))},dispatchConditionRejection:!0}),Jt=(0,Qt.createAsyncThunk)(Zt+"/executeMutation",Pt,{getPendingMeta:function(){var _e;return(_e={startedTimeStamp:Date.now()})[Qt.SHOULD_AUTOBATCH]=!0,_e}});function un(_e){return function(Ye){var ze,Te;return((Te=(ze=Ye==null?void 0:Ye.meta)==null?void 0:ze.arg)==null?void 0:Te.endpointName)===_e}}return{queryThunk:gn,mutationThunk:Jt,prefetch:function(_e,Ye,ze){return function(Te,Ge){var lt=function(ce){return"force"in ce}(ze)&&ze.force,je=function(ce){return"ifOlderThan"in ce}(ze)&&ze.ifOlderThan,be=function(ce){return ce===void 0&&(ce=!0),pn.endpoints[_e].initiate(Ye,{forceRefetch:ce})},ae=pn.endpoints[_e].select(Ye)(Ge());if(lt)Te(be());else if(je){var xe=ae==null?void 0:ae.fulfilledTimeStamp;if(!xe)return void Te(be());(Number(new Date)-Number(new Date(xe)))/1e3>=je&&Te(be())}else Te(be(!1))}},updateQueryData:function(_e,Ye,ze){return function(Te,Ge){var lt,je,be=pn.endpoints[_e].select(Ye)(Ge()),ae={patches:[],inversePatches:[],undo:function(){return Te(pn.util.patchQueryData(_e,Ye,ae.inversePatches))}};if(be.status===t.uninitialized)return ae;if("data"in be)if((0,ke.isDraftable)(be.data)){var xe=(0,ke.produceWithPatches)(be.data,ze),ce=xe[2];(lt=ae.patches).push.apply(lt,xe[1]),(je=ae.inversePatches).push.apply(je,ce)}else{var he=ze(be.data);ae.patches.push({op:"replace",path:[],value:he}),ae.inversePatches.push({op:"replace",path:[],value:be.data})}return Te(pn.util.patchQueryData(_e,Ye,ae.patches)),ae}},upsertQueryData:function(_e,Ye,ze){return function(Te){var Ge;return Te(pn.endpoints[_e].initiate(Ye,((Ge={subscribe:!1,forceRefetch:!0})[nt]=function(){return{data:ze}},Ge)))}},patchQueryData:function(_e,Ye,ze){return function(Te){Te(pn.internalActions.queryResultPatched({queryCacheKey:li({queryArgs:Ye,endpointDefinition:hr[_e],endpointName:_e}),patches:ze}))}},buildMatchThunkActions:function(_e,Ye){return{matchPending:(0,ct.isAllOf)((0,ct.isPending)(_e),un(Ye)),matchFulfilled:(0,ct.isAllOf)((0,ct.isFulfilled)(_e),un(Ye)),matchRejected:(0,ct.isAllOf)((0,ct.isRejected)(_e),un(Ye))}}}}({baseQuery:ue,reducerPath:ie,context:ne,api:H,serializeQueryArgs:Be}),ve=re.queryThunk,Qe=re.mutationThunk,Xe=re.patchQueryData,st=re.updateQueryData,at=re.upsertQueryData,mt=re.prefetch,bt=re.buildMatchThunkActions,xt=function(tt){var an=tt.reducerPath,Zt=tt.queryThunk,Xn=tt.mutationThunk,hr=tt.context,li=hr.endpointDefinitions,pn=hr.apiUid,Pt=hr.extractRehydrationInfo,Vt=hr.hasRehydrationInfo,gn=tt.assertTagType,Jt=tt.config,un=(0,le.createAction)(an+"/resetApiState"),_e=(0,le.createSlice)({name:an+"/queries",initialState:Vr,reducers:{removeQueryResult:{reducer:function(be,ae){delete be[ae.payload.queryCacheKey]},prepare:(0,le.prepareAutoBatched)()},queryResultPatched:function(be,ae){var xe=ae.payload,ce=xe.patches;Pn(be,xe.queryCacheKey,function(he){he.data=(0,Xt.applyPatches)(he.data,ce.concat())})}},extraReducers:function(be){be.addCase(Zt.pending,function(ae,xe){var ce,he=xe.meta,Se=xe.meta.arg,Ze=Fe(Se);(Se.subscribe||Ze)&&(ae[ce=Se.queryCacheKey]!=null||(ae[ce]={status:t.uninitialized,endpointName:Se.endpointName})),Pn(ae,Se.queryCacheKey,function(We){We.status=t.pending,We.requestId=Ze&&We.requestId?We.requestId:he.requestId,Se.originalArgs!==void 0&&(We.originalArgs=Se.originalArgs),We.startedTimeStamp=he.startedTimeStamp})}).addCase(Zt.fulfilled,function(ae,xe){var ce=xe.meta,he=xe.payload;Pn(ae,ce.arg.queryCacheKey,function(Se){var Ze;if(Se.requestId===ce.requestId||Fe(ce.arg)){var We=li[ce.arg.endpointName].merge;if(Se.status=t.fulfilled,We)if(Se.data!==void 0){var Ae=ce.fulfilledTimeStamp,Ct=ce.arg,Bt=ce.baseQueryMeta,jt=ce.requestId,Yn=(0,le.createNextState)(Se.data,function(sr){return We(sr,he,{arg:Ct.originalArgs,baseQueryMeta:Bt,fulfilledTimeStamp:Ae,requestId:jt})});Se.data=Yn}else Se.data=he;else Se.data=(Ze=li[ce.arg.endpointName].structuralSharing)==null||Ze?C((0,bn.isDraft)(Se.data)?(0,Xt.original)(Se.data):Se.data,he):he;delete Se.error,Se.fulfilledTimeStamp=ce.fulfilledTimeStamp}})}).addCase(Zt.rejected,function(ae,xe){var ce=xe.meta,he=ce.condition,Se=ce.requestId,Ze=xe.error,We=xe.payload;Pn(ae,ce.arg.queryCacheKey,function(Ae){if(!he){if(Ae.requestId!==Se)return;Ae.status=t.rejected,Ae.error=We??Ze}})}).addMatcher(Vt,function(ae,xe){for(var ce=Pt(xe).queries,he=0,Se=Object.entries(ce);he<Se.length;he++){var Ze=Se[he],We=Ze[1];(We==null?void 0:We.status)!==t.fulfilled&&(We==null?void 0:We.status)!==t.rejected||(ae[Ze[0]]=We)}})}}),Ye=(0,le.createSlice)({name:an+"/mutations",initialState:Vr,reducers:{removeMutationResult:{reducer:function(be,ae){var xe=Sr(ae.payload);xe in be&&delete be[xe]},prepare:(0,le.prepareAutoBatched)()}},extraReducers:function(be){be.addCase(Xn.pending,function(ae,xe){var ce=xe.meta,he=ce.requestId,Se=ce.arg,Ze=ce.startedTimeStamp;Se.track&&(ae[Sr(xe.meta)]={requestId:he,status:t.pending,endpointName:Se.endpointName,startedTimeStamp:Ze})}).addCase(Xn.fulfilled,function(ae,xe){var ce=xe.payload,he=xe.meta;he.arg.track&&Ji(ae,he,function(Se){Se.requestId===he.requestId&&(Se.status=t.fulfilled,Se.data=ce,Se.fulfilledTimeStamp=he.fulfilledTimeStamp)})}).addCase(Xn.rejected,function(ae,xe){var ce=xe.payload,he=xe.error,Se=xe.meta;Se.arg.track&&Ji(ae,Se,function(Ze){Ze.requestId===Se.requestId&&(Ze.status=t.rejected,Ze.error=ce??he)})}).addMatcher(Vt,function(ae,xe){for(var ce=Pt(xe).mutations,he=0,Se=Object.entries(ce);he<Se.length;he++){var Ze=Se[he],We=Ze[0],Ae=Ze[1];(Ae==null?void 0:Ae.status)!==t.fulfilled&&(Ae==null?void 0:Ae.status)!==t.rejected||We===(Ae==null?void 0:Ae.requestId)||(ae[We]=Ae)}})}}),ze=(0,le.createSlice)({name:an+"/invalidation",initialState:Vr,reducers:{},extraReducers:function(be){be.addCase(_e.actions.removeQueryResult,function(ae,xe){for(var ce=xe.payload.queryCacheKey,he=0,Se=Object.values(ae);he<Se.length;he++)for(var Ze=0,We=Object.values(Se[he]);Ze<We.length;Ze++){var Ae=We[Ze],Ct=Ae.indexOf(ce);Ct!==-1&&Ae.splice(Ct,1)}}).addMatcher(Vt,function(ae,xe){for(var ce,he,Se,Ze,We=Pt(xe).provided,Ae=0,Ct=Object.entries(We);Ae<Ct.length;Ae++)for(var Bt=Ct[Ae],jt=Bt[0],Yn=0,sr=Object.entries(Bt[1]);Yn<sr.length;Yn++)for(var On=sr[Yn],Sn=On[0],zi=On[1],F=(Ze=(he=(ce=ae[jt])!=null?ce:ae[jt]={})[Se=Sn||"__internal_without_id"])!=null?Ze:he[Se]=[],V=0,K=zi;V<K.length;V++){var fe=K[V];F.includes(fe)||F.push(fe)}}).addMatcher((0,le.isAnyOf)((0,le.isFulfilled)(Zt),(0,le.isRejectedWithValue)(Zt)),function(ae,xe){for(var ce,he,Se,Ze,We=kn(xe,"providesTags",li,gn),Ae=xe.meta.arg.queryCacheKey,Ct=0,Bt=Object.values(ae);Ct<Bt.length;Ct++)for(var jt=0,Yn=Object.values(Bt[Ct]);jt<Yn.length;jt++){var sr=Yn[jt],On=sr.indexOf(Ae);On!==-1&&sr.splice(On,1)}for(var Sn=0,zi=We;Sn<zi.length;Sn++){var F=zi[Sn],V=F.type,K=F.id,fe=(Ze=(he=(ce=ae[V])!=null?ce:ae[V]={})[Se=K||"__internal_without_id"])!=null?Ze:he[Se]=[];fe.includes(Ae)||fe.push(Ae)}})}}),Te=(0,le.createSlice)({name:an+"/subscriptions",initialState:Vr,reducers:{updateSubscriptionOptions:function(be,ae){},unsubscribeQueryResult:function(be,ae){},internal_probeSubscription:function(be,ae){}}}),Ge=(0,le.createSlice)({name:an+"/internalSubscriptions",initialState:Vr,reducers:{subscriptionsUpdated:{reducer:function(be,ae){return(0,Xt.applyPatches)(be,ae.payload)},prepare:(0,le.prepareAutoBatched)()}}}),lt=(0,le.createSlice)({name:an+"/config",initialState:b({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Jt),reducers:{middlewareRegistered:function(be,ae){be.middlewareRegistered=be.middlewareRegistered!=="conflict"&&pn===ae.payload||"conflict"}},extraReducers:function(be){be.addCase(U,function(ae){ae.online=!0}).addCase(G,function(ae){ae.online=!1}).addCase(N,function(ae){ae.focused=!0}).addCase(B,function(ae){ae.focused=!1}).addMatcher(Vt,function(ae){return b({},ae)})}}),je=(0,le.combineReducers)({queries:_e.reducer,mutations:Ye.reducer,provided:ze.reducer,subscriptions:Ge.reducer,config:lt.reducer});return{reducer:function(be,ae){return je(un.match(ae)?void 0:be,ae)},actions:_(b(b(b(b(b({},lt.actions),_e.actions),Te.actions),Ge.actions),Ye.actions),{unsubscribeMutationResult:Ye.actions.removeMutationResult,resetApiState:un})}}({context:ne,queryThunk:ve,mutationThunk:Qe,reducerPath:ie,assertTagType:Pe,config:{refetchOnFocus:Ne,refetchOnReconnect:Ve,refetchOnMountOrArgChange:ot,keepUnusedDataFor:Ue,reducerPath:ie}}),on=xt.reducer,sn=xt.actions;si(H.util,{patchQueryData:Xe,updateQueryData:st,upsertQueryData:at,prefetch:mt,resetApiState:sn.resetApiState}),si(H.internalActions,sn);var Ci=function(tt){var an=tt.reducerPath,Zt=tt.queryThunk,Xn=tt.api,hr=tt.context,li=hr.apiUid,pn={invalidateTags:(0,ka.createAction)(an+"/invalidateTags")},Pt=[Mr,In,Or,xr,xi,oi];return{middleware:function(gn){var Jt=!1,un=_(b({},tt),{internalState:{currentSubscriptions:{}},refetchQuery:Vt}),_e=Pt.map(function(Te){return Te(un)}),Ye=function(Te){var Ge=Te.api,lt=Te.queryThunk,je=Te.internalState,be=Ge.reducerPath+"/subscriptions",ae=null,xe=!1,ce=Ge.internalActions,he=ce.updateSubscriptionOptions,Se=ce.unsubscribeQueryResult;return function(Ze,We){var Ae,Ct;if(ae||(ae=JSON.parse(JSON.stringify(je.currentSubscriptions))),Ge.util.resetApiState.match(Ze))return ae=je.currentSubscriptions={},[!0,!1];if(Ge.internalActions.internal_probeSubscription.match(Ze)){var Bt=Ze.payload;return[!1,!!((Ae=je.currentSubscriptions[Bt.queryCacheKey])!=null&&Ae[Bt.requestId])]}var jt=function(On,Sn){var zi,F,V,K,fe,St,ln,wn,Tt;if(he.match(Sn)){var mn=Sn.payload,ui=mn.queryCacheKey,Vn=mn.requestId;return(zi=On==null?void 0:On[ui])!=null&&zi[Vn]&&(On[ui][Vn]=mn.options),!0}if(Se.match(Sn)){var _l=Sn.payload;return Vn=_l.requestId,On[ui=_l.queryCacheKey]&&delete On[ui][Vn],!0}if(Ge.internalActions.removeQueryResult.match(Sn))return delete On[Sn.payload.queryCacheKey],!0;if(lt.pending.match(Sn)){var ld=Sn.meta;if(Vn=ld.requestId,(cd=ld.arg).subscribe)return(bl=(V=On[F=cd.queryCacheKey])!=null?V:On[F]={})[Vn]=(fe=(K=cd.subscriptionOptions)!=null?K:bl[Vn])!=null?fe:{},!0}if(lt.rejected.match(Sn)){var bl,ud=Sn.meta,cd=ud.arg;if(Vn=ud.requestId,ud.condition&&cd.subscribe)return(bl=(ln=On[St=cd.queryCacheKey])!=null?ln:On[St]={})[Vn]=(Tt=(wn=cd.subscriptionOptions)!=null?wn:bl[Vn])!=null?Tt:{},!0}return!1}(je.currentSubscriptions,Ze);if(jt){xe||(Us(function(){var On=JSON.parse(JSON.stringify(je.currentSubscriptions)),Sn=(0,hs.produceWithPatches)(ae,function(){return On});We.next(Ge.internalActions.subscriptionsUpdated(Sn[1])),ae=On,xe=!1}),xe=!0);var Yn=!!((Ct=Ze.type)!=null&&Ct.startsWith(be)),sr=lt.rejected.match(Ze)&&Ze.meta.condition&&!!Ze.meta.arg.subscribe;return[!Yn&&!sr,!1]}return[!0,!1]}}(un),ze=function(Te){var Ge=Te.reducerPath,lt=Te.context,je=Te.refetchQuery,be=Te.internalState,ae=Te.api.internalActions.removeQueryResult;function xe(ce,he){var Se=ce.getState()[Ge],Ze=Se.queries,We=be.currentSubscriptions;lt.batch(function(){for(var Ae=0,Ct=Object.keys(We);Ae<Ct.length;Ae++){var Bt=Ct[Ae],jt=Ze[Bt],Yn=We[Bt];Yn&&jt&&(Object.values(Yn).some(function(sr){return sr[he]===!0})||Object.values(Yn).every(function(sr){return sr[he]===void 0})&&Se.config[he])&&(Object.keys(Yn).length===0?ce.dispatch(ae({queryCacheKey:Bt})):jt.status!==t.uninitialized&&ce.dispatch(je(jt,Bt)))}})}return function(ce,he){N.match(ce)&&xe(he,"refetchOnFocus"),U.match(ce)&&xe(he,"refetchOnReconnect")}}(un);return function(Te){return function(Ge){Jt||(Jt=!0,gn.dispatch(Xn.internalActions.middlewareRegistered(li)));var lt,je=_(b({},gn),{next:Te}),be=gn.getState(),ae=Ye(Ge,je,be),xe=ae[1];if(lt=ae[0]?Te(Ge):xe,gn.getState()[an]&&(ze(Ge,je,be),function(Se){return!!Se&&typeof Se.type=="string"&&Se.type.startsWith(an+"/")}(Ge)||hr.hasRehydrationInfo(Ge)))for(var ce=0,he=_e;ce<he.length;ce++)(0,he[ce])(Ge,je,be);return lt}}},actions:pn};function Vt(gn,Jt,un){return un===void 0&&(un={}),Zt(b({type:"query",endpointName:gn.endpointName,originalArgs:gn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Jt},un))}}({reducerPath:ie,context:ne,queryThunk:ve,mutationThunk:Qe,api:H,assertTagType:Pe}),_o=Ci.middleware;si(H.util,Ci.actions),si(H,{reducer:on,middleware:_o});var Ei=function(tt){var an=tt.serializeQueryArgs,Zt=tt.reducerPath,Xn=function(Pt){return Rn},hr=function(Pt){return hn};return{buildQuerySelector:function(Pt,Vt){return function(gn){var Jt=an({queryArgs:gn,endpointDefinition:Vt,endpointName:Pt});return(0,W.createSelector)(gn===or?Xn:function(un){var _e,Ye,ze;return(ze=(Ye=(_e=pn(un))==null?void 0:_e.queries)==null?void 0:Ye[Jt])!=null?ze:Rn},li)}},buildMutationSelector:function(){return function(Pt){var Vt,gn;return gn=typeof Pt=="object"?(Vt=Sr(Pt))!=null?Vt:or:Pt,(0,W.createSelector)(gn===or?hr:function(Jt){var un,_e,Ye;return(Ye=(_e=(un=pn(Jt))==null?void 0:un.mutations)==null?void 0:_e[gn])!=null?Ye:hn},li)}},selectInvalidatedBy:function(Pt,Vt){for(var gn,Jt=Pt[Zt],un=new Set,_e=0,Ye=Vt.map(ye);_e<Ye.length;_e++){var ze=Ye[_e],Te=Jt.provided[ze.type];if(Te)for(var Ge=0,lt=(gn=ze.id!==void 0?Te[ze.id]:w(Object.values(Te)))!=null?gn:[];Ge<lt.length;Ge++)un.add(lt[Ge])}return w(Array.from(un.values()).map(function(je){var be=Jt.queries[je];return be?[{queryCacheKey:je,endpointName:be.endpointName,originalArgs:be.originalArgs}]:[]}))}};function li(Pt){return b(b({},Pt),{status:Vt=Pt.status,isUninitialized:Vt===t.uninitialized,isLoading:Vt===t.pending,isSuccess:Vt===t.fulfilled,isError:Vt===t.rejected});var Vt}function pn(Pt){return Pt[Zt]}}({serializeQueryArgs:Be,reducerPath:ie}),fr=Ei.buildQuerySelector,ai=Ei.buildMutationSelector;si(H.util,{selectInvalidatedBy:Ei.selectInvalidatedBy});var Un=function(tt){var an=tt.serializeQueryArgs,Zt=tt.queryThunk,Xn=tt.mutationThunk,hr=tt.api,li=tt.context,pn=new Map,Pt=new Map,Vt=hr.internalActions,gn=Vt.unsubscribeQueryResult,Jt=Vt.removeMutationResult,un=Vt.updateSubscriptionOptions;return{buildInitiateQuery:function(_e,Ye){var ze=function(Te,Ge){var lt=Ge===void 0?{}:Ge,je=lt.subscribe,be=je===void 0||je,ae=lt.forceRefetch,xe=lt.subscriptionOptions,ce=lt[nt];return function(he,Se){var Ze,We,Ae=an({queryArgs:Te,endpointDefinition:Ye,endpointName:_e}),Ct=Zt(((Ze={type:"query",subscribe:be,forceRefetch:ae,subscriptionOptions:xe,endpointName:_e,originalArgs:Te,queryCacheKey:Ae})[nt]=ce,Ze)),Bt=hr.endpoints[_e].select(Te),jt=he(Ct),Yn=Bt(Se()),sr=jt.requestId,On=jt.abort,Sn=Yn.requestId!==sr,zi=(We=pn.get(he))==null?void 0:We[Ae],F=function(){return Bt(Se())},V=Object.assign(ce?jt.then(F):Sn&&!zi?Promise.resolve(Yn):Promise.all([zi,jt]).then(F),{arg:Te,requestId:sr,subscriptionOptions:xe,queryCacheKey:Ae,abort:On,unwrap:function(){return S(this,null,function(){var fe;return r(this,function(St){switch(St.label){case 0:return[4,V];case 1:if((fe=St.sent()).isError)throw fe.error;return[2,fe.data]}})})},refetch:function(){return he(ze(Te,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){be&&he(gn({queryCacheKey:Ae,requestId:sr}))},updateSubscriptionOptions:function(fe){V.subscriptionOptions=fe,he(un({endpointName:_e,requestId:sr,queryCacheKey:Ae,options:fe}))}});if(!zi&&!Sn&&!ce){var K=pn.get(he)||{};K[Ae]=V,pn.set(he,K),V.then(function(){delete K[Ae],Object.keys(K).length||pn.delete(he)})}return V}};return ze},buildInitiateMutation:function(_e){return function(Ye,ze){var Te=ze===void 0?{}:ze,Ge=Te.track,lt=Ge===void 0||Ge,je=Te.fixedCacheKey;return function(be,ae){var xe=Xn({type:"mutation",endpointName:_e,originalArgs:Ye,track:lt,fixedCacheKey:je}),ce=be(xe),he=ce.requestId,Se=ce.abort,Ze=ce.unwrap,We=ce.unwrap().then(function(jt){return{data:jt}}).catch(function(jt){return{error:jt}}),Ae=function(){be(Jt({requestId:he,fixedCacheKey:je}))},Ct=Object.assign(We,{arg:ce.arg,requestId:he,abort:Se,unwrap:Ze,unsubscribe:Ae,reset:Ae}),Bt=Pt.get(be)||{};return Pt.set(be,Bt),Bt[he]=Ct,Ct.then(function(){delete Bt[he],Object.keys(Bt).length||Pt.delete(be)}),je&&(Bt[je]=Ct,Ct.then(function(){Bt[je]===Ct&&(delete Bt[je],Object.keys(Bt).length||Pt.delete(be))})),Ct}}},getRunningQueryThunk:function(_e,Ye){return function(ze){var Te,Ge=an({queryArgs:Ye,endpointDefinition:li.endpointDefinitions[_e],endpointName:_e});return(Te=pn.get(ze))==null?void 0:Te[Ge]}},getRunningMutationThunk:function(_e,Ye){return function(ze){var Te;return(Te=Pt.get(ze))==null?void 0:Te[Ye]}},getRunningQueriesThunk:function(){return function(_e){return Object.values(pn.get(_e)||{}).filter(pt)}},getRunningMutationsThunk:function(){return function(_e){return Object.values(Pt.get(_e)||{}).filter(pt)}},getRunningOperationPromises:function(){var _e=function(Ye){return Array.from(Ye.values()).flatMap(function(ze){return ze?Object.values(ze):[]})};return i(i([],_e(pn)),_e(Pt)).filter(pt)},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:ve,mutationThunk:Qe,api:H,serializeQueryArgs:Be,context:ne}),no=Un.buildInitiateQuery,ps=Un.buildInitiateMutation;return si(H.util,{getRunningOperationPromises:Un.getRunningOperationPromises,getRunningOperationPromise:Un.removalWarning,getRunningMutationThunk:Un.getRunningMutationThunk,getRunningMutationsThunk:Un.getRunningMutationsThunk,getRunningQueryThunk:Un.getRunningQueryThunk,getRunningQueriesThunk:Un.getRunningQueriesThunk}),{name:Bo,injectEndpoint:function(tt,an){var Zt,Xn=H;(Zt=Xn.endpoints)[tt]!=null||(Zt[tt]={}),te(an)?si(Xn.endpoints[tt],{name:tt,select:fr(tt,an),initiate:no(tt,an)},bt(ve,tt)):an.type===Y.mutation&&si(Xn.endpoints[tt],{name:tt,select:ai(),initiate:ps(tt)},bt(Qe,tt))}}}}},Pa=eo(Hr())})(LD);DD.exports=LD;var Mre=DD.exports;const Kr=["general"],Gl=["control","mask","user","other"],Nre=100,Ty=20,$D=xa(),Dre={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 Gv{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||Dre,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 Gv(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Gv(this.logger,t)}}var ia=new Gv;class B_{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 Ih(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function sP(e){return e==null?"":""+e}function Lre(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function AT(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 aP(e,t,n){const{obj:r,k:i}=AT(e,t,Object);r[i]=n}function $re(e,t,n,r){const{obj:i,k:o}=AT(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function qv(e,t){const{obj:n,k:r}=AT(e,t);if(n)return n[r]}function Fre(e,t,n){const r=qv(e,n);return r!==void 0?r:qv(t,n)}function FD(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]):FD(e[r],t[r],n):e[r]=t[r]);return e}function hd(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Bre={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function zre(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Bre[t]):e}const jre=[" ",",","?","!",";"];function Ure(e,t,n){t=t||"",n=n||"";const r=jre.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 Hv(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?Hv(l,u,n):void 0}i=i[r[o]]}return i}function Wv(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class lP extends B_{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=qv(this.data,a);return l||!s||typeof r!="string"?l:Hv(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),aP(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=qv(this.data,a)||{};i?FD(l,r,o):l={...l,...r},aP(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 BD={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 uP={};class Kv extends B_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Lre(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ia.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&&!Ure(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 y=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${y}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l}:`${l}${y}${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,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&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 y=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=y,d):y}if(o){const y=m==="[object Array]",S=y?[]:{},w=y?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(v&&typeof _=="string"&&m==="[object Array]")f=f.join(_),f&&(f=this.extendTranslation(f,t,n,r));else{let y=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",x=Kv.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&&(y=!0,f=T),this.isValidLookup(f)||(S=!0,f=s);const L=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,R=x&&T!==f&&this.options.updateMissing;if(S||y||R){if(this.logger.log(R?"updateKey":"missingKey",u,l,s,R?T:f),o){const $=this.resolve(s,{...n,keySeparator:!1});$&&$.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 k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let $=0;$<k.length;$++)E.push(k[$]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(n.lng||this.language):E.push(n.lng||this.language);const D=($,O,I)=>{const N=x&&I!==f?I:L;this.options.missingKeyHandler?this.options.missingKeyHandler($,l,O,N,R,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing($,l,O,N,R,n),this.emit("missingKey",$,l,O,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach($=>{this.pluralResolver.getSuffixes($,n).forEach(O=>{D([$],s+O,n[`defaultValue${O}`]||T)})}):D(E,s,T))}f=this.extendTranslation(f,t,n,d,r),S&&f===s&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${s}`),(S||y)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,y?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=BD.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,!uP[`${m[0]}-${b}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(uP[`${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 v=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,c,_,b,n);else{let y;f&&(y=this.pluralResolver.getSuffix(_,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(c+y),n.ordinal&&y.indexOf(w)===0&&v.push(c+y.replace(w,this.options.pluralSeparator)),h&&v.push(c+S)),p){const x=`${c}${this.options.contextSeparator}${n.context}`;v.push(x),f&&(v.push(x+y),n.ordinal&&y.indexOf(w)===0&&v.push(x+y.replace(w,this.options.pluralSeparator)),h&&v.push(x+S))}}let g;for(;g=v.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 z2(e){return e.charAt(0).toUpperCase()+e.slice(1)}class cP{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ia.create("languageUtils")}getScriptPartFromCode(t){if(t=Wv(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=Wv(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]=z2(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]=z2(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=z2(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 Vre=[{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}],Gre={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 qre=["v1","v2","v3"],Hre=["v4"],dP={zero:0,one:1,two:2,few:3,many:4,other:5};function Wre(){const e={};return Vre.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Gre[t.fc]}})}),e}class Kre{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ia.create("pluralResolver"),(!this.options.compatibilityJSON||Hre.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=Wre()}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(Wv(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)=>dP[i]-dP[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!qre.includes(this.options.compatibilityJSON)}}function fP(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=Fre(e,t,n);return!o&&i&&typeof n=="string"&&(o=Hv(e,n,r),o===void 0&&(o=Hv(t,n,r))),o}class Qre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ia.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:zre,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?hd(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?hd(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?hd(n.nestingPrefix):n.nestingPrefixEscaped||hd("$t("),this.nestingSuffix=n.nestingSuffix?hd(n.nestingSuffix):n.nestingSuffixEscaped||hd(")"),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 v=fP(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...i,...n,interpolationkey:p}):v}const m=p.split(this.formatSeparator),b=m.shift().trim(),_=m.join(this.formatSeparator).trim();return this.format(fP(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=sP(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=sP(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 Xre(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 pd(e){const t={};return function(r,i,o){const s=i+JSON.stringify(o);let a=t[s];return a||(a=e(Wv(i),o),t[s]=a),a(r)}}class Yre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ia.create("formatter"),this.options=t,this.formats={number:pd((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:pd((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:pd((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:pd((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:pd((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()]=pd(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}=Xre(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 Zre(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Jre extends B_{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=ia.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=>{$re(l.loaded,[o],s),Zre(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 hP(){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 pP(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 Ay(){}function eie(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class bg extends B_{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=pP(t),this.services={},this.logger=ia,this.modules={external:[]},eie(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=hP();this.options={...i,...this.options,...pP(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?ia.init(o(this.modules.logger),this.options):ia.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Yre);const d=new cP(this.options);this.store=new lP(this.options.resources,this.options);const f=this.services;f.logger=ia,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Kre(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 Qre(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Jre(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 Kv(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=Ay),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=Ih(),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]:Ay;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=Ih();return t||(t=this.languages),n||(n=this.options.ns),r||(r=Ay),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"&&BD.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=Ih();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=Ih();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=Ih();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 cP(hP());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 bg(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ay;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new bg(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 lP(this.store.data,i),o.services.resourceStore=o.store),o.translator=new Kv(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 we=bg.createInstance();we.createInstance=bg.createInstance;we.createInstance;we.dir;we.init;we.loadResources;we.reloadResources;we.use;we.changeLanguage;we.getFixedT;const X=we.t;we.exists;we.setDefaultNamespace;we.hasLoadedNamespace;we.loadNamespaces;we.loadLanguages;const zD=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"]),tie=z.enum(["WorkflowField","IsIntermediate","MetadataField"]),gP=e=>zD.safeParse(e).success||tie.safeParse(e).success;z.enum(["connection","direct","any"]);const jD=z.object({id:z.string().trim().min(1),name:z.string().trim().min(1),type:zD}),nie=jD.extend({fieldKind:z.literal("output")}),gt=jD.extend({fieldKind:z.literal("input"),label:z.string()}),Kc=z.object({model_name:z.string().trim().min(1),base_model:Wc}),Tm=z.object({image_name:z.string().trim().min(1)}),Qv=z.object({latents_name:z.string().trim().min(1),seed:z.number().int().optional()}),Xv=z.object({conditioning_name:z.string().trim().min(1)}),rie=z.object({mask_name:z.string().trim().min(1),masked_latents_name:z.string().trim().min(1).optional()}),iie=gt.extend({type:z.literal("integer"),value:z.number().int().optional()}),oie=gt.extend({type:z.literal("IntegerCollection"),value:z.array(z.number().int()).optional()}),sie=gt.extend({type:z.literal("IntegerPolymorphic"),value:z.number().int().optional()}),aie=gt.extend({type:z.literal("float"),value:z.number().optional()}),lie=gt.extend({type:z.literal("FloatCollection"),value:z.array(z.number()).optional()}),uie=gt.extend({type:z.literal("FloatPolymorphic"),value:z.number().optional()}),cie=gt.extend({type:z.literal("string"),value:z.string().optional()}),die=gt.extend({type:z.literal("StringCollection"),value:z.array(z.string()).optional()}),fie=gt.extend({type:z.literal("StringPolymorphic"),value:z.string().optional()}),hie=gt.extend({type:z.literal("boolean"),value:z.boolean().optional()}),pie=gt.extend({type:z.literal("BooleanCollection"),value:z.array(z.boolean()).optional()}),gie=gt.extend({type:z.literal("BooleanPolymorphic"),value:z.boolean().optional()}),mie=gt.extend({type:z.literal("enum"),value:z.string().optional()}),yie=gt.extend({type:z.literal("LatentsField"),value:Qv.optional()}),vie=gt.extend({type:z.literal("LatentsCollection"),value:z.array(Qv).optional()}),_ie=gt.extend({type:z.literal("LatentsPolymorphic"),value:z.union([Qv,z.array(Qv)]).optional()}),bie=gt.extend({type:z.literal("DenoiseMaskField"),value:rie.optional()}),Sie=gt.extend({type:z.literal("ConditioningField"),value:Xv.optional()}),wie=gt.extend({type:z.literal("ConditioningCollection"),value:z.array(Xv).optional()}),xie=gt.extend({type:z.literal("ConditioningPolymorphic"),value:z.union([Xv,z.array(Xv)]).optional()}),Cie=Kc,Sg=z.object({image:Tm,control_model:Cie,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()}),Eie=gt.extend({type:z.literal("ControlField"),value:Sg.optional()}),Tie=gt.extend({type:z.literal("ControlPolymorphic"),value:z.union([Sg,z.array(Sg)]).optional()}),Aie=gt.extend({type:z.literal("ControlCollection"),value:z.array(Sg).optional()}),kie=Kc,Pie=z.object({image:Tm,ip_adapter_model:kie,image_encoder_model:z.string().trim().min(1),weight:z.number()}),Rie=gt.extend({type:z.literal("IPAdapterField"),value:Pie.optional()}),Iie=z.enum(["onnx","main","vae","lora","controlnet","embedding"]),Oie=z.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),$f=Kc.extend({model_type:Iie,submodel:Oie.optional()}),UD=$f.extend({weight:z.number().optional()}),Mie=z.object({unet:$f,scheduler:$f,loras:z.array(UD)}),Nie=gt.extend({type:z.literal("UNetField"),value:Mie.optional()}),Die=z.object({tokenizer:$f,text_encoder:$f,skipped_layers:z.number(),loras:z.array(UD)}),Lie=gt.extend({type:z.literal("ClipField"),value:Die.optional()}),$ie=z.object({vae:$f}),Fie=gt.extend({type:z.literal("VaeField"),value:$ie.optional()}),Bie=gt.extend({type:z.literal("ImageField"),value:Tm.optional()}),zie=gt.extend({type:z.literal("ImagePolymorphic"),value:Tm.optional()}),jie=gt.extend({type:z.literal("ImageCollection"),value:z.array(Tm).optional()}),Uie=gt.extend({type:z.literal("MainModelField"),value:xm.optional()}),Vie=gt.extend({type:z.literal("SDXLMainModelField"),value:xm.optional()}),Gie=gt.extend({type:z.literal("SDXLRefinerModelField"),value:xm.optional()}),VD=Kc,qie=gt.extend({type:z.literal("VaeModelField"),value:VD.optional()}),kT=Kc,Hie=gt.extend({type:z.literal("LoRAModelField"),value:kT.optional()}),Wie=Kc,Kie=gt.extend({type:z.literal("ControlNetModelField"),value:Wie.optional()}),Qie=Kc,Xie=gt.extend({type:z.literal("IPAdapterModelField"),value:Qie.optional()}),Yie=gt.extend({type:z.literal("Collection"),value:z.array(z.any()).optional()}),Zie=gt.extend({type:z.literal("CollectionItem"),value:z.any().optional()}),Yv=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)}),Jie=gt.extend({type:z.literal("ColorField"),value:Yv.optional()}),eoe=gt.extend({type:z.literal("ColorCollection"),value:z.array(Yv).optional()}),toe=gt.extend({type:z.literal("ColorPolymorphic"),value:z.union([Yv,z.array(Yv)]).optional()}),noe=gt.extend({type:z.literal("Scheduler"),value:CD.optional()}),roe=z.discriminatedUnion("type",[pie,hie,gie,Lie,Yie,Zie,Jie,eoe,toe,Sie,wie,xie,Eie,Kie,Aie,Tie,bie,mie,lie,aie,uie,jie,zie,Bie,oie,sie,iie,Rie,Xie,yie,vie,_ie,Hie,Uie,noe,Vie,Gie,die,fie,cie,Nie,Fie,qie]),PIe=e=>!!(e&&e.fieldKind==="input"),RIe=e=>!!(e&&e.fieldKind==="input"),ioe=e=>!!(e&&!("$ref"in e)),mP=e=>!!(e&&!("$ref"in e)&&e.type==="array"),ky=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),Oh=e=>!!(e&&"$ref"in e),ooe=e=>"class"in e&&e.class==="invocation",soe=e=>"class"in e&&e.class==="output",yP=e=>!("$ref"in e);z.object({lora:kT.deepPartial(),weight:z.number()});const GD=z.object({app_version:z.string().nullish().catch(null),generation_mode:z.string().nullish().catch(null),created_by:z.string().nullish().catch(null),positive_prompt:z.string().nullish().catch(null),negative_prompt:z.string().nullish().catch(null),width:z.number().int().nullish().catch(null),height:z.number().int().nullish().catch(null),seed:z.number().int().nullish().catch(null),rand_device:z.string().nullish().catch(null),cfg_scale:z.number().nullish().catch(null),steps:z.number().int().nullish().catch(null),scheduler:z.string().nullish().catch(null),clip_skip:z.number().int().nullish().catch(null),model:z.union([D_.deepPartial(),ED.deepPartial()]).nullish().catch(null),controlnets:z.array(Sg.deepPartial()).nullish().catch(null),loras:z.array(z.object({lora:kT.deepPartial(),weight:z.number()})).nullish().catch(null),vae:VD.nullish().catch(null),strength:z.number().nullish().catch(null),init_image:z.string().nullish().catch(null),positive_style_prompt:z.string().nullish().catch(null),negative_style_prompt:z.string().nullish().catch(null),refiner_model:xT.deepPartial().nullish().catch(null),refiner_cfg_scale:z.number().nullish().catch(null),refiner_steps:z.number().int().nullish().catch(null),refiner_scheduler:z.string().nullish().catch(null),refiner_positive_aesthetic_score:z.number().nullish().catch(null),refiner_negative_aesthetic_score:z.number().nullish().catch(null),refiner_start:z.number().nullish().catch(null)}).passthrough(),PT=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))});PT.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});const vP=z.object({id:z.string().trim().min(1),type:z.string().trim().min(1),inputs:z.record(roe),outputs:z.record(nie),label:z.string(),isOpen:z.boolean(),notes:z.string(),embedWorkflow:z.boolean(),isIntermediate:z.boolean(),version:PT.optional()}),aoe=z.preprocess(e=>{var t;try{const n=vP.parse(e);if(!Ree(n,"useCache")){const r=(t=$D.get())==null?void 0:t.getState().nodes.nodeTemplates,i=r==null?void 0:r[n.type];let o=!0;i&&(o=i.useCache),Object.assign(n,{useCache:o})}return n}catch{return e}},vP.extend({useCache:z.boolean()})),loe=z.object({id:z.string().trim().min(1),type:z.literal("notes"),label:z.string(),isOpen:z.boolean(),notes:z.string()}),qD=z.object({x:z.number(),y:z.number()}).default({x:0,y:0}),Zv=z.number().gt(0).nullish(),HD=z.object({id:z.string().trim().min(1),type:z.literal("invocation"),data:aoe,width:Zv,height:Zv,position:qD}),wC=e=>HD.safeParse(e).success,uoe=z.object({id:z.string().trim().min(1),type:z.literal("notes"),data:loe,width:Zv,height:Zv,position:qD}),WD=z.discriminatedUnion("type",[HD,uoe]),coe=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")}),doe=z.object({source:z.string().trim().min(1),target:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("collapsed")}),KD=z.union([coe,doe]),foe=z.object({nodeId:z.string().trim().min(1),fieldName:z.string().trim().min(1)}),hoe="1.0.0",QD=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(WD).default([]),edges:z.array(KD).default([]),exposedFields:z.array(foe).default([]),meta:z.object({version:PT}).default({version:hoe})});QD.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(wC),o=wT(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(`${we.t("nodes.outputField")}"${s.source}.${s.sourceHandle}" ${we.t("nodes.doesNotExist")}`):c.push(`${we.t("nodes.outputNode")} ${s.source} ${we.t("nodes.doesNotExist")}`),u?s.type==="default"&&!(s.targetHandle in u.data.inputs)&&c.push(`${we.t("nodes.inputField")} "${s.target}.${s.targetHandle}" ${we.t("nodes.doesNotExist")}`):c.push(`${we.t("nodes.inputNode")} ${s.target} ${we.t("nodes.doesNotExist")}`),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:`${we.t("nodes.edge")} "${d} -> ${f}" ${we.t("nodes.skipped")}`,issues:c,data:s})}}),{workflow:e,warnings:r}});const Nr=e=>!!(e&&e.type==="invocation"),IIe=e=>!!(e&&!["notes","current_image"].includes(e.type)),_P=e=>!!(e&&e.type==="notes");var Qs=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(Qs||{});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const poe=4,bP=0,SP=1,goe=2;function oh(e){let t=e.length;for(;--t>=0;)e[t]=0}const moe=0,XD=1,yoe=2,voe=3,_oe=258,RT=29,Am=256,wg=Am+1+RT,df=30,IT=19,YD=2*wg+1,ac=15,j2=16,boe=7,OT=256,ZD=16,JD=17,eL=18,xC=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]),O0=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]),Soe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),tL=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),woe=512,ja=new Array((wg+2)*2);oh(ja);const Sp=new Array(df*2);oh(Sp);const xg=new Array(woe);oh(xg);const Cg=new Array(_oe-voe+1);oh(Cg);const MT=new Array(RT);oh(MT);const Jv=new Array(df);oh(Jv);function U2(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 nL,rL,iL;function V2(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const oL=e=>e<256?xg[e]:xg[256+(e>>>7)],Eg=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},ao=(e,t,n)=>{e.bi_valid>j2-n?(e.bi_buf|=t<<e.bi_valid&65535,Eg(e,e.bi_buf),e.bi_buf=t>>j2-e.bi_valid,e.bi_valid+=n-j2):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},ta=(e,t,n)=>{ao(e,n[t*2],n[t*2+1])},sL=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},xoe=e=>{e.bi_valid===16?(Eg(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)},Coe=(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<=ac;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<YD;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--)}},aL=(e,t,n)=>{const r=new Array(ac+1);let i=0,o,s;for(o=1;o<=ac;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]=sL(r[a]++,a))}},Eoe=()=>{let e,t,n,r,i;const o=new Array(ac+1);for(n=0,r=0;r<RT-1;r++)for(MT[r]=n,e=0;e<1<<xC[r];e++)Cg[n++]=r;for(Cg[n-1]=r,i=0,r=0;r<16;r++)for(Jv[r]=i,e=0;e<1<<O0[r];e++)xg[i++]=r;for(i>>=7;r<df;r++)for(Jv[r]=i<<7,e=0;e<1<<O0[r]-7;e++)xg[256+i++]=r;for(t=0;t<=ac;t++)o[t]=0;for(e=0;e<=143;)ja[e*2+1]=8,e++,o[8]++;for(;e<=255;)ja[e*2+1]=9,e++,o[9]++;for(;e<=279;)ja[e*2+1]=7,e++,o[7]++;for(;e<=287;)ja[e*2+1]=8,e++,o[8]++;for(aL(ja,wg+1,o),e=0;e<df;e++)Sp[e*2+1]=5,Sp[e*2]=sL(e,5);nL=new U2(ja,xC,Am+1,wg,ac),rL=new U2(Sp,O0,0,df,ac),iL=new U2(new Array(0),Soe,0,IT,boe)},lL=e=>{let t;for(t=0;t<wg;t++)e.dyn_ltree[t*2]=0;for(t=0;t<df;t++)e.dyn_dtree[t*2]=0;for(t=0;t<IT;t++)e.bl_tree[t*2]=0;e.dyn_ltree[OT*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},uL=e=>{e.bi_valid>8?Eg(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},wP=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},G2=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&wP(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!wP(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},xP=(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?ta(e,i,t):(s=Cg[i],ta(e,s+Am+1,t),a=xC[s],a!==0&&(i-=MT[s],ao(e,i,a)),r--,s=oL(r),ta(e,s,n),a=O0[s],a!==0&&(r-=Jv[s],ao(e,r,a)));while(o<e.sym_next);ta(e,OT,t)},CC=(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=YD,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--)G2(e,n,s);u=o;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G2(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++,G2(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Coe(e,t),aL(n,l,e.bl_count)},CP=(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[ZD*2]++):a<=10?e.bl_tree[JD*2]++:e.bl_tree[eL*2]++,a=0,i=o,s===0?(l=138,u=3):o===s?(l=6,u=3):(l=7,u=4))},EP=(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 ta(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==i&&(ta(e,o,e.bl_tree),a--),ta(e,ZD,e.bl_tree),ao(e,a-3,2)):a<=10?(ta(e,JD,e.bl_tree),ao(e,a-3,3)):(ta(e,eL,e.bl_tree),ao(e,a-11,7));a=0,i=o,s===0?(l=138,u=3):o===s?(l=6,u=3):(l=7,u=4)}},Toe=e=>{let t;for(CP(e,e.dyn_ltree,e.l_desc.max_code),CP(e,e.dyn_dtree,e.d_desc.max_code),CC(e,e.bl_desc),t=IT-1;t>=3&&e.bl_tree[tL[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Aoe=(e,t,n,r)=>{let i;for(ao(e,t-257,5),ao(e,n-1,5),ao(e,r-4,4),i=0;i<r;i++)ao(e,e.bl_tree[tL[i]*2+1],3);EP(e,e.dyn_ltree,t-1),EP(e,e.dyn_dtree,n-1)},koe=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return bP;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return SP;for(n=32;n<Am;n++)if(e.dyn_ltree[n*2]!==0)return SP;return bP};let TP=!1;const Poe=e=>{TP||(Eoe(),TP=!0),e.l_desc=new V2(e.dyn_ltree,nL),e.d_desc=new V2(e.dyn_dtree,rL),e.bl_desc=new V2(e.bl_tree,iL),e.bi_buf=0,e.bi_valid=0,lL(e)},cL=(e,t,n,r)=>{ao(e,(moe<<1)+(r?1:0),3),uL(e),Eg(e,n),Eg(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Roe=e=>{ao(e,XD<<1,3),ta(e,OT,ja),xoe(e)},Ioe=(e,t,n,r)=>{let i,o,s=0;e.level>0?(e.strm.data_type===goe&&(e.strm.data_type=koe(e)),CC(e,e.l_desc),CC(e,e.d_desc),s=Toe(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?cL(e,t,n,r):e.strategy===poe||o===i?(ao(e,(XD<<1)+(r?1:0),3),xP(e,ja,Sp)):(ao(e,(yoe<<1)+(r?1:0),3),Aoe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),xP(e,e.dyn_ltree,e.dyn_dtree)),lL(e),r&&uL(e)},Ooe=(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[(Cg[n]+Am+1)*2]++,e.dyn_dtree[oL(t)*2]++),e.sym_next===e.sym_end);var Moe=Poe,Noe=cL,Doe=Ioe,Loe=Ooe,$oe=Roe,Foe={_tr_init:Moe,_tr_stored_block:Noe,_tr_flush_block:Doe,_tr_tally:Loe,_tr_align:$oe};const Boe=(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 Tg=Boe;const zoe=()=>{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},joe=new Uint32Array(zoe()),Uoe=(e,t,n,r)=>{const i=joe,o=r+n;e^=-1;for(let s=r;s<o;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var Xr=Uoe,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"},km={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:Voe,_tr_stored_block:EC,_tr_flush_block:Goe,_tr_tally:nu,_tr_align:qoe}=Foe,{Z_NO_FLUSH:ru,Z_PARTIAL_FLUSH:Hoe,Z_FULL_FLUSH:Woe,Z_FINISH:Qo,Z_BLOCK:AP,Z_OK:gi,Z_STREAM_END:kP,Z_STREAM_ERROR:ca,Z_DATA_ERROR:Koe,Z_BUF_ERROR:q2,Z_DEFAULT_COMPRESSION:Qoe,Z_FILTERED:Xoe,Z_HUFFMAN_ONLY:Py,Z_RLE:Yoe,Z_FIXED:Zoe,Z_DEFAULT_STRATEGY:Joe,Z_UNKNOWN:ese,Z_DEFLATED:z_}=km,tse=9,nse=15,rse=8,ise=29,ose=256,TC=ose+1+ise,sse=30,ase=19,lse=2*TC+1,use=15,Lt=3,ql=258,da=ql+Lt+1,cse=32,Bf=42,NT=57,AC=69,kC=73,PC=91,RC=103,lc=113,ep=666,Gi=1,sh=2,Oc=3,ah=4,dse=3,uc=(e,t)=>(e.msg=Ff[t],t),PP=e=>e*2-(e>4?9:0),Fl=e=>{let t=e.length;for(;--t>=0;)e[t]=0},fse=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 hse=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,iu=hse;const wo=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))},ko=(e,t)=>{Goe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,wo(e.strm)},en=(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},IC=(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=Tg(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Xr(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},dL=(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-da?e.strstart-(e.w_size-da):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+ql;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=ql-(f-r),r=f-ql,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-da)&&(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),fse(e),r+=t),e.strm.avail_in===0)break;if(n=IC(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Lt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=iu(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=iu(e,e.ins_h,e.window[i+Lt-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<Lt)););}while(e.lookahead<da&&e.strm.avail_in!==0)},fL=(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!==Qo||t===ru||r!==i+e.strm.avail_in)))break;s=t===Qo&&r===i+e.strm.avail_in?1:0,EC(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,wo(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&&(IC(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?ah:t!==ru&&t!==Qo&&e.strm.avail_in===0&&e.strstart===e.block_start?sh:(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&&(IC(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===Qo)&&t!==ru&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,s=t===Qo&&e.strm.avail_in===0&&r===i?1:0,EC(e,e.block_start,r,s),e.block_start+=r,wo(e.strm)),s?Oc:Gi)},H2=(e,t)=>{let n,r;for(;;){if(e.lookahead<da){if(zf(e),e.lookahead<da&&t===ru)return Gi;if(e.lookahead===0)break}if(n=0,e.lookahead>=Lt&&(e.ins_h=iu(e,e.ins_h,e.window[e.strstart+Lt-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-da&&(e.match_length=dL(e,n)),e.match_length>=Lt)if(r=nu(e,e.strstart-e.match_start,e.match_length-Lt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Lt){e.match_length--;do e.strstart++,e.ins_h=iu(e,e.ins_h,e.window[e.strstart+Lt-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=iu(e,e.ins_h,e.window[e.strstart+1]);else r=nu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ko(e,!1),e.strm.avail_out===0))return Gi}return e.insert=e.strstart<Lt-1?e.strstart:Lt-1,t===Qo?(ko(e,!0),e.strm.avail_out===0?Oc:ah):e.sym_next&&(ko(e,!1),e.strm.avail_out===0)?Gi:sh},gd=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<da){if(zf(e),e.lookahead<da&&t===ru)return Gi;if(e.lookahead===0)break}if(n=0,e.lookahead>=Lt&&(e.ins_h=iu(e,e.ins_h,e.window[e.strstart+Lt-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=Lt-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-da&&(e.match_length=dL(e,n),e.match_length<=5&&(e.strategy===Xoe||e.match_length===Lt&&e.strstart-e.match_start>4096)&&(e.match_length=Lt-1)),e.prev_length>=Lt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Lt,r=nu(e,e.strstart-1-e.prev_match,e.prev_length-Lt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=iu(e,e.ins_h,e.window[e.strstart+Lt-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=Lt-1,e.strstart++,r&&(ko(e,!1),e.strm.avail_out===0))return Gi}else if(e.match_available){if(r=nu(e,0,e.window[e.strstart-1]),r&&ko(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Gi}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=nu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Lt-1?e.strstart:Lt-1,t===Qo?(ko(e,!0),e.strm.avail_out===0?Oc:ah):e.sym_next&&(ko(e,!1),e.strm.avail_out===0)?Gi:sh},pse=(e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=ql){if(zf(e),e.lookahead<=ql&&t===ru)return Gi;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Lt&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+ql;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=ql-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Lt?(n=nu(e,1,e.match_length-Lt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=nu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(ko(e,!1),e.strm.avail_out===0))return Gi}return e.insert=0,t===Qo?(ko(e,!0),e.strm.avail_out===0?Oc:ah):e.sym_next&&(ko(e,!1),e.strm.avail_out===0)?Gi:sh},gse=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(zf(e),e.lookahead===0)){if(t===ru)return Gi;break}if(e.match_length=0,n=nu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(ko(e,!1),e.strm.avail_out===0))return Gi}return e.insert=0,t===Qo?(ko(e,!0),e.strm.avail_out===0?Oc:ah):e.sym_next&&(ko(e,!1),e.strm.avail_out===0)?Gi:sh};function Gs(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 tp=[new Gs(0,0,0,0,fL),new Gs(4,4,8,4,H2),new Gs(4,5,16,8,H2),new Gs(4,6,32,32,H2),new Gs(4,4,16,16,gd),new Gs(8,16,32,32,gd),new Gs(8,16,128,128,gd),new Gs(8,32,128,256,gd),new Gs(32,128,258,1024,gd),new Gs(32,258,258,4096,gd)],mse=e=>{e.window_size=2*e.w_size,Fl(e.head),e.max_lazy_match=tp[e.level].max_lazy,e.good_match=tp[e.level].good_length,e.nice_match=tp[e.level].nice_length,e.max_chain_length=tp[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Lt-1,e.match_available=0,e.ins_h=0};function yse(){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=z_,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(lse*2),this.dyn_dtree=new Uint16Array((2*sse+1)*2),this.bl_tree=new Uint16Array((2*ase+1)*2),Fl(this.dyn_ltree),Fl(this.dyn_dtree),Fl(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(use+1),this.heap=new Uint16Array(2*TC+1),Fl(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*TC+1),Fl(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 Pm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Bf&&t.status!==NT&&t.status!==AC&&t.status!==kC&&t.status!==PC&&t.status!==RC&&t.status!==lc&&t.status!==ep?1:0},hL=e=>{if(Pm(e))return uc(e,ca);e.total_in=e.total_out=0,e.data_type=ese;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?NT:t.wrap?Bf:lc,e.adler=t.wrap===2?0:1,t.last_flush=-2,Voe(t),gi},pL=e=>{const t=hL(e);return t===gi&&mse(e.state),t},vse=(e,t)=>Pm(e)||e.state.wrap!==2?ca:(e.state.gzhead=t,gi),gL=(e,t,n,r,i,o)=>{if(!e)return ca;let s=1;if(t===Qoe&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>tse||n!==z_||r<8||r>15||t<0||t>9||o<0||o>Zoe||r===8&&s!==1)return uc(e,ca);r===8&&(r=9);const a=new yse;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+Lt-1)/Lt),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,pL(e)},_se=(e,t)=>gL(e,t,z_,nse,rse,Joe),bse=(e,t)=>{if(Pm(e)||t>AP||t<0)return e?uc(e,ca):ca;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===ep&&t!==Qo)return uc(e,e.avail_out===0?q2:ca);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(wo(e),e.avail_out===0)return n.last_flush=-1,gi}else if(e.avail_in===0&&PP(t)<=PP(r)&&t!==Qo)return uc(e,q2);if(n.status===ep&&e.avail_in!==0)return uc(e,q2);if(n.status===Bf&&n.wrap===0&&(n.status=lc),n.status===Bf){let i=z_+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Py||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=cse),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=lc,wo(e),n.pending!==0)return n.last_flush=-1,gi}if(n.status===NT){if(e.adler=0,en(n,31),en(n,139),en(n,8),n.gzhead)en(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)),en(n,n.gzhead.time&255),en(n,n.gzhead.time>>8&255),en(n,n.gzhead.time>>16&255),en(n,n.gzhead.time>>24&255),en(n,n.level===9?2:n.strategy>=Py||n.level<2?4:0),en(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(en(n,n.gzhead.extra.length&255),en(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Xr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=AC;else if(en(n,0),en(n,0),en(n,0),en(n,0),en(n,0),en(n,n.level===9?2:n.strategy>=Py||n.level<2?4:0),en(n,dse),n.status=lc,wo(e),n.pending!==0)return n.last_flush=-1,gi}if(n.status===AC){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=Xr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,wo(e),n.pending!==0)return n.last_flush=-1,gi;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=Xr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=kC}if(n.status===kC){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=Xr(e.adler,n.pending_buf,n.pending-i,i)),wo(e),n.pending!==0)return n.last_flush=-1,gi;i=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,en(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Xr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=PC}if(n.status===PC){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=Xr(e.adler,n.pending_buf,n.pending-i,i)),wo(e),n.pending!==0)return n.last_flush=-1,gi;i=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,en(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Xr(e.adler,n.pending_buf,n.pending-i,i))}n.status=RC}if(n.status===RC){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(wo(e),n.pending!==0))return n.last_flush=-1,gi;en(n,e.adler&255),en(n,e.adler>>8&255),e.adler=0}if(n.status=lc,wo(e),n.pending!==0)return n.last_flush=-1,gi}if(e.avail_in!==0||n.lookahead!==0||t!==ru&&n.status!==ep){let i=n.level===0?fL(n,t):n.strategy===Py?gse(n,t):n.strategy===Yoe?pse(n,t):tp[n.level].func(n,t);if((i===Oc||i===ah)&&(n.status=ep),i===Gi||i===Oc)return e.avail_out===0&&(n.last_flush=-1),gi;if(i===sh&&(t===Hoe?qoe(n):t!==AP&&(EC(n,0,0,!1),t===Woe&&(Fl(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),wo(e),e.avail_out===0))return n.last_flush=-1,gi}return t!==Qo?gi:n.wrap<=0?kP:(n.wrap===2?(en(n,e.adler&255),en(n,e.adler>>8&255),en(n,e.adler>>16&255),en(n,e.adler>>24&255),en(n,e.total_in&255),en(n,e.total_in>>8&255),en(n,e.total_in>>16&255),en(n,e.total_in>>24&255)):(Mh(n,e.adler>>>16),Mh(n,e.adler&65535)),wo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?gi:kP)},Sse=e=>{if(Pm(e))return ca;const t=e.state.status;return e.state=null,t===lc?uc(e,Koe):gi},wse=(e,t)=>{let n=t.length;if(Pm(e))return ca;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Bf||r.lookahead)return ca;if(i===1&&(e.adler=Tg(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Fl(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>=Lt;){let l=r.strstart,u=r.lookahead-(Lt-1);do r.ins_h=iu(r,r.ins_h,r.window[l+Lt-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=Lt-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=Lt-1,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,r.wrap=i,gi};var xse=_se,Cse=gL,Ese=pL,Tse=hL,Ase=vse,kse=bse,Pse=Sse,Rse=wse,Ise="pako deflate (from Nodeca project)",wp={deflateInit:xse,deflateInit2:Cse,deflateReset:Ese,deflateResetKeep:Tse,deflateSetHeader:Ase,deflate:kse,deflateEnd:Pse,deflateSetDictionary:Rse,deflateInfo:Ise};const Ose=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Mse=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)Ose(n,r)&&(e[r]=n[r])}}return e},Nse=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},j_={assign:Mse,flattenChunks:Nse};let mL=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{mL=!1}const Ag=new Uint8Array(256);for(let e=0;e<256;e++)Ag[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ag[254]=Ag[254]=1;var Dse=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 Lse=(e,t)=>{if(t<65534&&e.subarray&&mL)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 $se=(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=Ag[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 Lse(o,i)},Fse=(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+Ag[e[n]]>t?n:t},kg={string2buf:Dse,buf2string:$se,utf8border:Fse};function Bse(){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 yL=Bse;const vL=Object.prototype.toString,{Z_NO_FLUSH:zse,Z_SYNC_FLUSH:jse,Z_FULL_FLUSH:Use,Z_FINISH:Vse,Z_OK:e1,Z_STREAM_END:Gse,Z_DEFAULT_COMPRESSION:qse,Z_DEFAULT_STRATEGY:Hse,Z_DEFLATED:Wse}=km;function DT(e){this.options=j_.assign({level:qse,method:Wse,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hse},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 yL,this.strm.avail_out=0;let n=wp.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==e1)throw new Error(Ff[n]);if(t.header&&wp.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=kg.string2buf(t.dictionary):vL.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=wp.deflateSetDictionary(this.strm,r),n!==e1)throw new Error(Ff[n]);this._dict_set=!0}}DT.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?Vse:zse,typeof e=="string"?n.input=kg.string2buf(e):vL.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===jse||o===Use)&&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===Gse)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===e1;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};DT.prototype.onData=function(e){this.chunks.push(e)};DT.prototype.onEnd=function(e){e===e1&&(this.result=j_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Ry=16209,Kse=16191;var Qse=function(t,n){let r,i,o,s,a,l,u,c,d,f,h,p,m,b,_,v,g,y,S,w,x,C,A,T;const P=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=P.dmax,u=P.wsize,c=P.whave,d=P.wnext,f=P.window,h=P.hold,p=P.bits,m=P.lencode,b=P.distcode,_=(1<<P.lenbits)-1,v=(1<<P.distbits)-1;e:do{p<15&&(h+=A[r++]<<p,p+=8,h+=A[r++]<<p,p+=8),g=m[h&_];t:for(;;){if(y=g>>>24,h>>>=y,p-=y,y=g>>>16&255,y===0)T[o++]=g&65535;else if(y&16){S=g&65535,y&=15,y&&(p<y&&(h+=A[r++]<<p,p+=8),S+=h&(1<<y)-1,h>>>=y,p-=y),p<15&&(h+=A[r++]<<p,p+=8,h+=A[r++]<<p,p+=8),g=b[h&v];n:for(;;){if(y=g>>>24,h>>>=y,p-=y,y=g>>>16&255,y&16){if(w=g&65535,y&=15,p<y&&(h+=A[r++]<<p,p+=8,p<y&&(h+=A[r++]<<p,p+=8)),w+=h&(1<<y)-1,w>l){t.msg="invalid distance too far back",P.mode=Ry;break e}if(h>>>=y,p-=y,y=o-s,w>y){if(y=w-y,y>c&&P.sane){t.msg="invalid distance too far back",P.mode=Ry;break e}if(x=0,C=f,d===0){if(x+=u-y,y<S){S-=y;do T[o++]=f[x++];while(--y);x=o-w,C=T}}else if(d<y){if(x+=u+d-y,y-=d,y<S){S-=y;do T[o++]=f[x++];while(--y);if(x=0,d<S){y=d,S-=y;do T[o++]=f[x++];while(--y);x=o-w,C=T}}}else if(x+=d-y,y<S){S-=y;do T[o++]=f[x++];while(--y);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(y&64){t.msg="invalid distance code",P.mode=Ry;break e}else{g=b[(g&65535)+(h&(1<<y)-1)];continue n}break}}else if(y&64)if(y&32){P.mode=Kse;break e}else{t.msg="invalid literal/length code",P.mode=Ry;break e}else{g=m[(g&65535)+(h&(1<<y)-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),P.hold=h,P.bits=p};const md=15,RP=852,IP=592,OP=0,W2=1,MP=2,Xse=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]),Yse=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]),Zse=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]),Jse=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]),eae=(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,v=0,g,y,S,w,x,C=null,A;const T=new Uint16Array(md+1),P=new Uint16Array(md+1);let L=null,R,E,k;for(u=0;u<=md;u++)T[u]=0;for(c=0;c<r;c++)T[t[n+c]]++;for(h=l,f=md;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<=md;u++)if(b<<=1,b-=T[u],b<0)return-1;if(b>0&&(e===OP||f!==1))return-1;for(P[1]=0,u=1;u<md;u++)P[u+1]=P[u]+T[u];for(c=0;c<r;c++)t[n+c]!==0&&(s[P[t[n+c]]++]=c);if(e===OP?(C=L=s,A=20):e===W2?(C=Xse,L=Yse,A=257):(C=Zse,L=Jse,A=0),v=0,c=0,u=d,x=o,p=h,m=0,S=-1,_=1<<h,w=_-1,e===W2&&_>RP||e===MP&&_>IP)return 1;for(;;){R=u-m,s[c]+1<A?(E=0,k=s[c]):s[c]>=A?(E=L[s[c]-A],k=C[s[c]-A]):(E=32+64,k=0),g=1<<u-m,y=1<<p,d=y;do y-=g,i[x+(v>>m)+y]=R<<24|E<<16|k|0;while(y!==0);for(g=1<<u-1;v&g;)g>>=1;if(g!==0?(v&=g-1,v+=g):v=0,c++,--T[u]===0){if(u===f)break;u=t[n+s[c]]}if(u>h&&(v&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===W2&&_>RP||e===MP&&_>IP)return 1;S=v&w,i[S]=h<<24|p<<16|x-o|0}}return v!==0&&(i[x+v]=u-m<<24|64<<16|0),a.bits=h,0};var xp=eae;const tae=0,_L=1,bL=2,{Z_FINISH:NP,Z_BLOCK:nae,Z_TREES:Iy,Z_OK:Mc,Z_STREAM_END:rae,Z_NEED_DICT:iae,Z_STREAM_ERROR:ns,Z_DATA_ERROR:SL,Z_MEM_ERROR:wL,Z_BUF_ERROR:oae,Z_DEFLATED:DP}=km,U_=16180,LP=16181,$P=16182,FP=16183,BP=16184,zP=16185,jP=16186,UP=16187,VP=16188,GP=16189,t1=16190,Ra=16191,K2=16192,qP=16193,Q2=16194,HP=16195,WP=16196,KP=16197,QP=16198,Oy=16199,My=16200,XP=16201,YP=16202,ZP=16203,JP=16204,e6=16205,X2=16206,t6=16207,n6=16208,Gn=16209,xL=16210,CL=16211,sae=852,aae=592,lae=15,uae=lae,r6=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function cae(){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<U_||t.mode>CL?1:0},EL=e=>{if(Qc(e))return ns;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=U_,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(sae),t.distcode=t.distdyn=new Int32Array(aae),t.sane=1,t.back=-1,Mc},TL=e=>{if(Qc(e))return ns;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,EL(e)},AL=(e,t)=>{let n;if(Qc(e))return ns;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ns:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,TL(e))},kL=(e,t)=>{if(!e)return ns;const n=new cae;e.state=n,n.strm=e,n.window=null,n.mode=U_;const r=AL(e,t);return r!==Mc&&(e.state=null),r},dae=e=>kL(e,uae);let i6=!0,Y2,Z2;const fae=e=>{if(i6){Y2=new Int32Array(512),Z2=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(_L,e.lens,0,288,Y2,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;xp(bL,e.lens,0,32,Z2,0,e.work,{bits:5}),i6=!1}e.lencode=Y2,e.lenbits=9,e.distcode=Z2,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},hae=(e,t)=>{let n,r,i,o,s,a,l,u,c,d,f,h,p,m,b=0,_,v,g,y,S,w,x,C;const A=new Uint8Array(4);let T,P;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 ns;n=e.state,n.mode===Ra&&(n.mode=K2),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=Mc;e:for(;;)switch(n.mode){case U_:if(n.wrap===0){n.mode=K2;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=Xr(n.check,A,2,0),u=0,c=0,n.mode=LP;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)!==DP){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?GP:Ra,u=0,c=0;break;case LP:for(;c<16;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(n.flags=u,(n.flags&255)!==DP){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=Xr(n.check,A,2,0)),u=0,c=0,n.mode=$P;case $P: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=Xr(n.check,A,4,0)),u=0,c=0,n.mode=FP;case FP: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=Xr(n.check,A,2,0)),u=0,c=0,n.mode=BP;case BP: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=Xr(n.check,A,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=zP;case zP: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=Xr(n.check,r,h,o)),a-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=jP;case jP: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=Xr(n.check,r,h,o)),a-=h,o+=h,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=UP;case UP: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=Xr(n.check,r,h,o)),a-=h,o+=h,x)break e}else n.head&&(n.head.comment=null);n.mode=VP;case VP: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=Ra;break;case GP:for(;c<32;){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}e.adler=n.check=r6(u),u=0,c=0,n.mode=t1;case t1: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,iae;e.adler=n.check=1,n.mode=Ra;case Ra:if(t===nae||t===Iy)break e;case K2:if(n.last){u>>>=c&7,c-=c&7,n.mode=X2;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=qP;break;case 1:if(fae(n),n.mode=Oy,t===Iy){u>>>=2,c-=2;break e}break;case 2:n.mode=WP;break;case 3:e.msg="invalid block type",n.mode=Gn}u>>>=2,c-=2;break;case qP: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=Q2,t===Iy)break e;case Q2:n.mode=HP;case HP: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=Ra;break;case WP: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=KP;case KP: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(tae,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=QP;case QP:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[u&(1<<n.lenbits)-1],_=b>>>24,v=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(P=_+2;c<P;){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(P=_+3;c<P;){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(P=_+7;c<P;){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(_L,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(bL,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=Oy,t===Iy)break e;case Oy:n.mode=My;case My: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,Qse(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===Ra&&(n.back=-1);break}for(n.back=0;b=n.lencode[u&(1<<n.lenbits)-1],_=b>>>24,v=b>>>16&255,g=b&65535,!(_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(v&&!(v&240)){for(y=_,S=v,w=g;b=n.lencode[w+((u&(1<<y+S)-1)>>y)],_=b>>>24,v=b>>>16&255,g=b&65535,!(y+_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=y,c-=y,n.back+=y}if(u>>>=_,c-=_,n.back+=_,n.length=g,v===0){n.mode=e6;break}if(v&32){n.back=-1,n.mode=Ra;break}if(v&64){e.msg="invalid literal/length code",n.mode=Gn;break}n.extra=v&15,n.mode=XP;case XP:if(n.extra){for(P=n.extra;c<P;){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=YP;case YP:for(;b=n.distcode[u&(1<<n.distbits)-1],_=b>>>24,v=b>>>16&255,g=b&65535,!(_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}if(!(v&240)){for(y=_,S=v,w=g;b=n.distcode[w+((u&(1<<y+S)-1)>>y)],_=b>>>24,v=b>>>16&255,g=b&65535,!(y+_<=c);){if(a===0)break e;a--,u+=r[o++]<<c,c+=8}u>>>=y,c-=y,n.back+=y}if(u>>>=_,c-=_,n.back+=_,v&64){e.msg="invalid distance code",n.mode=Gn;break}n.offset=g,n.extra=v&15,n.mode=ZP;case ZP:if(n.extra){for(P=n.extra;c<P;){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=JP;case JP: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=My);break;case e6:if(l===0)break e;i[s++]=n.length,l--,n.mode=My;break;case X2: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?Xr(n.check,i,f,s-f):Tg(n.check,i,f,s-f)),f=l,n.wrap&4&&(n.flags?u:r6(u))!==n.check){e.msg="incorrect data check",n.mode=Gn;break}u=0,c=0}n.mode=t6;case t6: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=n6;case n6:C=rae;break e;case Gn:C=SL;break e;case xL:return wL;case CL:default:return ns}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<X2||t!==NP))&&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?Xr(n.check,i,f,e.next_out-f):Tg(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Ra?128:0)+(n.mode===Oy||n.mode===Q2?256:0),(d===0&&f===0||t===NP)&&C===Mc&&(C=oae),C},pae=e=>{if(Qc(e))return ns;let t=e.state;return t.window&&(t.window=null),e.state=null,Mc},gae=(e,t)=>{if(Qc(e))return ns;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Mc):ns},mae=(e,t)=>{const n=t.length;let r,i,o;return Qc(e)||(r=e.state,r.wrap!==0&&r.mode!==t1)?ns:r.mode===t1&&(i=1,i=Tg(i,t,n,0),i!==r.check)?SL:(o=PL(e,t,n,n),o?(r.mode=xL,wL):(r.havedict=1,Mc))};var yae=TL,vae=AL,_ae=EL,bae=dae,Sae=kL,wae=hae,xae=pae,Cae=gae,Eae=mae,Tae="pako inflate (from Nodeca project)",Ua={inflateReset:yae,inflateReset2:vae,inflateResetKeep:_ae,inflateInit:bae,inflateInit2:Sae,inflate:wae,inflateEnd:xae,inflateGetHeader:Cae,inflateSetDictionary:Eae,inflateInfo:Tae};function Aae(){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 kae=Aae;const RL=Object.prototype.toString,{Z_NO_FLUSH:Pae,Z_FINISH:Rae,Z_OK:Pg,Z_STREAM_END:J2,Z_NEED_DICT:ew,Z_STREAM_ERROR:Iae,Z_DATA_ERROR:o6,Z_MEM_ERROR:Oae}=km;function Rm(e){this.options=j_.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 yL,this.strm.avail_out=0;let n=Ua.inflateInit2(this.strm,t.windowBits);if(n!==Pg)throw new Error(Ff[n]);if(this.header=new kae,Ua.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=kg.string2buf(t.dictionary):RL.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ua.inflateSetDictionary(this.strm,t.dictionary),n!==Pg)))throw new Error(Ff[n])}Rm.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?Rae:Pae,RL.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=Ua.inflate(n,s),o===ew&&i&&(o=Ua.inflateSetDictionary(n,i),o===Pg?o=Ua.inflate(n,s):o===o6&&(o=ew));n.avail_in>0&&o===J2&&n.state.wrap>0&&e[n.next_in]!==0;)Ua.inflateReset(n),o=Ua.inflate(n,s);switch(o){case Iae:case o6:case ew:case Oae:return this.onEnd(o),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(n.avail_out===0||o===J2))if(this.options.to==="string"){let l=kg.utf8border(n.output,n.next_out),u=n.next_out-l,c=kg.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===Pg&&a===0)){if(o===J2)return o=Ua.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Rm.prototype.onData=function(e){this.chunks.push(e)};Rm.prototype.onEnd=function(e){e===Pg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=j_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function LT(e,t){const n=new Rm(t);if(n.push(e),n.err)throw n.msg||Ff[n.err];return n.result}function Mae(e,t){return t=t||{},t.raw=!0,LT(e,t)}var Nae=Rm,Dae=LT,Lae=Mae,$ae=LT,Fae=km,Bae={Inflate:Nae,inflate:Dae,inflateRaw:Lae,ungzip:$ae,constants:Fae};const{Inflate:OIe,inflate:zae,inflateRaw:MIe,ungzip:NIe}=Bae;var IL=zae;const OL=[];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;OL[e]=t}function jae(e){let t=-1;for(let n=0;n<e.length;n++)t=OL[(t^e[n])&255]^t>>>8;return t^-1}var qn;(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"})(qn||(qn={}));const Uae={[qn.GRAYSCALE]:1,[qn.TRUE_COLOR]:3,[qn.PALETTE]:1,[qn.GRAYSCALE_WITH_ALPHA]:2,[qn.TRUE_COLOR_WITH_ALPHA]:4},Vae=1;var Eo;(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"})(Eo||(Eo={}));const Gae={[Eo.NONE](e){return e},[Eo.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},[Eo.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},[Eo.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},[Eo.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=ML(o,s,a);r[i]=e[i]+l}return r}};Eo.NONE+"",Eo.SUB+"",Eo.UP+"",Eo.AVERAGE+"",Eo.PAETH+"";function ML(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 Yr(e,t,n){if(t===n)return e;const r=2**t-1,i=2**n-1;return Math.round(e*i/r)}function qae(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 NL=[{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 Hae(e,t,n){if(!e)return[{passWidth:t,passHeight:n,passIndex:0}];const r=[];return NL.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 Wae(e,t,n,r,i){if(!e)return t*i+r<<2;const o=NL[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 Kae(e,t,n,r,i,o,s,a){let l=[];const u=IL(e),c=Hae(t,r,i),f=Uae[n]*o,h=f>>3||1;let p=0,m=new Uint8Array;for(let b=0;b<c.length;b++){const{passWidth:_,passHeight:v,passIndex:g}=c[b];for(let y=0;y<v;y++){let P=function(){if(n===qn.GRAYSCALE){const L=Yr(T[A++],o,8);return[L,L,L,255]}if(n===qn.TRUE_COLOR)return[Yr(T[A++],o,8),Yr(T[A++],o,8),Yr(T[A++],o,8),255];if(n===qn.PALETTE){const L=T[A++];if(!s)throw new Error("Mising chunk: PLTE");return s[L]}if(n===qn.GRAYSCALE_WITH_ALPHA){const L=Yr(T[A++],o,8);return[L,L,L,Yr(T[A++],o,8)]}if(n===qn.TRUE_COLOR_WITH_ALPHA)return[Yr(T[A++],o,8),Yr(T[A++],o,8),Yr(T[A++],o,8),Yr(T[A++],o,8)];throw new Error("Unsupported color type: "+n)};const S=(_*f+7>>3)+Vae,w=u[p];if(!(w in Eo))throw new Error("Unsupported filter type: "+w);const x=Gae[w],C=x(u.slice(p+1,p+S),h,m);m=C;let A=0;const T=qae(C,o);for(let L=0;L<_;L++){const R=P();a&&R[0]===a[0]&&R[1]===a[1]&&R[2]===a[2]&&(R[3]=0);const E=Wae(t,r,g,L,y);for(let k=0;k<R.length;k++)l[E+k]=R[k]}p+=S}}return l}const tw=[137,80,78,71,13,10,26,10],Qae=1e5;function nw(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 Xae(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}const wl=1e5;function Yae(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 O=[];let I=0;for(;(I=t[i++])!==0;)O.push(I);return new Uint8Array(O)}function u(O){const I=i+O;let N="";for(;i<I;){const B=a();if(B===0)break;N+=String.fromCharCode(B)}return N}function c(O){let I="";for(;i<O;){const N=a();I+=String.fromCharCode(N)}return I}function d(O){const I=t.slice(i,O);return i=O,IL(I)}function f(){let O="";for(const I=i+4;i<I;i++)O+=String.fromCharCode(t[i]);return O}for(;i<tw.length;i++)if(t[i]!==tw[i])throw new Error(`Invalid file signature, at position ${i}: ${t[i]} !== ${tw[i]}`);const h={IHDR:p,PLTE:m,IDAT:b,IEND:_,tRNS:v,cHRM:g,gAMA:y,iCCP:S,sBIT:w,sRGB:x,tEXt:C,zTXt:A,iTXt:T,bKGD:P,hIST:L,pHYs:R,sPLT:E,tIME:k};function p(){r.width=o(),r.height=o(),r.depth=a();const O=a();if(!(O in qn))throw new Error("Unsupported color type: "+O);r.colorType=O,r.compression=a(),r.filter=a(),r.interlace=a()}function m(O){const I=[];for(let N=0;N<O;N+=3)I.push([t[i++],t[i++],t[i++],255]);r.palette=I}function b(O){n=Xae(n,t.slice(i,i+O)),i+=O}function _(O){i+=O}function v(O){if(r.colorType===qn.GRAYSCALE){const I=Yr(t[i++]<<8|t[i++],r.depth,8);r.transparent=[I,I,I,255]}else if(r.colorType===qn.TRUE_COLOR)r.transparent=[Yr(t[i++]<<8|t[i++],r.depth,8),Yr(t[i++]<<8|t[i++],r.depth,8),Yr(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===qn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");for(let I=0;I<O;I++)r.palette[I][3]=t[i++]}}function g(){r.chromaticities={white:{x:o()/wl,y:o()/wl},red:{x:o()/wl,y:o()/wl},green:{x:o()/wl,y:o()/wl},blue:{x:o()/wl,y:o()/wl}}}function y(){r.gamma=o()/Qae}function S(O){const I=i+O,N=u(80);a();const B=d(I);r.icc={name:N,profile:Array.from(B)}}function w(){if(r.colorType===qn.GRAYSCALE){const O=a();r.significantBits=[O,O,O,r.depth]}else if(r.colorType===qn.TRUE_COLOR||r.colorType===qn.PALETTE)r.significantBits=[a(),a(),a(),r.depth];else if(r.colorType===qn.GRAYSCALE_WITH_ALPHA){const O=a();r.significantBits=[O,O,O,a()]}else r.colorType===qn.TRUE_COLOR_WITH_ALPHA&&(r.significantBits=[a(),a(),a(),a()])}function x(){r.sRGB=a()}function C(O){const I=i+O,N=u(80),B=c(I);r.text||(r.text={}),r.text[N]=B}function A(O){const I=i+O,N=u(80);a();const B=d(I);let U="";for(let G=0;G<B.length;G++)U+=String.fromCharCode(B[G]);r.compressedText||(r.compressedText={}),r.compressedText[N]=U}function T(O){const I=i+O,N=u(80),B=a();a();const U=u(1/0),G=nw(l());let Q="";if(B===0)Q=nw(t.slice(i,I)),i=I;else{const Z=d(I);Q=nw(Z)}r.internationalText||(r.internationalText={}),r.internationalText[N]={languageTag:U,translatedKeyword:G,text:Q}}function P(){if((r.colorType&3)===qn.GRAYSCALE){const O=Yr(t[i++]<<8|t[i++],r.depth,8);r.background=[O,O,O,255]}else if((r.colorType&3)===qn.TRUE_COLOR)r.background=[Yr(t[i++]<<8|t[i++],r.depth,8),Yr(t[i++]<<8|t[i++],r.depth,8),Yr(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===qn.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");r.background=r.palette[t[i++]]}}function L(O){const I=i+O,N=[];for(;i<I;)N.push(s());r.histogram=N}function R(){const O=o(),I=o(),N=a();r.physicalDimensions={pixelPerUnitX:O,pixelPerUnitY:I,unit:N}}function E(O){const I=i+O,N=u(80),B=a(),U=[];if(B===8)for(;i<I;)U.push([a(),a(),a(),a(),s()]);else if(B===16)for(;i<I;)U.push([s(),s(),s(),s(),s()]);r.suggestedPalette={name:N,depth:B,palette:U}}function k(){const O=s(),I=a(),N=a(),B=a(),U=a(),G=a();r.lastModificationTime=Date.UTC(O,I-1,N,B,U,G)}function D(){const O=i,I=o(),N=f();h[N]?h[N](I):(N.charCodeAt(0)&32,i+=I),$(O,I)}function $(O,I){const N=o(),B=jae(t.slice(O+4,O+8+I));if(N!==B)throw new Error("Crc32 error: calculated "+B+", expected "+N);i<t.length&&D()}return D(),r.data=Kae(n,r.interlace,r.colorType,r.width,r.height,r.depth,r.palette,r.transparent),r}var DL={},V_={},G_={};Object.defineProperty(G_,"__esModule",{value:!0});G_.createLogMethods=void 0;var Zae=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)}};G_.createLogMethods=Zae;var $T={},q_={};Object.defineProperty(q_,"__esModule",{value:!0});q_.boolean=void 0;const Jae=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}};q_.boolean=Jae;var H_={};Object.defineProperty(H_,"__esModule",{value:!0});H_.isBooleanable=void 0;const ele=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}};H_.isBooleanable=ele;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=q_;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=H_;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})($T);var s6=Object.prototype.toString,LL=function(t){var n=s6.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&s6.call(t.callee)==="[object Function]"),r},rw,a6;function tle(){if(a6)return rw;a6=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=LL,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]",v=[];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 y=0;y<h.length;++y)v.push(String(y));if(b&&h.length>0)for(var S=0;S<h.length;++S)v.push(String(S));else for(var w in h)!(g&&w==="prototype")&&t.call(h,w)&&v.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])&&v.push(a[C]);return v}}return rw=e,rw}var nle=Array.prototype.slice,rle=LL,l6=Object.keys,M0=l6?function(t){return l6(t)}:tle(),u6=Object.keys;M0.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 rle(r)?u6(nle.call(r)):u6(r)})}else Object.keys=M0;return Object.keys||M0};var ile=M0,ole=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},c6=typeof Symbol<"u"&&Symbol,sle=ole,ale=function(){return typeof c6!="function"||typeof Symbol!="function"||typeof c6("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sle()},d6={foo:{}},lle=Object,ule=function(){return{__proto__:d6}.foo===d6.foo&&!({__proto__:null}instanceof lle)},cle="Function.prototype.bind called on incompatible ",iw=Array.prototype.slice,dle=Object.prototype.toString,fle="[object Function]",hle=function(t){var n=this;if(typeof n!="function"||dle.call(n)!==fle)throw new TypeError(cle+n);for(var r=iw.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(iw.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(iw.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},ple=hle,$L=Function.prototype.bind||ple,gle=$L,mle=gle.call(Function.call,Object.prototype.hasOwnProperty),It,jf=SyntaxError,FL=Function,ff=TypeError,ow=function(e){try{return FL('"use strict"; return ('+e+").constructor;")()}catch{}},_c=Object.getOwnPropertyDescriptor;if(_c)try{_c({},"")}catch{_c=null}var sw=function(){throw new ff},yle=_c?function(){try{return arguments.callee,sw}catch{try{return _c(arguments,"callee").get}catch{return sw}}}():sw,yd=ale(),vle=ule(),Qr=Object.getPrototypeOf||(vle?function(e){return e.__proto__}:null),Pd={},_le=typeof Uint8Array>"u"||!Qr?It:Qr(Uint8Array),bc={"%AggregateError%":typeof AggregateError>"u"?It:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?It:ArrayBuffer,"%ArrayIteratorPrototype%":yd&&Qr?Qr([][Symbol.iterator]()):It,"%AsyncFromSyncIteratorPrototype%":It,"%AsyncFunction%":Pd,"%AsyncGenerator%":Pd,"%AsyncGeneratorFunction%":Pd,"%AsyncIteratorPrototype%":Pd,"%Atomics%":typeof Atomics>"u"?It:Atomics,"%BigInt%":typeof BigInt>"u"?It:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?It:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?It:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?It:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?It:Float32Array,"%Float64Array%":typeof Float64Array>"u"?It:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?It:FinalizationRegistry,"%Function%":FL,"%GeneratorFunction%":Pd,"%Int8Array%":typeof Int8Array>"u"?It:Int8Array,"%Int16Array%":typeof Int16Array>"u"?It:Int16Array,"%Int32Array%":typeof Int32Array>"u"?It:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yd&&Qr?Qr(Qr([][Symbol.iterator]())):It,"%JSON%":typeof JSON=="object"?JSON:It,"%Map%":typeof Map>"u"?It:Map,"%MapIteratorPrototype%":typeof Map>"u"||!yd||!Qr?It:Qr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?It:Promise,"%Proxy%":typeof Proxy>"u"?It:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?It:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?It:Set,"%SetIteratorPrototype%":typeof Set>"u"||!yd||!Qr?It:Qr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?It:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yd&&Qr?Qr(""[Symbol.iterator]()):It,"%Symbol%":yd?Symbol:It,"%SyntaxError%":jf,"%ThrowTypeError%":yle,"%TypedArray%":_le,"%TypeError%":ff,"%Uint8Array%":typeof Uint8Array>"u"?It:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?It:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?It:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?It:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?It:WeakMap,"%WeakRef%":typeof WeakRef>"u"?It:WeakRef,"%WeakSet%":typeof WeakSet>"u"?It:WeakSet};if(Qr)try{null.error}catch(e){var ble=Qr(Qr(e));bc["%Error.prototype%"]=ble}var Sle=function e(t){var n;if(t==="%AsyncFunction%")n=ow("async function () {}");else if(t==="%GeneratorFunction%")n=ow("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ow("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 bc[t]=n,n},f6={"%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"]},Im=$L,n1=mle,wle=Im.call(Function.call,Array.prototype.concat),xle=Im.call(Function.apply,Array.prototype.splice),h6=Im.call(Function.call,String.prototype.replace),r1=Im.call(Function.call,String.prototype.slice),Cle=Im.call(Function.call,RegExp.prototype.exec),Ele=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Tle=/\\(\\)?/g,Ale=function(t){var n=r1(t,0,1),r=r1(t,-1);if(n==="%"&&r!=="%")throw new jf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new jf("invalid intrinsic syntax, expected opening `%`");var i=[];return h6(t,Ele,function(o,s,a,l){i[i.length]=a?h6(l,Tle,"$1"):s||o}),i},kle=function(t,n){var r=t,i;if(n1(f6,r)&&(i=f6[r],r="%"+i[0]+"%"),n1(bc,r)){var o=bc[r];if(o===Pd&&(o=Sle(r)),typeof o>"u"&&!n)throw new ff("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new jf("intrinsic "+t+" does not exist!")},Ple=function(t,n){if(typeof t!="string"||t.length===0)throw new ff("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new ff('"allowMissing" argument must be a boolean');if(Cle(/^%?[^%]*%?$/,t)===null)throw new jf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Ale(t),i=r.length>0?r[0]:"",o=kle("%"+i+"%",n),s=o.name,a=o.value,l=!1,u=o.alias;u&&(i=u[0],xle(r,wle([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=r1(f,0,1),p=r1(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new jf("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,s="%"+i+"%",n1(bc,s))a=bc[s];else if(a!=null){if(!(f in a)){if(!n)throw new ff("base intrinsic for "+t+" exists, but the property is not available.");return}if(_c&&c+1>=r.length){var m=_c(a,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[f]}else d=n1(a,f),a=a[f];d&&!l&&(bc[s]=a)}}return a},Rle=Ple,OC=Rle("%Object.defineProperty%",!0),MC=function(){if(OC)try{return OC({},"a",{value:1}),!0}catch{return!1}return!1};MC.hasArrayLengthDefineBug=function(){if(!MC())return null;try{return OC([],"length",{value:1}).length!==1}catch{return!0}};var Ile=MC,Ole=ile,Mle=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Nle=Object.prototype.toString,Dle=Array.prototype.concat,BL=Object.defineProperty,Lle=function(e){return typeof e=="function"&&Nle.call(e)==="[object Function]"},$le=Ile(),zL=BL&&$le,Fle=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!Lle(r)||!r())return}zL?BL(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},jL=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Ole(t);Mle&&(r=Dle.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)Fle(e,r[i],t[r[i]],n[r[i]])};jL.supportsDescriptors=!!zL;var UL=jL,N0={exports:{}};typeof self<"u"?N0.exports=self:typeof window<"u"?N0.exports=window:N0.exports=Function("return this")();var VL=N0.exports,Ble=VL,GL=function(){return typeof ft!="object"||!ft||ft.Math!==Math||ft.Array!==Array?Ble:ft},zle=UL,jle=GL,Ule=function(){var t=jle();if(zle.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},Vle=UL,Gle=VL,qL=GL,qle=Ule,Hle=qL(),HL=function(){return Hle};Vle(HL,{getPolyfill:qL,implementation:Gle,shim:qle});var FT=HL,WL={},Om={},BT={},W_={},K_={};Object.defineProperty(K_,"__esModule",{value:!0});K_.convertWildcardToRegex=void 0;var Wle=/\*+/g,Kle=function(e){return new RegExp(e.replace(Wle,"(.+?)"))};K_.convertWildcardToRegex=Kle;var Mm={};Object.defineProperty(Mm,"__esModule",{value:!0});Mm.escapeRegexString=void 0;var Qle=/[$()*+.?[\\\]^{|}]/g,Xle=/-/g,Yle=function(e){return e.replace(Qle,"\\$&").replace(Xle,"\\x2d")};Mm.escapeRegexString=Yle;var Q_={};Object.defineProperty(Q_,"__esModule",{value:!0});Q_.parseRegex=void 0;var Zle=/(\/?)(.+)\1([a-z]*)/,Jle=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,eue=function(e){var t=Zle.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!Jle.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};Q_.parseRegex=eue;Object.defineProperty(W_,"__esModule",{value:!0});W_.createStringTest=void 0;var tue=K_,nue=Mm,rue=Q_,aw=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,rue.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}},iue=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 aw(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?aw(e,String((0,tue.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):aw(e,"/("+(0,nue.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};W_.createStringTest=iue;var X_={};Object.defineProperty(X_,"__esModule",{value:!0});X_.testComparisonRange=void 0;var oue=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))}};X_.testComparisonRange=oue;var Y_={};Object.defineProperty(Y_,"__esModule",{value:!0});Y_.testRange=void 0;var sue=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};Y_.testRange=sue;(function(e){var t=ft&&ft.__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=ft&&ft.__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=W_,i=X_,o=Y_,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,v=d;_<v.length;_++){var g=v[_];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 y in d)if(a(c,d[y],f,n(n([],h,!0),[y],!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,v=0,g=d.field.path;v<g.length;v++){var y=g[v];if(typeof _!="object"||_===null)return!1;if(y in _)_=_[y];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(v){return l(v,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(v){return!m.includes(v)})}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})(BT);Object.defineProperty(Om,"__esModule",{value:!0});Om.filter=void 0;var aue=BT,lue=function(e,t){return(0,aue.internalFilter)(e,t)};Om.filter=lue;var Z_={};Object.defineProperty(Z_,"__esModule",{value:!0});Z_.highlight=void 0;var uue=Mm,cue=BT,due=function(e,t){var n=[];(0,cue.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,uue.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};Z_.highlight=due;var J_={},KL={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(ft,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 v=p.rule.name;(this.completed[v]=this.completed[v]||[]).push(p)}}}else{var v=p.rule.symbols[p.dot];if(typeof v!="string"){this.scannable.push(p);continue}if(d[v]){if(d[v].push(p),f.hasOwnProperty(v))for(var g=f[v],b=0;b<g.length;b++){var y=g[b];this.complete(p,y)}}else d[v]=[p],this.predict(v)}}},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(_,v){return b(this.line-f.length+v+1,m)+" "+_},this).join(`
|
||
`),c+=`
|
||
`+b("",m+p)+`^
|
||
`,c}else return c+" at index "+(this.index-1);function b(_,v){var g=String(_);return Array(v-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,v=h.scannable,g=v.length;g--;){var y=v[g],S=y.rule.symbols[y.dot];if(S.test?S.test(_):S.type?S.type===d.type:S.literal===b){var w=y.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],v=_.rule.symbols[_.dot],g=this.getSymbolDisplay(v);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}})})(KL);var fue=KL.exports,Nc={},QL={},Ru={};Ru.__esModule=void 0;Ru.__esModule=!0;var hue=typeof Object.setPrototypeOf=="function",pue=typeof Object.getPrototypeOf=="function",gue=typeof Object.defineProperty=="function",mue=typeof Object.create=="function",yue=typeof Object.prototype.hasOwnProperty=="function",vue=function(t,n){hue?Object.setPrototypeOf(t,n):t.__proto__=n};Ru.setPrototypeOf=vue;var _ue=function(t){return pue?Object.getPrototypeOf(t):t.__proto__||t.prototype};Ru.getPrototypeOf=_ue;var p6=!1,bue=function e(t,n,r){if(gue&&!p6)try{Object.defineProperty(t,n,r)}catch{p6=!0,e(t,n,r)}else t[n]=r.value};Ru.defineProperty=bue;var XL=function(t,n){return yue?t.hasOwnProperty(t,n):t[n]===void 0};Ru.hasOwnProperty=XL;var Sue=function(t,n){if(mue)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)XL(n,o)&&(i[o]=n[o].value);return i};Ru.objectCreate=Sue;(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})(QL);var YL=ft&&ft.__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(Nc,"__esModule",{value:!0});Nc.SyntaxError=Nc.LiqeError=void 0;var wue=QL,ZL=function(e){YL(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(wue.ExtendableError);Nc.LiqeError=ZL;var xue=function(e){YL(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}(ZL);Nc.SyntaxError=xue;var zT={},i1=ft&&ft.__assign||function(){return i1=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},i1.apply(this,arguments)};Object.defineProperty(zT,"__esModule",{value:!0});function Ia(e){return e[0]}var Cue={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:Ia},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:Ia},{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:Ia},{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:Ia},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:Ia},{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:Ia},{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:Ia},{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:Ia},{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,i1({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 i1({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:Ia},{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"};zT.default=Cue;var JL={},eb={},Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});Nm.isSafePath=void 0;var Eue=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Tue=function(e){return Eue.test(e)};Nm.isSafePath=Tue;Object.defineProperty(eb,"__esModule",{value:!0});eb.createGetValueFunctionBody=void 0;var Aue=Nm,kue=function(e){if(!(0,Aue.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};eb.createGetValueFunctionBody=kue;(function(e){var t=ft&&ft.__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=eb,r=Nm,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})(JL);var e$=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(J_,"__esModule",{value:!0});J_.parse=void 0;var t$=e$(fue),Pue=Nc,Rue=e$(zT),Iue=JL,Oue=t$.default.Grammar.fromCompiled(Rue.default),Mue=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,Nue=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new t$.default.Parser(Oue),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(Mue);throw r?new Pue.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,Iue.hydrateAst)(n[0]);return i};J_.parse=Nue;var tb={};Object.defineProperty(tb,"__esModule",{value:!0});tb.test=void 0;var Due=Om,Lue=function(e,t){return(0,Due.filter)(e,[t]).length===1};tb.test=Lue;var n$={};(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})(n$);var nb={};Object.defineProperty(nb,"__esModule",{value:!0});nb.isSafeUnquotedExpression=void 0;var $ue=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};nb.isSafeUnquotedExpression=$ue;(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=Om;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=Z_;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=J_;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=tb;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Nc;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var s=n$;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return s.serialize}});var a=nb;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return a.isSafeUnquotedExpression}})})(WL);var Dm={},r$={},Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.ROARR_LOG_FORMAT_VERSION=Dc.ROARR_VERSION=void 0;Dc.ROARR_VERSION="5.0.0";Dc.ROARR_LOG_FORMAT_VERSION="2.0.0";var Lm={};Object.defineProperty(Lm,"__esModule",{value:!0});Lm.logLevels=void 0;Lm.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var i$={},rb={};Object.defineProperty(rb,"__esModule",{value:!0});rb.hasOwnProperty=void 0;const Fue=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);rb.hasOwnProperty=Fue;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=rb;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(i$);var o$={},ib={},ob={};Object.defineProperty(ob,"__esModule",{value:!0});ob.tokenize=void 0;const Bue=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,zue=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=Bue.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};ob.tokenize=zue;Object.defineProperty(ib,"__esModule",{value:!0});ib.createPrintf=void 0;const g6=$T,jue=ob,Uue=(e,t)=>t.placeholder,Vue=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:Uue,i={};return(o,...s)=>{let a=i[o];a||(a=i[o]=jue.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+=g6.boolean(c)?"true":"false";else if(u.conversion==="B")l+=g6.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}};ib.createPrintf=Vue;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=ib;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(o$);var NC={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 v=1;v<_.length;v++){const g=_[v];let y=v;for(;y!==0&&_[y-1]>g;)_[y]=_[y-1],y--;_[y]=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(_,v,g){_.length<g&&(g=_.length);const y=v===","?"":" ";let S=`"0":${y}${_[0]}`;for(let w=1;w<g;w++)S+=`${v}"${w}":${y}${_[w]}`;return S}function c(_){if(n.call(_,"circularValue")){const v=_.circularValue;if(typeof v=="string")return`"${v}"`;if(v==null)return v;if(v===Error||v===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(_,v){let g;if(n.call(_,v)&&(g=_[v],typeof g!="boolean"))throw new TypeError(`The "${v}" argument must be of type boolean`);return g===void 0?!0:g}function f(_,v){let g;if(n.call(_,v)){if(g=_[v],typeof g!="number")throw new TypeError(`The "${v}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${v}" argument must be an integer`);if(g<1)throw new RangeError(`The "${v}" argument must be >= 1`)}return g===void 0?1/0:g}function h(_){return _===1?"1 item":`${_} items`}function p(_){const v=new Set;for(const g of _)(typeof g=="string"||typeof g=="number")&&v.add(String(g));return v}function m(_){if(n.call(_,"strict")){const v=_.strict;if(typeof v!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(v)return g=>{let y=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(y+=` (${g.toString()})`),new Error(y)}}}function b(_){_={..._};const v=m(_);v&&(_.bigint===void 0&&(_.bigint=!1),"circularValue"in _||(_.circularValue=Error));const g=c(_),y=d(_,"bigint"),S=d(_,"deterministic"),w=f(_,"maximumDepth"),x=f(_,"maximumBreadth");function C(R,E,k,D,$,O){let I=E[R];switch(typeof I=="object"&&I!==null&&typeof I.toJSON=="function"&&(I=I.toJSON(R)),I=D.call(E,R,I),typeof I){case"string":return o(I);case"object":{if(I===null)return"null";if(k.indexOf(I)!==-1)return g;let N="",B=",";const U=O;if(Array.isArray(I)){if(I.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(I),$!==""&&(O+=$,N+=`
|
||
${O}`,B=`,
|
||
${O}`);const W=Math.min(I.length,x);let te=0;for(;te<W-1;te++){const ye=C(String(te),I,k,D,$,O);N+=ye!==void 0?ye:"null",N+=B}const oe=C(String(te),I,k,D,$,O);if(N+=oe!==void 0?oe:"null",I.length-1>x){const ye=I.length-x-1;N+=`${B}"... ${h(ye)} not stringified"`}return $!==""&&(N+=`
|
||
${U}`),k.pop(),`[${N}]`}let G=Object.keys(I);const Q=G.length;if(Q===0)return"{}";if(w<k.length+1)return'"[Object]"';let Z="",Y="";$!==""&&(O+=$,B=`,
|
||
${O}`,Z=" ");const j=Math.min(Q,x);S&&!l(I)&&(G=s(G)),k.push(I);for(let W=0;W<j;W++){const te=G[W],oe=C(te,I,k,D,$,O);oe!==void 0&&(N+=`${Y}${o(te)}:${Z}${oe}`,Y=B)}if(Q>x){const W=Q-x;N+=`${Y}"...":${Z}"${h(W)} not stringified"`,Y=B}return $!==""&&Y.length>1&&(N=`
|
||
${O}${N}
|
||
${U}`),k.pop(),`{${N}}`}case"number":return isFinite(I)?String(I):v?v(I):"null";case"boolean":return I===!0?"true":"false";case"undefined":return;case"bigint":if(y)return String(I);default:return v?v(I):void 0}}function A(R,E,k,D,$,O){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(R)),typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(k.indexOf(E)!==-1)return g;const I=O;let N="",B=",";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(E),$!==""&&(O+=$,N+=`
|
||
${O}`,B=`,
|
||
${O}`);const Q=Math.min(E.length,x);let Z=0;for(;Z<Q-1;Z++){const j=A(String(Z),E[Z],k,D,$,O);N+=j!==void 0?j:"null",N+=B}const Y=A(String(Z),E[Z],k,D,$,O);if(N+=Y!==void 0?Y:"null",E.length-1>x){const j=E.length-x-1;N+=`${B}"... ${h(j)} not stringified"`}return $!==""&&(N+=`
|
||
${I}`),k.pop(),`[${N}]`}k.push(E);let U="";$!==""&&(O+=$,B=`,
|
||
${O}`,U=" ");let G="";for(const Q of D){const Z=A(Q,E[Q],k,D,$,O);Z!==void 0&&(N+=`${G}${o(Q)}:${U}${Z}`,G=B)}return $!==""&&G.length>1&&(N=`
|
||
${O}${N}
|
||
${I}`),k.pop(),`{${N}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(y)return String(E);default:return v?v(E):void 0}}function T(R,E,k,D,$){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(R),typeof E!="object")return T(R,E,k,D,$);if(E===null)return"null"}if(k.indexOf(E)!==-1)return g;const O=$;if(Array.isArray(E)){if(E.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(E),$+=D;let Z=`
|
||
${$}`;const Y=`,
|
||
${$}`,j=Math.min(E.length,x);let W=0;for(;W<j-1;W++){const oe=T(String(W),E[W],k,D,$);Z+=oe!==void 0?oe:"null",Z+=Y}const te=T(String(W),E[W],k,D,$);if(Z+=te!==void 0?te:"null",E.length-1>x){const oe=E.length-x-1;Z+=`${Y}"... ${h(oe)} not stringified"`}return Z+=`
|
||
${O}`,k.pop(),`[${Z}]`}let I=Object.keys(E);const N=I.length;if(N===0)return"{}";if(w<k.length+1)return'"[Object]"';$+=D;const B=`,
|
||
${$}`;let U="",G="",Q=Math.min(N,x);l(E)&&(U+=u(E,B,x),I=I.slice(E.length),Q-=E.length,G=B),S&&(I=s(I)),k.push(E);for(let Z=0;Z<Q;Z++){const Y=I[Z],j=T(Y,E[Y],k,D,$);j!==void 0&&(U+=`${G}${o(Y)}: ${j}`,G=B)}if(N>x){const Z=N-x;U+=`${G}"...": "${h(Z)} not stringified"`,G=B}return G!==""&&(U=`
|
||
${$}${U}
|
||
${O}`),k.pop(),`{${U}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(y)return String(E);default:return v?v(E):void 0}}function P(R,E,k){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(R),typeof E!="object")return P(R,E,k);if(E===null)return"null"}if(k.indexOf(E)!==-1)return g;let D="";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<k.length+1)return'"[Array]"';k.push(E);const B=Math.min(E.length,x);let U=0;for(;U<B-1;U++){const Q=P(String(U),E[U],k);D+=Q!==void 0?Q:"null",D+=","}const G=P(String(U),E[U],k);if(D+=G!==void 0?G:"null",E.length-1>x){const Q=E.length-x-1;D+=`,"... ${h(Q)} not stringified"`}return k.pop(),`[${D}]`}let $=Object.keys(E);const O=$.length;if(O===0)return"{}";if(w<k.length+1)return'"[Object]"';let I="",N=Math.min(O,x);l(E)&&(D+=u(E,",",x),$=$.slice(E.length),N-=E.length,I=","),S&&($=s($)),k.push(E);for(let B=0;B<N;B++){const U=$[B],G=P(U,E[U],k);G!==void 0&&(D+=`${I}${o(U)}:${G}`,I=",")}if(O>x){const B=O-x;D+=`${I}"...":"${h(B)} not stringified"`}return k.pop(),`{${D}}`}case"number":return isFinite(E)?String(E):v?v(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(y)return String(E);default:return v?v(E):void 0}}function L(R,E,k){if(arguments.length>1){let D="";if(typeof k=="number"?D=" ".repeat(Math.min(k,10)):typeof k=="string"&&(D=k.slice(0,10)),E!=null){if(typeof E=="function")return C("",{"":R},[],E,D,"");if(Array.isArray(E))return A("",R,[],p(E),D,"")}if(D.length!==0)return T("",R,[],D,"")}return P("",R,[])}return L}})(NC,NC.exports);var Gue=NC.exports;(function(e){var t=ft&&ft.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=Dc,r=Lm,i=i$,o=o$,s=t(FT),a=t(Gue);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 y=g.getStore();return y||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,y)=>(S,w,x,C,A,T,P,L,R,E)=>{g.child({logLevel:y})(S,w,x,C,A,T,P,L,R,E)},b=1e3,_=(g,y)=>(S,w,x,C,A,T,P,L,R,E)=>{const k=(0,a.default)({a:S,b:w,c:x,d:C,e:A,f:T,g:P,h:L,i:R,j:E,logLevel:y});if(!k)throw new Error("Expected key to be a string");const D=c().onceLog;D.has(k)||(D.add(k),D.size>b&&D.clear(),g.child({logLevel:y})(S,w,x,C,A,T,P,L,R,E))},v=(g,y={},S=[])=>{const w=(x,C,A,T,P,L,R,E,k,D)=>{const $=Date.now(),O=p();let I;h()?I=f():I=d();let N,B;if(typeof x=="string"?N={...I.messageContext,...y}:N={...I.messageContext,...y,...x},typeof x=="string"&&C===void 0)B=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.");B=(0,o.printf)(x,C,A,T,P,L,R,E,k,D)}else{let G=C;if(typeof C!="string")if(C===void 0)G="";else throw new TypeError("Message must be a string. Received "+typeof C+".");B=(0,o.printf)(G,A,T,P,L,R,E,k,D)}let U={context:N,message:B,sequence:O,time:$,version:n.ROARR_LOG_FORMAT_VERSION};for(const G of[...I.transforms,...S])if(U=G(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,...y,...x},[x,...S]):(0,e.createLogger)(g,{...C.messageContext,...y,...x},S)},w.getContext=()=>{let x;return h()?x=f():x=d(),{...x.messageContext,...y}},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 P={...A.messageContext};const L=[...A.transforms];typeof C=="function"?L.push(C):P={...P,...C};const R=c().asyncLocalStorage;if(!R)throw new Error("Async local context unavailable.");return R.run({messageContext:P,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=v})(r$);var sb={},que=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},Hue=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sb,"__esModule",{value:!0});sb.createRoarrInitialGlobalStateBrowser=void 0;const m6=Dc,y6=Hue(que),Wue=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(y6.default),t.includes(m6.ROARR_VERSION)||t.push(m6.ROARR_VERSION),t.sort(y6.default),{sequence:0,...e,versions:t}};sb.createRoarrInitialGlobalStateBrowser=Wue;var ab={};Object.defineProperty(ab,"__esModule",{value:!0});ab.getLogLevelName=void 0;const Kue=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";ab.getLogLevelName=Kue;(function(e){var t=ft&&ft.__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=r$,r=sb,o=(0,t(FT).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=Lm;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var c=ab;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return c.getLogLevelName}})})(Dm);var Que=ft&&ft.__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},Xue=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V_,"__esModule",{value:!0});V_.createLogWriter=void 0;var Yue=G_,Zue=$T,Jue=Xue(FT),s$=WL,ece=Dm,v6=(0,Jue.default)(),tce={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"}},nce={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},rce=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,s$.parse)(t):null},ice=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:v6.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,Yue.createLogMethods)();if(!r&&!v6.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,Zue.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=rce(r);return function(s){var a=JSON.parse(s),l=a.context,u=l.logLevel,c=l.namespace,d=Que(l,["logLevel","namespace"]);if(!(o&&!(0,s$.test)(o,a))){var f=(0,ece.getLogLevelName)(Number(u)),h=i[f],p=tce[f],m=`
|
||
background-color: `.concat(p.backgroundColor,`;
|
||
color: `).concat(p.color,`;
|
||
font-weight: bold;
|
||
`),b=`
|
||
color: `.concat(nce[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,_)}}};V_.createLogWriter=ice;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=V_;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(DL);Dm.ROARR.write=DL.createLogWriter();const a$={};Dm.Roarr.child(a$);const lb=xa(Dm.Roarr.child(a$)),pe=e=>lb.get().child({namespace:e}),DIe=["trace","debug","info","warn","error","fatal"],LIe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},$t=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},oce=async e=>{const t={},n=await e.arrayBuffer(),r=Yae(n).text,i=Mv(r,"invokeai_metadata");if(i){const s=GD.safeParse(JSON.parse(i));s.success?t.metadata=s.data:pe("system").error({error:$t(s.error)},"Problem reading metadata from image")}const o=Mv(r,"invokeai_workflow");if(o){const s=QD.safeParse(JSON.parse(o));s.success?t.workflow=s.data:pe("system").error({error:$t(s.error)},"Problem reading workflow from image")}return t};var o1=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}}},s1=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},sce=Object.defineProperty,ace=Object.defineProperties,lce=Object.getOwnPropertyDescriptors,a1=Object.getOwnPropertySymbols,l$=Object.prototype.hasOwnProperty,u$=Object.prototype.propertyIsEnumerable,_6=function(e,t,n){return t in e?sce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},mr=function(e,t){for(var n in t||(t={}))l$.call(t,n)&&_6(e,n,t[n]);if(a1)for(var r=0,i=a1(t);r<i.length;r++){var n=i[r];u$.call(t,n)&&_6(e,n,t[n])}return e},oa=function(e,t){return ace(e,lce(t))},b6=function(e,t){var n={};for(var r in e)l$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a1)for(var i=0,o=a1(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&u$.call(e,r)&&(n[r]=e[r])}return n},l1=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())})},Hn;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(Hn||(Hn={}));function uce(e){return{status:e,isUninitialized:e===Hn.uninitialized,isLoading:e===Hn.pending,isSuccess:e===Hn.fulfilled,isError:e===Hn.rejected}}function cce(e){return new RegExp("(^|:)//").test(e)}var dce=function(e){return e.replace(/\/$/,"")},fce=function(e){return e.replace(/^\//,"")};function hce(e,t){if(!e)return t;if(!t)return e;if(cce(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=dce(e),t=fce(t),""+e+n+t}var S6=function(e){return[].concat.apply([],e)};function pce(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function gce(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var w6=Ds;function c$(e,t){if(e===t||!(w6(e)&&w6(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]=c$(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var x6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},mce=function(e){return e.status>=200&&e.status<=299},yce=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function C6(e){if(!Ds(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 vce(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?x6:s,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?yce:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,m=n.responseHandler,b=n.validateStatus,_=b6(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&a===x6&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(g,y){return l1(t,null,function(){var S,w,x,C,A,T,P,L,R,E,k,D,$,O,I,N,B,U,G,Q,Z,Y,j,W,te,oe,ye,le,pt,nt,Fe,ct,ke,Qt,br,kn;return o1(this,function(bn){switch(bn.label){case 0:return S=y.signal,w=y.getState,x=y.extra,C=y.endpoint,A=y.forced,T=y.type,L=typeof g=="string"?{url:g}:g,R=L.url,E=L.headers,k=E===void 0?new Headers(_.headers):E,D=L.params,$=D===void 0?void 0:D,O=L.responseHandler,I=O===void 0?m??"json":O,N=L.validateStatus,B=N===void 0?b??mce:N,U=L.timeout,G=U===void 0?p:U,Q=b6(L,["url","headers","params","responseHandler","validateStatus","timeout"]),Z=mr(oa(mr({},_),{signal:S}),Q),k=new Headers(C6(k)),Y=Z,[4,o(k,{getState:w,extra:x,endpoint:C,forced:A,type:T})];case 1:Y.headers=bn.sent()||k,j=function(Xt){return typeof Xt=="object"&&(Ds(Xt)||Array.isArray(Xt)||typeof Xt.toJSON=="function")},!Z.headers.has("content-type")&&j(Z.body)&&Z.headers.set("content-type",f),j(Z.body)&&c(Z.headers)&&(Z.body=JSON.stringify(Z.body,h)),$&&(W=~R.indexOf("?")?"&":"?",te=l?l($):new URLSearchParams(C6($)),R+=W+te),R=hce(r,R),oe=new Request(R,Z),ye=oe.clone(),P={request:ye},pt=!1,nt=G&&setTimeout(function(){pt=!0,y.abort()},G),bn.label=2;case 2:return bn.trys.push([2,4,5,6]),[4,a(oe)];case 3:return le=bn.sent(),[3,6];case 4:return Fe=bn.sent(),[2,{error:{status:pt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Fe)},meta:P}];case 5:return nt&&clearTimeout(nt),[7];case 6:ct=le.clone(),P.response=ct,Qt="",bn.label=7;case 7:return bn.trys.push([7,9,,10]),[4,Promise.all([v(le,I).then(function(Xt){return ke=Xt},function(Xt){return br=Xt}),ct.text().then(function(Xt){return Qt=Xt},function(){})])];case 8:if(bn.sent(),br)throw br;return[3,10];case 9:return kn=bn.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:le.status,data:Qt,error:String(kn)},meta:P}];case 10:return[2,B(le,ke)?{data:ke,meta:P}:{error:{status:le.status,data:ke},meta:P}]}})})};function v(g,y){return l1(this,null,function(){var S;return o1(this,function(w){switch(w.label){case 0:return typeof y=="function"?[2,y(g)]:(y==="content-type"&&(y=c(g.headers)?"json":"text"),y!=="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 E6=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),jT=Me("__rtkq/focused"),d$=Me("__rtkq/unfocused"),UT=Me("__rtkq/online"),f$=Me("__rtkq/offline"),va;(function(e){e.query="query",e.mutation="mutation"})(va||(va={}));function h$(e){return e.type===va.query}function _ce(e){return e.type===va.mutation}function p$(e,t,n,r,i,o){return bce(e)?e(t,n,r,i).map(DC).map(o):Array.isArray(e)?e.map(DC).map(o):[]}function bce(e){return typeof e=="function"}function DC(e){return typeof e=="string"?{type:e}:e}function lw(e){return e!=null}var Rg=Symbol("forceQueryFn"),LC=function(e){return typeof e[Rg]=="function"};function Sce(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:v,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 y=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return s1(s1([],y(s)),y(a)).filter(lw)}function p(y,S){return function(w){var x,C=o.endpointDefinitions[y],A=t({queryArgs:S,endpointDefinition:C,endpointName:y});return(x=s.get(w))==null?void 0:x[A]}}function m(y,S){return function(w){var x;return(x=a.get(w))==null?void 0:x[S]}}function b(){return function(y){return Object.values(s.get(y)||{}).filter(lw)}}function _(){return function(y){return Object.values(a.get(y)||{}).filter(lw)}}function v(y,S){var w=function(x,C){var A=C===void 0?{}:C,T=A.subscribe,P=T===void 0?!0:T,L=A.forceRefetch,R=A.subscriptionOptions,E=Rg,k=A[E];return function(D,$){var O,I,N=t({queryArgs:x,endpointDefinition:S,endpointName:y}),B=n((O={type:"query",subscribe:P,forceRefetch:L,subscriptionOptions:R,endpointName:y,originalArgs:x,queryCacheKey:N},O[Rg]=k,O)),U=i.endpoints[y].select(x),G=D(B),Q=U($()),Z=G.requestId,Y=G.abort,j=Q.requestId!==Z,W=(I=s.get(D))==null?void 0:I[N],te=function(){return U($())},oe=Object.assign(k?G.then(te):j&&!W?Promise.resolve(Q):Promise.all([W,G]).then(te),{arg:x,requestId:Z,subscriptionOptions:R,queryCacheKey:N,abort:Y,unwrap:function(){return l1(this,null,function(){var le;return o1(this,function(pt){switch(pt.label){case 0:return[4,oe];case 1:if(le=pt.sent(),le.isError)throw le.error;return[2,le.data]}})})},refetch:function(){return D(w(x,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){P&&D(u({queryCacheKey:N,requestId:Z}))},updateSubscriptionOptions:function(le){oe.subscriptionOptions=le,D(d({endpointName:y,requestId:Z,queryCacheKey:N,options:le}))}});if(!W&&!j&&!k){var ye=s.get(D)||{};ye[N]=oe,s.set(D,ye),oe.then(function(){delete ye[N],Object.keys(ye).length||s.delete(D)})}return oe}};return w}function g(y){return function(S,w){var x=w===void 0?{}:w,C=x.track,A=C===void 0?!0:C,T=x.fixedCacheKey;return function(P,L){var R=r({type:"mutation",endpointName:y,originalArgs:S,track:A,fixedCacheKey:T}),E=P(R),k=E.requestId,D=E.abort,$=E.unwrap,O=E.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),I=function(){P(c({requestId:k,fixedCacheKey:T}))},N=Object.assign(O,{arg:E.arg,requestId:k,abort:D,unwrap:$,unsubscribe:I,reset:I}),B=a.get(P)||{};return a.set(P,B),B[k]=N,N.then(function(){delete B[k],Object.keys(B).length||a.delete(P)}),T&&(B[T]=N,N.then(function(){B[T]===N&&(delete B[T],Object.keys(B).length||a.delete(P))})),N}}}}function T6(e){return e}function wce(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,s=e.api,a=function(g,y,S){return function(w){var x=i[g];w(s.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:y,endpointDefinition:x,endpointName:g}),patches:S}))}},l=function(g,y,S){return function(w,x){var C,A,T=s.endpoints[g].select(y)(x()),P={patches:[],inversePatches:[],undo:function(){return w(s.util.patchQueryData(g,y,P.inversePatches))}};if(T.status===Hn.uninitialized)return P;if("data"in T)if(ho(T.data)){var L=rT(T.data,S),R=L[1],E=L[2];(C=P.patches).push.apply(C,R),(A=P.inversePatches).push.apply(A,E)}else{var k=S(T.data);P.patches.push({op:"replace",path:[],value:k}),P.inversePatches.push({op:"replace",path:[],value:T.data})}return w(s.util.patchQueryData(g,y,P.patches)),P}},u=function(g,y,S){return function(w){var x;return w(s.endpoints[g].initiate(y,(x={subscribe:!1,forceRefetch:!0},x[Rg]=function(){return{data:S}},x)))}},c=function(g,y){return l1(t,[g,y],function(S,w){var x,C,A,T,P,L,R,E,k,D,$,O,I,N,B,U,G,Q,Z=w.signal,Y=w.abort,j=w.rejectWithValue,W=w.fulfillWithValue,te=w.dispatch,oe=w.getState,ye=w.extra;return o1(this,function(le){switch(le.label){case 0:x=i[S.endpointName],le.label=1;case 1:return le.trys.push([1,8,,13]),C=T6,A=void 0,T={signal:Z,abort:Y,dispatch:te,getState:oe,extra:ye,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?d(S,oe()):void 0},P=S.type==="query"?S[Rg]:void 0,P?(A=P(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(S.originalArgs),T,x.extraOptions)]:[3,4];case 3:return A=le.sent(),x.transformResponse&&(C=x.transformResponse),[3,6];case 4:return[4,x.queryFn(S.originalArgs,T,x.extraOptions,function(pt){return r(pt,T,x.extraOptions)})];case 5:A=le.sent(),le.label=6;case 6:if(typeof process<"u",A.error)throw new E6(A.error,A.meta);return $=W,[4,C(A.data,A.meta,S.originalArgs)];case 7:return[2,$.apply(void 0,[le.sent(),(G={fulfilledTimeStamp:Date.now(),baseQueryMeta:A.meta},G[sc]=!0,G)])];case 8:if(O=le.sent(),I=O,!(I instanceof E6))return[3,12];N=T6,x.query&&x.transformErrorResponse&&(N=x.transformErrorResponse),le.label=9;case 9:return le.trys.push([9,11,,12]),B=j,[4,N(I.value,I.meta,S.originalArgs)];case 10:return[2,B.apply(void 0,[le.sent(),(Q={baseQueryMeta:I.meta},Q[sc]=!0,Q)])];case 11:return U=le.sent(),I=U,[3,12];case 12:throw typeof process<"u",console.error(I),I;case 13:return[2]}})})};function d(g,y){var S,w,x,C,A=(w=(S=y[n])==null?void 0:S.queries)==null?void 0:w[g.queryCacheKey],T=(x=y[n])==null?void 0:x.config.refetchOnMountOrArgChange,P=A==null?void 0:A.fulfilledTimeStamp,L=(C=g.forceRefetch)!=null?C:g.subscribe&&T;return L?L===!0||(Number(new Date)-Number(P))/1e3>=L:!1}var f=hu(n+"/executeQuery",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[sc]=!0,g},condition:function(g,y){var S=y.getState,w,x,C,A=S(),T=(x=(w=A[n])==null?void 0:w.queries)==null?void 0:x[g.queryCacheKey],P=T==null?void 0:T.fulfilledTimeStamp,L=g.originalArgs,R=T==null?void 0:T.originalArgs,E=i[g.endpointName];return LC(g)?!0:(T==null?void 0:T.status)==="pending"?!1:d(g,A)||h$(E)&&((C=E==null?void 0:E.forceRefetch)!=null&&C.call(E,{currentArg:L,previousArg:R,endpointState:T,state:A}))?!0:!P},dispatchConditionRejection:!0}),h=hu(n+"/executeMutation",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[sc]=!0,g}}),p=function(g){return"force"in g},m=function(g){return"ifOlderThan"in g},b=function(g,y,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(y,{forceRefetch:E})},P=s.endpoints[g].select(y)(x());if(C)w(T());else if(A){var L=P==null?void 0:P.fulfilledTimeStamp;if(!L){w(T());return}var R=(Number(new Date)-Number(new Date(L)))/1e3>=A;R&&w(T())}else w(T(!1))}};function _(g){return function(y){var S,w;return((w=(S=y==null?void 0:y.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===g}}function v(g,y){return{matchPending:of(b_(g),_(y)),matchFulfilled:of(Pu(g),_(y)),matchRejected:of(If(g),_(y))}}return{queryThunk:f,mutationThunk:h,prefetch:b,updateQueryData:l,upsertQueryData:u,patchQueryData:a,buildMatchThunkActions:v}}function g$(e,t,n,r){return p$(n[e.meta.arg.endpointName][t],Pu(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 Ny(e,t,n){var r=e[t];r&&n(r)}function Ig(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function A6(e,t,n){var r=e[Ig(t)];r&&n(r)}var Nh={};function xce(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=Kn({name:t+"/queries",initialState:Nh,reducers:{removeQueryResult:{reducer:function(S,w){var x=w.payload.queryCacheKey;delete S[x]},prepare:P0()},queryResultPatched:function(S,w){var x=w.payload,C=x.queryCacheKey,A=x.patches;Ny(S,C,function(T){T.data=rC(T.data,A.concat())})}},extraReducers:function(S){S.addCase(n.pending,function(w,x){var C=x.meta,A=x.meta.arg,T,P,L=LC(A);(A.subscribe||L)&&((P=w[T=A.queryCacheKey])!=null||(w[T]={status:Hn.uninitialized,endpointName:A.endpointName})),Ny(w,A.queryCacheKey,function(R){R.status=Hn.pending,R.requestId=L&&R.requestId?R.requestId:C.requestId,A.originalArgs!==void 0&&(R.originalArgs=A.originalArgs),R.startedTimeStamp=C.startedTimeStamp})}).addCase(n.fulfilled,function(w,x){var C=x.meta,A=x.payload;Ny(w,C.arg.queryCacheKey,function(T){var P;if(!(T.requestId!==C.requestId&&!LC(C.arg))){var L=o[C.arg.endpointName].merge;if(T.status=Hn.fulfilled,L)if(T.data!==void 0){var R=C.fulfilledTimeStamp,E=C.arg,k=C.baseQueryMeta,D=C.requestId,$=ku(T.data,function(O){return L(O,A,{arg:E.originalArgs,baseQueryMeta:k,fulfilledTimeStamp:R,requestId:D})});T.data=$}else T.data=A;else T.data=(P=o[C.arg.endpointName].structuralSharing)==null||P?c$(Hi(T.data)?XE(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,P=C.requestId,L=x.error,R=x.payload;Ny(w,T.queryCacheKey,function(E){if(!A){if(E.requestId!==P)return;E.status=Hn.rejected,E.error=R??L}})}).addMatcher(l,function(w,x){for(var C=a(x).queries,A=0,T=Object.entries(C);A<T.length;A++){var P=T[A],L=P[0],R=P[1];((R==null?void 0:R.status)===Hn.fulfilled||(R==null?void 0:R.status)===Hn.rejected)&&(w[L]=R)}})}}),h=Kn({name:t+"/mutations",initialState:Nh,reducers:{removeMutationResult:{reducer:function(S,w){var x=w.payload,C=Ig(x);C in S&&delete S[C]},prepare:P0()}},extraReducers:function(S){S.addCase(r.pending,function(w,x){var C=x.meta,A=x.meta,T=A.requestId,P=A.arg,L=A.startedTimeStamp;P.track&&(w[Ig(C)]={requestId:T,status:Hn.pending,endpointName:P.endpointName,startedTimeStamp:L})}).addCase(r.fulfilled,function(w,x){var C=x.payload,A=x.meta;A.arg.track&&A6(w,A,function(T){T.requestId===A.requestId&&(T.status=Hn.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&&A6(w,T,function(P){P.requestId===T.requestId&&(P.status=Hn.rejected,P.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 P=T[A],L=P[0],R=P[1];((R==null?void 0:R.status)===Hn.fulfilled||(R==null?void 0:R.status)===Hn.rejected)&&L!==(R==null?void 0:R.requestId)&&(w[L]=R)}})}}),p=Kn({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 P=T[A],L=0,R=Object.values(P);L<R.length;L++){var E=R[L],k=E.indexOf(C);k!==-1&&E.splice(k,1)}}).addMatcher(l,function(w,x){for(var C,A,T,P,L=a(x).provided,R=0,E=Object.entries(L);R<E.length;R++)for(var k=E[R],D=k[0],$=k[1],O=0,I=Object.entries($);O<I.length;O++)for(var N=I[O],B=N[0],U=N[1],G=(P=(A=(C=w[D])!=null?C:w[D]={})[T=B||"__internal_without_id"])!=null?P:A[T]=[],Q=0,Z=U;Q<Z.length;Q++){var Y=Z[Q],j=G.includes(Y);j||G.push(Y)}}).addMatcher(Xi(Pu(n),pm(n)),function(w,x){for(var C,A,T,P,L=g$(x,"providesTags",o,u),R=x.meta.arg.queryCacheKey,E=0,k=Object.values(w);E<k.length;E++)for(var D=k[E],$=0,O=Object.values(D);$<O.length;$++){var I=O[$],N=I.indexOf(R);N!==-1&&I.splice(N,1)}for(var B=0,U=L;B<U.length;B++){var G=U[B],Q=G.type,Z=G.id,Y=(P=(A=(C=w[Q])!=null?C:w[Q]={})[T=Z||"__internal_without_id"])!=null?P:A[T]=[],j=Y.includes(R);j||Y.push(R)}})}}),m=Kn({name:t+"/subscriptions",initialState:Nh,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),b=Kn({name:t+"/internalSubscriptions",initialState:Nh,reducers:{subscriptionsUpdated:{reducer:function(S,w){return rC(S,w.payload)},prepare:P0()}}}),_=Kn({name:t+"/config",initialState:mr({online:pce(),focused:gce(),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(UT,function(w){w.online=!0}).addCase(f$,function(w){w.online=!1}).addCase(jT,function(w){w.focused=!0}).addCase(d$,function(w){w.focused=!1}).addMatcher(l,function(w){return mr({},w)})}}),v=th({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:b.reducer,config:_.reducer}),g=function(S,w){return v(d.match(w)?void 0:S,w)},y=oa(mr(mr(mr(mr(mr({},_.actions),f.actions),m.actions),b.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:g,actions:y}}var cc=Symbol.for("RTKQ/skipToken"),m$={status:Hn.uninitialized},k6=ku(m$,function(){}),P6=ku(m$,function(){});function Cce(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return k6},i=function(c){return P6};return{buildQuerySelector:a,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return mr(mr({},c),uce(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 _,v,g;return(g=(v=(_=s(b))==null?void 0:_.queries)==null?void 0:v[h])!=null?g:k6},m=f===cc?r:p;return Di(m,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=Ig(c))!=null?d:cc:f=c;var h=function(m){var b,_,v;return(v=(_=(b=s(m))==null?void 0:b.mutations)==null?void 0:_[f])!=null?v:P6},p=f===cc?i:h;return Di(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,m=0,b=d.map(DC);m<b.length;m++){var _=b[m],v=h.provided[_.type];if(v)for(var g=(f=_.id!==void 0?v[_.id]:S6(Object.values(v)))!=null?f:[],y=0,S=g;y<S.length;y++){var w=S[y];p.add(w)}}return S6(Array.from(p.values()).map(function(x){var C=h.queries[x];return C?[{queryCacheKey:x,endpointName:C.endpointName,originalArgs:C.originalArgs}]:[]}))}}var Dy=WeakMap?new WeakMap:void 0,R6=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Dy==null?void 0:Dy.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return Ds(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});Ds(n)&&(Dy==null||Dy.set(n,o)),r=o}return t+"("+r+")"};function Ece(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=kv(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=oa(mr({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=R6;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:R6(oa(mr({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:s1([],r.tagTypes||[])}),s={endpointDefinitions:{},batch:function(c){c()},apiUid:v_(),extractRehydrationInfo:i,hasRehydrationInfo:kv(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 v=_[b],g=v[0],y=v[1];typeof y=="function"?y(s.endpointDefinitions[g]):Object.assign(s.endpointDefinitions[g]||{},y)}return a}},l=e.map(function(c){return c.init(a,o,s)});function u(c){for(var d=c.endpoints({query:function(y){return oa(mr({},y),{type:va.query})},mutation:function(y){return oa(mr({},y),{type:va.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,v=l;_<v.length;_++){var g=v[_];g.injectEndpoint(m,b)}}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function Tce(e){for(var t in e)return!1;return!0}var Ace=2147483647/1e3-1,kce=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&&!Tce(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 v=0,g=Object.entries(u);v<g.length;v++){var y=g[v],S=y[0],w=y[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],P=T[1];d(_,P==null?void 0:P.endpointName,h,b.config)}};function d(f,h,p,m){var b,_=r.endpointDefinitions[h],v=(b=_==null?void 0:_.keepUnusedDataFor)!=null?b:m.keepUnusedDataFor;if(v!==1/0){var g=Math.max(0,Math.min(v,Ace));if(!l(f)){var y=u[f];y&&clearTimeout(y),u[f]=setTimeout(function(){l(f)||p.dispatch(s({queryCacheKey:f})),delete u[f]},g*1e3)}}}return c},Pce=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=Xi(Pu(i),pm(i)),c=function(f,h){u(f)&&d(g$(f,"invalidatesTags",r,s),h),o.util.invalidateTags.match(f)&&d(p$(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 _,v=Array.from(b.values()),g=0,y=v;g<y.length;g++){var S=y[g].queryCacheKey,w=m.queries[S],x=(_=m.subscriptions[S])!=null?_:{};w&&(Object.keys(x).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==Hn.uninitialized&&h.dispatch(a(w,S)))}})}return c},Rce=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],v=o.currentSubscriptions[m];if(!(!_||_.status===Hn.uninitialized)){var g=f(v);if(Number.isFinite(g)){var y=s[m];y!=null&&y.timeout&&(clearTimeout(y.timeout),y.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],v=o.currentSubscriptions[m];if(!(!_||_.status===Hn.uninitialized)){var g=f(v);if(!Number.isFinite(g)){c(m);return}var y=s[m],S=Date.now()+g;(!y||S<y.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},Ice=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){jT.match(u)&&l(c,"refetchOnFocus"),UT.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],v=h[b];if(!(!v||!_)){var g=Object.values(v).some(function(y){return y[c]===!0})||Object.values(v).every(function(y){return y[c]===void 0})&&d.config[c];g&&(Object.keys(v).length===0?u.dispatch(s({queryCacheKey:b})):_.status!==Hn.uninitialized&&u.dispatch(i(_,b)))}}})}return a},I6=new Error("Promise never resolved before cacheEntryRemoved."),Oce=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var s=Pv(i),a=Pv(o),l=Pu(i,o),u={},c=function(h,p,m){var b=d(h);if(i.pending.match(h)){var _=m[n].queries[b],v=p.getState()[n].queries[b];!_&&v&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,b,p,h.meta.requestId)}else if(o.pending.match(h)){var v=p.getState()[n].mutations[b];v&&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 y=0,S=Object.entries(u);y<S.length;y++){var w=S[y],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)?Ig(h.payload):""}function f(h,p,m,b,_){var v=r.endpointDefinitions[h],g=v==null?void 0:v.onCacheEntryAdded;if(g){var y={},S=new Promise(function(P){y.cacheEntryRemoved=P}),w=Promise.race([new Promise(function(P){y.valueResolved=P}),S.then(function(){throw I6})]);w.catch(function(){}),u[m]=y;var x=t.endpoints[h].select(v.type===va.query?p:m),C=b.dispatch(function(P,L,R){return R}),A=oa(mr({},b),{getCacheEntry:function(){return x(b.getState())},requestId:_,extra:C,updateCachedData:v.type===va.query?function(P){return b.dispatch(t.util.updateQueryData(h,p,P))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),T=g(p,A);Promise.resolve(T).catch(function(P){if(P!==I6)throw P})}}return c},Mce=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=b_(r,i),s=If(r,i),a=Pu(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var m=c.meta,b=m.requestId,_=m.arg,v=_.endpointName,g=_.originalArgs,y=n.endpointDefinitions[v],S=y==null?void 0:y.onQueryStarted;if(S){var w={},x=new Promise(function(k,D){w.resolve=k,w.reject=D});x.catch(function(){}),l[b]=w;var C=t.endpoints[v].select(y.type===va.query?g:b),A=d.dispatch(function(k,D,$){return $}),T=oa(mr({},d),{getCacheEntry:function(){return C(d.getState())},requestId:b,extra:A,updateCachedData:y.type===va.query?function(k){return d.dispatch(t.util.updateQueryData(v,g,k))}:void 0,queryFulfilled:x});S(g,T)}}else if(a(c)){var P=c.meta,b=P.requestId,L=P.baseQueryMeta;(f=l[b])==null||f.resolve({data:c.payload,meta:L}),delete l[b]}else if(s(c)){var R=c.meta,b=R.requestId,E=R.rejectedWithValue,L=R.baseQueryMeta;(p=l[b])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!E,meta:L}),delete l[b]}};return u},Nce=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"}},O6,Dce=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(O6||(O6=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Lce=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,_,v,g,y,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 P=f.meta,L=P.arg,C=P.requestId;if(L.subscribe){var R=(m=d[p=L.queryCacheKey])!=null?m:d[p]={};return R[C]=(_=(b=L.subscriptionOptions)!=null?b:R[C])!=null?_:{},!0}}if(n.rejected.match(f)){var E=f.meta,k=E.condition,L=E.arg,C=E.requestId;if(k&&L.subscribe){var R=(g=d[v=L.queryCacheKey])!=null?g:d[v]={};return R[C]=(S=(y=L.subscriptionOptions)!=null?y:R[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,v=!!((h=r.currentSubscriptions[b])!=null&&h[_]);return[!1,v]}var g=c(r.currentSubscriptions,d);if(g){s||(Dce(function(){var x=JSON.parse(JSON.stringify(r.currentSubscriptions)),C=rT(o,function(){return x}),A=C[1];f.next(t.internalActions.subscriptionsUpdated(A)),o=x,s=!1}),s=!0);var y=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!y&&!S;return[w,!1]}return[!0,!1]}};function $ce(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=[Nce,kce,Pce,Rce,Oce,Mce],u=function(d){var f=!1,h={currentSubscriptions:{}},p=oa(mr({},e),{internalState:h,refetchQuery:c}),m=l.map(function(v){return v(p)}),b=Lce(p),_=Ice(p);return function(v){return function(g){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var y=oa(mr({},d),{next:v}),S=d.getState(),w=b(g,y,S),x=w[0],C=w[1],A;if(x?A=v(g):A=C,d.getState()[t]&&(_(g,y,S),a(g)||i.hasRehydrationInfo(g)))for(var T=0,P=m;T<P.length;T++){var L=P[T];L(g,y,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 xl(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,s1([e],t))}var M6=Symbol(),Fce=function(){return{name:M6,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;tT();var d=function(G){return typeof process<"u",G};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:UT,onOffline:f$,onFocus:jT,onFocusLost:d$},util:{}});var f=wce({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:s}),h=f.queryThunk,p=f.mutationThunk,m=f.patchQueryData,b=f.updateQueryData,_=f.upsertQueryData,v=f.prefetch,g=f.buildMatchThunkActions,y=xce({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:a,reducerPath:o}}),S=y.reducer,w=y.actions;xl(e.util,{patchQueryData:m,updateQueryData:b,upsertQueryData:_,prefetch:v,resetApiState:w.resetApiState}),xl(e.internalActions,w);var x=$ce({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),C=x.middleware,A=x.actions;xl(e.util,A),xl(e,{reducer:S,middleware:C});var T=Cce({serializeQueryArgs:s,reducerPath:o}),P=T.buildQuerySelector,L=T.buildMutationSelector,R=T.selectInvalidatedBy;xl(e.util,{selectInvalidatedBy:R});var E=Sce({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:s,context:n}),k=E.buildInitiateQuery,D=E.buildInitiateMutation,$=E.getRunningMutationThunk,O=E.getRunningMutationsThunk,I=E.getRunningQueriesThunk,N=E.getRunningQueryThunk,B=E.getRunningOperationPromises,U=E.removalWarning;return xl(e.util,{getRunningOperationPromises:B,getRunningOperationPromise:U,getRunningMutationThunk:$,getRunningMutationsThunk:O,getRunningQueryThunk:N,getRunningQueriesThunk:I}),{name:M6,injectEndpoint:function(G,Q){var Z,Y,j=e;(Y=(Z=j.endpoints)[G])!=null||(Z[G]={}),h$(Q)?xl(j.endpoints[G],{name:G,select:P(G,Q),initiate:k(G,Q)},g(h,G)):_ce(Q)&&xl(j.endpoints[G],{name:G,select:L(),initiate:D(G)},g(p,G))}}}}},y$={exports:{}},v$={};/**
|
||
* @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 Uf=M;function Bce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zce=typeof Object.is=="function"?Object.is:Bce,jce=Uf.useState,Uce=Uf.useEffect,Vce=Uf.useLayoutEffect,Gce=Uf.useDebugValue;function qce(e,t){var n=t(),r=jce({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Vce(function(){i.value=n,i.getSnapshot=t,uw(i)&&o({inst:i})},[e,n,t]),Uce(function(){return uw(i)&&o({inst:i}),e(function(){uw(i)&&o({inst:i})})},[e]),Gce(n),n}function uw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zce(e,n)}catch{return!0}}function Hce(e,t){return t()}var Wce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Hce:qce;v$.useSyncExternalStore=Uf.useSyncExternalStore!==void 0?Uf.useSyncExternalStore:Wce;y$.exports=v$;var Kce=y$.exports,_$={exports:{}},b$={};/**
|
||
* @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 ub=M,Qce=Kce;function Xce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yce=typeof Object.is=="function"?Object.is:Xce,Zce=Qce.useSyncExternalStore,Jce=ub.useRef,ede=ub.useEffect,tde=ub.useMemo,nde=ub.useDebugValue;b$.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Jce(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=tde(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,Yce(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=Zce(e,o[0],o[1]);return ede(function(){s.hasValue=!0,s.value=a},[a]),nde(a),a};_$.exports=b$;var S$=_$.exports;const rde=jc(S$);function ide(e){e()}let w$=ide;const ode=e=>w$=e,sde=()=>w$,N6=Symbol.for("react-redux-context"),D6=typeof globalThis<"u"?globalThis:{};function ade(){var e;if(!M.createContext)return{};const t=(e=D6[N6])!=null?e:D6[N6]=new Map;let n=t.get(M.createContext);return n||(n=M.createContext(null),t.set(M.createContext,n)),n}const vu=ade();function VT(e=vu){return function(){return M.useContext(e)}}const x$=VT(),lde=()=>{throw new Error("uSES not initialized!")};let C$=lde;const ude=e=>{C$=e},cde=(e,t)=>e===t;function dde(e=vu){const t=e===vu?x$:VT(e);return function(r,i={}){const{equalityFn:o=cde,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=C$(u.addNestedSub,l.getState,c||l.getState,h,o);return M.useDebugValue(p),p}}const E$=dde();function u1(){return u1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u1.apply(this,arguments)}var T$={exports:{}},dn={};/** @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 ni=typeof Symbol=="function"&&Symbol.for,GT=ni?Symbol.for("react.element"):60103,qT=ni?Symbol.for("react.portal"):60106,cb=ni?Symbol.for("react.fragment"):60107,db=ni?Symbol.for("react.strict_mode"):60108,fb=ni?Symbol.for("react.profiler"):60114,hb=ni?Symbol.for("react.provider"):60109,pb=ni?Symbol.for("react.context"):60110,HT=ni?Symbol.for("react.async_mode"):60111,gb=ni?Symbol.for("react.concurrent_mode"):60111,mb=ni?Symbol.for("react.forward_ref"):60112,yb=ni?Symbol.for("react.suspense"):60113,fde=ni?Symbol.for("react.suspense_list"):60120,vb=ni?Symbol.for("react.memo"):60115,_b=ni?Symbol.for("react.lazy"):60116,hde=ni?Symbol.for("react.block"):60121,pde=ni?Symbol.for("react.fundamental"):60117,gde=ni?Symbol.for("react.responder"):60118,mde=ni?Symbol.for("react.scope"):60119;function Fo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case GT:switch(e=e.type,e){case HT:case gb:case cb:case fb:case db:case yb:return e;default:switch(e=e&&e.$$typeof,e){case pb:case mb:case _b:case vb:case hb:return e;default:return t}}case qT:return t}}}function A$(e){return Fo(e)===gb}dn.AsyncMode=HT;dn.ConcurrentMode=gb;dn.ContextConsumer=pb;dn.ContextProvider=hb;dn.Element=GT;dn.ForwardRef=mb;dn.Fragment=cb;dn.Lazy=_b;dn.Memo=vb;dn.Portal=qT;dn.Profiler=fb;dn.StrictMode=db;dn.Suspense=yb;dn.isAsyncMode=function(e){return A$(e)||Fo(e)===HT};dn.isConcurrentMode=A$;dn.isContextConsumer=function(e){return Fo(e)===pb};dn.isContextProvider=function(e){return Fo(e)===hb};dn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===GT};dn.isForwardRef=function(e){return Fo(e)===mb};dn.isFragment=function(e){return Fo(e)===cb};dn.isLazy=function(e){return Fo(e)===_b};dn.isMemo=function(e){return Fo(e)===vb};dn.isPortal=function(e){return Fo(e)===qT};dn.isProfiler=function(e){return Fo(e)===fb};dn.isStrictMode=function(e){return Fo(e)===db};dn.isSuspense=function(e){return Fo(e)===yb};dn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cb||e===gb||e===fb||e===db||e===yb||e===fde||typeof e=="object"&&e!==null&&(e.$$typeof===_b||e.$$typeof===vb||e.$$typeof===hb||e.$$typeof===pb||e.$$typeof===mb||e.$$typeof===pde||e.$$typeof===gde||e.$$typeof===mde||e.$$typeof===hde)};dn.typeOf=Fo;T$.exports=dn;var yde=T$.exports,k$=yde,vde={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_de={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},P$={};P$[k$.ForwardRef]=vde;P$[k$.Memo]=_de;var _n={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var WT=Symbol.for("react.element"),KT=Symbol.for("react.portal"),bb=Symbol.for("react.fragment"),Sb=Symbol.for("react.strict_mode"),wb=Symbol.for("react.profiler"),xb=Symbol.for("react.provider"),Cb=Symbol.for("react.context"),bde=Symbol.for("react.server_context"),Eb=Symbol.for("react.forward_ref"),Tb=Symbol.for("react.suspense"),Ab=Symbol.for("react.suspense_list"),kb=Symbol.for("react.memo"),Pb=Symbol.for("react.lazy"),Sde=Symbol.for("react.offscreen"),R$;R$=Symbol.for("react.module.reference");function rs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case WT:switch(e=e.type,e){case bb:case wb:case Sb:case Tb:case Ab:return e;default:switch(e=e&&e.$$typeof,e){case bde:case Cb:case Eb:case Pb:case kb:case xb:return e;default:return t}}case KT:return t}}}_n.ContextConsumer=Cb;_n.ContextProvider=xb;_n.Element=WT;_n.ForwardRef=Eb;_n.Fragment=bb;_n.Lazy=Pb;_n.Memo=kb;_n.Portal=KT;_n.Profiler=wb;_n.StrictMode=Sb;_n.Suspense=Tb;_n.SuspenseList=Ab;_n.isAsyncMode=function(){return!1};_n.isConcurrentMode=function(){return!1};_n.isContextConsumer=function(e){return rs(e)===Cb};_n.isContextProvider=function(e){return rs(e)===xb};_n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===WT};_n.isForwardRef=function(e){return rs(e)===Eb};_n.isFragment=function(e){return rs(e)===bb};_n.isLazy=function(e){return rs(e)===Pb};_n.isMemo=function(e){return rs(e)===kb};_n.isPortal=function(e){return rs(e)===KT};_n.isProfiler=function(e){return rs(e)===wb};_n.isStrictMode=function(e){return rs(e)===Sb};_n.isSuspense=function(e){return rs(e)===Tb};_n.isSuspenseList=function(e){return rs(e)===Ab};_n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===bb||e===wb||e===Sb||e===Tb||e===Ab||e===Sde||typeof e=="object"&&e!==null&&(e.$$typeof===Pb||e.$$typeof===kb||e.$$typeof===xb||e.$$typeof===Cb||e.$$typeof===Eb||e.$$typeof===R$||e.getModuleId!==void 0)};_n.typeOf=rs;function wde(){const e=sde();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 L6={notify(){},get:()=>[]};function xde(e,t){let n,r=L6;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=wde())}function u(){n&&(n(),n=void 0,r.clear(),r=L6)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const Cde=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ede=Cde?M.useLayoutEffect:M.useEffect;function $6(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function c1(e,t){if($6(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])||!$6(e[n[i]],t[n[i]]))return!1;return!0}function Tde({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const s=M.useMemo(()=>{const u=xde(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]);Ede(()=>{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||vu;return M.createElement(l.Provider,{value:s},n)}function I$(e=vu){const t=e===vu?x$:VT(e);return function(){const{store:r}=t();return r}}const O$=I$();function Ade(e=vu){const t=e===vu?O$:I$(e);return function(){return t().dispatch}}const M$=Ade();ude(S$.useSyncExternalStoreWithSelector);ode(ws.unstable_batchedUpdates);var kde=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},Pde=Object.defineProperty,Rde=Object.defineProperties,Ide=Object.getOwnPropertyDescriptors,F6=Object.getOwnPropertySymbols,Ode=Object.prototype.hasOwnProperty,Mde=Object.prototype.propertyIsEnumerable,B6=function(e,t,n){return t in e?Pde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},La=function(e,t){for(var n in t||(t={}))Ode.call(t,n)&&B6(e,n,t[n]);if(F6)for(var r=0,i=F6(t);r<i.length;r++){var n=i[r];Mde.call(t,n)&&B6(e,n,t[n])}return e},D0=function(e,t){return Rde(e,Ide(t))};function z6(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 cw=Symbol();function dw(e){var t=M.useRef(e);return M.useEffect(function(){c1(t.current,e)||(t.current=e)},[e]),c1(t.current,e)?t.current:e}var Ly=WeakMap?new WeakMap:void 0,Nde=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Ly==null?void 0:Ly.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return Ds(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});Ds(n)&&(Ly==null||Ly.set(n,o)),r=o}return t+"("+r+")"},Dde=typeof window<"u"&&window.document&&window.document.createElement?M.useLayoutEffect:M.useEffect,Lde=function(e){return e},$de=function(e){return e.isUninitialized?D0(La({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Hn.pending}):e};function Fde(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 v=b.endpointName,g=u.endpointDefinitions[v];l({queryArgs:b.originalArgs,endpointDefinition:g,endpointName:v})===l({queryArgs:_,endpointDefinition:g,endpointName:v})&&(b=void 0)}var y=m.isSuccess?m.data:b==null?void 0:b.data;y===void 0&&(y=m.data);var S=y!==void 0,w=m.isLoading,x=!S&&w,C=m.isSuccess||w&&S;return D0(La({},m),{data:y,currentData:m.data,isFetching:w,isLoading:x,isSuccess:C})}function f(m,b){var _=i(),v=dw(b);return M.useCallback(function(g,y){return _(t.util.prefetch(m,g,La(La({},v),y)))},[m,_,v])}function h(m){var b=function(g,y){var S=y===void 0?{}:y,w=S.refetchOnReconnect,x=S.refetchOnFocus,C=S.refetchOnMountOrArgChange,A=S.skip,T=A===void 0?!1:A,P=S.pollingInterval,L=P===void 0?0:P,R=t.endpoints[m].initiate,E=i(),k=z6(T?cc:g,Nde,u.endpointDefinitions[m],m),D=dw({refetchOnReconnect:w,refetchOnFocus:x,pollingInterval:L}),$=M.useRef(!1),O=M.useRef(),I=O.current||{},N=I.queryCacheKey,B=I.requestId,U=!1;if(N&&B){var G=E(t.internalActions.internal_probeSubscription({queryCacheKey:N,requestId:B}));U=!!G}var Q=!U&&$.current;return c(function(){$.current=U}),c(function(){Q&&(O.current=void 0)},[Q]),c(function(){var Z,Y=O.current;if(typeof process<"u",k===cc){Y==null||Y.unsubscribe(),O.current=void 0;return}var j=(Z=O.current)==null?void 0:Z.subscriptionOptions;if(!Y||Y.arg!==k){Y==null||Y.unsubscribe();var W=E(R(k,{subscriptionOptions:D,forceRefetch:C}));O.current=W}else D!==j&&Y.updateSubscriptionOptions(D)},[E,R,C,k,D,Q]),M.useEffect(function(){return function(){var Z;(Z=O.current)==null||Z.unsubscribe(),O.current=void 0}},[]),M.useMemo(function(){return{refetch:function(){var Z;if(!O.current)throw new Error("Cannot refetch a query that has not been started yet.");return(Z=O.current)==null?void 0:Z.refetch()}}},[])},_=function(g){var y=g===void 0?{}:g,S=y.refetchOnReconnect,w=y.refetchOnFocus,x=y.pollingInterval,C=x===void 0?0:x,A=t.endpoints[m].initiate,T=i(),P=M.useState(cw),L=P[0],R=P[1],E=M.useRef(),k=dw({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:C});c(function(){var O,I,N=(O=E.current)==null?void 0:O.subscriptionOptions;k!==N&&((I=E.current)==null||I.updateSubscriptionOptions(k))},[k]);var D=M.useRef(k);c(function(){D.current=k},[k]);var $=M.useCallback(function(O,I){I===void 0&&(I=!1);var N;return r(function(){var B;(B=E.current)==null||B.unsubscribe(),E.current=N=T(A(O,{subscriptionOptions:D.current,forceRefetch:!I})),R(O)}),N},[T,A]);return M.useEffect(function(){return function(){var O;(O=E==null?void 0:E.current)==null||O.unsubscribe()}},[]),M.useEffect(function(){L!==cw&&!E.current&&$(L,!0)},[L,$]),M.useMemo(function(){return[$,L]},[$,L])},v=function(g,y){var S=y===void 0?{}:y,w=S.skip,x=w===void 0?!1:w,C=S.selectFromResult,A=t.endpoints[m].select,T=z6(x?cc:g,l,u.endpointDefinitions[m],m),P=M.useRef(),L=M.useMemo(function(){return Di([A(T),function($,O){return O},function($){return T}],d)},[A,T]),R=M.useMemo(function(){return C?Di([L],C):L},[L,C]),E=o(function($){return R($,P.current)},c1),k=s(),D=L(k.getState(),P.current);return Dde(function(){P.current=D},[D]),E};return{useQueryState:v,useQuerySubscription:b,useLazyQuerySubscription:_,useLazyQuery:function(g){var y=_(g),S=y[0],w=y[1],x=v(w,D0(La({},g),{skip:w===cw})),C=M.useMemo(function(){return{lastArg:w}},[w]);return M.useMemo(function(){return[S,x,C]},[S,x,C])},useQuery:function(g,y){var S=b(g,y),w=v(g,La({selectFromResult:g===cc||y!=null&&y.skip?void 0:$de},y)),x=w.data,C=w.status,A=w.isLoading,T=w.isSuccess,P=w.isError,L=w.error;return M.useDebugValue({data:x,status:C,isLoading:A,isSuccess:T,isError:P,error:L}),M.useMemo(function(){return La(La({},w),S)},[w,S])}}}function p(m){return function(b){var _=b===void 0?{}:b,v=_.selectFromResult,g=v===void 0?Lde:v,y=_.fixedCacheKey,S=t.endpoints[m],w=S.select,x=S.initiate,C=i(),A=M.useState(),T=A[0],P=A[1];M.useEffect(function(){return function(){T!=null&&T.arg.fixedCacheKey||T==null||T.reset()}},[T]);var L=M.useCallback(function(Y){var j=C(x(Y,{fixedCacheKey:y}));return P(j),j},[C,x,y]),R=(T||{}).requestId,E=M.useMemo(function(){return Di([w({fixedCacheKey:y,requestId:T==null?void 0:T.requestId})],g)},[w,T,g,y]),k=o(E,c1),D=y==null?T==null?void 0:T.arg.originalArgs:void 0,$=M.useCallback(function(){r(function(){T&&P(void 0),y&&C(t.internalActions.removeMutationResult({requestId:R,fixedCacheKey:y}))})},[C,y,T,R]),O=k.endpointName,I=k.data,N=k.status,B=k.isLoading,U=k.isSuccess,G=k.isError,Q=k.error;M.useDebugValue({endpointName:O,data:I,status:N,isLoading:B,isSuccess:U,isError:G,error:Q});var Z=M.useMemo(function(){return D0(La({},k),{originalArgs:D,reset:$})},[k,D,$]);return M.useMemo(function(){return[L,Z]},[L,Z])}}}var d1;(function(e){e.query="query",e.mutation="mutation"})(d1||(d1={}));function Bde(e){return e.type===d1.query}function zde(e){return e.type===d1.mutation}function fw(e){return e.replace(e[0],e[0].toUpperCase())}function $y(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,kde([e],t))}var jde=Symbol(),Ude=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?M$:i,s=t.useSelector,a=s===void 0?E$:s,l=t.useStore,u=l===void 0?O$:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:jde,init:function(f,h,p){var m=h.serializeQueryArgs,b=f,_=Fde({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:a,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:p}),v=_.buildQueryHooks,g=_.buildMutationHook,y=_.usePrefetch;return $y(b,{usePrefetch:y}),$y(p,{batch:r}),{injectEndpoint:function(S,w){if(Bde(w)){var x=v(S),C=x.useQuery,A=x.useLazyQuery,T=x.useLazyQuerySubscription,P=x.useQueryState,L=x.useQuerySubscription;$y(b.endpoints[S],{useQuery:C,useLazyQuery:A,useLazyQuerySubscription:T,useQueryState:P,useQuerySubscription:L}),f["use"+fw(S)+"Query"]=C,f["useLazy"+fw(S)+"Query"]=A}else if(zde(w)){var R=g(S);$y(b.endpoints[S],{useMutation:R}),f["use"+fw(S)+"Mutation"]=R}}}}}},Vde=Ece(Fce(),Ude());const Gde=["Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","Model","SessionQueueItem","SessionQueueItemDTO","SessionQueueItemDTOList","SessionQueueStatus","SessionProcessorStatus","BatchStatus"],Ot="LIST",qde=async(e,t,n)=>{const r=vg.get(),i=Lf.get(),o=_g.get();return vce({baseUrl:`${r??""}/api/v1`,prepareHeaders:a=>(i&&a.set("Authorization",`Bearer ${i}`),o&&a.set("project-id",o),a)})(e,t,n)},$s=Vde({baseQuery:qde,reducerPath:"api",tagTypes:Gde,endpoints:()=>({})}),Hde=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},N$="%[a-f0-9]{2}",j6=new RegExp("("+N$+")|([^%]+?)","gi"),U6=new RegExp("("+N$+")+","gi");function $C(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([],$C(n),$C(r))}function Wde(e){try{return decodeURIComponent(e)}catch{let t=e.match(j6)||[];for(let n=1;n<t.length;n++)e=$C(t,n).join(""),t=e.match(j6)||[];return e}}function Kde(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=U6.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=Wde(n[0]);i!==n[0]&&(t[n[0]]=i)}n=U6.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 Qde(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Kde(e)}}function D$(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 Xde(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 Yde=e=>e==null,Zde=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),FC=Symbol("encodeFragmentIdentifier");function Jde(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 efe(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&&Va(r,e).includes(e.arrayFormatSeparator);r=s?Va(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>Va(l,e)):r===null?r:Va(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Va(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>Va(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 L$(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?Zde(e):encodeURIComponent(e):e}function Va(e,t){return t.decode?Qde(e):e}function $$(e){return Array.isArray(e)?e.sort():typeof e=="object"?$$(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function F$(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function tfe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function V6(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 QT(e){e=F$(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function XT(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},L$(t.arrayFormatSeparator);const n=efe(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]=D$(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:Va(a,t),n(Va(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]=V6(a,t);else r[i]=V6(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]=$$(s):i[o]=s,i},Object.create(null))}function B$(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},L$(t.arrayFormatSeparator);const n=s=>t.skipNull&&Yde(e[s])||t.skipEmptyString&&e[s]==="",r=Jde(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 z$(e,t){var i;t={decode:!0,...t};let[n,r]=D$(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:XT(QT(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Va(r,t)}:{}}}function j$(e,t){t={encode:!0,strict:!0,[FC]:!0,...t};const n=F$(e.url).split("?")[0]||"",r=QT(e.url),i={...XT(r,{sort:!1}),...e.query};let o=B$(i,t);o&&(o=`?${o}`);let s=tfe(e.url);if(e.fragmentIdentifier){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[FC]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function U$(e,t,n){n={parseFragmentIdentifier:!0,[FC]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=z$(e,n);return j$({url:r,query:Xde(i,t),fragmentIdentifier:o},n)}function nfe(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return U$(e,r,n)}const Cp=Object.freeze(Object.defineProperty({__proto__:null,exclude:nfe,extract:QT,parse:XT,parseUrl:z$,pick:U$,stringify:B$,stringifyUrl:j$},Symbol.toStringTag,{value:"Module"})),Bu=(e,t)=>{if(!e)return!1;const n=f1.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=>Kr.includes(e.image_category)?Kr:Gl,Dn=Sa({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:Hde(t.created_at,e.created_at)}),f1=Dn.getSelectors(),xo=e=>`images/?${Cp.stringify(e,{arrayFormat:"none"})}`,fi=$s.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:Ot}];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:Ot}];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:xo({board_id:t??"none",categories:Kr,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:xo({board_id:t??"none",categories:Gl,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:Ot}]}),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:$Ie,useListAllBoardsQuery:FIe,useGetBoardImagesTotalQuery:BIe,useGetBoardAssetsTotalQuery:zIe,useCreateBoardMutation:jIe,useUpdateBoardMutation:UIe,useListAllImageNamesForBoardQuery:VIe}=fi,ge=$s.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:xo(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:xo({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return xo({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Dn.addMany(Dn.getInitialState(),n)},merge:(t,n)=>{Dn.addMany(t,f1.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;f1.selectAll(i).forEach(o=>{n(ge.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:xo({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=GD.safeParse((o=a.data)==null?void 0:o.metadata);l.success&&(s=l.data)}return{data:{metadata:s}}}else{const s=Lf.get(),a=_g.get(),u=await Mre.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 oce(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(ge.util.updateQueryData("listImages",s,l=>{Dn.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=wT(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(ge.util.updateQueryData("listImages",l,u=>{Dn.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(ge.util.updateQueryData("getImageDTO",t.image_name,l=>{Object.assign(l,{is_intermediate:n})})));const a=zo(t);if(n)s.push(r(ge.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:a},l=>{Dn.removeOne(l,t.image_name)})));else{const l={board_id:t.board_id??"none",categories:a},u=ge.endpoints.listImages.select(l)(o()),{data:c}=Kr.includes(t.image_category)?fi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):fi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),d=u.data&&u.data.ids.length>=(c??0),f=Bu(u.data,t);(d||f)&&s.push(r(ge.util.updateQueryData("listImages",l,h=>{Dn.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(ge.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:xo({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(ge.util.updateQueryData("getImageDTO",c,b=>{b.starred=!0}));const d={board_id:l??"none",categories:a},f=ge.endpoints.listImages.select(d)(i()),{data:h}=Kr.includes(u.image_category)?fi.endpoints.getBoardImagesTotal.select(l??"none")(i()):fi.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=(h??0),m=(h||0)>=Ty?Bu(f.data,u):!0;(p||m)&&n(ge.util.updateQueryData("listImages",d,b=>{Dn.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:xo({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(ge.util.updateQueryData("getImageDTO",c,b=>{b.starred=!1}));const d={board_id:l??"none",categories:a},f=ge.endpoints.listImages.select(d)(i()),{data:h}=Kr.includes(u.image_category)?fi.endpoints.getBoardImagesTotal.select(l??"none")(i()):fi.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=(h??0),m=(h||0)>=Ty?Bu(f.data,u):!0;(p||m)&&n(ge.util.updateQueryData("listImages",d,b=>{Dn.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(ge.util.upsertQueryData("getImageDTO",i.image_name,i));const o=zo(i);n(ge.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},s=>{Dn.addOne(s,i)})),n(ge.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:Ot},{type:"ImageList",id:xo({board_id:"none",categories:Kr})},{type:"ImageList",id:xo({board_id:"none",categories:Gl})},{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(ge.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))});const s=[{categories:Kr},{categories:Gl}],a=o.map(l=>({id:l,changes:{board_id:void 0}}));s.forEach(l=>{n(ge.util.updateQueryData("listImages",l,u=>{Dn.updateMany(u,a)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:Ot},{type:"ImageList",id:xo({board_id:"none",categories:Kr})},{type:"ImageList",id:xo({board_id:"none",categories:Gl})},{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:Kr},{categories:Gl}].forEach(a=>{n(ge.util.updateQueryData("listImages",a,l=>{Dn.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(ge.util.updateQueryData("getImageDTO",n.image_name,l=>{l.board_id=t}))),!n.is_intermediate){s.push(r(ge.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:a},h=>{Dn.removeOne(h,n.image_name)})));const l={board_id:t??"none",categories:a},u=ge.endpoints.listImages.select(l)(o()),{data:c}=Kr.includes(n.image_category)?fi.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):fi.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),d=u.data&&u.data.ids.length>=(c??0),f=Bu(u.data,n);(d||f)&&s.push(r(ge.util.updateQueryData("listImages",l,h=>{Dn.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(ge.util.updateQueryData("getImageDTO",t.image_name,f=>{f.board_id=void 0}))),s.push(n(ge.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},f=>{Dn.removeOne(f,t.image_name)})));const a={board_id:"none",categories:o},l=ge.endpoints.listImages.select(a)(i()),{data:u}=Kr.includes(t.image_category)?fi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):fi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),c=l.data&&l.data.ids.length>=(u??0),d=Bu(l.data,t);(c||d)&&s.push(n(ge.util.updateQueryData("listImages",a,f=>{Dn.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(ge.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(ge.util.updateQueryData("listImages",{board_id:d??"none",categories:c},_=>{Dn.removeOne(_,u.image_name)}));const f={board_id:t,categories:c},h=ge.endpoints.listImages.select(f)(o()),{data:p}=Kr.includes(u.image_category)?fi.endpoints.getBoardImagesTotal.select(t??"none")(o()):fi.endpoints.getBoardAssetsTotal.select(t??"none")(o()),m=h.data&&h.data.ids.length>=(p??0),b=(p||0)>=Ty?Bu(h.data,u):!0;(m||b)&&r(ge.util.updateQueryData("listImages",f,_=>{Dn.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(ge.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(ge.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},m=>{Dn.removeOne(m,l.image_name)}));const c={board_id:"none",categories:u},d=ge.endpoints.listImages.select(c)(i()),{data:f}=Kr.includes(l.image_category)?fi.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):fi.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),h=d.data&&d.data.ids.length>=(f??0),p=(f||0)>=Ty?Bu(d.data,l):!0;(h||p)&&n(ge.util.updateQueryData("listImages",c,m=>{Dn.upsertOne(m,{...l,board_id:"none"})}))})}catch{}}})})}),{useGetIntermediatesCountQuery:GIe,useListImagesQuery:qIe,useLazyListImagesQuery:HIe,useGetImageDTOQuery:WIe,useGetImageMetadataQuery:KIe,useDeleteImageMutation:QIe,useDeleteImagesMutation:XIe,useUploadImageMutation:YIe,useClearIntermediatesMutation:ZIe,useAddImagesToBoardMutation:JIe,useRemoveImagesFromBoardMutation:eOe,useAddImageToBoardMutation:tOe,useRemoveImageFromBoardMutation:nOe,useChangeImageIsIntermediateMutation:rOe,useChangeImageSessionIdMutation:iOe,useDeleteBoardAndImagesMutation:oOe,useDeleteBoardMutation:sOe,useStarImagesMutation:aOe,useUnstarImagesMutation:lOe,useGetImageMetadataFromFileQuery:uOe}=ge,V$=Me("socket/socketConnected"),YT=Me("socket/appSocketConnected"),G$=Me("socket/socketDisconnected"),q$=Me("socket/appSocketDisconnected"),rfe=Me("socket/socketSubscribedSession"),ife=Me("socket/appSocketSubscribedSession"),ofe=Me("socket/socketUnsubscribedSession"),sfe=Me("socket/appSocketUnsubscribedSession"),H$=Me("socket/socketInvocationStarted"),ZT=Me("socket/appSocketInvocationStarted"),JT=Me("socket/socketInvocationComplete"),e5=Me("socket/appSocketInvocationComplete"),W$=Me("socket/socketInvocationError"),Rb=Me("socket/appSocketInvocationError"),K$=Me("socket/socketGraphExecutionStateComplete"),Q$=Me("socket/appSocketGraphExecutionStateComplete"),X$=Me("socket/socketGeneratorProgress"),t5=Me("socket/appSocketGeneratorProgress"),Y$=Me("socket/socketModelLoadStarted"),Z$=Me("socket/appSocketModelLoadStarted"),J$=Me("socket/socketModelLoadCompleted"),eF=Me("socket/appSocketModelLoadCompleted"),tF=Me("socket/socketSessionRetrievalError"),nF=Me("socket/appSocketSessionRetrievalError"),rF=Me("socket/socketInvocationRetrievalError"),iF=Me("socket/appSocketInvocationRetrievalError"),oF=Me("socket/socketQueueItemStatusChanged"),n5=Me("socket/appSocketQueueItemStatusChanged"),r5=Me("controlNet/imageProcessed"),Rd={none:{type:"none",get label(){return we.t("controlnet.none")},get description(){return we.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return we.t("controlnet.canny")},get description(){return we.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 we.t("controlnet.contentShuffle")},get description(){return we.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 we.t("controlnet.hed")},get description(){return we.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 we.t("controlnet.lineartAnime")},get description(){return we.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 we.t("controlnet.lineart")},get description(){return we.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 we.t("controlnet.mediapipeFace")},get description(){return we.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 we.t("controlnet.depthMidas")},get description(){return we.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 we.t("controlnet.mlsd")},get description(){return we.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 we.t("controlnet.normalBae")},get description(){return we.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 we.t("controlnet.openPose")},get description(){return we.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 we.t("controlnet.pidi")},get description(){return we.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 we.t("controlnet.depthZoe")},get description(){return we.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},Fy={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"},G6={isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Rd.canny_image_processor.default,shouldAutoConfig:!0},sF={adapterImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},BC={controlNets:{},isEnabled:!1,pendingControlImages:[],isIPAdapterEnabled:!1,ipAdapterInfo:{...sF}},aF=Kn({name:"controlNet",initialState:BC,reducers:{isControlNetEnabledToggled:e=>{e.isEnabled=!e.isEnabled},controlNetAdded:(e,t)=>{const{controlNetId:n,controlNet:r}=t.payload;e.controlNets[n]={...r??G6,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]={...G6,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 Fy)if(r.model_name.includes(s)){o=Fy[s];break}o?(i.processorType=o,i.processorNode=Rd[o].default):(i.processorType="none",i.processorNode=Rd.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=Rd[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 Fy)if((o=r.model)!=null&&o.model_name.includes(a)){s=Fy[a];break}s?(r.processorType=s,r.processorNode=Rd[s].default):(r.processorType="none",r.processorNode=Rd.none.default)}r.shouldAutoConfig=i},controlNetReset:()=>({...BC}),isIPAdapterEnableToggled:e=>{e.isIPAdapterEnabled=!e.isIPAdapterEnabled},ipAdapterImageChanged:(e,t)=>{e.ipAdapterInfo.adapterImage=t.payload},ipAdapterWeightChanged:(e,t)=>{e.ipAdapterInfo.weight=t.payload},ipAdapterModelChanged:(e,t)=>{e.ipAdapterInfo.model=t.payload},ipAdapterBeginStepPctChanged:(e,t)=>{e.ipAdapterInfo.beginStepPct=t.payload},ipAdapterEndStepPctChanged:(e,t)=>{e.ipAdapterInfo.endStepPct=t.payload},ipAdapterStateReset:e=>{e.isIPAdapterEnabled=!1,e.ipAdapterInfo={...sF}}},extraReducers:e=>{e.addCase(r5,(t,n)=>{const r=t.controlNets[n.payload.controlNetId];r&&r.controlImage!==null&&t.pendingControlImages.push(n.payload.controlNetId)}),e.addCase(Rb,t=>{t.pendingControlImages=[]}),e.addMatcher(PD,t=>{t.pendingControlImages=[]}),e.addMatcher(ge.endpoints.deleteImage.matchFulfilled,(t,n)=>{const{image_name:r}=n.meta.arg.originalArgs;Mo(t.controlNets,i=>{i.controlImage===r&&(i.controlImage=null,i.processedControlImage=null),i.processedControlImage===r&&(i.processedControlImage=null)})})}}),{isControlNetEnabledToggled:cOe,controlNetAdded:dOe,controlNetDuplicated:fOe,controlNetAddedFromImage:hOe,controlNetRemoved:lF,controlNetImageChanged:Xc,controlNetProcessedImageChanged:i5,controlNetToggled:pOe,controlNetModelChanged:q6,controlNetWeightChanged:gOe,controlNetBeginStepPctChanged:mOe,controlNetEndStepPctChanged:yOe,controlNetControlModeChanged:vOe,controlNetResizeModeChanged:_Oe,controlNetProcessorParamsChanged:afe,controlNetProcessorTypeChanged:lfe,controlNetReset:ufe,controlNetAutoConfigToggled:H6,isIPAdapterEnableToggled:bOe,ipAdapterImageChanged:Ib,ipAdapterWeightChanged:SOe,ipAdapterModelChanged:wOe,ipAdapterBeginStepPctChanged:xOe,ipAdapterEndStepPctChanged:COe,ipAdapterStateReset:uF}=aF.actions,cfe=aF.reducer,dfe={imagesToDelete:[],isModalOpen:!1},cF=Kn({name:"deleteImageModal",initialState:dfe,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:o5,imagesToDeleteSelected:ffe,imageDeletionCanceled:EOe}=cF.actions,hfe=cF.reducer,s5={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},pfe=s5,dF=Kn({name:"dynamicPrompts",initialState:pfe,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=s5.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},promptsChanged:(e,t)=>{e.prompts=t.payload},parsingErrorChanged:(e,t)=>{e.parsingError=t.payload},isErrorChanged:(e,t)=>{e.isError=t.payload},isLoadingChanged:(e,t)=>{e.isLoading=t.payload},seedBehaviourChanged:(e,t)=>{e.seedBehaviour=t.payload}}}),{maxPromptsChanged:gfe,maxPromptsReset:mfe,combinatorialToggled:yfe,promptsChanged:vfe,parsingErrorChanged:_fe,isErrorChanged:W6,isLoadingChanged:hw,seedBehaviourChanged:TOe}=dF.actions,bfe=dF.reducer,fF={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},hF=Kn({name:"gallery",initialState:fF,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(wfe,(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(fi.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:fa,shouldAutoSwitchChanged:AOe,autoAssignBoardOnClickChanged:kOe,setGalleryImageMinimumWidth:POe,boardIdSelected:zC,autoAddBoardIdChanged:ROe,galleryViewChanged:h1,selectionChanged:pF,boardSearchTextChanged:IOe}=hF.actions,Sfe=hF.reducer,wfe=Xi(ge.endpoints.deleteBoard.matchFulfilled,ge.endpoints.deleteBoardAndImages.matchFulfilled),K6={weight:.75},xfe={loras:{}},gF=Kn({name:"lora",initialState:xfe,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,...K6}},loraRecalled:(e,t)=>{const{model_name:n,id:r,base_model:i,weight:o}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,weight:o}},loraRemoved:(e,t)=>{const n=t.payload;delete e.loras[n]},lorasCleared:e=>{e.loras={}},loraWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload,i=e.loras[n];i&&(i.weight=r)},loraWeightReset:(e,t)=>{const n=t.payload,r=e.loras[n];r&&(r.weight=K6.weight)}}}),{loraAdded:OOe,loraRemoved:mF,loraWeightChanged:MOe,loraWeightReset:NOe,lorasCleared:DOe,loraRecalled:LOe}=gF.actions,Cfe=gF.reducer;function is(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=is(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const Q6=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},Efe=e=>e?Q6(e):Q6,{useSyncExternalStoreWithSelector:Tfe}=rde;function yF(e,t=e.getState,n){const r=Tfe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const X6=(e,t)=>{const n=Efe(e),r=(i,o=t)=>yF(n,i,o);return Object.assign(r,n),r},Afe=(e,t)=>e?X6(e,t):X6;function go(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 kfe={value:()=>{}};function Ob(){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 L0(n)}function L0(e){this._=e}function Pfe(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}})}L0.prototype=Ob.prototype={constructor:L0,on:function(e,t){var n=this._,r=Pfe(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Rfe(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]=Y6(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Y6(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 L0(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 Rfe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Y6(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=kfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jC="http://www.w3.org/1999/xhtml";const Z6={svg:"http://www.w3.org/2000/svg",xhtml:jC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Mb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Z6.hasOwnProperty(t)?{space:Z6[t],local:e}:e}function Ife(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===jC&&t.documentElement.namespaceURI===jC?t.createElement(e):t.createElementNS(n,e)}}function Ofe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vF(e){var t=Mb(e);return(t.local?Ofe:Ife)(t)}function Mfe(){}function a5(e){return e==null?Mfe:function(){return this.querySelector(e)}}function Nfe(e){typeof e!="function"&&(e=a5(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 Dfe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lfe(){return[]}function _F(e){return e==null?Lfe:function(){return this.querySelectorAll(e)}}function $fe(e){return function(){return Dfe(e.apply(this,arguments))}}function Ffe(e){typeof e=="function"?e=$fe(e):e=_F(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 bF(e){return function(){return this.matches(e)}}function SF(e){return function(t){return t.matches(e)}}var Bfe=Array.prototype.find;function zfe(e){return function(){return Bfe.call(this.children,e)}}function jfe(){return this.firstElementChild}function Ufe(e){return this.select(e==null?jfe:zfe(typeof e=="function"?e:SF(e)))}var Vfe=Array.prototype.filter;function Gfe(){return Array.from(this.children)}function qfe(e){return function(){return Vfe.call(this.children,e)}}function Hfe(e){return this.selectAll(e==null?Gfe:qfe(typeof e=="function"?e:SF(e)))}function Wfe(e){typeof e!="function"&&(e=bF(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 wF(e){return new Array(e.length)}function Kfe(){return new No(this._enter||this._groups.map(wF),this._parents)}function p1(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}p1.prototype={constructor:p1,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 Qfe(e){return function(){return e}}function Xfe(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 p1(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Yfe(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 p1(e,o[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(i[a]=l)}function Zfe(e){return e.__data__}function Jfe(e,t){if(!arguments.length)return Array.from(this,Zfe);var n=t?Yfe:Xfe,r=this._parents,i=this._groups;typeof e!="function"&&(e=Qfe(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=ehe(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 v=0,g=0,y,S;v<p;++v)if(y=m[v]){for(v>=g&&(g=v+1);!(S=b[g])&&++g<p;);y._next=S||null}}return s=new No(s,r),s._enter=a,s._exit=l,s}function ehe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function the(){return new No(this._exit||this._groups.map(wF),this._parents)}function nhe(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 rhe(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 ihe(){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 ohe(e){e||(e=she);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 she(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ahe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function lhe(){return Array.from(this)}function uhe(){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 che(){let e=0;for(const t of this)++e;return e}function dhe(){return!this.node()}function fhe(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 hhe(e){return function(){this.removeAttribute(e)}}function phe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ghe(e,t){return function(){this.setAttribute(e,t)}}function mhe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yhe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function vhe(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 _he(e,t){var n=Mb(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?phe:hhe:typeof t=="function"?n.local?vhe:yhe:n.local?mhe:ghe)(n,t))}function xF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bhe(e){return function(){this.style.removeProperty(e)}}function She(e,t,n){return function(){this.style.setProperty(e,t,n)}}function whe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function xhe(e,t,n){return arguments.length>1?this.each((t==null?bhe:typeof t=="function"?whe:She)(e,t,n??"")):Vf(this.node(),e)}function Vf(e,t){return e.style.getPropertyValue(t)||xF(e).getComputedStyle(e,null).getPropertyValue(t)}function Che(e){return function(){delete this[e]}}function Ehe(e,t){return function(){this[e]=t}}function The(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ahe(e,t){return arguments.length>1?this.each((t==null?Che:typeof t=="function"?The:Ehe)(e,t)):this.node()[e]}function CF(e){return e.trim().split(/^|\s+/)}function l5(e){return e.classList||new EF(e)}function EF(e){this._node=e,this._names=CF(e.getAttribute("class")||"")}EF.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 TF(e,t){for(var n=l5(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function AF(e,t){for(var n=l5(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function khe(e){return function(){TF(this,e)}}function Phe(e){return function(){AF(this,e)}}function Rhe(e,t){return function(){(t.apply(this,arguments)?TF:AF)(this,e)}}function Ihe(e,t){var n=CF(e+"");if(arguments.length<2){for(var r=l5(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Rhe:t?khe:Phe)(n,t))}function Ohe(){this.textContent=""}function Mhe(e){return function(){this.textContent=e}}function Nhe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dhe(e){return arguments.length?this.each(e==null?Ohe:(typeof e=="function"?Nhe:Mhe)(e)):this.node().textContent}function Lhe(){this.innerHTML=""}function $he(e){return function(){this.innerHTML=e}}function Fhe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Bhe(e){return arguments.length?this.each(e==null?Lhe:(typeof e=="function"?Fhe:$he)(e)):this.node().innerHTML}function zhe(){this.nextSibling&&this.parentNode.appendChild(this)}function jhe(){return this.each(zhe)}function Uhe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vhe(){return this.each(Uhe)}function Ghe(e){var t=typeof e=="function"?e:vF(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qhe(){return null}function Hhe(e,t){var n=typeof e=="function"?e:vF(e),r=t==null?qhe:typeof t=="function"?t:a5(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Whe(){var e=this.parentNode;e&&e.removeChild(this)}function Khe(){return this.each(Whe)}function Qhe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xhe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Yhe(e){return this.select(e?Xhe:Qhe)}function Zhe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Jhe(e){return function(t){e.call(this,t,this.__data__)}}function epe(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 tpe(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 npe(e,t,n){return function(){var r=this.__on,i,o=Jhe(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 rpe(e,t,n){var r=epe(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?npe:tpe,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function kF(e,t,n){var r=xF(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 ipe(e,t){return function(){return kF(this,e,t)}}function ope(e,t){return function(){return kF(this,e,t.apply(this,arguments))}}function spe(e,t){return this.each((typeof t=="function"?ope:ipe)(e,t))}function*ape(){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 PF=[null];function No(e,t){this._groups=e,this._parents=t}function $m(){return new No([[document.documentElement]],PF)}function lpe(){return this}No.prototype=$m.prototype={constructor:No,select:Nfe,selectAll:Ffe,selectChild:Ufe,selectChildren:Hfe,filter:Wfe,data:Jfe,enter:Kfe,exit:the,join:nhe,merge:rhe,selection:lpe,order:ihe,sort:ohe,call:ahe,nodes:lhe,node:uhe,size:che,empty:dhe,each:fhe,attr:_he,style:xhe,property:Ahe,classed:Ihe,text:Dhe,html:Bhe,raise:jhe,lower:Vhe,append:Ghe,insert:Hhe,remove:Khe,clone:Yhe,datum:Zhe,on:rpe,dispatch:spe,[Symbol.iterator]:ape};function xs(e){return typeof e=="string"?new No([[document.querySelector(e)]],[document.documentElement]):new No([[e]],PF)}function upe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ys(e,t){if(e=upe(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 cpe={passive:!1},Og={capture:!0,passive:!1};function pw(e){e.stopImmediatePropagation()}function hf(e){e.preventDefault(),e.stopImmediatePropagation()}function RF(e){var t=e.document.documentElement,n=xs(e).on("dragstart.drag",hf,Og);"onselectstart"in t?n.on("selectstart.drag",hf,Og):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function IF(e,t){var n=e.document.documentElement,r=xs(e).on("dragstart.drag",null);t&&(r.on("click.drag",hf,Og),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 By=e=>()=>e;function UC(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}})}UC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function dpe(e){return!e.ctrlKey&&!e.button}function fpe(){return this.parentNode}function hpe(e,t){return t??{x:e.x,y:e.y}}function ppe(){return navigator.maxTouchPoints||"ontouchstart"in this}function gpe(){var e=dpe,t=fpe,n=hpe,r=ppe,i={},o=Ob("start","drag","end"),s=0,a,l,u,c,d=0;function f(y){y.on("mousedown.drag",h).filter(r).on("touchstart.drag",b).on("touchmove.drag",_,cpe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(y,S){if(!(c||!e.call(this,y,S))){var w=g(this,t.call(this,y,S),y,S,"mouse");w&&(xs(y.view).on("mousemove.drag",p,Og).on("mouseup.drag",m,Og),RF(y.view),pw(y),u=!1,a=y.clientX,l=y.clientY,w("start",y))}}function p(y){if(hf(y),!u){var S=y.clientX-a,w=y.clientY-l;u=S*S+w*w>d}i.mouse("drag",y)}function m(y){xs(y.view).on("mousemove.drag mouseup.drag",null),IF(y.view,u),hf(y),i.mouse("end",y)}function b(y,S){if(e.call(this,y,S)){var w=y.changedTouches,x=t.call(this,y,S),C=w.length,A,T;for(A=0;A<C;++A)(T=g(this,x,y,S,w[A].identifier,w[A]))&&(pw(y),T("start",y,w[A]))}}function _(y){var S=y.changedTouches,w=S.length,x,C;for(x=0;x<w;++x)(C=i[S[x].identifier])&&(hf(y),C("drag",y,S[x]))}function v(y){var S=y.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])&&(pw(y),C("end",y,S[x]))}function g(y,S,w,x,C,A){var T=o.copy(),P=Ys(A||w,S),L,R,E;if((E=n.call(y,new UC("beforestart",{sourceEvent:w,target:f,identifier:C,active:s,x:P[0],y:P[1],dx:0,dy:0,dispatch:T}),x))!=null)return L=E.x-P[0]||0,R=E.y-P[1]||0,function k(D,$,O){var I=P,N;switch(D){case"start":i[C]=k,N=s++;break;case"end":delete i[C],--s;case"drag":P=Ys(O||$,S),N=s;break}T.call(D,y,new UC(D,{sourceEvent:$,subject:E,target:f,identifier:C,active:N,x:P[0]+L,y:P[1]+R,dx:P[0]-I[0],dy:P[1]-I[1],dispatch:T}),x)}}return f.filter=function(y){return arguments.length?(e=typeof y=="function"?y:By(!!y),f):e},f.container=function(y){return arguments.length?(t=typeof y=="function"?y:By(y),f):t},f.subject=function(y){return arguments.length?(n=typeof y=="function"?y:By(y),f):n},f.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:By(!!y),f):r},f.on=function(){var y=o.on.apply(o,arguments);return y===o?f:y},f.clickDistance=function(y){return arguments.length?(d=(y=+y)*y,f):Math.sqrt(d)},f}function u5(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function OF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Fm(){}var Mg=.7,g1=1/Mg,pf="\\s*([+-]?\\d+)\\s*",Ng="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ha="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mpe=/^#([0-9a-f]{3,8})$/,ype=new RegExp(`^rgb\\(${pf},${pf},${pf}\\)$`),vpe=new RegExp(`^rgb\\(${ha},${ha},${ha}\\)$`),_pe=new RegExp(`^rgba\\(${pf},${pf},${pf},${Ng}\\)$`),bpe=new RegExp(`^rgba\\(${ha},${ha},${ha},${Ng}\\)$`),Spe=new RegExp(`^hsl\\(${Ng},${ha},${ha}\\)$`),wpe=new RegExp(`^hsla\\(${Ng},${ha},${ha},${Ng}\\)$`),J6={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};u5(Fm,Dg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:e8,formatHex:e8,formatHex8:xpe,formatHsl:Cpe,formatRgb:t8,toString:t8});function e8(){return this.rgb().formatHex()}function xpe(){return this.rgb().formatHex8()}function Cpe(){return MF(this).formatHsl()}function t8(){return this.rgb().formatRgb()}function Dg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mpe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?n8(t):n===3?new lo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zy(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=ype.exec(e))?new lo(t[1],t[2],t[3],1):(t=vpe.exec(e))?new lo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_pe.exec(e))?zy(t[1],t[2],t[3],t[4]):(t=bpe.exec(e))?zy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Spe.exec(e))?o8(t[1],t[2]/100,t[3]/100,1):(t=wpe.exec(e))?o8(t[1],t[2]/100,t[3]/100,t[4]):J6.hasOwnProperty(e)?n8(J6[e]):e==="transparent"?new lo(NaN,NaN,NaN,0):null}function n8(e){return new lo(e>>16&255,e>>8&255,e&255,1)}function zy(e,t,n,r){return r<=0&&(e=t=n=NaN),new lo(e,t,n,r)}function Epe(e){return e instanceof Fm||(e=Dg(e)),e?(e=e.rgb(),new lo(e.r,e.g,e.b,e.opacity)):new lo}function VC(e,t,n,r){return arguments.length===1?Epe(e):new lo(e,t,n,r??1)}function lo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}u5(lo,VC,OF(Fm,{brighter(e){return e=e==null?g1:Math.pow(g1,e),new lo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mg:Math.pow(Mg,e),new lo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new lo(Sc(this.r),Sc(this.g),Sc(this.b),m1(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:r8,formatHex:r8,formatHex8:Tpe,formatRgb:i8,toString:i8}));function r8(){return`#${dc(this.r)}${dc(this.g)}${dc(this.b)}`}function Tpe(){return`#${dc(this.r)}${dc(this.g)}${dc(this.b)}${dc((isNaN(this.opacity)?1:this.opacity)*255)}`}function i8(){const e=m1(this.opacity);return`${e===1?"rgb(":"rgba("}${Sc(this.r)}, ${Sc(this.g)}, ${Sc(this.b)}${e===1?")":`, ${e})`}`}function m1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dc(e){return e=Sc(e),(e<16?"0":"")+e.toString(16)}function o8(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 MF(e){if(e instanceof Cs)return new Cs(e.h,e.s,e.l,e.opacity);if(e instanceof Fm||(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 Ape(e,t,n,r){return arguments.length===1?MF(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}u5(Cs,Ape,OF(Fm,{brighter(e){return e=e==null?g1:Math.pow(g1,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 lo(gw(e>=240?e-240:e+120,i,r),gw(e,i,r),gw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cs(s8(this.h),jy(this.s),jy(this.l),m1(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=m1(this.opacity);return`${e===1?"hsl(":"hsla("}${s8(this.h)}, ${jy(this.s)*100}%, ${jy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function s8(e){return e=(e||0)%360,e<0?e+360:e}function jy(e){return Math.max(0,Math.min(1,e||0))}function gw(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 NF=e=>()=>e;function kpe(e,t){return function(n){return e+n*t}}function Ppe(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 Rpe(e){return(e=+e)==1?DF:function(t,n){return n-t?Ppe(t,n,e):NF(isNaN(t)?n:t)}}function DF(e,t){var n=t-e;return n?kpe(e,n):NF(isNaN(e)?t:e)}const a8=function e(t){var n=Rpe(t);function r(i,o){var s=n((i=VC(i)).r,(o=VC(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=DF(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 Rl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var GC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mw=new RegExp(GC.source,"g");function Ipe(e){return function(){return e}}function Ope(e){return function(t){return e(t)+""}}function Mpe(e,t){var n=GC.lastIndex=mw.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=GC.exec(e))&&(i=mw.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:Rl(r,i)})),n=mw.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Ope(l[0].x):Ipe(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 l8=180/Math.PI,qC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function LF(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)*l8,skewX:Math.atan(l)*l8,scaleX:s,scaleY:a}}var Uy;function Npe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qC:LF(t.a,t.b,t.c,t.d,t.e,t.f)}function Dpe(e){return e==null||(Uy||(Uy=document.createElementNS("http://www.w3.org/2000/svg","g")),Uy.setAttribute("transform",e),!(e=Uy.transform.baseVal.consolidate()))?qC:(e=e.matrix,LF(e.a,e.b,e.c,e.d,e.e,e.f))}function $F(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:Rl(u,d)},{i:m-2,x:Rl(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:Rl(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:Rl(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:Rl(u,d)},{i:m-2,x:Rl(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 Lpe=$F(Npe,"px, ","px)","deg)"),$pe=$F(Dpe,", ",")",")"),Fpe=1e-12;function u8(e){return((e=Math.exp(e))+1/e)/2}function Bpe(e){return((e=Math.exp(e))-1/e)/2}function zpe(e){return((e=Math.exp(2*e))-1)/(e+1)}const jpe=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<Fpe)_=Math.log(f/u)/t,b=function(x){return[a+x*h,l+x*p,u*Math.exp(t*x*_)]};else{var v=Math.sqrt(m),g=(f*f-u*u+r*m)/(2*u*n*v),y=(f*f-u*u-r*m)/(2*f*n*v),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(y*y+1)-y);_=(w-S)/t,b=function(x){var C=x*_,A=u8(S),T=u/(n*v)*(A*zpe(t*C+S)-Bpe(S));return[a+T*h,l+T*p,u*A/u8(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,np=0,Dh=0,FF=1e3,y1,rp,v1=0,Lc=0,Nb=0,Lg=typeof performance=="object"&&performance.now?performance:Date,BF=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function c5(){return Lc||(BF(Upe),Lc=Lg.now()+Nb)}function Upe(){Lc=0}function _1(){this._call=this._time=this._next=null}_1.prototype=zF.prototype={constructor:_1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?c5():+n)+(t==null?0:+t),!this._next&&rp!==this&&(rp?rp._next=this:y1=this,rp=this),this._call=e,this._time=n,HC()},stop:function(){this._call&&(this._call=null,this._time=1/0,HC())}};function zF(e,t,n){var r=new _1;return r.restart(e,t,n),r}function Vpe(){c5(),++Gf;for(var e=y1,t;e;)(t=Lc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Gf}function c8(){Lc=(v1=Lg.now())+Nb,Gf=np=0;try{Vpe()}finally{Gf=0,qpe(),Lc=0}}function Gpe(){var e=Lg.now(),t=e-v1;t>FF&&(Nb-=t,v1=e)}function qpe(){for(var e,t=y1,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:y1=n);rp=e,HC(r)}function HC(e){if(!Gf){np&&(np=clearTimeout(np));var t=e-Lc;t>24?(e<1/0&&(np=setTimeout(c8,e-Lg.now()-Nb)),Dh&&(Dh=clearInterval(Dh))):(Dh||(v1=Lg.now(),Dh=setInterval(Gpe,FF)),Gf=1,BF(c8))}}function d8(e,t,n){var r=new _1;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Hpe=Ob("start","end","cancel","interrupt"),Wpe=[],jF=0,f8=1,WC=2,$0=3,h8=4,KC=5,F0=6;function Db(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Kpe(e,n,{name:t,index:r,group:i,on:Hpe,tween:Wpe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jF})}function d5(e,t){var n=zs(e,t);if(n.state>jF)throw new Error("too late; already scheduled");return n}function Ca(e,t){var n=zs(e,t);if(n.state>$0)throw new Error("too late; already running");return n}function zs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Kpe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zF(o,0,n.time);function o(u){n.state=f8,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!==f8)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===$0)return d8(s);h.state===h8?(h.state=F0,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=F0,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(d8(function(){n.state===$0&&(n.state=h8,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=WC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===WC){for(n.state=$0,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=KC,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===KC&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=F0,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function B0(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>WC&&r.state<KC,r.state=F0,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function Qpe(e){return this.each(function(){B0(this,e)})}function Xpe(e,t){var n,r;return function(){var i=Ca(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 Ype(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ca(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 Zpe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=zs(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?Xpe:Ype)(n,e,t))}function f5(e,t,n){var r=e._id;return e.each(function(){var i=Ca(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return zs(i,r).value[t]}}function UF(e,t){var n;return(typeof t=="number"?Rl:t instanceof Dg?a8:(n=Dg(t))?(t=n,a8):Mpe)(e,t)}function Jpe(e){return function(){this.removeAttribute(e)}}function ege(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tge(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 nge(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 rge(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 ige(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 oge(e,t){var n=Mb(e),r=n==="transform"?$pe:UF;return this.attrTween(e,typeof t=="function"?(n.local?ige:rge)(n,r,f5(this,"attr."+e,t)):t==null?(n.local?ege:Jpe)(n):(n.local?nge:tge)(n,r,t))}function sge(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function age(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lge(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&age(e,o)),n}return i._value=t,i}function uge(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&sge(e,o)),n}return i._value=t,i}function cge(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=Mb(e);return this.tween(n,(r.local?lge:uge)(r,t))}function dge(e,t){return function(){d5(this,e).delay=+t.apply(this,arguments)}}function fge(e,t){return t=+t,function(){d5(this,e).delay=t}}function hge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dge:fge)(t,e)):zs(this.node(),t).delay}function pge(e,t){return function(){Ca(this,e).duration=+t.apply(this,arguments)}}function gge(e,t){return t=+t,function(){Ca(this,e).duration=t}}function mge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pge:gge)(t,e)):zs(this.node(),t).duration}function yge(e,t){if(typeof t!="function")throw new Error;return function(){Ca(this,e).ease=t}}function vge(e){var t=this._id;return arguments.length?this.each(yge(t,e)):zs(this.node(),t).ease}function _ge(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ca(this,e).ease=n}}function bge(e){if(typeof e!="function")throw new Error;return this.each(_ge(this._id,e))}function Sge(e){typeof e!="function"&&(e=bF(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 ll(r,this._parents,this._name,this._id)}function wge(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 ll(s,this._parents,this._name,this._id)}function xge(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 Cge(e,t,n){var r,i,o=xge(t)?d5:Ca;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function Ege(e,t){var n=this._id;return arguments.length<2?zs(this.node(),n).on.on(e):this.each(Cge(n,e,t))}function Tge(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Age(){return this.on("end.remove",Tge(this._id))}function kge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=a5(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,Db(u[f],t,n,f,u,zs(c,n)));return new ll(o,this._parents,t,n)}function Pge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_F(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=zs(c,n),m=0,b=f.length;m<b;++m)(h=f[m])&&Db(h,t,n,m,f,p);o.push(f),s.push(c)}return new ll(o,s,t,n)}var Rge=$m.prototype.constructor;function Ige(){return new Rge(this._groups,this._parents)}function Oge(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 VF(e){return function(){this.style.removeProperty(e)}}function Mge(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 Nge(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 Dge(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=Ca(this,e),u=l.on,c=l.value[o]==null?a||(a=VF(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(s,i=c),l.on=r}}function Lge(e,t,n){var r=(e+="")=="transform"?Lpe:UF;return t==null?this.styleTween(e,Oge(e,r)).on("end.style."+e,VF(e)):typeof t=="function"?this.styleTween(e,Nge(e,r,f5(this,"style."+e,t))).each(Dge(this._id,e)):this.styleTween(e,Mge(e,r,t),n).on("end.style."+e,null)}function $ge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Fge(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&$ge(e,s,n)),r}return o._value=t,o}function Bge(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,Fge(e,t,n??""))}function zge(e){return function(){this.textContent=e}}function jge(e){return function(){var t=e(this);this.textContent=t??""}}function Uge(e){return this.tween("text",typeof e=="function"?jge(f5(this,"text",e)):zge(e==null?"":e+""))}function Vge(e){return function(t){this.textContent=e.call(this,t)}}function Gge(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Vge(i)),t}return r._value=e,r}function qge(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,Gge(e))}function Hge(){for(var e=this._name,t=this._id,n=GF(),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=zs(l,t);Db(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ll(r,this._parents,e,n)}function Wge(){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=Ca(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 Kge=0;function ll(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function GF(){return++Kge}var Oa=$m.prototype;ll.prototype={constructor:ll,select:kge,selectAll:Pge,selectChild:Oa.selectChild,selectChildren:Oa.selectChildren,filter:Sge,merge:wge,selection:Ige,transition:Hge,call:Oa.call,nodes:Oa.nodes,node:Oa.node,size:Oa.size,empty:Oa.empty,each:Oa.each,on:Ege,attr:oge,attrTween:cge,style:Lge,styleTween:Bge,text:Uge,textTween:qge,remove:Age,tween:Zpe,delay:hge,duration:mge,ease:vge,easeVarying:bge,end:Wge,[Symbol.iterator]:Oa[Symbol.iterator]};function Qge(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Xge={time:null,delay:0,duration:250,ease:Qge};function Yge(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 Zge(e){var t,n;e instanceof ll?(t=e._id,e=e._name):(t=GF(),(n=Xge).time=c5(),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])&&Db(l,e,t,u,s,n||Yge(l,t));return new ll(r,this._parents,e,t)}$m.prototype.interrupt=Qpe;$m.prototype.transition=Zge;const Vy=e=>()=>e;function Jge(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 ou=new Ha(1,0,0);Ha.prototype;function yw(e){e.stopImmediatePropagation()}function Lh(e){e.preventDefault(),e.stopImmediatePropagation()}function eme(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tme(){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 p8(){return this.__zoom||ou}function nme(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rme(){return navigator.maxTouchPoints||"ontouchstart"in this}function ime(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 ome(){var e=eme,t=tme,n=ime,r=nme,i=rme,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=jpe,u=Ob("start","zoom","end"),c,d,f,h=500,p=150,m=0,b=10;function _(E){E.property("__zoom",p8).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(E,k,D,$){var O=E.selection?E.selection():E;O.property("__zoom",p8),E!==O?S(E,k,D,$):O.interrupt().each(function(){w(this,arguments).event($).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},_.scaleBy=function(E,k,D,$){_.scaleTo(E,function(){var O=this.__zoom.k,I=typeof k=="function"?k.apply(this,arguments):k;return O*I},D,$)},_.scaleTo=function(E,k,D,$){_.transform(E,function(){var O=t.apply(this,arguments),I=this.__zoom,N=D==null?y(O):typeof D=="function"?D.apply(this,arguments):D,B=I.invert(N),U=typeof k=="function"?k.apply(this,arguments):k;return n(g(v(I,U),N,B),O,s)},D,$)},_.translateBy=function(E,k,D,$){_.transform(E,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,$)},_.translateTo=function(E,k,D,$,O){_.transform(E,function(){var I=t.apply(this,arguments),N=this.__zoom,B=$==null?y(I):typeof $=="function"?$.apply(this,arguments):$;return n(ou.translate(B[0],B[1]).scale(N.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof D=="function"?-D.apply(this,arguments):-D),I,s)},$,O)};function v(E,k){return k=Math.max(o[0],Math.min(o[1],k)),k===E.k?E:new Ha(k,E.x,E.y)}function g(E,k,D){var $=k[0]-D[0]*E.k,O=k[1]-D[1]*E.k;return $===E.x&&O===E.y?E:new Ha(E.k,$,O)}function y(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,k,D,$){E.on("start.zoom",function(){w(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event($).end()}).tween("zoom",function(){var O=this,I=arguments,N=w(O,I).event($),B=t.apply(O,I),U=D==null?y(B):typeof D=="function"?D.apply(O,I):D,G=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Q=O.__zoom,Z=typeof k=="function"?k.apply(O,I):k,Y=l(Q.invert(U).concat(G/Q.k),Z.invert(U).concat(G/Z.k));return function(j){if(j===1)j=Z;else{var W=Y(j),te=G/W[2];j=new Ha(te,U[0]-W[0]*te,U[1]-W[1]*te)}N.zoom(null,j)}})}function w(E,k,D){return!D&&E.__zooming||new x(E,k)}function x(E,k){this.that=E,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,k),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,k){return this.mouse&&E!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var k=xs(this.that).datum();u.call(E,this.that,new Jge(E,{sourceEvent:this.sourceEvent,target:_,type:E,transform:this.that.__zoom,dispatch:u}),k)}};function C(E,...k){if(!e.apply(this,arguments))return;var D=w(this,k).event(E),$=this.__zoom,O=Math.max(o[0],Math.min(o[1],$.k*Math.pow(2,r.apply(this,arguments)))),I=Ys(E);if(D.wheel)(D.mouse[0][0]!==I[0]||D.mouse[0][1]!==I[1])&&(D.mouse[1]=$.invert(D.mouse[0]=I)),clearTimeout(D.wheel);else{if($.k===O)return;D.mouse=[I,$.invert(I)],B0(this),D.start()}Lh(E),D.wheel=setTimeout(N,p),D.zoom("mouse",n(g(v($,O),D.mouse[0],D.mouse[1]),D.extent,s));function N(){D.wheel=null,D.end()}}function A(E,...k){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,$=w(this,k,!0).event(E),O=xs(E.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),I=Ys(E,D),N=E.clientX,B=E.clientY;RF(E.view),yw(E),$.mouse=[I,this.__zoom.invert(I)],B0(this),$.start();function U(Q){if(Lh(Q),!$.moved){var Z=Q.clientX-N,Y=Q.clientY-B;$.moved=Z*Z+Y*Y>m}$.event(Q).zoom("mouse",n(g($.that.__zoom,$.mouse[0]=Ys(Q,D),$.mouse[1]),$.extent,s))}function G(Q){O.on("mousemove.zoom mouseup.zoom",null),IF(Q.view,$.moved),Lh(Q),$.event(Q).end()}}function T(E,...k){if(e.apply(this,arguments)){var D=this.__zoom,$=Ys(E.changedTouches?E.changedTouches[0]:E,this),O=D.invert($),I=D.k*(E.shiftKey?.5:2),N=n(g(v(D,I),$,O),t.apply(this,k),s);Lh(E),a>0?xs(this).transition().duration(a).call(S,N,$,E):xs(this).call(_.transform,N,$,E)}}function P(E,...k){if(e.apply(this,arguments)){var D=E.touches,$=D.length,O=w(this,k,E.changedTouches.length===$).event(E),I,N,B,U;for(yw(E),N=0;N<$;++N)B=D[N],U=Ys(B,this),U=[U,this.__zoom.invert(U),B.identifier],O.touch0?!O.touch1&&O.touch0[2]!==U[2]&&(O.touch1=U,O.taps=0):(O.touch0=U,I=!0,O.taps=1+!!c);c&&(c=clearTimeout(c)),I&&(O.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),B0(this),O.start())}}function L(E,...k){if(this.__zooming){var D=w(this,k).event(E),$=E.changedTouches,O=$.length,I,N,B,U;for(Lh(E),I=0;I<O;++I)N=$[I],B=Ys(N,this),D.touch0&&D.touch0[2]===N.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===N.identifier&&(D.touch1[0]=B);if(N=D.that.__zoom,D.touch1){var G=D.touch0[0],Q=D.touch0[1],Z=D.touch1[0],Y=D.touch1[1],j=(j=Z[0]-G[0])*j+(j=Z[1]-G[1])*j,W=(W=Y[0]-Q[0])*W+(W=Y[1]-Q[1])*W;N=v(N,Math.sqrt(j/W)),B=[(G[0]+Z[0])/2,(G[1]+Z[1])/2],U=[(Q[0]+Y[0])/2,(Q[1]+Y[1])/2]}else if(D.touch0)B=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(g(N,B,U),D.extent,s))}}function R(E,...k){if(this.__zooming){var D=w(this,k).event(E),$=E.changedTouches,O=$.length,I,N;for(yw(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),I=0;I<O;++I)N=$[I],D.touch0&&D.touch0[2]===N.identifier?delete D.touch0:D.touch1&&D.touch1[2]===N.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&&(N=Ys(N,this),Math.hypot(d[0]-N[0],d[1]-N[1])<b)){var B=xs(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return _.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Vy(+E),_):r},_.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Vy(!!E),_):e},_.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Vy(!!E),_):i},_.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Vy([[+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 Lb=M.createContext(null),sme=Lb.Provider,ul={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.`},qF=ul.error001();function dr(e,t){const n=M.useContext(Lb);if(n===null)throw new Error(qF);return yF(n,e,t)}const ri=()=>{const e=M.useContext(Lb);if(e===null)throw new Error(qF);return M.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},ame=e=>e.userSelectionActive?"none":"all";function lme({position:e,children:t,className:n,style:r,...i}){const o=dr(ame),s=`${e}`.split("-");return J.jsx("div",{className:is(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i,children:t})}function ume({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:J.jsx(lme,{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:J.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const cme=({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=is(["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:J.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[i&&J.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}),J.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var dme=M.memo(cme);const h5=e=>({width:e.offsetWidth,height:e.offsetHeight}),qf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),p5=(e={x:0,y:0},t)=>({x:qf(e.x,t[0][0],t[1][0]),y:qf(e.y,t[0][1],t[1][1])}),g8=(e,t,n)=>e<t?qf(Math.abs(e-t),1,50)/50:e>n?-qf(Math.abs(e-n),1,50)/50:0,HF=(e,t)=>{const n=g8(e.x,35,t.width-35)*20,r=g8(e.y,35,t.height-35)*20;return[n,r]},WF=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},KF=(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}),QF=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),m8=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$Oe=(e,t)=>QF(KF($g(e),$g(t))),QC=(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)},fme=e=>Yo(e.width)&&Yo(e.height)&&Yo(e.x)&&Yo(e.y),Yo=e=>!isNaN(e)&&isFinite(e),zr=Symbol.for("internals"),XF=["Enter"," ","Escape"],hme=(e,t)=>{},pme=e=>"nativeEvent"in e;function XC(e){var i,o;const t=pme(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 YF=e=>"clientX"in e,su=(e,t)=>{var o,s;const n=YF(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)}},b1=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Bm=({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})=>J.jsxs(J.Fragment,{children:[J.jsx("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&J.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Yo(n)&&Yo(r)?J.jsx(dme,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u}):null]});Bm.displayName="BaseEdge";function $h(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function ZF({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 JF({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 $c;(function(e){e.Strict="strict",e.Loose="loose"})($c||($c={}));var fc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fc||(fc={}));var _u;(function(e){e.Partial="partial",e.Full="full"})(_u||(_u={}));var Bl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Bl||(Bl={}));var S1;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(S1||(S1={}));var Je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Je||(Je={}));function y8({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Je.Left||e===Je.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function eB({sourceX:e,sourceY:t,sourcePosition:n=Je.Bottom,targetX:r,targetY:i,targetPosition:o=Je.Top}){const[s,a]=y8({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=y8({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=JF({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 g5=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Je.Bottom,targetPosition:o=Je.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[b,_,v]=eB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return J.jsx(Bm,{path:b,labelX:_,labelY:v,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});g5.displayName="SimpleBezierEdge";const v8={[Je.Left]:{x:-1,y:0},[Je.Right]:{x:1,y:0},[Je.Top]:{x:0,y:-1},[Je.Bottom]:{x:0,y:1}},gme=({source:e,sourcePosition:t=Je.Bottom,target:n})=>t===Je.Left||t===Je.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},_8=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function mme({source:e,sourcePosition:t=Je.Bottom,target:n,targetPosition:r=Je.Top,center:i,offset:o}){const s=v8[t],a=v8[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=gme({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},[v,g,y,S]=ZF({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){p=i.x||v,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 R=Math.abs(e[d]-n[d]);if(R<=o){const E=Math.min(o-1,o-R);s[d]===f?b[d]=(l[d]>e[d]?-1:1)*E:_[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const R=d==="x"?"y":"x",E=s[d]===a[R],k=l[R]>u[R],D=l[R]<u[R];(s[d]===1&&(!E&&k||E&&D)||s[d]!==1&&(!E&&D||E&&k))&&(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},P=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));P>=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,y,S]}function yme(e,t,n,r){const i=Math.min(_8(e,t)/2,_8(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 YC({sourceX:e,sourceY:t,sourcePosition:n=Je.Bottom,targetX:r,targetY:i,targetPosition:o=Je.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,d,f,h,p]=mme({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,_,v)=>{let g="";return v>0&&v<c.length-1?g=yme(c[v-1],_,c[v+1],s):g=`${v===0?"M":"L"}${_.x} ${_.y}`,b+=g,b},""),d,f,h,p]}const $b=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=Je.Bottom,targetPosition:f=Je.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:b})=>{const[_,v,g]=YC({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 J.jsx(Bm,{path:_,labelX:v,labelY:g,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:b})});$b.displayName="SmoothStepEdge";const m5=M.memo(e=>{var t;return J.jsx($b,{...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])})});m5.displayName="StepEdge";function vme({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=ZF({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const y5=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]=vme({sourceX:e,sourceY:t,targetX:n,targetY:r});return J.jsx(Bm,{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})});y5.displayName="StraightEdge";function Gy(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function b8({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case Je.Left:return[t-Gy(t-r,o),n];case Je.Right:return[t+Gy(r-t,o),n];case Je.Top:return[t,n-Gy(n-i,o)];case Je.Bottom:return[t,n+Gy(i-n,o)]}}function tB({sourceX:e,sourceY:t,sourcePosition:n=Je.Bottom,targetX:r,targetY:i,targetPosition:o=Je.Top,curvature:s=.25}){const[a,l]=b8({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,c]=b8({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[d,f,h,p]=JF({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 w1=M.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Je.Bottom,targetPosition:o=Je.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:b})=>{const[_,v,g]=tB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return J.jsx(Bm,{path:_,labelX:v,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:b})});w1.displayName="BezierEdge";const v5=M.createContext(null),_me=v5.Provider;v5.Consumer;const bme=()=>M.useContext(v5),Sme=e=>"id"in e&&"source"in e&&"target"in e,nB=e=>"id"in e&&!("source"in e)&&!("target"in e),wme=(e,t,n)=>{if(!nB(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},xme=(e,t,n)=>{if(!nB(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},Cme=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,ZC=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Eme=(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)),rB=(e,t)=>{if(!e.source||!e.target)return t;let n;return Sme(e)?n={...e}:n={...e,id:Cme(e)},Eme(n,t)?t:t.concat(n)},iB=({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},Tme=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),gf=(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}},_5=(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}=gf(i,t).positionAbsolute;return KF(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 QF(n)},oB=(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}=gf(c,a),b={x:m.x,y:m.y,width:d||0,height:f||0},_=QC(l,b),v=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&_>0,y=(d||0)*(f||0);(v||g||_>=y||c.dragging)&&u.push(c)}),u},b5=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},sB=(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=qf(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]},Xu=(e,t=0)=>e.transition().duration(t);function S8(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 Ame(e,t,n,r,i,o){const{x:s,y:a}=su(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=S5(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:aB()};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 kme={source:null,target:null,sourceHandle:null,targetHandle:null},aB=()=>({handleDomNode:null,isValid:!1,connection:kme,endHandle:null});function lB(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={...aB(),handleDomNode:l};if(l){const c=S5(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===$c.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 Pme({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=S8(o,s,"source",`${t}-${n}-${r}`),l=S8(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...l)}return i},[])}function S5(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vw(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Rme(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function uB({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=WF(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:b,getNodes:_,cancelConnection:v}=o();let g=0,y;const{x:S,y:w}=su(e),x=c==null?void 0:c.elementFromPoint(S,w),C=S5(l,x),A=f==null?void 0:f.getBoundingClientRect();if(!A||!C)return;let T,P=su(e,A),L=!1,R=null,E=!1,k=null;const D=Pme({nodes:_(),nodeId:n,handleId:t,handleType:C}),$=()=>{if(!h)return;const[N,B]=HF(P,A);b({x:N,y:B}),g=requestAnimationFrame($)};s({connectionPosition:P,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 O(N){const{transform:B}=o();P=su(N,A);const{handle:U,validHandleResult:G}=Ame(N,c,iB(P,B,!1,[1,1]),p,D,Q=>lB(Q,d,n,t,i?"target":"source",a,c));if(y=U,L||($(),L=!0),k=G.handleDomNode,R=G.connection,E=G.isValid,s({connectionPosition:y&&E?Tme({x:y.x,y:y.y},B):P,connectionStatus:Rme(!!y,E),connectionEndHandle:G.endHandle}),!y&&!E&&!k)return vw(T);R.source!==R.target&&k&&(vw(T),T=k,k.classList.add("connecting","react-flow__handle-connecting"),k.classList.toggle("valid",E),k.classList.toggle("react-flow__handle-valid",E))}function I(N){var B,U;(y||k)&&R&&E&&(r==null||r(R)),(U=(B=o()).onConnectEnd)==null||U.call(B,N),l&&(u==null||u(N)),vw(T),v(),cancelAnimationFrame(g),L=!1,E=!1,R=null,k=null,c.removeEventListener("mousemove",O),c.removeEventListener("mouseup",I),c.removeEventListener("touchmove",O),c.removeEventListener("touchend",I)}c.addEventListener("mousemove",O),c.addEventListener("mouseup",I),c.addEventListener("touchmove",O),c.addEventListener("touchend",I)}const w8=()=>!0,Ime=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Ome=(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}},cB=M.forwardRef(({type:e="source",position:t=Je.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=ri(),_=bme(),{connectOnClick:v,noPanClassName:g}=dr(Ime,go),{connecting:y,clickConnecting:S}=dr(Ome(_,p,e),go);_||(T=(A=b.getState()).onError)==null||T.call(A,"010",ul.error010());const w=P=>{const{defaultEdgeOptions:L,onConnect:R,hasDefaultEdges:E}=b.getState(),k={...L,...P};if(E){const{edges:D,setEdges:$}=b.getState();$(rB(k,D))}R==null||R(k),a==null||a(k)},x=P=>{if(!_)return;const L=YF(P);i&&(L&&P.button===0||!L)&&uB({event:P,handleId:p,nodeId:_,onConnect:w,isTarget:m,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||w8}),L?c==null||c(P):d==null||d(P)},C=P=>{const{onClickConnectStart:L,onClickConnectEnd:R,connectionClickStartHandle:E,connectionMode:k,isValidConnection:D}=b.getState();if(!_||!E&&!i)return;if(!E){L==null||L(P,{nodeId:_,handleId:p,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,handleId:p}});return}const $=WF(P.target),O=n||D||w8,{connection:I,isValid:N}=lB({nodeId:_,id:p,type:e},k,E.nodeId,E.handleId||null,E.type,O,$);N&&w(I),R==null||R(P),b.setState({connectionClickStartHandle:null})};return J.jsx("div",{"data-handleid":p,"data-nodeid":_,"data-handlepos":t,"data-id":`${_}-${p}-${e}`,className:is(["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&&!y||o&&y)}]),onMouseDown:x,onTouchStart:x,onClick:v?C:void 0,ref:h,...f,children:l})});cB.displayName="Handle";var x1=M.memo(cB);const dB=({data:e,isConnectable:t,targetPosition:n=Je.Top,sourcePosition:r=Je.Bottom})=>J.jsxs(J.Fragment,{children:[J.jsx(x1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,J.jsx(x1,{type:"source",position:r,isConnectable:t})]});dB.displayName="DefaultNode";var JC=M.memo(dB);const fB=({data:e,isConnectable:t,sourcePosition:n=Je.Bottom})=>J.jsxs(J.Fragment,{children:[e==null?void 0:e.label,J.jsx(x1,{type:"source",position:n,isConnectable:t})]});fB.displayName="InputNode";var hB=M.memo(fB);const pB=({data:e,isConnectable:t,targetPosition:n=Je.Top})=>J.jsxs(J.Fragment,{children:[J.jsx(x1,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});pB.displayName="OutputNode";var gB=M.memo(pB);const w5=()=>null;w5.displayName="GroupNode";const Mme=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),qy=e=>e.id;function Nme(e,t){return go(e.selectedNodes.map(qy),t.selectedNodes.map(qy))&&go(e.selectedEdges.map(qy),t.selectedEdges.map(qy))}const mB=M.memo(({onSelectionChange:e})=>{const t=ri(),{selectedNodes:n,selectedEdges:r}=dr(Mme,Nme);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});mB.displayName="SelectionListener";const Dme=e=>!!e.onSelectionChange;function Lme({onSelectionChange:e}){const t=dr(Dme);return e||t?J.jsx(mB,{onSelectionChange:e}):null}const $me=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 vd(e,t){M.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function kt(e,t,n){M.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Fme=({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:v,onEdgesChange:g,elementsSelectable:y,connectionMode:S,snapGrid:w,snapToGrid:x,translateExtent:C,connectOnClick:A,defaultEdgeOptions:T,fitView:P,fitViewOptions:L,onNodesDelete:R,onEdgesDelete:E,onNodeDrag:k,onNodeDragStart:D,onNodeDragStop:$,onSelectionDrag:O,onSelectionDragStart:I,onSelectionDragStop:N,noPanClassName:B,nodeOrigin:U,rfId:G,autoPanOnConnect:Q,autoPanOnNodeDrag:Z,onError:Y,connectionRadius:j,isValidConnection:W})=>{const{setNodes:te,setEdges:oe,setDefaultNodesAndEdges:ye,setMinZoom:le,setMaxZoom:pt,setTranslateExtent:nt,setNodeExtent:Fe,reset:ct}=dr($me,go),ke=ri();return M.useEffect(()=>{const Qt=r==null?void 0:r.map(br=>({...br,...T}));return ye(n,Qt),()=>{ct()}},[]),kt("defaultEdgeOptions",T,ke.setState),kt("connectionMode",S,ke.setState),kt("onConnect",i,ke.setState),kt("onConnectStart",o,ke.setState),kt("onConnectEnd",s,ke.setState),kt("onClickConnectStart",a,ke.setState),kt("onClickConnectEnd",l,ke.setState),kt("nodesDraggable",u,ke.setState),kt("nodesConnectable",c,ke.setState),kt("nodesFocusable",d,ke.setState),kt("edgesFocusable",f,ke.setState),kt("edgesUpdatable",h,ke.setState),kt("elementsSelectable",y,ke.setState),kt("elevateNodesOnSelect",p,ke.setState),kt("snapToGrid",x,ke.setState),kt("snapGrid",w,ke.setState),kt("onNodesChange",v,ke.setState),kt("onEdgesChange",g,ke.setState),kt("connectOnClick",A,ke.setState),kt("fitViewOnInit",P,ke.setState),kt("fitViewOnInitOptions",L,ke.setState),kt("onNodesDelete",R,ke.setState),kt("onEdgesDelete",E,ke.setState),kt("onNodeDrag",k,ke.setState),kt("onNodeDragStart",D,ke.setState),kt("onNodeDragStop",$,ke.setState),kt("onSelectionDrag",O,ke.setState),kt("onSelectionDragStart",I,ke.setState),kt("onSelectionDragStop",N,ke.setState),kt("noPanClassName",B,ke.setState),kt("nodeOrigin",U,ke.setState),kt("rfId",G,ke.setState),kt("autoPanOnConnect",Q,ke.setState),kt("autoPanOnNodeDrag",Z,ke.setState),kt("onError",Y,ke.setState),kt("connectionRadius",j,ke.setState),kt("isValidConnection",W,ke.setState),vd(e,te),vd(t,oe),vd(m,le),vd(b,pt),vd(C,nt),vd(_,Fe),null},x8={display:"none"},Bme={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},yB="react-flow__node-desc",vB="react-flow__edge-desc",zme="react-flow__aria-live",jme=e=>e.ariaLiveMessage;function Ume({rfId:e}){const t=dr(jme);return J.jsx("div",{id:`${zme}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Bme,children:t})}function Vme({rfId:e,disableKeyboardA11y:t}){return J.jsxs(J.Fragment,{children:[J.jsxs("div",{id:`${yB}-${e}`,style:x8,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."," "]}),J.jsx("div",{id:`${vB}-${e}`,style:x8,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&J.jsx(Ume,{rfId:e})]})}const Gme=typeof document<"u"?document:null;var Fg=(e=null,t={target:Gme})=>{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&&XC(h))return!1;const p=E8(h.code,a);o.current.add(h[p]),C8(s,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!i.current&&XC(h))return!1;const p=E8(h.code,a);C8(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 C8(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function E8(e,t){return t.includes(e)?"code":"key"}function _B(e,t,n,r){var s,a;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=gf(i,r);return _B(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 bB(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}=_B(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 _w(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)}),bB(i,n,o),i}function SB(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 v;const _=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(v=t.nodes)!=null&&v.length?_&&t.nodes.some(g=>g.id===b.id):_}),m=p.every(b=>b.width&&b.height);if(p.length>0&&m){const b=_5(p,d),[_,v,g]=sB(b,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),y=ou.translate(_,v).scale(g);return typeof t.duration=="number"&&t.duration>0?a.transform(Xu(l,t.duration),y):a.transform(l,y),!0}}return!1}function qme(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 Hme(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Hy({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:qme(e,i)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:Hme(t,o)}),a==null||a(t))}const _d=()=>{},Wme={zoomIn:_d,zoomOut:_d,zoomTo:_d,getZoom:()=>1,setViewport:_d,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:_d,fitBounds:_d,project:e=>e,viewportInitialized:!1},Kme=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Qme=()=>{const e=ri(),{d3Zoom:t,d3Selection:n}=dr(Kme,go);return M.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Xu(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Xu(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Xu(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,l]=e.getState().transform,u=ou.translate(i.x??s,i.y??a).scale(i.zoom??l);t.transform(Xu(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=>SB(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=ou.translate(d,f).scale(c);t.transform(Xu(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]=sB(i,s,a,l,u,(o==null?void 0:o.padding)??.1),h=ou.translate(c,d).scale(f);t.transform(Xu(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return iB(i,o,s,a)},viewportInitialized:!0}:Wme,[t,n])};function wB(){const e=Qme(),t=ri(),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:v,onNodesChange:g}=t.getState(),y=b(),S=typeof m=="function"?m(y):m;if(v)_(S);else if(g){const w=S.length===0?y.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:v,onEdgesChange:g}=t.getState(),y=typeof m=="function"?m(b):m;if(v)_(y);else if(g){const S=y.length===0?b.map(w=>({type:"remove",id:w.id})):y.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=M.useCallback(m=>{const b=Array.isArray(m)?m:[m],{getNodes:_,setNodes:v,hasDefaultNodes:g,onNodesChange:y}=t.getState();if(g){const w=[..._(),...b];v(w)}else if(y){const S=b.map(w=>({item:w,type:"add"}));y(S)}},[]),u=M.useCallback(m=>{const b=Array.isArray(m)?m:[m],{edges:_=[],setEdges:v,hasDefaultEdges:g,onEdgesChange:y}=t.getState();if(g)v([..._,...b]);else if(y){const S=b.map(w=>({item:w,type:"add"}));y(S)}},[]),c=M.useCallback(()=>{const{getNodes:m,edges:b=[],transform:_}=t.getState(),[v,g,y]=_;return{nodes:m().map(S=>({...S})),edges:b.map(S=>({...S})),viewport:{x:v,y:g,zoom:y}}},[]),d=M.useCallback(({nodes:m,edges:b})=>{const{nodeInternals:_,getNodes:v,edges:g,hasDefaultNodes:y,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:x,onNodesChange:C,onEdgesChange:A}=t.getState(),T=(m||[]).map(k=>k.id),P=(b||[]).map(k=>k.id),L=v().reduce((k,D)=>{const $=!T.includes(D.id)&&D.parentNode&&k.find(I=>I.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(T.includes(D.id)||$)&&k.push(D),k},[]),R=g.filter(k=>typeof k.deletable=="boolean"?k.deletable:!0),E=R.filter(k=>P.includes(k.id));if(L||E){const k=b5(L,R),D=[...E,...k],$=D.reduce((O,I)=>(O.includes(I.id)||O.push(I.id),O),[]);if((S||y)&&(S&&t.setState({edges:g.filter(O=>!$.includes(O.id))}),y&&(L.forEach(O=>{_.delete(O.id)}),t.setState({nodeInternals:new Map(_)}))),$.length>0&&(x==null||x(D),A&&A($.map(O=>({id:O,type:"remove"})))),L.length>0&&(w==null||w(L),C)){const O=L.map(I=>({id:I.id,type:"remove"}));C(O)}}},[]),f=M.useCallback(m=>{const b=fme(m),_=b?null:t.getState().nodeInternals.get(m.id);return[b?m:m8(_),_,b]},[]),h=M.useCallback((m,b=!0,_)=>{const[v,g,y]=f(m);return v?(_||t.getState().getNodes()).filter(S=>{if(!y&&(S.id===g.id||!S.positionAbsolute))return!1;const w=m8(S),x=QC(w,v);return b&&x>0||x>=m.width*m.height}):[]},[]),p=M.useCallback((m,b,_=!0)=>{const[v]=f(m);if(!v)return!1;const g=QC(v,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 Xme=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ri(),{deleteElements:r}=wB(),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 Yme(e){const t=ri();M.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=h5(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",ul.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 x5={position:"absolute",width:"100%",height:"100%",top:0,left:0},Zme=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wy=e=>({x:e.x,y:e.y,zoom:e.k}),bd=(e,t)=>e.target.closest(`.${t}`),T8=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),A8=e=>{const t=e.ctrlKey&&b1()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Jme=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),eye=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=fc.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:b,preventScrolling:_=!0,children:v,noWheelClassName:g,noPanClassName:y})=>{const S=M.useRef(),w=ri(),x=M.useRef(!1),C=M.useRef(!1),A=M.useRef(null),T=M.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:L,d3ZoomHandler:R,userSelectionActive:E}=dr(Jme,go),k=Fg(b),D=M.useRef(0),$=M.useRef(!1),O=M.useRef();return Yme(A),M.useEffect(()=>{if(A.current){const I=A.current.getBoundingClientRect(),N=ome().scaleExtent([p,m]).translateExtent(h),B=xs(A.current).call(N),U=ou.translate(f.x,f.y).scale(qf(f.zoom,p,m)),G=[[0,0],[I.width,I.height]],Q=N.constrain()(U,G,h);N.transform(B,Q),N.wheelDelta(A8),w.setState({d3Zoom:N,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[Q.x,Q.y,Q.k],domNode:A.current.closest(".react-flow")})}},[]),M.useEffect(()=>{L&&P&&(s&&!k&&!E?L.on("wheel.zoom",I=>{if(bd(I,g))return!1;I.preventDefault(),I.stopImmediatePropagation();const N=L.property("__zoom").k||1,B=b1();if(I.ctrlKey&&o&&B){const te=Ys(I),oe=A8(I),ye=N*Math.pow(2,oe);P.scaleTo(L,ye,te,I);return}const U=I.deltaMode===1?20:1;let G=l===fc.Vertical?0:I.deltaX*U,Q=l===fc.Horizontal?0:I.deltaY*U;!B&&I.shiftKey&&l!==fc.Vertical&&(G=I.deltaY*U,Q=0),P.translateBy(L,-(G/N)*a,-(Q/N)*a,{internal:!0});const Z=Wy(L.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:j,onViewportChangeEnd:W}=w.getState();clearTimeout(O.current),$.current||($.current=!0,t==null||t(I,Z),Y==null||Y(Z)),$.current&&(e==null||e(I,Z),j==null||j(Z),O.current=setTimeout(()=>{n==null||n(I,Z),W==null||W(Z),$.current=!1},150))},{passive:!1}):typeof R<"u"&&L.on("wheel.zoom",function(I,N){if(!_||bd(I,g))return null;I.preventDefault(),R.call(this,I,N)},{passive:!1}))},[E,s,l,L,P,R,k,o,_,g,t,e,n]),M.useEffect(()=>{P&&P.on("start",I=>{var U,G;if(!I.sourceEvent||I.sourceEvent.internal)return null;D.current=(U=I.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:N}=w.getState(),B=Wy(I.transform);x.current=!0,T.current=B,((G=I.sourceEvent)==null?void 0:G.type)==="mousedown"&&w.setState({paneDragging:!0}),N==null||N(B),t==null||t(I.sourceEvent,B)})},[P,t]),M.useEffect(()=>{P&&(E&&!x.current?P.on("zoom",null):E||P.on("zoom",I=>{var B;const{onViewportChange:N}=w.getState();if(w.setState({transform:[I.transform.x,I.transform.y,I.transform.k]}),C.current=!!(r&&T8(d,D.current??0)),(e||N)&&!((B=I.sourceEvent)!=null&&B.internal)){const U=Wy(I.transform);N==null||N(U),e==null||e(I.sourceEvent,U)}}))},[E,P,e,d,r]),M.useEffect(()=>{P&&P.on("end",I=>{if(!I.sourceEvent||I.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=w.getState();if(x.current=!1,w.setState({paneDragging:!1}),r&&T8(d,D.current??0)&&!C.current&&r(I.sourceEvent),C.current=!1,(n||N)&&Zme(T.current,I.transform)){const B=Wy(I.transform);T.current=B,clearTimeout(S.current),S.current=setTimeout(()=>{N==null||N(B),n==null||n(I.sourceEvent,B)},s?150:0)}})},[P,s,d,n,r]),M.useEffect(()=>{P&&P.filter(I=>{const N=k||i,B=o&&I.ctrlKey;if(I.button===1&&I.type==="mousedown"&&(bd(I,"react-flow__node")||bd(I,"react-flow__edge")))return!0;if(!d&&!N&&!s&&!u&&!o||E||!u&&I.type==="dblclick"||bd(I,g)&&I.type==="wheel"||bd(I,y)&&I.type!=="wheel"||!o&&I.ctrlKey&&I.type==="wheel"||!N&&!s&&!B&&I.type==="wheel"||!d&&(I.type==="mousedown"||I.type==="touchstart")||Array.isArray(d)&&!d.includes(I.button)&&(I.type==="mousedown"||I.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(I.button)||!I.button||I.button<=1;return(!I.ctrlKey||I.type==="wheel")&&U})},[E,P,i,o,s,u,d,c,k]),J.jsx("div",{className:"react-flow__renderer",ref:A,style:x5,children:v})},tye=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function nye(){const{userSelectionActive:e,userSelectionRect:t}=dr(tye,go);return e&&t?J.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 k8(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 xB(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&&k8(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&&k8(r,s);break}case"remove":return r}return r.push(s),r},n)}function Yu(e,t){return xB(e,t)}function zu(e,t){return xB(e,t)}const Il=(e,t)=>({id:e,type:"select",selected:t});function qd(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Il(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Il(r.id,!1))),n},[])}const bw=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},rye=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),CB=M.memo(({isSelecting:e,selectionMode:t=_u.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=ri(),p=M.useRef(0),m=M.useRef(0),b=M.useRef(),{userSelectionActive:_,elementsSelectable:v,dragging:g}=dr(rye,go),y=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},S=R=>{o==null||o(R),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=R=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){R.preventDefault();return}s==null||s(R)},x=a?R=>a(R):void 0,C=R=>{const{resetSelectedElements:E,domNode:k}=h.getState();if(b.current=k==null?void 0:k.getBoundingClientRect(),!v||!e||R.button!==0||R.target!==f.current||!b.current)return;const{x:D,y:$}=su(R,b.current);E(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:$,x:D,y:$}}),r==null||r(R)},A=R=>{const{userSelectionRect:E,nodeInternals:k,edges:D,transform:$,onNodesChange:O,onEdgesChange:I,nodeOrigin:N,getNodes:B}=h.getState();if(!e||!b.current||!E)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=su(R,b.current),G=E.startX??0,Q=E.startY??0,Z={...E,x:U.x<G?U.x:G,y:U.y<Q?U.y:Q,width:Math.abs(U.x-G),height:Math.abs(U.y-Q)},Y=B(),j=oB(k,Z,$,t===_u.Partial,!0,N),W=b5(j,D).map(oe=>oe.id),te=j.map(oe=>oe.id);if(p.current!==te.length){p.current=te.length;const oe=qd(Y,te);oe.length&&(O==null||O(oe))}if(m.current!==W.length){m.current=W.length;const oe=qd(D,W);oe.length&&(I==null||I(oe))}h.setState({userSelectionRect:Z})},T=R=>{if(R.button!==0)return;const{userSelectionRect:E}=h.getState();!_&&E&&R.target===f.current&&(S==null||S(R)),h.setState({nodesSelectionActive:p.current>0}),y(),i==null||i(R)},P=R=>{_&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(R)),y()},L=v&&(e||_);return J.jsxs("div",{className:is(["react-flow__pane",{dragging:g,selection:e}]),onClick:L?void 0:bw(S,f),onContextMenu:bw(w,f),onWheel:bw(x,f),onMouseEnter:L?void 0:l,onMouseDown:L?C:void 0,onMouseMove:L?A:u,onMouseUp:L?T:void 0,onMouseLeave:L?P:c,ref:f,style:x5,children:[d,J.jsx(nye,{})]})});CB.displayName="Pane";function EB(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:EB(n,t):!1}function P8(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 iye(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!EB(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 oye(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function TB(e,t,n,r,i=[0,0],o){const s=oye(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}=gf(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",ul.error005()),a=s;else if(e.extent&&e.parentNode){const c=n.get(e.parentNode),{x:d,y:f}=gf(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=gf(c,i).positionAbsolute}const u=a&&a!=="parent"?p5(t,a):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function Sw({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 R8=(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,...h5(l)}})};function Fh(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function e3({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",ul.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 sye(){const e=ri();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 ww(e){return(t,n,r)=>e==null?void 0:e(t,r)}function AB({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=ri(),[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),_=sye();return M.useEffect(()=>{if(e!=null&&e.current){const v=xs(e.current),g=({x:S,y:w})=>{const{nodeInternals:x,onNodeDrag:C,onSelectionDrag:A,updateNodePositions:T,nodeExtent:P,snapGrid:L,snapToGrid:R,nodeOrigin:E,onError:k}=a.getState();d.current={x:S,y:w};let D=!1,$={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&P){const I=_5(c.current,E);$=$g(I)}if(c.current=c.current.map(I=>{const N={x:S-I.distance.x,y:w-I.distance.y};R&&(N.x=L[0]*Math.round(N.x/L[0]),N.y=L[1]*Math.round(N.y/L[1]));const B=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];c.current.length>1&&P&&!I.extent&&(B[0][0]=I.positionAbsolute.x-$.x+P[0][0],B[1][0]=I.positionAbsolute.x+(I.width??0)-$.x2+P[1][0],B[0][1]=I.positionAbsolute.y-$.y+P[0][1],B[1][1]=I.positionAbsolute.y+(I.height??0)-$.y2+P[1][1]);const U=TB(I,N,x,B,E,k);return D=D||I.position.x!==U.position.x||I.position.y!==U.position.y,I.position=U.position,I.positionAbsolute=U.positionAbsolute,I}),!D)return;T(c.current,!0,!0),u(!0);const O=i?C:ww(A);if(O&&m.current){const[I,N]=Sw({nodeId:i,dragItems:c.current,nodeInternals:x});O(m.current,I,N)}},y=()=>{if(!h.current)return;const[S,w]=HF(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(y)};if(t)v.on(".drag",null);else{const S=gpe().on("start",w=>{var D;const{nodeInternals:x,multiSelectionActive:C,domNode:A,nodesDraggable:T,unselectNodesAndEdges:P,onNodeDragStart:L,onSelectionDragStart:R}=a.getState(),E=i?L:ww(R);!s&&!C&&i&&((D=x.get(i))!=null&&D.selected||P()),i&&o&&s&&e3({id:i,store:a,nodeRef:e});const k=_(w);if(d.current=k,c.current=iye(x,T,k,i),E&&c.current){const[$,O]=Sw({nodeId:i,dragItems:c.current,nodeInternals:x});E(w.sourceEvent,$,O)}h.current=(A==null?void 0:A.getBoundingClientRect())||null,p.current=su(w.sourceEvent,h.current)}).on("drag",w=>{const x=_(w),{autoPanOnNodeDrag:C}=a.getState();!b.current&&C&&(b.current=!0,y()),(d.current.x!==x.xSnapped||d.current.y!==x.ySnapped)&&c.current&&(m.current=w.sourceEvent,p.current=su(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(),P=i?A:ww(T);if(x(c.current,!1,!1),P){const[L,R]=Sw({nodeId:i,dragItems:c.current,nodeInternals:C});P(w.sourceEvent,L,R)}}}).filter(w=>{const x=w.target;return!w.button&&(!n||!P8(x,`.${n}`,e))&&(!r||P8(x,r,e))});return v.call(S),()=>{v.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,_]),l}function kB(){const e=ri();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(v=>v.selected&&(v.draggable||c&&typeof v.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(v=>{if(v.positionAbsolute){const g={x:v.positionAbsolute.x+m,y:v.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:y,position:S}=TB(v,g,r,i,void 0,u);v.position=S,v.positionAbsolute=y}return v});o(_,!0,!1)},[])}const mf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Bh=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:b,className:_,isDraggable:v,isSelectable:g,isConnectable:y,isFocusable:S,selectNodesOnDrag:w,sourcePosition:x,targetPosition:C,hidden:A,resizeObserver:T,dragHandle:P,zIndex:L,isParent:R,noDragClassName:E,noPanClassName:k,initialized:D,disableKeyboardA11y:$,ariaLabel:O,rfId:I})=>{const N=ri(),B=M.useRef(null),U=M.useRef(x),G=M.useRef(C),Q=M.useRef(r),Z=g||v||c||d||f||h,Y=kB(),j=Fh(n,N.getState,d),W=Fh(n,N.getState,f),te=Fh(n,N.getState,h),oe=Fh(n,N.getState,p),ye=Fh(n,N.getState,m),le=Fe=>{if(g&&(!w||!v)&&e3({id:n,store:N,nodeRef:B}),c){const ct=N.getState().nodeInternals.get(n);ct&&c(Fe,{...ct})}},pt=Fe=>{if(!XC(Fe))if(XF.includes(Fe.key)&&g){const ct=Fe.key==="Escape";e3({id:n,store:N,unselect:ct,nodeRef:B})}else!$&&v&&u&&Object.prototype.hasOwnProperty.call(mf,Fe.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${Fe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),Y({x:mf[Fe.key].x,y:mf[Fe.key].y,isShiftPressed:Fe.shiftKey}))};M.useEffect(()=>{if(B.current&&!A){const Fe=B.current;return T==null||T.observe(Fe),()=>T==null?void 0:T.unobserve(Fe)}},[A]),M.useEffect(()=>{const Fe=Q.current!==r,ct=U.current!==x,ke=G.current!==C;B.current&&(Fe||ct||ke)&&(Fe&&(Q.current=r),ct&&(U.current=x),ke&&(G.current=C),N.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,x,C]);const nt=AB({nodeRef:B,disabled:A||!v,noDragClassName:E,handleSelector:P,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return A?null:J.jsx("div",{className:is(["react-flow__node",`react-flow__node-${r}`,{[k]:v},_,{selected:u,selectable:g,parent:R,dragging:nt}]),ref:B,style:{zIndex:L,transform:`translate(${a}px,${l}px)`,pointerEvents:Z?"all":"none",visibility:D?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:W,onMouseLeave:te,onContextMenu:oe,onClick:le,onDoubleClick:ye,onKeyDown:S?pt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":$?void 0:`${yB}-${I}`,"aria-label":O,children:J.jsx(_me,{value:n,children:J.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:u,isConnectable:y,sourcePosition:x,targetPosition:C,dragging:nt,dragHandle:P,zIndex:L})})})};return t.displayName="NodeWrapper",M.memo(t)};const aye=e=>{const t=e.getNodes().filter(n=>n.selected);return{..._5(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function lye({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ri(),{width:i,height:o,x:s,y:a,transformString:l,userSelectionActive:u}=dr(aye,go),c=kB(),d=M.useRef(null);if(M.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),AB({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(mf,p.key)&&c({x:mf[p.key].x,y:mf[p.key].y,isShiftPressed:p.shiftKey})};return J.jsx("div",{className:is(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:J.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 uye=M.memo(lye);const cye=e=>e.nodesSelectionActive,PB=({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:v,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:A,panOnDrag:T,defaultViewport:P,translateExtent:L,minZoom:R,maxZoom:E,preventScrolling:k,onSelectionContextMenu:D,noWheelClassName:$,noPanClassName:O,disableKeyboardA11y:I})=>{const N=dr(cye),B=Fg(d),G=Fg(_)||T,Q=B||f&&G!==!0;return Xme({deleteKeyCode:a,multiSelectionKeyCode:b}),J.jsx(eye,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:A,panOnDrag:!B&&G,defaultViewport:P,translateExtent:L,minZoom:R,maxZoom:E,zoomActivationKeyCode:v,preventScrolling:k,noWheelClassName:$,noPanClassName:O,children:J.jsxs(CB,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:G,isSelecting:!!Q,selectionMode:h,children:[e,N&&J.jsx(uye,{onSelectionContextMenu:D,noPanClassName:O,disableKeyboardA11y:I})]})})};PB.displayName="FlowRenderer";var dye=M.memo(PB);function fye(e){return dr(M.useCallback(n=>e?oB(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function hye(e){const t={input:Bh(e.input||hB),default:Bh(e.default||JC),output:Bh(e.output||gB),group:Bh(e.group||w5)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Bh(e[o]||JC),i),n);return{...t,...r}}const pye=({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]},gye=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),RB=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=dr(gye,go),a=fye(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()},[]),J.jsx("div",{className:"react-flow__nodes",style:x5,children:a.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",ul.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?p5(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,v=(_==null?void 0:_.x)??0,g=(_==null?void 0:_.y)??0,y=pye({x:v,y:g,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return J.jsx(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Je.Bottom,targetPosition:c.targetPosition||Je.Top,hidden:c.hidden,xPos:v,yPos:g,xPosOrigin:y.x,yPosOrigin:y.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)})})};RB.displayName="NodeRenderer";var mye=M.memo(RB);const yye=(e,t,n)=>n===Je.Left?e-t:n===Je.Right?e+t:e,vye=(e,t,n)=>n===Je.Top?e-t:n===Je.Bottom?e+t:e,I8="react-flow__edgeupdater",O8=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>J.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:is([I8,`${I8}-${a}`]),cx:yye(t,r,e),cy:vye(n,r,e),r,stroke:"transparent",fill:"transparent"}),_ye=()=>!0;var Sd=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:v,sourceX:g,sourceY:y,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,elementsSelectable:A,hidden:T,sourceHandleId:P,targetHandleId:L,onContextMenu:R,onMouseEnter:E,onMouseMove:k,onMouseLeave:D,edgeUpdaterRadius:$,onEdgeUpdate:O,onEdgeUpdateStart:I,onEdgeUpdateEnd:N,markerEnd:B,markerStart:U,rfId:G,ariaLabel:Q,isFocusable:Z,isUpdatable:Y,pathOptions:j,interactionWidth:W})=>{const te=M.useRef(null),[oe,ye]=M.useState(!1),[le,pt]=M.useState(!1),nt=ri(),Fe=M.useMemo(()=>`url(#${ZC(U,G)})`,[U,G]),ct=M.useMemo(()=>`url(#${ZC(B,G)})`,[B,G]);if(T)return null;const ke=Rn=>{const{edges:hn,addSelectedEdges:wi}=nt.getState();if(A&&(nt.setState({nodesSelectionActive:!1}),wi([n])),s){const ii=hn.find(Bi=>Bi.id===n);s(Rn,ii)}},Qt=$h(n,nt.getState,a),br=$h(n,nt.getState,R),kn=$h(n,nt.getState,E),bn=$h(n,nt.getState,k),Xt=$h(n,nt.getState,D),Pn=(Rn,hn)=>{if(Rn.button!==0)return;const{edges:wi,isValidConnection:ii}=nt.getState(),Bi=hn?v:_,fs=(hn?L:P)||null,wr=hn?"target":"source",eo=ii||_ye,Aa=hn,vo=wi.find(Yt=>Yt.id===n);pt(!0),I==null||I(Rn,vo,wr);const ka=Yt=>{pt(!1),N==null||N(Yt,vo,wr)};uB({event:Rn,handleId:fs,nodeId:Bi,onConnect:Yt=>O==null?void 0:O(vo,Yt),isTarget:Aa,getState:nt.getState,setState:nt.setState,isValidConnection:eo,edgeUpdaterType:wr,onEdgeUpdateEnd:ka})},Sr=Rn=>Pn(Rn,!0),Ji=Rn=>Pn(Rn,!1),Vr=()=>ye(!0),or=()=>ye(!1),Ir=!A&&!s,Gr=Rn=>{var hn;if(XF.includes(Rn.key)&&A){const{unselectNodesAndEdges:wi,addSelectedEdges:ii,edges:Bi}=nt.getState();Rn.key==="Escape"?((hn=te.current)==null||hn.blur(),wi({edges:[Bi.find(wr=>wr.id===n)]})):ii([n])}};return J.jsxs("g",{className:is(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:Ir,updating:oe}]),onClick:ke,onDoubleClick:Qt,onContextMenu:br,onMouseEnter:kn,onMouseMove:bn,onMouseLeave:Xt,onKeyDown:Z?Gr:void 0,tabIndex:Z?0:void 0,role:Z?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Q===null?void 0:Q||`Edge from ${_} to ${v}`,"aria-describedby":Z?`${vB}-${G}`:void 0,ref:te,children:[!le&&J.jsx(e,{id:n,source:_,target:v,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:b,sourceX:g,sourceY:y,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,sourceHandleId:P,targetHandleId:L,markerStart:Fe,markerEnd:ct,pathOptions:j,interactionWidth:W}),Y&&J.jsxs(J.Fragment,{children:[(Y==="source"||Y===!0)&&J.jsx(O8,{position:x,centerX:g,centerY:y,radius:$,onMouseDown:Sr,onMouseEnter:Vr,onMouseOut:or,type:"source"}),(Y==="target"||Y===!0)&&J.jsx(O8,{position:C,centerX:S,centerY:w,radius:$,onMouseDown:Ji,onMouseEnter:Vr,onMouseOut:or,type:"target"})]})]})};return t.displayName="EdgeWrapper",M.memo(t)};function bye(e){const t={default:Sd(e.default||w1),straight:Sd(e.bezier||y5),step:Sd(e.step||m5),smoothstep:Sd(e.step||$b),simplebezier:Sd(e.simplebezier||g5)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=Sd(e[o]||w1),i),n);return{...t,...r}}function M8(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 Je.Top:return{x:r+o/2,y:i};case Je.Right:return{x:r+o,y:i+s/2};case Je.Bottom:return{x:r+o/2,y:i+s};case Je.Left:return{x:r,y:i+s/2}}}function N8(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Sye=(e,t,n,r,i,o)=>{const s=M8(n,e,t),a=M8(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function wye({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 D8(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 xye=[{level:0,isMaxLevel:!0,edges:[]}];function Cye(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?xye:o}function Eye(e,t,n){const r=dr(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)&&wye({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 Cye(r,t,n)}const Tye=({color:e="none",strokeWidth:t=1})=>J.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),Aye=({color:e="none",strokeWidth:t=1})=>J.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),L8={[S1.Arrow]:Tye,[S1.ArrowClosed]:Aye};function kye(e){const t=ri();return M.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(L8,e)?L8[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ul.error009(e)),null)},[e])}const Pye=({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=kye(t);return l?J.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:J.jsx(l,{color:n,strokeWidth:s})}):null},Rye=({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=ZC(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))},IB=({defaultColor:e,rfId:t})=>{const n=dr(M.useCallback(Rye({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return J.jsx("defs",{children:n.map(r=>J.jsx(Pye,{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))})};IB.displayName="MarkerDefinitions";var Iye=M.memo(IB);const Oye=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}),OB=({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:v,elementsSelectable:g,width:y,height:S,connectionMode:w,nodeInternals:x,onError:C}=dr(Oye,go),A=Eye(t,x,n);return y?J.jsxs(J.Fragment,{children:[A.map(({level:T,edges:P,isMaxLevel:L})=>J.jsxs("svg",{style:{zIndex:T},width:y,height:S,className:"react-flow__edges react-flow__container",children:[L&&J.jsx(Iye,{defaultColor:e,rfId:r}),J.jsx("g",{children:P.map(R=>{const[E,k,D]=D8(x.get(R.source)),[$,O,I]=D8(x.get(R.target));if(!D||!I)return null;let N=R.type||"default";i[N]||(C==null||C("011",ul.error011(N)),N="default");const B=i[N]||i.default,U=w===$c.Strict?O.target:(O.target??[]).concat(O.source??[]),G=N8(k.source,R.sourceHandle),Q=N8(U,R.targetHandle),Z=(G==null?void 0:G.position)||Je.Bottom,Y=(Q==null?void 0:Q.position)||Je.Top,j=!!(R.focusable||_&&typeof R.focusable>"u"),W=typeof s<"u"&&(R.updatable||v&&typeof R.updatable>"u");if(!G||!Q)return C==null||C("008",ul.error008(G,R)),null;const{sourceX:te,sourceY:oe,targetX:ye,targetY:le}=Sye(E,G,Z,$,Q,Y);return J.jsx(B,{id:R.id,className:is([R.className,o]),type:N,data:R.data,selected:!!R.selected,animated:!!R.animated,hidden:!!R.hidden,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,style:R.style,source:R.source,target:R.target,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerEnd:R.markerEnd,markerStart:R.markerStart,sourceX:te,sourceY:oe,targetX:ye,targetY:le,sourcePosition:Z,targetPosition:Y,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:R.ariaLabel,isFocusable:j,isUpdatable:W,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth},R.id)})})]},T)),b]}):null};OB.displayName="EdgeRenderer";var Mye=M.memo(OB);const Nye=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Dye({children:e}){const t=dr(Nye);return J.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function Lye(e){const t=wB(),n=M.useRef(!1);M.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const $ye={[Je.Left]:Je.Right,[Je.Right]:Je.Left,[Je.Top]:Je.Bottom,[Je.Bottom]:Je.Top},MB=({nodeId:e,handleType:t,style:n,type:r=Bl.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,x,C;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=dr(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]),go),d=(w=s==null?void 0:s[zr])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===$c.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,v=h==null?void 0:h.position,g=v?$ye[v]:null;if(!v||!g)return null;if(i)return J.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:b,fromY:_,toX:l,toY:u,fromPosition:v,toPosition:g,connectionStatus:o});let y="";const S={sourceX:b,sourceY:_,sourcePosition:v,targetX:l,targetY:u,targetPosition:g};return r===Bl.Bezier?[y]=tB(S):r===Bl.Step?[y]=YC({...S,borderRadius:0}):r===Bl.SmoothStep?[y]=YC(S):r===Bl.SimpleBezier?[y]=eB(S):y=`M${b},${_} ${l},${u}`,J.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:n})};MB.displayName="ConnectionLine";const Fye=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Bye({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:l,connectionStatus:u}=dr(Fye,go);return!(i&&o&&a&&s)?null:J.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:J.jsx("g",{className:is(["react-flow__connection",u]),children:J.jsx(MB,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}function $8(e,t){return M.useRef(null),ri(),M.useMemo(()=>t(e),[e])}const NB=({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:v,connectionLineComponent:g,connectionLineContainerStyle:y,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:L,elementsSelectable:R,selectNodesOnDrag:E,defaultViewport:k,translateExtent:D,minZoom:$,maxZoom:O,preventScrolling:I,defaultMarkerColor:N,zoomOnScroll:B,zoomOnPinch:U,panOnScroll:G,panOnScrollSpeed:Q,panOnScrollMode:Z,zoomOnDoubleClick:Y,panOnDrag:j,onPaneClick:W,onPaneMouseEnter:te,onPaneMouseMove:oe,onPaneMouseLeave:ye,onPaneScroll:le,onPaneContextMenu:pt,onEdgeUpdate:nt,onEdgeContextMenu:Fe,onEdgeMouseEnter:ct,onEdgeMouseMove:ke,onEdgeMouseLeave:Qt,edgeUpdaterRadius:br,onEdgeUpdateStart:kn,onEdgeUpdateEnd:bn,noDragClassName:Xt,noWheelClassName:Pn,noPanClassName:Sr,elevateEdgesOnSelect:Ji,disableKeyboardA11y:Vr,nodeOrigin:or,nodeExtent:Ir,rfId:Gr})=>{const Rn=$8(e,hye),hn=$8(t,bye);return Lye(o),J.jsx(dye,{onPaneClick:W,onPaneMouseEnter:te,onPaneMouseMove:oe,onPaneMouseLeave:ye,onPaneContextMenu:pt,onPaneScroll:le,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,onSelectionStart:m,onSelectionEnd:b,multiSelectionKeyCode:C,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:R,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:B,zoomOnPinch:U,zoomOnDoubleClick:Y,panOnScroll:G,panOnScrollSpeed:Q,panOnScrollMode:Z,panOnDrag:j,defaultViewport:k,translateExtent:D,minZoom:$,maxZoom:O,onSelectionContextMenu:p,preventScrolling:I,noDragClassName:Xt,noWheelClassName:Pn,noPanClassName:Sr,disableKeyboardA11y:Vr,children:J.jsxs(Dye,{children:[J.jsx(Mye,{edgeTypes:hn,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:nt,onlyRenderVisibleElements:L,onEdgeContextMenu:Fe,onEdgeMouseEnter:ct,onEdgeMouseMove:ke,onEdgeMouseLeave:Qt,onEdgeUpdateStart:kn,onEdgeUpdateEnd:bn,edgeUpdaterRadius:br,defaultMarkerColor:N,noPanClassName:Sr,elevateEdgesOnSelect:!!Ji,disableKeyboardA11y:Vr,rfId:Gr,children:J.jsx(Bye,{style:v,type:_,component:g,containerStyle:y})}),J.jsx("div",{className:"react-flow__edgelabel-renderer"}),J.jsx(mye,{nodeTypes:Rn,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:E,onlyRenderVisibleElements:L,noPanClassName:Sr,noDragClassName:Xt,disableKeyboardA11y:Vr,nodeOrigin:or,nodeExtent:Ir,rfId:Gr})]})})};NB.displayName="GraphView";var zye=M.memo(NB);const t3=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Cl={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:t3,nodeExtent:t3,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$c.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:hme,isValidConnection:void 0},jye=()=>Afe((e,t)=>({...Cl,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:_w(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?_w(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 v=h5(b.nodeElement);!!(v.width&&v.height&&(_.width!==v.width||_.height!==v.height||b.forceUpdate))&&(i.set(_.id,{..._,[zr]:{..._[zr],handleBounds:{source:R8(".source",b.nodeElement,f,u),target:R8(".target",b.nodeElement,f,u)}},...v}),m.push({id:_.id,type:"dimensions",dimensions:v}))}return m},[]);bB(i,u);const p=s||o&&!s&&SB(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=_w(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=>Il(l,!0)):(s=qd(o(),n),a=qd(i,[])),Hy({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=>Il(l,!0)):(s=qd(i,n),a=qd(o(),[])),Hy({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,Il(c.id,!1))),u=a.map(c=>Il(c.id,!1));Hy({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=>Il(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Il(a.id,!1));Hy({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=p5(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=ou.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:Cl.connectionNodeId,connectionHandleId:Cl.connectionHandleId,connectionHandleType:Cl.connectionHandleType,connectionStatus:Cl.connectionStatus,connectionStartHandle:Cl.connectionStartHandle,connectionEndHandle:Cl.connectionEndHandle}),reset:()=>e({...Cl})}),Object.is),DB=({children:e})=>{const t=M.useRef(null);return t.current||(t.current=jye()),J.jsx(sme,{value:t.current,children:e})};DB.displayName="ReactFlowProvider";const LB=({children:e})=>M.useContext(Lb)?J.jsx(J.Fragment,{children:e}):J.jsx(DB,{children:e});LB.displayName="ReactFlowWrapper";const Uye={input:hB,default:JC,output:gB,group:w5},Vye={default:w1,straight:y5,step:m5,smoothstep:$b,simplebezier:g5},Gye=[0,0],qye=[15,15],Hye={x:0,y:0,zoom:1},Wye={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Kye=M.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=Uye,edgeTypes:s=Vye,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:A,onNodesDelete:T,onEdgesDelete:P,onSelectionChange:L,onSelectionDragStart:R,onSelectionDrag:E,onSelectionDragStop:k,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:O,connectionMode:I=$c.Strict,connectionLineType:N=Bl.Bezier,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,deleteKeyCode:Q="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:Y=!1,selectionMode:j=_u.Full,panActivationKeyCode:W="Space",multiSelectionKeyCode:te=b1()?"Meta":"Control",zoomActivationKeyCode:oe=b1()?"Meta":"Control",snapToGrid:ye=!1,snapGrid:le=qye,onlyRenderVisibleElements:pt=!1,selectNodesOnDrag:nt=!0,nodesDraggable:Fe,nodesConnectable:ct,nodesFocusable:ke,nodeOrigin:Qt=Gye,edgesFocusable:br,edgesUpdatable:kn,elementsSelectable:bn,defaultViewport:Xt=Hye,minZoom:Pn=.5,maxZoom:Sr=2,translateExtent:Ji=t3,preventScrolling:Vr=!0,nodeExtent:or,defaultMarkerColor:Ir="#b1b1b7",zoomOnScroll:Gr=!0,zoomOnPinch:Rn=!0,panOnScroll:hn=!1,panOnScrollSpeed:wi=.5,panOnScrollMode:ii=fc.Free,zoomOnDoubleClick:Bi=!0,panOnDrag:fs=!0,onPaneClick:wr,onPaneMouseEnter:eo,onPaneMouseMove:Aa,onPaneMouseLeave:vo,onPaneScroll:ka,onPaneContextMenu:In,children:Yt,onEdgeUpdate:Or,onEdgeContextMenu:xr,onEdgeDoubleClick:Cr,onEdgeMouseEnter:qr,onEdgeMouseMove:xi,onEdgeMouseLeave:to,onEdgeUpdateStart:oi,onEdgeUpdateEnd:Mr,edgeUpdaterRadius:hs=10,onNodesChange:Us,onEdgesChange:si,noDragClassName:vl="nodrag",noWheelClassName:Bo="nowheel",noPanClassName:Hr="nopan",fitView:Pa=!1,fitViewOptions:H,connectOnClick:ee=!0,attributionPosition:ne,proOptions:ue,defaultEdgeOptions:ie,elevateNodesOnSelect:Be=!0,elevateEdgesOnSelect:Ue=!1,disableKeyboardA11y:ot=!1,autoPanOnConnect:Ne=!0,autoPanOnNodeDrag:Ve=!0,connectionRadius:Pe=20,isValidConnection:re,onError:ve,style:Qe,id:Xe,...st},at)=>{const mt=Xe||"1";return J.jsx("div",{...st,style:{...Qe,...Wye},ref:at,className:is(["react-flow",i]),"data-testid":"rf__wrapper",id:Xe,children:J.jsxs(LB,{children:[J.jsx(zye,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:s,connectionLineType:N,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,selectionKeyCode:Z,selectionOnDrag:Y,selectionMode:j,deleteKeyCode:Q,multiSelectionKeyCode:te,panActivationKeyCode:W,zoomActivationKeyCode:oe,onlyRenderVisibleElements:pt,selectNodesOnDrag:nt,defaultViewport:Xt,translateExtent:Ji,minZoom:Pn,maxZoom:Sr,preventScrolling:Vr,zoomOnScroll:Gr,zoomOnPinch:Rn,zoomOnDoubleClick:Bi,panOnScroll:hn,panOnScrollSpeed:wi,panOnScrollMode:ii,panOnDrag:fs,onPaneClick:wr,onPaneMouseEnter:eo,onPaneMouseMove:Aa,onPaneMouseLeave:vo,onPaneScroll:ka,onPaneContextMenu:In,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:O,onEdgeUpdate:Or,onEdgeContextMenu:xr,onEdgeDoubleClick:Cr,onEdgeMouseEnter:qr,onEdgeMouseMove:xi,onEdgeMouseLeave:to,onEdgeUpdateStart:oi,onEdgeUpdateEnd:Mr,edgeUpdaterRadius:hs,defaultMarkerColor:Ir,noDragClassName:vl,noWheelClassName:Bo,noPanClassName:Hr,elevateEdgesOnSelect:Ue,rfId:mt,disableKeyboardA11y:ot,nodeOrigin:Qt,nodeExtent:or}),J.jsx(Fme,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:Fe,nodesConnectable:ct,nodesFocusable:ke,edgesFocusable:br,edgesUpdatable:kn,elementsSelectable:bn,elevateNodesOnSelect:Be,minZoom:Pn,maxZoom:Sr,nodeExtent:or,onNodesChange:Us,onEdgesChange:si,snapToGrid:ye,snapGrid:le,connectionMode:I,translateExtent:Ji,connectOnClick:ee,defaultEdgeOptions:ie,fitView:Pa,fitViewOptions:H,onNodesDelete:T,onEdgesDelete:P,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:A,onSelectionDrag:E,onSelectionDragStart:R,onSelectionDragStop:k,noPanClassName:Hr,nodeOrigin:Qt,rfId:mt,autoPanOnConnect:Ne,autoPanOnNodeDrag:Ve,onError:ve,connectionRadius:Pe,isValidConnection:re}),J.jsx(Lme,{onSelectionChange:L}),Yt,J.jsx(ume,{proOptions:ue,position:ne}),J.jsx(Vme,{rfId:mt,disableKeyboardA11y:ot})]})})});Kye.displayName="ReactFlow";const Qye=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function FOe({children:e}){const t=dr(Qye);return t?ws.createPortal(e,t):null}function BOe(){const e=ri();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 Xye(){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=hu("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,Xye()))}catch(n){return t({error:n})}});let Ky;const Yye=new Uint8Array(16);function Zye(){if(!Ky&&(Ky=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ky))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ky(Yye)}const di=[];for(let e=0;e<256;++e)di.push((e+256).toString(16).slice(1));function Jye(e,t=0){return(di[e[t+0]]+di[e[t+1]]+di[e[t+2]]+di[e[t+3]]+"-"+di[e[t+4]]+di[e[t+5]]+"-"+di[e[t+6]]+di[e[t+7]]+"-"+di[e[t+8]]+di[e[t+9]]+"-"+di[e[t+10]]+di[e[t+11]]+di[e[t+12]]+di[e[t+13]]+di[e[t+14]]+di[e[t+15]]).toLowerCase()}const e0e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),F8={randomUUID:e0e};function $B(e,t,n){if(F8.randomUUID&&!t&&!e)return F8.randomUUID();e=e||{};const r=e.random||(e.rng||Zye)();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 Jye(r)}const zOe=500,jOe=320,t0e="node-drag-handle",UOe=["ImageField","ImageCollection"],VOe={input:"inputs",output:"outputs"},GOe=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection"],n0e=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic"],qOe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField"],FB={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection"},r0e=e=>!!(e&&e in FB),BB={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic"},HOe={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField"},WOe=["string","StringPolymorphic","boolean","BooleanPolymorphic","integer","float","FloatPolymorphic","IntegerPolymorphic","enum","ImageField","ImagePolymorphic","MainModelField","SDXLRefinerModelField","VaeModelField","LoRAModelField","ControlNetModelField","ColorField","SDXLMainModelField","Scheduler"],i0e=e=>!!(e&&e in BB),KOe={boolean:{color:"green.500",description:X("nodes.booleanDescription"),title:X("nodes.boolean")},BooleanCollection:{color:"green.500",description:X("nodes.booleanCollectionDescription"),title:X("nodes.booleanCollection")},BooleanPolymorphic:{color:"green.500",description:X("nodes.booleanPolymorphicDescription"),title:X("nodes.booleanPolymorphic")},ClipField:{color:"green.500",description:X("nodes.clipFieldDescription"),title:X("nodes.clipField")},Collection:{color:"base.500",description:X("nodes.collectionDescription"),title:X("nodes.collection")},CollectionItem:{color:"base.500",description:X("nodes.collectionItemDescription"),title:X("nodes.collectionItem")},ColorCollection:{color:"pink.300",description:X("nodes.colorCollectionDescription"),title:X("nodes.colorCollection")},ColorField:{color:"pink.300",description:X("nodes.colorFieldDescription"),title:X("nodes.colorField")},ColorPolymorphic:{color:"pink.300",description:X("nodes.colorPolymorphicDescription"),title:X("nodes.colorPolymorphic")},ConditioningCollection:{color:"cyan.500",description:X("nodes.conditioningCollectionDescription"),title:X("nodes.conditioningCollection")},ConditioningField:{color:"cyan.500",description:X("nodes.conditioningFieldDescription"),title:X("nodes.conditioningField")},ConditioningPolymorphic:{color:"cyan.500",description:X("nodes.conditioningPolymorphicDescription"),title:X("nodes.conditioningPolymorphic")},ControlCollection:{color:"teal.500",description:X("nodes.controlCollectionDescription"),title:X("nodes.controlCollection")},ControlField:{color:"teal.500",description:X("nodes.controlFieldDescription"),title:X("nodes.controlField")},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:X("nodes.denoiseMaskFieldDescription"),title:X("nodes.denoiseMaskField")},enum:{color:"blue.500",description:X("nodes.enumDescription"),title:X("nodes.enum")},float:{color:"orange.500",description:X("nodes.floatDescription"),title:X("nodes.float")},FloatCollection:{color:"orange.500",description:X("nodes.floatCollectionDescription"),title:X("nodes.floatCollection")},FloatPolymorphic:{color:"orange.500",description:X("nodes.floatPolymorphicDescription"),title:X("nodes.floatPolymorphic")},ImageCollection:{color:"purple.500",description:X("nodes.imageCollectionDescription"),title:X("nodes.imageCollection")},ImageField:{color:"purple.500",description:X("nodes.imageFieldDescription"),title:X("nodes.imageField")},ImagePolymorphic:{color:"purple.500",description:X("nodes.imagePolymorphicDescription"),title:X("nodes.imagePolymorphic")},integer:{color:"red.500",description:X("nodes.integerDescription"),title:X("nodes.integer")},IntegerCollection:{color:"red.500",description:X("nodes.integerCollectionDescription"),title:X("nodes.integerCollection")},IntegerPolymorphic:{color:"red.500",description:X("nodes.integerPolymorphicDescription"),title:X("nodes.integerPolymorphic")},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:X("nodes.latentsCollectionDescription"),title:X("nodes.latentsCollection")},LatentsField:{color:"pink.500",description:X("nodes.latentsFieldDescription"),title:X("nodes.latentsField")},LatentsPolymorphic:{color:"pink.500",description:X("nodes.latentsPolymorphicDescription"),title:X("nodes.latentsPolymorphic")},LoRAModelField:{color:"teal.500",description:X("nodes.loRAModelFieldDescription"),title:X("nodes.loRAModelField")},MainModelField:{color:"teal.500",description:X("nodes.mainModelFieldDescription"),title:X("nodes.mainModelField")},ONNXModelField:{color:"teal.500",description:X("nodes.oNNXModelFieldDescription"),title:X("nodes.oNNXModelField")},Scheduler:{color:"base.500",description:X("nodes.schedulerDescription"),title:X("nodes.scheduler")},SDXLMainModelField:{color:"teal.500",description:X("nodes.sDXLMainModelFieldDescription"),title:X("nodes.sDXLMainModelField")},SDXLRefinerModelField:{color:"teal.500",description:X("nodes.sDXLRefinerModelFieldDescription"),title:X("nodes.sDXLRefinerModelField")},string:{color:"yellow.500",description:X("nodes.stringDescription"),title:X("nodes.string")},StringCollection:{color:"yellow.500",description:X("nodes.stringCollectionDescription"),title:X("nodes.stringCollection")},StringPolymorphic:{color:"yellow.500",description:X("nodes.stringPolymorphicDescription"),title:X("nodes.stringPolymorphic")},UNetField:{color:"red.500",description:X("nodes.uNetFieldDescription"),title:X("nodes.uNetField")},VaeField:{color:"blue.500",description:X("nodes.vaeFieldDescription"),title:X("nodes.vaeField")},VaeModelField:{color:"teal.500",description:X("nodes.vaeModelFieldDescription"),title:X("nodes.vaeModelField")}},B8=(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}},o0e="1.0.0",xw={status:Qs.PENDING,error:null,progress:null,progressImage:null,outputs:[]},n3={meta:{version:o0e},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},zB={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:n3,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:_u.Partial},So=(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(!Nr(s))return;const a=(u=s.data)==null?void 0:u.inputs[r];a&&o>-1&&(a.value=i)},jB=Kn({name:"nodes",initialState:zB,reducers:{nodesChanged:(e,t)=>{e.nodes=Yu(t.payload,e.nodes)},nodeAdded:(e,t)=>{const n=t.payload,r=B8(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=zu(e.edges.map(i=>({id:i.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),Nr(n)&&(e.nodeExecutionStates[n.id]={nodeId:n.id,...xw})},edgesChanged:(e,t)=>{e.edges=zu(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(!Nr(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=rB({...t.payload,type:"default"},e.edges))},connectionEnded:e=>{e.connectionStartParams=null,e.currentConnectionFieldType=null},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=Jk(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(!Nr(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];Nr(o)&&(o.data.embedWorkflow=r)},nodeUseCacheChanged:(e,t)=>{var s;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Nr(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var s;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(a=>a.id===n),o=(s=e.nodes)==null?void 0:s[i];Nr(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(!Nr(o)&&!_P(o)||(o.data.isOpen=r,!Nr(o)))return;const s=b5([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=xme(o,e.nodes,e.edges).filter(d=>Nr(d)&&d.data.isOpen===!1),u=wme(o,e.nodes,e.edges).filter(d=>Nr(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=zu(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=zu(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),Nr(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];Nr(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];Nr(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)=>{So(e,t)},fieldNumberValueChanged:(e,t)=>{So(e,t)},fieldBooleanValueChanged:(e,t)=>{So(e,t)},fieldImageValueChanged:(e,t)=>{So(e,t)},fieldColorValueChanged:(e,t)=>{So(e,t)},fieldMainModelValueChanged:(e,t)=>{So(e,t)},fieldRefinerModelValueChanged:(e,t)=>{So(e,t)},fieldVaeModelValueChanged:(e,t)=>{So(e,t)},fieldLoRAModelValueChanged:(e,t)=>{So(e,t)},fieldControlNetModelValueChanged:(e,t)=>{So(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{So(e,t)},fieldEnumModelValueChanged:(e,t)=>{So(e,t)},fieldSchedulerValueChanged:(e,t)=>{So(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(!Nr(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=Jk(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];_P(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(n3)},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:`.${t0e}`},type:"add"})),[]),e.edges=zu(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,s)=>(o[s.id]={nodeId:s.id,...xw},o),{})},workflowReset:e=>{e.workflow=Zn(n3)},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=zu(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{if(e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Zn),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Zn),e.nodesToCopy.length>0){const t={x:0,y:0};e.nodesToCopy.forEach(n=>{const r=.15*(n.width??0),i=.5*(n.height??0);t.x+=n.position.x+r,t.y+=n.position.y+i}),t.x/=e.nodesToCopy.length,t.y/=e.nodesToCopy.length,e.nodesToCopy.forEach(n=>{n.position.x-=t.x,n.position.y-=t.y})}},selectionPasted:(e,t)=>{const{cursorPosition:n}=t.payload,r=e.nodesToCopy.map(Zn),i=r.map(c=>c.data.id),o=e.edgesToCopy.filter(c=>i.includes(c.source)&&i.includes(c.target)).map(Zn);o.forEach(c=>c.selected=!0),r.forEach(c=>{const d=$B();o.forEach(h=>{h.source===c.data.id&&(h.source=d,h.id=h.id.replace(c.data.id,d)),h.target===c.data.id&&(h.target=d,h.id=h.id.replace(c.data.id,d))}),c.selected=!0,c.id=d,c.data.id=d;const f=B8(e.nodes,c.position.x+((n==null?void 0:n.x)??0),c.position.y+((n==null?void 0:n.y)??0));c.position=f});const s=r.map(c=>({item:c,type:"add"})),a=e.nodes.map(c=>({id:c.data.id,type:"select",selected:!1})),l=o.map(c=>({item:c,type:"add"})),u=e.edges.map(c=>({id:c.id,type:"select",selected:!1}));e.nodes=Yu(s.concat(a),e.nodes),e.edges=zu(l.concat(u),e.edges),r.forEach(c=>{e.nodeExecutionStates[c.id]={nodeId:c.id,...xw}})},addNodePopoverOpened:e=>{e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?_u.Full:_u.Partial}},extraReducers:e=>{e.addCase(Bg.pending,t=>{t.isReady=!1}),e.addCase(ZT,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Qs.IN_PROGRESS)}),e.addCase(e5,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=Qs.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(Rb,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Qs.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(t5,(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=Qs.IN_PROGRESS,a.progress=(i+1)/o,a.progressImage=s??null)}),e.addCase(Cm.fulfilled,t=>{Mo(t.nodeExecutionStates,n=>{n.status=Qs.PENDING,n.error=null,n.progress=null,n.progressImage=null,n.outputs=[]})}),e.addCase(Em.fulfilled,t=>{Tee(t.nodeExecutionStates,n=>{n.status===Qs.IN_PROGRESS&&(n.status=Qs.PENDING)})}),e.addCase(n5,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.status)&&Mo(t.nodeExecutionStates,r=>{r.status=Qs.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{nodesChanged:QOe,edgesChanged:XOe,nodeAdded:YOe,nodesDeleted:ZOe,connectionMade:JOe,connectionStarted:e9e,connectionEnded:t9e,shouldShowFieldTypeLegendChanged:n9e,shouldShowMinimapPanelChanged:r9e,nodeTemplatesBuilt:UB,nodeEditorReset:s0e,imageCollectionFieldValueChanged:i9e,fieldStringValueChanged:o9e,fieldNumberValueChanged:s9e,fieldBooleanValueChanged:a9e,fieldImageValueChanged:Fb,fieldColorValueChanged:l9e,fieldMainModelValueChanged:u9e,fieldVaeModelValueChanged:c9e,fieldLoRAModelValueChanged:d9e,fieldEnumModelValueChanged:f9e,fieldControlNetModelValueChanged:h9e,fieldIPAdapterModelValueChanged:p9e,fieldRefinerModelValueChanged:g9e,fieldSchedulerValueChanged:m9e,nodeIsOpenChanged:y9e,nodeLabelChanged:v9e,nodeNotesChanged:_9e,edgesDeleted:b9e,shouldValidateGraphChanged:S9e,shouldAnimateEdgesChanged:w9e,nodeOpacityChanged:x9e,shouldSnapToGridChanged:C9e,shouldColorEdgesChanged:E9e,selectedNodesChanged:T9e,selectedEdgesChanged:A9e,workflowNameChanged:k9e,workflowDescriptionChanged:P9e,workflowTagsChanged:R9e,workflowAuthorChanged:I9e,workflowNotesChanged:O9e,workflowVersionChanged:M9e,workflowContactChanged:N9e,workflowLoaded:a0e,notesNodeValueChanged:D9e,workflowExposedFieldAdded:l0e,workflowExposedFieldRemoved:L9e,fieldLabelChanged:$9e,viewportChanged:F9e,mouseOverFieldChanged:B9e,selectionCopied:z9e,selectionPasted:j9e,selectedAll:U9e,addNodePopoverOpened:V9e,addNodePopoverClosed:G9e,addNodePopoverToggled:q9e,selectionModeChanged:H9e,nodeEmbedWorkflowChanged:W9e,nodeIsIntermediateChanged:K9e,mouseOverNodeChanged:Q9e,nodeExclusivelySelected:X9e,nodeUseCacheChanged:Y9e}=jB.actions,u0e=jB.reducer,VB={esrganModelName:"RealESRGAN_x4plus.pth"},GB=Kn({name:"postprocessing",initialState:VB,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:Z9e}=GB.actions,c0e=GB.reducer,qB={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},HB=Kn({name:"sdxl",initialState:qB,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:J9e,setNegativeStylePromptSDXL:eMe,setShouldConcatSDXLStylePrompt:tMe,setShouldUseSDXLRefiner:d0e,setSDXLImg2ImgDenoisingStrength:nMe,refinerModelChanged:z8,setRefinerSteps:rMe,setRefinerCFGScale:iMe,setRefinerScheduler:oMe,setRefinerPositiveAestheticScore:sMe,setRefinerNegativeAestheticScore:aMe,setRefinerStart:lMe}=HB.actions,f0e=HB.reducer,h0e=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),Xa=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},p0e=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()}))})}),WB={isInitialized:!1,isConnected:!1,shouldConfirmOnDelete:!0,enableImageDebugging:!1,toastQueue:[],denoiseProgress:null,shouldAntialiasProgressImage:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,language:"en",shouldUseNSFWChecker:!1,shouldUseWatermarker:!1,shouldEnableInformationalPopovers:!1,status:"DISCONNECTED"},KB=Kn({name:"system",initialState:WB,reducers:{setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},languageChanged:(e,t)=>{e.language=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload},setShouldEnableInformationalPopovers(e,t){e.shouldEnableInformationalPopovers=t.payload},isInitializedChanged(e,t){e.isInitialized=t.payload}},extraReducers(e){e.addCase(YT,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(q$,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(ZT,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(t5,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:s,graph_execution_state_id:a,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:h0e(r,i,o),progress_image:s,session_id:a,batch_id:l},t.status="PROCESSING"}),e.addCase(e5,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Q$,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Z$,t=>{t.status="LOADING_MODEL"}),e.addCase(eF,t=>{t.status="CONNECTED"}),e.addCase(n5,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(PD,(t,n)=>{var o,s,a;let r;if(((o=n.payload)==null?void 0:o.status)===422){const l=p0e.safeParse(n.payload);if(l.success){l.data.error.detail.map(u=>{t.toastQueue.push(Xa({title:B2(w7(u.msg),{length:128}),status:"error",description:B2(`Path:
|
||
${u.loc.join(".")}`,{length:128}),duration:5e3}))});return}}else(s=n.payload)!=null&&s.error&&(r=(a=n.payload)==null?void 0:a.error);t.toastQueue.push(Xa({title:X("toast.serverError"),status:"error",description:B2(Mv(r,"detail","Unknown Error"),{length:128}),duration:5e3}))}),e.addMatcher(_0e,(t,n)=>{t.toastQueue.push(Xa({title:X("toast.serverError"),status:"error",description:Ate(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:uMe,setEnableImageDebugging:cMe,addToast:Mt,clearToastQueue:dMe,consoleLogLevelChanged:fMe,shouldLogToConsoleChanged:hMe,shouldAntialiasProgressImageChanged:pMe,languageChanged:gMe,shouldUseNSFWCheckerChanged:g0e,shouldUseWatermarkerChanged:m0e,setShouldEnableInformationalPopovers:mMe,isInitializedChanged:y0e}=KB.actions,v0e=KB.reducer,_0e=Xi(Rb,nF,iF),b0e={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},S0e=b0e,QB=Kn({name:"queue",initialState:S0e,reducers:{listCursorChanged:(e,t)=>{e.listCursor=t.payload},listPriorityChanged:(e,t)=>{e.listPriority=t.payload},listParamsReset:e=>{e.listCursor=void 0,e.listPriority=void 0},queueItemSelectionToggled:(e,t)=>{e.selectedQueueItem===t.payload?e.selectedQueueItem=void 0:e.selectedQueueItem=t.payload},resumeProcessorOnEnqueueChanged:(e,t)=>{e.resumeProcessorOnEnqueue=t.payload}}}),{listCursorChanged:yMe,listPriorityChanged:vMe,listParamsReset:w0e,queueItemSelectionToggled:_Me,resumeProcessorOnEnqueueChanged:bMe}=QB.actions,x0e=QB.reducer,C0e={searchFolder:null,advancedAddScanModel:null},XB=Kn({name:"modelmanager",initialState:C0e,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:SMe,setAdvancedAddScanModel:wMe}=XB.actions,E0e=XB.reducer,YB={shift:!1,ctrl:!1,meta:!1},ZB=Kn({name:"hotkeys",initialState:YB,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:xMe,ctrlKeyPressed:CMe,metaKeyPressed:EMe}=ZB.actions,T0e=ZB.reducer,JB=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],j8=(e,t)=>{typeof t=="number"?e.activeTab=t:e.activeTab=JB.indexOf(t)},ez={activeTab:0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},tz=Kn({name:"ui",initialState:ez,reducers:{setActiveTab:(e,t)=>{j8(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(L_,t=>{j8(t,"img2img")})}}),{setActiveTab:nz,setShouldShowImageDetails:TMe,setShouldUseCanvasBetaLayout:AMe,setShouldShowExistingModelsInSearch:kMe,setShouldUseSliders:PMe,setShouldHidePreview:RMe,setShouldShowProgressInViewer:IMe,favoriteSchedulersChanged:OMe,toggleEmbeddingPicker:MMe,setShouldAutoChangeDimensions:NMe,contextMenusClosed:DMe,panelsChanged:LMe}=tz.actions,A0e=tz.reducer,k0e=Y1(FH);rz=r3=void 0;var P0e=k0e,R0e=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return P0e.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}},Bb=R0e(),I0e=Bb.enhancer,O0e=Bb.addMiddleware;Bb.removeMiddleware;var M0e=Bb.resetMiddlewares,r3=O0e,rz=M0e,i3="@@REMEMBER_REHYDRATED",N0e="@@REMEMBER_PERSISTED";function o3(e){"@babel/helpers - typeof";return o3=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},o3(e)}var iz=function(t,n){if(t===null||o3(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},D0e=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)}},L0e=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 U8(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 C5(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){U8(o,r,i,s,a,"next",l)}function a(l){U8(o,r,i,s,a,"throw",l)}s(void 0)})}}var $0e=function(){var e=C5(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?{}:iz(o(s,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),F0e=function(){var e=C5(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)}}(),B0e=function(){var e=C5(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.unserialize,l={};try{var u=s?$0e:F0e;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:a})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:i3,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function Cw(e,t){return U0e(e)||j0e(e,t)||oz(e,t)||z0e()}function z0e(){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 j0e(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 U0e(e){if(Array.isArray(e))return e}function Ew(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=oz(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 oz(e,t){if(e){if(typeof e=="string")return V8(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 V8(e,t)}}function V8(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 C1(e){"@babel/helpers - typeof";return C1=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},C1(e)}var G8=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},q8=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},V0e=function e(t,n){if(t===n)return!0;if(C1(t)!=="object"||C1(n)!=="object"||t===null||t===void 0||n===null||n===void 0)return t!==t&&n!==n;if(t.constructor!==n.constructor)return!1;if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(var r=t.length;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(q8(t)&&q8(n)){if(t.byteLength!==n.byteLength)return!1;for(var i=t.byteLength;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}var o=G8(t),s=G8(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=Ew(t.entries()),l;try{for(a.s();!(l=a.n()).done;){var u=Cw(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(C){a.e(C)}finally{a.f()}var d=Ew(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=Cw(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=Ew(t.entries()),_;try{for(b.s();!(_=b.n()).done;){var v=Cw(_.value,1),g=v[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 y=Object.keys(t);if(y.length!==Object.keys(n).length)return!1;for(var S=y.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,y[S]))return!1;for(var w=y.length;w--!==0;){var x=y[w];if(!e(t[x],n[x]))return!1}return o!=="Object"&&s!=="Object"?t===n:!0};const E5=V0e;function H8(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 sz(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){H8(o,r,i,s,a,"next",l)}function a(l){H8(o,r,i,s,a,"throw",l)}s(void 0)})}}var G0e=function(){var e=sz(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;if(!E5(t,n))return o.setItem("".concat(i,"rootState"),s(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),q0e=function(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;return Promise.all(Object.keys(t).map(function(a){return E5(t[a],n[a])?Promise.resolve():o.setItem("".concat(i).concat(a),s(t[a],a))}))},H0e=function(){var e=sz(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?G0e:q0e;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 W8(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 K8(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){W8(o,r,i,s,a,"next",l)}function a(l){W8(o,r,i,s,a,"throw",l)}s(void 0)})}}var W0e=function(){var e=K8(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 B0e(t,n,{prefix:i,driver:o,unserialize:a,persistWholeStore:c});var d={},f=function(){var h=K8(function*(){var p=iz(t.getState(),n);yield H0e(p,d,{prefix:i,driver:o,serialize:s,persistWholeStore:c}),E5(p,d)||t.dispatch({type:N0e,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(L0e(f,u)):t.subscribe(D0e(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const K0e=W0e;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 Q8(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 Tw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q8(Object(n),!0).forEach(function(r){Q0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Q0e(e,t,n){return t=X0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X0e(e){var t=Y0e(e,"string");return zg(t)==="symbol"?t:String(t)}function Y0e(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 Z0e=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=Tw({},r));var o=typeof t=="function"?t:th(t);switch(i.type){case i3:{var s=Tw(Tw({},n.state),i.payload||{});return n.state=o(s,{type:i3,payload:s}),n.state}default:return o(r,i)}}},J0e=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(v,g,y){var S=_(v,g,y);return K0e(S,n,{driver:t,prefix:o,serialize:a,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return m};const $Me=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],eve="@@invokeai-",tve=["cursorPosition"],nve=["pendingControlImages"],rve=["prompts"],ive=["selection","selectedBoardId","galleryView"],ove=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy"],sve=[],ave=[],lve=["isInitialized","isConnected","denoiseProgress","status"],uve=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],cve={canvas:tve,gallery:ive,generation:sve,nodes:ove,postprocessing:ave,system:lve,ui:uve,controlNet:nve,dynamicPrompts:rve},dve=(e,t)=>{const n=O_(e,cve[t]??[]);return JSON.stringify(n)},fve={canvas:ID,gallery:fF,generation:CT,nodes:zB,postprocessing:VB,system:WB,config:pD,ui:ez,hotkeys:YB,controlNet:BC,dynamicPrompts:s5,sdxl:qB},hve=(e,t)=>_ee(JSON.parse(e),fve[t]),pve=Me("nodes/textToImageGraphBuilt"),gve=Me("nodes/imageToImageGraphBuilt"),az=Me("nodes/canvasGraphBuilt"),mve=Me("nodes/nodesGraphBuilt"),yve=Xi(pve,gve,az,mve),vve=Me("nodes/workflowLoadRequested"),_ve=e=>{if(yve(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return Bg.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:UB.match(e)?{...e,payload:"<Node templates omitted>"}:e},bve=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],Sve=e=>e,wve=e=>{const t=e?Cp.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${pr.get()}/list?${t}`:`queue/${pr.get()}/list`},ec=Sa({selectId:e=>e.item_id,sortComparer:(e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.item_id<t.item_id?-1:e.item_id>t.item_id?1:0}),bi=$s.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${pr.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,zh(r)}catch{}}}),enqueueGraph:e.mutation({query:t=>({url:`queue/${pr.get()}/enqueue_graph`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,zh(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${pr.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${pr.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${pr.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,zh(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${pr.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,zh(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${pr.get()}/current`,method:"GET"}),providesTags:t=>{const n=["CurrentSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getNextQueueItem:e.query({query:()=>({url:`queue/${pr.get()}/next`,method:"GET"}),providesTags:t=>{const n=["NextSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getQueueStatus:e.query({query:()=>({url:`queue/${pr.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${pr.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${pr.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${pr.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(bi.util.updateQueryData("listQueueItems",void 0,o=>{ec.updateOne(o,{id:t,changes:{status:i.status}})}))}catch{}},invalidatesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id},{type:"SessionQueueItemDTO",id:t.item_id},{type:"BatchStatus",id:t.batch_id}]:[]}),cancelByBatchIds:e.mutation({query:t=>({url:`queue/${pr.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,zh(r)}catch{}},invalidatesTags:["SessionQueueItem","SessionQueueItemDTO","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:wve(t),method:"GET"}),serializeQueryArgs:()=>`queue/${pr.get()}/list`,transformResponse:t=>ec.addMany(ec.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{ec.addMany(t,ec.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:FMe,useEnqueueGraphMutation:BMe,useEnqueueBatchMutation:zMe,usePauseProcessorMutation:jMe,useResumeProcessorMutation:UMe,useClearQueueMutation:VMe,usePruneQueueMutation:GMe,useGetCurrentQueueItemQuery:qMe,useGetQueueStatusQuery:HMe,useGetQueueItemQuery:WMe,useGetNextQueueItemQuery:KMe,useListQueueItemsQuery:QMe,useCancelQueueItemMutation:XMe,useGetBatchStatusQuery:YMe}=bi,zh=e=>{e(bi.util.updateQueryData("listQueueItems",void 0,t=>{ec.removeAll(t),t.has_more=!1})),e(w0e()),e(bi.endpoints.listQueueItems.initiate(void 0))},xve=Xi(xre,Cre),Cve=()=>{Ee({matcher:xve,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),{batchIds:o}=i.canvas;try{const s=t(bi.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:a}=await s.unwrap();s.reset(),a>0&&(r.debug(`Canceled ${a} canvas batches`),t(Mt({title:X("queue.cancelBatchSucceeded"),status:"success"}))),t(kre())}catch{r.error("Failed to cancel canvas batches"),t(Mt({title:X("queue.cancelBatchFailed"),status:"error"}))}}})};Me("app/appStarted");const Eve=()=>{Ee({matcher:ge.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==xo({board_id:"none",categories:Kr}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Dn.getSelectors().selectAll(i)[0];t(fa(o??null))}}})},Tve=Xi(bi.endpoints.enqueueBatch.matchFulfilled,bi.endpoints.enqueueGraph.matchFulfilled),Ave=()=>{Ee({matcher:Tve,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=bi.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(bi.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},lz=$s.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:ZMe,useGetAppConfigQuery:JMe}=lz,kve=()=>{Ee({matcher:lz.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(ere(r[0])),i.includes("nsfw_checker")||n(g0e(!1)),o.includes("invisible_watermark")||n(m0e(!1))}})},Pve=Me("app/appStarted"),Rve=()=>{Ee({actionCreator:Pve,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},T5={memoizeOptions:{resultEqualityCheck:Sm}},uz=(e,t)=>{var f,h;const{generation:n,canvas:r,nodes:i,controlNet:o}=e,s=((f=n.initialImage)==null?void 0:f.imageName)===t,a=r.layerState.objects.some(p=>p.kind==="image"&&p.imageName===t),l=i.nodes.filter(Nr).some(p=>_p(p.data.inputs,m=>{var b;return m.type==="ImageField"&&((b=m.value)==null?void 0:b.image_name)===t})),u=_p(o.controlNets,p=>p.controlImage===t||p.processedControlImage===t),c=((h=o.ipAdapterInfo.adapterImage)==null?void 0:h.image_name)===t;return{isInitialImage:s,isCanvasImage:a,isNodesImage:l,isControlNetImage:u,isIPAdapterImage:c}},Ive=Di([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>uz(e,r.image_name)):[]},T5),Ove=()=>{Ee({matcher:ge.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,l=!1;const u=n();r.forEach(c=>{const d=uz(u,c);d.isInitialImage&&!i&&(t(ET()),i=!0),d.isCanvasImage&&!o&&(t(TT()),o=!0),d.isNodesImage&&!s&&(t(s0e()),s=!0),d.isControlNetImage&&!a&&(t(ufe()),a=!0),d.isIPAdapterImage&&!l&&(t(uF()),l=!0)})}})},Mve=()=>{Ee({matcher:Xi(zC,h1),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),s=zC.match(e)?e.payload:o.gallery.selectedBoardId,l=(h1.match(e)?e.payload:o.gallery.galleryView)==="images"?Kr:Gl,u={board_id:s??"none",categories:l};if(await r(()=>ge.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=ge.endpoints.listImages.select(u)(t());if(d){const f=f1.selectAll(d)[0];n(fa(f??null))}else n(fa(null))}else n(fa(null))}})},Nve=Me("canvas/canvasSavedToGallery"),Dve=Me("canvas/canvasMaskSavedToGallery"),Lve=Me("canvas/canvasCopiedToClipboard"),$ve=Me("canvas/canvasDownloadedAsImage"),Fve=Me("canvas/canvasMerged"),Bve=Me("canvas/stagingAreaImageSaved"),zve=Me("canvas/canvasMaskToControlNet"),jve=Me("canvas/canvasImageToControlNet");let cz=null,dz=null;const eNe=e=>{cz=e},zb=()=>cz,tNe=e=>{dz=e},Uve=()=>dz,Vve=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),E1=async(e,t)=>await Vve(e.toCanvas(t)),jb=async e=>{const t=zb();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 E1(o,a)},Gve=e=>{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])},qve=()=>{Ee({actionCreator:Lve,effect:async(e,{dispatch:t,getState:n})=>{const r=lb.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n(),o=await jb(i);if(!o){r.error("Problem getting base layer blob"),t(Mt({title:X("toast.problemCopyingCanvas"),description:X("toast.problemCopyingCanvasDesc"),status:"error"}));return}Gve(o),t(Mt({title:X("toast.canvasCopiedClipboard"),status:"success"}))}})},Hve=(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()},Wve=()=>{Ee({actionCreator:$ve,effect:async(e,{dispatch:t,getState:n})=>{const r=lb.get().child({namespace:"canvasSavedToGalleryListener"}),i=n(),o=await jb(i);if(!o){r.error("Problem getting base layer blob"),t(Mt({title:X("toast.problemDownloadingCanvas"),description:X("toast.problemDownloadingCanvasDesc"),status:"error"}));return}Hve(o,"canvas.png"),t(Mt({title:X("toast.canvasDownloaded"),status:"success"}))}})},Kve=()=>{Ee({actionCreator:jve,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await jb(i);if(!o){r.error("Problem getting base layer blob"),t(Mt({title:X("toast.problemSavingCanvas"),description:X("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery,a=await t(ge.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:X("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:l}=a;t(Xc({controlNetId:e.payload.controlNet.controlNetId,controlImage:l}))}})};var A5={exports:{}},Ub={},fz={},At={};(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 ft<"u"?ft: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)})(At);var ir={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=At;class n{constructor(y=[1,0,0,1,0,0]){this.dirty=!1,this.m=y&&y.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(y){y.m[0]=this.m[0],y.m[1]=this.m[1],y.m[2]=this.m[2],y.m[3]=this.m[3],y.m[4]=this.m[4],y.m[5]=this.m[5]}point(y){var S=this.m;return{x:S[0]*y.x+S[2]*y.y+S[4],y:S[1]*y.x+S[3]*y.y+S[5]}}translate(y,S){return this.m[4]+=this.m[0]*y+this.m[2]*S,this.m[5]+=this.m[1]*y+this.m[3]*S,this}scale(y,S){return this.m[0]*=y,this.m[1]*=y,this.m[2]*=S,this.m[3]*=S,this}rotate(y){var S=Math.cos(y),w=Math.sin(y),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(y,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]*y,A=this.m[3]+this.m[1]*y;return this.m[0]=w,this.m[1]=x,this.m[2]=C,this.m[3]=A,this}multiply(y){var S=this.m[0]*y.m[0]+this.m[2]*y.m[1],w=this.m[1]*y.m[0]+this.m[3]*y.m[1],x=this.m[0]*y.m[2]+this.m[2]*y.m[3],C=this.m[1]*y.m[2]+this.m[3]*y.m[3],A=this.m[0]*y.m[4]+this.m[2]*y.m[5]+this.m[4],T=this.m[1]*y.m[4]+this.m[3]*y.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 y=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*y,w=-this.m[1]*y,x=-this.m[2]*y,C=this.m[0]*y,A=y*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=y*(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 y=this.m[0],S=this.m[1],w=this.m[2],x=this.m[3],C=this.m[4],A=this.m[5],T=y*x-S*w;let P={x:C,y:A,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(y!=0||S!=0){var L=Math.sqrt(y*y+S*S);P.rotation=S>0?Math.acos(y/L):-Math.acos(y/L),P.scaleX=L,P.scaleY=T/L,P.skewX=(y*w+S*x)/T,P.skewY=0}else if(w!=0||x!=0){var R=Math.sqrt(w*w+x*x);P.rotation=Math.PI/2-(x>0?Math.acos(-w/R):-Math.acos(w/R)),P.scaleX=T/R,P.scaleY=R,P.skewX=0,P.skewY=(y*w+S*x)/T}return P.rotation=e.Util._getRotation(P.rotation),P}}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 v=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 y=g[0];return y==="#"||y==="."||y===y.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){_.push(g),_.length===1&&v(function(){const y=_;_=[],y.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,y){var S=e.Util.createImageElement();S.onload=function(){y(S)},S.src=g},_rgbToHex(g,y,S){return((1<<24)+(g<<16)+(y<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,c);var y=parseInt(g,16);return{r:y>>16&255,g:y>>8&255,b:y&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return u+g},getRGB(g){var y;return g in m?(y=m[g],{r:y[0],g:y[1],b:y[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(y=b.exec(g.replace(/ /g,"")),{r:parseInt(y[1],10),g:parseInt(y[2],10),b:parseInt(y[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 y=m[g.toLowerCase()];return y?{r:y[0],g:y[1],b:y[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var y=g.split(/ *, */).map(Number);return{r:y[0],g:y[1],b:y[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var y=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:y[0],g:y[1],b:y[2],a:y[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[y,...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,P;if(x===0)return P=C*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};C<.5?A=C*(1+x):A=C+x-C*x;const L=2*C-A,R=[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?P=L+(A-L)*6*T:2*T<1?P=A:3*T<2?P=L+(A-L)*(2/3-T)*6:P=L,R[E]=P*255;return{r:Math.round(R[0]),g:Math.round(R[1]),b:Math.round(R[2]),a:1}}},haveIntersection(g,y){return!(y.x>g.x+g.width||y.x+y.width<g.x||y.y>g.y+g.height||y.y+y.height<g.y)},cloneObject(g){var y={};for(var S in g)this._isPlainObject(g[S])?y[S]=this.cloneObject(g[S]):this._isArray(g[S])?y[S]=this.cloneArray(g[S]):y[S]=g[S];return y},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,y){for(var S in g)y(S,g[S])},_inRange(g,y,S){return y<=g&&g<S},_getProjectionToSegment(g,y,S,w,x,C){var A,T,P,L=(g-S)*(g-S)+(y-w)*(y-w);if(L==0)A=g,T=y,P=(x-S)*(x-S)+(C-w)*(C-w);else{var R=((x-g)*(S-g)+(C-y)*(w-y))/L;R<0?(A=g,T=y,P=(g-x)*(g-x)+(y-C)*(y-C)):R>1?(A=S,T=w,P=(S-x)*(S-x)+(w-C)*(w-C)):(A=g+R*(S-g),T=y+R*(w-y),P=(A-x)*(A-x)+(T-C)*(T-C))}return[A,T,P]},_getProjectionToLine(g,y,S){var w=e.Util.cloneObject(g),x=Number.MAX_VALUE;return y.forEach(function(C,A){if(!(!S&&A===y.length-1)){var T=y[(A+1)%y.length],P=e.Util._getProjectionToSegment(C.x,C.y,T.x,T.y,g.x,g.y),L=P[0],R=P[1],E=P[2];E<x&&(w.x=L,w.y=R,x=E)}}),w},_prepareArrayForTween(g,y,S){var w,x=[],C=[];if(g.length>y.length){var A=y;y=g,g=A}for(w=0;w<g.length;w+=2)x.push({x:g[w],y:g[w+1]});for(w=0;w<y.length;w+=2)C.push({x:y[w],y:y[w+1]});var T=[];return C.forEach(function(P){var L=e.Util._getProjectionToLine(P,x,S);T.push(L.x),T.push(L.y)}),T},_prepareToStringify(g){var y;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(y=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(y.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(y.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,y){for(var S in y)g[S]=y[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(y=>{y.width=0,y.height=0})},drawRoundedRectPath(g,y,S,w){let x=0,C=0,A=0,T=0;typeof w=="number"?x=C=A=T=Math.min(w,y/2,S/2):(x=Math.min(w[0]||0,y/2,S/2),C=Math.min(w[1]||0,y/2,S/2),T=Math.min(w[2]||0,y/2,S/2),A=Math.min(w[3]||0,y/2,S/2)),g.moveTo(x,0),g.lineTo(y-C,0),g.arc(y-C,C,C,Math.PI*3/2,0,!1),g.lineTo(y,S-T),g.arc(y-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)}}})(ir);var Qn={},Et={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getComponentValidator=Ke.getBooleanValidator=Ke.getNumberArrayValidator=Ke.getFunctionValidator=Ke.getStringOrGradientValidator=Ke.getStringValidator=Ke.getNumberOrAutoValidator=Ke.getNumberOrArrayOfNumbersValidator=Ke.getNumberValidator=Ke.alphaComponent=Ke.RGBComponent=void 0;const pl=At,cr=ir;function gl(e){return cr.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||cr.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Qve(e){return e>255?255:e<0?0:Math.round(e)}Ke.RGBComponent=Qve;function Xve(e){return e>1?1:e<1e-4?1e-4:e}Ke.alphaComponent=Xve;function Yve(){if(pl.Konva.isUnminified)return function(e,t){return cr.Util._isNumber(e)||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Ke.getNumberValidator=Yve;function Zve(e){if(pl.Konva.isUnminified)return function(t,n){let r=cr.Util._isNumber(t),i=cr.Util._isArray(t)&&t.length==e;return!r&&!i&&cr.Util.warn(gl(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Ke.getNumberOrArrayOfNumbersValidator=Zve;function Jve(){if(pl.Konva.isUnminified)return function(e,t){var n=cr.Util._isNumber(e),r=e==="auto";return n||r||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Ke.getNumberOrAutoValidator=Jve;function e1e(){if(pl.Konva.isUnminified)return function(e,t){return cr.Util._isString(e)||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Ke.getStringValidator=e1e;function t1e(){if(pl.Konva.isUnminified)return function(e,t){const n=cr.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Ke.getStringOrGradientValidator=t1e;function n1e(){if(pl.Konva.isUnminified)return function(e,t){return cr.Util._isFunction(e)||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Ke.getFunctionValidator=n1e;function r1e(){if(pl.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(cr.Util._isArray(e)?e.forEach(function(r){cr.Util._isNumber(r)||cr.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Ke.getNumberArrayValidator=r1e;function i1e(){if(pl.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||cr.Util.warn(gl(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Ke.getBooleanValidator=i1e;function o1e(e){if(pl.Konva.isUnminified)return function(t,n){return t==null||cr.Util.isObject(t)||cr.Util.warn(gl(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Ke.getComponentValidator=o1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=ir,n=Ke;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 v=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(y=>{this._setAttr(s+d(y),void 0)}),this._fireChangeEvent(s,v,_),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}}})(Et);var Ms={},Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.HitContext=Ya.SceneContext=Ya.Context=void 0;const hz=ir,s1e=At;function a1e(e){var t=[],n=e.length,r=hz.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 X8=",",l1e="(",u1e=")",c1e="([",d1e="])",f1e=";",h1e="()",p1e="=",Y8=["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"],g1e=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const m1e=100;class Vb{constructor(t){this.canvas=t,s1e.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+=h1e:hz.Util._isArray(u[0])?o+=c1e+u.join(X8)+d1e:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=l1e+u.join(X8)+u1e)):(o+=a.property,t||(o+=p1e+a.val)),o+=f1e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=m1e&&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=Y8.length,r=this.setAttr,i,o,s=function(a){var l=t[a],u;t[a]=function(){return o=a1e(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(Y8[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)}}Ya.Context=Vb;g1e.forEach(function(e){Object.defineProperty(Vb.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class y1e extends Vb{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)}}Ya.SceneContext=y1e;class v1e extends Vb{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()}}}Ya.HitContext=v1e;Object.defineProperty(Ms,"__esModule",{value:!0});Ms.HitCanvas=Ms.SceneCanvas=Ms.Canvas=void 0;const T1=ir,pz=Ya,gz=At,_1e=Et,b1e=Ke;var Qy;function S1e(){if(Qy)return Qy;var e=T1.Util.createCanvasElement(),t=e.getContext("2d");return Qy=function(){var n=gz.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),T1.Util.releaseCanvas(e),Qy}class Gb{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||gz.Konva.pixelRatio||S1e();this.pixelRatio=r,this._canvas=T1.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 T1.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Ms.Canvas=Gb;_1e.Factory.addGetterSetter(Gb,"pixelRatio",void 0,(0,b1e.getNumberValidator)());class w1e extends Gb{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new pz.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}Ms.SceneCanvas=w1e;class x1e extends Gb{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new pz.HitContext(this),this.setSize(t.width,t.height)}}Ms.HitCanvas=x1e;var qb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=At,n=ir;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))})(qb);Object.defineProperty(Qn,"__esModule",{value:!0});Qn.Node=void 0;const Rt=ir,zm=Et,Xy=Ms,ju=At,jo=qb,vr=Ke;var z0="absoluteOpacity",Yy="allEventListeners",$a="absoluteTransform",Z8="absoluteScale",Uu="canvas",C1e="Change",E1e="children",T1e="konva",s3="listening",J8="mouseenter",eR="mouseleave",tR="set",nR="Shape",j0=" ",rR="stage",Tl="transform",A1e="Stage",a3="visible",k1e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(j0);let P1e=1;class ut{constructor(t){this._id=P1e++,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===Tl||t===$a)&&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===Tl||t===$a,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(j0);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Uu)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===$a&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Uu)){const{scene:t,filter:n,hit:r}=this._cache.get(Uu);Rt.Util.releaseCanvas(t,n,r),this._cache.delete(Uu)}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 Xy.SceneCanvas({pixelRatio:s,width:i,height:o}),h=new Xy.SceneCanvas({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),p=new Xy.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),b=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(Uu),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(z0),this._clearSelfAndDescendantCache(Z8),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(Uu,{scene:f,filter:h,hit:p,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Uu)}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(Yy),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(j0),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(j0),i=r.length,o,s,a,l,u,c;if(this._cache&&this._cache.delete(Yy),!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(),jo.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache($a),this._clearSelfAndDescendantCache(z0),this._clearSelfAndDescendantCache(Z8),this._clearSelfAndDescendantCache(rR),this._clearSelfAndDescendantCache(a3),this._clearSelfAndDescendantCache(s3)}_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!==E1e&&(r=tR+Rt.Util._capitalize(n),Rt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(s3,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(a3,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;jo.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!==nR&&(i=i.concat(a.getChildren().slice())),a._id===n._id&&(s=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==A1e&&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(Tl),this._clearSelfAndDescendantCache($a)),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(Tl);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(Tl),this._clearSelfAndDescendantCache($a),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(z0,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(rR,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($a,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($a)||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(Tl,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(Tl)||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(T1e)<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 Xy.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+C1e,{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[tR+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===nR&&(n.target=this);var i=(t===J8||t===eR)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===J8||t===eR)&&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(Yy))!==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(Yy,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;jo.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){jo.DD._dragElements.has(this._id)||this._createDragElement(t);const r=jo.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=jo.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),jo.DD._endDragBefore(t),jo.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=jo.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;jo.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=jo.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&jo.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=ut.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(ut._createNode(i[a]));return o}}Qn.Node=ut;ut.prototype.nodeType="Node";ut.prototype._attrsAffectingSize=[];ut.prototype.eventListeners={};ut.prototype.on.call(ut.prototype,k1e,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Tl),this._clearSelfAndDescendantCache($a)});ut.prototype.on.call(ut.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(a3)});ut.prototype.on.call(ut.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(s3)});ut.prototype.on.call(ut.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(z0)});const xn=zm.Factory.addGetterSetter;xn(ut,"zIndex");xn(ut,"absolutePosition");xn(ut,"position");xn(ut,"x",0,(0,vr.getNumberValidator)());xn(ut,"y",0,(0,vr.getNumberValidator)());xn(ut,"globalCompositeOperation","source-over",(0,vr.getStringValidator)());xn(ut,"opacity",1,(0,vr.getNumberValidator)());xn(ut,"name","",(0,vr.getStringValidator)());xn(ut,"id","",(0,vr.getStringValidator)());xn(ut,"rotation",0,(0,vr.getNumberValidator)());zm.Factory.addComponentsGetterSetter(ut,"scale",["x","y"]);xn(ut,"scaleX",1,(0,vr.getNumberValidator)());xn(ut,"scaleY",1,(0,vr.getNumberValidator)());zm.Factory.addComponentsGetterSetter(ut,"skew",["x","y"]);xn(ut,"skewX",0,(0,vr.getNumberValidator)());xn(ut,"skewY",0,(0,vr.getNumberValidator)());zm.Factory.addComponentsGetterSetter(ut,"offset",["x","y"]);xn(ut,"offsetX",0,(0,vr.getNumberValidator)());xn(ut,"offsetY",0,(0,vr.getNumberValidator)());xn(ut,"dragDistance",null,(0,vr.getNumberValidator)());xn(ut,"width",0,(0,vr.getNumberValidator)());xn(ut,"height",0,(0,vr.getNumberValidator)());xn(ut,"listening",!0,(0,vr.getBooleanValidator)());xn(ut,"preventDefault",!0,(0,vr.getBooleanValidator)());xn(ut,"filters",null,function(e){return this._filterUpToDate=!1,e});xn(ut,"visible",!0,(0,vr.getBooleanValidator)());xn(ut,"transformsEnabled","all",(0,vr.getStringValidator)());xn(ut,"size");xn(ut,"dragBoundFunc");xn(ut,"draggable",!1,(0,vr.getBooleanValidator)());zm.Factory.backCompat(ut,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Container=void 0;const lh=Et,Aw=Qn,Hb=Ke;class Zc extends Aw.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=Aw.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=Aw.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)}}Yc.Container=Zc;lh.Factory.addComponentsGetterSetter(Zc,"clip",["x","y","width","height"]);lh.Factory.addGetterSetter(Zc,"clipX",void 0,(0,Hb.getNumberValidator)());lh.Factory.addGetterSetter(Zc,"clipY",void 0,(0,Hb.getNumberValidator)());lh.Factory.addGetterSetter(Zc,"clipWidth",void 0,(0,Hb.getNumberValidator)());lh.Factory.addGetterSetter(Zc,"clipHeight",void 0,(0,Hb.getNumberValidator)());lh.Factory.addGetterSetter(Zc,"clipFunc");var mz={},To={};Object.defineProperty(To,"__esModule",{value:!0});To.releaseCapture=To.setPointerCapture=To.hasPointerCapture=To.createEvent=To.getCapturedShape=void 0;const R1e=At,jg=new Map,yz=R1e.Konva._global.PointerEvent!==void 0;function I1e(e){return jg.get(e)}To.getCapturedShape=I1e;function k5(e){return{evt:e,pointerId:e.pointerId}}To.createEvent=k5;function O1e(e,t){return jg.get(e)===t}To.hasPointerCapture=O1e;function M1e(e,t){vz(e),t.getStage()&&(jg.set(e,t),yz&&t._fire("gotpointercapture",k5(new PointerEvent("gotpointercapture"))))}To.setPointerCapture=M1e;function vz(e,t){const n=jg.get(e);if(!n)return;const r=n.getStage();r&&r.content,jg.delete(e),yz&&n._fire("lostpointercapture",k5(new PointerEvent("lostpointercapture")))}To.releaseCapture=vz;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=ir,n=Et,r=Yc,i=At,o=Ms,s=qb,a=At,l=To;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",b="mousemove",_="mousedown",v="mouseup",g="pointermove",y="pointerdown",S="pointerup",w="pointercancel",x="lostpointercapture",C="pointerout",A="pointerleave",T="pointerover",P="pointerenter",L="contextmenu",R="touchstart",E="touchend",k="touchmove",D="touchcancel",$="wheel",O=5,I=[[m,"_pointerenter"],[_,"_pointerdown"],[b,"_pointermove"],[v,"_pointerup"],[h,"_pointerleave"],[R,"_pointerdown"],[k,"_pointermove"],[E,"_pointerup"],[D,"_pointercancel"],[p,"_pointerover"],[$,"_wheel"],[L,"_contextmenu"],[y,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[x,"_lostpointercapture"]];const N={mouse:{[C]:f,[A]:h,[T]:p,[P]:m,[g]:b,[y]:_,[S]:v,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[A]:"touchleave",[T]:"touchover",[P]:"touchenter",[g]:k,[y]:R,[S]:E,[w]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[A]:A,[T]:T,[P]:P,[g]:g,[y]:y,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=Y=>Y.indexOf("pointer")>=0?"pointer":Y.indexOf("touch")>=0?"touch":"mouse",U=Y=>{const j=B(Y);if(j==="pointer")return i.Konva.pointerEventsEnabled&&N.pointer;if(j==="touch")return N.touch;if(j==="mouse")return N.mouse};function G(Y={}){return(Y.clipFunc||Y.clipWidth||Y.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Y}const Q="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Z extends r.Container{constructor(j){super(G(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",()=>{G(this.attrs)}),this._checkVisibility()}_validateAdd(j){const W=j.getType()==="Layer",te=j.getType()==="FastLayer";W||te||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 W=j.slice(1);j=document.getElementsByClassName(W)[0]}else{var te;j.charAt(0)!=="#"?te=j:te=j.slice(1),j=document.getElementById(te)}if(!j)throw"Can not find container in document with id "+te}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,W=j.length,te;for(te=0;te<W;te++)j[te].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 W=e.stages.indexOf(this);return W>-1&&e.stages.splice(W,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(Q),null)}_getPointerById(j){return this._pointerPositions.find(W=>W.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 W=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),te=W.getContext()._context,oe=this.children;return(j.x||j.y)&&te.translate(-1*j.x,-1*j.y),oe.forEach(function(ye){if(ye.isVisible()){var le=ye._toKonvaCanvas(j);te.drawImage(le._canvas,j.x,j.y,le.getWidth()/le.getPixelRatio(),le.getHeight()/le.getPixelRatio())}}),W}getIntersection(j){if(!j)return null;var W=this.children,te=W.length,oe=te-1,ye;for(ye=oe;ye>=0;ye--){const le=W[ye].getIntersection(j);if(le)return le}return null}_resizeDOM(){var j=this.width(),W=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=W+d),this.bufferCanvas.setSize(j,W),this.bufferHitCanvas.setSize(j,W),this.children.forEach(te=>{te.setSize({width:j,height:W}),te.draw()})}add(j,...W){if(arguments.length>1){for(var te=0;te<arguments.length;te++)this.add(arguments[te]);return this}super.add(j);var oe=this.children.length;return oe>O&&t.Util.warn("The stage has "+oe+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),j.setSize({width:this.width(),height:this.height()}),j.draw(),i.Konva.isBrowser&&this.content.appendChild(j.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(j){return l.hasPointerCapture(j,this)}setPointerCapture(j){l.setPointerCapture(j,this)}releaseCapture(j){l.releaseCapture(j,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&I.forEach(([j,W])=>{this.content.addEventListener(j,te=>{this[W](te)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const W=U(j.type);this._fire(W.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const W=U(j.type);this._fire(W.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let W=this[j+"targetShape"];return W&&!W.getStage()&&(W=null),W}_pointerleave(j){const W=U(j.type),te=B(j.type);if(W){this.setPointersPositions(j);var oe=this._getTargetShape(te),ye=!s.DD.isDragging||i.Konva.hitOnDragEnabled;oe&&ye?(oe._fireAndBubble(W.pointerout,{evt:j}),oe._fireAndBubble(W.pointerleave,{evt:j}),this._fire(W.pointerleave,{evt:j,target:this,currentTarget:this}),this[te+"targetShape"]=null):ye&&(this._fire(W.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(W.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(j){const W=U(j.type),te=B(j.type);if(W){this.setPointersPositions(j);var oe=!1;this._changedPointerPositions.forEach(ye=>{var le=this.getIntersection(ye);if(s.DD.justDragged=!1,i.Konva["_"+te+"ListenClick"]=!0,!(le&&le.isListening()))return;i.Konva.capturePointerEventsEnabled&&le.setPointerCapture(ye.id),this[te+"ClickStartShape"]=le,le._fireAndBubble(W.pointerdown,{evt:j,pointerId:ye.id}),oe=!0;const nt=j.type.indexOf("touch")>=0;le.preventDefault()&&j.cancelable&&nt&&j.preventDefault()}),oe||this._fire(W.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const W=U(j.type),te=B(j.type);if(!W)return;s.DD.isDragging&&s.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var oe=!s.DD.isDragging||i.Konva.hitOnDragEnabled;if(!oe)return;var ye={};let le=!1;var pt=this._getTargetShape(te);this._changedPointerPositions.forEach(nt=>{const Fe=l.getCapturedShape(nt.id)||this.getIntersection(nt),ct=nt.id,ke={evt:j,pointerId:ct};var Qt=pt!==Fe;if(Qt&&pt&&(pt._fireAndBubble(W.pointerout,Object.assign({},ke),Fe),pt._fireAndBubble(W.pointerleave,Object.assign({},ke),Fe)),Fe){if(ye[Fe._id])return;ye[Fe._id]=!0}Fe&&Fe.isListening()?(le=!0,Qt&&(Fe._fireAndBubble(W.pointerover,Object.assign({},ke),pt),Fe._fireAndBubble(W.pointerenter,Object.assign({},ke),pt),this[te+"targetShape"]=Fe),Fe._fireAndBubble(W.pointermove,Object.assign({},ke))):pt&&(this._fire(W.pointerover,{evt:j,target:this,currentTarget:this,pointerId:ct}),this[te+"targetShape"]=null)}),le||this._fire(W.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const W=U(j.type),te=B(j.type);if(!W)return;this.setPointersPositions(j);const oe=this[te+"ClickStartShape"],ye=this[te+"ClickEndShape"];var le={};let pt=!1;this._changedPointerPositions.forEach(nt=>{const Fe=l.getCapturedShape(nt.id)||this.getIntersection(nt);if(Fe){if(Fe.releaseCapture(nt.id),le[Fe._id])return;le[Fe._id]=!0}const ct=nt.id,ke={evt:j,pointerId:ct};let Qt=!1;i.Konva["_"+te+"InDblClickWindow"]?(Qt=!0,clearTimeout(this[te+"DblTimeout"])):s.DD.justDragged||(i.Konva["_"+te+"InDblClickWindow"]=!0,clearTimeout(this[te+"DblTimeout"])),this[te+"DblTimeout"]=setTimeout(function(){i.Konva["_"+te+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Fe&&Fe.isListening()?(pt=!0,this[te+"ClickEndShape"]=Fe,Fe._fireAndBubble(W.pointerup,Object.assign({},ke)),i.Konva["_"+te+"ListenClick"]&&oe&&oe===Fe&&(Fe._fireAndBubble(W.pointerclick,Object.assign({},ke)),Qt&&ye&&ye===Fe&&Fe._fireAndBubble(W.pointerdblclick,Object.assign({},ke)))):(this[te+"ClickEndShape"]=null,i.Konva["_"+te+"ListenClick"]&&this._fire(W.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:ct}),Qt&&this._fire(W.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:ct}))}),pt||this._fire(W.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+te+"ListenClick"]=!1,j.cancelable&&te!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var W=this.getIntersection(this.getPointerPosition());W&&W.isListening()?W._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var W=this.getIntersection(this.getPointerPosition());W&&W.isListening()?W._fireAndBubble($,{evt:j}):this._fire($,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const W=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());W&&W._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var W=this._getContentPosition(),te=null,oe=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,ye=>{this._pointerPositions.push({id:ye.identifier,x:(ye.clientX-W.left)/W.scaleX,y:(ye.clientY-W.top)/W.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,ye=>{this._changedPointerPositions.push({id:ye.identifier,x:(ye.clientX-W.left)/W.scaleX,y:(ye.clientY-W.top)/W.scaleY})})):(te=(j.clientX-W.left)/W.scaleX,oe=(j.clientY-W.top)/W.scaleY,this.pointerPos={x:te,y:oe},this._pointerPositions=[{x:te,y:oe,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:te,y:oe,id:t.Util._getFirstPointerId(j)}])}_setPointerPosition(j){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(j)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var j=this.content.getBoundingClientRect();return{top:j.top,left:j.left,scaleX:j.width/this.content.clientWidth||1,scaleY:j.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var j=this.container();if(!j)throw"Stage has no container. A container is required.";j.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),j.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(j){j.batchDraw()}),this}}e.Stage=Z,Z.prototype.nodeType=u,(0,a._registerNode)(Z),n.Factory.addGetterSetter(Z,"container")})(mz);var jm={},jr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=At,n=ir,r=Et,i=Qn,o=Ke,s=At,a=To;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 v(A){A.stroke()}function g(){this._clearCache(l)}function y(){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 P;for(;P=n.Util.getRandomColor(),!(P&&!(P in e.shapes)););this.colorKey=P,e.shapes[P]=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 P=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.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 R=L.getMatrix(),E=typeof DOMMatrix>"u"?{a:R[0],b:R[1],c:R[2],d:R[3],e:R[4],f:R[5]}:new DOMMatrix(R);P.setTransform(E)}return P}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var P=p(),L=this.fillLinearGradientStartPoint(),R=this.fillLinearGradientEndPoint(),E=P.createLinearGradient(L.x,L.y,R.x,R.y),k=0;k<T.length;k+=2)E.addColorStop(T[k],T[k+1]);return E}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var P=p(),L=this.fillRadialGradientStartPoint(),R=this.fillRadialGradientEndPoint(),E=P.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),R.x,R.y,this.fillRadialGradientEndRadius()),k=0;k<T.length;k+=2)E.addColorStop(T[k],T[k+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 P=this.getStage(),L=P.bufferHitCanvas,R;return L.getContext().clear(),this.drawHit(L,null,!0),R=L.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data,R[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var P;if(!this.getStage()||!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const R=T||this.hasFill(),E=this.hasStroke(),k=this.getAbsoluteOpacity()!==1;if(R&&E&&k)return!0;const D=this.hasShadow(),$=this.shadowForStrokeEnabled();return!!(R&&E&&D&&$)}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 P=T.skipTransform,L=T.relativeTo,R=this.getSelfRect(),k=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=R.width+k,$=R.height+k,O=!T.skipShadow&&this.hasShadow(),I=O?this.shadowOffsetX():0,N=O?this.shadowOffsetY():0,B=D+Math.abs(I),U=$+Math.abs(N),G=O&&this.shadowBlur()||0,Q=B+G*2,Z=U+G*2,Y={width:Q,height:Z,x:-(k/2+G)+Math.min(I,0)+R.x,y:-(k/2+G)+Math.min(N,0)+R.y};return P?Y:this._transformedRect(Y,L)}drawScene(T,P){var L=this.getLayer(),R=T||L.getCanvas(),E=R.getContext(),k=this._getCanvasCache(),D=this.getSceneFunc(),$=this.hasShadow(),O,I,N,B=R.isCache,U=P===this;if(!this.isVisible()&&!U)return this;if(k){E.save();var G=this.getAbsoluteTransform(P).getMatrix();return E.transform(G[0],G[1],G[2],G[3],G[4],G[5]),this._drawCachedSceneCanvas(E),E.restore(),this}if(!D)return this;if(E.save(),this._useBufferCanvas()&&!B){O=this.getStage(),I=O.bufferCanvas,N=I.getContext(),N.clear(),N.save(),N._applyLineJoin(this);var Q=this.getAbsoluteTransform(P).getMatrix();N.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]),D.call(this,N,this),N.restore();var Z=I.pixelRatio;$&&E._applyShadow(this),E._applyOpacity(this),E._applyGlobalCompositeOperation(this),E.drawImage(I._canvas,0,0,I.width/Z,I.height/Z)}else{if(E._applyLineJoin(this),!U){var Q=this.getAbsoluteTransform(P).getMatrix();E.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]),E._applyOpacity(this),E._applyGlobalCompositeOperation(this)}$&&E._applyShadow(this),D.call(this,E,this)}return E.restore(),this}drawHit(T,P,L=!1){if(!this.shouldDrawHit(P,L))return this;var R=this.getLayer(),E=T||R.hitCanvas,k=E&&E.getContext(),D=this.hitFunc()||this.sceneFunc(),$=this._getCanvasCache(),O=$&&$.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()"),O){k.save();var I=this.getAbsoluteTransform(P).getMatrix();return k.transform(I[0],I[1],I[2],I[3],I[4],I[5]),this._drawCachedHitCanvas(k),k.restore(),this}if(!D)return this;if(k.save(),k._applyLineJoin(this),!(this===P)){var B=this.getAbsoluteTransform(P).getMatrix();k.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return D.call(this,k,this),k.restore(),this}drawHitFromCache(T=0){var P=this._getCanvasCache(),L=this._getCachedSceneCanvas(),R=P.hit,E=R.getContext(),k=R.getWidth(),D=R.getHeight(),$,O,I,N,B,U;E.clear(),E.drawImage(L._canvas,0,0,k,D);try{for($=E.getImageData(0,0,k,D),O=$.data,I=O.length,N=n.Util._hexToRgb(this.colorKey),B=0;B<I;B+=4)U=O[B+3],U>T?(O[B]=N.r,O[B+1]=N.g,O[B+2]=N.b,O[B+3]=255):O[B+3]=0;E.putImageData($,0,0)}catch(G){n.Util.error("Unable to draw hit graph from cached scene canvas. "+G.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=v,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",y),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"})})(jr);Object.defineProperty(jm,"__esModule",{value:!0});jm.Layer=void 0;const Ma=ir,kw=Yc,wd=Qn,P5=Et,iR=Ms,N1e=Ke,D1e=jr,L1e=At;var $1e="#",F1e="beforeDraw",B1e="draw",_z=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],z1e=_z.length;class uh extends kw.Container{constructor(t){super(t),this.canvas=new iR.SceneCanvas,this.hitCanvas=new iR.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(){wd.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=wd.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(wd.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(wd.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 wd.Node.prototype.remove.call(this),t&&t.parentNode&&Ma.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"&&Ma.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(),wd.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(){Ma.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ma.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ma.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<z1e;i++){const o=_z[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=Ma.Util._rgbToHex(r[0],r[1],r[2]),s=D1e.shapes[$1e+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(F1e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),kw.Container.prototype.drawScene.call(this,i,n),this._fire(B1e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),kw.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Ma.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Ma.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 Ma.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}jm.Layer=uh;uh.prototype.nodeType="Layer";(0,L1e._registerNode)(uh);P5.Factory.addGetterSetter(uh,"imageSmoothingEnabled",!0);P5.Factory.addGetterSetter(uh,"clearBeforeDraw",!0);P5.Factory.addGetterSetter(uh,"hitGraphEnabled",!0,(0,N1e.getBooleanValidator)());var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0});Wb.FastLayer=void 0;const j1e=ir,U1e=jm,V1e=At;class R5 extends U1e.Layer{constructor(t){super(t),this.listening(!1),j1e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Wb.FastLayer=R5;R5.prototype.nodeType="FastLayer";(0,V1e._registerNode)(R5);var ch={};Object.defineProperty(ch,"__esModule",{value:!0});ch.Group=void 0;const G1e=ir,q1e=Yc,H1e=At;class I5 extends q1e.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&G1e.Util.throw("You may only add groups and shapes to groups.")}}ch.Group=I5;I5.prototype.nodeType="Group";(0,H1e._registerNode)(I5);var dh={};Object.defineProperty(dh,"__esModule",{value:!0});dh.Animation=void 0;const Pw=At,oR=ir;var Rw=function(){return Pw.glob.performance&&Pw.glob.performance.now?function(){return Pw.glob.performance.now()}:function(){return new Date().getTime()}}();class na{constructor(t,n){this.id=na.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Rw(),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=na,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=Rw(),na._addAnimation(this),this}stop(){return na._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(Rw()),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=na;t.animations.length?(t._runFrames(),oR.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,oR.Util.requestAnimFrame(this._animationLoop))}}dh.Animation=na;na.animations=[];na.animIdCounter=0;na.animRunning=!1;var bz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=ir,n=dh,r=Qn,i=At;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,_,v,g,y){this.prop=p,this.propFunc=m,this.begin=_,this._pos=_,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=y,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=b,this._change=v-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,v,g=p.easing||e.Easings.Linear,y=!!p.yoyo,S;typeof p.duration>"u"?v=.3:p.duration===0?v=.001:v=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,v*1e3,y),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,v,g,y,S,w,x,C,A;if(y=f.tweens[_][p],y&&delete f.attrs[_][y][p],v=b.getAttr(p),t.Util._isArray(m))if(g=[],w=Math.max(m.length,v.length),p==="points"&&m.length!==v.length&&(m.length>v.length?(C=v,v=t.Util._prepareArrayForTween(v,m,b.closed())):(x=m,m=t.Util._prepareArrayForTween(m,v,b.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-v[S]);else{var T=t.Util.colorToRGBA(v[S]);A=t.Util.colorToRGBA(m[S]),v[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]-v[S]);else c.indexOf(p)!==-1?(v=t.Util.colorToRGBA(v),A=t.Util.colorToRGBA(m),g={r:A.r-v.r,g:A.g-v.g,b:A.b-v.b,a:A.a-v.a}):g=m-v;f.attrs[_][this._id][p]={start:v,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],_,v,g,y,S,w,x,C;for(_ in b){if(v=b[_],g=v.start,y=v.diff,C=v.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)+y[w]*p):S.push("rgba("+Math.round(g[w].r+y[w].r*p)+","+Math.round(g[w].g+y[w].g*p)+","+Math.round(g[w].b+y[w].b*p)+","+(g[w].a+y[w].a*p)+")");else for(w=0;w<x;w++)S.push((g[w]||0)+y[w]*p);else c.indexOf(_)!==-1?S="rgba("+Math.round(g.r+y.r*p)+","+Math.round(g.g+y.g*p)+","+Math.round(g.b+y.b*p)+","+(g.a+y.a*p)+")":S=g+y*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,_,v){var g=0;return h===0?p:(h/=b)===1?p+m:(v||(v=b*.3),!_||_<Math.abs(m)?(_=m,g=v/4):g=v/(2*Math.PI)*Math.asin(m/_),-(_*Math.pow(2,10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/v))+p)},ElasticEaseOut(h,p,m,b,_,v){var g=0;return h===0?p:(h/=b)===1?p+m:(v||(v=b*.3),!_||_<Math.abs(m)?(_=m,g=v/4):g=v/(2*Math.PI)*Math.asin(m/_),_*Math.pow(2,-10*h)*Math.sin((h*b-g)*(2*Math.PI)/v)+m+p)},ElasticEaseInOut(h,p,m,b,_,v){var g=0;return h===0?p:(h/=b/2)===2?p+m:(v||(v=b*(.3*1.5)),!_||_<Math.abs(m)?(_=m,g=v/4):g=v/(2*Math.PI)*Math.asin(m/_),h<1?-.5*(_*Math.pow(2,10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/v))+p:_*Math.pow(2,-10*(h-=1))*Math.sin((h*b-g)*(2*Math.PI)/v)*.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}}})(bz);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=At,n=ir,r=Qn,i=Yc,o=mz,s=jm,a=Wb,l=ch,u=qb,c=jr,d=dh,f=bz,h=Ya,p=Ms;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})(fz);var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});Kb.Arc=void 0;const Qb=Et,W1e=jr,sR=At,Xb=Ke,K1e=At;class ml extends W1e.Shape{_sceneFunc(t){var n=sR.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=sR.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}}}Kb.Arc=ml;ml.prototype._centroid=!0;ml.prototype.className="Arc";ml.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,K1e._registerNode)(ml);Qb.Factory.addGetterSetter(ml,"innerRadius",0,(0,Xb.getNumberValidator)());Qb.Factory.addGetterSetter(ml,"outerRadius",0,(0,Xb.getNumberValidator)());Qb.Factory.addGetterSetter(ml,"angle",0,(0,Xb.getNumberValidator)());Qb.Factory.addGetterSetter(ml,"clockwise",!1,(0,Xb.getBooleanValidator)());var Yb={},Um={};Object.defineProperty(Um,"__esModule",{value:!0});Um.Line=void 0;const Zb=Et,Q1e=jr,Sz=Ke,X1e=At;function l3(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 aR(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=l3(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 Iu extends Q1e.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():aR(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=l3(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=l3(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),s=aR(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}}}Um.Line=Iu;Iu.prototype.className="Line";Iu.prototype._attrsAffectingSize=["points","bezier","tension"];(0,X1e._registerNode)(Iu);Zb.Factory.addGetterSetter(Iu,"closed",!1);Zb.Factory.addGetterSetter(Iu,"bezier",!1);Zb.Factory.addGetterSetter(Iu,"tension",0,(0,Sz.getNumberValidator)());Zb.Factory.addGetterSetter(Iu,"points",[],(0,Sz.getNumberArrayValidator)());var fh={},wz={};(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,v=l+b,g=_-b*b,y=v*v+g>0?Math.sqrt(v*v+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((v+y)/(b+S))):0;return Math.sqrt(h)/2*(v*y-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})(wz);Object.defineProperty(fh,"__esModule",{value:!0});fh.Path=void 0;const Y1e=Et,Z1e=jr,J1e=At,xd=wz;class Dr extends Z1e.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Dr.parsePathData(this.data()),this.pathLength=Dr.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=Dr.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=Dr.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=Dr.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 Dr.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 Dr.getPointOnLine(t,s.start.x,s.start.y,a[0],a[1]);case"C":return Dr.getPointOnCubicBezier((0,xd.t2length)(t,Dr.getPathLength(n),m=>(0,xd.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 Dr.getPointOnQuadraticBezier((0,xd.t2length)(t,Dr.getPathLength(n),m=>(0,xd.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,Dr.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 v=null,g=[],y=l,S=u,w,x,C,A,T,P,L,R,E,k;switch(h){case"l":l+=p.shift(),u+=p.shift(),v="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(),$=p.shift();if(l+=D,u+=$,v="M",s.length>2&&s[s.length-1].command==="z"){for(var O=s.length-2;O>=0;O--)if(s[O].command==="M"){l=s[O].points[0]+D,u=s[O].points[1]+$;break}}g.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),v="M",g.push(l,u),h="L";break;case"h":l+=p.shift(),v="L",g.push(l,u);break;case"H":l=p.shift(),v="L",g.push(l,u);break;case"v":u+=p.shift(),v="L",g.push(l,u);break;case"V":u=p.shift(),v="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(),v="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(),v="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(),v="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(),v="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(),v="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(),v="Q",g.push(x,C,l,u);break;case"A":A=p.shift(),T=p.shift(),P=p.shift(),L=p.shift(),R=p.shift(),E=l,k=u,l=p.shift(),u=p.shift(),v="A",g=this.convertEndpointToCenterParameterization(E,k,l,u,L,R,A,T,P);break;case"a":A=p.shift(),T=p.shift(),P=p.shift(),L=p.shift(),R=p.shift(),E=l,k=u,l+=p.shift(),u+=p.shift(),v="A",g=this.convertEndpointToCenterParameterization(E,k,l,u,L,R,A,T,P);break}s.push({command:v||h,points:g,start:{x:y,y:S},pathLength:this.calcLength(y,S,v||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=Dr;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,xd.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,xd.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,v=(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])},y=function(T,P){return(T[0]*P[0]+T[1]*P[1])/(g(T)*g(P))},S=function(T,P){return(T[0]*P[1]<T[1]*P[0]?-1:1)*Math.acos(y(T,P))},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 y(x,C)<=-1&&(A=Math.PI),y(x,C)>=1&&(A=0),s===0&&A>0&&(A=A-2*Math.PI),s===1&&A<0&&(A=A+2*Math.PI),[_,v,a,l,w,A,c,s]}}fh.Path=Dr;Dr.prototype.className="Path";Dr.prototype._attrsAffectingSize=["data"];(0,J1e._registerNode)(Dr);Y1e.Factory.addGetterSetter(Dr,"data");Object.defineProperty(Yb,"__esModule",{value:!0});Yb.Arrow=void 0;const Jb=Et,e_e=Um,xz=Ke,t_e=At,lR=fh;class Jc extends e_e.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=lR.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=lR.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}}}Yb.Arrow=Jc;Jc.prototype.className="Arrow";(0,t_e._registerNode)(Jc);Jb.Factory.addGetterSetter(Jc,"pointerLength",10,(0,xz.getNumberValidator)());Jb.Factory.addGetterSetter(Jc,"pointerWidth",10,(0,xz.getNumberValidator)());Jb.Factory.addGetterSetter(Jc,"pointerAtBeginning",!1);Jb.Factory.addGetterSetter(Jc,"pointerAtEnding",!0);var eS={};Object.defineProperty(eS,"__esModule",{value:!0});eS.Circle=void 0;const n_e=Et,r_e=jr,i_e=Ke,o_e=At;let hh=class extends r_e.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)}};eS.Circle=hh;hh.prototype._centroid=!0;hh.prototype.className="Circle";hh.prototype._attrsAffectingSize=["radius"];(0,o_e._registerNode)(hh);n_e.Factory.addGetterSetter(hh,"radius",0,(0,i_e.getNumberValidator)());var tS={};Object.defineProperty(tS,"__esModule",{value:!0});tS.Ellipse=void 0;const O5=Et,s_e=jr,Cz=Ke,a_e=At;class Ou extends s_e.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)}}tS.Ellipse=Ou;Ou.prototype.className="Ellipse";Ou.prototype._centroid=!0;Ou.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,a_e._registerNode)(Ou);O5.Factory.addComponentsGetterSetter(Ou,"radius",["x","y"]);O5.Factory.addGetterSetter(Ou,"radiusX",0,(0,Cz.getNumberValidator)());O5.Factory.addGetterSetter(Ou,"radiusY",0,(0,Cz.getNumberValidator)());var nS={};Object.defineProperty(nS,"__esModule",{value:!0});nS.Image=void 0;const Iw=ir,ed=Et,l_e=jr,u_e=At,Vm=Ke;let Ea=class Ez extends l_e.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?Iw.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?Iw.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=Iw.Util.createImageElement();i.onload=function(){var o=new Ez({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};nS.Image=Ea;Ea.prototype.className="Image";(0,u_e._registerNode)(Ea);ed.Factory.addGetterSetter(Ea,"cornerRadius",0,(0,Vm.getNumberOrArrayOfNumbersValidator)(4));ed.Factory.addGetterSetter(Ea,"image");ed.Factory.addComponentsGetterSetter(Ea,"crop",["x","y","width","height"]);ed.Factory.addGetterSetter(Ea,"cropX",0,(0,Vm.getNumberValidator)());ed.Factory.addGetterSetter(Ea,"cropY",0,(0,Vm.getNumberValidator)());ed.Factory.addGetterSetter(Ea,"cropWidth",0,(0,Vm.getNumberValidator)());ed.Factory.addGetterSetter(Ea,"cropHeight",0,(0,Vm.getNumberValidator)());var Hf={};Object.defineProperty(Hf,"__esModule",{value:!0});Hf.Tag=Hf.Label=void 0;const rS=Et,c_e=jr,d_e=ch,M5=Ke,Tz=At;var Az=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],f_e="Change.konva",h_e="none",u3="up",c3="right",d3="down",f3="left",p_e=Az.length;class N5 extends d_e.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<p_e;r++)t.on(Az[r]+f_e,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 u3:a=r/2,l=-1*u;break;case c3:a=r+s,l=i/2;break;case d3:a=r/2,l=i+u;break;case f3: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})}}}Hf.Label=N5;N5.prototype.className="Label";(0,Tz._registerNode)(N5);class td extends c_e.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===u3&&(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===c3&&(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===d3&&(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===f3&&(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===u3?(n-=i,a+=i):o===d3?a+=i:o===f3?(t-=r*1.5,s+=r):o===c3&&(s+=r*1.5),{x:t,y:n,width:s,height:a}}}Hf.Tag=td;td.prototype.className="Tag";(0,Tz._registerNode)(td);rS.Factory.addGetterSetter(td,"pointerDirection",h_e);rS.Factory.addGetterSetter(td,"pointerWidth",0,(0,M5.getNumberValidator)());rS.Factory.addGetterSetter(td,"pointerHeight",0,(0,M5.getNumberValidator)());rS.Factory.addGetterSetter(td,"cornerRadius",0,(0,M5.getNumberOrArrayOfNumbersValidator)(4));var Gm={};Object.defineProperty(Gm,"__esModule",{value:!0});Gm.Rect=void 0;const g_e=Et,m_e=jr,y_e=At,v_e=ir,__e=Ke;let iS=class extends m_e.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?v_e.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};Gm.Rect=iS;iS.prototype.className="Rect";(0,y_e._registerNode)(iS);g_e.Factory.addGetterSetter(iS,"cornerRadius",0,(0,__e.getNumberOrArrayOfNumbersValidator)(4));var oS={};Object.defineProperty(oS,"__esModule",{value:!0});oS.RegularPolygon=void 0;const kz=Et,b_e=jr,Pz=Ke,S_e=At;class nd extends b_e.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)}}oS.RegularPolygon=nd;nd.prototype.className="RegularPolygon";nd.prototype._centroid=!0;nd.prototype._attrsAffectingSize=["radius"];(0,S_e._registerNode)(nd);kz.Factory.addGetterSetter(nd,"radius",0,(0,Pz.getNumberValidator)());kz.Factory.addGetterSetter(nd,"sides",0,(0,Pz.getNumberValidator)());var sS={};Object.defineProperty(sS,"__esModule",{value:!0});sS.Ring=void 0;const Rz=Et,w_e=jr,Iz=Ke,x_e=At;var uR=Math.PI*2;class rd extends w_e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,uR,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),uR,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)}}sS.Ring=rd;rd.prototype.className="Ring";rd.prototype._centroid=!0;rd.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,x_e._registerNode)(rd);Rz.Factory.addGetterSetter(rd,"innerRadius",0,(0,Iz.getNumberValidator)());Rz.Factory.addGetterSetter(rd,"outerRadius",0,(0,Iz.getNumberValidator)());var aS={};Object.defineProperty(aS,"__esModule",{value:!0});aS.Sprite=void 0;const id=Et,C_e=jr,E_e=dh,Oz=Ke,T_e=At;class Ta extends C_e.Shape{constructor(t){super(t),this._updated=!0,this.anim=new E_e.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)}}aS.Sprite=Ta;Ta.prototype.className="Sprite";(0,T_e._registerNode)(Ta);id.Factory.addGetterSetter(Ta,"animation");id.Factory.addGetterSetter(Ta,"animations");id.Factory.addGetterSetter(Ta,"frameOffsets");id.Factory.addGetterSetter(Ta,"image");id.Factory.addGetterSetter(Ta,"frameIndex",0,(0,Oz.getNumberValidator)());id.Factory.addGetterSetter(Ta,"frameRate",17,(0,Oz.getNumberValidator)());id.Factory.backCompat(Ta,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var lS={};Object.defineProperty(lS,"__esModule",{value:!0});lS.Star=void 0;const D5=Et,A_e=jr,L5=Ke,k_e=At;class Mu extends A_e.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)}}lS.Star=Mu;Mu.prototype.className="Star";Mu.prototype._centroid=!0;Mu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,k_e._registerNode)(Mu);D5.Factory.addGetterSetter(Mu,"numPoints",5,(0,L5.getNumberValidator)());D5.Factory.addGetterSetter(Mu,"innerRadius",0,(0,L5.getNumberValidator)());D5.Factory.addGetterSetter(Mu,"outerRadius",0,(0,L5.getNumberValidator)());var Fc={};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Text=Fc.stringToArray=void 0;const h3=ir,Yi=Et,P_e=jr,Nu=Ke,R_e=At;function Mz(e){return Array.from(e)}Fc.stringToArray=Mz;var Cd="auto",I_e="center",jh="justify",O_e="Change.konva",M_e="2d",cR="-",Nz="left",N_e="text",D_e="Text",L_e="top",$_e="bottom",dR="middle",Dz="normal",F_e="px ",Zy=" ",B_e="right",z_e="word",j_e="char",fR="none",Ow="…",Lz=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],U_e=Lz.length;function V_e(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 Jy;function Mw(){return Jy||(Jy=h3.Util.createCanvasElement().getContext(M_e),Jy)}function G_e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function q_e(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function H_e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let _r=class extends P_e.Shape{constructor(t){super(H_e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<U_e;n++)this.on(Lz[n]+O_e,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,v=0,g=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",dR),t.setAttr("textAlign",Nz),a===dR?l=(this.getHeight()-r*s-i*2)/2:a===$_e&&(l=this.getHeight()-r*s-i*2),t.translate(i,l+i),b=0;b<r;b++){var v=0,g=0,y=n[b],S=y.text,w=y.width,x=y.lastInParagraph,C,A,T;if(t.save(),u===B_e?v+=c-w-i*2:u===I_e&&(v+=(c-w-i*2)/2),p){t.save(),t.beginPath(),t.moveTo(v,_+g+Math.round(o/2)),C=S.split(" ").length-1,A=C===0,T=u===jh&&!x?c-i*2:w,t.lineTo(v+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(v,_+g),C=S.split(" ").length-1,A=C===0,T=u===jh&&x&&!A?c-i*2:w,t.lineTo(v+Math.round(T),_+g),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(d!==0||u===jh){C=S.split(" ").length-1;for(var P=Mz(S),L=0;L<P.length;L++){var R=P[L];R===" "&&!x&&u===jh&&(v+=(c-i*2-w)/C),this._partialTextX=v,this._partialTextY=_+g,this._partialText=R,t.fillStrokeShape(this),v+=this.measureSize(R).width+d}}else this._partialTextX=v,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=h3.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(N_e,n),this}getWidth(){var t=this.attrs.width===Cd||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Cd||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 h3.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=Mw(),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()+Zy+this.fontVariant()+Zy+(this.fontSize()+F_e)+V_e(this.fontFamily())}_addTextLine(t){this.align()===jh&&(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 Mw().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!==Cd&&o!==void 0,l=s!==Cd&&s!==void 0,u=this.padding(),c=o-u*2,d=s-u*2,f=0,h=this.wrap(),p=h!==fR,m=h!==j_e&&p,b=this.ellipsis();this.textArr=[],Mw().font=this._getContextFont();for(var _=b?this._getTextWidth(Ow):0,v=0,g=t.length;v<g;++v){var y=t[v],S=this._getTextWidth(y);if(a&&S>c)for(;y.length>0;){for(var w=0,x=y.length,C="",A=0;w<x;){var T=w+x>>>1,P=y.slice(0,T+1),L=this._getTextWidth(P)+_;L<=c?(w=T+1,C=P,A=L):x=T}if(C){if(m){var R,E=y[C.length],k=E===Zy||E===cR;k&&A<=c?R=C.length:R=Math.max(C.lastIndexOf(Zy),C.lastIndexOf(cR))+1,R>0&&(w=R,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(y=y.slice(w),y=y.trimLeft(),y.length>0&&(S=this._getTextWidth(y),S<=c)){this._addTextLine(y),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(y),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&v<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!==Cd&&i!==void 0,s=this.padding(),a=i-s*2,l=this.wrap(),u=l!==fR;return!u||o&&t+r>a}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Cd&&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+Ow)<i;a||(s.text=s.text.slice(0,s.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(s.text+Ow)}}getStrokeScaleEnabled(){return!0}};Fc.Text=_r;_r.prototype._fillFunc=G_e;_r.prototype._strokeFunc=q_e;_r.prototype.className=D_e;_r.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,R_e._registerNode)(_r);Yi.Factory.overWriteSetter(_r,"width",(0,Nu.getNumberOrAutoValidator)());Yi.Factory.overWriteSetter(_r,"height",(0,Nu.getNumberOrAutoValidator)());Yi.Factory.addGetterSetter(_r,"fontFamily","Arial");Yi.Factory.addGetterSetter(_r,"fontSize",12,(0,Nu.getNumberValidator)());Yi.Factory.addGetterSetter(_r,"fontStyle",Dz);Yi.Factory.addGetterSetter(_r,"fontVariant",Dz);Yi.Factory.addGetterSetter(_r,"padding",0,(0,Nu.getNumberValidator)());Yi.Factory.addGetterSetter(_r,"align",Nz);Yi.Factory.addGetterSetter(_r,"verticalAlign",L_e);Yi.Factory.addGetterSetter(_r,"lineHeight",1,(0,Nu.getNumberValidator)());Yi.Factory.addGetterSetter(_r,"wrap",z_e);Yi.Factory.addGetterSetter(_r,"ellipsis",!1,(0,Nu.getBooleanValidator)());Yi.Factory.addGetterSetter(_r,"letterSpacing",0,(0,Nu.getNumberValidator)());Yi.Factory.addGetterSetter(_r,"text","",(0,Nu.getStringValidator)());Yi.Factory.addGetterSetter(_r,"textDecoration","");var uS={};Object.defineProperty(uS,"__esModule",{value:!0});uS.TextPath=void 0;const Nw=ir,js=Et,W_e=jr,Uh=fh,Dw=Fc,$z=Ke,K_e=At;var Q_e="",Fz="normal";function Bz(e){e.fillText(this.partialText,0,0)}function zz(e){e.strokeText(this.partialText,0,0)}class Ur extends W_e.Shape{constructor(t){super(t),this.dummyCanvas=Nw.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 Uh.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:Uh.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Uh.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 Nw.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 Dw.Text.prototype.setText.call(this,t)}_getContextFont(){return Dw.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,Dw.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 v=this.text().split(" ").length-1;f+=(this.pathLength-s)/v}const h=this._getPointAtLength(u+f);if(!h)return;const p=Uh.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=Uh.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 Nw.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}uS.TextPath=Ur;Ur.prototype._fillFunc=Bz;Ur.prototype._strokeFunc=zz;Ur.prototype._fillFuncHit=Bz;Ur.prototype._strokeFuncHit=zz;Ur.prototype.className="TextPath";Ur.prototype._attrsAffectingSize=["text","fontSize","data"];(0,K_e._registerNode)(Ur);js.Factory.addGetterSetter(Ur,"data");js.Factory.addGetterSetter(Ur,"fontFamily","Arial");js.Factory.addGetterSetter(Ur,"fontSize",12,(0,$z.getNumberValidator)());js.Factory.addGetterSetter(Ur,"fontStyle",Fz);js.Factory.addGetterSetter(Ur,"align","left");js.Factory.addGetterSetter(Ur,"letterSpacing",0,(0,$z.getNumberValidator)());js.Factory.addGetterSetter(Ur,"textBaseline","middle");js.Factory.addGetterSetter(Ur,"fontVariant",Fz);js.Factory.addGetterSetter(Ur,"text",Q_e);js.Factory.addGetterSetter(Ur,"textDecoration",null);js.Factory.addGetterSetter(Ur,"kerningFunc",null);var cS={};Object.defineProperty(cS,"__esModule",{value:!0});cS.Transformer=void 0;const yn=ir,fn=Et,hR=Qn,X_e=jr,Y_e=Gm,pR=ch,ms=At,Du=Ke,Z_e=At;var jz="tr-konva",J_e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${jz}`).join(" "),gR="nodesRect",ebe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],tbe={"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 nbe="ontouchstart"in ms.Konva._global;function rbe(e,t){if(e==="rotater")return"crosshair";t+=yn.Util.degToRad(tbe[e]||0);var n=(yn.Util.radToDeg(t)%360+360)%360;return yn.Util._inRange(n,315+22.5,360)||yn.Util._inRange(n,0,22.5)?"ns-resize":yn.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":yn.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":yn.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":yn.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":yn.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":yn.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":yn.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(yn.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var A1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],mR=1e8;function ibe(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 Uz(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 obe(e,t){const n=ibe(e);return Uz(e,t,n)}function sbe(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 Kt extends pR.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(J_e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return yn.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 jz+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(yn.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(ebe.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(gR),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(gR,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 Uz(c,-ms.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-mR,y:-mR,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 yn.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(),A1.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Y_e.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:nbe?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=rbe(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 X_e.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()*yn.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 R=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(R-=Math.PI);var f=ms.Konva.getAngle(this.rotation());const E=f+R,k=ms.Konva.getAngle(this.rotationSnapTolerance()),$=sbe(this.rotationSnaps(),E,k)-d.rotation,O=obe(d,$);this._fitNodesInto(O,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 v=o.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.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)}v=o.position(),this.findOne(".top-left").x(v.x),this.findOne(".bottom-right").y(v.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 y=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=y.x(),x=y.y(),C=this.getWidth()-S.x(),A=this.getHeight()-S.y();S.move({x:-w,y:-x}),y.move({x:C,y:A})}var T=this.findOne(".top-left").getAbsolutePosition();n=T.x,r=T.y;var P=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:P,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(yn.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(yn.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var s=new yn.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:yn.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,l=new yn.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/a,r.height/a);const u=new yn.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 yn.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(yn.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(yn.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()*yn.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=""),pR.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return hR.Node.prototype.toObject.call(this)}clone(t){var n=hR.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}cS.Transformer=Kt;function abe(e){return e instanceof Array||yn.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){A1.indexOf(t)===-1&&yn.Util.warn("Unknown anchor name: "+t+". Available names are: "+A1.join(", "))}),e||[]}Kt.prototype.className="Transformer";(0,Z_e._registerNode)(Kt);fn.Factory.addGetterSetter(Kt,"enabledAnchors",A1,abe);fn.Factory.addGetterSetter(Kt,"flipEnabled",!0,(0,Du.getBooleanValidator)());fn.Factory.addGetterSetter(Kt,"resizeEnabled",!0);fn.Factory.addGetterSetter(Kt,"anchorSize",10,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"rotateEnabled",!0);fn.Factory.addGetterSetter(Kt,"rotationSnaps",[]);fn.Factory.addGetterSetter(Kt,"rotateAnchorOffset",50,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"rotationSnapTolerance",5,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"borderEnabled",!0);fn.Factory.addGetterSetter(Kt,"anchorStroke","rgb(0, 161, 255)");fn.Factory.addGetterSetter(Kt,"anchorStrokeWidth",1,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"anchorFill","white");fn.Factory.addGetterSetter(Kt,"anchorCornerRadius",0,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"borderStroke","rgb(0, 161, 255)");fn.Factory.addGetterSetter(Kt,"borderStrokeWidth",1,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"borderDash");fn.Factory.addGetterSetter(Kt,"keepRatio",!0);fn.Factory.addGetterSetter(Kt,"shiftBehavior","default");fn.Factory.addGetterSetter(Kt,"centeredScaling",!1);fn.Factory.addGetterSetter(Kt,"ignoreStroke",!1);fn.Factory.addGetterSetter(Kt,"padding",0,(0,Du.getNumberValidator)());fn.Factory.addGetterSetter(Kt,"node");fn.Factory.addGetterSetter(Kt,"nodes");fn.Factory.addGetterSetter(Kt,"boundBoxFunc");fn.Factory.addGetterSetter(Kt,"anchorDragBoundFunc");fn.Factory.addGetterSetter(Kt,"anchorStyleFunc");fn.Factory.addGetterSetter(Kt,"shouldOverdrawWholeArea",!1);fn.Factory.addGetterSetter(Kt,"useSingleNodeRotation",!0);fn.Factory.backCompat(Kt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var dS={};Object.defineProperty(dS,"__esModule",{value:!0});dS.Wedge=void 0;const fS=Et,lbe=jr,ube=At,Vz=Ke,cbe=At;class yl extends lbe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,ube.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)}}dS.Wedge=yl;yl.prototype.className="Wedge";yl.prototype._centroid=!0;yl.prototype._attrsAffectingSize=["radius"];(0,cbe._registerNode)(yl);fS.Factory.addGetterSetter(yl,"radius",0,(0,Vz.getNumberValidator)());fS.Factory.addGetterSetter(yl,"angle",0,(0,Vz.getNumberValidator)());fS.Factory.addGetterSetter(yl,"clockwise",!1);fS.Factory.backCompat(yl,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var hS={};Object.defineProperty(hS,"__esModule",{value:!0});hS.Blur=void 0;const yR=Et,dbe=Qn,fbe=Ke;function vR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var hbe=[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],pbe=[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 gbe(e,t){var n=e.data,r=e.width,i=e.height,o,s,a,l,u,c,d,f,h,p,m,b,_,v,g,y,S,w,x,C,A,T,P,L,R=t+t+1,E=r-1,k=i-1,D=t+1,$=D*(D+1)/2,O=new vR,I=null,N=O,B=null,U=null,G=hbe[t],Q=pbe[t];for(a=1;a<R;a++)N=N.next=new vR,a===D&&(I=N);for(N.next=O,d=c=0,s=0;s<i;s++){for(y=S=w=x=f=h=p=m=0,b=D*(C=n[c]),_=D*(A=n[c+1]),v=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=$*C,h+=$*A,p+=$*T,m+=$*P,N=O,a=0;a<D;a++)N.r=C,N.g=A,N.b=T,N.a=P,N=N.next;for(a=1;a<D;a++)l=c+((E<a?E:a)<<2),f+=(N.r=C=n[l])*(L=D-a),h+=(N.g=A=n[l+1])*L,p+=(N.b=T=n[l+2])*L,m+=(N.a=P=n[l+3])*L,y+=C,S+=A,w+=T,x+=P,N=N.next;for(B=O,U=I,o=0;o<r;o++)n[c+3]=P=m*G>>Q,P!==0?(P=255/P,n[c]=(f*G>>Q)*P,n[c+1]=(h*G>>Q)*P,n[c+2]=(p*G>>Q)*P):n[c]=n[c+1]=n[c+2]=0,f-=b,h-=_,p-=v,m-=g,b-=B.r,_-=B.g,v-=B.b,g-=B.a,l=d+((l=o+t+1)<E?l:E)<<2,y+=B.r=n[l],S+=B.g=n[l+1],w+=B.b=n[l+2],x+=B.a=n[l+3],f+=y,h+=S,p+=w,m+=x,B=B.next,b+=C=U.r,_+=A=U.g,v+=T=U.b,g+=P=U.a,y-=C,S-=A,w-=T,x-=P,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=x=y=h=p=m=f=0,c=o<<2,b=D*(C=n[c]),_=D*(A=n[c+1]),v=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=$*C,h+=$*A,p+=$*T,m+=$*P,N=O,a=0;a<D;a++)N.r=C,N.g=A,N.b=T,N.a=P,N=N.next;for(u=r,a=1;a<=t;a++)c=u+o<<2,f+=(N.r=C=n[c])*(L=D-a),h+=(N.g=A=n[c+1])*L,p+=(N.b=T=n[c+2])*L,m+=(N.a=P=n[c+3])*L,y+=C,S+=A,w+=T,x+=P,N=N.next,a<k&&(u+=r);for(c=o,B=O,U=I,s=0;s<i;s++)l=c<<2,n[l+3]=P=m*G>>Q,P>0?(P=255/P,n[l]=(f*G>>Q)*P,n[l+1]=(h*G>>Q)*P,n[l+2]=(p*G>>Q)*P):n[l]=n[l+1]=n[l+2]=0,f-=b,h-=_,p-=v,m-=g,b-=B.r,_-=B.g,v-=B.b,g-=B.a,l=o+((l=s+D)<k?l:k)*r<<2,f+=y+=B.r=n[l],h+=S+=B.g=n[l+1],p+=w+=B.b=n[l+2],m+=x+=B.a=n[l+3],B=B.next,b+=C=U.r,_+=A=U.g,v+=T=U.b,g+=P=U.a,y-=C,S-=A,w-=T,x-=P,U=U.next,c+=r}}const mbe=function(t){var n=Math.round(this.blurRadius());n>0&&gbe(t,n)};hS.Blur=mbe;yR.Factory.addGetterSetter(dbe.Node,"blurRadius",0,(0,fbe.getNumberValidator)(),yR.Factory.afterSetFilter);var pS={};Object.defineProperty(pS,"__esModule",{value:!0});pS.Brighten=void 0;const _R=Et,ybe=Qn,vbe=Ke,_be=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};pS.Brighten=_be;_R.Factory.addGetterSetter(ybe.Node,"brightness",0,(0,vbe.getNumberValidator)(),_R.Factory.afterSetFilter);var gS={};Object.defineProperty(gS,"__esModule",{value:!0});gS.Contrast=void 0;const bR=Et,bbe=Qn,Sbe=Ke,wbe=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,s=150,a;for(a=0;a<r;a+=4)i=n[a],o=n[a+1],s=n[a+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,s=s<0?0:s>255?255:s,n[a]=i,n[a+1]=o,n[a+2]=s};gS.Contrast=wbe;bR.Factory.addGetterSetter(bbe.Node,"contrast",0,(0,Sbe.getNumberValidator)(),bR.Factory.afterSetFilter);var mS={};Object.defineProperty(mS,"__esModule",{value:!0});mS.Emboss=void 0;const bu=Et,yS=Qn,xbe=ir,Gz=Ke,Cbe=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:xbe.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 v=p+(m-1+_)*4,g=a[b]-a[v],y=a[b+1]-a[v+1],S=a[b+2]-a[v+2],w=g,x=w>0?w:-w,C=y>0?y:-y,A=S>0?S:-S;if(C>x&&(w=y),A>x&&(w=S),w*=t,i){var T=a[b]+w,P=a[b+1]+w,L=a[b+2]+w;a[b]=T>255?255:T<0?0:T,a[b+1]=P>255?255:P<0?0:P,a[b+2]=L>255?255:L<0?0:L}else{var R=n-w;R<0?R=0:R>255&&(R=255),a[b]=a[b+1]=a[b+2]=R}}while(--m)}while(--d)};mS.Emboss=Cbe;bu.Factory.addGetterSetter(yS.Node,"embossStrength",.5,(0,Gz.getNumberValidator)(),bu.Factory.afterSetFilter);bu.Factory.addGetterSetter(yS.Node,"embossWhiteLevel",.5,(0,Gz.getNumberValidator)(),bu.Factory.afterSetFilter);bu.Factory.addGetterSetter(yS.Node,"embossDirection","top-left",null,bu.Factory.afterSetFilter);bu.Factory.addGetterSetter(yS.Node,"embossBlend",!1,null,bu.Factory.afterSetFilter);var vS={};Object.defineProperty(vS,"__esModule",{value:!0});vS.Enhance=void 0;const SR=Et,Ebe=Qn,Tbe=Ke;function Lw(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 Abe=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,_,v,g,y,S,w;for(h>0?(m=i+h*(255-i),b=r-h*(r-0),v=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,v=a+h*(a-_),g=s+h*(s-_),y=(c+u)*.5,S=c+h*(c-y),w=u+h*(u-y)),f=0;f<n;f+=4)t[f+0]=Lw(t[f+0],r,i,b,m),t[f+1]=Lw(t[f+1],s,a,g,v),t[f+2]=Lw(t[f+2],u,c,w,S)}};vS.Enhance=Abe;SR.Factory.addGetterSetter(Ebe.Node,"enhance",0,(0,Tbe.getNumberValidator)(),SR.Factory.afterSetFilter);var _S={};Object.defineProperty(_S,"__esModule",{value:!0});_S.Grayscale=void 0;const kbe=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};_S.Grayscale=kbe;var bS={};Object.defineProperty(bS,"__esModule",{value:!0});bS.HSL=void 0;const Wf=Et,$5=Qn,F5=Ke;Wf.Factory.addGetterSetter($5.Node,"hue",0,(0,F5.getNumberValidator)(),Wf.Factory.afterSetFilter);Wf.Factory.addGetterSetter($5.Node,"saturation",0,(0,F5.getNumberValidator)(),Wf.Factory.afterSetFilter);Wf.Factory.addGetterSetter($5.Node,"luminance",0,(0,F5.getNumberValidator)(),Wf.Factory.afterSetFilter);const Pbe=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,v=.114*r+.886*l-.2*u,g,y,S,w;for(a=0;a<n;a+=4)g=t[a+0],y=t[a+1],S=t[a+2],w=t[a+3],t[a+0]=c*g+d*y+f*S+s,t[a+1]=h*g+p*y+m*S+s,t[a+2]=b*g+_*y+v*S+s,t[a+3]=w};bS.HSL=Pbe;var SS={};Object.defineProperty(SS,"__esModule",{value:!0});SS.HSV=void 0;const Kf=Et,B5=Qn,z5=Ke,Rbe=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,v,g,y,S;for(s=0;s<n;s+=4)v=t[s+0],g=t[s+1],y=t[s+2],S=t[s+3],t[s+0]=u*v+c*g+d*y,t[s+1]=f*v+h*g+p*y,t[s+2]=m*v+b*g+_*y,t[s+3]=S};SS.HSV=Rbe;Kf.Factory.addGetterSetter(B5.Node,"hue",0,(0,z5.getNumberValidator)(),Kf.Factory.afterSetFilter);Kf.Factory.addGetterSetter(B5.Node,"saturation",0,(0,z5.getNumberValidator)(),Kf.Factory.afterSetFilter);Kf.Factory.addGetterSetter(B5.Node,"value",0,(0,z5.getNumberValidator)(),Kf.Factory.afterSetFilter);var wS={};Object.defineProperty(wS,"__esModule",{value:!0});wS.Invert=void 0;const Ibe=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]};wS.Invert=Ibe;var xS={};Object.defineProperty(xS,"__esModule",{value:!0});xS.Kaleidoscope=void 0;const k1=Et,qz=Qn,wR=ir,Hz=Ke;var Obe=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 v=s,g=o,y,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),y=0;y<v;y+=1)c=Math.floor(a+_*y/v*C),d=Math.floor(l+_*y/v*x),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],m=r[u+3],u=(S+y*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=m},Mbe=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,v,g=Math.sqrt(a*a+l*l);c=o-a,d=s-l,v=Math.sqrt(c*c+d*d),g=v>g?v:g;var y=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)*y/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 Nbe=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=wR.Util.createCanvasElement();b.width=t,b.height=n;var _=b.getContext("2d").getImageData(0,0,t,n);wR.Util.releaseCanvas(b),Obe(e,_,{polarCenterX:t/2,polarCenterY:n/2});for(var v=t/Math.pow(2,h);v<=8;)v=v*2,h-=1;v=Math.ceil(v);var g=v,y=0,S=g,w=1;for(m+v>t&&(y=g,S=0,w=-1),i=0;i<n;i+=1)for(r=y;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(v),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}Mbe(_,e,{polarRotation:0})}};xS.Kaleidoscope=Nbe;k1.Factory.addGetterSetter(qz.Node,"kaleidoscopePower",2,(0,Hz.getNumberValidator)(),k1.Factory.afterSetFilter);k1.Factory.addGetterSetter(qz.Node,"kaleidoscopeAngle",0,(0,Hz.getNumberValidator)(),k1.Factory.afterSetFilter);var CS={};Object.defineProperty(CS,"__esModule",{value:!0});CS.Mask=void 0;const xR=Et,Dbe=Qn,Lbe=Ke;function e0(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 $be(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 Fbe(e,t){var n=e0(e,0,0),r=e0(e,e.width-1,0),i=e0(e,0,e.height-1),o=e0(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=$be([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 Bbe(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function zbe(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 jbe(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 Ube(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 Vbe=function(e){var t=this.threshold(),n=Fbe(e,t);return n&&(n=zbe(n,e.width,e.height),n=jbe(n,e.width,e.height),n=Ube(n,e.width,e.height),Bbe(e,n)),e};CS.Mask=Vbe;xR.Factory.addGetterSetter(Dbe.Node,"threshold",0,(0,Lbe.getNumberValidator)(),xR.Factory.afterSetFilter);var ES={};Object.defineProperty(ES,"__esModule",{value:!0});ES.Noise=void 0;const CR=Et,Gbe=Qn,qbe=Ke,Hbe=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()};ES.Noise=Hbe;CR.Factory.addGetterSetter(Gbe.Node,"noise",.2,(0,qbe.getNumberValidator)(),CR.Factory.afterSetFilter);var TS={};Object.defineProperty(TS,"__esModule",{value:!0});TS.Pixelate=void 0;const ER=Et,Wbe=ir,Kbe=Qn,Qbe=Ke,Xbe=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,_,v,g,y=e.data;if(t<=0){Wbe.Util.error("pixelSize value can not be <= 0");return}for(_=0;_<d;_+=1)for(v=0;v<f;v+=1){for(a=0,l=0,u=0,c=0,h=_*t,p=h+t,m=v*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+=y[s+0],l+=y[s+1],u+=y[s+2],c+=y[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,y[s+0]=a,y[s+1]=l,y[s+2]=u,y[s+3]=c)}};TS.Pixelate=Xbe;ER.Factory.addGetterSetter(Kbe.Node,"pixelSize",8,(0,Qbe.getNumberValidator)(),ER.Factory.afterSetFilter);var AS={};Object.defineProperty(AS,"__esModule",{value:!0});AS.Posterize=void 0;const TR=Et,Ybe=Qn,Zbe=Ke,Jbe=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};AS.Posterize=Jbe;TR.Factory.addGetterSetter(Ybe.Node,"levels",.5,(0,Zbe.getNumberValidator)(),TR.Factory.afterSetFilter);var kS={};Object.defineProperty(kS,"__esModule",{value:!0});kS.RGB=void 0;const P1=Et,j5=Qn,eSe=Ke,tSe=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]};kS.RGB=tSe;P1.Factory.addGetterSetter(j5.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});P1.Factory.addGetterSetter(j5.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});P1.Factory.addGetterSetter(j5.Node,"blue",0,eSe.RGBComponent,P1.Factory.afterSetFilter);var PS={};Object.defineProperty(PS,"__esModule",{value:!0});PS.RGBA=void 0;const Ug=Et,RS=Qn,nSe=Ke,rSe=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};PS.RGBA=rSe;Ug.Factory.addGetterSetter(RS.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Ug.Factory.addGetterSetter(RS.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Ug.Factory.addGetterSetter(RS.Node,"blue",0,nSe.RGBComponent,Ug.Factory.afterSetFilter);Ug.Factory.addGetterSetter(RS.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var IS={};Object.defineProperty(IS,"__esModule",{value:!0});IS.Sepia=void 0;const iSe=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)};IS.Sepia=iSe;var OS={};Object.defineProperty(OS,"__esModule",{value:!0});OS.Solarize=void 0;const oSe=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)};OS.Solarize=oSe;var MS={};Object.defineProperty(MS,"__esModule",{value:!0});MS.Threshold=void 0;const AR=Et,sSe=Qn,aSe=Ke,lSe=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};MS.Threshold=lSe;AR.Factory.addGetterSetter(sSe.Node,"threshold",.5,(0,aSe.getNumberValidator)(),AR.Factory.afterSetFilter);Object.defineProperty(Ub,"__esModule",{value:!0});Ub.Konva=void 0;const kR=fz,uSe=Kb,cSe=Yb,dSe=eS,fSe=tS,hSe=nS,PR=Hf,pSe=Um,gSe=fh,mSe=Gm,ySe=oS,vSe=sS,_Se=aS,bSe=lS,SSe=Fc,wSe=uS,xSe=cS,CSe=dS,ESe=hS,TSe=pS,ASe=gS,kSe=mS,PSe=vS,RSe=_S,ISe=bS,OSe=SS,MSe=wS,NSe=xS,DSe=CS,LSe=ES,$Se=TS,FSe=AS,BSe=kS,zSe=PS,jSe=IS,USe=OS,VSe=MS;Ub.Konva=kR.Konva.Util._assign(kR.Konva,{Arc:uSe.Arc,Arrow:cSe.Arrow,Circle:dSe.Circle,Ellipse:fSe.Ellipse,Image:hSe.Image,Label:PR.Label,Tag:PR.Tag,Line:pSe.Line,Path:gSe.Path,Rect:mSe.Rect,RegularPolygon:ySe.RegularPolygon,Ring:vSe.Ring,Sprite:_Se.Sprite,Star:bSe.Star,Text:SSe.Text,TextPath:wSe.TextPath,Transformer:xSe.Transformer,Wedge:CSe.Wedge,Filters:{Blur:ESe.Blur,Brighten:TSe.Brighten,Contrast:ASe.Contrast,Emboss:kSe.Emboss,Enhance:PSe.Enhance,Grayscale:RSe.Grayscale,HSL:ISe.HSL,HSV:OSe.HSV,Invert:MSe.Invert,Kaleidoscope:NSe.Kaleidoscope,Mask:DSe.Mask,Noise:LSe.Noise,Pixelate:$Se.Pixelate,Posterize:FSe.Posterize,RGB:BSe.RGB,RGBA:zSe.RGBA,Sepia:jSe.Sepia,Solarize:USe.Solarize,Threshold:VSe.Threshold}});var GSe=A5.exports;Object.defineProperty(GSe,"__esModule",{value:!0});const qSe=Ub;A5.exports=qSe.Konva;var HSe=A5.exports;const Gh=jc(HSe),WSe=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},KSe=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}),RR=async(e,t)=>{const n=e.toDataURL(t);return await KSe(n,t.width,t.height)},U5=async(e,t,n,r,i)=>{const o=pe("canvas"),s=zb(),a=Uve();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 E1(u,d),h=await RR(u,d),p=await WSe(r?e.objects.filter(RD):[],l,i),m=await E1(p,l),b=await RR(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:b}},QSe=()=>{Ee({actionCreator:Dve,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await U5(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(Mt({title:X("toast.problemSavingMask"),description:X("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(ge.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:X("toast.maskSavedAssets")}}}))}})},XSe=()=>{Ee({actionCreator:zve,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await U5(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(Mt({title:X("toast.problemImportingMask"),description:X("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery,l=await t(ge.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:X("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:u}=l;t(Xc({controlNetId:e.payload.controlNet.controlNetId,controlImage:u}))}})},YSe=async()=>{const e=zb();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),E1(t,t.getClientRect())},ZSe=()=>{Ee({actionCreator:Fve,effect:async(e,{dispatch:t})=>{const n=lb.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await YSe();if(!r){n.error("Problem getting base layer blob"),t(Mt({title:X("toast.problemMergingCanvas"),description:X("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=zb();if(!i){n.error("Problem getting canvas base layer"),t(Mt({title:X("toast.problemMergingCanvas"),description:X("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),s=await t(ge.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:X("toast.canvasMerged")}}})).unwrap(),{image_name:a}=s;t(Ere({kind:"image",layer:"base",imageName:a,...o}))}})},JSe=()=>{Ee({actionCreator:Nve,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("canvas"),i=n(),o=await jb(i);if(!o){r.error("Problem getting base layer blob"),t(Mt({title:X("toast.problemSavingCanvas"),description:X("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(ge.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:X("toast.canvasSavedGallery")}}}))}})},e2e=(e,t,n)=>{var c;if(!(afe.match(e)||q6.match(e)||Xc.match(e)||lfe.match(e)||H6.match(e))||H6.match(e)&&((c=n.controlNet.controlNets[e.payload.controlNetId])==null?void 0:c.shouldAutoConfig)===!0)return!1;const i=t.controlNet.controlNets[e.payload.controlNetId];if(!i)return!1;const{controlImage:o,processorType:s,shouldAutoConfig:a}=i;return q6.match(e)&&!a?!1:s!=="none"&&!!o},t2e=()=>{Ee({predicate:e2e,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(r5({controlNetId:o}))}})},$e="positive_conditioning",qe="negative_conditioning",Ie="denoise_latents",He="latents_to_image",As="save_image",wc="nsfw_checker",tc="invisible_watermark",Le="noise",Lu="main_model_loader",NS="onnx_model_loader",qs="vae_loader",Wz="lora_loader",Wt="clip_skip",$n="image_to_latents",ra="resize_image",yf="img2img_resize",me="canvas_output",zn="inpaint_image",vi="inpaint_image_resize_up",Mi="inpaint_image_resize_down",Gt="inpaint_infill",Hl="inpaint_infill_resize_down",Fn="inpaint_create_mask",_t="canvas_coherence_denoise_latents",zt="canvas_coherence_noise",Su="canvas_coherence_noise_increment",lr="canvas_coherence_mask_edge",Ft="canvas_coherence_inpaint_create_mask",vf="tomask",Ri="mask_blur",mi="mask_combine",Bn="mask_resize_up",Ni="mask_resize_down",t0="control_net_collect",n2e="ip_adapter",dt="metadata_accumulator",$w="esrgan",Ii="sdxl_model_loader",Ce="sdxl_denoise_latents",Vu="sdxl_refiner_model_loader",n0="sdxl_refiner_positive_conditioning",r0="sdxl_refiner_negative_conditioning",Hs="sdxl_refiner_denoise_latents",Ba="refiner_inpaint_create_mask",Fr="seamless",Es="refiner_seamless",Kz="text_to_image_graph",p3="image_to_image_graph",Qz="canvas_text_to_image_graph",g3="canvas_image_to_image_graph",DS="canvas_inpaint_graph",LS="canvas_outpaint_graph",V5="sdxl_text_to_image_graph",R1="sxdl_image_to_image_graph",$S="sdxl_canvas_text_to_image_graph",Vg="sdxl_canvas_image_to_image_graph",Bc="sdxl_canvas_inpaint_graph",zc="sdxl_canvas_outpaint_graph",Xz=e=>(e==null?void 0:e.type)==="image_output",r2e=()=>{Ee({actionCreator:r5,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}},[As]:{id:As,type:"save_image",is_intermediate:!0,use_cache:!1}},edges:[{source:{node_id:s.processorNode.id,field:"image"},destination:{node_id:As,field:"image"}}]};try{const l=t(bi.endpoints.enqueueGraph.initiate({graph:a,prepend:!0},{fixedCacheKey:"enqueueGraph"})),u=await l.unwrap();l.reset(),i.debug({enqueueResult:$t(u)},X("queue.graphQueued"));const[c]=await r(d=>JT.match(d)&&d.payload.data.graph_execution_state_id===u.queue_item.session_id&&d.payload.data.source_node_id===As);if(Xz(c.payload.data.result)){const{image_name:d}=c.payload.data.result.image,[{payload:f}]=await r(p=>ge.endpoints.getImageDTO.matchFulfilled(p)&&p.payload.image_name===d),h=f;i.debug({controlNetId:e.payload,processedControlImage:h},"ControlNet image processed"),t(i5({controlNetId:o,processedControlImage:h.image_name}))}}catch{i.error({graph:$t(a)},X("queue.graphFailedToQueue")),t(Mt({title:X("queue.graphFailedToQueue"),status:"error"}))}}})},G5=Me("app/enqueueRequested");Me("app/batchEnqueued");const i2e=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>")})},IR=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)}),o2e=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}},s2e=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},a2e=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=o2e(e.data),i=s2e(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},l2e=e=>Cee(e,n=>n.isEnabled&&(!!n.processedControlImage||n.processorType==="none"&&!!n.controlImage)),os=(e,t,n)=>{const{isEnabled:r,controlNets:i}=e.controlNet,o=l2e(i),s=t.nodes[dt];if(r&&o.length&&o.length){const a={id:t0,type:"collect",is_intermediate:!0};t.nodes[t0]=a,t.edges.push({source:{node_id:t0,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:v}=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:v};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 y=O_(g,["id","type"]);s.controlnets.push(y)}t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:t0,field:"item"}})})}},ss=(e,t,n)=>{var o,s;const{isIPAdapterEnabled:r,ipAdapterInfo:i}=e.controlNet;if(r&&i.model){const a={id:n2e,type:"ip_adapter",is_intermediate:!0,weight:i.weight,ip_adapter_model:{base_model:(o=i.model)==null?void 0:o.base_model,model_name:(s=i.model)==null?void 0:s.model_name},begin_step_percent:i.beginStepPct,end_step_percent:i.endStepPct};if(i.adapterImage)a.image={image_name:i.adapterImage.image_name};else return;t.nodes[a.id]=a,t.edges.push({source:{node_id:a.id,field:"ip_adapter"},destination:{node_id:n,field:"ip_adapter"}})}},ph=(e,t,n,r=Lu)=>{const{loras:i}=e.lora,o=M_(i),s=t.nodes[dt];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===Wt&&["clip"].includes(u.source.field))));let a="",l=0;Mo(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${Wz}_${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:Wt,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&&[DS,LS].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:_t,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:$e,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:qe,field:"clip"}})),a=h,l+=1})},as=(e,t,n=He)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:wc,type:"img_nsfw",is_intermediate:!0};t.nodes[wc]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:wc,field:"image"}})},q5=Di(e=>e.ui,e=>JB[e.activeTab],{memoizeOptions:{equalityCheck:Sm}}),oNe=Di(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Sm}}),sNe=Di(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Sm}}),ls=(e,t)=>{const r=q5(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,i={id:As,type:"save_image",is_intermediate:r,use_cache:!1};t.nodes[As]=i,t.nodes[dt]&&t.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:As,field:"metadata"}});const s={node_id:As,field:"image"};tc in t.nodes?t.edges.push({source:{node_id:tc,field:"image"},destination:s}):wc in t.nodes?t.edges.push({source:{node_id:wc,field:"image"},destination:s}):me in t.nodes?t.edges.push({source:{node_id:me,field:"image"},destination:s}):He in t.nodes&&t.edges.push({source:{node_id:He,field:"image"},destination:s})},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=Ie;(t.id===V5||t.id===R1||t.id===$S||t.id===Vg||t.id===Bc||t.id===zc)&&(o=Ce),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==DS||t.id===LS||t.id===Bc||t.id===zc)&&t.edges.push({source:{node_id:Fr,field:"unet"},destination:{node_id:_t,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[dt];l||(t.nodes[qs]={type:"vae_loader",id:qs,is_intermediate:!0,vae_model:r});const c=n==NS;(t.id===Kz||t.id===p3||t.id===V5||t.id===R1)&&t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:He,field:"vae"}}),(t.id===Qz||t.id===g3||t.id===$S||t.id==Vg)&&t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:a?He:me,field:"vae"}}),(t.id===p3||t.id===R1||t.id===g3||t.id===Vg)&&t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:$n,field:"vae"}}),(t.id===DS||t.id===LS||t.id===Bc||t.id===zc)&&(t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:zn,field:"vae"}},{source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Fn,field:"vae"}},{source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:He,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ft,field:"vae"}})),s&&(t.id===Bc||t.id===zc)&&t.edges.push({source:{node_id:l?n:qs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ba,field:"vae"}}),r&&u&&(u.vae=r)},ds=(e,t,n=He)=>{const i=q5(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[wc],a=t.nodes[dt];if(!o)return;const l={id:tc,type:"img_watermark",is_intermediate:i};t.nodes[tc]=l,o.is_intermediate=!0,o.use_cache=!0,s?(s.is_intermediate=!0,t.edges.push({source:{node_id:wc,field:"image"},destination:{node_id:tc,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:tc,field:"image"}}),a&&t.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:tc,field:"metadata"}})},u2e=(e,t)=>{const n=pe("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,seed:l,steps:u,img2imgStrength:c,vaePrecision:d,clipSkip:f,shouldUseCpuNoise:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{width:b,height:_}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:v,boundingBoxScaleMethod:g}=e.canvas,y=d==="fp32",S=!0,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,A={id:g3,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:S,model:o},[Wt]:{type:"clip_skip",id:Wt,is_intermediate:S,skipped_layers:f},[$e]:{type:"compel",id:$e,is_intermediate:S,prompt:r},[qe]:{type:"compel",id:qe,is_intermediate:S,prompt:i},[Le]:{type:"noise",id:Le,is_intermediate:S,use_cpu:C,seed:l,width:w?v.width:b,height:w?v.height:_},[$n]:{type:"i2l",id:$n,is_intermediate:S},[Ie]:{type:"denoise_latents",id:Ie,is_intermediate:S,cfg_scale:s,scheduler:a,steps:u,denoising_start:1-c,denoising_end:1},[me]:{type:"l2i",id:me,is_intermediate:S}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}},{source:{node_id:$n,field:"latents"},destination:{node_id:Ie,field:"latents"}}]};return w?(A.nodes[yf]={id:yf,type:"img_resize",is_intermediate:S,image:t,width:v.width,height:v.height},A.nodes[He]={id:He,type:"l2i",is_intermediate:S,fp32:y},A.nodes[me]={id:me,type:"img_resize",is_intermediate:S,width:b,height:_},A.edges.push({source:{node_id:yf,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:Ie,field:"latents"},destination:{node_id:He,field:"latents"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}})):(A.nodes[me]={type:"l2i",id:me,is_intermediate:S,fp32:y},A.nodes[$n].image=t,A.edges.push({source:{node_id:Ie,field:"latents"},destination:{node_id:me,field:"latents"}})),A.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,width:w?v.width:b,height:w?v.height:_,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:C?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:f,strength:c,init_image:t.image_name},(p||m)&&(us(e,A,x),x=Fr),ph(e,A,Ie),cs(e,A,x),os(e,A,Ie),ss(e,A,Ie),e.system.shouldUseNSFWChecker&&as(e,A,me),e.system.shouldUseWatermarker&&ds(e,A,me),ls(e,A),A},c2e=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:m,canvasCoherenceMode:b,canvasCoherenceSteps:_,canvasCoherenceStrength:v,clipSkip:g,seamlessXAxis:y,seamlessYAxis:S}=e.generation;if(!s)throw r.error("No Image found in state"),new Error("No Image found in state");const{width:w,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:C,boundingBoxScaleMethod:A}=e.canvas,T=!0,P=f==="fp32",L=["auto","manual"].includes(A);let R=Lu;const E=h,k={id:DS,nodes:{[R]:{type:"main_model_loader",id:R,is_intermediate:T,model:s},[Wt]:{type:"clip_skip",id:Wt,is_intermediate:T,skipped_layers:g},[$e]:{type:"compel",id:$e,is_intermediate:T,prompt:i},[qe]:{type:"compel",id:qe,is_intermediate:T,prompt:o},[Ri]:{type:"img_blur",id:Ri,is_intermediate:T,radius:p,blur_type:m},[zn]:{type:"i2l",id:zn,is_intermediate:T,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:E,seed:d,is_intermediate:T},[Fn]:{type:"create_denoise_mask",id:Fn,is_intermediate:T,fp32:P},[Ie]:{type:"denoise_latents",id:Ie,is_intermediate:T,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-c,denoising_end:1},[zt]:{type:"noise",id:zt,use_cpu:E,seed:d+1,is_intermediate:T},[Su]:{type:"add",id:Su,b:1,is_intermediate:T},[_t]:{type:"denoise_latents",id:_t,is_intermediate:T,steps:_,cfg_scale:a,scheduler:l,denoising_start:1-v,denoising_end:1},[He]:{type:"l2i",id:He,is_intermediate:T,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:T,reference:t}},edges:[{source:{node_id:R,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:R,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Ie,field:"latents"}},{source:{node_id:Ri,field:"image"},destination:{node_id:Fn,field:"mask"}},{source:{node_id:Fn,field:"denoise_mask"},destination:{node_id:Ie,field:"denoise_mask"}},{source:{node_id:R,field:"unet"},destination:{node_id:_t,field:"unet"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:_t,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:_t,field:"negative_conditioning"}},{source:{node_id:zt,field:"noise"},destination:{node_id:_t,field:"noise"}},{source:{node_id:Ie,field:"latents"},destination:{node_id:_t,field:"latents"}},{source:{node_id:_t,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(L){const D=C.width,$=C.height;k.nodes[vi]={type:"img_resize",id:vi,is_intermediate:T,width:D,height:$,image:t},k.nodes[Bn]={type:"img_resize",id:Bn,is_intermediate:T,width:D,height:$,image:n},k.nodes[Mi]={type:"img_resize",id:Mi,is_intermediate:T,width:w,height:x},k.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:T,width:w,height:x},k.nodes[Le].width=D,k.nodes[Le].height=$,k.nodes[zt].width=D,k.nodes[zt].height=$,k.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:Bn,field:"image"},destination:{node_id:Ri,field:"image"}},{source:{node_id:vi,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:He,field:"image"},destination:{node_id:Mi,field:"image"}},{source:{node_id:Mi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ri,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"mask"}})}else k.nodes[Le].width=w,k.nodes[Le].height=x,k.nodes[zt].width=w,k.nodes[zt].height=x,k.nodes[zn]={...k.nodes[zn],image:t},k.nodes[Ri]={...k.nodes[Ri],image:n},k.nodes[Fn]={...k.nodes[Fn],image:t},k.edges.push({source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ri,field:"image"},destination:{node_id:me,field:"mask"}});return b!=="unmasked"&&(k.nodes[Ft]={type:"create_denoise_mask",id:Ft,is_intermediate:T,fp32:P},L?k.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:Ft,field:"image"}}):k.nodes[Ft]={...k.nodes[Ft],image:t},b==="mask"&&(L?k.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:Ft,field:"mask"}}):k.nodes[Ft]={...k.nodes[Ft],mask:n}),b==="edge"&&(k.nodes[lr]={type:"mask_edge",id:lr,is_intermediate:T,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},L?k.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:lr,field:"image"}}):k.nodes[lr]={...k.nodes[lr],image:n},k.edges.push({source:{node_id:lr,field:"image"},destination:{node_id:Ft,field:"mask"}})),k.edges.push({source:{node_id:Ft,field:"denoise_mask"},destination:{node_id:_t,field:"denoise_mask"}})),(y||S)&&(us(e,k,R),R=Fr),cs(e,k,R),ph(e,k,Ie,R),os(e,k,Ie),ss(e,k,Ie),e.system.shouldUseNSFWChecker&&as(e,k,me),e.system.shouldUseWatermarker&&ds(e,k,me),ls(e,k),k},d2e=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:m,canvasCoherenceSteps:b,canvasCoherenceStrength:_,infillTileSize:v,infillPatchmatchDownscaleSize:g,infillMethod:y,clipSkip:S,seamlessXAxis:w,seamlessYAxis:x}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:A}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:T,boundingBoxScaleMethod:P}=e.canvas,L=f==="fp32",R=!0,E=["auto","manual"].includes(P);let k=Lu;const D=h,$={id:LS,nodes:{[k]:{type:"main_model_loader",id:k,is_intermediate:R,model:s},[Wt]:{type:"clip_skip",id:Wt,is_intermediate:R,skipped_layers:S},[$e]:{type:"compel",id:$e,is_intermediate:R,prompt:i},[qe]:{type:"compel",id:qe,is_intermediate:R,prompt:o},[vf]:{type:"tomask",id:vf,is_intermediate:R,image:t},[mi]:{type:"mask_combine",id:mi,is_intermediate:R,mask2:n},[zn]:{type:"i2l",id:zn,is_intermediate:R,fp32:L},[Le]:{type:"noise",id:Le,use_cpu:D,seed:d,is_intermediate:R},[Fn]:{type:"create_denoise_mask",id:Fn,is_intermediate:R,fp32:L},[Ie]:{type:"denoise_latents",id:Ie,is_intermediate:R,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-c,denoising_end:1},[zt]:{type:"noise",id:zt,use_cpu:D,seed:d+1,is_intermediate:R},[Su]:{type:"add",id:Su,b:1,is_intermediate:R},[_t]:{type:"denoise_latents",id:_t,is_intermediate:R,steps:b,cfg_scale:a,scheduler:l,denoising_start:1-_,denoising_end:1},[He]:{type:"l2i",id:He,is_intermediate:R,fp32:L},[me]:{type:"color_correct",id:me,is_intermediate:R}},edges:[{source:{node_id:k,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:k,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:Gt,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:vf,field:"image"},destination:{node_id:mi,field:"mask1"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Ie,field:"latents"}},{source:{node_id:E?Bn:mi,field:"image"},destination:{node_id:Fn,field:"mask"}},{source:{node_id:Fn,field:"denoise_mask"},destination:{node_id:Ie,field:"denoise_mask"}},{source:{node_id:k,field:"unet"},destination:{node_id:_t,field:"unet"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:_t,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:_t,field:"negative_conditioning"}},{source:{node_id:zt,field:"noise"},destination:{node_id:_t,field:"noise"}},{source:{node_id:Ie,field:"latents"},destination:{node_id:_t,field:"latents"}},{source:{node_id:Gt,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:_t,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(y==="patchmatch"&&($.nodes[Gt]={type:"infill_patchmatch",id:Gt,is_intermediate:R,downscale:g}),y==="lama"&&($.nodes[Gt]={type:"infill_lama",id:Gt,is_intermediate:R}),y==="cv2"&&($.nodes[Gt]={type:"infill_cv2",id:Gt,is_intermediate:R}),y==="tile"&&($.nodes[Gt]={type:"infill_tile",id:Gt,is_intermediate:R,tile_size:v}),E){const O=T.width,I=T.height;$.nodes[vi]={type:"img_resize",id:vi,is_intermediate:R,width:O,height:I,image:t},$.nodes[Bn]={type:"img_resize",id:Bn,is_intermediate:R,width:O,height:I},$.nodes[Mi]={type:"img_resize",id:Mi,is_intermediate:R,width:C,height:A},$.nodes[Hl]={type:"img_resize",id:Hl,is_intermediate:R,width:C,height:A},$.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:R,width:C,height:A},$.nodes[Le].width=O,$.nodes[Le].height=I,$.nodes[zt].width=O,$.nodes[zt].height=I,$.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:Gt,field:"image"}},{source:{node_id:mi,field:"image"},destination:{node_id:Bn,field:"image"}},{source:{node_id:He,field:"image"},destination:{node_id:Mi,field:"image"}},{source:{node_id:Bn,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Gt,field:"image"},destination:{node_id:Hl,field:"image"}},{source:{node_id:Hl,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Mi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"mask"}})}else $.nodes[Gt]={...$.nodes[Gt],image:t},$.nodes[Le].width=C,$.nodes[Le].height=A,$.nodes[zt].width=C,$.nodes[zt].height=A,$.nodes[zn]={...$.nodes[zn],image:t},$.edges.push({source:{node_id:Gt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:mi,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&($.nodes[Ft]={type:"create_denoise_mask",id:Ft,is_intermediate:R,fp32:L},$.edges.push({source:{node_id:Gt,field:"image"},destination:{node_id:Ft,field:"image"}}),m==="mask"&&(E?$.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:Ft,field:"mask"}}):$.edges.push({source:{node_id:mi,field:"image"},destination:{node_id:Ft,field:"mask"}})),m==="edge"&&($.nodes[lr]={type:"mask_edge",id:lr,is_intermediate:R,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},E?$.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:lr,field:"image"}}):$.edges.push({source:{node_id:mi,field:"image"},destination:{node_id:lr,field:"image"}}),$.edges.push({source:{node_id:lr,field:"image"},destination:{node_id:Ft,field:"mask"}})),$.edges.push({source:{node_id:Ft,field:"denoise_mask"},destination:{node_id:_t,field:"denoise_mask"}})),(w||x)&&(us(e,$,k),k=Fr),cs(e,$,k),ph(e,$,Ie,k),os(e,$,Ie),ss(e,$,Ie),e.system.shouldUseNSFWChecker&&as(e,$,me),e.system.shouldUseWatermarker&&ds(e,$,me),ls(e,$),$},gh=(e,t,n,r=Ii)=>{const{loras:i}=e.lora,o=M_(i),s=t.nodes[dt],a=r;let l=r;[Fr,Ba].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;Mo(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${Wz}_${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&&[Bc,zc].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:_t,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:$e,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:qe,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:$e,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:qe,field:"clip2"}})),u=m,c+=1})},od=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:s}=e.sdxl,a=s||t?[n,i].join(" "):i,l=s||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:a,joinedNegativeStylePrompt:l}},mh=(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 v=t.nodes[dt];v&&(v.refiner_model=o,v.refiner_positive_aesthetic_score=s,v.refiner_negative_aesthetic_score=a,v.refiner_cfg_scale=c,v.refiner_scheduler=u,v.refiner_start=d,v.refiner_steps=l);const g=r||Ii,{joinedPositiveStylePrompt:y,joinedNegativeStylePrompt:S}=od(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[Vu]={type:"sdxl_refiner_model_loader",id:Vu,model:o},t.nodes[n0]={type:"sdxl_refiner_compel_prompt",id:n0,style:y,aesthetic_score:s},t.nodes[r0]={type:"sdxl_refiner_compel_prompt",id:r0,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:Vu,field:"unet"},destination:{node_id:Es,field:"unet"}},{source:{node_id:Vu,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:Vu,field:"unet"},destination:{node_id:Hs,field:"unet"}}),t.edges.push({source:{node_id:Vu,field:"clip2"},destination:{node_id:n0,field:"clip2"}},{source:{node_id:Vu,field:"clip2"},destination:{node_id:r0,field:"clip2"}},{source:{node_id:n0,field:"conditioning"},destination:{node_id:Hs,field:"positive_conditioning"}},{source:{node_id:r0,field:"conditioning"},destination:{node_id:Hs,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:Hs,field:"latents"}}),(t.id===Bc||t.id===zc)&&(t.nodes[Ba]={type:"create_denoise_mask",id:Ba,is_intermediate:!0,fp32:b},_?t.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:Ba,field:"image"}}):t.nodes[Ba]={...t.nodes[Ba],image:i},t.edges.push({source:{node_id:_?Bn:mi,field:"image"},destination:{node_id:Ba,field:"mask"}},{source:{node_id:Ba,field:"denoise_mask"},destination:{node_id:Hs,field:"denoise_mask"}})),t.id===$S||t.id===Vg?t.edges.push({source:{node_id:Hs,field:"latents"},destination:{node_id:_?He:me,field:"latents"}}):t.edges.push({source:{node_id:Hs,field:"latents"},destination:{node_id:He,field:"latents"}})},f2e=(e,t)=>{const n=pe("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,seed:l,steps:u,vaePrecision:c,clipSkip:d,shouldUseCpuNoise:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{shouldUseSDXLRefiner:m,refinerStart:b,sdxlImg2ImgDenoisingStrength:_}=e.sdxl,{width:v,height:g}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:S}=e.canvas,w=c==="fp32",x=!0,C=["auto","manual"].includes(S);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let A=Ii;const T=f,{joinedPositiveStylePrompt:P,joinedNegativeStylePrompt:L}=od(e),R={id:Vg,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:o},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:r,style:P},[qe]:{type:"sdxl_compel_prompt",id:qe,prompt:i,style:L},[Le]:{type:"noise",id:Le,is_intermediate:x,use_cpu:T,seed:l,width:C?y.width:v,height:C?y.height:g},[$n]:{type:"i2l",id:$n,is_intermediate:x,fp32:w},[Ce]:{type:"denoise_latents",id:Ce,is_intermediate:x,cfg_scale:s,scheduler:a,steps:u,denoising_start:m?Math.min(b,1-_):1-_,denoising_end:m?b:1}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}},{source:{node_id:$n,field:"latents"},destination:{node_id:Ce,field:"latents"}}]};return C?(R.nodes[yf]={id:yf,type:"img_resize",is_intermediate:x,image:t,width:y.width,height:y.height},R.nodes[He]={id:He,type:"l2i",is_intermediate:x,fp32:w},R.nodes[me]={id:me,type:"img_resize",is_intermediate:x,width:v,height:g},R.edges.push({source:{node_id:yf,field:"image"},destination:{node_id:$n,field:"image"}},{source:{node_id:Ce,field:"latents"},destination:{node_id:He,field:"latents"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}})):(R.nodes[me]={type:"l2i",id:me,is_intermediate:x,fp32:w},R.nodes[$n].image=t,R.edges.push({source:{node_id:Ce,field:"latents"},destination:{node_id:me,field:"latents"}})),R.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,width:C?y.width:v,height:C?y.height:g,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:T?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:d,strength:_,init_image:t.image_name},R.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(h||p)&&(us(e,R,A),A=Fr),m&&(mh(e,R,Ce,A),(h||p)&&(A=Es)),cs(e,R,A),gh(e,R,Ce,A),os(e,R,Ce),ss(e,R,Ce),e.system.shouldUseNSFWChecker&&as(e,R,me),e.system.shouldUseWatermarker&&ds(e,R,me),ls(e,R),R},h2e=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:m,canvasCoherenceSteps:b,canvasCoherenceStrength:_,seamlessXAxis:v,seamlessYAxis:g}=e.generation,{sdxlImg2ImgDenoisingStrength:y,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:A,boundingBoxScaleMethod:T}=e.canvas,P=d==="fp32",L=!0,R=["auto","manual"].includes(T);let E=Ii;const k=f,{joinedPositiveStylePrompt:D,joinedNegativeStylePrompt:$}=od(e),O={id:Bc,nodes:{[E]:{type:"sdxl_model_loader",id:E,model:s},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:i,style:D},[qe]:{type:"sdxl_compel_prompt",id:qe,prompt:o,style:$},[Ri]:{type:"img_blur",id:Ri,is_intermediate:L,radius:h,blur_type:p},[zn]:{type:"i2l",id:zn,is_intermediate:L,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:k,seed:c,is_intermediate:L},[Fn]:{type:"create_denoise_mask",id:Fn,is_intermediate:L,fp32:P},[Ce]:{type:"denoise_latents",id:Ce,is_intermediate:L,steps:u,cfg_scale:a,scheduler:l,denoising_start:S?Math.min(w,1-y):1-y,denoising_end:S?w:1},[zt]:{type:"noise",id:zt,use_cpu:k,seed:c+1,is_intermediate:L},[Su]:{type:"add",id:Su,b:1,is_intermediate:L},[_t]:{type:"denoise_latents",id:_t,is_intermediate:L,steps:b,cfg_scale:a,scheduler:l,denoising_start:1-_,denoising_end:1},[He]:{type:"l2i",id:He,is_intermediate:L,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:L,reference:t}},edges:[{source:{node_id:E,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:E,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:E,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Ce,field:"latents"}},{source:{node_id:Ri,field:"image"},destination:{node_id:Fn,field:"mask"}},{source:{node_id:Fn,field:"denoise_mask"},destination:{node_id:Ce,field:"denoise_mask"}},{source:{node_id:E,field:"unet"},destination:{node_id:_t,field:"unet"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:_t,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:_t,field:"negative_conditioning"}},{source:{node_id:zt,field:"noise"},destination:{node_id:_t,field:"noise"}},{source:{node_id:Ce,field:"latents"},destination:{node_id:_t,field:"latents"}},{source:{node_id:_t,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(R){const I=A.width,N=A.height;O.nodes[vi]={type:"img_resize",id:vi,is_intermediate:L,width:I,height:N,image:t},O.nodes[Bn]={type:"img_resize",id:Bn,is_intermediate:L,width:I,height:N,image:n},O.nodes[Mi]={type:"img_resize",id:Mi,is_intermediate:L,width:x,height:C},O.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:L,width:x,height:C},O.nodes[Le].width=I,O.nodes[Le].height=N,O.nodes[zt].width=I,O.nodes[zt].height=N,O.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:Bn,field:"image"},destination:{node_id:Ri,field:"image"}},{source:{node_id:vi,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:He,field:"image"},destination:{node_id:Mi,field:"image"}},{source:{node_id:Mi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ri,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"mask"}})}else O.nodes[Le].width=x,O.nodes[Le].height=C,O.nodes[zt].width=x,O.nodes[zt].height=C,O.nodes[zn]={...O.nodes[zn],image:t},O.nodes[Ri]={...O.nodes[Ri],image:n},O.nodes[Fn]={...O.nodes[Fn],image:t},O.edges.push({source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ri,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&(O.nodes[Ft]={type:"create_denoise_mask",id:Ft,is_intermediate:L,fp32:P},R?O.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:Ft,field:"image"}}):O.nodes[Ft]={...O.nodes[Ft],image:t},m==="mask"&&(R?O.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:Ft,field:"mask"}}):O.nodes[Ft]={...O.nodes[Ft],mask:n}),m==="edge"&&(O.nodes[lr]={type:"mask_edge",id:lr,is_intermediate:L,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},R?O.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:lr,field:"image"}}):O.nodes[lr]={...O.nodes[lr],image:n},O.edges.push({source:{node_id:lr,field:"image"},destination:{node_id:Ft,field:"mask"}})),O.edges.push({source:{node_id:Ft,field:"denoise_mask"},destination:{node_id:_t,field:"denoise_mask"}})),(v||g)&&(us(e,O,E),E=Fr),S&&(mh(e,O,_t,E,t),(v||g)&&(E=Es)),cs(e,O,E),gh(e,O,Ce,E),os(e,O,Ce),ss(e,O,Ce),e.system.shouldUseNSFWChecker&&as(e,O,me),e.system.shouldUseWatermarker&&ds(e,O,me),ls(e,O),O},p2e=(e,t,n)=>{const r=pe("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:m,canvasCoherenceStrength:b,infillTileSize:_,infillPatchmatchDownscaleSize:v,infillMethod:g,seamlessXAxis:y,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:x,refinerStart:C}=e.sdxl;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:P,boundingBoxScaleMethod:L}=e.canvas,R=d==="fp32",E=!0,k=["auto","manual"].includes(L);let D=Ii;const $=f,{joinedPositiveStylePrompt:O,joinedNegativeStylePrompt:I}=od(e),N={id:zc,nodes:{[Ii]:{type:"sdxl_model_loader",id:Ii,model:s},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:i,style:O},[qe]:{type:"sdxl_compel_prompt",id:qe,prompt:o,style:I},[vf]:{type:"tomask",id:vf,is_intermediate:E,image:t},[mi]:{type:"mask_combine",id:mi,is_intermediate:E,mask2:n},[zn]:{type:"i2l",id:zn,is_intermediate:E,fp32:R},[Le]:{type:"noise",id:Le,use_cpu:$,seed:c,is_intermediate:E},[Fn]:{type:"create_denoise_mask",id:Fn,is_intermediate:E,fp32:R},[Ce]:{type:"denoise_latents",id:Ce,is_intermediate:E,steps:u,cfg_scale:a,scheduler:l,denoising_start:x?Math.min(C,1-w):1-w,denoising_end:x?C:1},[zt]:{type:"noise",id:zt,use_cpu:$,seed:c+1,is_intermediate:E},[Su]:{type:"add",id:Su,b:1,is_intermediate:E},[_t]:{type:"denoise_latents",id:_t,is_intermediate:E,steps:m,cfg_scale:a,scheduler:l,denoising_start:1-b,denoising_end:1},[He]:{type:"l2i",id:He,is_intermediate:E,fp32:R},[me]:{type:"color_correct",id:me,is_intermediate:E}},edges:[{source:{node_id:Ii,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:Ii,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Ii,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:Ii,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:Ii,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:Gt,field:"image"},destination:{node_id:zn,field:"image"}},{source:{node_id:vf,field:"image"},destination:{node_id:mi,field:"mask1"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}},{source:{node_id:zn,field:"latents"},destination:{node_id:Ce,field:"latents"}},{source:{node_id:k?Bn:mi,field:"image"},destination:{node_id:Fn,field:"mask"}},{source:{node_id:Fn,field:"denoise_mask"},destination:{node_id:Ce,field:"denoise_mask"}},{source:{node_id:D,field:"unet"},destination:{node_id:_t,field:"unet"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:_t,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:_t,field:"negative_conditioning"}},{source:{node_id:zt,field:"noise"},destination:{node_id:_t,field:"noise"}},{source:{node_id:Ce,field:"latents"},destination:{node_id:_t,field:"latents"}},{source:{node_id:Gt,field:"image"},destination:{node_id:Fn,field:"image"}},{source:{node_id:_t,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(g==="patchmatch"&&(N.nodes[Gt]={type:"infill_patchmatch",id:Gt,is_intermediate:E,downscale:v}),g==="lama"&&(N.nodes[Gt]={type:"infill_lama",id:Gt,is_intermediate:E}),g==="cv2"&&(N.nodes[Gt]={type:"infill_cv2",id:Gt,is_intermediate:E}),g==="tile"&&(N.nodes[Gt]={type:"infill_tile",id:Gt,is_intermediate:E,tile_size:_}),k){const B=P.width,U=P.height;N.nodes[vi]={type:"img_resize",id:vi,is_intermediate:E,width:B,height:U,image:t},N.nodes[Bn]={type:"img_resize",id:Bn,is_intermediate:E,width:B,height:U},N.nodes[Mi]={type:"img_resize",id:Mi,is_intermediate:E,width:A,height:T},N.nodes[Hl]={type:"img_resize",id:Hl,is_intermediate:E,width:A,height:T},N.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:E,width:A,height:T},N.nodes[Le].width=B,N.nodes[Le].height=U,N.nodes[zt].width=B,N.nodes[zt].height=U,N.edges.push({source:{node_id:vi,field:"image"},destination:{node_id:Gt,field:"image"}},{source:{node_id:mi,field:"image"},destination:{node_id:Bn,field:"image"}},{source:{node_id:He,field:"image"},destination:{node_id:Mi,field:"image"}},{source:{node_id:Bn,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Gt,field:"image"},destination:{node_id:Hl,field:"image"}},{source:{node_id:Hl,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Mi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:me,field:"mask"}})}else N.nodes[Gt]={...N.nodes[Gt],image:t},N.nodes[Le].width=A,N.nodes[Le].height=T,N.nodes[zt].width=A,N.nodes[zt].height=T,N.nodes[zn]={...N.nodes[zn],image:t},N.edges.push({source:{node_id:Gt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:mi,field:"image"},destination:{node_id:me,field:"mask"}});return p!=="unmasked"&&(N.nodes[Ft]={type:"create_denoise_mask",id:Ft,is_intermediate:E,fp32:R},N.edges.push({source:{node_id:Gt,field:"image"},destination:{node_id:Ft,field:"image"}}),p==="mask"&&(k?N.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:Ft,field:"mask"}}):N.edges.push({source:{node_id:mi,field:"image"},destination:{node_id:Ft,field:"mask"}})),p==="edge"&&(N.nodes[lr]={type:"mask_edge",id:lr,is_intermediate:E,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},k?N.edges.push({source:{node_id:Bn,field:"image"},destination:{node_id:lr,field:"image"}}):N.edges.push({source:{node_id:mi,field:"image"},destination:{node_id:lr,field:"image"}}),N.edges.push({source:{node_id:lr,field:"image"},destination:{node_id:Ft,field:"mask"}})),N.edges.push({source:{node_id:Ft,field:"denoise_mask"},destination:{node_id:_t,field:"denoise_mask"}})),(y||S)&&(us(e,N,D),D=Fr),x&&(mh(e,N,_t,D,t),(y||S)&&(D=Es)),cs(e,N,D),gh(e,N,Ce,D),os(e,N,Ce),ss(e,N,Ce),e.system.shouldUseNSFWChecker&&as(e,N,me),e.system.shouldUseWatermarker&&ds(e,N,me),ls(e,N),N},g2e=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,seed:a,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:b,boundingBoxScaleMethod:_}=e.canvas,v=u==="fp32",g=!0,y=["auto","manual"].includes(_),{shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const x=d,C=i.model_type==="onnx";let A=C?NS:Ii;const T=C?"onnx_model_loader":"sdxl_model_loader",P=C?{type:"t2l_onnx",id:Ce,is_intermediate:g,cfg_scale:o,scheduler:s,steps:l}:{type:"denoise_latents",id:Ce,is_intermediate:g,cfg_scale:o,scheduler:s,steps:l,denoising_start:0,denoising_end:S?w:1},{joinedPositiveStylePrompt:L,joinedNegativeStylePrompt:R}=od(e),E={id:$S,nodes:{[A]:{type:T,id:A,is_intermediate:g,model:i},[$e]:{type:C?"prompt_onnx":"sdxl_compel_prompt",id:$e,is_intermediate:g,prompt:n,style:L},[qe]:{type:C?"prompt_onnx":"sdxl_compel_prompt",id:qe,is_intermediate:g,prompt:r,style:R},[Le]:{type:"noise",id:Le,is_intermediate:g,seed:a,width:y?b.width:p,height:y?b.height:m,use_cpu:x},[P.id]:P},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}}]};return y?(E.nodes[He]={id:He,type:C?"l2i_onnx":"l2i",is_intermediate:g,fp32:v},E.nodes[me]={id:me,type:"img_resize",is_intermediate:g,width:p,height:m},E.edges.push({source:{node_id:Ce,field:"latents"},destination:{node_id:He,field:"latents"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}})):(E.nodes[me]={type:C?"l2i_onnx":"l2i",id:me,is_intermediate:g,fp32:v},E.edges.push({source:{node_id:Ce,field:"latents"},destination:{node_id:me,field:"latents"}})),E.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:y?b.width:p,height:y?b.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:a,steps:l,rand_device:x?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:c},E.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(us(e,E,A),A=Fr),S&&(mh(e,E,Ce,A),(f||h)&&(A=Es)),gh(e,E,Ce,A),cs(e,E,A),os(e,E,Ce),ss(e,E,Ce),e.system.shouldUseNSFWChecker&&as(e,E,me),e.system.shouldUseWatermarker&&ds(e,E,me),ls(e,E),E},m2e=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,seed:a,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:b,boundingBoxScaleMethod:_}=e.canvas,v=u==="fp32",g=!0,y=["auto","manual"].includes(_);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d,w=i.model_type==="onnx";let x=w?NS:Lu;const C=w?"onnx_model_loader":"main_model_loader",A=w?{type:"t2l_onnx",id:Ie,is_intermediate:g,cfg_scale:o,scheduler:s,steps:l}:{type:"denoise_latents",id:Ie,is_intermediate:g,cfg_scale:o,scheduler:s,steps:l,denoising_start:0,denoising_end:1},T={id:Qz,nodes:{[x]:{type:C,id:x,is_intermediate:g,model:i},[Wt]:{type:"clip_skip",id:Wt,is_intermediate:g,skipped_layers:c},[$e]:{type:w?"prompt_onnx":"compel",id:$e,is_intermediate:g,prompt:n},[qe]:{type:w?"prompt_onnx":"compel",id:qe,is_intermediate:g,prompt:r},[Le]:{type:"noise",id:Le,is_intermediate:g,seed:a,width:y?b.width:p,height:y?b.height:m,use_cpu:S},[A.id]:A},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}}]};return y?(T.nodes[He]={id:He,type:w?"l2i_onnx":"l2i",is_intermediate:g,fp32:v},T.nodes[me]={id:me,type:"img_resize",is_intermediate:g,width:p,height:m},T.edges.push({source:{node_id:Ie,field:"latents"},destination:{node_id:He,field:"latents"}},{source:{node_id:He,field:"image"},destination:{node_id:me,field:"image"}})):(T.nodes[me]={type:w?"l2i_onnx":"l2i",id:me,is_intermediate:g,fp32:v},T.edges.push({source:{node_id:Ie,field:"latents"},destination:{node_id:me,field:"latents"}})),T.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:y?b.width:p,height:y?b.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:a,steps:l,rand_device:S?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:c},T.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(us(e,T,x),x=Fr),cs(e,T,x),ph(e,T,Ie,x),os(e,T,Ie),ss(e,T,Ie),e.system.shouldUseNSFWChecker&&as(e,T,me),e.system.shouldUseWatermarker&&ds(e,T,me),ls(e,T),T},y2e=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=g2e(e):i=m2e(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=f2e(e,n):i=u2e(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=h2e(e,n,r):i=c2e(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=p2e(e,n,r):i=d2e(e,n,r)}return i},Fw=({count:e,start:t,min:n=Bte,max:r=bp})=>{const i=t??gte(n,r),o=[];for(let s=i;s<i+e;s++)o.push(s%r);return o},Yz=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:s}=e.generation,{shouldConcatSDXLStylePrompt:a,positiveStylePrompt:l}=e.sdxl,{prompts:u,seedBehaviour:c}=e.dynamicPrompts,d=[];if(u.length===1){eP(t.nodes[dt],"seed");const h=Fw({count:r,start:o?void 0:s}),p=[];t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:h}),t.nodes[dt]&&p.push({node_path:dt,field_name:"seed",items:h}),t.nodes[zt]&&p.push({node_path:zt,field_name:"seed",items:h.map(m=>(m+1)%bp)}),d.push(p)}else{const h=[],p=[];if(c==="PER_PROMPT"){const b=Fw({count:u.length*r,start:o?void 0:s});t.nodes[Le]&&h.push({node_path:Le,field_name:"seed",items:b}),t.nodes[dt]&&h.push({node_path:dt,field_name:"seed",items:b}),t.nodes[zt]&&h.push({node_path:zt,field_name:"seed",items:b.map(_=>(_+1)%bp)})}else{const b=Fw({count:r,start:o?void 0:s});t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:b}),t.nodes[dt]&&p.push({node_path:dt,field_name:"seed",items:b}),t.nodes[zt]&&p.push({node_path:zt,field_name:"seed",items:b.map(_=>(_+1)%bp)}),d.push(p)}const m=c==="PER_PROMPT"?Ste(r).flatMap(()=>u):u;if(t.nodes[$e]&&h.push({node_path:$e,field_name:"prompt",items:m}),t.nodes[dt]&&h.push({node_path:dt,field_name:"positive_prompt",items:m}),a&&(i==null?void 0:i.base_model)==="sdxl"){eP(t.nodes[dt],"positive_style_prompt");const b=m.map(_=>[_,l].join(" "));t.nodes[$e]&&h.push({node_path:$e,field_name:"style",items:b}),t.nodes[dt]&&h.push({node_path:dt,field_name:"positive_style_prompt",items:b})}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},v2e=()=>{Ee({predicate:e=>G5.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=pe("queue"),{prepend:i}=e.payload,o=t(),{layerState:s,boundingBoxCoordinates:a,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await U5(s,a,l,u,c);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,b=a2e(h,m);if(o.system.enableImageDebugging){const S=await IR(f),w=await IR(p);i2e([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${b}`);let _,v;["img2img","inpaint","outpaint"].includes(b)&&(_=await n(ge.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(b)&&(v=await n(ge.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const g=y2e(o,b,_,v);r.debug({graph:$t(g)},"Canvas graph built"),n(az(g));const y=Yz(o,g,i);try{const S=n(bi.endpoints.enqueueBatch.initiate(y,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset(),r.debug({enqueueResult:$t(w)},"Batch enqueued");const x=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(Tre({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(Are(x)),n(Mt({title:X("queue.batchQueued"),description:X("queue.batchQueuedDesc",{item_count:w.enqueued,direction:X(i?"queue.front":"queue.back")}),status:"success"}))}catch{r.error({batchConfig:$t(y)},X("queue.batchFailedToQueue")),n(Mt({title:X("queue.batchFailedToQueue"),status:"error"}))}}})},_2e=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,seed:a,steps:l,initialImage:u,img2imgStrength:c,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:p,shouldUseCpuNoise:m,vaePrecision:b,seamlessXAxis:_,seamlessYAxis:v}=e.generation;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const g=b==="fp32",y=!0;let S=Lu;const w=m,x={id:p3,nodes:{[S]:{type:"main_model_loader",id:S,model:i,is_intermediate:y},[Wt]:{type:"clip_skip",id:Wt,skipped_layers:p,is_intermediate:y},[$e]:{type:"compel",id:$e,prompt:n,is_intermediate:y},[qe]:{type:"compel",id:qe,prompt:r,is_intermediate:y},[Le]:{type:"noise",id:Le,use_cpu:w,seed:a,is_intermediate:y},[He]:{type:"l2i",id:He,fp32:g,is_intermediate:y},[Ie]:{type:"denoise_latents",id:Ie,cfg_scale:o,scheduler:s,steps:l,denoising_start:1-c,denoising_end:1,is_intermediate:y},[$n]:{type:"i2l",id:$n,fp32:g,is_intermediate:y}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}},{source:{node_id:$n,field:"latents"},destination:{node_id:Ie,field:"latents"}},{source:{node_id:Ie,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const C={id:ra,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};x.nodes[ra]=C,x.edges.push({source:{node_id:ra,field:"image"},destination:{node_id:$n,field:"image"}}),x.edges.push({source:{node_id:ra,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:ra,field:"height"},destination:{node_id:Le,field:"height"}})}else x.nodes[$n].image={image_name:u.imageName},x.edges.push({source:{node_id:$n,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:$n,field:"height"},destination:{node_id:Le,field:"height"}});return x.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:a,steps:l,rand_device:w?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:p,strength:c,init_image:u.imageName},x.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:He,field:"metadata"}}),(_||v)&&(us(e,x,S),S=Fr),cs(e,x,S),ph(e,x,Ie,S),os(e,x,Ie),ss(e,x,Ie),e.system.shouldUseNSFWChecker&&as(e,x),e.system.shouldUseWatermarker&&ds(e,x),ls(e,x),x},b2e=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,seed:a,steps:l,initialImage:u,shouldFitToWidthHeight:c,width:d,height:f,clipSkip:h,shouldUseCpuNoise:p,vaePrecision:m,seamlessXAxis:b,seamlessYAxis:_}=e.generation,{positiveStylePrompt:v,negativeStylePrompt:g,shouldUseSDXLRefiner:y,refinerStart:S,sdxlImg2ImgDenoisingStrength:w}=e.sdxl;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const x=m==="fp32",C=!0;let A=Ii;const T=p,{joinedPositiveStylePrompt:P,joinedNegativeStylePrompt:L}=od(e),R={id:R1,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:i,is_intermediate:C},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:n,style:P,is_intermediate:C},[qe]:{type:"sdxl_compel_prompt",id:qe,prompt:r,style:L,is_intermediate:C},[Le]:{type:"noise",id:Le,use_cpu:T,seed:a,is_intermediate:C},[He]:{type:"l2i",id:He,fp32:x,is_intermediate:C},[Ce]:{type:"denoise_latents",id:Ce,cfg_scale:o,scheduler:s,steps:l,denoising_start:y?Math.min(S,1-w):1-w,denoising_end:y?S:1,is_intermediate:C},[$n]:{type:"i2l",id:$n,fp32:x,is_intermediate:C}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}},{source:{node_id:$n,field:"latents"},destination:{node_id:Ce,field:"latents"}},{source:{node_id:Ce,field:"latents"},destination:{node_id:He,field:"latents"}}]};if(c&&(u.width!==d||u.height!==f)){const E={id:ra,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:d,height:f};R.nodes[ra]=E,R.edges.push({source:{node_id:ra,field:"image"},destination:{node_id:$n,field:"image"}}),R.edges.push({source:{node_id:ra,field:"width"},destination:{node_id:Le,field:"width"}}),R.edges.push({source:{node_id:ra,field:"height"},destination:{node_id:Le,field:"height"}})}else R.nodes[$n].image={image_name:u.imageName},R.edges.push({source:{node_id:$n,field:"width"},destination:{node_id:Le,field:"width"}}),R.edges.push({source:{node_id:$n,field:"height"},destination:{node_id:Le,field:"height"}});return R.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:n,negative_prompt:r,model:i,seed:a,steps:l,rand_device:T?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:h,strength:w,init_image:u.imageName,positive_style_prompt:v,negative_style_prompt:g},R.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:He,field:"metadata"}}),(b||_)&&(us(e,R,A),A=Fr),y&&(mh(e,R,Ce),(b||_)&&(A=Es)),cs(e,R,A),gh(e,R,Ce,A),os(e,R,Ce),ss(e,R,Ce),e.system.shouldUseNSFWChecker&&as(e,R),e.system.shouldUseWatermarker&&ds(e,R),ls(e,R),R},S2e=e=>{const t=pe("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,seed:a,steps:l,width:u,height:c,clipSkip:d,shouldUseCpuNoise:f,vaePrecision:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:_,shouldUseSDXLRefiner:v,refinerStart:g}=e.sdxl,y=f;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=h==="fp32",w=!0,{joinedPositiveStylePrompt:x,joinedNegativeStylePrompt:C}=od(e);let A=Ii;const T={id:V5,nodes:{[A]:{type:"sdxl_model_loader",id:A,model:i,is_intermediate:w},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:n,style:x,is_intermediate:w},[qe]:{type:"sdxl_compel_prompt",id:qe,prompt:r,style:C,is_intermediate:w},[Le]:{type:"noise",id:Le,seed:a,width:u,height:c,use_cpu:y,is_intermediate:w},[Ce]:{type:"denoise_latents",id:Ce,cfg_scale:o,scheduler:s,steps:l,denoising_start:0,denoising_end:v?g:1,is_intermediate:w},[He]:{type:"l2i",id:He,fp32:S,is_intermediate:w}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Ce,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:A,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:A,field:"clip2"},destination:{node_id:qe,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ce,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ce,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ce,field:"noise"}},{source:{node_id:Ce,field:"latents"},destination:{node_id:He,field:"latents"}}]};return T.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:c,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:a,steps:l,rand_device:y?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:d,positive_style_prompt:b,negative_style_prompt:_},T.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:He,field:"metadata"}}),(p||m)&&(us(e,T,A),A=Fr),v&&(mh(e,T,Ce),(p||m)&&(A=Es)),cs(e,T,A),gh(e,T,Ce,A),os(e,T,Ce),ss(e,T,Ce),e.system.shouldUseNSFWChecker&&as(e,T),e.system.shouldUseWatermarker&&ds(e,T),ls(e,T),T},w2e=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,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p,seed:m}=e.generation,b=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const _=f==="fp32",v=!0,g=i.model_type==="onnx";let y=g?NS:Lu;const S=g?"onnx_model_loader":"main_model_loader",w=g?{type:"t2l_onnx",id:Ie,is_intermediate:v,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Ie,is_intermediate:v,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:1},x={id:Kz,nodes:{[y]:{type:S,id:y,is_intermediate:v,model:i},[Wt]:{type:"clip_skip",id:Wt,skipped_layers:c,is_intermediate:v},[$e]:{type:g?"prompt_onnx":"compel",id:$e,prompt:n,is_intermediate:v},[qe]:{type:g?"prompt_onnx":"compel",id:qe,prompt:r,is_intermediate:v},[Le]:{type:"noise",id:Le,seed:m,width:l,height:u,use_cpu:b,is_intermediate:v},[w.id]:w,[He]:{type:g?"l2i_onnx":"l2i",id:He,fp32:_,is_intermediate:v}},edges:[{source:{node_id:y,field:"unet"},destination:{node_id:Ie,field:"unet"}},{source:{node_id:y,field:"clip"},destination:{node_id:Wt,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:Wt,field:"clip"},destination:{node_id:qe,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Ie,field:"positive_conditioning"}},{source:{node_id:qe,field:"conditioning"},destination:{node_id:Ie,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Ie,field:"noise"}},{source:{node_id:Ie,field:"latents"},destination:{node_id:He,field:"latents"}}]};return x.nodes[dt]={id:dt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:n,negative_prompt:r,model:i,seed:m,steps:a,rand_device:b?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:c},x.edges.push({source:{node_id:dt,field:"metadata"},destination:{node_id:He,field:"metadata"}}),(h||p)&&(us(e,x,y),y=Fr),cs(e,x,y),ph(e,x,Ie,y),os(e,x,Ie),ss(e,x,Ie),e.system.shouldUseNSFWChecker&&as(e,x),e.system.shouldUseWatermarker&&ds(e,x),ls(e,x),x},x2e=()=>{Ee({predicate:e=>G5.match(e)&&(e.payload.tabName==="txt2img"||e.payload.tabName==="img2img"),effect:async(e,{getState:t,dispatch:n})=>{const r=pe("queue"),i=t(),o=i.generation.model,{prepend:s}=e.payload;let a;o&&o.base_model==="sdxl"?e.payload.tabName==="txt2img"?a=S2e(i):a=b2e(i):e.payload.tabName==="txt2img"?a=w2e(i):a=_2e(i);const l=Yz(i,a,s);try{const u=n(bi.endpoints.enqueueBatch.initiate(l,{fixedCacheKey:"enqueueBatch"})),c=await u.unwrap();u.reset(),r.debug({enqueueResult:$t(c)},"Batch enqueued"),n(Mt({title:X("queue.batchQueued"),description:X("queue.batchQueuedDesc",{item_count:c.enqueued,direction:X(s?"queue.front":"queue.back")}),status:"success"}))}catch{r.error({batchConfig:$t(l)},X("queue.batchFailedToQueue")),n(Mt({title:X("queue.batchFailedToQueue"),status:"error"}))}}})},C2e=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function E2e(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+'["'+T2e(n)+'"]';if(!C2e.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function T2e(e){return e.replace(/"/g,'\\"')}function A2e(e){return e.length!==0}const k2e=99,Zz="; ",Jz=", or ",H5="Validation error",ej=": ";class tj extends Error{constructor(n,r=[]){super(n);n2(this,"details");n2(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function W5(e,t,n){if(e.code==="invalid_union")return e.unionErrors.reduce((r,i)=>{const o=i.issues.map(s=>W5(s,t,n)).join(t);return r.includes(o)||r.push(o),r},[]).join(n);if(A2e(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 "${E2e(e.path)}"`}return e.message}function nj(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:H5}function aNe(e,t={}){const{issueSeparator:n=Zz,unionSeparator:r=Jz,prefixSeparator:i=ej,prefix:o=H5}=t,s=W5(e,n,r),a=nj(s,o,i);return new tj(a,[e])}function OR(e,t={}){const{maxIssuesInMessage:n=k2e,issueSeparator:r=Zz,unionSeparator:i=Jz,prefixSeparator:o=ej,prefix:s=H5}=t,a=e.errors.slice(0,n).map(u=>W5(u,r,i)).join(r),l=nj(a,s,o);return new tj(l,e.errors)}const P2e=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=WD.safeParse(o);if(!s.success){const{message:a}=OR(s.error,{prefix:we.t("nodes.unableToParseNode")});pe("nodes").warn({node:$t(o)},a);return}i.nodes.push(s.data)}),r.forEach(o=>{const s=KD.safeParse(o);if(!s.success){const{message:a}=OR(s.error,{prefix:we.t("nodes.unableToParseEdge")});pe("nodes").warn({edge:$t(o)},a);return}i.edges.push(s.data)}),i},R2e=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},I2e=e=>{const{nodes:t,edges:n}=e,r=t.filter(Nr),i=JSON.stringify(P2e(e)),o=r.reduce((u,c)=>{const{id:d,data:f}=c,{type:h,inputs:p,isIntermediate:m,embedWorkflow:b}=f,_=yC(p,(g,y,S)=>{const w=R2e(y);return g[S]=w,g},{});_.use_cache=c.data.useCache;const v={type:h,id:d,..._,is_intermediate:m};return b&&Object.assign(v,{workflow:i}),Object.assign(u,{[d]:v}),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]=O_(c,d)}),{id:$B(),nodes:o,edges:a}},O2e=()=>{Ee({predicate:e=>G5.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=pe("queue"),i=t(),{prepend:o}=e.payload,a={batch:{graph:I2e(i.nodes),runs:i.generation.iterations},prepend:e.payload.prepend};try{const l=n(bi.endpoints.enqueueBatch.initiate(a,{fixedCacheKey:"enqueueBatch"})),u=await l.unwrap();l.reset(),r.debug({enqueueResult:$t(u)},"Batch enqueued"),n(Mt({title:X("queue.batchQueued"),description:X("queue.batchQueuedDesc",{item_count:u.enqueued,direction:X(o?"queue.front":"queue.back")}),status:"success"}))}catch{r.error({batchConfig:$t(a)},"Failed to enqueue batch"),n(Mt({title:X("queue.batchFailedToQueue"),status:"error"}))}}})},M2e=()=>{Ee({matcher:ge.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")}})},N2e=()=>{Ee({matcher:ge.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")}})},K5=Me("deleteImageModal/imageDeletionConfirmed"),lNe=Di(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],T5),rj=Di([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?Kr:Gl,offset:0,limit:Nre,is_intermediate:!1}},T5),D2e=()=>{Ee({actionCreator:K5,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(o5(!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=rj(l),{data:m}=ge.endpoints.listImages.select(p)(l),b=m?Dn.getSelectors().selectAll(m):[],_=b.findIndex(S=>S.image_name===h),v=b.filter(S=>S.image_name!==h),g=Ul(_,0,v.length-1),y=v[g];t(fa(y||null))}a.isCanvasImage&&t(TT()),i.forEach(h=>{var p,m;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(ET()),Mo(n().controlNet.controlNets,b=>{(b.controlImage===h.image_name||b.processedControlImage===h.image_name)&&(t(Xc({controlNetId:b.controlNetId,controlImage:null})),t(i5({controlNetId:b.controlNetId,processedControlImage:null})))}),((m=n().controlNet.ipAdapterInfo.adapterImage)==null?void 0:m.image_name)===h.image_name&&t(Ib(null)),n().nodes.nodes.forEach(b=>{Nr(b)&&Mo(b.data.inputs,_=>{var v;_.type==="ImageField"&&((v=_.value)==null?void 0:v.image_name)===h.image_name&&t(Fb({nodeId:b.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:c}=t(ge.endpoints.deleteImage.initiate(s));await r(h=>ge.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t($s.util.invalidateTags([{type:"Board",id:s.board_id}]))}})},L2e=()=>{Ee({actionCreator:K5,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(ge.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),s=rj(o),{data:a}=ge.endpoints.listImages.select(s)(o),l=a?Dn.getSelectors().selectAll(a)[0]:void 0;t(fa(l||null)),t(o5(!1)),i.some(u=>u.isCanvasImage)&&t(TT()),r.forEach(u=>{var c,d;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(ET()),Mo(n().controlNet.controlNets,f=>{(f.controlImage===u.image_name||f.processedControlImage===u.image_name)&&(t(Xc({controlNetId:f.controlNetId,controlImage:null})),t(i5({controlNetId:f.controlNetId,processedControlImage:null})))}),((d=n().controlNet.ipAdapterInfo.adapterImage)==null?void 0:d.image_name)===u.image_name&&t(Ib(null)),n().nodes.nodes.forEach(f=>{Nr(f)&&Mo(f.data.inputs,h=>{var p;h.type==="ImageField"&&((p=h.value)==null?void 0:p.image_name)===u.image_name&&t(Fb({nodeId:f.data.id,fieldName:h.name,value:void 0}))})})})}catch{}}})},$2e=()=>{Ee({matcher:ge.endpoints.deleteImage.matchPending,effect:()=>{}})},F2e=()=>{Ee({matcher:ge.endpoints.deleteImage.matchFulfilled,effect:e=>{pe("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},B2e=()=>{Ee({matcher:ge.endpoints.deleteImage.matchRejected,effect:e=>{pe("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},ij=Me("dnd/dndDropped"),z2e=()=>{Ee({actionCreator:ij,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:$t(r),overData:$t(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(l0e({nodeId:o,fieldName:s.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(fa(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(L_(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROLNET_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{controlNetId:o}=i.context;t(Xc({controlImage:r.payload.imageDTO.image_name,controlNetId:o}));return}if(i.actionType==="SET_IP_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(Ib(r.payload.imageDTO));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(MD(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(Fb({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(ge.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(ge.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(ge.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(ge.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},j2e=()=>{Ee({matcher:ge.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=pe("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},U2e=()=>{Ee({matcher:ge.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=pe("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},V2e=()=>{Ee({actionCreator:ffe,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,s=Ive(n()),a=s.some(l=>l.isCanvasImage)||s.some(l=>l.isInitialImage)||s.some(l=>l.isControlNetImage)||s.some(l=>l.isIPAdapterImage)||s.some(l=>l.isNodesImage);if(o||a){t(o5(!0));return}t(K5({imageDTOs:r,imagesUsage:s}))}})},Gu={title:X("toast.imageUploaded"),status:"success"},G2e=()=>{Ee({matcher:ge.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(Mt({...Gu,...l}));else{t(ge.endpoints.addImageToBoard.initiate({board_id:s,imageDTO:i}));const{data:u}=fi.endpoints.listAllBoards.select()(o),c=u==null?void 0:u.find(f=>f.board_id===s),d=c?`${X("toast.addedToBoard")} ${c.board_name}`:`${X("toast.addedToBoard")} ${s}`;t(Mt({...Gu,description:d}))}return}if((a==null?void 0:a.type)==="SET_CANVAS_INITIAL_IMAGE"){t(MD(i)),t(Mt({...Gu,description:X("toast.setCanvasInitialImage")}));return}if((a==null?void 0:a.type)==="SET_CONTROLNET_IMAGE"){const{controlNetId:l}=a;t(Xc({controlNetId:l,controlImage:i.image_name})),t(Mt({...Gu,description:X("toast.setControlImage")}));return}if((a==null?void 0:a.type)==="SET_IP_ADAPTER_IMAGE"){t(Ib(i)),t(Mt({...Gu,description:X("toast.setIPAdapterImage")}));return}if((a==null?void 0:a.type)==="SET_INITIAL_IMAGE"){t(L_(i)),t(Mt({...Gu,description:X("toast.setInitialImage")}));return}if((a==null?void 0:a.type)==="SET_NODES_IMAGE"){const{nodeId:l,fieldName:u}=a;t(Fb({nodeId:l,fieldName:u,value:i})),t(Mt({...Gu,description:`${X("toast.setNodeField")} ${u}`}));return}}}})},q2e=()=>{Ee({matcher:ge.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=pe("images"),r={arg:{...O_(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(Mt({title:X("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},H2e=()=>{Ee({matcher:ge.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(pF(s))}})},W2e=()=>{Ee({matcher:ge.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(pF(s))}})},K2e=Me("generation/initialImageSelected"),Q2e=Me("generation/modelSelected"),X2e=()=>{Ee({actionCreator:K2e,effect:(e,{dispatch:t})=>{if(!e.payload){t(Mt(Xa({title:X("toast.imageNotLoadedDesc"),status:"error"})));return}t(L_(e.payload)),t(Mt(Xa(X("toast.sentToImageToImage"))))}})},Y2e=()=>{Ee({actionCreator:Q2e,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;Mo(i.lora.loras,(p,m)=>{p.base_model!==a&&(n(mF(m)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==a&&(n(AD(null)),c+=1);const{controlNets:f}=i.controlNet;Mo(f,(p,m)=>{var b;((b=p.model)==null?void 0:b.base_model)!==a&&(n(lF({controlNetId:m})),c+=1)});const{ipAdapterInfo:h}=i.controlNet;h.model&&h.model.base_model!==a&&(n(uF()),c+=1),c>0&&n(Mt(Xa({title:`${X("toast.baseModelChangedCleared")} ${c} ${X("toast.incompatibleSubmodel")}${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(rP(1024)),n(iP(1024)),n(oP({width:1024,height:1024}))):(n(rP(512)),n(iP(512)),n(oP({width:512,height:512})))),n(Vl(s))}})},Gg=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),MR=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),NR=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),DR=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),LR=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),$R=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),m3=Sa({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),Z2e=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,qu=e=>{const t=[];return e.forEach(n=>{const r={...Zn(n),id:Z2e(n)};t.push(r)}),t},Ol=$s.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${Cp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return MR.setAll(MR.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${Cp.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return Gg.setAll(Gg.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:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:[{type:"MainModel",id:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),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:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:[{type:"MainModel",id:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:[{type:"MainModel",id:Ot},{type:"SDXLRefinerModel",id:Ot},{type:"OnnxModel",id:Ot}]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return NR.setAll(NR.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:Ot}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:Ot}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return DR.setAll(DR.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return LR.setAll(LR.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return m3.setAll(m3.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:Ot}];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=qu(t.models);return $R.setAll($R.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${Cp.stringify(t,{})}`}),providesTags:t=>{const n=[{type:"ScannedModels",id:Ot}];return t&&n.push(...t.map(r=>({type:"ScannedModels",id:r}))),n}}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:uNe,useGetOnnxModelsQuery:cNe,useGetControlNetModelsQuery:dNe,useGetIPAdapterModelsQuery:fNe,useGetLoRAModelsQuery:hNe,useGetTextualInversionModelsQuery:pNe,useGetVaeModelsQuery:gNe,useUpdateMainModelsMutation:mNe,useDeleteMainModelsMutation:yNe,useImportMainModelsMutation:vNe,useAddMainModelsMutation:_Ne,useConvertMainModelsMutation:bNe,useMergeMainModelsMutation:SNe,useDeleteLoRAModelsMutation:wNe,useUpdateLoRAModelsMutation:xNe,useSyncModelsMutation:CNe,useGetModelsInFolderQuery:ENe,useGetCheckpointConfigsQuery:TNe}=Ol,J2e=()=>{Ee({predicate:e=>Ol.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=Gg.getSelectors().selectAll(e.payload);if(o.length===0){n(Vl(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(Vl(a.data))}}),Ee({predicate:e=>Ol.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=Gg.getSelectors().selectAll(e.payload);if(o.length===0){n(z8(null)),n(d0e(!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=xT.safeParse(o[0]);if(!a.success){r.error({error:a.error.format()},"Failed to parse SDXL Refiner Model");return}n(z8(a.data))}}),Ee({matcher:Ol.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||_p(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=m3.getSelectors().selectAll(e.payload)[0];if(!s){n(Vl(null));return}const a=Wne.safeParse(s);if(!a.success){r.error({error:a.error.format()},"Failed to parse VAE model");return}n(AD(a.data))}}),Ee({matcher:Ol.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;Mo(i,(o,s)=>{_p(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(mF(s))})}}),Ee({matcher:Ol.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;Mo(i,(o,s)=>{_p(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(lF({controlNetId:s}))})}}),Ee({matcher:Ol.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{pe("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},ewe=$s.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),twe=Xi(tre,yfe,gfe,mfe,YT),nwe=()=>{Ee({matcher:twe,effect:async(e,{dispatch:t,getState:n,cancelActiveListeners:r,delay:i})=>{r(),await i(1e3);const o=n();if(o.config.disabledFeatures.includes("dynamicPrompting"))return;const{positivePrompt:s}=o.generation,{maxPrompts:a}=o.dynamicPrompts;t(hw(!0));try{const l=t(ewe.endpoints.dynamicPrompts.initiate({prompt:s,max_prompts:a})),u=await l.unwrap();l.unsubscribe(),t(vfe(u.prompts)),t(_fe(u.error)),t(W6(!1)),t(hw(!1))}catch{t(W6(!0)),t(hw(!1))}}})},Ed=e=>e.$ref.split("/").slice(-1)[0],rwe=({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},iwe=({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},owe=({schemaObject:e,baseField:t})=>{const n=oD(e.item_default)&&Dee(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},swe=({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},awe=({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},lwe=({schemaObject:e,baseField:t})=>{const n=oD(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},uwe=({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},cwe=({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},dwe=({schemaObject:e,baseField:t})=>{const n=iD(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},fwe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),hwe=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),pwe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&Nee(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},gwe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),mwe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),ywe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),vwe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),_we=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),bwe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),Swe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),wwe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),xwe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),Cwe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),Ewe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),Twe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),Awe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),kwe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),Pwe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),Rwe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),Iwe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),Owe=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),Mwe=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),Nwe=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),Dwe=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),Lwe=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),$we=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),Fwe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),Bwe=({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]}},zwe=({baseField:e})=>({...e,type:"Collection",default:[]}),jwe=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),Uwe=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),Vwe=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),Gwe=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),qwe=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),FR=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=ioe(e.items)?e.items.type:Ed(e.items);return r0e(t)?FB[t]:void 0}else return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&Oh(t[0]))return Ed(t[0])}else if(e.anyOf){const t=e.anyOf;let n,r;if(mP(t[0])){const i=t[0].items,o=t[1];Oh(i)&&Oh(o)?(n=Ed(i),r=Ed(o)):ky(i)&&ky(o)&&(n=i.type,r=o.type)}else if(mP(t[1])){const i=t[0],o=t[1].items;Oh(i)&&Oh(o)?(n=Ed(i),r=Ed(o)):ky(i)&&ky(o)&&(n=i.type,r=o.type)}if(n===r&&i0e(n))return BB[n]}},oj={boolean:fwe,BooleanCollection:pwe,BooleanPolymorphic:hwe,ClipField:Mwe,Collection:zwe,CollectionItem:jwe,ColorCollection:Gwe,ColorField:Uwe,ColorPolymorphic:Vwe,ConditioningCollection:Iwe,ConditioningField:Pwe,ConditioningPolymorphic:Rwe,ControlCollection:$we,ControlField:Dwe,ControlNetModelField:bwe,ControlPolymorphic:Lwe,DenoiseMaskField:Ewe,enum:Bwe,float:swe,FloatCollection:lwe,FloatPolymorphic:awe,ImageCollection:Cwe,ImageField:wwe,ImagePolymorphic:xwe,integer:rwe,IntegerCollection:owe,IntegerPolymorphic:iwe,IPAdapterField:Fwe,IPAdapterModelField:Swe,LatentsCollection:kwe,LatentsField:Twe,LatentsPolymorphic:Awe,LoRAModelField:_we,MainModelField:gwe,Scheduler:qwe,SDXLMainModelField:mwe,SDXLRefinerModelField:ywe,string:uwe,StringCollection:dwe,StringPolymorphic:cwe,UNetField:Owe,VaeField:Nwe,VaeModelField:vwe},Hwe=e=>!!(e&&e in oj),Wwe=(e,t,n,r)=>{var d;const{input:i,ui_hidden:o,ui_component:s,ui_type:a,ui_order:l}=t,u={input:n0e.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(Hwe(r))return oj[r]({schemaObject:t,baseField:c})},Kwe=["id","type","metadata","use_cache"],Qwe=["type"],Xwe=["WorkflowField","MetadataField","IsIntermediate"],Ywe=["graph","metadata_accumulator"],Zwe=(e,t)=>!!(Kwe.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),Jwe=e=>!!Xwe.includes(e),exe=(e,t)=>!Qwe.includes(t),txe=e=>!Ywe.includes(e.properties.type.default),nxe=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(ooe).filter(txe).filter(s=>t?t.includes(s.properties.type.default):!0).filter(s=>n?!n.includes(s.properties.type.default):!0).reduce((s,a)=>{var y,S;const l=a.properties.type.default,u=a.title.replace("Invocation",""),c=a.tags??[],d=a.description??"",f=a.version,h=yC(a.properties,(w,x,C)=>{if(Zwe(l,C))return pe("nodes").trace({node:l,fieldName:C,field:$t(x)},"Skipped reserved input field"),w;if(!yP(x))return pe("nodes").warn({node:l,propertyName:C,property:$t(x)},"Unhandled input property"),w;const A=FR(x);if(!gP(A))return pe("nodes").warn({node:l,fieldName:C,fieldType:A,field:$t(x)},"Skipping unknown input field type"),w;if(Jwe(A))return pe("nodes").trace({node:l,fieldName:C,fieldType:A,field:$t(x)},"Skipping reserved field type"),w;const T=Wwe(a,x,C,A);return T?(w[C]=T,w):(pe("nodes").debug({node:l,fieldName:C,fieldType:A,field:$t(x)},"Skipping input field with no template"),w)},{}),p=a.output.$ref.split("/").pop();if(!p)return pe("nodes").warn({outputRefObject:$t(a.output)},"No output schema name found in ref object"),s;const m=(S=(y=e.components)==null?void 0:y.schemas)==null?void 0:S[p];if(!m)return pe("nodes").warn({outputSchemaName:p},"Output schema not found"),s;if(!soe(m))return pe("nodes").error({outputSchema:$t(m)},"Invalid output schema"),s;const b=m.properties.type.default,_=yC(m.properties,(w,x,C)=>{if(!exe(l,C))return pe("nodes").trace({type:l,propertyName:C,property:$t(x)},"Skipped reserved output field"),w;if(!yP(x))return pe("nodes").warn({type:l,propertyName:C,property:$t(x)},"Unhandled output property"),w;const A=FR(x);return gP(A)?(w[C]={fieldKind:"output",name:C,title:x.title??"",description:x.description??"",type:A,ui_hidden:x.ui_hidden??!1,ui_type:x.ui_type,ui_order:x.ui_order},w):(pe("nodes").warn({fieldName:C,fieldType:A,field:$t(x)},"Skipping unknown output field type"),w)},{}),v=a.properties.use_cache.default,g={title:u,type:l,version:f,tags:c,description:d,outputType:b,inputs:h,outputs:_,useCache:v};return Object.assign(s,{[l]:g}),s},{})},rxe=()=>{Ee({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=nxe(i,o,s);r.debug({nodeTemplates:$t(a)},`Built ${M_(a)} node templates`),t(UB(a))}}),Ee({actionCreator:Bg.rejected,effect:e=>{pe("system").error({error:$t(e.error)},"Problem retrieving OpenAPI Schema")}})},ixe=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),oxe=new Map(ixe),sxe=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],y3=new WeakSet,axe=e=>{y3.add(e);const t=e.toJSON();return y3.delete(e),t},lxe=e=>oxe.get(e)??Error,sj=({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&&BR(e)){const u=lxe(e.name);n=new u}else n={};if(t.push(e),o>=i)return n;if(s&&typeof e.toJSON=="function"&&!y3.has(e))return axe(e);const l=u=>sj({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 sxe)typeof e[u]<"u"&&e[u]!==null&&Object.defineProperty(n,u,{value:BR(e[u])?l(e[u]):e[u],enumerable:r?!0:c,configurable:!0,writable:!0});return n};function Q5(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?sj({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function BR(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const uxe=()=>{Ee({actionCreator:Em.pending,effect:()=>{}})},cxe=()=>{Ee({actionCreator:Em.fulfilled,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session canceled (${n})`)}})},dxe=()=>{Ee({actionCreator:Em.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:Q5(r)},"Problem canceling session")}}})},fxe=()=>{Ee({actionCreator:F_.pending,effect:()=>{}})},hxe=()=>{Ee({actionCreator:F_.fulfilled,effect:e=>{const t=pe("session"),n=e.payload;t.debug({session:$t(n)},`Session created (${n.id})`)}})},pxe=()=>{Ee({actionCreator:F_.rejected,effect:e=>{const t=pe("session");if(e.payload){const{error:n,status:r}=e.payload,i=$t(e.meta.arg);t.error({graph:i,status:r,error:Q5(n)},"Problem creating session")}}})},gxe=()=>{Ee({actionCreator:Cm.pending,effect:()=>{}})},mxe=()=>{Ee({actionCreator:Cm.fulfilled,effect:e=>{const t=pe("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session invoked (${n})`)}})},yxe=()=>{Ee({actionCreator:Cm.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:Q5(r)},"Problem invoking session")}}})},vxe=()=>{Ee({actionCreator:V$,effect:(e,{dispatch:t,getState:n})=>{pe("socketio").debug("Connected");const{nodes:i,config:o,system:s}=n(),{disabledTabs:a}=o;!M_(i.nodeTemplates)&&!a.includes("nodes")&&t(Bg()),s.isInitialized?t($s.util.resetApiState()):t(y0e(!0)),t(YT(e.payload))}})},_xe=()=>{Ee({actionCreator:G$,effect:(e,{dispatch:t})=>{pe("socketio").debug("Disconnected"),t(q$(e.payload))}})},bxe=()=>{Ee({actionCreator:X$,effect:(e,{dispatch:t})=>{pe("socketio").trace(e.payload,"Generator progress"),t(t5(e.payload))}})},Sxe=()=>{Ee({actionCreator:K$,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Session complete"),t(Q$(e.payload))}})},wxe=["load_image"],xxe=()=>{Ee({actionCreator:JT,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("socketio"),{data:i}=e.payload;r.debug({data:$t(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:s,queue_batch_id:a}=i;if(Xz(o)&&!wxe.includes(s.type)){const{image_name:l}=o.image,{canvas:u,gallery:c}=n(),d=await t(ge.endpoints.getImageDTO.initiate(l)).unwrap();if(u.batchIds.includes(a)&&[me].includes(i.source_node_id)&&t(wre(d)),!d.is_intermediate){const{autoAddBoardId:f}=c;t(f&&f!=="none"?ge.endpoints.addImageToBoard.initiate({board_id:f,imageDTO:d}):ge.util.updateQueryData("listImages",{board_id:"none",categories:Kr},m=>{Dn.addOne(m,d)})),t(ge.util.invalidateTags([{type:"BoardImagesTotal",id:f},{type:"BoardAssetsTotal",id:f}]));const{selectedBoardId:h,shouldAutoSwitch:p}=c;p&&(f&&f!==h?(t(zC(f)),t(h1("images"))):f||t(h1("images")),t(fa(d)))}}t(e5(e.payload))}})},Cxe=()=>{Ee({actionCreator:W$,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(Rb(e.payload))}})},Exe=()=>{Ee({actionCreator:rF,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(iF(e.payload))}})},Txe=()=>{Ee({actionCreator:H$,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(ZT(e.payload))}})},Axe=()=>{Ee({actionCreator:Y$,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(Z$(e.payload))}}),Ee({actionCreator:J$,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(eF(e.payload))}})},kxe=()=>{Ee({actionCreator:oF,effect:async(e,{dispatch:t})=>{const n=pe("socketio"),{queue_item_id:r,queue_batch_id:i,status:o}=e.payload.data;n.debug(e.payload,`Queue item ${r} status updated: ${o}`),t(n5(e.payload)),t(bi.util.updateQueryData("listQueueItems",void 0,a=>{ec.updateOne(a,{id:r,changes:e.payload.data})})),t(bi.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem",{type:"SessionQueueItem",id:r},{type:"SessionQueueItemDTO",id:r},{type:"BatchStatus",id:i}]));const s=t(bi.endpoints.getQueueStatus.initiate(void 0,{forceRefetch:!0}));await s.unwrap(),s.unsubscribe()}})},Pxe=()=>{Ee({actionCreator:tF,effect:(e,{dispatch:t})=>{pe("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(nF(e.payload))}})},Rxe=()=>{Ee({actionCreator:rfe,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Subscribed"),t(ife(e.payload))}})},Ixe=()=>{Ee({actionCreator:ofe,effect:(e,{dispatch:t})=>{pe("socketio").debug(e.payload,"Unsubscribed"),t(sfe(e.payload))}})},Oxe=()=>{Ee({actionCreator:Bve,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(ge.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(ge.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(Mt({title:X("toast.imageSaved"),status:"success"}))}catch(i){t(Mt({title:X("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},ANe=["sd-1","sd-2","sdxl","sdxl-refiner"],Mxe=["sd-1","sd-2","sdxl"],kNe=["sdxl"],PNe=["sd-1","sd-2"],RNe=["sdxl-refiner"],Nxe=()=>{Ee({actionCreator:nz,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(Ol.endpoints.getMainModels.initiate(Mxe)),a=await s.unwrap();if(s.unsubscribe(),!a.ids.length){n(Vl(null));return}const u=Gg.getSelectors().selectAll(a).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n(Vl(null));return}const{base_model:c,model_name:d,model_type:f}=u;n(Vl({base_model:c,model_name:d,model_type:f}))}catch{n(Vl(null))}}}})},Dxe=({image_name:e,esrganModelName:t})=>{const n={id:$w,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},r={id:As,type:"save_image",use_cache:!1};return{id:"adhoc-esrgan-graph",nodes:{[$w]:n,[As]:r},edges:[{source:{node_id:$w,field:"image"},destination:{node_id:As,field:"image"}}]}},Lxe=Me("upscale/upscaleRequested"),$xe=()=>{Ee({actionCreator:Lxe,effect:async(e,{dispatch:t,getState:n})=>{const r=pe("session"),{image_name:i}=e.payload,{esrganModelName:o}=n().postprocessing,s=Dxe({image_name:i,esrganModelName:o});try{const a=t(bi.endpoints.enqueueGraph.initiate({graph:s,prepend:!0},{fixedCacheKey:"enqueueGraph"})),l=await a.unwrap();a.reset(),r.debug({enqueueResult:$t(l)},X("queue.graphQueued"))}catch{r.error({graph:$t(s)},X("queue.graphFailedToQueue")),t(Mt({title:X("queue.graphFailedToQueue"),status:"error"}))}}})},Fxe=xa(null),Bxe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,zR=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Bxe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},jR=e=>e==="*"||e==="x"||e==="X",UR=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},zxe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],jxe=(e,t)=>{if(jR(e)||jR(t))return 0;const[n,r]=zxe(UR(e),UR(t));return n>r?1:n<r?-1:0},VR=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=jxe(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},Uxe=(e,t)=>{const n=zR(e),r=zR(t),i=n.pop(),o=r.pop(),s=VR(n,r);return s!==0?s:i&&o?VR(i.split("."),o.split(".")):i||o?i?-1:1:0},Vxe=(e,t)=>{const n=Zn(e),{nodes:r,edges:i}=n,o=[],s=r.filter(wC),a=wT(s,"id");return r.forEach(l=>{if(!wC(l))return;const u=t[l.data.type];if(!u){o.push({message:`${we.t("nodes.node")} "${l.data.type}" ${we.t("nodes.skipped")}`,issues:[`${we.t("nodes.nodeType")}"${l.data.type}" ${we.t("nodes.doesNotExist")}`],data:l});return}if(u.version&&l.data.version&&Uxe(u.version,l.data.version)!==0){o.push({message:`${we.t("nodes.node")} "${l.data.type}" ${we.t("nodes.mismatchedVersion")}`,issues:[`${we.t("nodes.node")} "${l.data.type}" v${l.data.version} ${we.t("nodes.maybeIncompatible")} v${u.version}`],data:{node:l,nodeTemplate:$t(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(`${we.t("nodes.outputNode")} "${l.source}.${l.sourceHandle}" ${we.t("nodes.doesNotExist")}`):f.push(`${we.t("nodes.outputNode")} ${l.source} ${we.t("nodes.doesNotExist")}`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`${we.t("nodes.inputField")} "${l.target}.${l.targetHandle}" ${we.t("nodes.doesNotExist")}`):f.push(`${we.t("nodes.inputNode")} ${l.target} ${we.t("nodes.doesNotExist")}`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${we.t("nodes.sourceNode")} "${l.source}" ${we.t("nodes.missingTemplate")} "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${we.t("nodes.sourceNode")}"${l.target}" ${we.t("nodes.missingTemplate")} "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},Gxe=()=>{Ee({actionCreator:vve,effect:(e,{dispatch:t,getState:n})=>{const r=pe("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:s,errors:a}=Vxe(i,o);t(a0e(s)),a.length?(t(Mt(Xa({title:X("toast.loadedWithWarnings"),status:"warning"}))),a.forEach(({message:l,...u})=>{r.warn(u,l)})):t(Mt(Xa({title:X("toast.workflowLoaded"),status:"success"}))),t(nz("nodes")),requestAnimationFrame(()=>{var l;(l=Fxe.get())==null||l.fitView()})}})},aj=GN(),Ee=aj.startListening;G2e();q2e();X2e();D2e();L2e();$2e();F2e();B2e();Ove();V2e();H2e();W2e();v2e();O2e();x2e();Ave();JSe();QSe();Kve();XSe();Wve();qve();ZSe();Oxe();Cve();bxe();Sxe();xxe();Cxe();Txe();vxe();_xe();Rxe();Ixe();Axe();Pxe();Exe();kxe();fxe();hxe();pxe();gxe();mxe();yxe();uxe();cxe();dxe();r2e();t2e();M2e();N2e();j2e();U2e();Mve();rxe();Gxe();z2e();Y2e();Rve();J2e();kve();Eve();$xe();Nxe();nwe();const qxe={canvas:Pre,gallery:Sfe,generation:rre,nodes:u0e,postprocessing:c0e,system:v0e,config:$te,ui:A0e,hotkeys:T0e,controlNet:cfe,dynamicPrompts:bfe,deleteImageModal:hfe,changeBoardModal:Ire,lora:Cfe,modelmanager:E0e,sdxl:f0e,queue:x0e,[$s.reducerPath]:$s.reducer},Hxe=th(qxe),Wxe=Z0e(Hxe),Kxe=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlNet","dynamicPrompts","lora","modelmanager"],lj=CN({reducer:Wxe,enhancers:e=>e.concat(J0e(window.localStorage,Kxe,{persistDebounce:300,serialize:dve,unserialize:hve,prefix:eve})).concat(HN()),middleware:e=>e({serializableCheck:!1,immutableCheck:!1}).concat($s.middleware).concat(I0e).prepend(aj.middleware),devTools:{actionSanitizer:_ve,stateSanitizer:Sve,trace:!0,predicate:(e,t)=>!bve.includes(t.type)}}),Qxe=e=>e;$D.set(lj);const Xxe=e=>{const{socket:t,storeApi:n}=e,{dispatch:r}=n;t.on("connect",()=>{pe("socketio").debug("Connected"),r(V$());const o=pr.get();t.emit("subscribe_queue",{queue_id:o})}),t.on("connect_error",i=>{i&&i.message&&i.data==="ERR_UNAUTHENTICATED"&&r(Mt(Xa({title:i.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(G$())}),t.on("invocation_started",i=>{r(H$({data:i}))}),t.on("generator_progress",i=>{r(X$({data:i}))}),t.on("invocation_error",i=>{r(W$({data:i}))}),t.on("invocation_complete",i=>{r(JT({data:i}))}),t.on("graph_execution_state_complete",i=>{r(K$({data:i}))}),t.on("model_load_started",i=>{r(Y$({data:i}))}),t.on("model_load_completed",i=>{r(J$({data:i}))}),t.on("session_retrieval_error",i=>{r(tF({data:i}))}),t.on("invocation_retrieval_error",i=>{r(rF({data:i}))}),t.on("queue_item_status_changed",i=>{r(oF({data:i}))})},_a=Object.create(null);_a.open="0";_a.close="1";_a.ping="2";_a.pong="3";_a.message="4";_a.upgrade="5";_a.noop="6";const U0=Object.create(null);Object.keys(_a).forEach(e=>{U0[_a[e]]=e});const v3={type:"error",data:"parser error"},uj=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",cj=typeof ArrayBuffer=="function",dj=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,X5=({type:e,data:t},n,r)=>uj&&t instanceof Blob?n?r(t):GR(t,r):cj&&(t instanceof ArrayBuffer||dj(t))?n?r(t):GR(new Blob([t]),r):r(_a[e]+(t||"")),GR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function qR(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Bw;function Yxe(e,t){if(uj&&e.data instanceof Blob)return e.data.arrayBuffer().then(qR).then(t);if(cj&&(e.data instanceof ArrayBuffer||dj(e.data)))return t(qR(e.data));X5(e,!1,n=>{Bw||(Bw=new TextEncoder),t(Bw.encode(n))})}const HR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ip=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<HR.length;e++)ip[HR.charCodeAt(e)]=e;const Zxe=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=ip[e.charCodeAt(r)],s=ip[e.charCodeAt(r+1)],a=ip[e.charCodeAt(r+2)],l=ip[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},Jxe=typeof ArrayBuffer=="function",Y5=(e,t)=>{if(typeof e!="string")return{type:"message",data:fj(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:eCe(e.substring(1),t)}:U0[n]?e.length>1?{type:U0[n],data:e.substring(1)}:{type:U0[n]}:v3},eCe=(e,t)=>{if(Jxe){const n=Zxe(e);return fj(n,t)}else return{base64:!0,data:e}},fj=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},hj=String.fromCharCode(30),tCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{X5(o,!1,a=>{r[s]=a,++i===n&&t(r.join(hj))})})},nCe=(e,t)=>{const n=e.split(hj),r=[];for(let i=0;i<n.length;i++){const o=Y5(n[i],t);if(r.push(o),o.type==="error")break}return r};function rCe(){return new TransformStream({transform(e,t){Yxe(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 zw;function i0(e){return e.reduce((t,n)=>t+n.length,0)}function o0(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 iCe(e,t){zw||(zw=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(i0(n)<1)break;const l=o0(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(i0(n)<2)break;const l=o0(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(i0(n)<8)break;const l=o0(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(v3);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(i0(n)<i)break;const l=o0(n,i);a.enqueue(Y5(o?l:zw.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(v3);break}}}})}const pj=4;function Pr(e){if(e)return oCe(e)}function oCe(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 gj(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sCe=Ko.setTimeout,aCe=Ko.clearTimeout;function FS(e,t){t.useNativeTimers?(e.setTimeoutFn=sCe.bind(Ko),e.clearTimeoutFn=aCe.bind(Ko)):(e.setTimeoutFn=Ko.setTimeout.bind(Ko),e.clearTimeoutFn=Ko.clearTimeout.bind(Ko))}const lCe=1.33;function uCe(e){return typeof e=="string"?cCe(e):Math.ceil((e.byteLength||e.size)*lCe)}function cCe(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 dCe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function fCe(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 hCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Z5 extends Pr{constructor(t){super(),this.writable=!1,FS(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new hCe(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=Y5(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=dCe(t);return n.length?"?"+n:""}}const mj="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),_3=64,pCe={};let WR=0,s0=0,KR;function QR(e){let t="";do t=mj[e%_3]+t,e=Math.floor(e/_3);while(e>0);return t}function yj(){const e=QR(+new Date);return e!==KR?(WR=0,KR=e):e+"."+QR(WR++)}for(;s0<_3;s0++)pCe[mj[s0]]=s0;let vj=!1;try{vj=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const gCe=vj;function _j(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||gCe))return new XMLHttpRequest}catch{}if(!t)try{return new Ko[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function mCe(){}const yCe=function(){return new _j({xdomain:!1}).responseType!=null}();class vCe extends Z5{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=yCe&&!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)};nCe(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,tCe(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]=yj()),!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 _f(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 _f=class V0 extends Pr{constructor(t,n){super(),FS(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=gj(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new _j(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=V0.requestsCount++,V0.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=mCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete V0.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()}};_f.requestsCount=0;_f.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",XR);else if(typeof addEventListener=="function"){const e="onpagehide"in Ko?"pagehide":"unload";addEventListener(e,XR,!1)}}function XR(){for(let e in _f.requests)_f.requests.hasOwnProperty(e)&&_f.requests[e].abort()}const J5=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),a0=Ko.WebSocket||Ko.MozWebSocket,YR=!0,_Ce="arraybuffer",ZR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bCe extends Z5{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?{}:gj(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=YR&&!ZR?n?new a0(t,n):new a0(t):new a0(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;X5(r,this.supportsBinary,o=>{const s={};try{YR&&this.ws.send(o)}catch{}i&&J5(()=>{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]=yj()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!a0}}class SCe extends Z5{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=iCe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=rCe();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&&J5(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const wCe={websocket:bCe,webtransport:SCe,polling:vCe},xCe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CCe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function b3(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=xCe.exec(e||""),o={},s=14;for(;s--;)o[CCe[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=ECe(o,o.path),o.queryKey=TCe(o,o.query),o}function ECe(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 TCe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let bj=class Id extends Pr{constructor(t,n={}){super(),this.binaryType=_Ce,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=b3(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=b3(n.host).host),FS(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=fCe(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=pj,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 wCe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Id.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;Id.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;Id.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",Id.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+=uCe(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){Id.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}};bj.protocol=pj;function ACe(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=b3(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 kCe=typeof ArrayBuffer=="function",PCe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Sj=Object.prototype.toString,RCe=typeof Blob=="function"||typeof Blob<"u"&&Sj.call(Blob)==="[object BlobConstructor]",ICe=typeof File=="function"||typeof File<"u"&&Sj.call(File)==="[object FileConstructor]";function e4(e){return kCe&&(e instanceof ArrayBuffer||PCe(e))||RCe&&e instanceof Blob||ICe&&e instanceof File}function G0(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(G0(e[n]))return!0;return!1}if(e4(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return G0(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&G0(e[n]))return!0;return!1}function OCe(e){const t=[],n=e.data,r=e;return r.data=S3(n,t),r.attachments=t.length,{packet:r,buffers:t}}function S3(e,t){if(!e)return e;if(e4(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]=S3(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]=S3(e[r],t));return n}return e}function MCe(e,t){return e.data=w3(e.data,t),delete e.attachments,e}function w3(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]=w3(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=w3(e[n],t));return e}const NCe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],DCe=5;var Dt;(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"})(Dt||(Dt={}));class LCe{constructor(t){this.replacer=t}encode(t){return(t.type===Dt.EVENT||t.type===Dt.ACK)&&G0(t)?this.encodeAsBinary({type:t.type===Dt.EVENT?Dt.BINARY_EVENT:Dt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Dt.BINARY_EVENT||t.type===Dt.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=OCe(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function JR(e){return Object.prototype.toString.call(e)==="[object Object]"}class t4 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===Dt.BINARY_EVENT;r||n.type===Dt.BINARY_ACK?(n.type=r?Dt.EVENT:Dt.ACK,this.reconstructor=new $Ce(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(e4(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(Dt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Dt.BINARY_EVENT||r.type===Dt.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(t4.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 Dt.CONNECT:return JR(n);case Dt.DISCONNECT:return n===void 0;case Dt.CONNECT_ERROR:return typeof n=="string"||JR(n);case Dt.EVENT:case Dt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&NCe.indexOf(n[0])===-1);case Dt.ACK:case Dt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class $Ce{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=MCe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const FCe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:t4,Encoder:LCe,get PacketType(){return Dt},protocol:DCe},Symbol.toStringTag,{value:"Module"}));function _s(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const BCe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wj 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(BCe.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:Dt.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:Dt.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 Dt.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 Dt.EVENT:case Dt.BINARY_EVENT:this.onevent(t);break;case Dt.ACK:case Dt.BINARY_ACK:this.onack(t);break;case Dt.DISCONNECT:this.ondisconnect();break;case Dt.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:Dt.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:Dt.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 yh(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}yh.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};yh.prototype.reset=function(){this.attempts=0};yh.prototype.setMin=function(e){this.ms=e};yh.prototype.setMax=function(e){this.max=e};yh.prototype.setJitter=function(e){this.jitter=e};class x3 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,FS(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 yh({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||FCe;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 bj(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){J5(()=>{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 wj(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 q0(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ACe(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 x3(r,t):(qh[i]||(qh[i]=new x3(r,t)),l=qh[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(q0,{Manager:x3,Socket:wj,io:q0,connect:q0});const eI=()=>{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=Lf.get();a&&(r.auth={token:a}),r.transports=["websocket","polling"]}const i=q0(n,r);return s=>a=>l=>{e||(Xxe({storeApi:s,socket:i}),e=!0,i.connect()),a(l)}};function zCe(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 jCe(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 UCe=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(jCe(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=zCe(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}(),ki="-ms-",I1="-moz-",nn="-webkit-",xj="comm",n4="rule",r4="decl",VCe="@import",Cj="@keyframes",GCe="@layer",qCe=Math.abs,BS=String.fromCharCode,HCe=Object.assign;function WCe(e,t){return yi(e,0)^45?(((t<<2^yi(e,0))<<2^yi(e,1))<<2^yi(e,2))<<2^yi(e,3):0}function Ej(e){return e.trim()}function KCe(e,t){return(e=t.exec(e))?e[0]:e}function rn(e,t,n){return e.replace(t,n)}function C3(e,t){return e.indexOf(t)}function yi(e,t){return e.charCodeAt(t)|0}function qg(e,t,n){return e.slice(t,n)}function Zs(e){return e.length}function i4(e){return e.length}function l0(e,t){return t.push(e),e}function QCe(e,t){return e.map(t).join("")}var zS=1,Qf=1,Tj=0,mo=0,Ar=0,vh="";function jS(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:zS,column:Qf,length:s,return:""}}function Hh(e,t){return HCe(jS("",null,null,"",null,null,0),e,{length:-e.length},t)}function XCe(){return Ar}function YCe(){return Ar=mo>0?yi(vh,--mo):0,Qf--,Ar===10&&(Qf=1,zS--),Ar}function Ro(){return Ar=mo<Tj?yi(vh,mo++):0,Qf++,Ar===10&&(Qf=1,zS++),Ar}function pa(){return yi(vh,mo)}function H0(){return mo}function qm(e,t){return qg(vh,e,t)}function Hg(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 Aj(e){return zS=Qf=1,Tj=Zs(vh=e),mo=0,[]}function kj(e){return vh="",e}function W0(e){return Ej(qm(mo-1,E3(e===91?e+2:e===40?e+1:e)))}function ZCe(e){for(;(Ar=pa())&&Ar<33;)Ro();return Hg(e)>2||Hg(Ar)>3?"":" "}function JCe(e,t){for(;--t&&Ro()&&!(Ar<48||Ar>102||Ar>57&&Ar<65||Ar>70&&Ar<97););return qm(e,H0()+(t<6&&pa()==32&&Ro()==32))}function E3(e){for(;Ro();)switch(Ar){case e:return mo;case 34:case 39:e!==34&&e!==39&&E3(Ar);break;case 40:e===41&&E3(e);break;case 92:Ro();break}return mo}function e3e(e,t){for(;Ro()&&e+Ar!==47+10;)if(e+Ar===42+42&&pa()===47)break;return"/*"+qm(t,mo-1)+"*"+BS(e===47?e:Ro())}function t3e(e){for(;!Hg(pa());)Ro();return qm(e,mo)}function n3e(e){return kj(K0("",null,null,null,[""],e=Aj(e),0,[0],e))}function K0(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,v=0,g="",y=i,S=o,w=r,x=g;b;)switch(p=v,v=Ro()){case 40:if(p!=108&&yi(x,d-1)==58){C3(x+=rn(W0(v),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:x+=W0(v);break;case 9:case 10:case 13:case 32:x+=ZCe(p);break;case 92:x+=JCe(H0()-1,7);continue;case 47:switch(pa()){case 42:case 47:l0(r3e(e3e(Ro(),H0()),t,n),l);break;default:x+="/"}break;case 123*m:a[u++]=Zs(x)*_;case 125*m:case 59:case 0:switch(v){case 0:case 125:b=0;case 59+c:_==-1&&(x=rn(x,/\f/g,"")),h>0&&Zs(x)-d&&l0(h>32?nI(x+";",r,n,d-1):nI(rn(x," ","")+";",r,n,d-2),l);break;case 59:x+=";";default:if(l0(w=tI(x,t,n,u,c,i,a,g,y=[],S=[],d),o),v===123)if(c===0)K0(x,t,w,w,y,o,d,a,S);else switch(f===99&&yi(x,3)===110?100:f){case 100:case 108:case 109:case 115:K0(e,w,w,r&&l0(tI(e,w,w,0,0,i,a,g,i,y=[],d),S),i,S,d,a,r?y:S);break;default:K0(x,w,w,w,[""],S,0,a,S)}}u=c=h=0,m=_=1,g=x="",d=s;break;case 58:d=1+Zs(x),h=p;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&YCe()==125)continue}switch(x+=BS(v),v*m){case 38:_=c>0?1:(x+="\f",-1);break;case 44:a[u++]=(Zs(x)-1)*_,_=1;break;case 64:pa()===45&&(x+=W0(Ro())),f=pa(),c=d=Zs(g=x+=t3e(H0())),v++;break;case 45:p===45&&Zs(x)==2&&(m=0)}}return o}function tI(e,t,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],h=i4(f),p=0,m=0,b=0;p<r;++p)for(var _=0,v=qg(e,d+1,d=qCe(m=s[p])),g=e;_<h;++_)(g=Ej(m>0?f[_]+" "+v:rn(v,/&\f/g,f[_])))&&(l[b++]=g);return jS(e,t,n,i===0?n4:a,l,u,c)}function r3e(e,t,n){return jS(e,t,n,xj,BS(XCe()),qg(e,2,-2),0)}function nI(e,t,n,r){return jS(e,t,n,r4,qg(e,0,r),qg(e,r+1,-1),r)}function bf(e,t){for(var n="",r=i4(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function i3e(e,t,n,r){switch(e.type){case GCe:if(e.children.length)break;case VCe:case r4:return e.return=e.return||e.value;case xj:return"";case Cj:return e.return=e.value+"{"+bf(e.children,r)+"}";case n4:e.value=e.props.join(",")}return Zs(n=bf(e.children,r))?e.return=e.value+"{"+n+"}":""}function o3e(e){var t=i4(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 s3e(e){return function(t){t.root||(t=t.return)&&e(t)}}var rI=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 Pj(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var a3e=function(t,n,r){for(var i=0,o=0;i=o,o=pa(),i===38&&o===12&&(n[r]=1),!Hg(o);)Ro();return qm(t,mo)},l3e=function(t,n){var r=-1,i=44;do switch(Hg(i)){case 0:i===38&&pa()===12&&(n[r]=1),t[r]+=a3e(mo-1,n,r);break;case 2:t[r]+=W0(i);break;case 4:if(i===44){t[++r]=pa()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=BS(i)}while(i=Ro());return t},u3e=function(t,n){return kj(l3e(Aj(t),n))},iI=new WeakMap,c3e=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&&!iI.get(r))&&!i){iI.set(t,!0);for(var o=[],s=u3e(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]}}},d3e=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Rj(e,t){switch(WCe(e,t)){case 5103:return nn+"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 nn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return nn+e+I1+e+ki+e+e;case 6828:case 4268:return nn+e+ki+e+e;case 6165:return nn+e+ki+"flex-"+e+e;case 5187:return nn+e+rn(e,/(\w+).+(:[^]+)/,nn+"box-$1$2"+ki+"flex-$1$2")+e;case 5443:return nn+e+ki+"flex-item-"+rn(e,/flex-|-self/,"")+e;case 4675:return nn+e+ki+"flex-line-pack"+rn(e,/align-content|flex-|-self/,"")+e;case 5548:return nn+e+ki+rn(e,"shrink","negative")+e;case 5292:return nn+e+ki+rn(e,"basis","preferred-size")+e;case 6060:return nn+"box-"+rn(e,"-grow","")+nn+e+ki+rn(e,"grow","positive")+e;case 4554:return nn+rn(e,/([^-])(transform)/g,"$1"+nn+"$2")+e;case 6187:return rn(rn(rn(e,/(zoom-|grab)/,nn+"$1"),/(image-set)/,nn+"$1"),e,"")+e;case 5495:case 3959:return rn(e,/(image-set\([^]*)/,nn+"$1$`$1");case 4968:return rn(rn(e,/(.+:)(flex-)?(.*)/,nn+"box-pack:$3"+ki+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nn+e+e;case 4095:case 3583:case 4068:case 2532:return rn(e,/(.+)-inline(.+)/,nn+"$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(Zs(e)-1-t>6)switch(yi(e,t+1)){case 109:if(yi(e,t+4)!==45)break;case 102:return rn(e,/(.+:)(.+)-([^]+)/,"$1"+nn+"$2-$3$1"+I1+(yi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~C3(e,"stretch")?Rj(rn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(yi(e,t+1)!==115)break;case 6444:switch(yi(e,Zs(e)-3-(~C3(e,"!important")&&10))){case 107:return rn(e,":",":"+nn)+e;case 101:return rn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nn+(yi(e,14)===45?"inline-":"")+"box$3$1"+nn+"$2$3$1"+ki+"$2box$3")+e}break;case 5936:switch(yi(e,t+11)){case 114:return nn+e+ki+rn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return nn+e+ki+rn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return nn+e+ki+rn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return nn+e+ki+e+e}return e}var f3e=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case r4:t.return=Rj(t.value,t.length);break;case Cj:return bf([Hh(t,{value:rn(t.value,"@","@"+nn)})],i);case n4:if(t.length)return QCe(t.props,function(o){switch(KCe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return bf([Hh(t,{props:[rn(o,/:(read-\w+)/,":"+I1+"$1")]})],i);case"::placeholder":return bf([Hh(t,{props:[rn(o,/:(plac\w+)/,":"+nn+"input-$1")]}),Hh(t,{props:[rn(o,/:(plac\w+)/,":"+I1+"$1")]}),Hh(t,{props:[rn(o,/:(plac\w+)/,ki+"input-$1")]})],i)}return""})}},h3e=[f3e],p3e=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||h3e,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=[c3e,d3e];{var c,d=[i3e,s3e(function(m){c.insert(m)})],f=o3e(u.concat(i,d)),h=function(b){return bf(n3e(b),f)};l=function(b,_,v,g){c=v,h(b?b+"{"+_.styles+"}":_.styles),g&&(p.inserted[_.name]=!0)}}var p={key:n,sheet:new UCe({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},g3e=!0;function m3e(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Ij=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||g3e===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Oj=function(t,n,r){Ij(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 y3e(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 v3e={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},_3e=/[A-Z]|^ms/g,b3e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Mj=function(t){return t.charCodeAt(1)===45},oI=function(t){return t!=null&&typeof t!="boolean"},jw=Pj(function(e){return Mj(e)?e:e.replace(_3e,"-$&").toLowerCase()}),sI=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(b3e,function(r,i,o){return Js={name:i,styles:o,next:Js},i})}return v3e[t]!==1&&!Mj(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 Js={name:n.name,styles:n.styles,next:Js},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Js={name:r.name,styles:r.styles,next:Js},r=r.next;var i=n.styles+";";return i}return S3e(e,t,n)}case"function":{if(e!==void 0){var o=Js,s=n(e);return Js=o,Wg(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function S3e(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]+"}":oI(s)&&(r+=jw(o)+":"+sI(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++)oI(s[a])&&(r+=jw(o)+":"+sI(o,s[a])+";");else{var l=Wg(e,t,s);switch(o){case"animation":case"animationName":{r+=jw(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var aI=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Js,o4=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="";Js=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]);aI.lastIndex=0;for(var l="",u;(u=aI.exec(o))!==null;)l+="-"+u[1];var c=y3e(o)+l;return{name:c,styles:o,next:Js}},w3e=function(t){return t()},Nj=H4["useInsertionEffect"]?H4["useInsertionEffect"]:!1,x3e=Nj||w3e,lI=Nj||M.useLayoutEffect,Dj=M.createContext(typeof HTMLElement<"u"?p3e({key:"css"}):null);Dj.Provider;var Lj=function(t){return M.forwardRef(function(n,r){var i=M.useContext(Dj);return t(n,i,r)})},Kg=M.createContext({}),C3e=function(t,n){if(typeof n=="function"){var r=n(t);return r}return u1({},t,n)},E3e=rI(function(e){return rI(function(t){return C3e(e,t)})}),INe=function(t){var n=M.useContext(Kg);return t.theme!==n&&(n=E3e(n)(t.theme)),M.createElement(Kg.Provider,{value:n},t.children)},ONe=Lj(function(e,t){var n=e.styles,r=o4([n],void 0,M.useContext(Kg)),i=M.useRef();return lI(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]),lI(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&Oj(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 T3e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o4(t)}var A3e=function(){var t=T3e.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_"}}},k3e=globalThis!=null&&globalThis.document?M.useLayoutEffect:M.useEffect;function $j(){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 Fj=M.createContext({});Fj.displayName="ColorModeContext";function s4(){const e=M.useContext(Fj);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function MNe(e,t){const{colorMode:n}=s4();return n==="dark"?t:e}function P3e(){const e=s4(),t=$j();return{...e,theme:t}}function R3e(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 I3e(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 NNe(e,t,n){const r=$j();return O3e(e,t,n)(r)}function O3e(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 R3e(o,l,(c=s[u])!=null?c:l);const f=`${e}.${l}`;return I3e(o,f,(d=s[u])!=null?d:l)});return Array.isArray(t)?a:a[0]}}var a4=(...e)=>e.filter(Boolean).join(" ");function M3e(){return!1}function Za(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var DNe=e=>{const{condition:t,message:n}=e;t&&M3e()&&console.warn(n)};function hc(e,...t){return N3e(e)?e(...t):e}var N3e=e=>typeof e=="function",LNe=e=>e?"":void 0,$Ne=e=>e?!0:void 0;function FNe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function BNe(...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]",v="[object Object]",g="[object Proxy]",y="[object RegExp]",S="[object Set]",w="[object String]",x="[object Undefined]",C="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",P="[object Float32Array]",L="[object Float64Array]",R="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",$="[object Uint8ClampedArray]",O="[object Uint16Array]",I="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,G={};G[P]=G[L]=G[R]=G[E]=G[k]=G[D]=G[$]=G[O]=G[I]=!0,G[a]=G[l]=G[A]=G[c]=G[T]=G[d]=G[f]=G[h]=G[m]=G[b]=G[v]=G[y]=G[S]=G[w]=G[C]=!1;var Q=typeof ft=="object"&&ft&&ft.Object===Object&&ft,Z=typeof self=="object"&&self&&self.Object===Object&&self,Y=Q||Z||Function("return this")(),j=t&&!t.nodeType&&t,W=j&&!0&&e&&!e.nodeType&&e,te=W&&W.exports===j,oe=te&&Q.process,ye=function(){try{var F=W&&W.require&&W.require("util").types;return F||oe&&oe.binding&&oe.binding("util")}catch{}}(),le=ye&&ye.isTypedArray;function pt(F,V,K){switch(K.length){case 0:return F.call(V);case 1:return F.call(V,K[0]);case 2:return F.call(V,K[0],K[1]);case 3:return F.call(V,K[0],K[1],K[2])}return F.apply(V,K)}function nt(F,V){for(var K=-1,fe=Array(F);++K<F;)fe[K]=V(K);return fe}function Fe(F){return function(V){return F(V)}}function ct(F,V){return F==null?void 0:F[V]}function ke(F,V){return function(K){return F(V(K))}}var Qt=Array.prototype,br=Function.prototype,kn=Object.prototype,bn=Y["__core-js_shared__"],Xt=br.toString,Pn=kn.hasOwnProperty,Sr=function(){var F=/[^.]+$/.exec(bn&&bn.keys&&bn.keys.IE_PROTO||"");return F?"Symbol(src)_1."+F:""}(),Ji=kn.toString,Vr=Xt.call(Object),or=RegExp("^"+Xt.call(Pn).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ir=te?Y.Buffer:void 0,Gr=Y.Symbol,Rn=Y.Uint8Array,hn=Ir?Ir.allocUnsafe:void 0,wi=ke(Object.getPrototypeOf,Object),ii=Object.create,Bi=kn.propertyIsEnumerable,fs=Qt.splice,wr=Gr?Gr.toStringTag:void 0,eo=function(){try{var F=Xn(Object,"defineProperty");return F({},"",{}),F}catch{}}(),Aa=Ir?Ir.isBuffer:void 0,vo=Math.max,ka=Date.now,In=Xn(Y,"Map"),Yt=Xn(Object,"create"),Or=function(){function F(){}return function(V){if(!We(V))return{};if(ii)return ii(V);F.prototype=V;var K=new F;return F.prototype=void 0,K}}();function xr(F){var V=-1,K=F==null?0:F.length;for(this.clear();++V<K;){var fe=F[V];this.set(fe[0],fe[1])}}function Cr(){this.__data__=Yt?Yt(null):{},this.size=0}function qr(F){var V=this.has(F)&&delete this.__data__[F];return this.size-=V?1:0,V}function xi(F){var V=this.__data__;if(Yt){var K=V[F];return K===r?void 0:K}return Pn.call(V,F)?V[F]:void 0}function to(F){var V=this.__data__;return Yt?V[F]!==void 0:Pn.call(V,F)}function oi(F,V){var K=this.__data__;return this.size+=this.has(F)?0:1,K[F]=Yt&&V===void 0?r:V,this}xr.prototype.clear=Cr,xr.prototype.delete=qr,xr.prototype.get=xi,xr.prototype.has=to,xr.prototype.set=oi;function Mr(F){var V=-1,K=F==null?0:F.length;for(this.clear();++V<K;){var fe=F[V];this.set(fe[0],fe[1])}}function hs(){this.__data__=[],this.size=0}function Us(F){var V=this.__data__,K=Qe(V,F);if(K<0)return!1;var fe=V.length-1;return K==fe?V.pop():fs.call(V,K,1),--this.size,!0}function si(F){var V=this.__data__,K=Qe(V,F);return K<0?void 0:V[K][1]}function vl(F){return Qe(this.__data__,F)>-1}function Bo(F,V){var K=this.__data__,fe=Qe(K,F);return fe<0?(++this.size,K.push([F,V])):K[fe][1]=V,this}Mr.prototype.clear=hs,Mr.prototype.delete=Us,Mr.prototype.get=si,Mr.prototype.has=vl,Mr.prototype.set=Bo;function Hr(F){var V=-1,K=F==null?0:F.length;for(this.clear();++V<K;){var fe=F[V];this.set(fe[0],fe[1])}}function Pa(){this.size=0,this.__data__={hash:new xr,map:new(In||Mr),string:new xr}}function H(F){var V=Zt(this,F).delete(F);return this.size-=V?1:0,V}function ee(F){return Zt(this,F).get(F)}function ne(F){return Zt(this,F).has(F)}function ue(F,V){var K=Zt(this,F),fe=K.size;return K.set(F,V),this.size+=K.size==fe?0:1,this}Hr.prototype.clear=Pa,Hr.prototype.delete=H,Hr.prototype.get=ee,Hr.prototype.has=ne,Hr.prototype.set=ue;function ie(F){var V=this.__data__=new Mr(F);this.size=V.size}function Be(){this.__data__=new Mr,this.size=0}function Ue(F){var V=this.__data__,K=V.delete(F);return this.size=V.size,K}function ot(F){return this.__data__.get(F)}function Ne(F){return this.__data__.has(F)}function Ve(F,V){var K=this.__data__;if(K instanceof Mr){var fe=K.__data__;if(!In||fe.length<n-1)return fe.push([F,V]),this.size=++K.size,this;K=this.__data__=new Hr(fe)}return K.set(F,V),this.size=K.size,this}ie.prototype.clear=Be,ie.prototype.delete=Ue,ie.prototype.get=ot,ie.prototype.has=Ne,ie.prototype.set=Ve;function Pe(F,V){var K=ae(F),fe=!K&&be(F),St=!K&&!fe&&he(F),ln=!K&&!fe&&!St&&Bt(F),wn=K||fe||St||ln,Tt=wn?nt(F.length,String):[],mn=Tt.length;for(var ui in F)(V||Pn.call(F,ui))&&!(wn&&(ui=="length"||St&&(ui=="offset"||ui=="parent")||ln&&(ui=="buffer"||ui=="byteLength"||ui=="byteOffset")||pn(ui,mn)))&&Tt.push(ui);return Tt}function re(F,V,K){(K!==void 0&&!je(F[V],K)||K===void 0&&!(V in F))&&Xe(F,V,K)}function ve(F,V,K){var fe=F[V];(!(Pn.call(F,V)&&je(fe,K))||K===void 0&&!(V in F))&&Xe(F,V,K)}function Qe(F,V){for(var K=F.length;K--;)if(je(F[K][0],V))return K;return-1}function Xe(F,V,K){V=="__proto__"&&eo?eo(F,V,{configurable:!0,enumerable:!0,value:K,writable:!0}):F[V]=K}var st=an();function at(F){return F==null?F===void 0?x:_:wr&&wr in Object(F)?hr(F):_e(F)}function mt(F){return Ae(F)&&at(F)==a}function bt(F){if(!We(F)||gn(F))return!1;var V=Se(F)?or:B;return V.test(lt(F))}function xt(F){return Ae(F)&&Ze(F.length)&&!!G[at(F)]}function on(F){if(!We(F))return un(F);var V=Jt(F),K=[];for(var fe in F)fe=="constructor"&&(V||!Pn.call(F,fe))||K.push(fe);return K}function sn(F,V,K,fe,St){F!==V&&st(V,function(ln,wn){if(St||(St=new ie),We(ln))Ci(F,V,wn,K,sn,fe,St);else{var Tt=fe?fe(ze(F,wn),ln,wn+"",F,V,St):void 0;Tt===void 0&&(Tt=ln),re(F,wn,Tt)}},Yn)}function Ci(F,V,K,fe,St,ln,wn){var Tt=ze(F,K),mn=ze(V,K),ui=wn.get(mn);if(ui){re(F,K,ui);return}var Vn=ln?ln(Tt,mn,K+"",F,V,wn):void 0,_l=Vn===void 0;if(_l){var ld=ae(mn),bl=!ld&&he(mn),ud=!ld&&!bl&&Bt(mn);Vn=mn,ld||bl||ud?ae(Tt)?Vn=Tt:ce(Tt)?Vn=no(Tt):bl?(_l=!1,Vn=fr(mn,!0)):ud?(_l=!1,Vn=Un(mn,!0)):Vn=[]:Ct(mn)||be(mn)?(Vn=Tt,be(Tt)?Vn=jt(Tt):(!We(Tt)||Se(Tt))&&(Vn=li(mn))):_l=!1}_l&&(wn.set(mn,Vn),St(Vn,mn,fe,ln,wn),wn.delete(mn)),re(F,K,Vn)}function _o(F,V){return Te(Ye(F,V,Sn),F+"")}var Ei=eo?function(F,V){return eo(F,"toString",{configurable:!0,enumerable:!1,value:On(V),writable:!0})}:Sn;function fr(F,V){if(V)return F.slice();var K=F.length,fe=hn?hn(K):new F.constructor(K);return F.copy(fe),fe}function ai(F){var V=new F.constructor(F.byteLength);return new Rn(V).set(new Rn(F)),V}function Un(F,V){var K=V?ai(F.buffer):F.buffer;return new F.constructor(K,F.byteOffset,F.length)}function no(F,V){var K=-1,fe=F.length;for(V||(V=Array(fe));++K<fe;)V[K]=F[K];return V}function ps(F,V,K,fe){var St=!K;K||(K={});for(var ln=-1,wn=V.length;++ln<wn;){var Tt=V[ln],mn=fe?fe(K[Tt],F[Tt],Tt,K,F):void 0;mn===void 0&&(mn=F[Tt]),St?Xe(K,Tt,mn):ve(K,Tt,mn)}return K}function tt(F){return _o(function(V,K){var fe=-1,St=K.length,ln=St>1?K[St-1]:void 0,wn=St>2?K[2]:void 0;for(ln=F.length>3&&typeof ln=="function"?(St--,ln):void 0,wn&&Pt(K[0],K[1],wn)&&(ln=St<3?void 0:ln,St=1),V=Object(V);++fe<St;){var Tt=K[fe];Tt&&F(V,Tt,fe,ln)}return V})}function an(F){return function(V,K,fe){for(var St=-1,ln=Object(V),wn=fe(V),Tt=wn.length;Tt--;){var mn=wn[F?Tt:++St];if(K(ln[mn],mn,ln)===!1)break}return V}}function Zt(F,V){var K=F.__data__;return Vt(V)?K[typeof V=="string"?"string":"hash"]:K.map}function Xn(F,V){var K=ct(F,V);return bt(K)?K:void 0}function hr(F){var V=Pn.call(F,wr),K=F[wr];try{F[wr]=void 0;var fe=!0}catch{}var St=Ji.call(F);return fe&&(V?F[wr]=K:delete F[wr]),St}function li(F){return typeof F.constructor=="function"&&!Jt(F)?Or(wi(F)):{}}function pn(F,V){var K=typeof F;return V=V??s,!!V&&(K=="number"||K!="symbol"&&U.test(F))&&F>-1&&F%1==0&&F<V}function Pt(F,V,K){if(!We(K))return!1;var fe=typeof V;return(fe=="number"?xe(K)&&pn(V,K.length):fe=="string"&&V in K)?je(K[V],F):!1}function Vt(F){var V=typeof F;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?F!=="__proto__":F===null}function gn(F){return!!Sr&&Sr in F}function Jt(F){var V=F&&F.constructor,K=typeof V=="function"&&V.prototype||kn;return F===K}function un(F){var V=[];if(F!=null)for(var K in Object(F))V.push(K);return V}function _e(F){return Ji.call(F)}function Ye(F,V,K){return V=vo(V===void 0?F.length-1:V,0),function(){for(var fe=arguments,St=-1,ln=vo(fe.length-V,0),wn=Array(ln);++St<ln;)wn[St]=fe[V+St];St=-1;for(var Tt=Array(V+1);++St<V;)Tt[St]=fe[St];return Tt[V]=K(wn),pt(F,this,Tt)}}function ze(F,V){if(!(V==="constructor"&&typeof F[V]=="function")&&V!="__proto__")return F[V]}var Te=Ge(Ei);function Ge(F){var V=0,K=0;return function(){var fe=ka(),St=o-(fe-K);if(K=fe,St>0){if(++V>=i)return arguments[0]}else V=0;return F.apply(void 0,arguments)}}function lt(F){if(F!=null){try{return Xt.call(F)}catch{}try{return F+""}catch{}}return""}function je(F,V){return F===V||F!==F&&V!==V}var be=mt(function(){return arguments}())?mt:function(F){return Ae(F)&&Pn.call(F,"callee")&&!Bi.call(F,"callee")},ae=Array.isArray;function xe(F){return F!=null&&Ze(F.length)&&!Se(F)}function ce(F){return Ae(F)&&xe(F)}var he=Aa||zi;function Se(F){if(!We(F))return!1;var V=at(F);return V==h||V==p||V==u||V==g}function Ze(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=s}function We(F){var V=typeof F;return F!=null&&(V=="object"||V=="function")}function Ae(F){return F!=null&&typeof F=="object"}function Ct(F){if(!Ae(F)||at(F)!=v)return!1;var V=wi(F);if(V===null)return!0;var K=Pn.call(V,"constructor")&&V.constructor;return typeof K=="function"&&K instanceof K&&Xt.call(K)==Vr}var Bt=le?Fe(le):xt;function jt(F){return ps(F,Yn(F))}function Yn(F){return xe(F)?Pe(F,!0):on(F)}var sr=tt(function(F,V,K,fe){sn(F,V,K,fe)});function On(F){return function(){return F}}function Sn(F){return F}function zi(){return!1}e.exports=sr})(O1,O1.exports);var D3e=O1.exports;const sa=jc(D3e);var L3e=e=>/!(important)?$/.test(e),uI=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,$3e=(e,t)=>n=>{const r=String(t),i=L3e(r),o=uI(r),s=e?`${e}.${o}`:o;let a=Za(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=uI(a),i?`${a} !important`:a};function l4(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{var a;const l=$3e(t,o)(s);let u=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(u=r(u,s)),u}}var u0=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Uo(e,t){return n=>{const r={property:n,scale:e};return r.transform=l4({scale:e,transform:t}),r}}var F3e=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function B3e(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:F3e(t),transform:n?l4({scale:n,compose:r}):r}}var Bj=["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 z3e(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Bj].join(" ")}function j3e(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Bj].join(" ")}var U3e={"--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(" ")},V3e={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 G3e(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 q3e={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},T3={"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"},H3e=new Set(Object.values(T3)),A3=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),W3e=e=>e.trim();function K3e(e,t){if(e==null||A3.has(e))return e;if(!(k3(e)||A3.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(W3e).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in T3?T3[l]:l;u.unshift(c);const d=u.map(f=>{if(H3e.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],b=k3(m)?m:m&&m.split(" "),_=`colors.${p}`,v=_ in t.__cssMap?t.__cssMap[_].varRef:p;return b?[v,...Array.isArray(b)?b:[b]].join(" "):v});return`${a}(${d.join(", ")})`}var k3=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Q3e=(e,t)=>K3e(e,t??{});function X3e(e){return/^var\(--.+\)$/.test(e)}var Y3e=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Ws=e=>t=>`${e}(${t})`,qt={filter(e){return e!=="auto"?e:U3e},backdropFilter(e){return e!=="auto"?e:V3e},ring(e){return G3e(qt.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?z3e():e==="auto-gpu"?j3e():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Y3e(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(X3e(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Q3e,blur:Ws("blur"),opacity:Ws("opacity"),brightness:Ws("brightness"),contrast:Ws("contrast"),dropShadow:Ws("drop-shadow"),grayscale:Ws("grayscale"),hueRotate:Ws("hue-rotate"),invert:Ws("invert"),saturate:Ws("saturate"),sepia:Ws("sepia"),bgImage(e){return e==null||k3(e)||A3.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=q3e[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},q={borderWidths:Uo("borderWidths"),borderStyles:Uo("borderStyles"),colors:Uo("colors"),borders:Uo("borders"),gradients:Uo("gradients",qt.gradient),radii:Uo("radii",qt.px),space:Uo("space",u0(qt.vh,qt.px)),spaceT:Uo("space",u0(qt.vh,qt.px)),degreeT(e){return{property:e,transform:qt.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:l4({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Uo("sizes",u0(qt.vh,qt.px)),sizesT:Uo("sizes",u0(qt.vh,qt.fraction)),shadows:Uo("shadows"),logical:B3e,blur:Uo("blur",qt.blur)},Q0={background:q.colors("background"),backgroundColor:q.colors("backgroundColor"),backgroundImage:q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:qt.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:qt.bgClip}};Object.assign(Q0,{bgImage:Q0.backgroundImage,bgImg:Q0.backgroundImage});var tn={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(tn,{rounded:tn.borderRadius,roundedTop:tn.borderTopRadius,roundedTopLeft:tn.borderTopLeftRadius,roundedTopRight:tn.borderTopRightRadius,roundedTopStart:tn.borderStartStartRadius,roundedTopEnd:tn.borderStartEndRadius,roundedBottom:tn.borderBottomRadius,roundedBottomLeft:tn.borderBottomLeftRadius,roundedBottomRight:tn.borderBottomRightRadius,roundedBottomStart:tn.borderEndStartRadius,roundedBottomEnd:tn.borderEndEndRadius,roundedLeft:tn.borderLeftRadius,roundedRight:tn.borderRightRadius,roundedStart:tn.borderInlineStartRadius,roundedEnd:tn.borderInlineEndRadius,borderStart:tn.borderInlineStart,borderEnd:tn.borderInlineEnd,borderTopStartRadius:tn.borderStartStartRadius,borderTopEndRadius:tn.borderStartEndRadius,borderBottomStartRadius:tn.borderEndStartRadius,borderBottomEndRadius:tn.borderEndEndRadius,borderStartRadius:tn.borderInlineStartRadius,borderEndRadius:tn.borderInlineEndRadius,borderStartWidth:tn.borderInlineStartWidth,borderEndWidth:tn.borderInlineEndWidth,borderStartColor:tn.borderInlineStartColor,borderEndColor:tn.borderInlineEndColor,borderStartStyle:tn.borderInlineStartStyle,borderEndStyle:tn.borderInlineEndStyle});var Z3e={color:q.colors("color"),textColor:q.colors("color"),fill:q.colors("fill"),stroke:q.colors("stroke")},P3={boxShadow:q.shadows("boxShadow"),mixBlendMode:!0,blendMode:q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:q.prop("backgroundBlendMode"),opacity:!0};Object.assign(P3,{shadow:P3.boxShadow});var J3e={filter:{transform:qt.filter},blur:q.blur("--chakra-blur"),brightness:q.propT("--chakra-brightness",qt.brightness),contrast:q.propT("--chakra-contrast",qt.contrast),hueRotate:q.degreeT("--chakra-hue-rotate"),invert:q.propT("--chakra-invert",qt.invert),saturate:q.propT("--chakra-saturate",qt.saturate),dropShadow:q.propT("--chakra-drop-shadow",qt.dropShadow),backdropFilter:{transform:qt.backdropFilter},backdropBlur:q.blur("--chakra-backdrop-blur"),backdropBrightness:q.propT("--chakra-backdrop-brightness",qt.brightness),backdropContrast:q.propT("--chakra-backdrop-contrast",qt.contrast),backdropHueRotate:q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:q.propT("--chakra-backdrop-invert",qt.invert),backdropSaturate:q.propT("--chakra-backdrop-saturate",qt.saturate)},M1={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:qt.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(M1,{flexDir:M1.flexDirection});var zj={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},eEe={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:qt.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",qt.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 tEe={listStyleType:!0,listStylePosition:!0,listStylePos:q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:q.prop("listStyleImage")};function nEe(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 rEe=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}},iEe=rEe(nEe),oEe={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},sEe={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Uw=(e,t,n)=>{const r={},i=iEe(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},aEe={srOnly:{transform(e){return e===!0?oEe:e==="focusable"?sEe:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Uw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Uw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Uw(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 lEe={ring:{transform:qt.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")},Nn={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(Nn,{m:Nn.margin,mt:Nn.marginTop,mr:Nn.marginRight,me:Nn.marginInlineEnd,marginEnd:Nn.marginInlineEnd,mb:Nn.marginBottom,ml:Nn.marginLeft,ms:Nn.marginInlineStart,marginStart:Nn.marginInlineStart,mx:Nn.marginX,my:Nn.marginY,p:Nn.padding,pt:Nn.paddingTop,py:Nn.paddingY,px:Nn.paddingX,pb:Nn.paddingBottom,pl:Nn.paddingLeft,ps:Nn.paddingInlineStart,paddingStart:Nn.paddingInlineStart,pr:Nn.paddingRight,pe:Nn.paddingInlineEnd,paddingEnd:Nn.paddingInlineEnd});var uEe={textDecorationColor:q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:q.shadows("textShadow")},cEe={clipPath:!0,transform:q.propT("transform",qt.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")},dEe={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")},fEe={fontFamily:q.prop("fontFamily","fonts"),fontSize:q.prop("fontSize","fontSizes",qt.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"}},hEe={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 jj(e){return Za(e)&&e.reference?e.reference:String(e)}var US=(e,...t)=>t.map(jj).join(` ${e} `).replace(/calc/g,""),cI=(...e)=>`calc(${US("+",...e)})`,dI=(...e)=>`calc(${US("-",...e)})`,R3=(...e)=>`calc(${US("*",...e)})`,fI=(...e)=>`calc(${US("/",...e)})`,hI=e=>{const t=jj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:R3(t,-1)},nc=Object.assign(e=>({add:(...t)=>nc(cI(e,...t)),subtract:(...t)=>nc(dI(e,...t)),multiply:(...t)=>nc(R3(e,...t)),divide:(...t)=>nc(fI(e,...t)),negate:()=>nc(hI(e)),toString:()=>e.toString()}),{add:cI,subtract:dI,multiply:R3,divide:fI,negate:hI});function pEe(e,t="-"){return e.replace(/\s+/g,t)}function gEe(e){const t=pEe(e.toString());return yEe(mEe(t))}function mEe(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function yEe(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function vEe(e,t=""){return[t,e].filter(Boolean).join("-")}function _Ee(e,t){return`var(${e}${t?`, ${t}`:""})`}function bEe(e,t=""){return gEe(`--${vEe(e,t)}`)}function I3(e,t,n){const r=bEe(e,n);return{variable:r,reference:_Ee(r,t)}}function zNe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=I3(`${e}-${i}`,o);continue}n[r]=I3(`${e}-${r}`)}return n}function SEe(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function wEe(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function O3(e){if(e==null)return e;const{unitless:t}=wEe(e);return t||typeof e=="number"?`${e}px`:e}var Uj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,u4=e=>Object.fromEntries(Object.entries(e).sort(Uj));function pI(e){const t=u4(e);return Object.assign(Object.values(t),t)}function xEe(e){const t=Object.keys(u4(e));return new Set(t)}function gI(e){var t;if(!e)return e;e=(t=O3(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function op(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${O3(e)})`),t&&n.push("and",`(max-width: ${O3(t)})`),n.join(" ")}function CEe(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=pI(e),r=Object.entries(e).sort(Uj).map(([s,a],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?gI(d):void 0,{_minW:gI(a),breakpoint:s,minW:a,maxW:d,maxWQuery:op(null,d),minWQuery:op(a),minMaxQuery:op(a,d)}}),i=xEe(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:u4(e),asArray:pI(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>op(s)).slice(1)],toArrayValue(s){if(!Za(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(;SEe(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 ci={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}`},El=e=>Vj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Na=e=>Vj(t=>e(t,"~ &"),"[data-peer]",".peer"),Vj=(e,...t)=>t.map(e).join(", "),VS={_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:El(ci.hover),_peerHover:Na(ci.hover),_groupFocus:El(ci.focus),_peerFocus:Na(ci.focus),_groupFocusVisible:El(ci.focusVisible),_peerFocusVisible:Na(ci.focusVisible),_groupActive:El(ci.active),_peerActive:Na(ci.active),_groupDisabled:El(ci.disabled),_peerDisabled:Na(ci.disabled),_groupInvalid:El(ci.invalid),_peerInvalid:Na(ci.invalid),_groupChecked:El(ci.checked),_peerChecked:Na(ci.checked),_groupFocusWithin:El(ci.focusWithin),_peerFocusWithin:Na(ci.focusWithin),_peerPlaceholderShown:Na(ci.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]"},Gj=Object.keys(VS);function mI(e,t){return I3(String(e).replace(/\./g,"-"),void 0,t)}function EEe(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:s,value:a}=o,{variable:l,reference:u}=mI(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=nc.negate(a),_=nc.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}=mI(p,t==null?void 0:t.cssVarPrefix);return b},d=Za(a)?a:{default:a};n=sa(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 v=(b=(m=VS)==null?void 0:m[h])!=null?b:h;return f[v]={[l]:_},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function TEe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function AEe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function kEe(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function yI(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){var l;if(kEe(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 PEe=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function REe(e){return AEe(e,PEe)}function IEe(e){return e.semanticTokens}function OEe(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var MEe=e=>Gj.includes(e)||e==="default";function NEe({tokens:e,semanticTokens:t}){const n={};return yI(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),yI(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(MEe)}),n}function jNe(e){var t;const n=OEe(e),r=REe(n),i=IEe(n),o=NEe({tokens:r,semanticTokens:i}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=EEe(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:CEe(n.breakpoints)}),n}var c4=sa({},Q0,tn,Z3e,M1,Go,J3e,lEe,eEe,zj,aEe,Ep,P3,Nn,hEe,fEe,uEe,cEe,tEe,dEe),DEe=Object.assign({},Nn,Go,M1,zj,Ep),UNe=Object.keys(DEe),LEe=[...Object.keys(c4),...Gj],$Ee={...c4,...VS},FEe=e=>e in $Ee,BEe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=hc(e[s],t);if(a==null)continue;if(a=Za(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 zEe(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 jEe(e){return/^var\(--.+\)$/.test(e)}var UEe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!jEe(t),VEe=(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]=zEe(t);return t=(r=(n=i(s))!=null?n:o(a))!=null?r:o(t),t};function GEe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var a,l,u;const c=hc(o,r),d=BEe(c)(r);let f={};for(let h in d){const p=d[h];let m=hc(p,r);h in n&&(h=n[h]),UEe(h,m)&&(m=VEe(r,m));let b=t[h];if(b===!0&&(b={property:h}),Za(m)){f[h]=(a=f[h])!=null?a:{},f[h]=sa({},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 v=hc(b==null?void 0:b.property,r);if(!s&&(b!=null&&b.static)){const g=hc(b.static,r);f=sa({},f,g)}if(v&&Array.isArray(v)){for(const g of v)f[g]=_;continue}if(v){v==="&"&&Za(_)?f=sa({},f,_):f[v]=_;continue}if(Za(_)){f=sa({},f,_);continue}f[h]=_}return f};return i}var qEe=e=>t=>GEe({theme:t,pseudos:VS,configs:c4})(e);function VNe(e){return e}function GNe(e){return e}function qNe(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function HEe(e,t){if(Array.isArray(e))return e;if(Za(e))return t(e);if(e!=null)return[e]}function WEe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function KEe(e){const t=e.__breakpoints;return function(r,i,o,s){var a,l;if(!t)return;const u={},c=HEe(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[WEe(c,p)],_=op(m.minW,b==null?void 0:b._minW),v=hc((a=r[i])==null?void 0:a[c[p]],s);if(v){if(h){(l=r.parts)==null||l.forEach(g=>{sa(u,{[g]:f?v[g]:{[_]:v[g]}})});continue}if(!h){f?sa(u,v):u[_]=v;continue}u[_]=v}}return u}}function QEe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,s=KEe(o);return sa({},hc((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",i,t),s(e,"variants",r,t))}}function HNe(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 d4(e){return TEe(e,["styleConfig","size","variant","colorScheme"])}function XEe(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function YEe(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 ZEe=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}},JEe=ZEe(YEe);function qj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var Hj=e=>qj(e,t=>t!=null);function eTe(e){return typeof e=="function"}function tTe(e,...t){return eTe(e)?e(...t):e}function WNe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var nTe=typeof Element<"u",rTe=typeof Map=="function",iTe=typeof Set=="function",oTe=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(rTe&&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(iTe&&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(oTe&&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(nTe&&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 sTe=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 aTe=jc(sTe);function Wj(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:s}=P3e(),a=e?JEe(o,`components.${e}`):void 0,l=r||a,u=sa({theme:o,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},Hj(XEe(i,["children"]))),c=M.useRef({});if(l){const f=QEe(l)(u);aTe(c.current,f)||(c.current=f)}return c.current}function f4(e,t={}){return Wj(e,t)}function KNe(e,t={}){return Wj(e,t)}var lTe=new Set([...LEe,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),uTe=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function cTe(e){return uTe.has(e)||!lTe.has(e)}function dTe(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 fTe(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var hTe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,pTe=Pj(function(e){return hTe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gTe=pTe,mTe=function(t){return t!=="theme"},vI=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?gTe:mTe},_I=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},yTe=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Ij(n,r,i),x3e(function(){return Oj(n,r,i)}),null},vTe=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=_I(t,n,r),l=a||vI(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=Lj(function(m,b,_){var v=u&&m.as||i,g="",y=[],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=m3e(b.registered,y,m.className):m.className!=null&&(g=m.className+" ");var x=o4(d.concat(y),b.registered,S);g+=b.key+"-"+x.name,s!==void 0&&(g+=" "+s);var C=u&&a===void 0?vI(v):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(yTe,{cache:b,serialized:x,isStringTag:typeof v=="string"}),M.createElement(v,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,u1({},n,b,{shouldForwardProp:_I(p,b,!0)})).apply(void 0,d)},p}},_Te=["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"],N1=vTe.bind();_Te.forEach(function(e){N1[e]=N1(e)});var bI,bTe=(bI=N1.default)!=null?bI:N1,STe=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=qj(s,(d,f)=>FEe(f)),l=tTe(e,t),u=dTe({},i,l,Hj(a),o),c=qEe(u)(t.theme);return r?[c,r]:c};function Vw(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=cTe);const i=STe({baseStyle:n}),o=bTe(e,r)(i);return vn.forwardRef(function(l,u){const{colorMode:c,forced:d}=s4();return vn.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function wTe(){const e=new Map;return new Proxy(Vw,{apply(t,n,r){return Vw(...r)},get(t,n){return e.has(n)||e.set(n,Vw(n)),e.get(n)}})}var wu=wTe();function $u(e){return M.forwardRef(e)}const Kj=M.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),GS=M.createContext({}),Hm=M.createContext(null),qS=typeof document<"u",h4=qS?M.useLayoutEffect:M.useEffect,Qj=M.createContext({strict:!1});function xTe(e,t,n,r){const{visualElement:i}=M.useContext(GS),o=M.useContext(Qj),s=M.useContext(Hm),a=M.useContext(Kj).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 h4(()=>{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 Hd(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function CTe(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):Hd(n)&&(n.current=r))},[t])}function Qg(e){return typeof e=="string"||Array.isArray(e)}function HS(e){return typeof e=="object"&&typeof e.start=="function"}const p4=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],g4=["initial",...p4];function WS(e){return HS(e.animate)||g4.some(t=>Qg(e[t]))}function Xj(e){return!!(WS(e)||e.variants)}function ETe(e,t){if(WS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qg(n)?n:void 0,animate:Qg(r)?r:void 0}}return e.inherit!==!1?t:{}}function TTe(e){const{initial:t,animate:n}=ETe(e,M.useContext(GS));return M.useMemo(()=>({initial:t,animate:n}),[SI(t),SI(n)])}function SI(e){return Array.isArray(e)?e.join(" "):e}const wI={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"]},Xg={};for(const e in wI)Xg[e]={isEnabled:t=>wI[e].some(n=>!!t[n])};function ATe(e){for(const t in e)Xg[t]={...Xg[t],...e[t]}}const m4=M.createContext({}),Yj=M.createContext({}),kTe=Symbol.for("motionComponentSymbol");function PTe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&ATe(e);function o(a,l){let u;const c={...M.useContext(Kj),...a,layoutId:RTe(a)},{isStatic:d}=c,f=TTe(a),h=r(a,d);if(!d&&qS){f.visualElement=xTe(i,h,c,t);const p=M.useContext(Yj),m=M.useContext(Qj).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,m,e,p))}return M.createElement(GS.Provider,{value:f},u&&f.visualElement?M.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,a,CTe(h,f.visualElement,l),h,d,f.visualElement))}const s=M.forwardRef(o);return s[kTe]=i,s}function RTe({layoutId:e}){const t=M.useContext(m4).id;return t&&e!==void 0?t+"-"+e:e}function ITe(e){function t(r,i={}){return PTe(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 OTe=["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 y4(e){return typeof e!="string"||e.includes("-")?!1:!!(OTe.indexOf(e)>-1||/[A-Z]/.test(e))}const D1={};function MTe(e){Object.assign(D1,e)}const Wm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sd=new Set(Wm);function Zj(e,{layout:t,layoutId:n}){return sd.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!D1[e]||e==="opacity")}const yo=e=>!!(e&&e.getVelocity),NTe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},DTe=Wm.length;function LTe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let s=0;s<DTe;s++){const a=Wm[s];if(e[a]!==void 0){const l=NTe[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 Jj=e=>t=>typeof t=="string"&&t.startsWith(e),eU=Jj("--"),M3=Jj("var(--"),$Te=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,FTe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,xu=(e,t,n)=>Math.min(Math.max(n,e),t),ad={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tp={...ad,transform:e=>xu(0,1,e)},c0={...ad,default:1},Ap=e=>Math.round(e*1e5)/1e5,KS=/(-)?([\d]*\.?[\d])+/g,tU=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,BTe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Km(e){return typeof e=="string"}const Qm=e=>({test:t=>Km(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Al=Qm("deg"),ga=Qm("%"),rt=Qm("px"),zTe=Qm("vh"),jTe=Qm("vw"),xI={...ga,parse:e=>ga.parse(e)/100,transform:e=>ga.transform(e*100)},CI={...ad,transform:Math.round},nU={borderWidth:rt,borderTopWidth:rt,borderRightWidth:rt,borderBottomWidth:rt,borderLeftWidth:rt,borderRadius:rt,radius:rt,borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomRightRadius:rt,borderBottomLeftRadius:rt,width:rt,maxWidth:rt,height:rt,maxHeight:rt,size:rt,top:rt,right:rt,bottom:rt,left:rt,padding:rt,paddingTop:rt,paddingRight:rt,paddingBottom:rt,paddingLeft:rt,margin:rt,marginTop:rt,marginRight:rt,marginBottom:rt,marginLeft:rt,rotate:Al,rotateX:Al,rotateY:Al,rotateZ:Al,scale:c0,scaleX:c0,scaleY:c0,scaleZ:c0,skew:Al,skewX:Al,skewY:Al,distance:rt,translateX:rt,translateY:rt,translateZ:rt,x:rt,y:rt,z:rt,perspective:rt,transformPerspective:rt,opacity:Tp,originX:xI,originY:xI,originZ:rt,zIndex:CI,fillOpacity:Tp,strokeOpacity:Tp,numOctaves:CI};function v4(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(eU(d)){o[d]=f;continue}const h=nU[d],p=FTe(f,h);if(sd.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=LTe(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 _4=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rU(e,t,n){for(const r in t)!yo(t[r])&&!Zj(r,n)&&(e[r]=t[r])}function UTe({transformTemplate:e},t,n){return M.useMemo(()=>{const r=_4();return v4(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function VTe(e,t,n){const r=e.style||{},i={};return rU(i,r,e),Object.assign(i,UTe(e,t,n)),e.transformValues?e.transformValues(i):i}function GTe(e,t,n){const r={},i=VTe(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 qTe=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 L1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||qTe.has(e)}let iU=e=>!L1(e);function HTe(e){e&&(iU=t=>t.startsWith("on")?!L1(t):e(t))}try{HTe(require("@emotion/is-prop-valid").default)}catch{}function WTe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(iU(i)||n===!0&&L1(i)||!t&&!L1(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function EI(e,t,n){return typeof e=="string"?e:rt.transform(t+n*e)}function KTe(e,t,n){const r=EI(t,e.x,e.width),i=EI(n,e.y,e.height);return`${r} ${i}`}const QTe={offset:"stroke-dashoffset",array:"stroke-dasharray"},XTe={offset:"strokeDashoffset",array:"strokeDasharray"};function YTe(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?QTe:XTe;e[o.offset]=rt.transform(-r);const s=rt.transform(t),a=rt.transform(n);e[o.array]=`${s} ${a}`}function b4(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,f){if(v4(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=KTe(m,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&YTe(h,s,a,l,!1)}const oU=()=>({..._4(),attrs:{}}),S4=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ZTe(e,t,n,r){const i=M.useMemo(()=>{const o=oU();return b4(o,t,{enableHardwareAcceleration:!1},S4(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};rU(o,e.style,e),i.style={...o,...i.style}}return i}function JTe(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(y4(n)?ZTe:GTe)(r,o,s,n),c={...WTe(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=M.useMemo(()=>yo(d)?d.get():d,[d]);return M.createElement(n,{...c,children:f})}}const w4=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function sU(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 aU=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 lU(e,t,n,r){sU(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(aU.has(i)?i:w4(i),t.attrs[i])}function x4(e,t){const{style:n}=e,r={};for(const i in n)(yo(n[i])||t.style&&yo(t.style[i])||Zj(i,e))&&(r[i]=n[i]);return r}function uU(e,t){const n=x4(e,t);for(const r in e)if(yo(e[r])||yo(t[r])){const i=Wm.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function C4(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 cU(e){const t=M.useRef(null);return t.current===null&&(t.current=e()),t.current}const $1=e=>Array.isArray(e),e5e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),t5e=e=>$1(e)?e[e.length-1]||0:e;function Y0(e){const t=yo(e)?e.get():e;return e5e(t)?t.toValue():t}function n5e({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:r5e(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const dU=e=>(t,n)=>{const r=M.useContext(GS),i=M.useContext(Hm),o=()=>n5e(e,t,r,i);return n?o():cU(o)};function r5e(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=Y0(o[f]);let{initial:s,animate:a}=e;const l=WS(e),u=Xj(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"&&!HS(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=C4(e,h);if(!p)return;const{transitionEnd:m,transition:b,..._}=p;for(const v in _){let g=_[v];if(Array.isArray(g)){const y=c?g.length-1:0;g=g[y]}g!==null&&(i[v]=g)}for(const v in m)i[v]=m[v]}),i}const ur=e=>e;function i5e(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 d0=["prepare","read","update","preRender","render","postRender"],o5e=40;function s5e(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=d0.reduce((d,f)=>(d[f]=i5e(()=>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,o5e),1),i.timestamp=d,i.isProcessing=!0,d0.forEach(s),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:d0.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=>d0.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:An,cancel:cl,state:Pi,steps:Gw}=s5e(typeof requestAnimationFrame<"u"?requestAnimationFrame:ur,!0),a5e={useVisualState:dU({scrapeMotionValuesFromProps:uU,createRenderState:oU,onMount:(e,t,{renderState:n,latestValues:r})=>{An.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),An.render(()=>{b4(n,r,{enableHardwareAcceleration:!1},S4(t.tagName),e.transformTemplate),lU(t,n)})}})},l5e={useVisualState:dU({scrapeMotionValuesFromProps:x4,createRenderState:_4})};function u5e(e,{forwardMotionProps:t=!1},n,r){return{...y4(e)?a5e:l5e,preloadedFeatures:n,useRender:JTe(t),createVisualElement:r,Component:e}}function Wa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const fU=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function QS(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const c5e=e=>t=>fU(t)&&e(t,QS(t));function Ja(e,t,n,r){return Wa(e,t,c5e(n),r)}const d5e=(e,t)=>n=>t(e(n)),au=(...e)=>e.reduce(d5e);function hU(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const TI=hU("dragHorizontal"),AI=hU("dragVertical");function pU(e){let t=!1;if(e==="y")t=AI();else if(e==="x")t=TI();else{const n=TI(),r=AI();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function gU(){const e=pU(!0);return e?(e(),!1):!0}class Fu{constructor(t){this.isMounted=!1,this.node=t}update(){}}function kI(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,s)=>{if(o.type==="touch"||gU())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&An.update(()=>a[r](o,s))};return Ja(e.current,n,i,{passive:!e.getProps()[r]})}class f5e extends Fu{mount(){this.unmount=au(kI(this.node,!0),kI(this.node,!1))}unmount(){}}class h5e extends Fu{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=au(Wa(this.node.current,"focus",()=>this.onFocus()),Wa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const mU=(e,t)=>t?e===t?!0:mU(e,t.parentElement):!1;function qw(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,QS(n))}class p5e extends Fu{constructor(){super(...arguments),this.removeStartListeners=ur,this.removeEndListeners=ur,this.removeAccessibleListeners=ur,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Ja(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();An.update(()=>{mU(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=Ja(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=au(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()||qw("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&An.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Wa(this.node.current,"keyup",s),qw("down",(a,l)=>{this.startPress(a,l)})},n=Wa(this.node.current,"keydown",t),r=()=>{this.isPressing&&qw("cancel",(o,s)=>this.cancelPress(o,s))},i=Wa(this.node.current,"blur",r);this.removeAccessibleListeners=au(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&&An.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!gU()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&An.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ja(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Wa(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=au(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const N3=new WeakMap,Hw=new WeakMap,g5e=e=>{const t=N3.get(e.target);t&&t(e)},m5e=e=>{e.forEach(g5e)};function y5e({root:e,...t}){const n=e||document;Hw.has(n)||Hw.set(n,{});const r=Hw.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(m5e,{root:e,...t})),r[i]}function v5e(e,t,n){const r=y5e(t);return N3.set(e,n),r.observe(e),()=>{N3.delete(e),r.unobserve(e)}}const _5e={some:0,all:1};class b5e extends Fu{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:_5e[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 v5e(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(S5e(t,n))&&this.startObserver()}unmount(){}}function S5e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const w5e={inView:{Feature:b5e},tap:{Feature:p5e},focus:{Feature:h5e},hover:{Feature:f5e}};function yU(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 x5e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function C5e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function XS(e,t,n){const r=e.getProps();return C4(r,t,n!==void 0?n:r.custom,x5e(e),C5e(e))}const E5e="framerAppearId",T5e="data-"+w4(E5e);let A5e=ur,E4=ur;const lu=e=>e*1e3,el=e=>e/1e3,k5e={current:!1},vU=e=>Array.isArray(e)&&typeof e[0]=="number";function _U(e){return!!(!e||typeof e=="string"&&bU[e]||vU(e)||Array.isArray(e)&&e.every(_U))}const sp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bU={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sp([0,.65,.55,1]),circOut:sp([.55,0,1,.45]),backIn:sp([.31,.01,.66,-.59]),backOut:sp([.33,1.53,.69,.99])};function SU(e){if(e)return vU(e)?sp(e):Array.isArray(e)?e.map(SU):bU[e]}function P5e(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=SU(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 R5e(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const wU=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,I5e=1e-7,O5e=12;function M5e(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=wU(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>I5e&&++a<O5e);return s}function Xm(e,t,n,r){if(e===t&&n===r)return ur;const i=o=>M5e(o,0,1,e,n);return o=>o===0||o===1?o:wU(i(o),t,r)}const N5e=Xm(.42,0,1,1),D5e=Xm(0,0,.58,1),xU=Xm(.42,0,.58,1),L5e=e=>Array.isArray(e)&&typeof e[0]!="number",CU=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,EU=e=>t=>1-e(1-t),TU=e=>1-Math.sin(Math.acos(e)),T4=EU(TU),$5e=CU(T4),AU=Xm(.33,1.53,.69,.99),A4=EU(AU),F5e=CU(A4),B5e=e=>(e*=2)<1?.5*A4(e):.5*(2-Math.pow(2,-10*(e-1))),z5e={linear:ur,easeIn:N5e,easeInOut:xU,easeOut:D5e,circIn:TU,circInOut:$5e,circOut:T4,backIn:A4,backInOut:F5e,backOut:AU,anticipate:B5e},PI=e=>{if(Array.isArray(e)){E4(e.length===4);const[t,n,r,i]=e;return Xm(t,n,r,i)}else if(typeof e=="string")return z5e[e];return e},k4=(e,t)=>n=>!!(Km(n)&&BTe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kU=(e,t,n)=>r=>{if(!Km(r))return r;const[i,o,s,a]=r.match(KS);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},j5e=e=>xu(0,255,e),Ww={...ad,transform:e=>Math.round(j5e(e))},pc={test:k4("rgb","red"),parse:kU("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ww.transform(e)+", "+Ww.transform(t)+", "+Ww.transform(n)+", "+Ap(Tp.transform(r))+")"};function U5e(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 D3={test:k4("#"),parse:U5e,transform:pc.transform},Wd={test:k4("hsl","hue"),parse:kU("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ga.transform(Ap(t))+", "+ga.transform(Ap(n))+", "+Ap(Tp.transform(r))+")"},Ui={test:e=>pc.test(e)||D3.test(e)||Wd.test(e),parse:e=>pc.test(e)?pc.parse(e):Wd.test(e)?Wd.parse(e):D3.parse(e),transform:e=>Km(e)?e:e.hasOwnProperty("red")?pc.transform(e):Wd.transform(e)},tr=(e,t,n)=>-n*e+n*t+e;function Kw(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 V5e({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=Kw(l,a,e+1/3),o=Kw(l,a,e),s=Kw(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}const Qw=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},G5e=[D3,pc,Wd],q5e=e=>G5e.find(t=>t.test(e));function RI(e){const t=q5e(e);let n=t.parse(e);return t===Wd&&(n=V5e(n)),n}const PU=(e,t)=>{const n=RI(e),r=RI(t),i={...n};return o=>(i.red=Qw(n.red,r.red,o),i.green=Qw(n.green,r.green,o),i.blue=Qw(n.blue,r.blue,o),i.alpha=tr(n.alpha,r.alpha,o),pc.transform(i))};function H5e(e){var t,n;return isNaN(e)&&Km(e)&&(((t=e.match(KS))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(tU))===null||n===void 0?void 0:n.length)||0)>0}const RU={regex:$Te,countKey:"Vars",token:"${v}",parse:ur},IU={regex:tU,countKey:"Colors",token:"${c}",parse:Ui.parse},OU={regex:KS,countKey:"Numbers",token:"${n}",parse:ad.parse};function Xw(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 F1(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Xw(n,RU),Xw(n,IU),Xw(n,OU),n}function MU(e){return F1(e).values}function NU(e){const{values:t,numColors:n,numVars:r,tokenised:i}=F1(e),o=t.length;return s=>{let a=i;for(let l=0;l<o;l++)l<r?a=a.replace(RU.token,s[l]):l<r+n?a=a.replace(IU.token,Ui.transform(s[l])):a=a.replace(OU.token,Ap(s[l]));return a}}const W5e=e=>typeof e=="number"?0:e;function K5e(e){const t=MU(e);return NU(e)(t.map(W5e))}const Cu={test:H5e,parse:MU,createTransformer:NU,getAnimatableNone:K5e},DU=(e,t)=>n=>`${n>0?t:e}`;function LU(e,t){return typeof e=="number"?n=>tr(e,t,n):Ui.test(e)?PU(e,t):e.startsWith("var(")?DU(e,t):FU(e,t)}const $U=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,s)=>LU(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}},Q5e=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=LU(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},FU=(e,t)=>{const n=Cu.createTransformer(t),r=F1(e),i=F1(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?au($U(r.values,i.values),n):DU(e,t)},Yg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},II=(e,t)=>n=>tr(e,t,n);function X5e(e){return typeof e=="number"?II:typeof e=="string"?Ui.test(e)?PU:FU:Array.isArray(e)?$U:typeof e=="object"?Q5e:II}function Y5e(e,t,n){const r=[],i=n||X5e(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]||ur:t;a=au(l,a)}r.push(a)}return r}function BU(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(E4(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=Y5e(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(xu(e[0],e[o-1],u)):l}function Z5e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Yg(0,t,r);e.push(tr(n,1,i))}}function J5e(e){const t=[0];return Z5e(t,e.length-1),t}function e4e(e,t){return e.map(n=>n*t)}function t4e(e,t){return e.map(()=>t||xU).splice(0,e.length-1)}function B1({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=L5e(r)?r.map(PI):PI(r),o={done:!1,value:t[0]},s=e4e(n&&n.length===t.length?n:J5e(t),e),a=BU(s,t,{ease:Array.isArray(i)?i:t4e(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}function zU(e,t){return t?e*(1e3/t):0}const n4e=5;function jU(e,t,n){const r=Math.max(t-n4e,0);return zU(n-e(r),t-r)}const Yw=.001,r4e=.01,OI=10,i4e=.05,o4e=1;function s4e({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;A5e(e<=lu(OI));let s=1-t;s=xu(i4e,o4e,s),e=xu(r4e,OI,el(e)),s<1?(i=u=>{const c=u*s,d=c*e,f=c-n,h=L3(u,s),p=Math.exp(-d);return Yw-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=L3(Math.pow(u,2),s);return(-i(u)+Yw>0?-1:1)*((f-h)*p)/m}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Yw+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=l4e(i,o,a);if(e=lu(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 a4e=12;function l4e(e,t,n){let r=n;for(let i=1;i<a4e;i++)r=r-e(r)/t(r);return r}function L3(e,t){return e*Math.sqrt(1-t*t)}const u4e=["duration","bounce"],c4e=["stiffness","damping","mass"];function MI(e,t){return t.some(n=>e[n]!==void 0)}function d4e(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!MI(e,c4e)&&MI(e,u4e)){const n=s4e(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function UU({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}=d4e(r),h=c?-el(c):0,p=l/(2*Math.sqrt(a*u)),m=o-i,b=el(Math.sqrt(a/u)),_=Math.abs(m)<5;n||(n=_?.01:2),t||(t=_?.005:.5);let v;if(p<1){const g=L3(b,p);v=y=>{const S=Math.exp(-p*b*y);return o-S*((h+p*b*m)/g*Math.sin(g*y)+m*Math.cos(g*y))}}else if(p===1)v=g=>o-Math.exp(-b*g)*(m+(h+b*m)*g);else{const g=b*Math.sqrt(p*p-1);v=y=>{const S=Math.exp(-p*b*y),w=Math.min(g*y,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 y=v(g);if(f)s.done=g>=d;else{let S=h;g!==0&&(p<1?S=jU(v,g,y):S=0);const w=Math.abs(S)<=n,x=Math.abs(o-y)<=t;s.done=w&&x}return s.value=s.done?o:y,s}}}function NI({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 v=C=>-m*Math.exp(-C/r),g=C=>_+v(C),y=C=>{const A=v(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=UU({keyframes:[f.value,p(f.value)],velocity:jU(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,y(C),x(C)),S!==void 0&&C>S?w.next(C-S):(!A&&y(C),f)}}}const f4e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>An.update(t,!0),stop:()=>cl(t),now:()=>Pi.isProcessing?Pi.timestamp:performance.now()}},DI=2e4;function LI(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<DI;)t+=n,r=e.next(t);return t>=DI?1/0:t}const h4e={decay:NI,inertia:NI,tween:B1,keyframes:B1,spring:UU};function z1({autoplay:e=!0,delay:t=0,driver:n=f4e,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(B=>{m=B})};_();let v;const g=h4e[i]||B1;let y;g!==B1&&typeof r[0]!="number"&&(y=BU([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=LI(S));const{calculatedDuration:P}=S;let L=1/0,R=1/0;P!==null&&(L=P+s,R=L*(o+1)-s);let E=0;const k=B=>{if(A===null)return;h>0&&(A=Math.min(A,B)),h<0&&(A=Math.min(B-R/h,A)),C!==null?E=C:E=Math.round(B-A)*h;const U=E-t*(h>=0?1:-1),G=h>=0?U<0:U>R;E=Math.max(U,0),x==="finished"&&C===null&&(E=R);let Q=E,Z=S;if(o){const te=E/L;let oe=Math.floor(te),ye=te%1;!ye&&te>=1&&(ye=1),ye===1&&oe--,oe=Math.min(oe,o+1);const le=!!(oe%2);le&&(a==="reverse"?(ye=1-ye,s&&(ye-=s/L)):a==="mirror"&&(Z=w));let pt=xu(0,1,ye);E>R&&(pt=a==="reverse"&&le?1:0),Q=pt*L}const Y=G?{done:!1,value:r[0]}:Z.next(Q);y&&(Y.value=y(Y.value));let{done:j}=Y;!G&&P!==null&&(j=h>=0?E>=R:E<=0);const W=C===null&&(x==="finished"||x==="running"&&j);return d&&d(Y.value),W&&O(),Y},D=()=>{v&&v.stop(),v=void 0},$=()=>{x="idle",D(),m(),_(),A=T=null},O=()=>{x="finished",c&&c(),D(),m()},I=()=>{if(p)return;v||(v=n(k));const B=v.now();l&&l(),C!==null?A=B-C:(!A||x==="finished")&&(A=B),x==="finished"&&_(),T=A,C=null,x="running",v.start()};e&&I();const N={then(B,U){return b.then(B,U)},get time(){return el(E)},set time(B){B=lu(B),E=B,C!==null||!v||h===0?C=B:A=v.now()-B/h},get duration(){const B=S.calculatedDuration===null?LI(S):S.calculatedDuration;return el(B)},get speed(){return h},set speed(B){B===h||!v||(h=B,N.time=el(E))},get state(){return x},play:I,pause:()=>{x="paused",C=E},stop:()=>{p=!0,x!=="idle"&&(x="idle",u&&u(),$())},cancel:()=>{T!==null&&k(T),$()},complete:()=>{x="finished"},sample:B=>(A=0,k(B))};return N}function p4e(e){let t;return()=>(t===void 0&&(t=e()),t)}const g4e=p4e(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),m4e=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),f0=10,y4e=2e4,v4e=(e,t)=>t.type==="spring"||e==="backgroundColor"||!_U(t.ease);function _4e(e,t,{onUpdate:n,onComplete:r,...i}){if(!(g4e()&&m4e.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(v=>{a=v})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(v4e(t,i)){const v=z1({...i,repeat:0,delay:0});let g={done:!1,value:c[0]};const y=[];let S=0;for(;!g.done&&S<y4e;)g=v.sample(S),y.push(g.value),S+=f0;h=void 0,c=y,d=S-f0,f="linear"}const p=P5e(e.owner.current,t,c,{...i,duration:d,ease:f,times:h}),m=()=>p.cancel(),b=()=>{An.update(m),a(),u()};return p.onfinish=()=>{e.set(R5e(c,i)),r&&r(),b()},{then(v,g){return l.then(v,g)},attachTimeline(v){return p.timeline=v,p.onfinish=null,ur},get time(){return el(p.currentTime||0)},set time(v){p.currentTime=lu(v)},get speed(){return p.playbackRate},set speed(v){p.playbackRate=v},get duration(){return el(d)},play:()=>{s||(p.play(),cl(m))},pause:()=>p.pause(),stop:()=>{if(s=!0,p.playState==="idle")return;const{currentTime:v}=p;if(v){const g=z1({...i,autoplay:!1});e.setWithVelocity(g.sample(v-f0).value,g.sample(v).value,f0)}b()},complete:()=>p.finish(),cancel:b}}function b4e({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:ur,pause:ur,stop:ur,then:o=>(o(),Promise.resolve()),cancel:ur,complete:ur});return t?z1({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const S4e={type:"spring",stiffness:500,damping:25,restSpeed:10},w4e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),x4e={type:"keyframes",duration:.8},C4e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},E4e=(e,{keyframes:t})=>t.length>2?x4e:sd.has(e)?e.startsWith("scale")?w4e(t[1]):S4e:C4e,$3=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Cu.test(t)||t==="0")&&!t.startsWith("url(")),T4e=new Set(["brightness","contrast","saturate","opacity"]);function A4e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(KS)||[];if(!r)return e;const i=n.replace(r,"");let o=T4e.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const k4e=/([a-z-]*)\(.*?\)/g,F3={...Cu,getAnimatableNone:e=>{const t=e.match(k4e);return t?t.map(A4e).join(" "):e}},P4e={...nU,color:Ui,backgroundColor:Ui,outlineColor:Ui,fill:Ui,stroke:Ui,borderColor:Ui,borderTopColor:Ui,borderRightColor:Ui,borderBottomColor:Ui,borderLeftColor:Ui,filter:F3,WebkitFilter:F3},P4=e=>P4e[e];function VU(e,t){let n=P4(e);return n!==F3&&(n=Cu),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const GU=e=>/^0[^.\s]+$/.test(e);function R4e(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||GU(e)}function I4e(e,t,n,r){const i=$3(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]),R4e(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]=VU(t,a)}return o}function O4e({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 qU(e,t){return e[t]||e.default||e}const R4=(e,t,n,r={})=>i=>{const o=qU(r,e)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a=a-lu(s);const l=I4e(t,e,n,o),u=l[0],c=l[l.length-1],d=$3(e,u),f=$3(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(O4e(o)||(h={...h,...E4e(e,h)}),h.duration&&(h.duration=lu(h.duration)),h.repeatDelay&&(h.repeatDelay=lu(h.repeatDelay)),!d||!f||k5e.current||o.type===!1)return b4e(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=_4e(t,e,h);if(p)return p}return z1(h)};function j1(e){return!!(yo(e)&&e.add)}const HU=e=>/^\-?\d*\.?\d+$/.test(e);function I4(e,t){e.indexOf(t)===-1&&e.push(t)}function O4(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class M4{constructor(){this.subscriptions=[]}add(t){return I4(this.subscriptions,t),()=>O4(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 M4e=e=>!isNaN(parseFloat(e));class N4e{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}=Pi;this.lastUpdated!==s&&(this.timeDelta=o,this.lastUpdated=s,An.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=()=>An.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=M4e(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new M4);const r=this.events[t].add(n);return t==="change"?()=>{r(),An.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?zU(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 Xf(e,t){return new N4e(e,t)}const WU=e=>t=>t.test(e),D4e={test:e=>e==="auto",parse:e=>e},KU=[ad,rt,ga,Al,jTe,zTe,D4e],Wh=e=>KU.find(WU(e)),L4e=[...KU,Ui,Cu],$4e=e=>L4e.find(WU(e));function F4e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xf(n))}function B4e(e,t){const n=XS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const s in o){const a=t5e(o[s]);F4e(e,s,a)}}function z4e(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"&&(HU(c)||GU(c))?c=parseFloat(c):!$4e(c)&&Cu.test(u)&&(c=VU(l,u)),e.addValue(l,Xf(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function j4e(e,t){return t?(t[e]||t.default||t).from:void 0}function U4e(e,t,n){const r={};for(const i in e){const o=j4e(i,t);if(o!==void 0)r[i]=o;else{const s=n.getValue(i);s&&(r[i]=s.get())}}return r}function V4e({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function QU(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&&V4e(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const b=e.getProps()[T5e];b&&(p.elapsed=window.HandoffAppearAnimations(b,d,f,An))}f.start(R4(d,f,h,e.shouldReduceMotion&&sd.has(d)?{type:!1}:p));const m=f.animation;j1(l)&&(l.add(d),m.then(()=>l.remove(d))),u.push(m)}return s&&Promise.all(u).then(()=>{s&&B4e(e,s)}),u}function B3(e,t,n={}){const r=XS(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(QU(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return G4e(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 G4e(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(q4e).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(B3(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function q4e(e,t){return e.sortNodePosition(t)}function H4e(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>B3(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=B3(e,t,n);else{const i=typeof t=="function"?XS(e,t,n.custom):t;r=Promise.all(QU(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const W4e=[...p4].reverse(),K4e=p4.length;function Q4e(e){return t=>Promise.all(t.map(({animation:n,options:r})=>H4e(e,n,r)))}function X4e(e){let t=Q4e(e);const n=Z4e();let r=!0;const i=(l,u)=>{const c=XS(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;_<K4e;_++){const v=W4e[_],g=n[v],y=c[v]!==void 0?c[v]:d[v],S=Qg(y),w=v===u?g.isActive:null;w===!1&&(m=_);let x=y===d[v]&&y!==c[v]&&S;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...p},!g.isActive&&w===null||!y&&!g.prevProp||HS(y)||typeof y=="boolean")continue;const C=Y4e(g.prevProp,y);let A=C||v===u&&g.isActive&&!x&&S||_>m&&S;const T=Array.isArray(y)?y:[y];let P=T.reduce(i,{});w===!1&&(P={});const{prevResolvedValues:L={}}=g,R={...L,...P},E=k=>{A=!0,h.delete(k),g.needsAnimating[k]=!0};for(const k in R){const D=P[k],$=L[k];p.hasOwnProperty(k)||(D!==$?$1(D)&&$1($)?!yU(D,$)||C?E(k):g.protectedKeys[k]=!0:D!==void 0?E(k):h.add(k):D!==void 0&&h.has(k)?E(k):g.protectedKeys[k]=!0)}g.prevProp=y,g.prevResolvedValues=P,g.isActive&&(p={...p,...P}),r&&e.blockInitialAnimation&&(A=!1),A&&!x&&f.push(...T.map(k=>({animation:k,options:{type:v,...l}})))}if(h.size){const _={};h.forEach(v=>{const g=e.getBaseTarget(v);g!==void 0&&(_[v]=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 Y4e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!yU(t,e):!1}function Hu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Z4e(){return{animate:Hu(!0),whileInView:Hu(),whileHover:Hu(),whileTap:Hu(),whileDrag:Hu(),whileFocus:Hu(),exit:Hu()}}class J4e extends Fu{constructor(t){super(t),t.animationState||(t.animationState=X4e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),HS(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 eAe=0;class tAe extends Fu{constructor(){super(...arguments),this.id=eAe++}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 nAe={animation:{Feature:J4e},exit:{Feature:tAe}},$I=(e,t)=>Math.abs(e-t);function rAe(e,t){const n=$I(e.x,t.x),r=$I(e.y,t.y);return Math.sqrt(n**2+r**2)}class XU{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=Jw(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=rAe(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=Pi;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=Zw(c,this.transformPagePoint),An.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=Jw(u.type==="pointercancel"?this.lastMoveEventInfo:Zw(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!fU(t))return;this.handlers=n,this.transformPagePoint=r;const i=QS(t),o=Zw(i,this.transformPagePoint),{point:s}=o,{timestamp:a}=Pi;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,Jw(o,this.history)),this.removeListeners=au(Ja(window,"pointermove",this.handlePointerMove),Ja(window,"pointerup",this.handlePointerUp),Ja(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cl(this.updatePoint)}}function Zw(e,t){return t?{point:t(e.point)}:e}function FI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jw({point:e},t){return{point:e,delta:FI(e,YU(t)),offset:FI(e,iAe(t)),velocity:oAe(t,.1)}}function iAe(e){return e[0]}function YU(e){return e[e.length-1]}function oAe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=YU(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>lu(t)));)n--;if(!r)return{x:0,y:0};const o=el(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 z3(e,t=0,n=.01){return Math.abs(e-t)<=n}function BI(e,t,n,r=.5){e.origin=r,e.originPoint=tr(t.min,t.max,e.origin),e.scale=Do(n)/Do(t),(z3(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=tr(n.min,n.max,e.origin)-e.originPoint,(z3(e.translate)||isNaN(e.translate))&&(e.translate=0)}function kp(e,t,n,r){BI(e.x,t.x,n.x,r?r.originX:void 0),BI(e.y,t.y,n.y,r?r.originY:void 0)}function zI(e,t,n){e.min=n.min+t.min,e.max=e.min+Do(t)}function sAe(e,t,n){zI(e.x,t.x,n.x),zI(e.y,t.y,n.y)}function jI(e,t,n){e.min=t.min-n.min,e.max=e.min+Do(t)}function Pp(e,t,n){jI(e.x,t.x,n.x),jI(e.y,t.y,n.y)}function aAe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?tr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?tr(n,e,r.max):Math.min(e,n)),e}function UI(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 lAe(e,{top:t,left:n,bottom:r,right:i}){return{x:UI(e.x,n,i),y:UI(e.y,t,r)}}function VI(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 uAe(e,t){return{x:VI(e.x,t.x),y:VI(e.y,t.y)}}function cAe(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)),xu(0,1,n)}function dAe(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 j3=.35;function fAe(e=j3){return e===!1?e=0:e===!0&&(e=j3),{x:GI(e,"left","right"),y:GI(e,"top","bottom")}}function GI(e,t,n){return{min:qI(e,t),max:qI(e,n)}}function qI(e,t){return typeof e=="number"?e:e[t]||0}const HI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kd=()=>({x:HI(),y:HI()}),WI=()=>({min:0,max:0}),Tr=()=>({x:WI(),y:WI()});function Xs(e){return[e("x"),e("y")]}function ZU({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function hAe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pAe(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 ex(e){return e===void 0||e===1}function U3({scale:e,scaleX:t,scaleY:n}){return!ex(e)||!ex(t)||!ex(n)}function Zu(e){return U3(e)||JU(e)||e.z||e.rotate||e.rotateX||e.rotateY}function JU(e){return KI(e.x)||KI(e.y)}function KI(e){return e&&e!=="0%"}function U1(e,t,n){const r=e-n,i=t*r;return n+i}function QI(e,t,n,r,i){return i!==void 0&&(e=U1(e,i,r)),U1(e,n,r)+t}function V3(e,t=0,n=1,r,i){e.min=QI(e.min,t,n,r,i),e.max=QI(e.max,t,n,r,i)}function eV(e,{x:t,y:n}){V3(e.x,t.translate,t.scale,t.originPoint),V3(e.y,n.translate,n.scale,n.originPoint)}function gAe(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&&Qd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,eV(e,s)),r&&Zu(o.latestValues)&&Qd(e,o.latestValues))}t.x=XI(t.x),t.y=XI(t.y)}function XI(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Ml(e,t){e.min=e.min+t,e.max=e.max+t}function YI(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,s=tr(e.min,e.max,o);V3(e,t[n],t[r],s,t.scale)}const mAe=["x","scaleX","originX"],yAe=["y","scaleY","originY"];function Qd(e,t){YI(e.x,t,mAe),YI(e.y,t,yAe)}function tV(e,t){return ZU(pAe(e.getBoundingClientRect(),t))}function vAe(e,t,n){const r=tV(e,n),{scroll:i}=t;return i&&(Ml(r.x,i.offset.x),Ml(r.y,i.offset.y)),r}const _Ae=new WeakMap;class bAe{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(QS(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pU(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),Xs(p=>{let m=this.getAxisMotionValue(p).get()||0;if(ga.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&&An.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=SAe(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 XU(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&&An.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||!h0(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=aAe(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&&Hd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=lAe(r.layoutBox,t):this.constraints=!1,this.elastic=fAe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xs(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=dAe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hd(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=vAe(r,i.root,this.visualElement.getTransformPagePoint());let s=uAe(i.layout.layoutBox,o);if(n){const a=n(hAe(s));this.hasMutatedConstraints=!!a,a&&(s=ZU(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Xs(c=>{if(!h0(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(R4(t,r,0,n))}stopAnimation(){Xs(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){Xs(n=>{const{drag:r}=this.getProps();if(!h0(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]-tr(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Hd(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Xs(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();i[s]=cAe({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(),Xs(s=>{if(!h0(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];a.set(tr(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;_Ae.set(this.visualElement,this);const t=this.visualElement.current,n=Ja(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Hd(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=Wa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xs(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=j3,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function h0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function SAe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wAe extends Fu{constructor(t){super(t),this.removeGroupControls=ur,this.removeListeners=ur,this.controls=new bAe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ur}unmount(){this.removeGroupControls(),this.removeListeners()}}const ZI=e=>(t,n)=>{e&&An.update(()=>e(t,n))};class xAe extends Fu{constructor(){super(...arguments),this.removePointerDownListener=ur}onPointerDown(t){this.session=new XU(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ZI(t),onStart:ZI(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&An.update(()=>i(o,s))}}}mount(){this.removePointerDownListener=Ja(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 CAe(){const e=M.useContext(Hm);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 QNe(){return EAe(M.useContext(Hm))}function EAe(e){return e===null?!0:e.isPresent}const Z0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function JI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Kh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(rt.test(e))e=parseFloat(e);else return e;const n=JI(e,t.target.x),r=JI(e,t.target.y);return`${n}% ${r}%`}},TAe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Cu.parse(e);if(i.length>5)return r;const o=Cu.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=tr(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 AAe extends vn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;MTe(kAe),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()})),Z0.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()||An.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 nV(e){const[t,n]=CAe(),r=M.useContext(m4);return vn.createElement(AAe,{...e,layoutGroup:r,switchLayoutGroup:M.useContext(Yj),isPresent:t,safeToRemove:n})}const kAe={borderRadius:{...Kh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kh,borderTopRightRadius:Kh,borderBottomLeftRadius:Kh,borderBottomRightRadius:Kh,boxShadow:TAe},rV=["TopLeft","TopRight","BottomLeft","BottomRight"],PAe=rV.length,eO=e=>typeof e=="string"?parseFloat(e):e,tO=e=>typeof e=="number"||rt.test(e);function RAe(e,t,n,r,i,o){i?(e.opacity=tr(0,n.opacity!==void 0?n.opacity:1,IAe(r)),e.opacityExit=tr(t.opacity!==void 0?t.opacity:1,0,OAe(r))):o&&(e.opacity=tr(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<PAe;s++){const a=`border${rV[s]}Radius`;let l=nO(t,a),u=nO(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||tO(l)===tO(u)?(e[a]=Math.max(tr(eO(l),eO(u),r),0),(ga.test(u)||ga.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=tr(t.rotate||0,n.rotate||0,r))}function nO(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const IAe=iV(0,.5,T4),OAe=iV(.5,.95,ur);function iV(e,t,n){return r=>r<e?0:r>t?1:n(Yg(e,t,r))}function rO(e,t){e.min=t.min,e.max=t.max}function Vo(e,t){rO(e.x,t.x),rO(e.y,t.y)}function iO(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 MAe(e,t=0,n=1,r=.5,i,o=e,s=e){if(ga.test(t)&&(t=parseFloat(t),t=tr(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=tr(o.min,o.max,r);e===o&&(a-=t),e.min=iO(e.min,t,n,a,i),e.max=iO(e.max,t,n,a,i)}function oO(e,t,[n,r,i],o,s){MAe(e,t[n],t[r],t[i],t.scale,o,s)}const NAe=["x","scaleX","originX"],DAe=["y","scaleY","originY"];function sO(e,t,n,r){oO(e.x,t,NAe,n?n.x:void 0,r?r.x:void 0),oO(e.y,t,DAe,n?n.y:void 0,r?r.y:void 0)}function aO(e){return e.translate===0&&e.scale===1}function oV(e){return aO(e.x)&&aO(e.y)}function LAe(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 sV(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 lO(e){return Do(e.x)/Do(e.y)}class $Ae{constructor(){this.members=[]}add(t){I4(this.members,t),t.scheduleRender()}remove(t){if(O4(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 uO(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 FAe=(e,t)=>e.depth-t.depth;class BAe{constructor(){this.children=[],this.isDirty=!1}add(t){I4(this.children,t),this.isDirty=!0}remove(t){O4(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(FAe),this.isDirty=!1,this.children.forEach(t)}}function zAe(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(cl(r),e(o-t))};return An.read(r,!0),()=>cl(r)}function jAe(e){window.MotionDebug&&window.MotionDebug.record(e)}function UAe(e){return e instanceof SVGElement&&e.tagName!=="svg"}function VAe(e,t,n){const r=yo(e)?e:Xf(e);return r.start(R4("",r,t,n)),r.animation}const cO=["","X","Y","Z"],dO=1e3;let GAe=0;const Ju={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function aV({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=GAe++,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(WAe),this.nodes.forEach(ZAe),this.nodes.forEach(JAe),this.nodes.forEach(KAe),jAe(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 BAe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new M4),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=UAe(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=zAe(f,250),Z0.hasAnimatedSinceResize&&(Z0.hasAnimatedSinceResize=!1,this.nodes.forEach(hO))})}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()||ike,{onLayoutAnimationStart:b,onLayoutAnimationComplete:_}=c.getProps(),v=!this.targetLayout||!sV(this.targetLayout,p)||h,g=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const y={...qU(m,"layout"),onPlay:b,onComplete:_};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y)}else f||hO(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,cl(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(eke),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(fO);return}this.isUpdating||this.nodes.forEach(XAe),this.isUpdating=!1,this.nodes.forEach(YAe),this.nodes.forEach(qAe),this.nodes.forEach(HAe),this.clearAllSnapshots();const a=performance.now();Pi.delta=xu(0,1e3/60,a-Pi.timestamp),Pi.timestamp=a,Pi.isProcessing=!0,Gw.update.process(Pi),Gw.preRender.process(Pi),Gw.render.process(Pi),Pi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(QAe),this.sharedNodes.forEach(tke)}scheduleUpdateProjection(){An.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){An.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&&!oV(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)),oke(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&&(Ml(a.x,l.offset.x),Ml(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&&(Ml(a.x,-f.offset.x),Ml(a.y,-f.offset.y))}Ml(a.x,c.offset.x),Ml(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&&Qd(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Zu(c.latestValues)&&Qd(l,c.latestValues)}return Zu(this.latestValues)&&Qd(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;U3(u.latestValues)&&u.updateSnapshot();const c=Tr(),d=u.measurePageBox();Vo(c,d),sO(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Zu(this.latestValues)&&sO(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!==Pi.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=Pi.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(),sAe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vo(this.target,this.layout.layoutBox),eV(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||U3(this.parent.latestValues)||JU(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===Pi.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;gAe(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=uO(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,v=!!(m&&!_&&this.options.crossfade===!0&&!this.path.some(rke));this.animationProgress=0;let g;this.mixTargetDelta=y=>{const S=y/1e3;pO(d.x,s.x,S),pO(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),nke(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&LAe(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Tr()),Vo(g,this.relativeTarget)),m&&(this.animationValues=c,RAe(c,u,this.latestValues,S,v,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=An.update(()=>{Z0.hasAnimatedSinceResize=!0,this.currentAnimation=VAe(0,dO,{...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(dO),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&&lV(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),Qd(a,c),kp(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new $Ae),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<cO.length;c++){const d="rotate"+cO[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=Y0(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=Y0(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=uO(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 D1){if(f[m]===void 0)continue;const{correct:b,applyTo:_}=D1[m],v=u.transform==="none"?f[m]:b(f[m],d);if(_){const g=_.length;for(let y=0;y<g;y++)u[_[y]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=d===this?Y0(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(fO),this.root.sharedNodes.clear()}}}function qAe(e){e.updateLayout()}function HAe(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"?Xs(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],h=Do(f);f.min=r[d].min,f.max=f.min+h}):lV(o,n.layoutBox,r)&&Xs(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=!oV(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),sV(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 WAe(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 KAe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function QAe(e){e.clearSnapshot()}function fO(e){e.clearMeasurements()}function XAe(e){e.isLayoutDirty=!1}function YAe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZAe(e){e.resolveTargetDelta()}function JAe(e){e.calcProjection()}function eke(e){e.resetRotation()}function tke(e){e.removeLeadSnapshot()}function pO(e,t,n){e.translate=tr(t.translate,0,n),e.scale=tr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function gO(e,t,n,r){e.min=tr(t.min,n.min,r),e.max=tr(t.max,n.max,r)}function nke(e,t,n,r){gO(e.x,t.x,n.x,r),gO(e.y,t.y,n.y,r)}function rke(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ike={duration:.45,ease:[.4,0,.1,1]},mO=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),yO=mO("applewebkit/")&&!mO("chrome/")?Math.round:ur;function vO(e){e.min=yO(e.min),e.max=yO(e.max)}function oke(e){vO(e.x),vO(e.y)}function lV(e,t,n){return e==="position"||e==="preserve-aspect"&&!z3(lO(t),lO(n),.2)}const ske=aV({attachResizeListener:(e,t)=>Wa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),tx={current:void 0},uV=aV({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!tx.current){const e=new ske({});e.mount(window),e.setOptions({layoutScroll:!0}),tx.current=e}return tx.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ake={pan:{Feature:xAe},drag:{Feature:wAe,ProjectionNode:uV,MeasureLayout:nV}},lke=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function uke(e){const t=lke.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function G3(e,t,n=1){const[r,i]=uke(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return HU(s)?parseFloat(s):s}else return M3(i)?G3(i,t,n+1):i}function cke(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(!M3(o))return;const s=G3(o,r);s&&i.set(s)});for(const i in t){const o=t[i];if(!M3(o))continue;const s=G3(o,r);s&&(t[i]=s,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const dke=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cV=e=>dke.has(e),fke=e=>Object.keys(e).some(cV),_O=e=>e===ad||e===rt,bO=(e,t)=>parseFloat(e.split(", ")[t]),SO=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return bO(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?bO(o[1],e):0}},hke=new Set(["x","y","z"]),pke=Wm.filter(e=>!hke.has(e));function gke(e){const t=[];return pke.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:SO(4,13),y:SO(5,14)};Yf.translateX=Yf.x;Yf.translateY=Yf.y;const mke=(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},yke=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(cV);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=Wh(c);const f=t[l];let h;if($1(f)){const p=f.length,m=f[0]===null?1:0;c=f[m],d=Wh(c);for(let b=m;b<p&&f[b]!==null;b++)h?E4(Wh(f[b])===h):h=Wh(f[b])}else h=Wh(f);if(d!==h)if(_O(d)&&_O(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===rt&&(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=gke(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=mke(t,e,a);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),qS&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function vke(e,t,n,r){return fke(t)?yke(e,t,n,r):{target:t,transitionEnd:r}}const _ke=(e,t,n,r)=>{const i=cke(e,t,r);return t=i.target,r=i.transitionEnd,vke(e,t,n,r)},q3={current:null},dV={current:!1};function bke(){if(dV.current=!0,!!qS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>q3.current=e.matches;e.addListener(t),t()}else q3.current=!1}function Ske(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],s=n[i];if(yo(o))e.addValue(i,o),j1(r)&&r.add(i);else if(yo(s))e.addValue(i,Xf(o,{owner:e})),j1(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,Xf(a!==void 0?a:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const wO=new WeakMap,fV=Object.keys(Xg),wke=fV.length,xO=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xke=g4.length;class Cke{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=()=>An.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=WS(n),this.isVariantNode=Xj(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&&yo(f)&&(f.set(a[d],!1),j1(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,wO.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)),dV.current||bke(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:q3.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){wO.delete(this.current),this.projection&&this.projection.unmount(),cl(this.notifyUpdate),cl(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=sd.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&An.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<wke;l++){const u=fV[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=Xg[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&&Hd(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<xO.length;r++){const i=xO[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=Ske(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<xke;r++){const i=g4[r],o=this.props[i];(Qg(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=Xf(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=C4(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&&!yo(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 M4),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hV extends Cke{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=U4e(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),s&&(s=i(s))),o){z4e(this,r,s);const a=_ke(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function Eke(e){return window.getComputedStyle(e)}class Tke extends hV{readValueFromInstance(t,n){if(sd.has(n)){const r=P4(n);return r&&r.default||0}else{const r=Eke(t),i=(eU(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tV(t,n)}build(t,n,r,i){v4(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return x4(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;yo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){sU(t,n,r,i)}}class Ake extends hV{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(sd.has(n)){const r=P4(n);return r&&r.default||0}return n=aU.has(n)?n:w4(n),t.getAttribute(n)}measureInstanceViewportBox(){return Tr()}scrapeMotionValuesFromProps(t,n){return uU(t,n)}build(t,n,r,i){b4(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){lU(t,n,r,i)}mount(t){this.isSVGTag=S4(t.tagName),super.mount(t)}}const kke=(e,t)=>y4(e)?new Ake(t,{enableHardwareAcceleration:!1}):new Tke(t,{enableHardwareAcceleration:!0}),Pke={layout:{ProjectionNode:uV,MeasureLayout:nV}},Rke={...nAe,...w5e,...ake,...Pke},Ike=ITe((e,t)=>u5e(e,t,Rke,kke));function pV(){const e=M.useRef(!1);return h4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Oke(){const e=pV(),[t,n]=M.useState(0),r=M.useCallback(()=>{e.current&&n(t+1)},[t]);return[M.useCallback(()=>An.postRender(r),[r]),t]}class Mke 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 Nke({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(Mke,{isPresent:t,childRef:r,sizeRef:i},M.cloneElement(e,{ref:r}))}const nx=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=cU(Dke),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(Nke,{isPresent:n},e)),M.createElement(Hm.Provider,{value:u},e)};function Dke(){return new Map}function Lke(e){return M.useEffect(()=>()=>e(),[])}const Od=e=>e.key||"";function $ke(e,t){e.forEach(n=>{const r=Od(n);t.set(r,n)})}function Fke(e){const t=[];return M.Children.forEach(e,n=>{M.isValidElement(n)&&t.push(n)}),t}const Bke=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=M.useContext(m4).forceRender||Oke()[0],l=pV(),u=Fke(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(h4(()=>{p.current=!1,$ke(u,h),f.current=c}),Lke(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return M.createElement(M.Fragment,null,c.map(v=>M.createElement(nx,{key:Od(v),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:s},v)));c=[...c];const m=f.current.map(Od),b=u.map(Od),_=m.length;for(let v=0;v<_;v++){const g=m[v];b.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return s==="wait"&&d.size&&(c=[]),d.forEach((v,g)=>{if(b.indexOf(g)!==-1)return;const y=h.get(g);if(!y)return;const S=m.indexOf(g);let w=v;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(nx,{key:Od(y),isPresent:!1,onExitComplete:x,custom:t,presenceAffectsLayout:o,mode:s},y),d.set(g,w)}c.splice(S,0,w)}),c=c.map(v=>{const g=v.key;return d.has(g)?v:M.createElement(nx,{key:Od(v),isPresent:!0,presenceAffectsLayout:o,mode:s},v)}),M.createElement(M.Fragment,null,d.size?c:c.map(v=>M.cloneElement(v)))};var zke=A3e({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),gV=$u((e,t)=>{const n=f4("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=d4(e),u=a4("chakra-spinner",a),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${zke} ${o} linear infinite`,...n};return J.jsx(wu.div,{ref:t,__css:c,className:u,...l,children:r&&J.jsx(wu.span,{srOnly:!0,children:r})})});gV.displayName="Spinner";var H3=$u(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...s}=t;return J.jsx("img",{width:r,height:i,ref:n,alt:o,...s})});H3.displayName="NativeImage";function jke(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 k3e(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var Uke=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function Vke(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var N4=$u(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,_=jke({...t,crossOrigin:d,ignoreFallback:b}),v=Uke(_,f),g={ref:n,objectFit:l,objectPosition:a,...b?p:Vke(p,["onError","onLoad"])};return v?i||J.jsx(wu.img,{as:H3,className:"chakra-image__placeholder",src:r,...g}):J.jsx(wu.img,{as:H3,src:o,srcSet:s,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...g})});N4.displayName="Image";var mV=$u(function(t,n){const r=f4("Text",t),{className:i,align:o,decoration:s,casing:a,...l}=d4(t),u=fTe({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return J.jsx(wu.p,{ref:n,className:a4("chakra-text",t.className),...u,...l,__css:r})});mV.displayName="Text";var W3=$u(function(t,n){const r=f4("Heading",t),{className:i,...o}=d4(t);return J.jsx(wu.h2,{ref:n,className:a4("chakra-heading",t.className),...o,__css:r})});W3.displayName="Heading";var V1=wu("div");V1.displayName="Box";var yV=$u(function(t,n){const{size:r,centerContent:i=!0,...o}=t,s=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return J.jsx(V1,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});yV.displayName="Square";var Gke=$u(function(t,n){const{size:r,...i}=t;return J.jsx(yV,{size:r,ref:n,borderRadius:"9999px",...i})});Gke.displayName="Circle";var D4=$u(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 J.jsx(wu.div,{ref:n,__css:d,...c})});D4.displayName="Flex";const qke=""+new URL("logo-13003d72.png",import.meta.url).href,Hke=()=>J.jsxs(D4,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[J.jsx(N4,{src:qke,w:"8rem",h:"8rem"}),J.jsx(gV,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),Wke=M.memo(Hke);function K3(e){"@babel/helpers - typeof";return K3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K3(e)}var vV=[],Kke=vV.forEach,Qke=vV.slice;function Q3(e){return Kke.call(Qke.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function _V(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":K3(XMLHttpRequest))==="object"}function Xke(e){return!!e&&typeof e.then=="function"}function Yke(e){return Xke(e)?e:Promise.resolve(e)}function Zke(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 X3={exports:{}},p0={exports:{}},CO;function Jke(){return CO||(CO=1,function(e,t){var n=typeof self<"u"?self:ft,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 k={next:function(){var D=E.shift();return{done:D===void 0,value:D}}};return a.iterable&&(k[Symbol.iterator]=function(){return k}),k}function p(E){this.map={},E instanceof p?E.forEach(function(k,D){this.append(D,k)},this):Array.isArray(E)?E.forEach(function(k){this.append(k[0],k[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(k){this.append(k,E[k])},this)}p.prototype.append=function(E,k){E=d(E),k=f(k);var D=this.map[E];this.map[E]=D?D+", "+k:k},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,k){this.map[d(E)]=f(k)},p.prototype.forEach=function(E,k){for(var D in this.map)this.map.hasOwnProperty(D)&&E.call(k,this.map[D],D,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(k,D){E.push(D)}),h(E)},p.prototype.values=function(){var E=[];return this.forEach(function(k){E.push(k)}),h(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(k,D){E.push([D,k])}),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(k,D){E.onload=function(){k(E.result)},E.onerror=function(){D(E.error)}})}function _(E){var k=new FileReader,D=b(k);return k.readAsArrayBuffer(E),D}function v(E){var k=new FileReader,D=b(k);return k.readAsText(E),D}function g(E){for(var k=new Uint8Array(E),D=new Array(k.length),$=0;$<k.length;$++)D[$]=String.fromCharCode(k[$]);return D.join("")}function y(E){if(E.slice)return E.slice(0);var k=new Uint8Array(E.byteLength);return k.set(new Uint8Array(E)),k.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=y(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||c(E))?this._bodyArrayBuffer=y(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 v(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 k=E.toUpperCase();return w.indexOf(k)>-1?k:E}function C(E,k){k=k||{};var D=k.body;if(E instanceof C){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,k.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=k.credentials||this.credentials||"same-origin",(k.headers||!this.headers)&&(this.headers=new p(k.headers)),this.method=x(k.method||this.method||"GET"),this.mode=k.mode||this.mode||null,this.signal=k.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 k=new FormData;return E.trim().split("&").forEach(function(D){if(D){var $=D.split("="),O=$.shift().replace(/\+/g," "),I=$.join("=").replace(/\+/g," ");k.append(decodeURIComponent(O),decodeURIComponent(I))}}),k}function T(E){var k=new p,D=E.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function($){var O=$.split(":"),I=O.shift().trim();if(I){var N=O.join(":").trim();k.append(I,N)}}),k}S.call(C.prototype);function P(E,k){k||(k={}),this.type="default",this.status=k.status===void 0?200:k.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in k?k.statusText:"OK",this.headers=new p(k.headers),this.url=k.url||"",this._initBody(E)}S.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},P.error=function(){var E=new P(null,{status:0,statusText:""});return E.type="error",E};var L=[301,302,303,307,308];P.redirect=function(E,k){if(L.indexOf(k)===-1)throw new RangeError("Invalid status code");return new P(null,{status:k,headers:{location:E}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(k,D){this.message=k,this.name=D;var $=Error(k);this.stack=$.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function R(E,k){return new Promise(function(D,$){var O=new C(E,k);if(O.signal&&O.signal.aborted)return $(new s.DOMException("Aborted","AbortError"));var I=new XMLHttpRequest;function N(){I.abort()}I.onload=function(){var B={status:I.status,statusText:I.statusText,headers:T(I.getAllResponseHeaders()||"")};B.url="responseURL"in I?I.responseURL:B.headers.get("X-Request-URL");var U="response"in I?I.response:I.responseText;D(new P(U,B))},I.onerror=function(){$(new TypeError("Network request failed"))},I.ontimeout=function(){$(new TypeError("Network request failed"))},I.onabort=function(){$(new s.DOMException("Aborted","AbortError"))},I.open(O.method,O.url,!0),O.credentials==="include"?I.withCredentials=!0:O.credentials==="omit"&&(I.withCredentials=!1),"responseType"in I&&a.blob&&(I.responseType="blob"),O.headers.forEach(function(B,U){I.setRequestHeader(U,B)}),O.signal&&(O.signal.addEventListener("abort",N),I.onreadystatechange=function(){I.readyState===4&&O.signal.removeEventListener("abort",N)}),I.send(typeof O._bodyInit>"u"?null:O._bodyInit)})}return R.polyfill=!0,o.fetch||(o.fetch=R,o.Headers=p,o.Request=C,o.Response=P),s.Headers=p,s.Request=C,s.Response=P,s.fetch=R,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}(p0,p0.exports)),p0.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof ft<"u"&&ft.fetch?n=ft.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof Zke<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||Jke();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(X3,X3.exports);var bV=X3.exports;const SV=jc(bV),EO=GO({__proto__:null,default:SV},[bV]);function G1(e){"@babel/helpers - typeof";return G1=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},G1(e)}var tl;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?tl=global.fetch:typeof window<"u"&&window.fetch?tl=window.fetch:tl=fetch);var Zg;_V()&&(typeof global<"u"&&global.XMLHttpRequest?Zg=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Zg=window.XMLHttpRequest));var q1;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?q1=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(q1=window.ActiveXObject));!tl&&EO&&!Zg&&!q1&&(tl=SV||EO);typeof tl!="function"&&(tl=void 0);var Y3=function(t,n){if(n&&G1(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},TO=function(t,n,r){tl(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)},AO=!1,ePe=function(t,n,r,i){t.queryStringParams&&(n=Y3(n,t.queryStringParams));var o=Q3({},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=Q3({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},AO?{}:s);try{TO(n,a,i)}catch(l){if(!s||Object.keys(s).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(s).forEach(function(u){delete a[u]}),TO(n,a,i),AO=!0}catch(u){i(u)}}},tPe=function(t,n,r,i){r&&G1(r)==="object"&&(r=Y3("",r).slice(1)),t.queryStringParams&&(n=Y3(n,t.queryStringParams));try{var o;Zg?o=new Zg:o=new q1("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)}},nPe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},tl&&n.indexOf("file:")!==0)return ePe(t,n,r,i);if(_V()||typeof ActiveXObject=="function")return tPe(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 rPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wV(r.key),r)}}function iPe(e,t,n){return t&&kO(e.prototype,t),n&&kO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oPe(e,t,n){return t=wV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wV(e){var t=sPe(e,"string");return Jg(t)==="symbol"?t:String(t)}function sPe(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 aPe=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 oPe({},r,i||"")},parseLoadPayload:function(n,r){},request:nPe,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},xV=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]:{};rPe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return iPe(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=Q3(i,this.options||{},aPe()),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=Yke(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}();xV.type="backend";const lPe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uPe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},cPe=e=>uPe[e],dPe=e=>e.replace(lPe,cPe);let Z3={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:dPe};function fPe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Z3={...Z3,...e}}function YNe(){return Z3}let CV;function hPe(e){CV=e}function ZNe(){return CV}const pPe={type:"3rdParty",init(e){fPe(e.options.react),hPe(e)}};we.use(xV).use(pPe).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const YS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _h(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function L4(e){return"nodeType"in e}function Zi(e){var t,n;return e?_h(e)?e:L4(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function $4(e){const{Document:t}=Zi(e);return e instanceof t}function Ym(e){return _h(e)?!1:e instanceof Zi(e).HTMLElement}function gPe(e){return e instanceof Zi(e).SVGElement}function bh(e){return e?_h(e)?e.document:L4(e)?$4(e)?e:Ym(e)?e.ownerDocument:document:document:document}const ba=YS?M.useLayoutEffect:M.useEffect;function ZS(e){const t=M.useRef(e);return ba(()=>{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 mPe(){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 ba(()=>{n.current!==e&&(n.current=e)},t),n}function Zm(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=ZS(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 W1(e){const t=M.useRef();return M.useEffect(()=>{t.current=e},[e]),t.current}let rx={};function JS(e,t){return M.useMemo(()=>{if(t)return t;const n=rx[e]==null?0:rx[e]+1;return rx[e]=n,e+"-"+n},[e,t])}function EV(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 Sf=EV(1),K1=EV(-1);function yPe(e){return"clientX"in e&&"clientY"in e}function F4(e){if(!e)return!1;const{KeyboardEvent:t}=Zi(e.target);return t&&e instanceof t}function vPe(e){if(!e)return!1;const{TouchEvent:t}=Zi(e.target);return t&&e instanceof t}function tm(e){if(vPe(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 yPe(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}}}),PO="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _Pe(e){return e.matches(PO)?e:e.querySelector(PO)}const bPe={display:"none"};function SPe(e){let{id:t,value:n}=e;return vn.createElement("div",{id:t,style:bPe},n)}const wPe={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 xPe(e){let{id:t,announcement:n}=e;return vn.createElement("div",{id:t,style:wPe,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function CPe(){const[e,t]=M.useState("");return{announce:M.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const TV=M.createContext(null);function EPe(e){const t=M.useContext(TV);M.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function TPe(){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 APe={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.
|
||
`},kPe={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 PPe(e){let{announcements:t=kPe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=APe}=e;const{announce:o,announcement:s}=CPe(),a=JS("DndLiveRegion"),[l,u]=M.useState(!1);if(M.useEffect(()=>{u(!0)},[]),EPe(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=vn.createElement(vn.Fragment,null,vn.createElement(SPe,{id:r,value:i.draggable}),vn.createElement(xPe,{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 Q1(){}function RO(e,t){return M.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function RPe(){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 Fs=Object.freeze({x:0,y:0});function IPe(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function OPe(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 MPe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function NPe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function DPe(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 LPe(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function $Pe(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 FPe=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=$Pe(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(NPe)};function BPe(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 zPe=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&&BPe(r,a)){const u=DPe(a).reduce((d,f)=>d+IPe(r,f),0),c=Number((u/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:c}})}}return i.sort(MPe)};function jPe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function AV(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Fs}function UPe(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 VPe=UPe(1);function kV(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 GPe(e,t,n){const r=kV(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 qPe={ignoreTransform:!1};function Jm(e,t){t===void 0&&(t=qPe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=Zi(e).getComputedStyle(e);u&&(n=GPe(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 IO(e){return Jm(e,{ignoreTransform:!0})}function HPe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function WPe(e,t){return t===void 0&&(t=Zi(e).getComputedStyle(e)),t.position==="fixed"}function KPe(e,t){t===void 0&&(t=Zi(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 B4(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if($4(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Ym(i)||gPe(i)||n.includes(i))return n;const o=Zi(e).getComputedStyle(i);return i!==e&&KPe(i,o)&&n.push(i),WPe(i,o)?n:r(i.parentNode)}return e?r(e):n}function PV(e){const[t]=B4(e,1);return t??null}function ix(e){return!YS||!e?null:_h(e)?e:L4(e)?$4(e)||e===bh(e).scrollingElement?window:Ym(e)?e:null:null}function RV(e){return _h(e)?e.scrollX:e.scrollLeft}function IV(e){return _h(e)?e.scrollY:e.scrollTop}function J3(e){return{x:RV(e),y:IV(e)}}var Jr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Jr||(Jr={}));function OV(e){return!YS||!e?!1:e===document.scrollingElement}function MV(e){const t={x:0,y:0},n=OV(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 QPe={x:.2,y:.2};function XPe(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=QPe);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=MV(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=Jr.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!c&&l>=t.bottom-m.height&&(h.y=Jr.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&a>=t.right-m.width?(h.x=Jr.Forward,p.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&s<=t.left+m.width&&(h.x=Jr.Backward,p.x=r*Math.abs((t.left+m.width-s)/m.width)),{direction:h,speed:p}}function YPe(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 NV(e){return e.reduce((t,n)=>Sf(t,J3(n)),Fs)}function ZPe(e){return e.reduce((t,n)=>t+RV(n),0)}function JPe(e){return e.reduce((t,n)=>t+IV(n),0)}function DV(e,t){if(t===void 0&&(t=Jm),!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 e6e=[["x",["left","right"],ZPe],["y",["top","bottom"],JPe]];class z4{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=B4(n),i=NV(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of e6e)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 t6e(e){const{EventTarget:t}=Zi(e);return e instanceof t?e:bh(e)}function ox(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 qo;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(qo||(qo={}));function OO(e){e.preventDefault()}function n6e(e){e.stopPropagation()}var En;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(En||(En={}));const LV={start:[En.Space,En.Enter],cancel:[En.Esc],end:[En.Space,En.Enter]},r6e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case En.Right:return{...n,x:n.x+25};case En.Left:return{...n,x:n.x-25};case En.Down:return{...n,y:n.y+25};case En.Up:return{...n,y:n.y-25}}};class $V{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(bh(n)),this.windowListeners=new Rp(Zi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qo.Resize,this.handleCancel),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&DV(r),n(Fs)}handleKeyDown(t){if(F4(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=LV,coordinateGetter:s=r6e,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}:Fs;this.referenceCoordinates||(this.referenceCoordinates=c);const d=s(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=K1(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const b=t.code,{isTop:_,isRight:v,isLeft:g,isBottom:y,maxScroll:S,minScroll:w}=MV(m),x=YPe(m),C={x:Math.min(b===En.Right?x.right-x.width/2:x.right,Math.max(b===En.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(b===En.Down?x.bottom-x.height/2:x.bottom,Math.max(b===En.Down?x.top:x.top+x.height/2,d.y))},A=b===En.Right&&!v||b===En.Left&&!g,T=b===En.Down&&!y||b===En.Up&&!_;if(A&&C.x!==d.x){const P=m.scrollLeft+f.x,L=b===En.Right&&P<=S.x||b===En.Left&&P>=w.x;if(L&&!f.y){m.scrollTo({left:P,behavior:a});return}L?h.x=m.scrollLeft-P:h.x=b===En.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 P=m.scrollTop+f.y,L=b===En.Down&&P<=S.y||b===En.Up&&P>=w.y;if(L&&!f.x){m.scrollTo({top:P,behavior:a});return}L?h.y=m.scrollTop-P:h.y=b===En.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Sf(K1(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()}}$V.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=LV,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 MO(e){return!!(e&&"distance"in e)}function NO(e){return!!(e&&"delay"in e)}class j4{constructor(t,n,r){var i;r===void 0&&(r=t6e(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=bh(s),this.documentListeners=new Rp(this.document),this.listeners=new Rp(r),this.windowListeners=new Rp(Zi(s)),this.initialCoordinates=(i=tm(o))!=null?i:Fs,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(qo.Resize,this.handleCancel),this.windowListeners.add(qo.DragStart,OO),this.windowListeners.add(qo.VisibilityChange,this.handleCancel),this.windowListeners.add(qo.ContextMenu,OO),this.documentListeners.add(qo.Keydown,this.handleKeydown),n){if(MO(n))return;if(NO(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(qo.Click,n6e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qo.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:Fs,u=K1(i,l);if(!r&&a){if(NO(a))return ox(u,a.tolerance)?this.handleCancel():void 0;if(MO(a))return a.tolerance!=null&&ox(u,a.tolerance)?this.handleCancel():ox(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===En.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const i6e={move:{name:"pointermove"},end:{name:"pointerup"}};class FV extends j4{constructor(t){const{event:n}=t,r=bh(n.target);super(t,i6e,r)}}FV.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 o6e={move:{name:"mousemove"},end:{name:"mouseup"}};var eE;(function(e){e[e.RightClick=2]="RightClick"})(eE||(eE={}));class BV extends j4{constructor(t){super(t,o6e,bh(t.event.target))}}BV.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===eE.RightClick?!1:(r==null||r({event:n}),!0)}}];const sx={move:{name:"touchmove"},end:{name:"touchend"}};class zV extends j4{constructor(t){super(t,sx)}static setup(){return window.addEventListener(sx.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(sx.move.name,t)};function t(){}}}zV.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Ip;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ip||(Ip={}));var X1;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(X1||(X1={}));function s6e(e){let{acceleration:t,activator:n=Ip.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=l6e({delta:d,disabled:!o}),[p,m]=mPe(),b=M.useRef({x:0,y:0}),_=M.useRef({x:0,y:0}),v=M.useMemo(()=>{switch(n){case Ip.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ip.DraggableRect:return i}},[n,i,l]),g=M.useRef(null),y=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||!v){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}=XPe(w,C,v,t,f);for(const P of["x","y"])h[P][A[P]]||(T[P]=0,A[P]=0);if(T.x>0||T.y>0){m(),g.current=w,p(y,s),b.current=T,_.current=A;return}}b.current={x:0,y:0},_.current={x:0,y:0},m()},[t,y,r,m,o,s,JSON.stringify(v),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const a6e={x:{[Jr.Backward]:!1,[Jr.Forward]:!1},y:{[Jr.Backward]:!1,[Jr.Forward]:!1}};function l6e(e){let{delta:t,disabled:n}=e;const r=W1(t);return Zm(i=>{if(n||!r||!i)return a6e;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Jr.Backward]:i.x[Jr.Backward]||o.x===-1,[Jr.Forward]:i.x[Jr.Forward]||o.x===1},y:{[Jr.Backward]:i.y[Jr.Backward]||o.y===-1,[Jr.Forward]:i.y[Jr.Forward]||o.y===1}}},[n,t,r])}function u6e(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Zm(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function c6e(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 tE;(function(e){e.Optimized="optimized"})(tE||(tE={}));const DO=new Map;function d6e(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(v=>v===null?_:v.concat(_.filter(g=>!v.includes(g))))},[f]),p=M.useRef(null),m=Zm(_=>{if(d&&!n)return DO;if(!_||_===DO||c.current!==e||o!=null){const v=new Map;for(let g of e){if(!g)continue;if(o&&o.length>0&&!o.includes(g.id)&&g.rect.current){v.set(g.id,g.rect.current);continue}const y=g.node.current,S=y?new z4(l(y),y):null;g.rect.current=S,S&&v.set(g.id,S)}return v}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 U4(e,t){return Zm(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function f6e(e,t){return U4(e,t)}function h6e(e){let{callback:t,disabled:n}=e;const r=ZS(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 e2(e){let{callback:t,disabled:n}=e;const r=ZS(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 p6e(e){return new z4(Jm(e),e)}function LO(e,t,n){t===void 0&&(t=p6e);const[r,i]=M.useReducer(a,null),o=h6e({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=e2({callback:i});return ba(()=>{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 g6e(e){const t=U4(e);return AV(e,t)}const $O=[];function m6e(e){const t=M.useRef(e),n=Zm(r=>e?r&&r!==$O&&e&&t.current&&e.parentNode===t.current.parentNode?r:B4(e):$O,[e]);return M.useEffect(()=>{t.current=e},[e]),n}function y6e(e){const[t,n]=M.useState(null),r=M.useRef(e),i=M.useCallback(o=>{const s=ix(o.target);s&&n(a=>a?(a.set(s,J3(s)),new Map(a)):null)},[]);return M.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const u=ix(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,J3(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=ix(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),M.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>Sf(o,s),Fs):NV(e):Fs,[e,t])}function FO(e,t){t===void 0&&(t=[]);const n=M.useRef(null);return M.useEffect(()=>{n.current=null},t),M.useEffect(()=>{const r=e!==Fs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?K1(e,n.current):Fs}function v6e(e){M.useEffect(()=>{if(!YS)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 _6e(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 jV(e){return M.useMemo(()=>e?HPe(e):null,[e])}const ax=[];function b6e(e,t){t===void 0&&(t=Jm);const[n]=e,r=jV(n?Zi(n):null),[i,o]=M.useReducer(a,ax),s=e2({callback:o});return e.length>0&&i===ax&&o(),ba(()=>{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=>OV(l)?r:new z4(t(l),l)):ax}}function UV(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ym(t)?t:e}function S6e(e){let{measure:t}=e;const[n,r]=M.useState(null),i=M.useCallback(u=>{for(const{target:c}of u)if(Ym(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=e2({callback:i}),s=M.useCallback(u=>{const c=UV(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 w6e=[{sensor:FV,options:{}},{sensor:$V,options:{}}],x6e={current:{}},J0={draggable:{measure:IO},droppable:{measure:IO,strategy:rm.WhileDragging,frequency:tE.Optimized},dragOverlay:{measure:Jm}};class Op 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 C6e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Op,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Q1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:J0,measureDroppableContainers:Q1,windowRect:null,measuringScheduled:!1},VV={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Q1,draggableNodes:new Map,over:null,measureDroppableContainers:Q1},ey=M.createContext(VV),GV=M.createContext(C6e);function E6e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Op}}}function T6e(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 Op(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 Op(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 Op(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function A6e(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=M.useContext(ey),o=W1(r),s=W1(n==null?void 0:n.id);return M.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!F4(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=_Pe(c);if(d){d.focus();break}}})}},[r,t,i,s,o]),null}function qV(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function k6e(e){return M.useMemo(()=>({draggable:{...J0.draggable,...e==null?void 0:e.draggable},droppable:{...J0.droppable,...e==null?void 0:e.droppable},dragOverlay:{...J0.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 P6e(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;ba(()=>{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=AV(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 t2=M.createContext({...Fs,scaleX:1,scaleY:1});var Nl;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Nl||(Nl={}));const R6e=M.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:c=w6e,collisionDetection:d=FPe,measuring:f,modifiers:h,...p}=t;const m=M.useReducer(T6e,void 0,E6e),[b,_]=m,[v,g]=TPe(),[y,S]=M.useState(Nl.Uninitialized),w=y===Nl.Initialized,{draggable:{active:x,nodes:C,translate:A},droppable:{containers:T}}=b,P=x?C.get(x):null,L=M.useRef({initial:null,translated:null}),R=M.useMemo(()=>{var In;return x!=null?{id:x,data:(In=P==null?void 0:P.data)!=null?In:x6e,rect:L}:null},[x,P]),E=M.useRef(null),[k,D]=M.useState(null),[$,O]=M.useState(null),I=em(p,Object.values(p)),N=JS("DndDescribedBy",s),B=M.useMemo(()=>T.getEnabled(),[T]),U=k6e(f),{droppableRects:G,measureDroppableContainers:Q,measuringScheduled:Z}=d6e(B,{dragging:w,dependencies:[A.x,A.y],config:U.droppable}),Y=u6e(C,x),j=M.useMemo(()=>$?tm($):null,[$]),W=ka(),te=f6e(Y,U.draggable.measure);P6e({activeNode:x?C.get(x):null,config:W.layoutShiftCompensation,initialRect:te,measure:U.draggable.measure});const oe=LO(Y,U.draggable.measure,te),ye=LO(Y?Y.parentElement:null),le=M.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pt=T.getNodeFor((n=le.current.over)==null?void 0:n.id),nt=S6e({measure:U.dragOverlay.measure}),Fe=(r=nt.nodeRef.current)!=null?r:Y,ct=w?(i=nt.rect)!=null?i:oe:null,ke=!!(nt.nodeRef.current&&nt.rect),Qt=g6e(ke?null:oe),br=jV(Fe?Zi(Fe):null),kn=m6e(w?pt??Y:null),bn=b6e(kn),Xt=qV(h,{transform:{x:A.x-Qt.x,y:A.y-Qt.y,scaleX:1,scaleY:1},activatorEvent:$,active:R,activeNodeRect:oe,containerNodeRect:ye,draggingNodeRect:ct,over:le.current.over,overlayNodeRect:nt.rect,scrollableAncestors:kn,scrollableAncestorRects:bn,windowRect:br}),Pn=j?Sf(j,A):null,Sr=y6e(kn),Ji=FO(Sr),Vr=FO(Sr,[oe]),or=Sf(Xt,Ji),Ir=ct?VPe(ct,Xt):null,Gr=R&&Ir?d({active:R,collisionRect:Ir,droppableRects:G,droppableContainers:B,pointerCoordinates:Pn}):null,Rn=LPe(Gr,"id"),[hn,wi]=M.useState(null),ii=ke?Xt:Sf(Xt,Vr),Bi=jPe(ii,(o=hn==null?void 0:hn.rect)!=null?o:null,oe),fs=M.useCallback((In,Yt)=>{let{sensor:Or,options:xr}=Yt;if(E.current==null)return;const Cr=C.get(E.current);if(!Cr)return;const qr=In.nativeEvent,xi=new Or({active:E.current,activeNode:Cr,event:qr,options:xr,context:le,onStart(oi){const Mr=E.current;if(Mr==null)return;const hs=C.get(Mr);if(!hs)return;const{onDragStart:Us}=I.current,si={active:{id:Mr,data:hs.data,rect:L}};ws.unstable_batchedUpdates(()=>{Us==null||Us(si),S(Nl.Initializing),_({type:$r.DragStart,initialCoordinates:oi,active:Mr}),v({type:"onDragStart",event:si})})},onMove(oi){_({type:$r.DragMove,coordinates:oi})},onEnd:to($r.DragEnd),onCancel:to($r.DragCancel)});ws.unstable_batchedUpdates(()=>{D(xi),O(In.nativeEvent)});function to(oi){return async function(){const{active:hs,collisions:Us,over:si,scrollAdjustedTranslate:vl}=le.current;let Bo=null;if(hs&&vl){const{cancelDrop:Hr}=I.current;Bo={activatorEvent:qr,active:hs,collisions:Us,delta:vl,over:si},oi===$r.DragEnd&&typeof Hr=="function"&&await Promise.resolve(Hr(Bo))&&(oi=$r.DragCancel)}E.current=null,ws.unstable_batchedUpdates(()=>{_({type:oi}),S(Nl.Uninitialized),wi(null),D(null),O(null);const Hr=oi===$r.DragEnd?"onDragEnd":"onDragCancel";if(Bo){const Pa=I.current[Hr];Pa==null||Pa(Bo),v({type:Hr,event:Bo})}})}}},[C]),wr=M.useCallback((In,Yt)=>(Or,xr)=>{const Cr=Or.nativeEvent,qr=C.get(xr);if(E.current!==null||!qr||Cr.dndKit||Cr.defaultPrevented)return;const xi={active:qr};In(Or,Yt.options,xi)===!0&&(Cr.dndKit={capturedBy:Yt.sensor},E.current=xr,fs(Or,Yt))},[C,fs]),eo=c6e(c,wr);v6e(c),ba(()=>{oe&&y===Nl.Initializing&&S(Nl.Initialized)},[oe,y]),M.useEffect(()=>{const{onDragMove:In}=I.current,{active:Yt,activatorEvent:Or,collisions:xr,over:Cr}=le.current;if(!Yt||!Or)return;const qr={active:Yt,activatorEvent:Or,collisions:xr,delta:{x:or.x,y:or.y},over:Cr};ws.unstable_batchedUpdates(()=>{In==null||In(qr),v({type:"onDragMove",event:qr})})},[or.x,or.y]),M.useEffect(()=>{const{active:In,activatorEvent:Yt,collisions:Or,droppableContainers:xr,scrollAdjustedTranslate:Cr}=le.current;if(!In||E.current==null||!Yt||!Cr)return;const{onDragOver:qr}=I.current,xi=xr.get(Rn),to=xi&&xi.rect.current?{id:xi.id,rect:xi.rect.current,data:xi.data,disabled:xi.disabled}:null,oi={active:In,activatorEvent:Yt,collisions:Or,delta:{x:Cr.x,y:Cr.y},over:to};ws.unstable_batchedUpdates(()=>{wi(to),qr==null||qr(oi),v({type:"onDragOver",event:oi})})},[Rn]),ba(()=>{le.current={activatorEvent:$,active:R,activeNode:Y,collisionRect:Ir,collisions:Gr,droppableRects:G,draggableNodes:C,draggingNode:Fe,draggingNodeRect:ct,droppableContainers:T,over:hn,scrollableAncestors:kn,scrollAdjustedTranslate:or},L.current={initial:ct,translated:Ir}},[R,Y,Gr,Ir,C,Fe,ct,G,T,hn,kn,or]),s6e({...W,delta:A,draggingRect:Ir,pointerCoordinates:Pn,scrollableAncestors:kn,scrollableAncestorRects:bn});const Aa=M.useMemo(()=>({active:R,activeNode:Y,activeNodeRect:oe,activatorEvent:$,collisions:Gr,containerNodeRect:ye,dragOverlay:nt,draggableNodes:C,droppableContainers:T,droppableRects:G,over:hn,measureDroppableContainers:Q,scrollableAncestors:kn,scrollableAncestorRects:bn,measuringConfiguration:U,measuringScheduled:Z,windowRect:br}),[R,Y,oe,$,Gr,ye,nt,C,T,G,hn,Q,kn,bn,U,Z,br]),vo=M.useMemo(()=>({activatorEvent:$,activators:eo,active:R,activeNodeRect:oe,ariaDescribedById:{draggable:N},dispatch:_,draggableNodes:C,over:hn,measureDroppableContainers:Q}),[$,eo,R,oe,_,N,C,hn,Q]);return vn.createElement(TV.Provider,{value:g},vn.createElement(ey.Provider,{value:vo},vn.createElement(GV.Provider,{value:Aa},vn.createElement(t2.Provider,{value:Bi},u)),vn.createElement(A6e,{disabled:(a==null?void 0:a.restoreFocus)===!1})),vn.createElement(PPe,{...a,hiddenTextDescribedById:N}));function ka(){const In=(k==null?void 0:k.autoScrollEnabled)===!1,Yt=typeof l=="object"?l.enabled===!1:l===!1,Or=w&&!In&&!Yt;return typeof l=="object"?{...l,enabled:Or}:{enabled:Or}}}),I6e=M.createContext(null),BO="button",O6e="Droppable";function JNe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=JS(O6e),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=M.useContext(ey),{role:h=BO,roleDescription:p="draggable",tabIndex:m=0}=i??{},b=(l==null?void 0:l.id)===t,_=M.useContext(b?t2:I6e),[v,g]=H1(),[y,S]=H1(),w=_6e(s,t),x=em(n);ba(()=>(d.set(t,{id:t,key:o,node:v,activatorNode:y,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===BO?!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:v,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:_}}function M6e(){return M.useContext(GV)}const N6e="Droppable",D6e={timeout:25};function e7e(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=JS(N6e),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=M.useContext(ey),c=M.useRef({disabled:n}),d=M.useRef(!1),f=M.useRef(null),h=M.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:b}={...D6e,...i},_=em(m??r),v=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=e2({callback:v,disabled:p||!s}),y=M.useCallback((C,A)=>{g&&(A&&(g.unobserve(A),d.current=!1),C&&g.observe(C))},[g]),[S,w]=H1(y),x=em(t);return M.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),ba(()=>(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 L6e(e){let{animation:t,children:n}=e;const[r,i]=M.useState(null),[o,s]=M.useState(null),a=W1(n);return!n&&!r&&a&&i(a),ba(()=>{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]),vn.createElement(vn.Fragment,null,n,r?M.cloneElement(r,{ref:s}):null)}const $6e={x:0,y:0,scaleX:1,scaleY:1};function F6e(e){let{children:t}=e;return vn.createElement(ey.Provider,{value:VV},vn.createElement(t2.Provider,{value:$6e},t))}const B6e={position:"fixed",touchAction:"none"},z6e=e=>F4(e)?"transform 250ms ease":void 0,j6e=M.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:s,rect:a,style:l,transform:u,transition:c=z6e}=e;if(!a)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...B6e,width:a.width,height:a.height,top:a.top,left:a.left,transform:nm.Transform.toString(d),transformOrigin:i&&r?OPe(r,a):void 0,transition:typeof c=="function"?c(r):c,...l};return vn.createElement(n,{className:s,style:f,ref:t},o)}),U6e=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)}},V6e=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:nm.Transform.toString(t)},{transform:nm.Transform.toString(n)}]},G6e={duration:250,easing:"ease",keyframes:V6e,sideEffects:U6e({styles:{active:{opacity:"0"}}})};function q6e(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ZS((o,s)=>{if(t===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const u=UV(s);if(!u)return;const{transform:c}=Zi(s).getComputedStyle(s),d=kV(c);if(!d)return;const f=typeof t=="function"?t:H6e(t);return DV(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 H6e(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...G6e,...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(v=>{_.onfinish=()=>{b==null||b(),v()}})}}let zO=0;function W6e(e){return M.useMemo(()=>{if(e!=null)return zO++,zO},[e])}const K6e=vn.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:v,scrollableAncestors:g,scrollableAncestorRects:y,windowRect:S}=M6e(),w=M.useContext(t2),x=W6e(d==null?void 0:d.id),C=qV(s,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:b.rect,over:_,overlayNodeRect:b.rect,scrollableAncestors:g,scrollableAncestorRects:y,transform:w,windowRect:S}),A=U4(f),T=q6e({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:v}),P=A?b.setRef:void 0;return vn.createElement(F6e,null,vn.createElement(L6e,{animation:T},d&&x?vn.createElement(j6e,{key:x,id:d.id,ref:P,as:a,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:A,style:{zIndex:u,...i},transform:C},n):null))}),Q6e=()=>M$(),X6e=E$,Y6e=Di([Qxe,q5],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),Z6e=()=>{const e=X6e(Y6e);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 J6e(e){return J.jsx(R6e,{...e})}const g0=28,jO={w:g0,h:g0,maxW:g0,maxH:g0,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},e8e=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return J.jsx(V1,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:J.jsx(mV,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return J.jsx(V1,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:J.jsx(N4,{sx:{...jO},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?J.jsxs(D4,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...jO},children:[J.jsx(W3,{children:e.dragData.payload.imageDTOs.length}),J.jsx(W3,{size:"sm",children:"Images"})]}):null},t8e=M.memo(e8e),n8e=e=>{const[t,n]=M.useState(null),r=pe("images"),i=Q6e(),o=M.useCallback(d=>{r.trace({dragData:$t(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:$t(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(ij({overData:f,activeData:t})),n(null))},[t,i,r]),a=RO(BV,{activationConstraint:{distance:10}}),l=RO(zV,{activationConstraint:{distance:10}}),u=RPe(a,l),c=Z6e();return J.jsxs(J6e,{onDragStart:o,onDragEnd:s,sensors:u,collisionDetection:zPe,autoScroll:!1,children:[e.children,J.jsx(K6e,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"none",userSelect:"none",padding:"10rem"},children:J.jsx(Bke,{children:t&&J.jsx(Ike.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:J.jsx(t8e,{dragData:t})},"overlay-drag-image")})})]})},r8e=M.memo(n8e),UO=xa(void 0),VO=xa(void 0),i8e=M.lazy(()=>iN(()=>import("./App-d1618477.js"),["./App-d1618477.js","./menu-f1d42c75.js","./App-6125620a.css"],import.meta.url)),o8e=M.lazy(()=>iN(()=>import("./ThemeLocaleProvider-640fdd9b.js"),["./ThemeLocaleProvider-640fdd9b.js","./menu-f1d42c75.js","./ThemeLocaleProvider-90f0fcd3.css"],import.meta.url)),s8e=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:s,selectedImage:a,customStarUi:l})=>(M.useEffect(()=>(t&&Lf.set(t),e&&vg.set(e),o&&_g.set(o),s&&pr.set(s),rz(),i&&i.length>0?r3(eI(),...i):r3(eI()),()=>{vg.set(void 0),Lf.set(void 0),_g.set(void 0),pr.set(kD)}),[e,t,i,o,s]),M.useEffect(()=>(l&&UO.set(l),()=>{UO.set(void 0)}),[l]),M.useEffect(()=>(r&&VO.set(r),()=>{VO.set(void 0)}),[r]),J.jsx(vn.StrictMode,{children:J.jsx(Tde,{store:lj,children:J.jsx(vn.Suspense,{fallback:J.jsx(Wke,{}),children:J.jsx(o8e,{children:J.jsx(r8e,{children:J.jsx(i8e,{config:n,selectedImage:a})})})})})})),a8e=M.memo(s8e);lx.createRoot(document.getElementById("root")).render(J.jsx(a8e,{}));export{u1 as $,go as A,ou as B,Ys as C,$Oe as D,_5 as E,Uxe as F,$u as G,P3e as H,wu as I,a4 as J,FNe as K,DNe as L,Bke as M,Ike as N,KNe as O,lme as P,d4 as Q,gV as R,og as S,f4 as T,LNe as U,$Ne as V,k3e as W,A3e as X,BNe as Y,hc as Z,jc as _,lT as a,OMe as a$,DH as a0,vn as a1,tTe as a2,WNe as a3,fTe as a4,Za as a5,$j as a6,CAe as a7,UNe as a8,I3 as a9,ws as aA,H4 as aB,s4 as aC,xMe as aD,FIe as aE,JIe as aF,eOe as aG,kIe as aH,TIe as aI,mV as aJ,_p as aK,Ive as aL,uz as aM,uMe as aN,EOe as aO,o5 as aP,K5 as aQ,ZMe as aR,N4 as aS,qke as aT,we as aU,GIe as aV,ZIe as aW,ufe as aX,TT as aY,Tee as aZ,b8e as a_,NNe as aa,HNe as ab,Di as ac,Qxe as ad,Sm as ae,X6e as af,LIe as ag,Dm as ah,DL as ai,a$ as aj,lb as ak,pe as al,Q6e as am,dMe as an,Mt as ao,Xa as ap,V1 as aq,D4 as ar,W3 as as,q5 as at,T5 as au,YIe as av,p3e as aw,o4 as ax,Oj as ay,m3e as az,E_ as b,T8e as b$,hMe as b0,JMe as b1,$Me as b2,eve as b3,fMe as b4,gMe as b5,g0e as b6,m0e as b7,PMe as b8,IMe as b9,u8e as bA,h8e as bB,p8e as bC,g8e as bD,m8e as bE,tre as bF,j8e as bG,J9e as bH,eMe as bI,S8e as bJ,K8e as bK,v8e as bL,L8e as bM,C8e as bN,Q2e as bO,_8e as bP,U8e as bQ,y8e as bR,J8e as bS,w8e as bT,rP as bU,x8e as bV,iP as bW,P8e as bX,F8e as bY,hNe as bZ,NR as b_,pMe as ba,NMe as bb,mMe as bc,DIe as bd,cMe as be,HMe as bf,VIe as bg,Mre as bh,sOe as bi,oOe as bj,jIe as bk,IOe as bl,e7e as bm,JNe as bn,$B as bo,ROe as bp,BIe as bq,zIe as br,WIe as bs,zC as bt,UIe as bu,Ul as bv,_y as bw,POe as bx,AOe as by,kOe as bz,NK as c,A8e as c$,LOe as c0,K2e as c1,E8e as c2,z8 as c3,rMe as c4,iMe as c5,oMe as c6,R8e as c7,sMe as c8,I8e as c9,Nr as cA,b5 as cB,Mo as cC,zMe as cD,M8e as cE,G5 as cF,UMe as cG,LMe as cH,iD as cI,k9e as cJ,I9e as cK,N9e as cL,M9e as cM,P9e as cN,R9e as cO,O9e as cP,P2e as cQ,Q9e as cR,VOe as cS,RIe as cT,PIe as cU,KOe as cV,Ate as cW,$9e as cX,zOe as cY,a9e as cZ,l9e as c_,aMe as ca,O8e as cb,lMe as cc,Me as cd,UO as ce,uOe as cf,aOe as cg,lOe as ch,ffe as ci,vve as cj,nz as ck,MD as cl,AIe as cm,rj as cn,qIe as co,f1 as cp,pF as cq,MNe as cr,HIe as cs,Ty as ct,h1 as cu,XMe as cv,VMe as cw,yMe as cx,vMe as cy,jMe as cz,bee as d,bOe as d$,dNe as d0,h9e as d1,c8e as d2,f9e as d3,Fb as d4,Kne as d5,d9e as d6,xm as d7,CNe as d8,cNe as d9,cRe as dA,aRe as dB,lRe as dC,uRe as dD,Fte as dE,q6 as dF,gOe as dG,rOe as dH,tOe as dI,nOe as dJ,Xc as dK,oP as dL,afe as dM,Rd as dN,H6 as dO,jve as dP,zve as dQ,mOe as dR,yOe as dS,vOe as dT,lfe as dU,_Oe as dV,lF as dW,fOe as dX,pOe as dY,xOe as dZ,COe as d_,PNe as da,uNe as db,u9e as dc,s9e as dd,RNe as de,g9e as df,kNe as dg,m9e as dh,o9e as di,Wne as dj,gNe as dk,c9e as dl,k8e as dm,fNe as dn,p9e as dp,L9e as dq,B8e as dr,gfe as ds,mfe as dt,TOe as du,MOe as dv,NOe as dw,mF as dx,OOe as dy,M_ as dz,X7 as e,d8e as e$,Ib as e0,wOe as e1,SOe as e2,cOe as e3,l2e as e4,dOe as e5,pNe as e6,tMe as e7,xT as e8,d0e as e9,sRe as eA,iRe as eB,ET as eC,BMe as eD,GMe as eE,Z9e as eF,Lxe as eG,TMe as eH,ge as eI,fi as eJ,Dn as eK,fa as eL,lNe as eM,TNe as eN,_Ne as eO,wMe as eP,vNe as eQ,ANe as eR,ENe as eS,SMe as eT,SNe as eU,bNe as eV,mNe as eW,xNe as eX,f8e as eY,yNe as eZ,wNe as e_,Mxe as ea,AD as eb,sNe as ec,fRe as ed,nre as ee,dRe as ef,Ss as eg,$8e as eh,X8e as ei,Bte as ej,bp as ek,Z8e as el,nMe as em,q8e as en,H8e as eo,W8e as ep,V8e as eq,G8e as er,ere as es,nRe as et,tRe as eu,_Re as ev,BRe as ew,wIe as ex,zRe as ey,oRe as ez,n7 as f,YMe as f$,wB as f0,jOe as f1,yC as f2,t0e as f3,YOe as f4,G9e as f5,V9e as f6,GOe as f7,n0e as f8,HOe as f9,JOe as fA,t9e as fB,b9e as fC,ZOe as fD,T9e as fE,A9e as fF,F9e as fG,Fxe as fH,z9e as fI,U9e as fJ,j9e as fK,Kye as fL,aNe as fM,QD as fN,OR as fO,$t as fP,s0e as fQ,Bg as fR,_u as fS,S9e as fT,w9e as fU,C9e as fV,E9e as fW,H9e as fX,x9e as fY,r9e as fZ,DB as f_,FB as fa,tB as fb,Bm as fc,FOe as fd,Qs as fe,X9e as ff,DMe as fg,E$ as fh,WOe as fi,UOe as fj,W9e as fk,K9e as fl,Y9e as fm,BOe as fn,y9e as fo,v9e as fp,IIe as fq,x1 as fr,Je as fs,_9e as ft,l0e as fu,qOe as fv,D9e as fw,QOe as fx,XOe as fy,e9e as fz,c7 as g,rIe as g$,FMe as g0,WMe as g1,QMe as g2,ec as g3,fz as g4,gG as g5,At as g6,YRe as g7,mIe as g8,gIe as g9,wRe as gA,pIe as gB,MRe as gC,ORe as gD,xre as gE,hIe as gF,Bve as gG,Cre as gH,U5 as gI,a2e as gJ,$Re as gK,ZRe as gL,XRe as gM,WRe as gN,mRe as gO,yRe as gP,EIe as gQ,tNe as gR,eNe as gS,oIe as gT,eIe as gU,JRe as gV,Dve as gW,NRe as gX,ARe as gY,fIe as gZ,dIe as g_,DRe as ga,sIe as gb,vIe as gc,Uve as gd,kRe as ge,HRe as gf,Gh as gg,VRe as gh,PRe as gi,zb as gj,qRe as gk,ERe as gl,GRe as gm,TRe as gn,IRe as go,gRe as gp,pRe as gq,hRe as gr,yIe as gs,Ste as gt,oD as gu,RD as gv,Lf as gw,bre as gx,bRe as gy,SRe as gz,$i as h,tIe as h0,nIe as h1,xIe as h2,uIe as h3,CIe as h4,URe as h5,jRe as h6,CRe as h7,xRe as h8,SIe as h9,qEe as hA,QNe as hB,YNe as hC,ZNe as hD,vRe as ha,LRe as hb,Fve as hc,Nve as hd,Lve as he,$ve as hf,oNe as hg,JB as hh,KIe as hi,X as hj,Q5 as hk,CMe as hl,EMe as hm,Lte as hn,Pve as ho,VO as hp,ONe as hq,Fj as hr,qNe as hs,VNe as ht,zNe as hu,GNe as hv,sa as hw,jNe as hx,INe as hy,JEe as hz,hee as i,k_ as j,vm as k,cT as l,e7 as m,mT as n,V7 as o,rh as p,Dte as q,M as r,J as s,bm as t,is as u,dr as v,gf as w,ri as x,xs as y,ome as z};
|