mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-15 11:47:54 +00:00
726 lines
1.4 MiB
726 lines
1.4 MiB
var eB=Object.defineProperty;var jT=e=>{throw TypeError(e)};var tB=(e,n,r)=>n in e?eB(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var nB=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var Ue=(e,n,r)=>tB(e,typeof n!="symbol"?n+"":n,r),FT=(e,n,r)=>n.has(e)||jT("Cannot "+r);var Kn=(e,n,r)=>(FT(e,n,"read from private field"),r?r.call(e):n.get(e)),Ql=(e,n,r)=>n.has(e)?jT("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),Ha=(e,n,r,i)=>(FT(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r);var Xye=nB((uc,dc)=>{(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Ga=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var NC={exports:{}},nm={},IC={exports:{}},Vt={};/**
|
||
* @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 $T;function rB(){if($T)return Vt;$T=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v(X){return X===null||typeof X!="object"?null:(X=g&&X[g]||X["@@iterator"],typeof X=="function"?X:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function x(X,ee,ie){this.props=X,this.context=ee,this.refs=E,this.updater=ie||w}x.prototype.isReactComponent={},x.prototype.setState=function(X,ee){if(typeof X!="object"&&typeof X!="function"&&X!=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,X,ee,"setState")},x.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function I(){}I.prototype=x.prototype;function P(X,ee,ie){this.props=X,this.context=ee,this.refs=E,this.updater=ie||w}var M=P.prototype=new I;M.constructor=P,S(M,x.prototype),M.isPureReactComponent=!0;var k=Array.isArray,A=Object.prototype.hasOwnProperty,j={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function $(X,ee,ie){var we,Se={},J=null,Re=null;if(ee!=null)for(we in ee.ref!==void 0&&(Re=ee.ref),ee.key!==void 0&&(J=""+ee.key),ee)A.call(ee,we)&&!V.hasOwnProperty(we)&&(Se[we]=ee[we]);var be=arguments.length-2;if(be===1)Se.children=ie;else if(1<be){for(var Oe=Array(be),Ee=0;Ee<be;Ee++)Oe[Ee]=arguments[Ee+2];Se.children=Oe}if(X&&X.defaultProps)for(we in be=X.defaultProps,be)Se[we]===void 0&&(Se[we]=be[we]);return{$$typeof:e,type:X,key:J,ref:Re,props:Se,_owner:j.current}}function W(X,ee){return{$$typeof:e,type:X.type,key:ee,ref:X.ref,props:X.props,_owner:X._owner}}function B(X){return typeof X=="object"&&X!==null&&X.$$typeof===e}function H(X){var ee={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(ie){return ee[ie]})}var Y=/\/+/g;function te(X,ee){return typeof X=="object"&&X!==null&&X.key!=null?H(""+X.key):ee.toString(36)}function ue(X,ee,ie,we,Se){var J=typeof X;(J==="undefined"||J==="boolean")&&(X=null);var Re=!1;if(X===null)Re=!0;else switch(J){case"string":case"number":Re=!0;break;case"object":switch(X.$$typeof){case e:case n:Re=!0}}if(Re)return Re=X,Se=Se(Re),X=we===""?"."+te(Re,0):we,k(Se)?(ie="",X!=null&&(ie=X.replace(Y,"$&/")+"/"),ue(Se,ee,ie,"",function(Ee){return Ee})):Se!=null&&(B(Se)&&(Se=W(Se,ie+(!Se.key||Re&&Re.key===Se.key?"":(""+Se.key).replace(Y,"$&/")+"/")+X)),ee.push(Se)),1;if(Re=0,we=we===""?".":we+":",k(X))for(var be=0;be<X.length;be++){J=X[be];var Oe=we+te(J,be);Re+=ue(J,ee,ie,Oe,Se)}else if(Oe=v(X),typeof Oe=="function")for(X=Oe.call(X),be=0;!(J=X.next()).done;)J=J.value,Oe=we+te(J,be++),Re+=ue(J,ee,ie,Oe,Se);else if(J==="object")throw ee=String(X),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return Re}function ye(X,ee,ie){if(X==null)return X;var we=[],Se=0;return ue(X,we,"","",function(J){return ee.call(ie,J,Se++)}),we}function Ne(X){if(X._status===-1){var ee=X._result;ee=ee(),ee.then(function(ie){(X._status===0||X._status===-1)&&(X._status=1,X._result=ie)},function(ie){(X._status===0||X._status===-1)&&(X._status=2,X._result=ie)}),X._status===-1&&(X._status=0,X._result=ee)}if(X._status===1)return X._result.default;throw X._result}var q={current:null},G={transition:null},ae={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:G,ReactCurrentOwner:j};function ge(){throw Error("act(...) is not supported in production builds of React.")}return Vt.Children={map:ye,forEach:function(X,ee,ie){ye(X,function(){ee.apply(this,arguments)},ie)},count:function(X){var ee=0;return ye(X,function(){ee++}),ee},toArray:function(X){return ye(X,function(ee){return ee})||[]},only:function(X){if(!B(X))throw Error("React.Children.only expected to receive a single React element child.");return X}},Vt.Component=x,Vt.Fragment=r,Vt.Profiler=s,Vt.PureComponent=P,Vt.StrictMode=i,Vt.Suspense=u,Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,Vt.act=ge,Vt.cloneElement=function(X,ee,ie){if(X==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+X+".");var we=S({},X.props),Se=X.key,J=X.ref,Re=X._owner;if(ee!=null){if(ee.ref!==void 0&&(J=ee.ref,Re=j.current),ee.key!==void 0&&(Se=""+ee.key),X.type&&X.type.defaultProps)var be=X.type.defaultProps;for(Oe in ee)A.call(ee,Oe)&&!V.hasOwnProperty(Oe)&&(we[Oe]=ee[Oe]===void 0&&be!==void 0?be[Oe]:ee[Oe])}var Oe=arguments.length-2;if(Oe===1)we.children=ie;else if(1<Oe){be=Array(Oe);for(var Ee=0;Ee<Oe;Ee++)be[Ee]=arguments[Ee+2];we.children=be}return{$$typeof:e,type:X.type,key:Se,ref:J,props:we,_owner:Re}},Vt.createContext=function(X){return X={$$typeof:a,_currentValue:X,_currentValue2:X,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},X.Provider={$$typeof:o,_context:X},X.Consumer=X},Vt.createElement=$,Vt.createFactory=function(X){var ee=$.bind(null,X);return ee.type=X,ee},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(X){return{$$typeof:l,render:X}},Vt.isValidElement=B,Vt.lazy=function(X){return{$$typeof:p,_payload:{_status:-1,_result:X},_init:Ne}},Vt.memo=function(X,ee){return{$$typeof:h,type:X,compare:ee===void 0?null:ee}},Vt.startTransition=function(X){var ee=G.transition;G.transition={};try{X()}finally{G.transition=ee}},Vt.unstable_act=ge,Vt.useCallback=function(X,ee){return q.current.useCallback(X,ee)},Vt.useContext=function(X){return q.current.useContext(X)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(X){return q.current.useDeferredValue(X)},Vt.useEffect=function(X,ee){return q.current.useEffect(X,ee)},Vt.useId=function(){return q.current.useId()},Vt.useImperativeHandle=function(X,ee,ie){return q.current.useImperativeHandle(X,ee,ie)},Vt.useInsertionEffect=function(X,ee){return q.current.useInsertionEffect(X,ee)},Vt.useLayoutEffect=function(X,ee){return q.current.useLayoutEffect(X,ee)},Vt.useMemo=function(X,ee){return q.current.useMemo(X,ee)},Vt.useReducer=function(X,ee,ie){return q.current.useReducer(X,ee,ie)},Vt.useRef=function(X){return q.current.useRef(X)},Vt.useState=function(X){return q.current.useState(X)},Vt.useSyncExternalStore=function(X,ee,ie){return q.current.useSyncExternalStore(X,ee,ie)},Vt.useTransition=function(){return q.current.useTransition()},Vt.version="18.3.1",Vt}var zT;function nI(){return zT||(zT=1,IC.exports=rB()),IC.exports}/**
|
||
* @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 VT;function iB(){if(VT)return nm;VT=1;var e=nI(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(l,u,h){var p,g={},v=null,w=null;h!==void 0&&(v=""+h),u.key!==void 0&&(v=""+u.key),u.ref!==void 0&&(w=u.ref);for(p in u)i.call(u,p)&&!o.hasOwnProperty(p)&&(g[p]=u[p]);if(l&&l.defaultProps)for(p in u=l.defaultProps,u)g[p]===void 0&&(g[p]=u[p]);return{$$typeof:n,type:l,key:v,ref:w,props:g,_owner:s.current}}return nm.Fragment=r,nm.jsx=a,nm.jsxs=a,nm}var BT;function sB(){return BT||(BT=1,NC.exports=iB()),NC.exports}var F=sB(),q1={},OC={exports:{}},fs={},TC={exports:{}},MC={};/**
|
||
* @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.
|
||
*/var HT;function oB(){return HT||(HT=1,function(e){function n(G,ae){var ge=G.length;G.push(ae);e:for(;0<ge;){var X=ge-1>>>1,ee=G[X];if(0<s(ee,ae))G[X]=ae,G[ge]=ee,ge=X;else break e}}function r(G){return G.length===0?null:G[0]}function i(G){if(G.length===0)return null;var ae=G[0],ge=G.pop();if(ge!==ae){G[0]=ge;e:for(var X=0,ee=G.length,ie=ee>>>1;X<ie;){var we=2*(X+1)-1,Se=G[we],J=we+1,Re=G[J];if(0>s(Se,ge))J<ee&&0>s(Re,Se)?(G[X]=Re,G[J]=ge,X=J):(G[X]=Se,G[we]=ge,X=we);else if(J<ee&&0>s(Re,ge))G[X]=Re,G[J]=ge,X=J;else break e}}return ae}function s(G,ae){var ge=G.sortIndex-ae.sortIndex;return ge!==0?ge:G.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],h=[],p=1,g=null,v=3,w=!1,S=!1,E=!1,x=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(G){for(var ae=r(h);ae!==null;){if(ae.callback===null)i(h);else if(ae.startTime<=G)i(h),ae.sortIndex=ae.expirationTime,n(u,ae);else break;ae=r(h)}}function k(G){if(E=!1,M(G),!S)if(r(u)!==null)S=!0,Ne(A);else{var ae=r(h);ae!==null&&q(k,ae.startTime-G)}}function A(G,ae){S=!1,E&&(E=!1,I($),$=-1),w=!0;var ge=v;try{for(M(ae),g=r(u);g!==null&&(!(g.expirationTime>ae)||G&&!H());){var X=g.callback;if(typeof X=="function"){g.callback=null,v=g.priorityLevel;var ee=X(g.expirationTime<=ae);ae=e.unstable_now(),typeof ee=="function"?g.callback=ee:g===r(u)&&i(u),M(ae)}else i(u);g=r(u)}if(g!==null)var ie=!0;else{var we=r(h);we!==null&&q(k,we.startTime-ae),ie=!1}return ie}finally{g=null,v=ge,w=!1}}var j=!1,V=null,$=-1,W=5,B=-1;function H(){return!(e.unstable_now()-B<W)}function Y(){if(V!==null){var G=e.unstable_now();B=G;var ae=!0;try{ae=V(!0,G)}finally{ae?te():(j=!1,V=null)}}else j=!1}var te;if(typeof P=="function")te=function(){P(Y)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ye=ue.port2;ue.port1.onmessage=Y,te=function(){ye.postMessage(null)}}else te=function(){x(Y,0)};function Ne(G){V=G,j||(j=!0,te())}function q(G,ae){$=x(function(){G(e.unstable_now())},ae)}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(G){G.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,Ne(A))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(G){switch(v){case 1:case 2:case 3:var ae=3;break;default:ae=v}var ge=v;v=ae;try{return G()}finally{v=ge}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,ae){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ge=v;v=G;try{return ae()}finally{v=ge}},e.unstable_scheduleCallback=function(G,ae,ge){var X=e.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?X+ge:X):ge=X,G){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=ge+ee,G={id:p++,callback:ae,priorityLevel:G,startTime:ge,expirationTime:ee,sortIndex:-1},ge>X?(G.sortIndex=ge,n(h,G),r(u)===null&&G===r(h)&&(E?(I($),$=-1):E=!0,q(k,ge-X))):(G.sortIndex=ee,n(u,G),S||w||(S=!0,Ne(A))),G},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(G){var ae=v;return function(){var ge=v;v=ae;try{return G.apply(this,arguments)}finally{v=ge}}}}(MC)),MC}var UT;function aB(){return UT||(UT=1,TC.exports=oB()),TC.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 KT;function lB(){if(KT)return fs;KT=1;var e=nI(),n=aB();function r(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,m=1;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function o(c,d){a(c,d),a(c+"Capture",d)}function a(c,d){for(s[c]=d,c=0;c<d.length;c++)i.add(d[c])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},g={};function v(c){return u.call(g,c)?!0:u.call(p,c)?!1:h.test(c)?g[c]=!0:(p[c]=!0,!1)}function w(c,d,m,b){if(m!==null&&m.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function S(c,d,m,b){if(d===null||typeof d>"u"||w(c,d,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function E(c,d,m,b,N,O,z){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=b,this.attributeNamespace=N,this.mustUseProperty=m,this.propertyName=c,this.type=d,this.sanitizeURL=O,this.removeEmptyString=z}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){x[c]=new E(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var d=c[0];x[d]=new E(d,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){x[c]=new E(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){x[c]=new E(c,2,!1,c,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(c){x[c]=new E(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){x[c]=new E(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){x[c]=new E(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){x[c]=new E(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){x[c]=new E(c,5,!1,c.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function P(c){return c[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(c){var d=c.replace(I,P);x[d]=new E(d,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var d=c.replace(I,P);x[d]=new E(d,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var d=c.replace(I,P);x[d]=new E(d,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){x[c]=new E(c,1,!1,c.toLowerCase(),null,!1,!1)}),x.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){x[c]=new E(c,1,!1,c.toLowerCase(),null,!0,!0)});function M(c,d,m,b){var N=x.hasOwnProperty(d)?x[d]:null;(N!==null?N.type!==0:b||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(S(d,m,N,b)&&(m=null),b||N===null?v(d)&&(m===null?c.removeAttribute(d):c.setAttribute(d,""+m)):N.mustUseProperty?c[N.propertyName]=m===null?N.type===3?!1:"":m:(d=N.attributeName,b=N.attributeNamespace,m===null?c.removeAttribute(d):(N=N.type,m=N===3||N===4&&m===!0?"":""+m,b?c.setAttributeNS(b,d,m):c.setAttribute(d,m))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),j=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),H=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),ye=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),G=Symbol.iterator;function ae(c){return c===null||typeof c!="object"?null:(c=G&&c[G]||c["@@iterator"],typeof c=="function"?c:null)}var ge=Object.assign,X;function ee(c){if(X===void 0)try{throw Error()}catch(m){var d=m.stack.trim().match(/\n( *(at )?)/);X=d&&d[1]||""}return`
|
||
`+X+c}var ie=!1;function we(c,d){if(!c||ie)return"";ie=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(ve){var b=ve}Reflect.construct(c,[],d)}else{try{d.call()}catch(ve){b=ve}c.call(d.prototype)}else{try{throw Error()}catch(ve){b=ve}c()}}catch(ve){if(ve&&b&&typeof ve.stack=="string"){for(var N=ve.stack.split(`
|
||
`),O=b.stack.split(`
|
||
`),z=N.length-1,Z=O.length-1;1<=z&&0<=Z&&N[z]!==O[Z];)Z--;for(;1<=z&&0<=Z;z--,Z--)if(N[z]!==O[Z]){if(z!==1||Z!==1)do if(z--,Z--,0>Z||N[z]!==O[Z]){var ne=`
|
||
`+N[z].replace(" at new "," at ");return c.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",c.displayName)),ne}while(1<=z&&0<=Z);break}}}finally{ie=!1,Error.prepareStackTrace=m}return(c=c?c.displayName||c.name:"")?ee(c):""}function Se(c){switch(c.tag){case 5:return ee(c.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return c=we(c.type,!1),c;case 11:return c=we(c.type.render,!1),c;case 1:return c=we(c.type,!0),c;default:return""}}function J(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case V:return"Fragment";case j:return"Portal";case W:return"Profiler";case $:return"StrictMode";case te:return"Suspense";case ue:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case H:return(c.displayName||"Context")+".Consumer";case B:return(c._context.displayName||"Context")+".Provider";case Y:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case ye:return d=c.displayName||null,d!==null?d:J(c.type)||"Memo";case Ne:d=c._payload,c=c._init;try{return J(c(d))}catch{}}return null}function Re(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return J(d);case 8:return d===$?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function be(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function Oe(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Ee(c){var d=Oe(c)?"checked":"value",m=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),b=""+c[d];if(!c.hasOwnProperty(d)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var N=m.get,O=m.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return N.call(this)},set:function(z){b=""+z,O.call(this,z)}}),Object.defineProperty(c,d,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(z){b=""+z},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function Le(c){c._valueTracker||(c._valueTracker=Ee(c))}function tt(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),b="";return c&&(b=Oe(c)?c.checked?"true":"false":c.value),c=b,c!==m?(d.setValue(c),!0):!1}function Pt(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function _t(c,d){var m=d.checked;return ge({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??c._wrapperState.initialChecked})}function Ge(c,d){var m=d.defaultValue==null?"":d.defaultValue,b=d.checked!=null?d.checked:d.defaultChecked;m=be(d.value!=null?d.value:m),c._wrapperState={initialChecked:b,initialValue:m,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function Ft(c,d){d=d.checked,d!=null&&M(c,"checked",d,!1)}function Ke(c,d){Ft(c,d);var m=be(d.value),b=d.type;if(m!=null)b==="number"?(m===0&&c.value===""||c.value!=m)&&(c.value=""+m):c.value!==""+m&&(c.value=""+m);else if(b==="submit"||b==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?kn(c,d.type,m):d.hasOwnProperty("defaultValue")&&kn(c,d.type,be(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function zt(c,d,m){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var b=d.type;if(!(b!=="submit"&&b!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,m||d===c.value||(c.value=d),c.defaultValue=d}m=c.name,m!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,m!==""&&(c.name=m)}function kn(c,d,m){(d!=="number"||Pt(c.ownerDocument)!==c)&&(m==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+m&&(c.defaultValue=""+m))}var yt=Array.isArray;function St(c,d,m,b){if(c=c.options,d){d={};for(var N=0;N<m.length;N++)d["$"+m[N]]=!0;for(m=0;m<c.length;m++)N=d.hasOwnProperty("$"+c[m].value),c[m].selected!==N&&(c[m].selected=N),N&&b&&(c[m].defaultSelected=!0)}else{for(m=""+be(m),d=null,N=0;N<c.length;N++){if(c[N].value===m){c[N].selected=!0,b&&(c[N].defaultSelected=!0);return}d!==null||c[N].disabled||(d=c[N])}d!==null&&(d.selected=!0)}}function Bt(c,d){if(d.dangerouslySetInnerHTML!=null)throw Error(r(91));return ge({},d,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Nt(c,d){var m=d.value;if(m==null){if(m=d.children,d=d.defaultValue,m!=null){if(d!=null)throw Error(r(92));if(yt(m)){if(1<m.length)throw Error(r(93));m=m[0]}d=m}d==null&&(d=""),m=d}c._wrapperState={initialValue:be(m)}}function lt(c,d){var m=be(d.value),b=be(d.defaultValue);m!=null&&(m=""+m,m!==c.value&&(c.value=m),d.defaultValue==null&&c.defaultValue!==m&&(c.defaultValue=m)),b!=null&&(c.defaultValue=""+b)}function It(c){var d=c.textContent;d===c._wrapperState.initialValue&&d!==""&&d!==null&&(c.value=d)}function ci(c){switch(c){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 dn(c,d){return c==null||c==="http://www.w3.org/1999/xhtml"?ci(d):c==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var At,mr=function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,m,b,N){MSApp.execUnsafeLocalFunction(function(){return c(d,m,b,N)})}:c}(function(c,d){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=d;else{for(At=At||document.createElement("div"),At.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=At.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;d.firstChild;)c.appendChild(d.firstChild)}});function Er(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var Mn={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},ce=["Webkit","ms","Moz","O"];Object.keys(Mn).forEach(function(c){ce.forEach(function(d){d=d+c.charAt(0).toUpperCase()+c.substring(1),Mn[d]=Mn[c]})});function fe(c,d,m){return d==null||typeof d=="boolean"||d===""?"":m||typeof d!="number"||d===0||Mn.hasOwnProperty(c)&&Mn[c]?(""+d).trim():d+"px"}function _e(c,d){c=c.style;for(var m in d)if(d.hasOwnProperty(m)){var b=m.indexOf("--")===0,N=fe(m,d[m],b);m==="float"&&(m="cssFloat"),b?c.setProperty(m,N):c[m]=N}}var ze=ge({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 it(c,d){if(d){if(ze[c]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(r(137,c));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(r(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(r(61))}if(d.style!=null&&typeof d.style!="object")throw Error(r(62))}}function Gt(c,d){if(c.indexOf("-")===-1)return typeof d.is=="string";switch(c){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 hn=null;function wt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var He=null,We=null,ke=null;function Be(c){if(c=Xr(c)){if(typeof He!="function")throw Error(r(280));var d=c.stateNode;d&&(d=Df(d),He(c.stateNode,c.type,d))}}function ct(c){We?ke?ke.push(c):ke=[c]:We=c}function Dt(){if(We){var c=We,d=ke;if(ke=We=null,Be(c),d)for(c=0;c<d.length;c++)Be(d[c])}}function Mt(c,d){return c(d)}function Jt(){}var Fr=!1;function xs(c,d,m){if(Fr)return c(d,m);Fr=!0;try{return Mt(c,d,m)}finally{Fr=!1,(We!==null||ke!==null)&&(Jt(),Dt())}}function xr(c,d){var m=c.stateNode;if(m===null)return null;var b=Df(m);if(b===null)return null;m=b[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(c=c.type,b=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!b;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,d,typeof m));return m}var Ss=!1;if(l)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){Ss=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{Ss=!1}function ma(c,d,m,b,N,O,z,Z,ne){var ve=Array.prototype.slice.call(arguments,3);try{d.apply(m,ve)}catch(Me){this.onError(Me)}}var eo=!1,Cl=null,to=!1,Ro=null,hd={onError:function(c){eo=!0,Cl=c}};function x_(c,d,m,b,N,O,z,Z,ne){eo=!1,Cl=null,ma.apply(hd,arguments)}function S_(c,d,m,b,N,O,z,Z,ne){if(x_.apply(this,arguments),eo){if(eo){var ve=Cl;eo=!1,Cl=null}else throw Error(r(198));to||(to=!0,Ro=ve)}}function El(c){var d=c,m=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(m=d.return),c=d.return;while(c)}return d.tag===3?m:null}function kg(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function b0(c){if(El(c)!==c)throw Error(r(188))}function D_(c){var d=c.alternate;if(!d){if(d=El(c),d===null)throw Error(r(188));return d!==c?null:c}for(var m=c,b=d;;){var N=m.return;if(N===null)break;var O=N.alternate;if(O===null){if(b=N.return,b!==null){m=b;continue}break}if(N.child===O.child){for(O=N.child;O;){if(O===m)return b0(N),c;if(O===b)return b0(N),d;O=O.sibling}throw Error(r(188))}if(m.return!==b.return)m=N,b=O;else{for(var z=!1,Z=N.child;Z;){if(Z===m){z=!0,m=N,b=O;break}if(Z===b){z=!0,b=N,m=O;break}Z=Z.sibling}if(!z){for(Z=O.child;Z;){if(Z===m){z=!0,m=O,b=N;break}if(Z===b){z=!0,b=O,m=N;break}Z=Z.sibling}if(!z)throw Error(r(189))}}if(m.alternate!==b)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?c:d}function w0(c){return c=D_(c),c!==null?_0(c):null}function _0(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=_0(c);if(d!==null)return d;c=c.sibling}return null}var C0=n.unstable_scheduleCallback,E0=n.unstable_cancelCallback,Zh=n.unstable_shouldYield,N_=n.unstable_requestPaint,Vn=n.unstable_now,I_=n.unstable_getCurrentPriorityLevel,Lg=n.unstable_ImmediatePriority,x0=n.unstable_UserBlockingPriority,fd=n.unstable_NormalPriority,S0=n.unstable_LowPriority,jg=n.unstable_IdlePriority,Qh=null,no=null;function O_(c){if(no&&typeof no.onCommitFiberRoot=="function")try{no.onCommitFiberRoot(Qh,c,void 0,(c.current.flags&128)===128)}catch{}}var Ns=Math.clz32?Math.clz32:I0,D0=Math.log,N0=Math.LN2;function I0(c){return c>>>=0,c===0?32:31-(D0(c)/N0|0)|0}var Nc=64,Jh=4194304;function Ic(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function xl(c,d){var m=c.pendingLanes;if(m===0)return 0;var b=0,N=c.suspendedLanes,O=c.pingedLanes,z=m&268435455;if(z!==0){var Z=z&~N;Z!==0?b=Ic(Z):(O&=z,O!==0&&(b=Ic(O)))}else z=m&~N,z!==0?b=Ic(z):O!==0&&(b=Ic(O));if(b===0)return 0;if(d!==0&&d!==b&&(d&N)===0&&(N=b&-b,O=d&-d,N>=O||N===16&&(O&4194240)!==0))return d;if((b&4)!==0&&(b|=m&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=b;0<d;)m=31-Ns(d),N=1<<m,b|=c[m],d&=~N;return b}function O0(c,d){switch(c){case 1:case 2:case 4:return d+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 d+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 T_(c,d){for(var m=c.suspendedLanes,b=c.pingedLanes,N=c.expirationTimes,O=c.pendingLanes;0<O;){var z=31-Ns(O),Z=1<<z,ne=N[z];ne===-1?((Z&m)===0||(Z&b)!==0)&&(N[z]=O0(Z,d)):ne<=d&&(c.expiredLanes|=Z),O&=~Z}}function ef(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function Fg(){var c=Nc;return Nc<<=1,(Nc&4194240)===0&&(Nc=64),c}function pd(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function gd(c,d,m){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-Ns(d),c[d]=m}function T0(c,d){var m=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var b=c.eventTimes;for(c=c.expirationTimes;0<m;){var N=31-Ns(m),O=1<<N;d[N]=0,b[N]=-1,c[N]=-1,m&=~O}}function yd(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var b=31-Ns(m),N=1<<b;N&d|c[b]&d&&(c[b]|=d),m&=~N}}var ln=0;function Sl(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var $g,tf,M0,zg,Vg,nf=!1,md=[],va=null,ba=null,wa=null,Oc=new Map,vd=new Map,_a=[],M_="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 P0(c,d){switch(c){case"focusin":case"focusout":va=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":Oc.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":vd.delete(d.pointerId)}}function Dl(c,d,m,b,N,O){return c===null||c.nativeEvent!==O?(c={blockedOn:d,domEventName:m,eventSystemFlags:b,nativeEvent:O,targetContainers:[N]},d!==null&&(d=Xr(d),d!==null&&tf(d)),c):(c.eventSystemFlags|=b,d=c.targetContainers,N!==null&&d.indexOf(N)===-1&&d.push(N),c)}function P_(c,d,m,b,N){switch(d){case"focusin":return va=Dl(va,c,d,m,b,N),!0;case"dragenter":return ba=Dl(ba,c,d,m,b,N),!0;case"mouseover":return wa=Dl(wa,c,d,m,b,N),!0;case"pointerover":var O=N.pointerId;return Oc.set(O,Dl(Oc.get(O)||null,c,d,m,b,N)),!0;case"gotpointercapture":return O=N.pointerId,vd.set(O,Dl(vd.get(O)||null,c,d,m,b,N)),!0}return!1}function A0(c){var d=oo(c.target);if(d!==null){var m=El(d);if(m!==null){if(d=m.tag,d===13){if(d=kg(m),d!==null){c.blockedOn=d,Vg(c.priority,function(){M0(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function rf(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var m=af(c.domEventName,c.eventSystemFlags,d[0],c.nativeEvent);if(m===null){m=c.nativeEvent;var b=new m.constructor(m.type,m);hn=b,m.target.dispatchEvent(b),hn=null}else return d=Xr(m),d!==null&&tf(d),c.blockedOn=m,!1;d.shift()}return!0}function R0(c,d,m){rf(c)&&m.delete(d)}function A_(){nf=!1,va!==null&&rf(va)&&(va=null),ba!==null&&rf(ba)&&(ba=null),wa!==null&&rf(wa)&&(wa=null),Oc.forEach(R0),vd.forEach(R0)}function yn(c,d){c.blockedOn===d&&(c.blockedOn=null,nf||(nf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,A_)))}function fn(c){function d(N){return yn(N,c)}if(0<md.length){yn(md[0],c);for(var m=1;m<md.length;m++){var b=md[m];b.blockedOn===c&&(b.blockedOn=null)}}for(va!==null&&yn(va,c),ba!==null&&yn(ba,c),wa!==null&&yn(wa,c),Oc.forEach(d),vd.forEach(d),m=0;m<_a.length;m++)b=_a[m],b.blockedOn===c&&(b.blockedOn=null);for(;0<_a.length&&(m=_a[0],m.blockedOn===null);)A0(m),m.blockedOn===null&&_a.shift()}var Tc=k.ReactCurrentBatchConfig,sf=!0;function R_(c,d,m,b){var N=ln,O=Tc.transition;Tc.transition=null;try{ln=1,Bg(c,d,m,b)}finally{ln=N,Tc.transition=O}}function k_(c,d,m,b){var N=ln,O=Tc.transition;Tc.transition=null;try{ln=4,Bg(c,d,m,b)}finally{ln=N,Tc.transition=O}}function Bg(c,d,m,b){if(sf){var N=af(c,d,m,b);if(N===null)sy(c,d,b,of,m),P0(c,b);else if(P_(N,c,d,m,b))b.stopPropagation();else if(P0(c,b),d&4&&-1<M_.indexOf(c)){for(;N!==null;){var O=Xr(N);if(O!==null&&$g(O),O=af(c,d,m,b),O===null&&sy(c,d,b,of,m),O===N)break;N=O}N!==null&&b.stopPropagation()}else sy(c,d,b,null,m)}}var of=null;function af(c,d,m,b){if(of=null,c=wt(b),c=oo(c),c!==null)if(d=El(c),d===null)c=null;else if(m=d.tag,m===13){if(c=kg(d),c!==null)return c;c=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null);return of=c,null}function k0(c){switch(c){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(I_()){case Lg:return 1;case x0:return 4;case fd:case S0:return 16;case jg:return 536870912;default:return 16}default:return 16}}var Bn=null,bd=null,ro=null;function Hg(){if(ro)return ro;var c,d=bd,m=d.length,b,N="value"in Bn?Bn.value:Bn.textContent,O=N.length;for(c=0;c<m&&d[c]===N[c];c++);var z=m-c;for(b=1;b<=z&&d[m-b]===N[O-b];b++);return ro=N.slice(c,1<b?1-b:void 0)}function Mc(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function ui(){return!0}function Ug(){return!1}function Ci(c){function d(m,b,N,O,z){this._reactName=m,this._targetInst=N,this.type=b,this.nativeEvent=O,this.target=z,this.currentTarget=null;for(var Z in c)c.hasOwnProperty(Z)&&(m=c[Z],this[Z]=m?m(O):O[Z]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?ui:Ug,this.isPropagationStopped=Ug,this}return ge(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=ui)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=ui)},persist:function(){},isPersistent:ui}),d}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=Ci(Nl),Pc=ge({},Nl,{view:0,detail:0}),L0=Ci(Pc),di,Kg,Gr,cf=ge({},Pc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xg,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Gr&&(Gr&&c.type==="mousemove"?(di=c.screenX-Gr.screenX,Kg=c.screenY-Gr.screenY):Kg=di=0,Gr=c),di)},movementY:function(c){return"movementY"in c?c.movementY:Kg}}),Wg=Ci(cf),Ca=ge({},cf,{dataTransfer:0}),uf=Ci(Ca),qg=ge({},Pc,{relatedTarget:0}),Pn=Ci(qg),Ea=ge({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),Gg=Ci(Ea),L_=ge({},Nl,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Yg=Ci(L_),j_=ge({},Nl,{data:0}),j0=Ci(j_),F_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F0={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"},df={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ac(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=df[c])?!!d[c]:!1}function Xg(){return Ac}var $0=ge({},Pc,{key:function(c){if(c.key){var d=F_[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=Mc(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?F0[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xg,charCode:function(c){return c.type==="keypress"?Mc(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Mc(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),z0=Ci($0),Zg=ge({},cf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hf=Ci(Zg),V0=ge({},Pc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xg}),$_=Ci(V0),Qg=ge({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jg=Ci(Qg),z_=ge({},cf,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),B0=Ci(z_),Ri=[9,13,27,32],wd=l&&"CompositionEvent"in window,ko=null;l&&"documentMode"in document&&(ko=document.documentMode);var H0=l&&"TextEvent"in window&&!ko,ey=l&&(!wd||ko&&8<ko&&11>=ko),U0=" ",K0=!1;function W0(c,d){switch(c){case"keyup":return Ri.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q0(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Rc=!1;function kc(c,d){switch(c){case"compositionend":return q0(d);case"keypress":return d.which!==32?null:(K0=!0,U0);case"textInput":return c=d.data,c===U0&&K0?null:c;default:return null}}function V_(c,d){if(Rc)return c==="compositionend"||!wd&&W0(c,d)?(c=Hg(),ro=bd=Bn=null,Rc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return ey&&d.locale!=="ko"?null:d.data;default:return null}}var B_={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 ff(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!B_[c.type]:d==="textarea"}function ty(c,d,m,b){ct(b),d=Cf(d,"onChange"),0<d.length&&(m=new lf("onChange","change",null,m,b),c.push({event:m,listeners:d}))}var Qi=null,xa=null;function H_(c){e1(c,0)}function pf(c){var d=Ot(c);if(tt(d))return c}function U_(c,d){if(c==="change")return d}var Il=!1;if(l){var ki;if(l){var gf="oninput"in document;if(!gf){var G0=document.createElement("div");G0.setAttribute("oninput","return;"),gf=typeof G0.oninput=="function"}ki=gf}else ki=!1;Il=ki&&(!document.documentMode||9<document.documentMode)}function Y0(){Qi&&(Qi.detachEvent("onpropertychange",X0),xa=Qi=null)}function X0(c){if(c.propertyName==="value"&&pf(xa)){var d=[];ty(d,xa,c,wt(c)),xs(H_,d)}}function K_(c,d,m){c==="focusin"?(Y0(),Qi=d,xa=m,Qi.attachEvent("onpropertychange",X0)):c==="focusout"&&Y0()}function W_(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return pf(xa)}function Lc(c,d){if(c==="click")return pf(d)}function le(c,d){if(c==="input"||c==="change")return pf(d)}function Ce(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var me=typeof Object.is=="function"?Object.is:Ce;function Xe(c,d){if(me(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),b=Object.keys(d);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var N=m[b];if(!u.call(d,N)||!me(c[N],d[N]))return!1}return!0}function Ct(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function en(c,d){var m=Ct(c);c=0;for(var b;m;){if(m.nodeType===3){if(b=c+m.textContent.length,c<=d&&b>=d)return{node:m,offset:d-c};c=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Ct(m)}}function vr(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?vr(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function mn(){for(var c=window,d=Pt();d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=Pt(c.document)}return d}function _d(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}function q_(c){var d=mn(),m=c.focusedElem,b=c.selectionRange;if(d!==m&&m&&m.ownerDocument&&vr(m.ownerDocument.documentElement,m)){if(b!==null&&_d(m)){if(d=b.start,c=b.end,c===void 0&&(c=d),"selectionStart"in m)m.selectionStart=d,m.selectionEnd=Math.min(c,m.value.length);else if(c=(d=m.ownerDocument||document)&&d.defaultView||window,c.getSelection){c=c.getSelection();var N=m.textContent.length,O=Math.min(b.start,N);b=b.end===void 0?O:Math.min(b.end,N),!c.extend&&O>b&&(N=b,b=O,O=N),N=en(m,O);var z=en(m,b);N&&z&&(c.rangeCount!==1||c.anchorNode!==N.node||c.anchorOffset!==N.offset||c.focusNode!==z.node||c.focusOffset!==z.offset)&&(d=d.createRange(),d.setStart(N.node,N.offset),c.removeAllRanges(),O>b?(c.addRange(d),c.extend(z.node,z.offset)):(d.setEnd(z.node,z.offset),c.addRange(d)))}}for(d=[],c=m;c=c.parentNode;)c.nodeType===1&&d.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<d.length;m++)c=d[m],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var Ji=l&&"documentMode"in document&&11>=document.documentMode,Lo=null,ny=null,io=null,jc=!1;function Cd(c,d,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;jc||Lo==null||Lo!==Pt(b)||(b=Lo,"selectionStart"in b&&_d(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),io&&Xe(io,b)||(io=b,b=Cf(ny,"onSelect"),0<b.length&&(d=new lf("onSelect","select",null,d,m),c.push({event:d,listeners:b}),d.target=Lo)))}function tn(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var Fc={animationend:tn("Animation","AnimationEnd"),animationiteration:tn("Animation","AnimationIteration"),animationstart:tn("Animation","AnimationStart"),transitionend:tn("Transition","TransitionEnd")},yf={},Ed={};l&&(Ed=document.createElement("div").style,"AnimationEvent"in window||(delete Fc.animationend.animation,delete Fc.animationiteration.animation,delete Fc.animationstart.animation),"TransitionEvent"in window||delete Fc.transitionend.transition);function mf(c){if(yf[c])return yf[c];if(!Fc[c])return c;var d=Fc[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in Ed)return yf[c]=d[m];return c}var Z0=mf("animationend"),Q0=mf("animationiteration"),xd=mf("animationstart"),jo=mf("transitionend"),Sd=new Map,ry="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 Is(c,d){Sd.set(c,d),o(d,[c])}for(var vf=0;vf<ry.length;vf++){var bf=ry[vf],wf=bf.toLowerCase(),J0=bf[0].toUpperCase()+bf.slice(1);Is(wf,"on"+J0)}Is(Z0,"onAnimationEnd"),Is(Q0,"onAnimationIteration"),Is(xd,"onAnimationStart"),Is("dblclick","onDoubleClick"),Is("focusin","onFocus"),Is("focusout","onBlur"),Is(jo,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),Ol=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function Dd(c,d,m){var b=c.type||"unknown-event";c.currentTarget=m,S_(b,d,void 0,c),c.currentTarget=null}function e1(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var b=c[m],N=b.event;b=b.listeners;e:{var O=void 0;if(d)for(var z=b.length-1;0<=z;z--){var Z=b[z],ne=Z.instance,ve=Z.currentTarget;if(Z=Z.listener,ne!==O&&N.isPropagationStopped())break e;Dd(N,Z,ve),O=ne}else for(z=0;z<b.length;z++){if(Z=b[z],ne=Z.instance,ve=Z.currentTarget,Z=Z.listener,ne!==O&&N.isPropagationStopped())break e;Dd(N,Z,ve),O=ne}}}if(to)throw c=Ro,to=!1,Ro=null,c}function Ln(c,d){var m=d[Sf];m===void 0&&(m=d[Sf]=new Set);var b=c+"__bubble";m.has(b)||(_f(d,c,2,!1),m.add(b))}function iy(c,d,m){var b=0;d&&(b|=4),_f(m,c,b,d)}var Tl="_reactListening"+Math.random().toString(36).slice(2);function Sa(c){if(!c[Tl]){c[Tl]=!0,i.forEach(function(m){m!=="selectionchange"&&(Ol.has(m)||iy(m,!1,c),iy(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[Tl]||(d[Tl]=!0,iy("selectionchange",!1,d))}}function _f(c,d,m,b){switch(k0(d)){case 1:var N=R_;break;case 4:N=k_;break;default:N=Bg}m=N.bind(null,d,m,c),N=void 0,!Ss||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(N=!0),b?N!==void 0?c.addEventListener(d,m,{capture:!0,passive:N}):c.addEventListener(d,m,!0):N!==void 0?c.addEventListener(d,m,{passive:N}):c.addEventListener(d,m,!1)}function sy(c,d,m,b,N){var O=b;if((d&1)===0&&(d&2)===0&&b!==null)e:for(;;){if(b===null)return;var z=b.tag;if(z===3||z===4){var Z=b.stateNode.containerInfo;if(Z===N||Z.nodeType===8&&Z.parentNode===N)break;if(z===4)for(z=b.return;z!==null;){var ne=z.tag;if((ne===3||ne===4)&&(ne=z.stateNode.containerInfo,ne===N||ne.nodeType===8&&ne.parentNode===N))return;z=z.return}for(;Z!==null;){if(z=oo(Z),z===null)return;if(ne=z.tag,ne===5||ne===6){b=O=z;continue e}Z=Z.parentNode}}b=b.return}xs(function(){var ve=O,Me=wt(m),Ae=[];e:{var Te=Sd.get(c);if(Te!==void 0){var Ze=lf,nt=c;switch(c){case"keypress":if(Mc(m)===0)break e;case"keydown":case"keyup":Ze=z0;break;case"focusin":nt="focus",Ze=Pn;break;case"focusout":nt="blur",Ze=Pn;break;case"beforeblur":case"afterblur":Ze=Pn;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ze=Wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ze=uf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ze=$_;break;case Z0:case Q0:case xd:Ze=Gg;break;case jo:Ze=Jg;break;case"scroll":Ze=L0;break;case"wheel":Ze=B0;break;case"copy":case"cut":case"paste":Ze=Yg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ze=hf}var st=(d&4)!==0,dr=!st&&c==="scroll",he=st?Te!==null?Te+"Capture":null:Te;st=[];for(var se=ve,pe;se!==null;){pe=se;var Fe=pe.stateNode;if(pe.tag===5&&Fe!==null&&(pe=Fe,he!==null&&(Fe=xr(se,he),Fe!=null&&st.push($c(se,Fe,pe)))),dr)break;se=se.return}0<st.length&&(Te=new Ze(Te,nt,null,m,Me),Ae.push({event:Te,listeners:st}))}}if((d&7)===0){e:{if(Te=c==="mouseover"||c==="pointerover",Ze=c==="mouseout"||c==="pointerout",Te&&m!==hn&&(nt=m.relatedTarget||m.fromElement)&&(oo(nt)||nt[Li]))break e;if((Ze||Te)&&(Te=Me.window===Me?Me:(Te=Me.ownerDocument)?Te.defaultView||Te.parentWindow:window,Ze?(nt=m.relatedTarget||m.toElement,Ze=ve,nt=nt?oo(nt):null,nt!==null&&(dr=El(nt),nt!==dr||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Ze=null,nt=ve),Ze!==nt)){if(st=Wg,Fe="onMouseLeave",he="onMouseEnter",se="mouse",(c==="pointerout"||c==="pointerover")&&(st=hf,Fe="onPointerLeave",he="onPointerEnter",se="pointer"),dr=Ze==null?Te:Ot(Ze),pe=nt==null?Te:Ot(nt),Te=new st(Fe,se+"leave",Ze,m,Me),Te.target=dr,Te.relatedTarget=pe,Fe=null,oo(Me)===ve&&(st=new st(he,se+"enter",nt,m,Me),st.target=pe,st.relatedTarget=dr,Fe=st),dr=Fe,Ze&&nt)t:{for(st=Ze,he=nt,se=0,pe=st;pe;pe=zc(pe))se++;for(pe=0,Fe=he;Fe;Fe=zc(Fe))pe++;for(;0<se-pe;)st=zc(st),se--;for(;0<pe-se;)he=zc(he),pe--;for(;se--;){if(st===he||he!==null&&st===he.alternate)break t;st=zc(st),he=zc(he)}st=null}else st=null;Ze!==null&&br(Ae,Te,Ze,st,!1),nt!==null&&dr!==null&&br(Ae,dr,nt,st,!0)}}e:{if(Te=ve?Ot(ve):window,Ze=Te.nodeName&&Te.nodeName.toLowerCase(),Ze==="select"||Ze==="input"&&Te.type==="file")var ut=U_;else if(ff(Te))if(Il)ut=le;else{ut=W_;var pt=K_}else(Ze=Te.nodeName)&&Ze.toLowerCase()==="input"&&(Te.type==="checkbox"||Te.type==="radio")&&(ut=Lc);if(ut&&(ut=ut(c,ve))){ty(Ae,ut,m,Me);break e}pt&&pt(c,Te,ve),c==="focusout"&&(pt=Te._wrapperState)&&pt.controlled&&Te.type==="number"&&kn(Te,"number",Te.value)}switch(pt=ve?Ot(ve):window,c){case"focusin":(ff(pt)||pt.contentEditable==="true")&&(Lo=pt,ny=ve,io=null);break;case"focusout":io=ny=Lo=null;break;case"mousedown":jc=!0;break;case"contextmenu":case"mouseup":case"dragend":jc=!1,Cd(Ae,m,Me);break;case"selectionchange":if(Ji)break;case"keydown":case"keyup":Cd(Ae,m,Me)}var ht;if(wd)e:{switch(c){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Rc?W0(c,m)&&(mt="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(mt="onCompositionStart");mt&&(ey&&m.locale!=="ko"&&(Rc||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Rc&&(ht=Hg()):(Bn=Me,bd="value"in Bn?Bn.value:Bn.textContent,Rc=!0)),pt=Cf(ve,mt),0<pt.length&&(mt=new j0(mt,c,null,m,Me),Ae.push({event:mt,listeners:pt}),ht?mt.data=ht:(ht=q0(m),ht!==null&&(mt.data=ht)))),(ht=H0?kc(c,m):V_(c,m))&&(ve=Cf(ve,"onBeforeInput"),0<ve.length&&(Me=new j0("onBeforeInput","beforeinput",null,m,Me),Ae.push({event:Me,listeners:ve}),Me.data=ht))}e1(Ae,d)})}function $c(c,d,m){return{instance:c,listener:d,currentTarget:m}}function Cf(c,d){for(var m=d+"Capture",b=[];c!==null;){var N=c,O=N.stateNode;N.tag===5&&O!==null&&(N=O,O=xr(c,m),O!=null&&b.unshift($c(c,O,N)),O=xr(c,d),O!=null&&b.push($c(c,O,N))),c=c.return}return b}function zc(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function br(c,d,m,b,N){for(var O=d._reactName,z=[];m!==null&&m!==b;){var Z=m,ne=Z.alternate,ve=Z.stateNode;if(ne!==null&&ne===b)break;Z.tag===5&&ve!==null&&(Z=ve,N?(ne=xr(m,O),ne!=null&&z.unshift($c(m,ne,Z))):N||(ne=xr(m,O),ne!=null&&z.push($c(m,ne,Z)))),m=m.return}z.length!==0&&c.push({event:d,listeners:z})}var Yr=/\r\n?/g,G_=/\u0000|\uFFFD/g;function t1(c){return(typeof c=="string"?c:""+c).replace(Yr,`
|
||
`).replace(G_,"")}function Nd(c,d,m){if(d=t1(d),t1(c)!==d&&m)throw Error(r(425))}function Ef(){}var Id=null,Ml=null;function Od(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Da=typeof setTimeout=="function"?setTimeout:void 0,Td=typeof clearTimeout=="function"?clearTimeout:void 0,Vc=typeof Promise=="function"?Promise:void 0,xf=typeof queueMicrotask=="function"?queueMicrotask:typeof Vc<"u"?function(c){return Vc.resolve(null).then(c).catch(Bc)}:Da;function Bc(c){setTimeout(function(){throw c})}function oy(c,d){var m=d,b=0;do{var N=m.nextSibling;if(c.removeChild(m),N&&N.nodeType===8)if(m=N.data,m==="/$"){if(b===0){c.removeChild(N),fn(d);return}b--}else m!=="$"&&m!=="$?"&&m!=="$!"||b++;m=N}while(m);fn(d)}function Na(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return c}function n1(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"){if(d===0)return c;d--}else m==="/$"&&d++}c=c.previousSibling}return null}var Hc=Math.random().toString(36).slice(2),so="__reactFiber$"+Hc,Ia="__reactProps$"+Hc,Li="__reactContainer$"+Hc,Sf="__reactEvents$"+Hc,U="__reactListeners$"+Hc,Uc="__reactHandles$"+Hc;function oo(c){var d=c[so];if(d)return d;for(var m=c.parentNode;m;){if(d=m[Li]||m[so]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=n1(c);c!==null;){if(m=c[so])return m;c=n1(c)}return d}c=m,m=c.parentNode}return null}function Xr(c){return c=c[so]||c[Li],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function Ot(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(r(33))}function Df(c){return c[Ia]||null}var ay=[],Kc=-1;function Ei(c){return{current:c}}function jn(c){0>Kc||(c.current=ay[Kc],ay[Kc]=null,Kc--)}function An(c,d){Kc++,ay[Kc]=c.current,c.current=d}var Oa={},Zr=Ei(Oa),xi=Ei(!1),hi=Oa;function Wc(c,d){var m=c.type.contextTypes;if(!m)return Oa;var b=c.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===d)return b.__reactInternalMemoizedMaskedChildContext;var N={},O;for(O in m)N[O]=d[O];return b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=N),N}function Si(c){return c=c.childContextTypes,c!=null}function Nf(){jn(xi),jn(Zr)}function r1(c,d,m){if(Zr.current!==Oa)throw Error(r(168));An(Zr,d),An(xi,m)}function i1(c,d,m){var b=c.stateNode;if(d=d.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var N in b)if(!(N in d))throw Error(r(108,Re(c)||"Unknown",N));return ge({},m,b)}function es(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Oa,hi=Zr.current,An(Zr,c),An(xi,xi.current),!0}function s1(c,d,m){var b=c.stateNode;if(!b)throw Error(r(169));m?(c=i1(c,d,hi),b.__reactInternalMemoizedMergedChildContext=c,jn(xi),jn(Zr),An(Zr,c)):jn(xi),An(xi,m)}var $o=null,If=!1,ly=!1;function o1(c){$o===null?$o=[c]:$o.push(c)}function Pl(c){If=!0,o1(c)}function Ta(){if(!ly&&$o!==null){ly=!0;var c=0,d=ln;try{var m=$o;for(ln=1;c<m.length;c++){var b=m[c];do b=b(!0);while(b!==null)}$o=null,If=!1}catch(N){throw $o!==null&&($o=$o.slice(c+1)),C0(Lg,Ta),N}finally{ln=d,ly=!1}}return null}var qc=[],Qr=0,Of=null,Tf=0,ts=[],ns=0,Al=null,ao=1,lo="";function Rl(c,d){qc[Qr++]=Tf,qc[Qr++]=Of,Of=c,Tf=d}function a1(c,d,m){ts[ns++]=ao,ts[ns++]=lo,ts[ns++]=Al,Al=c;var b=ao;c=lo;var N=32-Ns(b)-1;b&=~(1<<N),m+=1;var O=32-Ns(d)+N;if(30<O){var z=N-N%5;O=(b&(1<<z)-1).toString(32),b>>=z,N-=z,ao=1<<32-Ns(d)+N|m<<N|b,lo=O+c}else ao=1<<O|m<<N|b,lo=c}function Md(c){c.return!==null&&(Rl(c,1),a1(c,1,0))}function kl(c){for(;c===Of;)Of=qc[--Qr],qc[Qr]=null,Tf=qc[--Qr],qc[Qr]=null;for(;c===Al;)Al=ts[--ns],ts[ns]=null,lo=ts[--ns],ts[ns]=null,ao=ts[--ns],ts[ns]=null}var Jr=null,ji=null,Fn=!1,Os=null;function co(c,d){var m=cs(5,null,null,0);m.elementType="DELETED",m.stateNode=d,m.return=c,d=c.deletions,d===null?(c.deletions=[m],c.flags|=16):d.push(m)}function Mf(c,d){switch(c.tag){case 5:var m=c.type;return d=d.nodeType!==1||m.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,Jr=c,ji=Na(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,Jr=c,ji=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(m=Al!==null?{id:ao,overflow:lo}:null,c.memoizedState={dehydrated:d,treeContext:m,retryLane:1073741824},m=cs(18,null,null,0),m.stateNode=d,m.return=c,c.child=m,Jr=c,ji=null,!0):!1;default:return!1}}function zo(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Di(c){if(Fn){var d=ji;if(d){var m=d;if(!Mf(c,d)){if(zo(c))throw Error(r(418));d=Na(m.nextSibling);var b=Jr;d&&Mf(c,d)?co(b,m):(c.flags=c.flags&-4097|2,Fn=!1,Jr=c)}}else{if(zo(c))throw Error(r(418));c.flags=c.flags&-4097|2,Fn=!1,Jr=c}}}function l1(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Jr=c}function Pd(c){if(c!==Jr)return!1;if(!Fn)return l1(c),Fn=!0,!1;var d;if((d=c.tag!==3)&&!(d=c.tag!==5)&&(d=c.type,d=d!=="head"&&d!=="body"&&!Od(c.type,c.memoizedProps)),d&&(d=ji)){if(zo(c))throw cy(),Error(r(418));for(;d;)co(c,d),d=Na(d.nextSibling)}if(l1(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));e:{for(c=c.nextSibling,d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"){if(d===0){ji=Na(c.nextSibling);break e}d--}else m!=="$"&&m!=="$!"&&m!=="$?"||d++}c=c.nextSibling}ji=null}}else ji=Jr?Na(c.stateNode.nextSibling):null;return!0}function cy(){for(var c=ji;c;)c=Na(c.nextSibling)}function uo(){ji=Jr=null,Fn=!1}function ho(c){Os===null?Os=[c]:Os.push(c)}var c1=k.ReactCurrentBatchConfig;function Ad(c,d,m){if(c=m.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(r(309));var b=m.stateNode}if(!b)throw Error(r(147,c));var N=b,O=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===O?d.ref:(d=function(z){var Z=N.refs;z===null?delete Z[O]:Z[O]=z},d._stringRef=O,d)}if(typeof c!="string")throw Error(r(284));if(!m._owner)throw Error(r(290,c))}return c}function Ll(c,d){throw c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function u1(c){var d=c._init;return d(c._payload)}function uy(c){function d(he,se){if(c){var pe=he.deletions;pe===null?(he.deletions=[se],he.flags|=16):pe.push(se)}}function m(he,se){if(!c)return null;for(;se!==null;)d(he,se),se=se.sibling;return null}function b(he,se){for(he=new Map;se!==null;)se.key!==null?he.set(se.key,se):he.set(se.index,se),se=se.sibling;return he}function N(he,se){return he=Ls(he,se),he.index=0,he.sibling=null,he}function O(he,se,pe){return he.index=pe,c?(pe=he.alternate,pe!==null?(pe=pe.index,pe<se?(he.flags|=2,se):pe):(he.flags|=2,se)):(he.flags|=1048576,se)}function z(he){return c&&he.alternate===null&&(he.flags|=2),he}function Z(he,se,pe,Fe){return se===null||se.tag!==6?(se=Xy(pe,he.mode,Fe),se.return=he,se):(se=N(se,pe),se.return=he,se)}function ne(he,se,pe,Fe){var ut=pe.type;return ut===V?Me(he,se,pe.props.children,Fe,pe.key):se!==null&&(se.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===Ne&&u1(ut)===se.type)?(Fe=N(se,pe.props),Fe.ref=Ad(he,se,pe),Fe.return=he,Fe):(Fe=hp(pe.type,pe.key,pe.props,null,he.mode,Fe),Fe.ref=Ad(he,se,pe),Fe.return=he,Fe)}function ve(he,se,pe,Fe){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=Zy(pe,he.mode,Fe),se.return=he,se):(se=N(se,pe.children||[]),se.return=he,se)}function Me(he,se,pe,Fe,ut){return se===null||se.tag!==7?(se=ql(pe,he.mode,Fe,ut),se.return=he,se):(se=N(se,pe),se.return=he,se)}function Ae(he,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number")return se=Xy(""+se,he.mode,pe),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return pe=hp(se.type,se.key,se.props,null,he.mode,pe),pe.ref=Ad(he,null,se),pe.return=he,pe;case j:return se=Zy(se,he.mode,pe),se.return=he,se;case Ne:var Fe=se._init;return Ae(he,Fe(se._payload),pe)}if(yt(se)||ae(se))return se=ql(se,he.mode,pe,null),se.return=he,se;Ll(he,se)}return null}function Te(he,se,pe,Fe){var ut=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number")return ut!==null?null:Z(he,se,""+pe,Fe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:return pe.key===ut?ne(he,se,pe,Fe):null;case j:return pe.key===ut?ve(he,se,pe,Fe):null;case Ne:return ut=pe._init,Te(he,se,ut(pe._payload),Fe)}if(yt(pe)||ae(pe))return ut!==null?null:Me(he,se,pe,Fe,null);Ll(he,pe)}return null}function Ze(he,se,pe,Fe,ut){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return he=he.get(pe)||null,Z(se,he,""+Fe,ut);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case A:return he=he.get(Fe.key===null?pe:Fe.key)||null,ne(se,he,Fe,ut);case j:return he=he.get(Fe.key===null?pe:Fe.key)||null,ve(se,he,Fe,ut);case Ne:var pt=Fe._init;return Ze(he,se,pe,pt(Fe._payload),ut)}if(yt(Fe)||ae(Fe))return he=he.get(pe)||null,Me(se,he,Fe,ut,null);Ll(se,Fe)}return null}function nt(he,se,pe,Fe){for(var ut=null,pt=null,ht=se,mt=se=0,Rr=null;ht!==null&&mt<pe.length;mt++){ht.index>mt?(Rr=ht,ht=null):Rr=ht.sibling;var nn=Te(he,ht,pe[mt],Fe);if(nn===null){ht===null&&(ht=Rr);break}c&&ht&&nn.alternate===null&&d(he,ht),se=O(nn,se,mt),pt===null?ut=nn:pt.sibling=nn,pt=nn,ht=Rr}if(mt===pe.length)return m(he,ht),Fn&&Rl(he,mt),ut;if(ht===null){for(;mt<pe.length;mt++)ht=Ae(he,pe[mt],Fe),ht!==null&&(se=O(ht,se,mt),pt===null?ut=ht:pt.sibling=ht,pt=ht);return Fn&&Rl(he,mt),ut}for(ht=b(he,ht);mt<pe.length;mt++)Rr=Ze(ht,he,mt,pe[mt],Fe),Rr!==null&&(c&&Rr.alternate!==null&&ht.delete(Rr.key===null?mt:Rr.key),se=O(Rr,se,mt),pt===null?ut=Rr:pt.sibling=Rr,pt=Rr);return c&&ht.forEach(function(Ba){return d(he,Ba)}),Fn&&Rl(he,mt),ut}function st(he,se,pe,Fe){var ut=ae(pe);if(typeof ut!="function")throw Error(r(150));if(pe=ut.call(pe),pe==null)throw Error(r(151));for(var pt=ut=null,ht=se,mt=se=0,Rr=null,nn=pe.next();ht!==null&&!nn.done;mt++,nn=pe.next()){ht.index>mt?(Rr=ht,ht=null):Rr=ht.sibling;var Ba=Te(he,ht,nn.value,Fe);if(Ba===null){ht===null&&(ht=Rr);break}c&&ht&&Ba.alternate===null&&d(he,ht),se=O(Ba,se,mt),pt===null?ut=Ba:pt.sibling=Ba,pt=Ba,ht=Rr}if(nn.done)return m(he,ht),Fn&&Rl(he,mt),ut;if(ht===null){for(;!nn.done;mt++,nn=pe.next())nn=Ae(he,nn.value,Fe),nn!==null&&(se=O(nn,se,mt),pt===null?ut=nn:pt.sibling=nn,pt=nn);return Fn&&Rl(he,mt),ut}for(ht=b(he,ht);!nn.done;mt++,nn=pe.next())nn=Ze(ht,he,mt,nn.value,Fe),nn!==null&&(c&&nn.alternate!==null&&ht.delete(nn.key===null?mt:nn.key),se=O(nn,se,mt),pt===null?ut=nn:pt.sibling=nn,pt=nn);return c&&ht.forEach(function(gC){return d(he,gC)}),Fn&&Rl(he,mt),ut}function dr(he,se,pe,Fe){if(typeof pe=="object"&&pe!==null&&pe.type===V&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:e:{for(var ut=pe.key,pt=se;pt!==null;){if(pt.key===ut){if(ut=pe.type,ut===V){if(pt.tag===7){m(he,pt.sibling),se=N(pt,pe.props.children),se.return=he,he=se;break e}}else if(pt.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===Ne&&u1(ut)===pt.type){m(he,pt.sibling),se=N(pt,pe.props),se.ref=Ad(he,pt,pe),se.return=he,he=se;break e}m(he,pt);break}else d(he,pt);pt=pt.sibling}pe.type===V?(se=ql(pe.props.children,he.mode,Fe,pe.key),se.return=he,he=se):(Fe=hp(pe.type,pe.key,pe.props,null,he.mode,Fe),Fe.ref=Ad(he,se,pe),Fe.return=he,he=Fe)}return z(he);case j:e:{for(pt=pe.key;se!==null;){if(se.key===pt)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){m(he,se.sibling),se=N(se,pe.children||[]),se.return=he,he=se;break e}else{m(he,se);break}else d(he,se);se=se.sibling}se=Zy(pe,he.mode,Fe),se.return=he,he=se}return z(he);case Ne:return pt=pe._init,dr(he,se,pt(pe._payload),Fe)}if(yt(pe))return nt(he,se,pe,Fe);if(ae(pe))return st(he,se,pe,Fe);Ll(he,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,se!==null&&se.tag===6?(m(he,se.sibling),se=N(se,pe),se.return=he,he=se):(m(he,se),se=Xy(pe,he.mode,Fe),se.return=he,he=se),z(he)):m(he,se)}return dr}var tr=uy(!0),Pf=uy(!1),Rd=Ei(null),Fi=null,Ma=null,Gc=null;function Vo(){Gc=Ma=Fi=null}function Af(c){var d=Rd.current;jn(Rd),c._currentValue=d}function $r(c,d,m){for(;c!==null;){var b=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),c===m)break;c=c.return}}function Pa(c,d){Fi=c,Gc=Ma=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&d)!==0&&(pi=!0),c.firstContext=null)}function rs(c){var d=c._currentValue;if(Gc!==c)if(c={context:c,memoizedValue:d,next:null},Ma===null){if(Fi===null)throw Error(r(308));Ma=c,Fi.dependencies={lanes:0,firstContext:c}}else Ma=Ma.next=c;return d}var jl=null;function dy(c){jl===null?jl=[c]:jl.push(c)}function Rf(c,d,m,b){var N=d.interleaved;return N===null?(m.next=m,dy(d)):(m.next=N.next,N.next=m),d.interleaved=m,Bo(c,b)}function Bo(c,d){c.lanes|=d;var m=c.alternate;for(m!==null&&(m.lanes|=d),m=c,c=c.return;c!==null;)c.childLanes|=d,m=c.alternate,m!==null&&(m.childLanes|=d),m=c,c=c.return;return m.tag===3?m.stateNode:null}var is=!1;function kf(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function d1(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Ho(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function ss(c,d,m){var b=c.updateQueue;if(b===null)return null;if(b=b.shared,(Xt&2)!==0){var N=b.pending;return N===null?d.next=d:(d.next=N.next,N.next=d),b.pending=d,Bo(c,m)}return N=b.interleaved,N===null?(d.next=d,dy(b)):(d.next=N.next,N.next=d),b.interleaved=d,Bo(c,m)}function Lf(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194240)!==0)){var b=d.lanes;b&=c.pendingLanes,m|=b,d.lanes=m,yd(c,m)}}function h1(c,d){var m=c.updateQueue,b=c.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var N=null,O=null;if(m=m.firstBaseUpdate,m!==null){do{var z={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};O===null?N=O=z:O=O.next=z,m=m.next}while(m!==null);O===null?N=O=d:O=O.next=d}else N=O=d;m={baseState:b.baseState,firstBaseUpdate:N,lastBaseUpdate:O,shared:b.shared,effects:b.effects},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}function Yc(c,d,m,b){var N=c.updateQueue;is=!1;var O=N.firstBaseUpdate,z=N.lastBaseUpdate,Z=N.shared.pending;if(Z!==null){N.shared.pending=null;var ne=Z,ve=ne.next;ne.next=null,z===null?O=ve:z.next=ve,z=ne;var Me=c.alternate;Me!==null&&(Me=Me.updateQueue,Z=Me.lastBaseUpdate,Z!==z&&(Z===null?Me.firstBaseUpdate=ve:Z.next=ve,Me.lastBaseUpdate=ne))}if(O!==null){var Ae=N.baseState;z=0,Me=ve=ne=null,Z=O;do{var Te=Z.lane,Ze=Z.eventTime;if((b&Te)===Te){Me!==null&&(Me=Me.next={eventTime:Ze,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var nt=c,st=Z;switch(Te=d,Ze=m,st.tag){case 1:if(nt=st.payload,typeof nt=="function"){Ae=nt.call(Ze,Ae,Te);break e}Ae=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=st.payload,Te=typeof nt=="function"?nt.call(Ze,Ae,Te):nt,Te==null)break e;Ae=ge({},Ae,Te);break e;case 2:is=!0}}Z.callback!==null&&Z.lane!==0&&(c.flags|=64,Te=N.effects,Te===null?N.effects=[Z]:Te.push(Z))}else Ze={eventTime:Ze,lane:Te,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Me===null?(ve=Me=Ze,ne=Ae):Me=Me.next=Ze,z|=Te;if(Z=Z.next,Z===null){if(Z=N.shared.pending,Z===null)break;Te=Z,Z=Te.next,Te.next=null,N.lastBaseUpdate=Te,N.shared.pending=null}}while(!0);if(Me===null&&(ne=Ae),N.baseState=ne,N.firstBaseUpdate=ve,N.lastBaseUpdate=Me,d=N.shared.interleaved,d!==null){N=d;do z|=N.lane,N=N.next;while(N!==d)}else O===null&&(N.shared.lanes=0);ja|=z,c.lanes=z,c.memoizedState=Ae}}function hy(c,d,m){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var b=c[d],N=b.callback;if(N!==null){if(b.callback=null,b=m,typeof N!="function")throw Error(r(191,N));N.call(b)}}}var kd={},fo=Ei(kd),Ld=Ei(kd),Xc=Ei(kd);function Uo(c){if(c===kd)throw Error(r(174));return c}function fy(c,d){switch(An(Xc,d),An(Ld,c),An(fo,kd),c=d.nodeType,c){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:dn(null,"");break;default:c=c===8?d.parentNode:d,d=c.namespaceURI||null,c=c.tagName,d=dn(d,c)}jn(fo),An(fo,d)}function Aa(){jn(fo),jn(Ld),jn(Xc)}function py(c){Uo(Xc.current);var d=Uo(fo.current),m=dn(d,c.type);d!==m&&(An(Ld,c),An(fo,m))}function jf(c){Ld.current===c&&(jn(fo),jn(Ld))}var Hn=Ei(0);function Fl(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var gy=[];function Ff(){for(var c=0;c<gy.length;c++)gy[c]._workInProgressVersionPrimary=null;gy.length=0}var jd=k.ReactCurrentDispatcher,yy=k.ReactCurrentBatchConfig,Ra=0,Yn=null,ur=null,Sr=null,Zc=!1,Fd=!1,$l=0,Rt=0;function ei(){throw Error(r(321))}function my(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!me(c[m],d[m]))return!1;return!0}function zl(c,d,m,b,N,O){if(Ra=O,Yn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,jd.current=c===null||c.memoizedState===null?X_:Kf,c=m(b,N),Fd){O=0;do{if(Fd=!1,$l=0,25<=O)throw Error(r(301));O+=1,Sr=ur=null,d.updateQueue=null,jd.current=tu,c=m(b,N)}while(Fd)}if(jd.current=Uf,d=ur!==null&&ur.next!==null,Ra=0,Sr=ur=Yn=null,Zc=!1,d)throw Error(r(300));return c}function $f(){var c=$l!==0;return $l=0,c}function po(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?Yn.memoizedState=Sr=c:Sr=Sr.next=c,Sr}function os(){if(ur===null){var c=Yn.alternate;c=c!==null?c.memoizedState:null}else c=ur.next;var d=Sr===null?Yn.memoizedState:Sr.next;if(d!==null)Sr=d,ur=c;else{if(c===null)throw Error(r(310));ur=c,c={memoizedState:ur.memoizedState,baseState:ur.baseState,baseQueue:ur.baseQueue,queue:ur.queue,next:null},Sr===null?Yn.memoizedState=Sr=c:Sr=Sr.next=c}return Sr}function ti(c,d){return typeof d=="function"?d(c):d}function vy(c){var d=os(),m=d.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var b=ur,N=b.baseQueue,O=m.pending;if(O!==null){if(N!==null){var z=N.next;N.next=O.next,O.next=z}b.baseQueue=N=O,m.pending=null}if(N!==null){O=N.next,b=b.baseState;var Z=z=null,ne=null,ve=O;do{var Me=ve.lane;if((Ra&Me)===Me)ne!==null&&(ne=ne.next={lane:0,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),b=ve.hasEagerState?ve.eagerState:c(b,ve.action);else{var Ae={lane:Me,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null};ne===null?(Z=ne=Ae,z=b):ne=ne.next=Ae,Yn.lanes|=Me,ja|=Me}ve=ve.next}while(ve!==null&&ve!==O);ne===null?z=b:ne.next=Z,me(b,d.memoizedState)||(pi=!0),d.memoizedState=b,d.baseState=z,d.baseQueue=ne,m.lastRenderedState=b}if(c=m.interleaved,c!==null){N=c;do O=N.lane,Yn.lanes|=O,ja|=O,N=N.next;while(N!==c)}else N===null&&(m.lanes=0);return[d.memoizedState,m.dispatch]}function Qc(c){var d=os(),m=d.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var b=m.dispatch,N=m.pending,O=d.memoizedState;if(N!==null){m.pending=null;var z=N=N.next;do O=c(O,z.action),z=z.next;while(z!==N);me(O,d.memoizedState)||(pi=!0),d.memoizedState=O,d.baseQueue===null&&(d.baseState=O),m.lastRenderedState=O}return[O,b]}function zf(){}function by(c,d){var m=Yn,b=os(),N=d(),O=!me(b.memoizedState,N);if(O&&(b.memoizedState=N,pi=!0),b=b.queue,go(Ko.bind(null,m,b,c),[c]),b.getSnapshot!==d||O||Sr!==null&&Sr.memoizedState.tag&1){if(m.flags|=2048,Jc(9,Ni.bind(null,m,b,N,d),void 0,null),Ar===null)throw Error(r(349));(Ra&30)!==0||wy(m,d,N)}return N}function wy(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=Yn.updateQueue,d===null?(d={lastEffect:null,stores:null},Yn.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function Ni(c,d,m,b){d.value=m,d.getSnapshot=b,Vf(d)&&_y(c)}function Ko(c,d,m){return m(function(){Vf(d)&&_y(c)})}function Vf(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!me(c,m)}catch{return!0}}function _y(c){var d=Bo(c,1);d!==null&&ks(d,c,1,-1)}function $d(c){var d=po();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:c},d.queue=c,c=c.dispatch=v1.bind(null,Yn,c),[d.memoizedState,c]}function Jc(c,d,m,b){return c={tag:c,create:d,destroy:m,deps:b,next:null},d=Yn.updateQueue,d===null?(d={lastEffect:null,stores:null},Yn.updateQueue=d,d.lastEffect=c.next=c):(m=d.lastEffect,m===null?d.lastEffect=c.next=c:(b=m.next,m.next=c,c.next=b,d.lastEffect=c)),c}function Bf(){return os().memoizedState}function zd(c,d,m,b){var N=po();Yn.flags|=c,N.memoizedState=Jc(1|d,m,void 0,b===void 0?null:b)}function eu(c,d,m,b){var N=os();b=b===void 0?null:b;var O=void 0;if(ur!==null){var z=ur.memoizedState;if(O=z.destroy,b!==null&&my(b,z.deps)){N.memoizedState=Jc(d,m,O,b);return}}Yn.flags|=c,N.memoizedState=Jc(1|d,m,O,b)}function Hf(c,d){return zd(8390656,8,c,d)}function go(c,d){return eu(2048,8,c,d)}function f1(c,d){return eu(4,2,c,d)}function Wo(c,d){return eu(4,4,c,d)}function Cy(c,d){if(typeof d=="function")return c=c(),d(c),function(){d(null)};if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function Ey(c,d,m){return m=m!=null?m.concat([c]):null,eu(4,4,Cy.bind(null,d,c),m)}function Vd(){}function p1(c,d){var m=os();d=d===void 0?null:d;var b=m.memoizedState;return b!==null&&d!==null&&my(d,b[1])?b[0]:(m.memoizedState=[c,d],c)}function g1(c,d){var m=os();d=d===void 0?null:d;var b=m.memoizedState;return b!==null&&d!==null&&my(d,b[1])?b[0]:(c=c(),m.memoizedState=[c,d],c)}function y1(c,d,m){return(Ra&21)===0?(c.baseState&&(c.baseState=!1,pi=!0),c.memoizedState=m):(me(m,d)||(m=Fg(),Yn.lanes|=m,ja|=m,c.baseState=!0),d)}function m1(c,d){var m=ln;ln=m!==0&&4>m?m:4,c(!0);var b=yy.transition;yy.transition={};try{c(!1),d()}finally{ln=m,yy.transition=b}}function xy(){return os().memoizedState}function Y_(c,d,m){var b=za(c);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},Sy(c))fi(d,m);else if(m=Rf(c,d,m,b),m!==null){var N=mi();ks(m,c,b,N),Ts(m,d,b)}}function v1(c,d,m){var b=za(c),N={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(Sy(c))fi(d,N);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var z=d.lastRenderedState,Z=O(z,m);if(N.hasEagerState=!0,N.eagerState=Z,me(Z,z)){var ne=d.interleaved;ne===null?(N.next=N,dy(d)):(N.next=ne.next,ne.next=N),d.interleaved=N;return}}catch{}finally{}m=Rf(c,d,N,b),m!==null&&(N=mi(),ks(m,c,b,N),Ts(m,d,b))}}function Sy(c){var d=c.alternate;return c===Yn||d!==null&&d===Yn}function fi(c,d){Fd=Zc=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function Ts(c,d,m){if((m&4194240)!==0){var b=d.lanes;b&=c.pendingLanes,m|=b,d.lanes=m,yd(c,m)}}var Uf={readContext:rs,useCallback:ei,useContext:ei,useEffect:ei,useImperativeHandle:ei,useInsertionEffect:ei,useLayoutEffect:ei,useMemo:ei,useReducer:ei,useRef:ei,useState:ei,useDebugValue:ei,useDeferredValue:ei,useTransition:ei,useMutableSource:ei,useSyncExternalStore:ei,useId:ei,unstable_isNewReconciler:!1},X_={readContext:rs,useCallback:function(c,d){return po().memoizedState=[c,d===void 0?null:d],c},useContext:rs,useEffect:Hf,useImperativeHandle:function(c,d,m){return m=m!=null?m.concat([c]):null,zd(4194308,4,Cy.bind(null,d,c),m)},useLayoutEffect:function(c,d){return zd(4194308,4,c,d)},useInsertionEffect:function(c,d){return zd(4,2,c,d)},useMemo:function(c,d){var m=po();return d=d===void 0?null:d,c=c(),m.memoizedState=[c,d],c},useReducer:function(c,d,m){var b=po();return d=m!==void 0?m(d):d,b.memoizedState=b.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},b.queue=c,c=c.dispatch=Y_.bind(null,Yn,c),[b.memoizedState,c]},useRef:function(c){var d=po();return c={current:c},d.memoizedState=c},useState:$d,useDebugValue:Vd,useDeferredValue:function(c){return po().memoizedState=c},useTransition:function(){var c=$d(!1),d=c[0];return c=m1.bind(null,c[1]),po().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,m){var b=Yn,N=po();if(Fn){if(m===void 0)throw Error(r(407));m=m()}else{if(m=d(),Ar===null)throw Error(r(349));(Ra&30)!==0||wy(b,d,m)}N.memoizedState=m;var O={value:m,getSnapshot:d};return N.queue=O,Hf(Ko.bind(null,b,O,c),[c]),b.flags|=2048,Jc(9,Ni.bind(null,b,O,m,d),void 0,null),m},useId:function(){var c=po(),d=Ar.identifierPrefix;if(Fn){var m=lo,b=ao;m=(b&~(1<<32-Ns(b)-1)).toString(32)+m,d=":"+d+"R"+m,m=$l++,0<m&&(d+="H"+m.toString(32)),d+=":"}else m=Rt++,d=":"+d+"r"+m.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},Kf={readContext:rs,useCallback:p1,useContext:rs,useEffect:go,useImperativeHandle:Ey,useInsertionEffect:f1,useLayoutEffect:Wo,useMemo:g1,useReducer:vy,useRef:Bf,useState:function(){return vy(ti)},useDebugValue:Vd,useDeferredValue:function(c){var d=os();return y1(d,ur.memoizedState,c)},useTransition:function(){var c=vy(ti)[0],d=os().memoizedState;return[c,d]},useMutableSource:zf,useSyncExternalStore:by,useId:xy,unstable_isNewReconciler:!1},tu={readContext:rs,useCallback:p1,useContext:rs,useEffect:go,useImperativeHandle:Ey,useInsertionEffect:f1,useLayoutEffect:Wo,useMemo:g1,useReducer:Qc,useRef:Bf,useState:function(){return Qc(ti)},useDebugValue:Vd,useDeferredValue:function(c){var d=os();return ur===null?d.memoizedState=c:y1(d,ur.memoizedState,c)},useTransition:function(){var c=Qc(ti)[0],d=os().memoizedState;return[c,d]},useMutableSource:zf,useSyncExternalStore:by,useId:xy,unstable_isNewReconciler:!1};function as(c,d){if(c&&c.defaultProps){d=ge({},d),c=c.defaultProps;for(var m in c)d[m]===void 0&&(d[m]=c[m]);return d}return d}function Wf(c,d,m,b){d=c.memoizedState,m=m(b,d),m=m==null?d:ge({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var qf={isMounted:function(c){return(c=c._reactInternals)?El(c)===c:!1},enqueueSetState:function(c,d,m){c=c._reactInternals;var b=mi(),N=za(c),O=Ho(b,N);O.payload=d,m!=null&&(O.callback=m),d=ss(c,O,N),d!==null&&(ks(d,c,N,b),Lf(d,c,N))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var b=mi(),N=za(c),O=Ho(b,N);O.tag=1,O.payload=d,m!=null&&(O.callback=m),d=ss(c,O,N),d!==null&&(ks(d,c,N,b),Lf(d,c,N))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=mi(),b=za(c),N=Ho(m,b);N.tag=2,d!=null&&(N.callback=d),d=ss(c,N,b),d!==null&&(ks(d,c,b,m),Lf(d,c,b))}};function Dy(c,d,m,b,N,O,z){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(b,O,z):d.prototype&&d.prototype.isPureReactComponent?!Xe(m,b)||!Xe(N,O):!0}function Vl(c,d,m){var b=!1,N=Oa,O=d.contextType;return typeof O=="object"&&O!==null?O=rs(O):(N=Si(d)?hi:Zr.current,b=d.contextTypes,O=(b=b!=null)?Wc(c,N):Oa),d=new d(m,O),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=qf,c.stateNode=d,d._reactInternals=c,b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=N,c.__reactInternalMemoizedMaskedChildContext=O),d}function nu(c,d,m,b){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,b),d.state!==c&&qf.enqueueReplaceState(d,d.state,null)}function Ny(c,d,m,b){var N=c.stateNode;N.props=m,N.state=c.memoizedState,N.refs={},kf(c);var O=d.contextType;typeof O=="object"&&O!==null?N.context=rs(O):(O=Si(d)?hi:Zr.current,N.context=Wc(c,O)),N.state=c.memoizedState,O=d.getDerivedStateFromProps,typeof O=="function"&&(Wf(c,d,O,m),N.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(d=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),d!==N.state&&qf.enqueueReplaceState(N,N.state,null),Yc(c,m,N,b),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308)}function Bl(c,d){try{var m="",b=d;do m+=Se(b),b=b.return;while(b);var N=m}catch(O){N=`
|
||
Error generating stack: `+O.message+`
|
||
`+O.stack}return{value:c,source:d,stack:N,digest:null}}function Gf(c,d,m){return{value:c,source:null,stack:m??null,digest:d??null}}function ru(c,d){try{console.error(d.value)}catch(m){setTimeout(function(){throw m})}}var b1=typeof WeakMap=="function"?WeakMap:Map;function Bd(c,d,m){m=Ho(-1,m),m.tag=3,m.payload={element:null};var b=d.value;return m.callback=function(){sp||(sp=!0,Hy=b),ru(c,d)},m}function Yf(c,d,m){m=Ho(-1,m),m.tag=3;var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var N=d.value;m.payload=function(){return b(N)},m.callback=function(){ru(c,d)}}var O=c.stateNode;return O!==null&&typeof O.componentDidCatch=="function"&&(m.callback=function(){ru(c,d),typeof b!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var z=d.stack;this.componentDidCatch(d.value,{componentStack:z!==null?z:""})}),m}function Hd(c,d,m){var b=c.pingCache;if(b===null){b=c.pingCache=new b1;var N=new Set;b.set(d,N)}else N=b.get(d),N===void 0&&(N=new Set,b.set(d,N));N.has(m)||(N.add(m),c=iC.bind(null,c,d,m),d.then(c,c))}function w1(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function Iy(c,d,m,b,N){return(c.mode&1)===0?(c===d?c.flags|=65536:(c.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(d=Ho(-1,1),d.tag=2,ss(m,d,1))),m.lanes|=1),c):(c.flags|=65536,c.lanes=N,c)}var Xf=k.ReactCurrentOwner,pi=!1;function zr(c,d,m,b){d.child=c===null?Pf(d,null,m,b):tr(d,c.child,m,b)}function _1(c,d,m,b,N){m=m.render;var O=d.ref;return Pa(d,N),b=zl(c,d,m,b,O,N),m=$f(),c!==null&&!pi?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,Ms(c,d,N)):(Fn&&m&&Md(d),d.flags|=1,zr(c,d,b,N),d.child)}function Oy(c,d,m,b,N){if(c===null){var O=m.type;return typeof O=="function"&&!dp(O)&&O.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(d.tag=15,d.type=O,yo(c,d,O,b,N)):(c=hp(m.type,null,b,d,d.mode,N),c.ref=d.ref,c.return=d,d.child=c)}if(O=c.child,(c.lanes&N)===0){var z=O.memoizedProps;if(m=m.compare,m=m!==null?m:Xe,m(z,b)&&c.ref===d.ref)return Ms(c,d,N)}return d.flags|=1,c=Ls(O,b),c.ref=d.ref,c.return=d,d.child=c}function yo(c,d,m,b,N){if(c!==null){var O=c.memoizedProps;if(Xe(O,b)&&c.ref===d.ref)if(pi=!1,d.pendingProps=b=O,(c.lanes&N)!==0)(c.flags&131072)!==0&&(pi=!0);else return d.lanes=c.lanes,Ms(c,d,N)}return Py(c,d,m,b,N)}function Ty(c,d,m){var b=d.pendingProps,N=b.children,O=c!==null?c.memoizedState:null;if(b.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},An(au,zi),zi|=m;else{if((m&1073741824)===0)return c=O!==null?O.baseLanes|m:m,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,An(au,zi),zi|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=O!==null?O.baseLanes:m,An(au,zi),zi|=b}else O!==null?(b=O.baseLanes|m,d.memoizedState=null):b=m,An(au,zi),zi|=b;return zr(c,d,N,m),d.child}function My(c,d){var m=d.ref;(c===null&&m!==null||c!==null&&c.ref!==m)&&(d.flags|=512,d.flags|=2097152)}function Py(c,d,m,b,N){var O=Si(m)?hi:Zr.current;return O=Wc(d,O),Pa(d,N),m=zl(c,d,m,b,O,N),b=$f(),c!==null&&!pi?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,Ms(c,d,N)):(Fn&&b&&Md(d),d.flags|=1,zr(c,d,m,N),d.child)}function Ay(c,d,m,b,N){if(Si(m)){var O=!0;es(d)}else O=!1;if(Pa(d,N),d.stateNode===null)Qf(c,d),Vl(d,m,b),Ny(d,m,b,N),b=!0;else if(c===null){var z=d.stateNode,Z=d.memoizedProps;z.props=Z;var ne=z.context,ve=m.contextType;typeof ve=="object"&&ve!==null?ve=rs(ve):(ve=Si(m)?hi:Zr.current,ve=Wc(d,ve));var Me=m.getDerivedStateFromProps,Ae=typeof Me=="function"||typeof z.getSnapshotBeforeUpdate=="function";Ae||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Z!==b||ne!==ve)&&nu(d,z,b,ve),is=!1;var Te=d.memoizedState;z.state=Te,Yc(d,b,z,N),ne=d.memoizedState,Z!==b||Te!==ne||xi.current||is?(typeof Me=="function"&&(Wf(d,m,Me,b),ne=d.memoizedState),(Z=is||Dy(d,m,Z,b,Te,ne,ve))?(Ae||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(d.flags|=4194308)):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=ne),z.props=b,z.state=ne,z.context=ve,b=Z):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{z=d.stateNode,d1(c,d),Z=d.memoizedProps,ve=d.type===d.elementType?Z:as(d.type,Z),z.props=ve,Ae=d.pendingProps,Te=z.context,ne=m.contextType,typeof ne=="object"&&ne!==null?ne=rs(ne):(ne=Si(m)?hi:Zr.current,ne=Wc(d,ne));var Ze=m.getDerivedStateFromProps;(Me=typeof Ze=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(Z!==Ae||Te!==ne)&&nu(d,z,b,ne),is=!1,Te=d.memoizedState,z.state=Te,Yc(d,b,z,N);var nt=d.memoizedState;Z!==Ae||Te!==nt||xi.current||is?(typeof Ze=="function"&&(Wf(d,m,Ze,b),nt=d.memoizedState),(ve=is||Dy(d,m,ve,b,Te,nt,ne)||!1)?(Me||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(b,nt,ne),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(b,nt,ne)),typeof z.componentDidUpdate=="function"&&(d.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof z.componentDidUpdate!="function"||Z===c.memoizedProps&&Te===c.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&Te===c.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=nt),z.props=b,z.state=nt,z.context=ne,b=ve):(typeof z.componentDidUpdate!="function"||Z===c.memoizedProps&&Te===c.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&Te===c.memoizedState||(d.flags|=1024),b=!1)}return Ry(c,d,m,b,O,N)}function Ry(c,d,m,b,N,O){My(c,d);var z=(d.flags&128)!==0;if(!b&&!z)return N&&s1(d,m,!1),Ms(c,d,O);b=d.stateNode,Xf.current=d;var Z=z&&typeof m.getDerivedStateFromError!="function"?null:b.render();return d.flags|=1,c!==null&&z?(d.child=tr(d,c.child,null,O),d.child=tr(d,null,Z,O)):zr(c,d,Z,O),d.memoizedState=b.state,N&&s1(d,m,!0),d.child}function C1(c){var d=c.stateNode;d.pendingContext?r1(c,d.pendingContext,d.pendingContext!==d.context):d.context&&r1(c,d.context,!1),fy(c,d.containerInfo)}function mo(c,d,m,b,N){return uo(),ho(N),d.flags|=256,zr(c,d,m,b),d.child}var Ud={dehydrated:null,treeContext:null,retryLane:0};function Kd(c){return{baseLanes:c,cachePool:null,transitions:null}}function Zf(c,d,m){var b=d.pendingProps,N=Hn.current,O=!1,z=(d.flags&128)!==0,Z;if((Z=z)||(Z=c!==null&&c.memoizedState===null?!1:(N&2)!==0),Z?(O=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(N|=1),An(Hn,N&1),c===null)return Di(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((d.mode&1)===0?d.lanes=1:c.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(z=b.children,c=b.fallback,O?(b=d.mode,O=d.child,z={mode:"hidden",children:z},(b&1)===0&&O!==null?(O.childLanes=0,O.pendingProps=z):O=fp(z,b,0,null),c=ql(c,b,m,null),O.return=d,c.return=d,O.sibling=c,d.child=O,d.child.memoizedState=Kd(m),d.memoizedState=Ud,c):iu(d,z));if(N=c.memoizedState,N!==null&&(Z=N.dehydrated,Z!==null))return gt(c,d,z,b,Z,N,m);if(O){O=b.fallback,z=d.mode,N=c.child,Z=N.sibling;var ne={mode:"hidden",children:b.children};return(z&1)===0&&d.child!==N?(b=d.child,b.childLanes=0,b.pendingProps=ne,d.deletions=null):(b=Ls(N,ne),b.subtreeFlags=N.subtreeFlags&14680064),Z!==null?O=Ls(Z,O):(O=ql(O,z,m,null),O.flags|=2),O.return=d,b.return=d,b.sibling=O,d.child=b,b=O,O=d.child,z=c.child.memoizedState,z=z===null?Kd(m):{baseLanes:z.baseLanes|m,cachePool:null,transitions:z.transitions},O.memoizedState=z,O.childLanes=c.childLanes&~m,d.memoizedState=Ud,b}return O=c.child,c=O.sibling,b=Ls(O,{mode:"visible",children:b.children}),(d.mode&1)===0&&(b.lanes=m),b.return=d,b.sibling=null,c!==null&&(m=d.deletions,m===null?(d.deletions=[c],d.flags|=16):m.push(c)),d.child=b,d.memoizedState=null,b}function iu(c,d){return d=fp({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function qo(c,d,m,b){return b!==null&&ho(b),tr(d,c.child,null,m),c=iu(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function gt(c,d,m,b,N,O,z){if(m)return d.flags&256?(d.flags&=-257,b=Gf(Error(r(422))),qo(c,d,z,b)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(O=b.fallback,N=d.mode,b=fp({mode:"visible",children:b.children},N,0,null),O=ql(O,N,z,null),O.flags|=2,b.return=d,O.return=d,b.sibling=O,d.child=b,(d.mode&1)!==0&&tr(d,c.child,null,z),d.child.memoizedState=Kd(z),d.memoizedState=Ud,O);if((d.mode&1)===0)return qo(c,d,z,null);if(N.data==="$!"){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Z=b.dgst;return b=Z,O=Error(r(419)),b=Gf(O,b,void 0),qo(c,d,z,b)}if(Z=(z&c.childLanes)!==0,pi||Z){if(b=Ar,b!==null){switch(z&-z){case 4:N=2;break;case 16:N=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:N=32;break;case 536870912:N=268435456;break;default:N=0}N=(N&(b.suspendedLanes|z))!==0?0:N,N!==0&&N!==O.retryLane&&(O.retryLane=N,Bo(c,N),ks(b,c,N,-1))}return Yy(),b=Gf(Error(r(421))),qo(c,d,z,b)}return N.data==="$?"?(d.flags|=128,d.child=c.child,d=sC.bind(null,c),N._reactRetry=d,null):(c=O.treeContext,ji=Na(N.nextSibling),Jr=d,Fn=!0,Os=null,c!==null&&(ts[ns++]=ao,ts[ns++]=lo,ts[ns++]=Al,ao=c.id,lo=c.overflow,Al=d),d=iu(d,b.children),d.flags|=4096,d)}function Wd(c,d,m){c.lanes|=d;var b=c.alternate;b!==null&&(b.lanes|=d),$r(c.return,d,m)}function qd(c,d,m,b,N){var O=c.memoizedState;O===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:N}:(O.isBackwards=d,O.rendering=null,O.renderingStartTime=0,O.last=b,O.tail=m,O.tailMode=N)}function ka(c,d,m){var b=d.pendingProps,N=b.revealOrder,O=b.tail;if(zr(c,d,b.children,m),b=Hn.current,(b&2)!==0)b=b&1|2,d.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Wd(c,m,d);else if(c.tag===19)Wd(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}b&=1}if(An(Hn,b),(d.mode&1)===0)d.memoizedState=null;else switch(N){case"forwards":for(m=d.child,N=null;m!==null;)c=m.alternate,c!==null&&Fl(c)===null&&(N=m),m=m.sibling;m=N,m===null?(N=d.child,d.child=null):(N=m.sibling,m.sibling=null),qd(d,!1,N,m,O);break;case"backwards":for(m=null,N=d.child,d.child=null;N!==null;){if(c=N.alternate,c!==null&&Fl(c)===null){d.child=N;break}c=N.sibling,N.sibling=m,m=N,N=c}qd(d,!0,m,null,O);break;case"together":qd(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Qf(c,d){(d.mode&1)===0&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function Ms(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),ja|=d.lanes,(m&d.childLanes)===0)return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,m=Ls(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=Ls(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function E1(c,d,m){switch(d.tag){case 3:C1(d),uo();break;case 5:py(d);break;case 1:Si(d.type)&&es(d);break;case 4:fy(d,d.stateNode.containerInfo);break;case 10:var b=d.type._context,N=d.memoizedProps.value;An(Rd,b._currentValue),b._currentValue=N;break;case 13:if(b=d.memoizedState,b!==null)return b.dehydrated!==null?(An(Hn,Hn.current&1),d.flags|=128,null):(m&d.child.childLanes)!==0?Zf(c,d,m):(An(Hn,Hn.current&1),c=Ms(c,d,m),c!==null?c.sibling:null);An(Hn,Hn.current&1);break;case 19:if(b=(m&d.childLanes)!==0,(c.flags&128)!==0){if(b)return ka(c,d,m);d.flags|=128}if(N=d.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),An(Hn,Hn.current),b)break;return null;case 22:case 23:return d.lanes=0,Ty(c,d,m)}return Ms(c,d,m)}var Vr,ky,x1,Ly;Vr=function(c,d){for(var m=d.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},ky=function(){},x1=function(c,d,m,b){var N=c.memoizedProps;if(N!==b){c=d.stateNode,Uo(fo.current);var O=null;switch(m){case"input":N=_t(c,N),b=_t(c,b),O=[];break;case"select":N=ge({},N,{value:void 0}),b=ge({},b,{value:void 0}),O=[];break;case"textarea":N=Bt(c,N),b=Bt(c,b),O=[];break;default:typeof N.onClick!="function"&&typeof b.onClick=="function"&&(c.onclick=Ef)}it(m,b);var z;m=null;for(ve in N)if(!b.hasOwnProperty(ve)&&N.hasOwnProperty(ve)&&N[ve]!=null)if(ve==="style"){var Z=N[ve];for(z in Z)Z.hasOwnProperty(z)&&(m||(m={}),m[z]="")}else ve!=="dangerouslySetInnerHTML"&&ve!=="children"&&ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(s.hasOwnProperty(ve)?O||(O=[]):(O=O||[]).push(ve,null));for(ve in b){var ne=b[ve];if(Z=N!=null?N[ve]:void 0,b.hasOwnProperty(ve)&&ne!==Z&&(ne!=null||Z!=null))if(ve==="style")if(Z){for(z in Z)!Z.hasOwnProperty(z)||ne&&ne.hasOwnProperty(z)||(m||(m={}),m[z]="");for(z in ne)ne.hasOwnProperty(z)&&Z[z]!==ne[z]&&(m||(m={}),m[z]=ne[z])}else m||(O||(O=[]),O.push(ve,m)),m=ne;else ve==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,Z=Z?Z.__html:void 0,ne!=null&&Z!==ne&&(O=O||[]).push(ve,ne)):ve==="children"?typeof ne!="string"&&typeof ne!="number"||(O=O||[]).push(ve,""+ne):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&(s.hasOwnProperty(ve)?(ne!=null&&ve==="onScroll"&&Ln("scroll",c),O||Z===ne||(O=[])):(O=O||[]).push(ve,ne))}m&&(O=O||[]).push("style",m);var ve=O;(d.updateQueue=ve)&&(d.flags|=4)}},Ly=function(c,d,m,b){m!==b&&(d.flags|=4)};function Gd(c,d){if(!Fn)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:b.sibling=null}}function Br(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,b=0;if(d)for(var N=c.child;N!==null;)m|=N.lanes|N.childLanes,b|=N.subtreeFlags&14680064,b|=N.flags&14680064,N.return=c,N=N.sibling;else for(N=c.child;N!==null;)m|=N.lanes|N.childLanes,b|=N.subtreeFlags,b|=N.flags,N.return=c,N=N.sibling;return c.subtreeFlags|=b,c.childLanes=m,d}function Z_(c,d,m){var b=d.pendingProps;switch(kl(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Br(d),null;case 1:return Si(d.type)&&Nf(),Br(d),null;case 3:return b=d.stateNode,Aa(),jn(xi),jn(Zr),Ff(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(c===null||c.child===null)&&(Pd(d)?d.flags|=4:c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Os!==null&&(Wy(Os),Os=null))),ky(c,d),Br(d),null;case 5:jf(d);var N=Uo(Xc.current);if(m=d.type,c!==null&&d.stateNode!=null)x1(c,d,m,b,N),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!b){if(d.stateNode===null)throw Error(r(166));return Br(d),null}if(c=Uo(fo.current),Pd(d)){b=d.stateNode,m=d.type;var O=d.memoizedProps;switch(b[so]=d,b[Ia]=O,c=(d.mode&1)!==0,m){case"dialog":Ln("cancel",b),Ln("close",b);break;case"iframe":case"object":case"embed":Ln("load",b);break;case"video":case"audio":for(N=0;N<Fo.length;N++)Ln(Fo[N],b);break;case"source":Ln("error",b);break;case"img":case"image":case"link":Ln("error",b),Ln("load",b);break;case"details":Ln("toggle",b);break;case"input":Ge(b,O),Ln("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!O.multiple},Ln("invalid",b);break;case"textarea":Nt(b,O),Ln("invalid",b)}it(m,O),N=null;for(var z in O)if(O.hasOwnProperty(z)){var Z=O[z];z==="children"?typeof Z=="string"?b.textContent!==Z&&(O.suppressHydrationWarning!==!0&&Nd(b.textContent,Z,c),N=["children",Z]):typeof Z=="number"&&b.textContent!==""+Z&&(O.suppressHydrationWarning!==!0&&Nd(b.textContent,Z,c),N=["children",""+Z]):s.hasOwnProperty(z)&&Z!=null&&z==="onScroll"&&Ln("scroll",b)}switch(m){case"input":Le(b),zt(b,O,!0);break;case"textarea":Le(b),It(b);break;case"select":case"option":break;default:typeof O.onClick=="function"&&(b.onclick=Ef)}b=N,d.updateQueue=b,b!==null&&(d.flags|=4)}else{z=N.nodeType===9?N:N.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=ci(m)),c==="http://www.w3.org/1999/xhtml"?m==="script"?(c=z.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof b.is=="string"?c=z.createElement(m,{is:b.is}):(c=z.createElement(m),m==="select"&&(z=c,b.multiple?z.multiple=!0:b.size&&(z.size=b.size))):c=z.createElementNS(c,m),c[so]=d,c[Ia]=b,Vr(c,d,!1,!1),d.stateNode=c;e:{switch(z=Gt(m,b),m){case"dialog":Ln("cancel",c),Ln("close",c),N=b;break;case"iframe":case"object":case"embed":Ln("load",c),N=b;break;case"video":case"audio":for(N=0;N<Fo.length;N++)Ln(Fo[N],c);N=b;break;case"source":Ln("error",c),N=b;break;case"img":case"image":case"link":Ln("error",c),Ln("load",c),N=b;break;case"details":Ln("toggle",c),N=b;break;case"input":Ge(c,b),N=_t(c,b),Ln("invalid",c);break;case"option":N=b;break;case"select":c._wrapperState={wasMultiple:!!b.multiple},N=ge({},b,{value:void 0}),Ln("invalid",c);break;case"textarea":Nt(c,b),N=Bt(c,b),Ln("invalid",c);break;default:N=b}it(m,N),Z=N;for(O in Z)if(Z.hasOwnProperty(O)){var ne=Z[O];O==="style"?_e(c,ne):O==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,ne!=null&&mr(c,ne)):O==="children"?typeof ne=="string"?(m!=="textarea"||ne!=="")&&Er(c,ne):typeof ne=="number"&&Er(c,""+ne):O!=="suppressContentEditableWarning"&&O!=="suppressHydrationWarning"&&O!=="autoFocus"&&(s.hasOwnProperty(O)?ne!=null&&O==="onScroll"&&Ln("scroll",c):ne!=null&&M(c,O,ne,z))}switch(m){case"input":Le(c),zt(c,b,!1);break;case"textarea":Le(c),It(c);break;case"option":b.value!=null&&c.setAttribute("value",""+be(b.value));break;case"select":c.multiple=!!b.multiple,O=b.value,O!=null?St(c,!!b.multiple,O,!1):b.defaultValue!=null&&St(c,!!b.multiple,b.defaultValue,!0);break;default:typeof N.onClick=="function"&&(c.onclick=Ef)}switch(m){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Br(d),null;case 6:if(c&&d.stateNode!=null)Ly(c,d,c.memoizedProps,b);else{if(typeof b!="string"&&d.stateNode===null)throw Error(r(166));if(m=Uo(Xc.current),Uo(fo.current),Pd(d)){if(b=d.stateNode,m=d.memoizedProps,b[so]=d,(O=b.nodeValue!==m)&&(c=Jr,c!==null))switch(c.tag){case 3:Nd(b.nodeValue,m,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Nd(b.nodeValue,m,(c.mode&1)!==0)}O&&(d.flags|=4)}else b=(m.nodeType===9?m:m.ownerDocument).createTextNode(b),b[so]=d,d.stateNode=b}return Br(d),null;case 13:if(jn(Hn),b=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Fn&&ji!==null&&(d.mode&1)!==0&&(d.flags&128)===0)cy(),uo(),d.flags|=98560,O=!1;else if(O=Pd(d),b!==null&&b.dehydrated!==null){if(c===null){if(!O)throw Error(r(318));if(O=d.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[so]=d}else uo(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Br(d),O=!1}else Os!==null&&(Wy(Os),Os=null),O=!0;if(!O)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=m,d):(b=b!==null,b!==(c!==null&&c.memoizedState!==null)&&b&&(d.child.flags|=8192,(d.mode&1)!==0&&(c===null||(Hn.current&1)!==0?Dr===0&&(Dr=3):Yy())),d.updateQueue!==null&&(d.flags|=4),Br(d),null);case 4:return Aa(),ky(c,d),c===null&&Sa(d.stateNode.containerInfo),Br(d),null;case 10:return Af(d.type._context),Br(d),null;case 17:return Si(d.type)&&Nf(),Br(d),null;case 19:if(jn(Hn),O=d.memoizedState,O===null)return Br(d),null;if(b=(d.flags&128)!==0,z=O.rendering,z===null)if(b)Gd(O,!1);else{if(Dr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(z=Fl(c),z!==null){for(d.flags|=128,Gd(O,!1),b=z.updateQueue,b!==null&&(d.updateQueue=b,d.flags|=4),d.subtreeFlags=0,b=m,m=d.child;m!==null;)O=m,c=b,O.flags&=14680066,z=O.alternate,z===null?(O.childLanes=0,O.lanes=c,O.child=null,O.subtreeFlags=0,O.memoizedProps=null,O.memoizedState=null,O.updateQueue=null,O.dependencies=null,O.stateNode=null):(O.childLanes=z.childLanes,O.lanes=z.lanes,O.child=z.child,O.subtreeFlags=0,O.deletions=null,O.memoizedProps=z.memoizedProps,O.memoizedState=z.memoizedState,O.updateQueue=z.updateQueue,O.type=z.type,c=z.dependencies,O.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),m=m.sibling;return An(Hn,Hn.current&1|2),d.child}c=c.sibling}O.tail!==null&&Vn()>Hl&&(d.flags|=128,b=!0,Gd(O,!1),d.lanes=4194304)}else{if(!b)if(c=Fl(z),c!==null){if(d.flags|=128,b=!0,m=c.updateQueue,m!==null&&(d.updateQueue=m,d.flags|=4),Gd(O,!0),O.tail===null&&O.tailMode==="hidden"&&!z.alternate&&!Fn)return Br(d),null}else 2*Vn()-O.renderingStartTime>Hl&&m!==1073741824&&(d.flags|=128,b=!0,Gd(O,!1),d.lanes=4194304);O.isBackwards?(z.sibling=d.child,d.child=z):(m=O.last,m!==null?m.sibling=z:d.child=z,O.last=z)}return O.tail!==null?(d=O.tail,O.rendering=d,O.tail=d.sibling,O.renderingStartTime=Vn(),d.sibling=null,m=Hn.current,An(Hn,b?m&1|2:m&1),d):(Br(d),null);case 22:case 23:return Gy(),b=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==b&&(d.flags|=8192),b&&(d.mode&1)!==0?(zi&1073741824)!==0&&(Br(d),d.subtreeFlags&6&&(d.flags|=8192)):Br(d),null;case 24:return null;case 25:return null}throw Error(r(156,d.tag))}function Q_(c,d){switch(kl(d),d.tag){case 1:return Si(d.type)&&Nf(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return Aa(),jn(xi),jn(Zr),Ff(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 5:return jf(d),null;case 13:if(jn(Hn),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));uo()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return jn(Hn),null;case 4:return Aa(),null;case 10:return Af(d.type._context),null;case 22:case 23:return Gy(),null;case 24:return null;default:return null}}var Jf=!1,Un=!1,gi=typeof WeakSet=="function"?WeakSet:Set,et=null;function su(c,d){var m=c.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){Xn(c,d,b)}else m.current=null}function Yd(c,d,m){try{m()}catch(b){Xn(c,d,b)}}var S1=!1;function J_(c,d){if(Id=sf,c=mn(),_d(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var N=b.anchorOffset,O=b.focusNode;b=b.focusOffset;try{m.nodeType,O.nodeType}catch{m=null;break e}var z=0,Z=-1,ne=-1,ve=0,Me=0,Ae=c,Te=null;t:for(;;){for(var Ze;Ae!==m||N!==0&&Ae.nodeType!==3||(Z=z+N),Ae!==O||b!==0&&Ae.nodeType!==3||(ne=z+b),Ae.nodeType===3&&(z+=Ae.nodeValue.length),(Ze=Ae.firstChild)!==null;)Te=Ae,Ae=Ze;for(;;){if(Ae===c)break t;if(Te===m&&++ve===N&&(Z=z),Te===O&&++Me===b&&(ne=z),(Ze=Ae.nextSibling)!==null)break;Ae=Te,Te=Ae.parentNode}Ae=Ze}m=Z===-1||ne===-1?null:{start:Z,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ml={focusedElem:c,selectionRange:m},sf=!1,et=d;et!==null;)if(d=et,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,et=c;else for(;et!==null;){d=et;try{var nt=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var st=nt.memoizedProps,dr=nt.memoizedState,he=d.stateNode,se=he.getSnapshotBeforeUpdate(d.elementType===d.type?st:as(d.type,st),dr);he.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var pe=d.stateNode.containerInfo;pe.nodeType===1?pe.textContent="":pe.nodeType===9&&pe.documentElement&&pe.removeChild(pe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Fe){Xn(d,d.return,Fe)}if(c=d.sibling,c!==null){c.return=d.return,et=c;break}et=d.return}return nt=S1,S1=!1,nt}function Go(c,d,m){var b=d.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var N=b=b.next;do{if((N.tag&c)===c){var O=N.destroy;N.destroy=void 0,O!==void 0&&Yd(d,m,O)}N=N.next}while(N!==b)}}function Xd(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&c)===c){var b=m.create;m.destroy=b()}m=m.next}while(m!==d)}}function ep(c){var d=c.ref;if(d!==null){var m=c.stateNode;switch(c.tag){case 5:c=m;break;default:c=m}typeof d=="function"?d(c):d.current=c}}function D1(c){var d=c.alternate;d!==null&&(c.alternate=null,D1(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&(delete d[so],delete d[Ia],delete d[Sf],delete d[U],delete d[Uc])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function N1(c){return c.tag===5||c.tag===3||c.tag===4}function I1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||N1(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function jy(c,d,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?m.nodeType===8?m.parentNode.insertBefore(c,d):m.insertBefore(c,d):(m.nodeType===8?(d=m.parentNode,d.insertBefore(c,m)):(d=m,d.appendChild(c)),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Ef));else if(b!==4&&(c=c.child,c!==null))for(jy(c,d,m),c=c.sibling;c!==null;)jy(c,d,m),c=c.sibling}function tp(c,d,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(b!==4&&(c=c.child,c!==null))for(tp(c,d,m),c=c.sibling;c!==null;)tp(c,d,m),c=c.sibling}var Pr=null,Ps=!1;function vo(c,d,m){for(m=m.child;m!==null;)Fy(c,d,m),m=m.sibling}function Fy(c,d,m){if(no&&typeof no.onCommitFiberUnmount=="function")try{no.onCommitFiberUnmount(Qh,m)}catch{}switch(m.tag){case 5:Un||su(m,d);case 6:var b=Pr,N=Ps;Pr=null,vo(c,d,m),Pr=b,Ps=N,Pr!==null&&(Ps?(c=Pr,m=m.stateNode,c.nodeType===8?c.parentNode.removeChild(m):c.removeChild(m)):Pr.removeChild(m.stateNode));break;case 18:Pr!==null&&(Ps?(c=Pr,m=m.stateNode,c.nodeType===8?oy(c.parentNode,m):c.nodeType===1&&oy(c,m),fn(c)):oy(Pr,m.stateNode));break;case 4:b=Pr,N=Ps,Pr=m.stateNode.containerInfo,Ps=!0,vo(c,d,m),Pr=b,Ps=N;break;case 0:case 11:case 14:case 15:if(!Un&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){N=b=b.next;do{var O=N,z=O.destroy;O=O.tag,z!==void 0&&((O&2)!==0||(O&4)!==0)&&Yd(m,d,z),N=N.next}while(N!==b)}vo(c,d,m);break;case 1:if(!Un&&(su(m,d),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(Z){Xn(m,d,Z)}vo(c,d,m);break;case 21:vo(c,d,m);break;case 22:m.mode&1?(Un=(b=Un)||m.memoizedState!==null,vo(c,d,m),Un=b):vo(c,d,m);break;default:vo(c,d,m)}}function ou(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var m=c.stateNode;m===null&&(m=c.stateNode=new gi),d.forEach(function(b){var N=oC.bind(null,c,b);m.has(b)||(m.add(b),b.then(N,N))})}}function $i(c,d){var m=d.deletions;if(m!==null)for(var b=0;b<m.length;b++){var N=m[b];try{var O=c,z=d,Z=z;e:for(;Z!==null;){switch(Z.tag){case 5:Pr=Z.stateNode,Ps=!1;break e;case 3:Pr=Z.stateNode.containerInfo,Ps=!0;break e;case 4:Pr=Z.stateNode.containerInfo,Ps=!0;break e}Z=Z.return}if(Pr===null)throw Error(r(160));Fy(O,z,N),Pr=null,Ps=!1;var ne=N.alternate;ne!==null&&(ne.return=null),N.return=null}catch(ve){Xn(N,d,ve)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)$y(d,c),d=d.sibling}function $y(c,d){var m=c.alternate,b=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if($i(d,c),As(c),b&4){try{Go(3,c,c.return),Xd(3,c)}catch(st){Xn(c,c.return,st)}try{Go(5,c,c.return)}catch(st){Xn(c,c.return,st)}}break;case 1:$i(d,c),As(c),b&512&&m!==null&&su(m,m.return);break;case 5:if($i(d,c),As(c),b&512&&m!==null&&su(m,m.return),c.flags&32){var N=c.stateNode;try{Er(N,"")}catch(st){Xn(c,c.return,st)}}if(b&4&&(N=c.stateNode,N!=null)){var O=c.memoizedProps,z=m!==null?m.memoizedProps:O,Z=c.type,ne=c.updateQueue;if(c.updateQueue=null,ne!==null)try{Z==="input"&&O.type==="radio"&&O.name!=null&&Ft(N,O),Gt(Z,z);var ve=Gt(Z,O);for(z=0;z<ne.length;z+=2){var Me=ne[z],Ae=ne[z+1];Me==="style"?_e(N,Ae):Me==="dangerouslySetInnerHTML"?mr(N,Ae):Me==="children"?Er(N,Ae):M(N,Me,Ae,ve)}switch(Z){case"input":Ke(N,O);break;case"textarea":lt(N,O);break;case"select":var Te=N._wrapperState.wasMultiple;N._wrapperState.wasMultiple=!!O.multiple;var Ze=O.value;Ze!=null?St(N,!!O.multiple,Ze,!1):Te!==!!O.multiple&&(O.defaultValue!=null?St(N,!!O.multiple,O.defaultValue,!0):St(N,!!O.multiple,O.multiple?[]:"",!1))}N[Ia]=O}catch(st){Xn(c,c.return,st)}}break;case 6:if($i(d,c),As(c),b&4){if(c.stateNode===null)throw Error(r(162));N=c.stateNode,O=c.memoizedProps;try{N.nodeValue=O}catch(st){Xn(c,c.return,st)}}break;case 3:if($i(d,c),As(c),b&4&&m!==null&&m.memoizedState.isDehydrated)try{fn(d.containerInfo)}catch(st){Xn(c,c.return,st)}break;case 4:$i(d,c),As(c);break;case 13:$i(d,c),As(c),N=c.child,N.flags&8192&&(O=N.memoizedState!==null,N.stateNode.isHidden=O,!O||N.alternate!==null&&N.alternate.memoizedState!==null||(By=Vn())),b&4&&ou(c);break;case 22:if(Me=m!==null&&m.memoizedState!==null,c.mode&1?(Un=(ve=Un)||Me,$i(d,c),Un=ve):$i(d,c),As(c),b&8192){if(ve=c.memoizedState!==null,(c.stateNode.isHidden=ve)&&!Me&&(c.mode&1)!==0)for(et=c,Me=c.child;Me!==null;){for(Ae=et=Me;et!==null;){switch(Te=et,Ze=Te.child,Te.tag){case 0:case 11:case 14:case 15:Go(4,Te,Te.return);break;case 1:su(Te,Te.return);var nt=Te.stateNode;if(typeof nt.componentWillUnmount=="function"){b=Te,m=Te.return;try{d=b,nt.props=d.memoizedProps,nt.state=d.memoizedState,nt.componentWillUnmount()}catch(st){Xn(b,m,st)}}break;case 5:su(Te,Te.return);break;case 22:if(Te.memoizedState!==null){La(Ae);continue}}Ze!==null?(Ze.return=Te,et=Ze):La(Ae)}Me=Me.sibling}e:for(Me=null,Ae=c;;){if(Ae.tag===5){if(Me===null){Me=Ae;try{N=Ae.stateNode,ve?(O=N.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none"):(Z=Ae.stateNode,ne=Ae.memoizedProps.style,z=ne!=null&&ne.hasOwnProperty("display")?ne.display:null,Z.style.display=fe("display",z))}catch(st){Xn(c,c.return,st)}}}else if(Ae.tag===6){if(Me===null)try{Ae.stateNode.nodeValue=ve?"":Ae.memoizedProps}catch(st){Xn(c,c.return,st)}}else if((Ae.tag!==22&&Ae.tag!==23||Ae.memoizedState===null||Ae===c)&&Ae.child!==null){Ae.child.return=Ae,Ae=Ae.child;continue}if(Ae===c)break e;for(;Ae.sibling===null;){if(Ae.return===null||Ae.return===c)break e;Me===Ae&&(Me=null),Ae=Ae.return}Me===Ae&&(Me=null),Ae.sibling.return=Ae.return,Ae=Ae.sibling}}break;case 19:$i(d,c),As(c),b&4&&ou(c);break;case 21:break;default:$i(d,c),As(c)}}function As(c){var d=c.flags;if(d&2){try{e:{for(var m=c.return;m!==null;){if(N1(m)){var b=m;break e}m=m.return}throw Error(r(160))}switch(b.tag){case 5:var N=b.stateNode;b.flags&32&&(Er(N,""),b.flags&=-33);var O=I1(c);tp(c,O,N);break;case 3:case 4:var z=b.stateNode.containerInfo,Z=I1(c);jy(c,Z,z);break;default:throw Error(r(161))}}catch(ne){Xn(c,c.return,ne)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function np(c,d,m){et=c,zy(c)}function zy(c,d,m){for(var b=(c.mode&1)!==0;et!==null;){var N=et,O=N.child;if(N.tag===22&&b){var z=N.memoizedState!==null||Jf;if(!z){var Z=N.alternate,ne=Z!==null&&Z.memoizedState!==null||Un;Z=Jf;var ve=Un;if(Jf=z,(Un=ne)&&!ve)for(et=N;et!==null;)z=et,ne=z.child,z.tag===22&&z.memoizedState!==null?O1(N):ne!==null?(ne.return=z,et=ne):O1(N);for(;O!==null;)et=O,zy(O),O=O.sibling;et=N,Jf=Z,Un=ve}Rs(c)}else(N.subtreeFlags&8772)!==0&&O!==null?(O.return=N,et=O):Rs(c)}}function Rs(c){for(;et!==null;){var d=et;if((d.flags&8772)!==0){var m=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:Un||Xd(5,d);break;case 1:var b=d.stateNode;if(d.flags&4&&!Un)if(m===null)b.componentDidMount();else{var N=d.elementType===d.type?m.memoizedProps:as(d.type,m.memoizedProps);b.componentDidUpdate(N,m.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var O=d.updateQueue;O!==null&&hy(d,O,b);break;case 3:var z=d.updateQueue;if(z!==null){if(m=null,d.child!==null)switch(d.child.tag){case 5:m=d.child.stateNode;break;case 1:m=d.child.stateNode}hy(d,z,m)}break;case 5:var Z=d.stateNode;if(m===null&&d.flags&4){m=Z;var ne=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":ne.autoFocus&&m.focus();break;case"img":ne.src&&(m.src=ne.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var ve=d.alternate;if(ve!==null){var Me=ve.memoizedState;if(Me!==null){var Ae=Me.dehydrated;Ae!==null&&fn(Ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Un||d.flags&512&&ep(d)}catch(Te){Xn(d,d.return,Te)}}if(d===c){et=null;break}if(m=d.sibling,m!==null){m.return=d.return,et=m;break}et=d.return}}function La(c){for(;et!==null;){var d=et;if(d===c){et=null;break}var m=d.sibling;if(m!==null){m.return=d.return,et=m;break}et=d.return}}function O1(c){for(;et!==null;){var d=et;try{switch(d.tag){case 0:case 11:case 15:var m=d.return;try{Xd(4,d)}catch(ne){Xn(d,m,ne)}break;case 1:var b=d.stateNode;if(typeof b.componentDidMount=="function"){var N=d.return;try{b.componentDidMount()}catch(ne){Xn(d,N,ne)}}var O=d.return;try{ep(d)}catch(ne){Xn(d,O,ne)}break;case 5:var z=d.return;try{ep(d)}catch(ne){Xn(d,z,ne)}}}catch(ne){Xn(d,d.return,ne)}if(d===c){et=null;break}var Z=d.sibling;if(Z!==null){Z.return=d.return,et=Z;break}et=d.return}}var T1=Math.ceil,rp=k.ReactCurrentDispatcher,Vy=k.ReactCurrentOwner,ls=k.ReactCurrentBatchConfig,Xt=0,Ar=null,wr=null,Hr=0,zi=0,au=Ei(0),Dr=0,Zd=null,ja=0,Qd=0,ip=0,Jd=null,Ii=null,By=0,Hl=1/0,Yo=null,sp=!1,Hy=null,Fa=null,op=!1,$a=null,yi=0,eh=0,Uy=null,ap=-1,th=0;function mi(){return(Xt&6)!==0?Vn():ap!==-1?ap:ap=Vn()}function za(c){return(c.mode&1)===0?1:(Xt&2)!==0&&Hr!==0?Hr&-Hr:c1.transition!==null?(th===0&&(th=Fg()),th):(c=ln,c!==0||(c=window.event,c=c===void 0?16:k0(c.type)),c)}function ks(c,d,m,b){if(50<eh)throw eh=0,Uy=null,Error(r(185));gd(c,m,b),((Xt&2)===0||c!==Ar)&&(c===Ar&&((Xt&2)===0&&(Qd|=m),Dr===4&&Va(c,Hr)),Oi(c,b),m===1&&Xt===0&&(d.mode&1)===0&&(Hl=Vn()+500,If&&Ta()))}function Oi(c,d){var m=c.callbackNode;T_(c,d);var b=xl(c,c===Ar?Hr:0);if(b===0)m!==null&&E0(m),c.callbackNode=null,c.callbackPriority=0;else if(d=b&-b,c.callbackPriority!==d){if(m!=null&&E0(m),d===1)c.tag===0?Pl(M1.bind(null,c)):o1(M1.bind(null,c)),xf(function(){(Xt&6)===0&&Ta()}),m=null;else{switch(Sl(b)){case 1:m=Lg;break;case 4:m=x0;break;case 16:m=fd;break;case 536870912:m=jg;break;default:m=fd}m=F1(m,lp.bind(null,c))}c.callbackPriority=d,c.callbackNode=m}}function lp(c,d){if(ap=-1,th=0,(Xt&6)!==0)throw Error(r(327));var m=c.callbackNode;if(lu()&&c.callbackNode!==m)return null;var b=xl(c,c===Ar?Hr:0);if(b===0)return null;if((b&30)!==0||(b&c.expiredLanes)!==0||d)d=cp(c,b);else{d=b;var N=Xt;Xt|=2;var O=A1();(Ar!==c||Hr!==d)&&(Yo=null,Hl=Vn()+500,Kl(c,d));do try{nC();break}catch(Z){P1(c,Z)}while(!0);Vo(),rp.current=O,Xt=N,wr!==null?d=0:(Ar=null,Hr=0,d=Dr)}if(d!==0){if(d===2&&(N=ef(c),N!==0&&(b=N,d=Ky(c,N))),d===1)throw m=Zd,Kl(c,0),Va(c,b),Oi(c,Vn()),m;if(d===6)Va(c,b);else{if(N=c.current.alternate,(b&30)===0&&!eC(N)&&(d=cp(c,b),d===2&&(O=ef(c),O!==0&&(b=O,d=Ky(c,O))),d===1))throw m=Zd,Kl(c,0),Va(c,b),Oi(c,Vn()),m;switch(c.finishedWork=N,c.finishedLanes=b,d){case 0:case 1:throw Error(r(345));case 2:Wl(c,Ii,Yo);break;case 3:if(Va(c,b),(b&130023424)===b&&(d=By+500-Vn(),10<d)){if(xl(c,0)!==0)break;if(N=c.suspendedLanes,(N&b)!==b){mi(),c.pingedLanes|=c.suspendedLanes&N;break}c.timeoutHandle=Da(Wl.bind(null,c,Ii,Yo),d);break}Wl(c,Ii,Yo);break;case 4:if(Va(c,b),(b&4194240)===b)break;for(d=c.eventTimes,N=-1;0<b;){var z=31-Ns(b);O=1<<z,z=d[z],z>N&&(N=z),b&=~O}if(b=N,b=Vn()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*T1(b/1960))-b,10<b){c.timeoutHandle=Da(Wl.bind(null,c,Ii,Yo),b);break}Wl(c,Ii,Yo);break;case 5:Wl(c,Ii,Yo);break;default:throw Error(r(329))}}}return Oi(c,Vn()),c.callbackNode===m?lp.bind(null,c):null}function Ky(c,d){var m=Jd;return c.current.memoizedState.isDehydrated&&(Kl(c,d).flags|=256),c=cp(c,d),c!==2&&(d=Ii,Ii=m,d!==null&&Wy(d)),c}function Wy(c){Ii===null?Ii=c:Ii.push.apply(Ii,c)}function eC(c){for(var d=c;;){if(d.flags&16384){var m=d.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var b=0;b<m.length;b++){var N=m[b],O=N.getSnapshot;N=N.value;try{if(!me(O(),N))return!1}catch{return!1}}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Va(c,d){for(d&=~ip,d&=~Qd,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var m=31-Ns(d),b=1<<m;c[m]=-1,d&=~b}}function M1(c){if((Xt&6)!==0)throw Error(r(327));lu();var d=xl(c,0);if((d&1)===0)return Oi(c,Vn()),null;var m=cp(c,d);if(c.tag!==0&&m===2){var b=ef(c);b!==0&&(d=b,m=Ky(c,b))}if(m===1)throw m=Zd,Kl(c,0),Va(c,d),Oi(c,Vn()),m;if(m===6)throw Error(r(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,Wl(c,Ii,Yo),Oi(c,Vn()),null}function qy(c,d){var m=Xt;Xt|=1;try{return c(d)}finally{Xt=m,Xt===0&&(Hl=Vn()+500,If&&Ta())}}function Ul(c){$a!==null&&$a.tag===0&&(Xt&6)===0&&lu();var d=Xt;Xt|=1;var m=ls.transition,b=ln;try{if(ls.transition=null,ln=1,c)return c()}finally{ln=b,ls.transition=m,Xt=d,(Xt&6)===0&&Ta()}}function Gy(){zi=au.current,jn(au)}function Kl(c,d){c.finishedWork=null,c.finishedLanes=0;var m=c.timeoutHandle;if(m!==-1&&(c.timeoutHandle=-1,Td(m)),wr!==null)for(m=wr.return;m!==null;){var b=m;switch(kl(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Nf();break;case 3:Aa(),jn(xi),jn(Zr),Ff();break;case 5:jf(b);break;case 4:Aa();break;case 13:jn(Hn);break;case 19:jn(Hn);break;case 10:Af(b.type._context);break;case 22:case 23:Gy()}m=m.return}if(Ar=c,wr=c=Ls(c.current,null),Hr=zi=d,Dr=0,Zd=null,ip=Qd=ja=0,Ii=Jd=null,jl!==null){for(d=0;d<jl.length;d++)if(m=jl[d],b=m.interleaved,b!==null){m.interleaved=null;var N=b.next,O=m.pending;if(O!==null){var z=O.next;O.next=N,b.next=z}m.pending=b}jl=null}return c}function P1(c,d){do{var m=wr;try{if(Vo(),jd.current=Uf,Zc){for(var b=Yn.memoizedState;b!==null;){var N=b.queue;N!==null&&(N.pending=null),b=b.next}Zc=!1}if(Ra=0,Sr=ur=Yn=null,Fd=!1,$l=0,Vy.current=null,m===null||m.return===null){Dr=1,Zd=d,wr=null;break}e:{var O=c,z=m.return,Z=m,ne=d;if(d=Hr,Z.flags|=32768,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ve=ne,Me=Z,Ae=Me.tag;if((Me.mode&1)===0&&(Ae===0||Ae===11||Ae===15)){var Te=Me.alternate;Te?(Me.updateQueue=Te.updateQueue,Me.memoizedState=Te.memoizedState,Me.lanes=Te.lanes):(Me.updateQueue=null,Me.memoizedState=null)}var Ze=w1(z);if(Ze!==null){Ze.flags&=-257,Iy(Ze,z,Z,O,d),Ze.mode&1&&Hd(O,ve,d),d=Ze,ne=ve;var nt=d.updateQueue;if(nt===null){var st=new Set;st.add(ne),d.updateQueue=st}else nt.add(ne);break e}else{if((d&1)===0){Hd(O,ve,d),Yy();break e}ne=Error(r(426))}}else if(Fn&&Z.mode&1){var dr=w1(z);if(dr!==null){(dr.flags&65536)===0&&(dr.flags|=256),Iy(dr,z,Z,O,d),ho(Bl(ne,Z));break e}}O=ne=Bl(ne,Z),Dr!==4&&(Dr=2),Jd===null?Jd=[O]:Jd.push(O),O=z;do{switch(O.tag){case 3:O.flags|=65536,d&=-d,O.lanes|=d;var he=Bd(O,ne,d);h1(O,he);break e;case 1:Z=ne;var se=O.type,pe=O.stateNode;if((O.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||pe!==null&&typeof pe.componentDidCatch=="function"&&(Fa===null||!Fa.has(pe)))){O.flags|=65536,d&=-d,O.lanes|=d;var Fe=Yf(O,Z,d);h1(O,Fe);break e}}O=O.return}while(O!==null)}k1(m)}catch(ut){d=ut,wr===m&&m!==null&&(wr=m=m.return);continue}break}while(!0)}function A1(){var c=rp.current;return rp.current=Uf,c===null?Uf:c}function Yy(){(Dr===0||Dr===3||Dr===2)&&(Dr=4),Ar===null||(ja&268435455)===0&&(Qd&268435455)===0||Va(Ar,Hr)}function cp(c,d){var m=Xt;Xt|=2;var b=A1();(Ar!==c||Hr!==d)&&(Yo=null,Kl(c,d));do try{tC();break}catch(N){P1(c,N)}while(!0);if(Vo(),Xt=m,rp.current=b,wr!==null)throw Error(r(261));return Ar=null,Hr=0,Dr}function tC(){for(;wr!==null;)R1(wr)}function nC(){for(;wr!==null&&!Zh();)R1(wr)}function R1(c){var d=j1(c.alternate,c,zi);c.memoizedProps=c.pendingProps,d===null?k1(c):wr=d,Vy.current=null}function k1(c){var d=c;do{var m=d.alternate;if(c=d.return,(d.flags&32768)===0){if(m=Z_(m,d,zi),m!==null){wr=m;return}}else{if(m=Q_(m,d),m!==null){m.flags&=32767,wr=m;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Dr=6,wr=null;return}}if(d=d.sibling,d!==null){wr=d;return}wr=d=c}while(d!==null);Dr===0&&(Dr=5)}function Wl(c,d,m){var b=ln,N=ls.transition;try{ls.transition=null,ln=1,rC(c,d,m,b)}finally{ls.transition=N,ln=b}return null}function rC(c,d,m,b){do lu();while($a!==null);if((Xt&6)!==0)throw Error(r(327));m=c.finishedWork;var N=c.finishedLanes;if(m===null)return null;if(c.finishedWork=null,c.finishedLanes=0,m===c.current)throw Error(r(177));c.callbackNode=null,c.callbackPriority=0;var O=m.lanes|m.childLanes;if(T0(c,O),c===Ar&&(wr=Ar=null,Hr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||op||(op=!0,F1(fd,function(){return lu(),null})),O=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||O){O=ls.transition,ls.transition=null;var z=ln;ln=1;var Z=Xt;Xt|=4,Vy.current=null,J_(c,m),$y(m,c),q_(Ml),sf=!!Id,Ml=Id=null,c.current=m,np(m),N_(),Xt=Z,ln=z,ls.transition=O}else c.current=m;if(op&&(op=!1,$a=c,yi=N),O=c.pendingLanes,O===0&&(Fa=null),O_(m.stateNode),Oi(c,Vn()),d!==null)for(b=c.onRecoverableError,m=0;m<d.length;m++)N=d[m],b(N.value,{componentStack:N.stack,digest:N.digest});if(sp)throw sp=!1,c=Hy,Hy=null,c;return(yi&1)!==0&&c.tag!==0&&lu(),O=c.pendingLanes,(O&1)!==0?c===Uy?eh++:(eh=0,Uy=c):eh=0,Ta(),null}function lu(){if($a!==null){var c=Sl(yi),d=ls.transition,m=ln;try{if(ls.transition=null,ln=16>c?16:c,$a===null)var b=!1;else{if(c=$a,$a=null,yi=0,(Xt&6)!==0)throw Error(r(331));var N=Xt;for(Xt|=4,et=c.current;et!==null;){var O=et,z=O.child;if((et.flags&16)!==0){var Z=O.deletions;if(Z!==null){for(var ne=0;ne<Z.length;ne++){var ve=Z[ne];for(et=ve;et!==null;){var Me=et;switch(Me.tag){case 0:case 11:case 15:Go(8,Me,O)}var Ae=Me.child;if(Ae!==null)Ae.return=Me,et=Ae;else for(;et!==null;){Me=et;var Te=Me.sibling,Ze=Me.return;if(D1(Me),Me===ve){et=null;break}if(Te!==null){Te.return=Ze,et=Te;break}et=Ze}}}var nt=O.alternate;if(nt!==null){var st=nt.child;if(st!==null){nt.child=null;do{var dr=st.sibling;st.sibling=null,st=dr}while(st!==null)}}et=O}}if((O.subtreeFlags&2064)!==0&&z!==null)z.return=O,et=z;else e:for(;et!==null;){if(O=et,(O.flags&2048)!==0)switch(O.tag){case 0:case 11:case 15:Go(9,O,O.return)}var he=O.sibling;if(he!==null){he.return=O.return,et=he;break e}et=O.return}}var se=c.current;for(et=se;et!==null;){z=et;var pe=z.child;if((z.subtreeFlags&2064)!==0&&pe!==null)pe.return=z,et=pe;else e:for(z=se;et!==null;){if(Z=et,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:Xd(9,Z)}}catch(ut){Xn(Z,Z.return,ut)}if(Z===z){et=null;break e}var Fe=Z.sibling;if(Fe!==null){Fe.return=Z.return,et=Fe;break e}et=Z.return}}if(Xt=N,Ta(),no&&typeof no.onPostCommitFiberRoot=="function")try{no.onPostCommitFiberRoot(Qh,c)}catch{}b=!0}return b}finally{ln=m,ls.transition=d}}return!1}function up(c,d,m){d=Bl(m,d),d=Bd(c,d,1),c=ss(c,d,1),d=mi(),c!==null&&(gd(c,1,d),Oi(c,d))}function Xn(c,d,m){if(c.tag===3)up(c,c,m);else for(;d!==null;){if(d.tag===3){up(d,c,m);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Fa===null||!Fa.has(b))){c=Bl(m,c),c=Yf(d,c,1),d=ss(d,c,1),c=mi(),d!==null&&(gd(d,1,c),Oi(d,c));break}}d=d.return}}function iC(c,d,m){var b=c.pingCache;b!==null&&b.delete(d),d=mi(),c.pingedLanes|=c.suspendedLanes&m,Ar===c&&(Hr&m)===m&&(Dr===4||Dr===3&&(Hr&130023424)===Hr&&500>Vn()-By?Kl(c,0):ip|=m),Oi(c,d)}function L1(c,d){d===0&&((c.mode&1)===0?d=1:(d=Jh,Jh<<=1,(Jh&130023424)===0&&(Jh=4194304)));var m=mi();c=Bo(c,d),c!==null&&(gd(c,d,m),Oi(c,m))}function sC(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),L1(c,m)}function oC(c,d){var m=0;switch(c.tag){case 13:var b=c.stateNode,N=c.memoizedState;N!==null&&(m=N.retryLane);break;case 19:b=c.stateNode;break;default:throw Error(r(314))}b!==null&&b.delete(d),L1(c,m)}var j1;j1=function(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps||xi.current)pi=!0;else{if((c.lanes&m)===0&&(d.flags&128)===0)return pi=!1,E1(c,d,m);pi=(c.flags&131072)!==0}else pi=!1,Fn&&(d.flags&1048576)!==0&&a1(d,Tf,d.index);switch(d.lanes=0,d.tag){case 2:var b=d.type;Qf(c,d),c=d.pendingProps;var N=Wc(d,Zr.current);Pa(d,m),N=zl(null,d,b,c,N,m);var O=$f();return d.flags|=1,typeof N=="object"&&N!==null&&typeof N.render=="function"&&N.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Si(b)?(O=!0,es(d)):O=!1,d.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,kf(d),N.updater=qf,d.stateNode=N,N._reactInternals=d,Ny(d,b,c,m),d=Ry(null,d,b,!0,O,m)):(d.tag=0,Fn&&O&&Md(d),zr(null,d,N,m),d=d.child),d;case 16:b=d.elementType;e:{switch(Qf(c,d),c=d.pendingProps,N=b._init,b=N(b._payload),d.type=b,N=d.tag=lC(b),c=as(b,c),N){case 0:d=Py(null,d,b,c,m);break e;case 1:d=Ay(null,d,b,c,m);break e;case 11:d=_1(null,d,b,c,m);break e;case 14:d=Oy(null,d,b,as(b.type,c),m);break e}throw Error(r(306,b,""))}return d;case 0:return b=d.type,N=d.pendingProps,N=d.elementType===b?N:as(b,N),Py(c,d,b,N,m);case 1:return b=d.type,N=d.pendingProps,N=d.elementType===b?N:as(b,N),Ay(c,d,b,N,m);case 3:e:{if(C1(d),c===null)throw Error(r(387));b=d.pendingProps,O=d.memoizedState,N=O.element,d1(c,d),Yc(d,b,null,m);var z=d.memoizedState;if(b=z.element,O.isDehydrated)if(O={element:b,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},d.updateQueue.baseState=O,d.memoizedState=O,d.flags&256){N=Bl(Error(r(423)),d),d=mo(c,d,b,m,N);break e}else if(b!==N){N=Bl(Error(r(424)),d),d=mo(c,d,b,m,N);break e}else for(ji=Na(d.stateNode.containerInfo.firstChild),Jr=d,Fn=!0,Os=null,m=Pf(d,null,b,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(uo(),b===N){d=Ms(c,d,m);break e}zr(c,d,b,m)}d=d.child}return d;case 5:return py(d),c===null&&Di(d),b=d.type,N=d.pendingProps,O=c!==null?c.memoizedProps:null,z=N.children,Od(b,N)?z=null:O!==null&&Od(b,O)&&(d.flags|=32),My(c,d),zr(c,d,z,m),d.child;case 6:return c===null&&Di(d),null;case 13:return Zf(c,d,m);case 4:return fy(d,d.stateNode.containerInfo),b=d.pendingProps,c===null?d.child=tr(d,null,b,m):zr(c,d,b,m),d.child;case 11:return b=d.type,N=d.pendingProps,N=d.elementType===b?N:as(b,N),_1(c,d,b,N,m);case 7:return zr(c,d,d.pendingProps,m),d.child;case 8:return zr(c,d,d.pendingProps.children,m),d.child;case 12:return zr(c,d,d.pendingProps.children,m),d.child;case 10:e:{if(b=d.type._context,N=d.pendingProps,O=d.memoizedProps,z=N.value,An(Rd,b._currentValue),b._currentValue=z,O!==null)if(me(O.value,z)){if(O.children===N.children&&!xi.current){d=Ms(c,d,m);break e}}else for(O=d.child,O!==null&&(O.return=d);O!==null;){var Z=O.dependencies;if(Z!==null){z=O.child;for(var ne=Z.firstContext;ne!==null;){if(ne.context===b){if(O.tag===1){ne=Ho(-1,m&-m),ne.tag=2;var ve=O.updateQueue;if(ve!==null){ve=ve.shared;var Me=ve.pending;Me===null?ne.next=ne:(ne.next=Me.next,Me.next=ne),ve.pending=ne}}O.lanes|=m,ne=O.alternate,ne!==null&&(ne.lanes|=m),$r(O.return,m,d),Z.lanes|=m;break}ne=ne.next}}else if(O.tag===10)z=O.type===d.type?null:O.child;else if(O.tag===18){if(z=O.return,z===null)throw Error(r(341));z.lanes|=m,Z=z.alternate,Z!==null&&(Z.lanes|=m),$r(z,m,d),z=O.sibling}else z=O.child;if(z!==null)z.return=O;else for(z=O;z!==null;){if(z===d){z=null;break}if(O=z.sibling,O!==null){O.return=z.return,z=O;break}z=z.return}O=z}zr(c,d,N.children,m),d=d.child}return d;case 9:return N=d.type,b=d.pendingProps.children,Pa(d,m),N=rs(N),b=b(N),d.flags|=1,zr(c,d,b,m),d.child;case 14:return b=d.type,N=as(b,d.pendingProps),N=as(b.type,N),Oy(c,d,b,N,m);case 15:return yo(c,d,d.type,d.pendingProps,m);case 17:return b=d.type,N=d.pendingProps,N=d.elementType===b?N:as(b,N),Qf(c,d),d.tag=1,Si(b)?(c=!0,es(d)):c=!1,Pa(d,m),Vl(d,b,N),Ny(d,b,N,m),Ry(null,d,b,!0,c,m);case 19:return ka(c,d,m);case 22:return Ty(c,d,m)}throw Error(r(156,d.tag))};function F1(c,d){return C0(c,d)}function aC(c,d,m,b){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cs(c,d,m,b){return new aC(c,d,m,b)}function dp(c){return c=c.prototype,!(!c||!c.isReactComponent)}function lC(c){if(typeof c=="function")return dp(c)?1:0;if(c!=null){if(c=c.$$typeof,c===Y)return 11;if(c===ye)return 14}return 2}function Ls(c,d){var m=c.alternate;return m===null?(m=cs(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&14680064,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m}function hp(c,d,m,b,N,O){var z=2;if(b=c,typeof c=="function")dp(c)&&(z=1);else if(typeof c=="string")z=5;else e:switch(c){case V:return ql(m.children,N,O,d);case $:z=8,N|=8;break;case W:return c=cs(12,m,d,N|2),c.elementType=W,c.lanes=O,c;case te:return c=cs(13,m,d,N),c.elementType=te,c.lanes=O,c;case ue:return c=cs(19,m,d,N),c.elementType=ue,c.lanes=O,c;case q:return fp(m,N,O,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case B:z=10;break e;case H:z=9;break e;case Y:z=11;break e;case ye:z=14;break e;case Ne:z=16,b=null;break e}throw Error(r(130,c==null?c:typeof c,""))}return d=cs(z,m,d,N),d.elementType=c,d.type=b,d.lanes=O,d}function ql(c,d,m,b){return c=cs(7,c,b,d),c.lanes=m,c}function fp(c,d,m,b){return c=cs(22,c,b,d),c.elementType=q,c.lanes=m,c.stateNode={isHidden:!1},c}function Xy(c,d,m){return c=cs(6,c,null,d),c.lanes=m,c}function Zy(c,d,m){return d=cs(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function cC(c,d,m,b,N){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pd(0),this.expirationTimes=pd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pd(0),this.identifierPrefix=b,this.onRecoverableError=N,this.mutableSourceEagerHydrationData=null}function Qy(c,d,m,b,N,O,z,Z,ne){return c=new cC(c,d,m,Z,ne),d===1?(d=1,O===!0&&(d|=8)):d=0,O=cs(3,null,null,d),c.current=O,O.stateNode=c,O.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},kf(O),c}function uC(c,d,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:b==null?null:""+b,children:c,containerInfo:d,implementation:m}}function $1(c){if(!c)return Oa;c=c._reactInternals;e:{if(El(c)!==c||c.tag!==1)throw Error(r(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(Si(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(r(171))}if(c.tag===1){var m=c.type;if(Si(m))return i1(c,m,d)}return d}function z1(c,d,m,b,N,O,z,Z,ne){return c=Qy(m,b,!0,c,N,O,z,Z,ne),c.context=$1(null),m=c.current,b=mi(),N=za(m),O=Ho(b,N),O.callback=d??null,ss(m,O,N),c.current.lanes=N,gd(c,N,b),Oi(c,b),c}function pp(c,d,m,b){var N=d.current,O=mi(),z=za(N);return m=$1(m),d.context===null?d.context=m:d.pendingContext=m,d=Ho(O,z),d.payload={element:c},b=b===void 0?null:b,b!==null&&(d.callback=b),c=ss(N,d,z),c!==null&&(ks(c,N,z,O),Lf(c,N,z)),z}function gp(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function V1(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<d?m:d}}function Jy(c,d){V1(c,d),(c=c.alternate)&&V1(c,d)}function dC(){return null}var B1=typeof reportError=="function"?reportError:function(c){console.error(c)};function yp(c){this._internalRoot=c}nh.prototype.render=yp.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));pp(c,d,null,null)},nh.prototype.unmount=yp.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;Ul(function(){pp(null,c,null,null)}),d[Li]=null}};function nh(c){this._internalRoot=c}nh.prototype.unstable_scheduleHydration=function(c){if(c){var d=zg();c={blockedOn:null,target:c,priority:d};for(var m=0;m<_a.length&&d!==0&&d<_a[m].priority;m++);_a.splice(m,0,c),m===0&&A0(c)}};function em(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function mp(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function H1(){}function hC(c,d,m,b,N){if(N){if(typeof b=="function"){var O=b;b=function(){var ve=gp(z);O.call(ve)}}var z=z1(d,b,c,0,null,!1,!1,"",H1);return c._reactRootContainer=z,c[Li]=z.current,Sa(c.nodeType===8?c.parentNode:c),Ul(),z}for(;N=c.lastChild;)c.removeChild(N);if(typeof b=="function"){var Z=b;b=function(){var ve=gp(ne);Z.call(ve)}}var ne=Qy(c,0,!1,null,null,!1,!1,"",H1);return c._reactRootContainer=ne,c[Li]=ne.current,Sa(c.nodeType===8?c.parentNode:c),Ul(function(){pp(d,ne,m,b)}),ne}function Gl(c,d,m,b,N){var O=m._reactRootContainer;if(O){var z=O;if(typeof N=="function"){var Z=N;N=function(){var ne=gp(z);Z.call(ne)}}pp(d,z,c,N)}else z=hC(m,d,c,N,b);return gp(z)}$g=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var m=Ic(d.pendingLanes);m!==0&&(yd(d,m|1),Oi(d,Vn()),(Xt&6)===0&&(Hl=Vn()+500,Ta()))}break;case 13:Ul(function(){var b=Bo(c,1);if(b!==null){var N=mi();ks(b,c,1,N)}}),Jy(c,1)}},tf=function(c){if(c.tag===13){var d=Bo(c,134217728);if(d!==null){var m=mi();ks(d,c,134217728,m)}Jy(c,134217728)}},M0=function(c){if(c.tag===13){var d=za(c),m=Bo(c,d);if(m!==null){var b=mi();ks(m,c,d,b)}Jy(c,d)}},zg=function(){return ln},Vg=function(c,d){var m=ln;try{return ln=c,d()}finally{ln=m}},He=function(c,d,m){switch(d){case"input":if(Ke(c,m),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<m.length;d++){var b=m[d];if(b!==c&&b.form===c.form){var N=Df(b);if(!N)throw Error(r(90));tt(b),Ke(b,N)}}}break;case"textarea":lt(c,m);break;case"select":d=m.value,d!=null&&St(c,!!m.multiple,d,!1)}},Mt=qy,Jt=Ul;var fC={usingClientEntryPoint:!1,Events:[Xr,Ot,Df,ct,Dt,qy]},rh={findFiberByHostInstance:oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pC={bundleType:rh.bundleType,version:rh.version,rendererPackageName:rh.rendererPackageName,rendererConfig:rh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=w0(c),c===null?null:c.stateNode},findFiberByHostInstance:rh.findFiberByHostInstance||dC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vp.isDisabled&&vp.supportsFiber)try{Qh=vp.inject(pC),no=vp}catch{}}return fs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fC,fs.createPortal=function(c,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!em(d))throw Error(r(200));return uC(c,d,null,m)},fs.createRoot=function(c,d){if(!em(c))throw Error(r(299));var m=!1,b="",N=B1;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onRecoverableError!==void 0&&(N=d.onRecoverableError)),d=Qy(c,1,!1,null,null,m,!1,b,N),c[Li]=d.current,Sa(c.nodeType===8?c.parentNode:c),new yp(d)},fs.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=w0(d),c=c===null?null:c.stateNode,c},fs.flushSync=function(c){return Ul(c)},fs.hydrate=function(c,d,m){if(!mp(d))throw Error(r(200));return Gl(null,c,d,!0,m)},fs.hydrateRoot=function(c,d,m){if(!em(c))throw Error(r(405));var b=m!=null&&m.hydratedSources||null,N=!1,O="",z=B1;if(m!=null&&(m.unstable_strictMode===!0&&(N=!0),m.identifierPrefix!==void 0&&(O=m.identifierPrefix),m.onRecoverableError!==void 0&&(z=m.onRecoverableError)),d=z1(d,null,c,1,m??null,N,!1,O,z),c[Li]=d.current,Sa(c),b)for(c=0;c<b.length;c++)m=b[c],N=m._getVersion,N=N(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,N]:d.mutableSourceEagerHydrationData.push(m,N);return new nh(d)},fs.render=function(c,d,m){if(!mp(d))throw Error(r(200));return Gl(null,c,d,!1,m)},fs.unmountComponentAtNode=function(c){if(!mp(c))throw Error(r(40));return c._reactRootContainer?(Ul(function(){Gl(null,null,c,!1,function(){c._reactRootContainer=null,c[Li]=null})}),!0):!1},fs.unstable_batchedUpdates=qy,fs.unstable_renderSubtreeIntoContainer=function(c,d,m,b){if(!mp(m))throw Error(r(200));if(c==null||c._reactInternals===void 0)throw Error(r(38));return Gl(c,d,m,!1,b)},fs.version="18.3.1-next-f1338f8080-20240426",fs}var WT;function iL(){if(WT)return OC.exports;WT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),OC.exports=lB(),OC.exports}var qT;function cB(){if(qT)return q1;qT=1;var e=iL();return q1.createRoot=e.createRoot,q1.hydrateRoot=e.hydrateRoot,q1}var uB=cB(),GT={};/*! *****************************************************************************
|
||
Copyright (C) Microsoft. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var YT;function dB(){if(YT)return GT;YT=1;var e;return function(n){(function(r){var i=typeof globalThis=="object"?globalThis:typeof Ga=="object"?Ga:typeof self=="object"?self:typeof this=="object"?this:u(),s=o(n);typeof i.Reflect<"u"&&(s=o(i.Reflect,s)),r(s,i),typeof i.Reflect>"u"&&(i.Reflect=n);function o(h,p){return function(g,v){Object.defineProperty(h,g,{configurable:!0,writable:!0,value:v}),p&&p(g,v)}}function a(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return a()||l()}})(function(r,i){var s=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",a=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",h={__proto__:[]}instanceof Array,p=!u&&!h,g={create:u?function(){return Mn(Object.create(null))}:h?function(){return Mn({__proto__:null})}:function(){return Mn({})},has:p?function(ce,fe){return s.call(ce,fe)}:function(ce,fe){return fe in ce},get:p?function(ce,fe){return s.call(ce,fe)?ce[fe]:void 0}:function(ce,fe){return ce[fe]}},v=Object.getPrototypeOf(Function),w=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:At(),S=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:mr(),E=typeof WeakMap=="function"?WeakMap:Er(),x=o?Symbol.for("@reflect-metadata:registry"):void 0,I=lt(),P=It(I);function M(ce,fe,_e,ze){if(ie(_e)){if(!tt(ce))throw new TypeError;if(!_t(fe))throw new TypeError;return te(ce,fe)}else{if(!tt(ce))throw new TypeError;if(!J(fe))throw new TypeError;if(!J(ze)&&!ie(ze)&&!we(ze))throw new TypeError;return we(ze)&&(ze=void 0),_e=Le(_e),ue(ce,fe,_e,ze)}}r("decorate",M);function k(ce,fe){function _e(ze,it){if(!J(ze))throw new TypeError;if(!ie(it)&&!Ge(it))throw new TypeError;ae(ce,fe,ze,it)}return _e}r("metadata",k);function A(ce,fe,_e,ze){if(!J(_e))throw new TypeError;return ie(ze)||(ze=Le(ze)),ae(ce,fe,_e,ze)}r("defineMetadata",A);function j(ce,fe,_e){if(!J(fe))throw new TypeError;return ie(_e)||(_e=Le(_e)),ye(ce,fe,_e)}r("hasMetadata",j);function V(ce,fe,_e){if(!J(fe))throw new TypeError;return ie(_e)||(_e=Le(_e)),Ne(ce,fe,_e)}r("hasOwnMetadata",V);function $(ce,fe,_e){if(!J(fe))throw new TypeError;return ie(_e)||(_e=Le(_e)),q(ce,fe,_e)}r("getMetadata",$);function W(ce,fe,_e){if(!J(fe))throw new TypeError;return ie(_e)||(_e=Le(_e)),G(ce,fe,_e)}r("getOwnMetadata",W);function B(ce,fe){if(!J(ce))throw new TypeError;return ie(fe)||(fe=Le(fe)),ge(ce,fe)}r("getMetadataKeys",B);function H(ce,fe){if(!J(ce))throw new TypeError;return ie(fe)||(fe=Le(fe)),X(ce,fe)}r("getOwnMetadataKeys",H);function Y(ce,fe,_e){if(!J(fe))throw new TypeError;if(ie(_e)||(_e=Le(_e)),!J(fe))throw new TypeError;ie(_e)||(_e=Le(_e));var ze=dn(fe,_e,!1);return ie(ze)?!1:ze.OrdinaryDeleteMetadata(ce,fe,_e)}r("deleteMetadata",Y);function te(ce,fe){for(var _e=ce.length-1;_e>=0;--_e){var ze=ce[_e],it=ze(fe);if(!ie(it)&&!we(it)){if(!_t(it))throw new TypeError;fe=it}}return fe}function ue(ce,fe,_e,ze){for(var it=ce.length-1;it>=0;--it){var Gt=ce[it],hn=Gt(fe,_e,ze);if(!ie(hn)&&!we(hn)){if(!J(hn))throw new TypeError;ze=hn}}return ze}function ye(ce,fe,_e){var ze=Ne(ce,fe,_e);if(ze)return!0;var it=Bt(fe);return we(it)?!1:ye(ce,it,_e)}function Ne(ce,fe,_e){var ze=dn(fe,_e,!1);return ie(ze)?!1:Oe(ze.OrdinaryHasOwnMetadata(ce,fe,_e))}function q(ce,fe,_e){var ze=Ne(ce,fe,_e);if(ze)return G(ce,fe,_e);var it=Bt(fe);if(!we(it))return q(ce,it,_e)}function G(ce,fe,_e){var ze=dn(fe,_e,!1);if(!ie(ze))return ze.OrdinaryGetOwnMetadata(ce,fe,_e)}function ae(ce,fe,_e,ze){var it=dn(_e,ze,!0);it.OrdinaryDefineOwnMetadata(ce,fe,_e,ze)}function ge(ce,fe){var _e=X(ce,fe),ze=Bt(ce);if(ze===null)return _e;var it=ge(ze,fe);if(it.length<=0)return _e;if(_e.length<=0)return it;for(var Gt=new S,hn=[],wt=0,He=_e;wt<He.length;wt++){var We=He[wt],ke=Gt.has(We);ke||(Gt.add(We),hn.push(We))}for(var Be=0,ct=it;Be<ct.length;Be++){var We=ct[Be],ke=Gt.has(We);ke||(Gt.add(We),hn.push(We))}return hn}function X(ce,fe){var _e=dn(ce,fe,!1);return _e?_e.OrdinaryOwnMetadataKeys(ce,fe):[]}function ee(ce){if(ce===null)return 1;switch(typeof ce){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return ce===null?1:6;default:return 6}}function ie(ce){return ce===void 0}function we(ce){return ce===null}function Se(ce){return typeof ce=="symbol"}function J(ce){return typeof ce=="object"?ce!==null:typeof ce=="function"}function Re(ce,fe){switch(ee(ce)){case 0:return ce;case 1:return ce;case 2:return ce;case 3:return ce;case 4:return ce;case 5:return ce}var _e="string",ze=Ke(ce,a);if(ze!==void 0){var it=ze.call(ce,_e);if(J(it))throw new TypeError;return it}return be(ce)}function be(ce,fe){var _e,ze,it;{var Gt=ce.toString;if(Pt(Gt)){var ze=Gt.call(ce);if(!J(ze))return ze}var _e=ce.valueOf;if(Pt(_e)){var ze=_e.call(ce);if(!J(ze))return ze}}throw new TypeError}function Oe(ce){return!!ce}function Ee(ce){return""+ce}function Le(ce){var fe=Re(ce);return Se(fe)?fe:Ee(fe)}function tt(ce){return Array.isArray?Array.isArray(ce):ce instanceof Object?ce instanceof Array:Object.prototype.toString.call(ce)==="[object Array]"}function Pt(ce){return typeof ce=="function"}function _t(ce){return typeof ce=="function"}function Ge(ce){switch(ee(ce)){case 3:return!0;case 4:return!0;default:return!1}}function Ft(ce,fe){return ce===fe||ce!==ce&&fe!==fe}function Ke(ce,fe){var _e=ce[fe];if(_e!=null){if(!Pt(_e))throw new TypeError;return _e}}function zt(ce){var fe=Ke(ce,l);if(!Pt(fe))throw new TypeError;var _e=fe.call(ce);if(!J(_e))throw new TypeError;return _e}function kn(ce){return ce.value}function yt(ce){var fe=ce.next();return fe.done?!1:fe}function St(ce){var fe=ce.return;fe&&fe.call(ce)}function Bt(ce){var fe=Object.getPrototypeOf(ce);if(typeof ce!="function"||ce===v||fe!==v)return fe;var _e=ce.prototype,ze=_e&&Object.getPrototypeOf(_e);if(ze==null||ze===Object.prototype)return fe;var it=ze.constructor;return typeof it!="function"||it===ce?fe:it}function Nt(){var ce;!ie(x)&&typeof i.Reflect<"u"&&!(x in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(ce=ci(i.Reflect));var fe,_e,ze,it=new E,Gt={registerProvider:hn,getProvider:He,setProvider:ke};return Gt;function hn(Be){if(!Object.isExtensible(Gt))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case ce===Be:break;case ie(fe):fe=Be;break;case fe===Be:break;case ie(_e):_e=Be;break;case _e===Be:break;default:ze===void 0&&(ze=new S),ze.add(Be);break}}function wt(Be,ct){if(!ie(fe)){if(fe.isProviderFor(Be,ct))return fe;if(!ie(_e)){if(_e.isProviderFor(Be,ct))return fe;if(!ie(ze))for(var Dt=zt(ze);;){var Mt=yt(Dt);if(!Mt)return;var Jt=kn(Mt);if(Jt.isProviderFor(Be,ct))return St(Dt),Jt}}}if(!ie(ce)&&ce.isProviderFor(Be,ct))return ce}function He(Be,ct){var Dt=it.get(Be),Mt;return ie(Dt)||(Mt=Dt.get(ct)),ie(Mt)&&(Mt=wt(Be,ct),ie(Mt)||(ie(Dt)&&(Dt=new w,it.set(Be,Dt)),Dt.set(ct,Mt))),Mt}function We(Be){if(ie(Be))throw new TypeError;return fe===Be||_e===Be||!ie(ze)&&ze.has(Be)}function ke(Be,ct,Dt){if(!We(Dt))throw new Error("Metadata provider not registered.");var Mt=He(Be,ct);if(Mt!==Dt){if(!ie(Mt))return!1;var Jt=it.get(Be);ie(Jt)&&(Jt=new w,it.set(Be,Jt)),Jt.set(ct,Dt)}return!0}}function lt(){var ce;return!ie(x)&&J(i.Reflect)&&Object.isExtensible(i.Reflect)&&(ce=i.Reflect[x]),ie(ce)&&(ce=Nt()),!ie(x)&&J(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,x,{enumerable:!1,configurable:!1,writable:!1,value:ce}),ce}function It(ce){var fe=new E,_e={isProviderFor:function(We,ke){var Be=fe.get(We);return ie(Be)?!1:Be.has(ke)},OrdinaryDefineOwnMetadata:hn,OrdinaryHasOwnMetadata:it,OrdinaryGetOwnMetadata:Gt,OrdinaryOwnMetadataKeys:wt,OrdinaryDeleteMetadata:He};return I.registerProvider(_e),_e;function ze(We,ke,Be){var ct=fe.get(We),Dt=!1;if(ie(ct)){if(!Be)return;ct=new w,fe.set(We,ct),Dt=!0}var Mt=ct.get(ke);if(ie(Mt)){if(!Be)return;if(Mt=new w,ct.set(ke,Mt),!ce.setProvider(We,ke,_e))throw ct.delete(ke),Dt&&fe.delete(We),new Error("Wrong provider for target.")}return Mt}function it(We,ke,Be){var ct=ze(ke,Be,!1);return ie(ct)?!1:Oe(ct.has(We))}function Gt(We,ke,Be){var ct=ze(ke,Be,!1);if(!ie(ct))return ct.get(We)}function hn(We,ke,Be,ct){var Dt=ze(Be,ct,!0);Dt.set(We,ke)}function wt(We,ke){var Be=[],ct=ze(We,ke,!1);if(ie(ct))return Be;for(var Dt=ct.keys(),Mt=zt(Dt),Jt=0;;){var Fr=yt(Mt);if(!Fr)return Be.length=Jt,Be;var xs=kn(Fr);try{Be[Jt]=xs}catch(xr){try{St(Mt)}finally{throw xr}}Jt++}}function He(We,ke,Be){var ct=ze(ke,Be,!1);if(ie(ct)||!ct.delete(We))return!1;if(ct.size===0){var Dt=fe.get(ke);ie(Dt)||(Dt.delete(Be),Dt.size===0&&fe.delete(Dt))}return!0}}function ci(ce){var fe=ce.defineMetadata,_e=ce.hasOwnMetadata,ze=ce.getOwnMetadata,it=ce.getOwnMetadataKeys,Gt=ce.deleteMetadata,hn=new E,wt={isProviderFor:function(He,We){var ke=hn.get(He);return!ie(ke)&&ke.has(We)?!0:it(He,We).length?(ie(ke)&&(ke=new S,hn.set(He,ke)),ke.add(We),!0):!1},OrdinaryDefineOwnMetadata:fe,OrdinaryHasOwnMetadata:_e,OrdinaryGetOwnMetadata:ze,OrdinaryOwnMetadataKeys:it,OrdinaryDeleteMetadata:Gt};return wt}function dn(ce,fe,_e){var ze=I.getProvider(ce,fe);if(!ie(ze))return ze;if(_e){if(I.setProvider(ce,fe,P))return P;throw new Error("Illegal state.")}}function At(){var ce={},fe=[],_e=function(){function wt(He,We,ke){this._index=0,this._keys=He,this._values=We,this._selector=ke}return wt.prototype["@@iterator"]=function(){return this},wt.prototype[l]=function(){return this},wt.prototype.next=function(){var He=this._index;if(He>=0&&He<this._keys.length){var We=this._selector(this._keys[He],this._values[He]);return He+1>=this._keys.length?(this._index=-1,this._keys=fe,this._values=fe):this._index++,{value:We,done:!1}}return{value:void 0,done:!0}},wt.prototype.throw=function(He){throw this._index>=0&&(this._index=-1,this._keys=fe,this._values=fe),He},wt.prototype.return=function(He){return this._index>=0&&(this._index=-1,this._keys=fe,this._values=fe),{value:He,done:!0}},wt}(),ze=function(){function wt(){this._keys=[],this._values=[],this._cacheKey=ce,this._cacheIndex=-2}return Object.defineProperty(wt.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),wt.prototype.has=function(He){return this._find(He,!1)>=0},wt.prototype.get=function(He){var We=this._find(He,!1);return We>=0?this._values[We]:void 0},wt.prototype.set=function(He,We){var ke=this._find(He,!0);return this._values[ke]=We,this},wt.prototype.delete=function(He){var We=this._find(He,!1);if(We>=0){for(var ke=this._keys.length,Be=We+1;Be<ke;Be++)this._keys[Be-1]=this._keys[Be],this._values[Be-1]=this._values[Be];return this._keys.length--,this._values.length--,Ft(He,this._cacheKey)&&(this._cacheKey=ce,this._cacheIndex=-2),!0}return!1},wt.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=ce,this._cacheIndex=-2},wt.prototype.keys=function(){return new _e(this._keys,this._values,it)},wt.prototype.values=function(){return new _e(this._keys,this._values,Gt)},wt.prototype.entries=function(){return new _e(this._keys,this._values,hn)},wt.prototype["@@iterator"]=function(){return this.entries()},wt.prototype[l]=function(){return this.entries()},wt.prototype._find=function(He,We){if(!Ft(this._cacheKey,He)){this._cacheIndex=-1;for(var ke=0;ke<this._keys.length;ke++)if(Ft(this._keys[ke],He)){this._cacheIndex=ke;break}}return this._cacheIndex<0&&We&&(this._cacheIndex=this._keys.length,this._keys.push(He),this._values.push(void 0)),this._cacheIndex},wt}();return ze;function it(wt,He){return wt}function Gt(wt,He){return He}function hn(wt,He){return[wt,He]}}function mr(){var ce=function(){function fe(){this._map=new w}return Object.defineProperty(fe.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),fe.prototype.has=function(_e){return this._map.has(_e)},fe.prototype.add=function(_e){return this._map.set(_e,_e),this},fe.prototype.delete=function(_e){return this._map.delete(_e)},fe.prototype.clear=function(){this._map.clear()},fe.prototype.keys=function(){return this._map.keys()},fe.prototype.values=function(){return this._map.keys()},fe.prototype.entries=function(){return this._map.entries()},fe.prototype["@@iterator"]=function(){return this.keys()},fe.prototype[l]=function(){return this.keys()},fe}();return ce}function Er(){var ce=16,fe=g.create(),_e=ze();return function(){function He(){this._key=ze()}return He.prototype.has=function(We){var ke=it(We,!1);return ke!==void 0?g.has(ke,this._key):!1},He.prototype.get=function(We){var ke=it(We,!1);return ke!==void 0?g.get(ke,this._key):void 0},He.prototype.set=function(We,ke){var Be=it(We,!0);return Be[this._key]=ke,this},He.prototype.delete=function(We){var ke=it(We,!1);return ke!==void 0?delete ke[this._key]:!1},He.prototype.clear=function(){this._key=ze()},He}();function ze(){var He;do He="@@WeakMap@@"+wt();while(g.has(fe,He));return fe[He]=!0,He}function it(He,We){if(!s.call(He,_e)){if(!We)return;Object.defineProperty(He,_e,{value:g.create()})}return He[_e]}function Gt(He,We){for(var ke=0;ke<We;++ke)He[ke]=Math.random()*255|0;return He}function hn(He){if(typeof Uint8Array=="function"){var We=new Uint8Array(He);return typeof crypto<"u"?crypto.getRandomValues(We):typeof msCrypto<"u"?msCrypto.getRandomValues(We):Gt(We,He),We}return Gt(new Array(He),He)}function wt(){var He=hn(ce);He[6]=He[6]&79|64,He[8]=He[8]&191|128;for(var We="",ke=0;ke<ce;++ke){var Be=He[ke];(ke===4||ke===6||ke===8)&&(We+="-"),Be<16&&(We+="0"),We+=Be.toString(16).toLowerCase()}return We}}function Mn(ce){return ce.__=void 0,delete ce.__,ce}})}(e||(e={})),GT}dB();var Dm={exports:{}};/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/var hB=Dm.exports,XT;function fB(){return XT||(XT=1,function(e,n){(function(){var r,i="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",g=1,v=2,w=4,S=1,E=2,x=1,I=2,P=4,M=8,k=16,A=32,j=64,V=128,$=256,W=512,B=30,H="...",Y=800,te=16,ue=1,ye=2,Ne=3,q=1/0,G=9007199254740991,ae=17976931348623157e292,ge=NaN,X=4294967295,ee=X-1,ie=X>>>1,we=[["ary",V],["bind",x],["bindKey",I],["curry",M],["curryRight",k],["flip",W],["partial",A],["partialRight",j],["rearg",$]],Se="[object Arguments]",J="[object Array]",Re="[object AsyncFunction]",be="[object Boolean]",Oe="[object Date]",Ee="[object DOMException]",Le="[object Error]",tt="[object Function]",Pt="[object GeneratorFunction]",_t="[object Map]",Ge="[object Number]",Ft="[object Null]",Ke="[object Object]",zt="[object Promise]",kn="[object Proxy]",yt="[object RegExp]",St="[object Set]",Bt="[object String]",Nt="[object Symbol]",lt="[object Undefined]",It="[object WeakMap]",ci="[object WeakSet]",dn="[object ArrayBuffer]",At="[object DataView]",mr="[object Float32Array]",Er="[object Float64Array]",Mn="[object Int8Array]",ce="[object Int16Array]",fe="[object Int32Array]",_e="[object Uint8Array]",ze="[object Uint8ClampedArray]",it="[object Uint16Array]",Gt="[object Uint32Array]",hn=/\b__p \+= '';/g,wt=/\b(__p \+=) '' \+/g,He=/(__e\(.*?\)|\b__t\)) \+\n'';/g,We=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Be=RegExp(We.source),ct=RegExp(ke.source),Dt=/<%-([\s\S]+?)%>/g,Mt=/<%([\s\S]+?)%>/g,Jt=/<%=([\s\S]+?)%>/g,Fr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xs=/^\w*$/,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,Ds=RegExp(Ss.source),ma=/^\s+/,eo=/\s/,Cl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,to=/\{\n\/\* \[wrapped with (.+)\] \*/,Ro=/,? & /,hd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,x_=/[()=,{}\[\]\/\s]/,S_=/\\(\\)?/g,El=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kg=/\w*$/,b0=/^[-+]0x[0-9a-f]+$/i,D_=/^0b[01]+$/i,w0=/^\[object .+?Constructor\]$/,_0=/^0o[0-7]+$/i,C0=/^(?:0|[1-9]\d*)$/,E0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zh=/($^)/,N_=/['\n\r\u2028\u2029\\]/g,Vn="\\ud800-\\udfff",I_="\\u0300-\\u036f",Lg="\\ufe20-\\ufe2f",x0="\\u20d0-\\u20ff",fd=I_+Lg+x0,S0="\\u2700-\\u27bf",jg="a-z\\xdf-\\xf6\\xf8-\\xff",Qh="\\xac\\xb1\\xd7\\xf7",no="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O_="\\u2000-\\u206f",Ns=" \\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",D0="A-Z\\xc0-\\xd6\\xd8-\\xde",N0="\\ufe0e\\ufe0f",I0=Qh+no+O_+Ns,Nc="['’]",Jh="["+Vn+"]",Ic="["+I0+"]",xl="["+fd+"]",O0="\\d+",T_="["+S0+"]",ef="["+jg+"]",Fg="[^"+Vn+I0+O0+S0+jg+D0+"]",pd="\\ud83c[\\udffb-\\udfff]",gd="(?:"+xl+"|"+pd+")",T0="[^"+Vn+"]",yd="(?:\\ud83c[\\udde6-\\uddff]){2}",ln="[\\ud800-\\udbff][\\udc00-\\udfff]",Sl="["+D0+"]",$g="\\u200d",tf="(?:"+ef+"|"+Fg+")",M0="(?:"+Sl+"|"+Fg+")",zg="(?:"+Nc+"(?:d|ll|m|re|s|t|ve))?",Vg="(?:"+Nc+"(?:D|LL|M|RE|S|T|VE))?",nf=gd+"?",md="["+N0+"]?",va="(?:"+$g+"(?:"+[T0,yd,ln].join("|")+")"+md+nf+")*",ba="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wa="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Oc=md+nf+va,vd="(?:"+[T_,yd,ln].join("|")+")"+Oc,_a="(?:"+[T0+xl+"?",xl,yd,ln,Jh].join("|")+")",M_=RegExp(Nc,"g"),P0=RegExp(xl,"g"),Dl=RegExp(pd+"(?="+pd+")|"+_a+Oc,"g"),P_=RegExp([Sl+"?"+ef+"+"+zg+"(?="+[Ic,Sl,"$"].join("|")+")",M0+"+"+Vg+"(?="+[Ic,Sl+tf,"$"].join("|")+")",Sl+"?"+tf+"+"+zg,Sl+"+"+Vg,wa,ba,O0,vd].join("|"),"g"),A0=RegExp("["+$g+Vn+fd+N0+"]"),rf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,R0=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],A_=-1,yn={};yn[mr]=yn[Er]=yn[Mn]=yn[ce]=yn[fe]=yn[_e]=yn[ze]=yn[it]=yn[Gt]=!0,yn[Se]=yn[J]=yn[dn]=yn[be]=yn[At]=yn[Oe]=yn[Le]=yn[tt]=yn[_t]=yn[Ge]=yn[Ke]=yn[yt]=yn[St]=yn[Bt]=yn[It]=!1;var fn={};fn[Se]=fn[J]=fn[dn]=fn[At]=fn[be]=fn[Oe]=fn[mr]=fn[Er]=fn[Mn]=fn[ce]=fn[fe]=fn[_t]=fn[Ge]=fn[Ke]=fn[yt]=fn[St]=fn[Bt]=fn[Nt]=fn[_e]=fn[ze]=fn[it]=fn[Gt]=!0,fn[Le]=fn[tt]=fn[It]=!1;var Tc={À:"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"},sf={"&":"&","<":"<",">":">",'"':""","'":"'"},R_={"&":"&","<":"<",">":">",""":'"',"'":"'"},k_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bg=parseFloat,of=parseInt,af=typeof Ga=="object"&&Ga&&Ga.Object===Object&&Ga,k0=typeof self=="object"&&self&&self.Object===Object&&self,Bn=af||k0||Function("return this")(),bd=n&&!n.nodeType&&n,ro=bd&&!0&&e&&!e.nodeType&&e,Hg=ro&&ro.exports===bd,Mc=Hg&&af.process,ui=function(){try{var le=ro&&ro.require&&ro.require("util").types;return le||Mc&&Mc.binding&&Mc.binding("util")}catch{}}(),Ug=ui&&ui.isArrayBuffer,Ci=ui&&ui.isDate,Nl=ui&&ui.isMap,lf=ui&&ui.isRegExp,Pc=ui&&ui.isSet,L0=ui&&ui.isTypedArray;function di(le,Ce,me){switch(me.length){case 0:return le.call(Ce);case 1:return le.call(Ce,me[0]);case 2:return le.call(Ce,me[0],me[1]);case 3:return le.call(Ce,me[0],me[1],me[2])}return le.apply(Ce,me)}function Kg(le,Ce,me,Xe){for(var Ct=-1,en=le==null?0:le.length;++Ct<en;){var vr=le[Ct];Ce(Xe,vr,me(vr),le)}return Xe}function Gr(le,Ce){for(var me=-1,Xe=le==null?0:le.length;++me<Xe&&Ce(le[me],me,le)!==!1;);return le}function cf(le,Ce){for(var me=le==null?0:le.length;me--&&Ce(le[me],me,le)!==!1;);return le}function Wg(le,Ce){for(var me=-1,Xe=le==null?0:le.length;++me<Xe;)if(!Ce(le[me],me,le))return!1;return!0}function Ca(le,Ce){for(var me=-1,Xe=le==null?0:le.length,Ct=0,en=[];++me<Xe;){var vr=le[me];Ce(vr,me,le)&&(en[Ct++]=vr)}return en}function uf(le,Ce){var me=le==null?0:le.length;return!!me&&Ac(le,Ce,0)>-1}function qg(le,Ce,me){for(var Xe=-1,Ct=le==null?0:le.length;++Xe<Ct;)if(me(Ce,le[Xe]))return!0;return!1}function Pn(le,Ce){for(var me=-1,Xe=le==null?0:le.length,Ct=Array(Xe);++me<Xe;)Ct[me]=Ce(le[me],me,le);return Ct}function Ea(le,Ce){for(var me=-1,Xe=Ce.length,Ct=le.length;++me<Xe;)le[Ct+me]=Ce[me];return le}function Gg(le,Ce,me,Xe){var Ct=-1,en=le==null?0:le.length;for(Xe&&en&&(me=le[++Ct]);++Ct<en;)me=Ce(me,le[Ct],Ct,le);return me}function L_(le,Ce,me,Xe){var Ct=le==null?0:le.length;for(Xe&&Ct&&(me=le[--Ct]);Ct--;)me=Ce(me,le[Ct],Ct,le);return me}function Yg(le,Ce){for(var me=-1,Xe=le==null?0:le.length;++me<Xe;)if(Ce(le[me],me,le))return!0;return!1}var j_=Zg("length");function j0(le){return le.split("")}function F_(le){return le.match(hd)||[]}function F0(le,Ce,me){var Xe;return me(le,function(Ct,en,vr){if(Ce(Ct,en,vr))return Xe=en,!1}),Xe}function df(le,Ce,me,Xe){for(var Ct=le.length,en=me+(Xe?1:-1);Xe?en--:++en<Ct;)if(Ce(le[en],en,le))return en;return-1}function Ac(le,Ce,me){return Ce===Ce?pf(le,Ce,me):df(le,$0,me)}function Xg(le,Ce,me,Xe){for(var Ct=me-1,en=le.length;++Ct<en;)if(Xe(le[Ct],Ce))return Ct;return-1}function $0(le){return le!==le}function z0(le,Ce){var me=le==null?0:le.length;return me?Qg(le,Ce)/me:ge}function Zg(le){return function(Ce){return Ce==null?r:Ce[le]}}function hf(le){return function(Ce){return le==null?r:le[Ce]}}function V0(le,Ce,me,Xe,Ct){return Ct(le,function(en,vr,mn){me=Xe?(Xe=!1,en):Ce(me,en,vr,mn)}),me}function $_(le,Ce){var me=le.length;for(le.sort(Ce);me--;)le[me]=le[me].value;return le}function Qg(le,Ce){for(var me,Xe=-1,Ct=le.length;++Xe<Ct;){var en=Ce(le[Xe]);en!==r&&(me=me===r?en:me+en)}return me}function Jg(le,Ce){for(var me=-1,Xe=Array(le);++me<le;)Xe[me]=Ce(me);return Xe}function z_(le,Ce){return Pn(Ce,function(me){return[me,le[me]]})}function B0(le){return le&&le.slice(0,gf(le)+1).replace(ma,"")}function Ri(le){return function(Ce){return le(Ce)}}function wd(le,Ce){return Pn(Ce,function(me){return le[me]})}function ko(le,Ce){return le.has(Ce)}function H0(le,Ce){for(var me=-1,Xe=le.length;++me<Xe&&Ac(Ce,le[me],0)>-1;);return me}function ey(le,Ce){for(var me=le.length;me--&&Ac(Ce,le[me],0)>-1;);return me}function U0(le,Ce){for(var me=le.length,Xe=0;me--;)le[me]===Ce&&++Xe;return Xe}var K0=hf(Tc),W0=hf(sf);function q0(le){return"\\"+k_[le]}function Rc(le,Ce){return le==null?r:le[Ce]}function kc(le){return A0.test(le)}function V_(le){return rf.test(le)}function B_(le){for(var Ce,me=[];!(Ce=le.next()).done;)me.push(Ce.value);return me}function ff(le){var Ce=-1,me=Array(le.size);return le.forEach(function(Xe,Ct){me[++Ce]=[Ct,Xe]}),me}function ty(le,Ce){return function(me){return le(Ce(me))}}function Qi(le,Ce){for(var me=-1,Xe=le.length,Ct=0,en=[];++me<Xe;){var vr=le[me];(vr===Ce||vr===p)&&(le[me]=p,en[Ct++]=me)}return en}function xa(le){var Ce=-1,me=Array(le.size);return le.forEach(function(Xe){me[++Ce]=Xe}),me}function H_(le){var Ce=-1,me=Array(le.size);return le.forEach(function(Xe){me[++Ce]=[Xe,Xe]}),me}function pf(le,Ce,me){for(var Xe=me-1,Ct=le.length;++Xe<Ct;)if(le[Xe]===Ce)return Xe;return-1}function U_(le,Ce,me){for(var Xe=me+1;Xe--;)if(le[Xe]===Ce)return Xe;return Xe}function Il(le){return kc(le)?Y0(le):j_(le)}function ki(le){return kc(le)?X0(le):j0(le)}function gf(le){for(var Ce=le.length;Ce--&&eo.test(le.charAt(Ce)););return Ce}var G0=hf(R_);function Y0(le){for(var Ce=Dl.lastIndex=0;Dl.test(le);)++Ce;return Ce}function X0(le){return le.match(Dl)||[]}function K_(le){return le.match(P_)||[]}var W_=function le(Ce){Ce=Ce==null?Bn:Lc.defaults(Bn.Object(),Ce,Lc.pick(Bn,R0));var me=Ce.Array,Xe=Ce.Date,Ct=Ce.Error,en=Ce.Function,vr=Ce.Math,mn=Ce.Object,_d=Ce.RegExp,q_=Ce.String,Ji=Ce.TypeError,Lo=me.prototype,ny=en.prototype,io=mn.prototype,jc=Ce["__core-js_shared__"],Cd=ny.toString,tn=io.hasOwnProperty,Fc=0,yf=function(){var f=/[^.]+$/.exec(jc&&jc.keys&&jc.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),Ed=io.toString,mf=Cd.call(mn),Z0=Bn._,Q0=_d("^"+Cd.call(tn).replace(Ss,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xd=Hg?Ce.Buffer:r,jo=Ce.Symbol,Sd=Ce.Uint8Array,ry=xd?xd.allocUnsafe:r,Is=ty(mn.getPrototypeOf,mn),vf=mn.create,bf=io.propertyIsEnumerable,wf=Lo.splice,J0=jo?jo.isConcatSpreadable:r,Fo=jo?jo.iterator:r,Ol=jo?jo.toStringTag:r,Dd=function(){try{var f=ka(mn,"defineProperty");return f({},"",{}),f}catch{}}(),e1=Ce.clearTimeout!==Bn.clearTimeout&&Ce.clearTimeout,Ln=Xe&&Xe.now!==Bn.Date.now&&Xe.now,iy=Ce.setTimeout!==Bn.setTimeout&&Ce.setTimeout,Tl=vr.ceil,Sa=vr.floor,_f=mn.getOwnPropertySymbols,sy=xd?xd.isBuffer:r,$c=Ce.isFinite,Cf=Lo.join,zc=ty(mn.keys,mn),br=vr.max,Yr=vr.min,G_=Xe.now,t1=Ce.parseInt,Nd=vr.random,Ef=Lo.reverse,Id=ka(Ce,"DataView"),Ml=ka(Ce,"Map"),Od=ka(Ce,"Promise"),Da=ka(Ce,"Set"),Td=ka(Ce,"WeakMap"),Vc=ka(mn,"create"),xf=Td&&new Td,Bc={},oy=La(Id),Na=La(Ml),n1=La(Od),Hc=La(Da),so=La(Td),Ia=jo?jo.prototype:r,Li=Ia?Ia.valueOf:r,Sf=Ia?Ia.toString:r;function U(f){if(_r(f)&&!Tt(f)&&!(f instanceof Ot)){if(f instanceof Xr)return f;if(tn.call(f,"__wrapped__"))return T1(f)}return new Xr(f)}var Uc=function(){function f(){}return function(y){if(!hr(y))return{};if(vf)return vf(y);f.prototype=y;var _=new f;return f.prototype=r,_}}();function oo(){}function Xr(f,y){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!y,this.__index__=0,this.__values__=r}U.templateSettings={escape:Dt,evaluate:Mt,interpolate:Jt,variable:"",imports:{_:U}},U.prototype=oo.prototype,U.prototype.constructor=U,Xr.prototype=Uc(oo.prototype),Xr.prototype.constructor=Xr;function Ot(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function Df(){var f=new Ot(this.__wrapped__);return f.__actions__=fi(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=fi(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=fi(this.__views__),f}function ay(){if(this.__filtered__){var f=new Ot(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function Kc(){var f=this.__wrapped__.value(),y=this.__dir__,_=Tt(f),T=y<0,L=_?f.length:0,K=ky(0,L,this.__views__),Q=K.start,re=K.end,de=re-Q,De=T?re:Q-1,Ie=this.__iteratees__,Pe=Ie.length,Ye=0,dt=Yr(de,this.__takeCount__);if(!_||!T&&L==de&&dt==de)return Jc(f,this.__actions__);var vt=[];e:for(;de--&&Ye<dt;){De+=y;for(var Lt=-1,bt=f[De];++Lt<Pe;){var Ht=Ie[Lt],Zt=Ht.iteratee,Fs=Ht.type,Vi=Zt(bt);if(Fs==ye)bt=Vi;else if(!Vi){if(Fs==ue)continue e;break e}}vt[Ye++]=bt}return vt}Ot.prototype=Uc(oo.prototype),Ot.prototype.constructor=Ot;function Ei(f){var y=-1,_=f==null?0:f.length;for(this.clear();++y<_;){var T=f[y];this.set(T[0],T[1])}}function jn(){this.__data__=Vc?Vc(null):{},this.size=0}function An(f){var y=this.has(f)&&delete this.__data__[f];return this.size-=y?1:0,y}function Oa(f){var y=this.__data__;if(Vc){var _=y[f];return _===u?r:_}return tn.call(y,f)?y[f]:r}function Zr(f){var y=this.__data__;return Vc?y[f]!==r:tn.call(y,f)}function xi(f,y){var _=this.__data__;return this.size+=this.has(f)?0:1,_[f]=Vc&&y===r?u:y,this}Ei.prototype.clear=jn,Ei.prototype.delete=An,Ei.prototype.get=Oa,Ei.prototype.has=Zr,Ei.prototype.set=xi;function hi(f){var y=-1,_=f==null?0:f.length;for(this.clear();++y<_;){var T=f[y];this.set(T[0],T[1])}}function Wc(){this.__data__=[],this.size=0}function Si(f){var y=this.__data__,_=Jr(y,f);if(_<0)return!1;var T=y.length-1;return _==T?y.pop():wf.call(y,_,1),--this.size,!0}function Nf(f){var y=this.__data__,_=Jr(y,f);return _<0?r:y[_][1]}function r1(f){return Jr(this.__data__,f)>-1}function i1(f,y){var _=this.__data__,T=Jr(_,f);return T<0?(++this.size,_.push([f,y])):_[T][1]=y,this}hi.prototype.clear=Wc,hi.prototype.delete=Si,hi.prototype.get=Nf,hi.prototype.has=r1,hi.prototype.set=i1;function es(f){var y=-1,_=f==null?0:f.length;for(this.clear();++y<_;){var T=f[y];this.set(T[0],T[1])}}function s1(){this.size=0,this.__data__={hash:new Ei,map:new(Ml||hi),string:new Ei}}function $o(f){var y=Wd(this,f).delete(f);return this.size-=y?1:0,y}function If(f){return Wd(this,f).get(f)}function ly(f){return Wd(this,f).has(f)}function o1(f,y){var _=Wd(this,f),T=_.size;return _.set(f,y),this.size+=_.size==T?0:1,this}es.prototype.clear=s1,es.prototype.delete=$o,es.prototype.get=If,es.prototype.has=ly,es.prototype.set=o1;function Pl(f){var y=-1,_=f==null?0:f.length;for(this.__data__=new es;++y<_;)this.add(f[y])}function Ta(f){return this.__data__.set(f,u),this}function qc(f){return this.__data__.has(f)}Pl.prototype.add=Pl.prototype.push=Ta,Pl.prototype.has=qc;function Qr(f){var y=this.__data__=new hi(f);this.size=y.size}function Of(){this.__data__=new hi,this.size=0}function Tf(f){var y=this.__data__,_=y.delete(f);return this.size=y.size,_}function ts(f){return this.__data__.get(f)}function ns(f){return this.__data__.has(f)}function Al(f,y){var _=this.__data__;if(_ instanceof hi){var T=_.__data__;if(!Ml||T.length<s-1)return T.push([f,y]),this.size=++_.size,this;_=this.__data__=new es(T)}return _.set(f,y),this.size=_.size,this}Qr.prototype.clear=Of,Qr.prototype.delete=Tf,Qr.prototype.get=ts,Qr.prototype.has=ns,Qr.prototype.set=Al;function ao(f,y){var _=Tt(f),T=!_&&ih(f),L=!_&&!T&&cu(f),K=!_&&!T&&!L&&bp(f),Q=_||T||L||K,re=Q?Jg(f.length,q_):[],de=re.length;for(var De in f)(y||tn.call(f,De))&&!(Q&&(De=="length"||L&&(De=="offset"||De=="parent")||K&&(De=="buffer"||De=="byteLength"||De=="byteOffset")||Un(De,de)))&&re.push(De);return re}function lo(f){var y=f.length;return y?f[Zc(0,y-1)]:r}function Rl(f,y){return np(fi(f),zo(y,0,f.length))}function a1(f){return np(fi(f))}function Md(f,y,_){(_!==r&&!Xo(f[y],_)||_===r&&!(y in f))&&co(f,y,_)}function kl(f,y,_){var T=f[y];(!(tn.call(f,y)&&Xo(T,_))||_===r&&!(y in f))&&co(f,y,_)}function Jr(f,y){for(var _=f.length;_--;)if(Xo(f[_][0],y))return _;return-1}function ji(f,y,_,T){return ho(f,function(L,K,Q){y(T,L,_(L),Q)}),T}function Fn(f,y){return f&&Ts(y,ni(y),f)}function Os(f,y){return f&&Ts(y,ds(y),f)}function co(f,y,_){y=="__proto__"&&Dd?Dd(f,y,{configurable:!0,enumerable:!0,value:_,writable:!0}):f[y]=_}function Mf(f,y){for(var _=-1,T=y.length,L=me(T),K=f==null;++_<T;)L[_]=K?r:vC(f,y[_]);return L}function zo(f,y,_){return f===f&&(_!==r&&(f=f<=_?f:_),y!==r&&(f=f>=y?f:y)),f}function Di(f,y,_,T,L,K){var Q,re=y&g,de=y&v,De=y&w;if(_&&(Q=L?_(f,T,L,K):_(f)),Q!==r)return Q;if(!hr(f))return f;var Ie=Tt(f);if(Ie){if(Q=Gd(f),!re)return fi(f,Q)}else{var Pe=Vr(f),Ye=Pe==tt||Pe==Pt;if(cu(f))return Ey(f,re);if(Pe==Ke||Pe==Se||Ye&&!L){if(Q=de||Ye?{}:Br(f),!re)return de?X_(f,Os(Q,f)):Uf(f,Fn(Q,f))}else{if(!fn[Pe])return L?f:{};Q=Z_(f,Pe,re)}}K||(K=new Qr);var dt=K.get(f);if(dt)return dt;K.set(f,Q),CT(f)?f.forEach(function(bt){Q.add(Di(bt,y,_,bt,f,K))}):wT(f)&&f.forEach(function(bt,Ht){Q.set(Ht,Di(bt,y,_,Ht,f,K))});var vt=De?de?Kd:Ud:de?ds:ni,Lt=Ie?r:vt(f);return Gr(Lt||f,function(bt,Ht){Lt&&(Ht=bt,bt=f[Ht]),kl(Q,Ht,Di(bt,y,_,Ht,f,K))}),Q}function l1(f){var y=ni(f);return function(_){return Pd(_,f,y)}}function Pd(f,y,_){var T=_.length;if(f==null)return!T;for(f=mn(f);T--;){var L=_[T],K=y[L],Q=f[L];if(Q===r&&!(L in f)||!K(Q))return!1}return!0}function cy(f,y,_){if(typeof f!="function")throw new Ji(a);return ou(function(){f.apply(r,_)},y)}function uo(f,y,_,T){var L=-1,K=uf,Q=!0,re=f.length,de=[],De=y.length;if(!re)return de;_&&(y=Pn(y,Ri(_))),T?(K=qg,Q=!1):y.length>=s&&(K=ko,Q=!1,y=new Pl(y));e:for(;++L<re;){var Ie=f[L],Pe=_==null?Ie:_(Ie);if(Ie=T||Ie!==0?Ie:0,Q&&Pe===Pe){for(var Ye=De;Ye--;)if(y[Ye]===Pe)continue e;de.push(Ie)}else K(y,Pe,T)||de.push(Ie)}return de}var ho=as(Fi),c1=as(Ma,!0);function Ad(f,y){var _=!0;return ho(f,function(T,L,K){return _=!!y(T,L,K),_}),_}function Ll(f,y,_){for(var T=-1,L=f.length;++T<L;){var K=f[T],Q=y(K);if(Q!=null&&(re===r?Q===Q&&!js(Q):_(Q,re)))var re=Q,de=K}return de}function u1(f,y,_,T){var L=f.length;for(_=kt(_),_<0&&(_=-_>L?0:L+_),T=T===r||T>L?L:kt(T),T<0&&(T+=L),T=_>T?0:xT(T);_<T;)f[_++]=y;return f}function uy(f,y){var _=[];return ho(f,function(T,L,K){y(T,L,K)&&_.push(T)}),_}function tr(f,y,_,T,L){var K=-1,Q=f.length;for(_||(_=Jf),L||(L=[]);++K<Q;){var re=f[K];y>0&&_(re)?y>1?tr(re,y-1,_,T,L):Ea(L,re):T||(L[L.length]=re)}return L}var Pf=Wf(),Rd=Wf(!0);function Fi(f,y){return f&&Pf(f,y,ni)}function Ma(f,y){return f&&Rd(f,y,ni)}function Gc(f,y){return Ca(y,function(_){return Yl(f[_])})}function Vo(f,y){y=go(y,f);for(var _=0,T=y.length;f!=null&&_<T;)f=f[Rs(y[_++])];return _&&_==T?f:r}function Af(f,y,_){var T=y(f);return Tt(f)?T:Ea(T,_(f))}function $r(f){return f==null?f===r?lt:Ft:Ol&&Ol in mn(f)?Qf(f):jy(f)}function Pa(f,y){return f>y}function rs(f,y){return f!=null&&tn.call(f,y)}function jl(f,y){return f!=null&&y in mn(f)}function dy(f,y,_){return f>=Yr(y,_)&&f<br(y,_)}function Rf(f,y,_){for(var T=_?qg:uf,L=f[0].length,K=f.length,Q=K,re=me(K),de=1/0,De=[];Q--;){var Ie=f[Q];Q&&y&&(Ie=Pn(Ie,Ri(y))),de=Yr(Ie.length,de),re[Q]=!_&&(y||L>=120&&Ie.length>=120)?new Pl(Q&&Ie):r}Ie=f[0];var Pe=-1,Ye=re[0];e:for(;++Pe<L&&De.length<de;){var dt=Ie[Pe],vt=y?y(dt):dt;if(dt=_||dt!==0?dt:0,!(Ye?ko(Ye,vt):T(De,vt,_))){for(Q=K;--Q;){var Lt=re[Q];if(!(Lt?ko(Lt,vt):T(f[Q],vt,_)))continue e}Ye&&Ye.push(vt),De.push(dt)}}return De}function Bo(f,y,_,T){return Fi(f,function(L,K,Q){y(T,_(L),K,Q)}),T}function is(f,y,_){y=go(y,f),f=Pr(f,y);var T=f==null?f:f[Rs(yi(y))];return T==null?r:di(T,f,_)}function kf(f){return _r(f)&&$r(f)==Se}function d1(f){return _r(f)&&$r(f)==dn}function Ho(f){return _r(f)&&$r(f)==Oe}function ss(f,y,_,T,L){return f===y?!0:f==null||y==null||!_r(f)&&!_r(y)?f!==f&&y!==y:Lf(f,y,_,T,ss,L)}function Lf(f,y,_,T,L,K){var Q=Tt(f),re=Tt(y),de=Q?J:Vr(f),De=re?J:Vr(y);de=de==Se?Ke:de,De=De==Se?Ke:De;var Ie=de==Ke,Pe=De==Ke,Ye=de==De;if(Ye&&cu(f)){if(!cu(y))return!1;Q=!0,Ie=!1}if(Ye&&!Ie)return K||(K=new Qr),Q||bp(f)?Ay(f,y,_,T,L,K):Ry(f,y,de,_,T,L,K);if(!(_&S)){var dt=Ie&&tn.call(f,"__wrapped__"),vt=Pe&&tn.call(y,"__wrapped__");if(dt||vt){var Lt=dt?f.value():f,bt=vt?y.value():y;return K||(K=new Qr),L(Lt,bt,_,T,K)}}return Ye?(K||(K=new Qr),C1(f,y,_,T,L,K)):!1}function h1(f){return _r(f)&&Vr(f)==_t}function Yc(f,y,_,T){var L=_.length,K=L,Q=!T;if(f==null)return!K;for(f=mn(f);L--;){var re=_[L];if(Q&&re[2]?re[1]!==f[re[0]]:!(re[0]in f))return!1}for(;++L<K;){re=_[L];var de=re[0],De=f[de],Ie=re[1];if(Q&&re[2]){if(De===r&&!(de in f))return!1}else{var Pe=new Qr;if(T)var Ye=T(De,Ie,de,f,y,Pe);if(!(Ye===r?ss(Ie,De,S|E,T,Pe):Ye))return!1}}return!0}function hy(f){if(!hr(f)||S1(f))return!1;var y=Yl(f)?Q0:w0;return y.test(La(f))}function kd(f){return _r(f)&&$r(f)==yt}function fo(f){return _r(f)&&Vr(f)==St}function Ld(f){return _r(f)&&U1(f.length)&&!!yn[$r(f)]}function Xc(f){return typeof f=="function"?f:f==null?hs:typeof f=="object"?Tt(f)?Hn(f[0],f[1]):jf(f):kT(f)}function Uo(f){if(!Go(f))return zc(f);var y=[];for(var _ in mn(f))tn.call(f,_)&&_!="constructor"&&y.push(_);return y}function fy(f){if(!hr(f))return I1(f);var y=Go(f),_=[];for(var T in f)T=="constructor"&&(y||!tn.call(f,T))||_.push(T);return _}function Aa(f,y){return f<y}function py(f,y){var _=-1,T=us(f)?me(f.length):[];return ho(f,function(L,K,Q){T[++_]=y(L,K,Q)}),T}function jf(f){var y=qd(f);return y.length==1&&y[0][2]?ep(y[0][0],y[0][1]):function(_){return _===f||Yc(_,f,y)}}function Hn(f,y){return et(f)&&Xd(y)?ep(Rs(f),y):function(_){var T=vC(_,f);return T===r&&T===y?bC(_,f):ss(y,T,S|E)}}function Fl(f,y,_,T,L){f!==y&&Pf(y,function(K,Q){if(L||(L=new Qr),hr(K))gy(f,y,Q,_,Fl,T,L);else{var re=T?T(vo(f,Q),K,Q+"",f,y,L):r;re===r&&(re=K),Md(f,Q,re)}},ds)}function gy(f,y,_,T,L,K,Q){var re=vo(f,_),de=vo(y,_),De=Q.get(de);if(De){Md(f,_,De);return}var Ie=K?K(re,de,_+"",f,y,Q):r,Pe=Ie===r;if(Pe){var Ye=Tt(de),dt=!Ye&&cu(de),vt=!Ye&&!dt&&bp(de);Ie=de,Ye||dt||vt?Tt(re)?Ie=re:Nr(re)?Ie=fi(re):dt?(Pe=!1,Ie=Ey(de,!0)):vt?(Pe=!1,Ie=m1(de,!0)):Ie=[]:tm(de)||ih(de)?(Ie=re,ih(re)?Ie=ST(re):(!hr(re)||Yl(re))&&(Ie=Br(de))):Pe=!1}Pe&&(Q.set(de,Ie),L(Ie,de,T,K,Q),Q.delete(de)),Md(f,_,Ie)}function Ff(f,y){var _=f.length;if(_)return y+=y<0?_:0,Un(y,_)?f[y]:r}function jd(f,y,_){y.length?y=Pn(y,function(K){return Tt(K)?function(Q){return Vo(Q,K.length===1?K[0]:K)}:K}):y=[hs];var T=-1;y=Pn(y,Ri(gt()));var L=py(f,function(K,Q,re){var de=Pn(y,function(De){return De(K)});return{criteria:de,index:++T,value:K}});return $_(L,function(K,Q){return Y_(K,Q,_)})}function yy(f,y){return Ra(f,y,function(_,T){return bC(f,T)})}function Ra(f,y,_){for(var T=-1,L=y.length,K={};++T<L;){var Q=y[T],re=Vo(f,Q);_(re,Q)&&zl(K,go(Q,f),re)}return K}function Yn(f){return function(y){return Vo(y,f)}}function ur(f,y,_,T){var L=T?Xg:Ac,K=-1,Q=y.length,re=f;for(f===y&&(y=fi(y)),_&&(re=Pn(f,Ri(_)));++K<Q;)for(var de=0,De=y[K],Ie=_?_(De):De;(de=L(re,Ie,de,T))>-1;)re!==f&&wf.call(re,de,1),wf.call(f,de,1);return f}function Sr(f,y){for(var _=f?y.length:0,T=_-1;_--;){var L=y[_];if(_==T||L!==K){var K=L;Un(L)?wf.call(f,L,1):Vf(f,L)}}return f}function Zc(f,y){return f+Sa(Nd()*(y-f+1))}function Fd(f,y,_,T){for(var L=-1,K=br(Tl((y-f)/(_||1)),0),Q=me(K);K--;)Q[T?K:++L]=f,f+=_;return Q}function $l(f,y){var _="";if(!f||y<1||y>G)return _;do y%2&&(_+=f),y=Sa(y/2),y&&(f+=f);while(y);return _}function Rt(f,y){return $i(tp(f,y,hs),f+"")}function ei(f){return lo(wp(f))}function my(f,y){var _=wp(f);return np(_,zo(y,0,_.length))}function zl(f,y,_,T){if(!hr(f))return f;y=go(y,f);for(var L=-1,K=y.length,Q=K-1,re=f;re!=null&&++L<K;){var de=Rs(y[L]),De=_;if(de==="__proto__"||de==="constructor"||de==="prototype")return f;if(L!=Q){var Ie=re[de];De=T?T(Ie,de,re):r,De===r&&(De=hr(Ie)?Ie:Un(y[L+1])?[]:{})}kl(re,de,De),re=re[de]}return f}var $f=xf?function(f,y){return xf.set(f,y),f}:hs,po=Dd?function(f,y){return Dd(f,"toString",{configurable:!0,enumerable:!1,value:_C(y),writable:!0})}:hs;function os(f){return np(wp(f))}function ti(f,y,_){var T=-1,L=f.length;y<0&&(y=-y>L?0:L+y),_=_>L?L:_,_<0&&(_+=L),L=y>_?0:_-y>>>0,y>>>=0;for(var K=me(L);++T<L;)K[T]=f[T+y];return K}function vy(f,y){var _;return ho(f,function(T,L,K){return _=y(T,L,K),!_}),!!_}function Qc(f,y,_){var T=0,L=f==null?T:f.length;if(typeof y=="number"&&y===y&&L<=ie){for(;T<L;){var K=T+L>>>1,Q=f[K];Q!==null&&!js(Q)&&(_?Q<=y:Q<y)?T=K+1:L=K}return L}return zf(f,y,hs,_)}function zf(f,y,_,T){var L=0,K=f==null?0:f.length;if(K===0)return 0;y=_(y);for(var Q=y!==y,re=y===null,de=js(y),De=y===r;L<K;){var Ie=Sa((L+K)/2),Pe=_(f[Ie]),Ye=Pe!==r,dt=Pe===null,vt=Pe===Pe,Lt=js(Pe);if(Q)var bt=T||vt;else De?bt=vt&&(T||Ye):re?bt=vt&&Ye&&(T||!dt):de?bt=vt&&Ye&&!dt&&(T||!Lt):dt||Lt?bt=!1:bt=T?Pe<=y:Pe<y;bt?L=Ie+1:K=Ie}return Yr(K,ee)}function by(f,y){for(var _=-1,T=f.length,L=0,K=[];++_<T;){var Q=f[_],re=y?y(Q):Q;if(!_||!Xo(re,de)){var de=re;K[L++]=Q===0?0:Q}}return K}function wy(f){return typeof f=="number"?f:js(f)?ge:+f}function Ni(f){if(typeof f=="string")return f;if(Tt(f))return Pn(f,Ni)+"";if(js(f))return Sf?Sf.call(f):"";var y=f+"";return y=="0"&&1/f==-1/0?"-0":y}function Ko(f,y,_){var T=-1,L=uf,K=f.length,Q=!0,re=[],de=re;if(_)Q=!1,L=qg;else if(K>=s){var De=y?null:_1(f);if(De)return xa(De);Q=!1,L=ko,de=new Pl}else de=y?[]:re;e:for(;++T<K;){var Ie=f[T],Pe=y?y(Ie):Ie;if(Ie=_||Ie!==0?Ie:0,Q&&Pe===Pe){for(var Ye=de.length;Ye--;)if(de[Ye]===Pe)continue e;y&&de.push(Pe),re.push(Ie)}else L(de,Pe,_)||(de!==re&&de.push(Pe),re.push(Ie))}return re}function Vf(f,y){return y=go(y,f),f=Pr(f,y),f==null||delete f[Rs(yi(y))]}function _y(f,y,_,T){return zl(f,y,_(Vo(f,y)),T)}function $d(f,y,_,T){for(var L=f.length,K=T?L:-1;(T?K--:++K<L)&&y(f[K],K,f););return _?ti(f,T?0:K,T?K+1:L):ti(f,T?K+1:0,T?L:K)}function Jc(f,y){var _=f;return _ instanceof Ot&&(_=_.value()),Gg(y,function(T,L){return L.func.apply(L.thisArg,Ea([T],L.args))},_)}function Bf(f,y,_){var T=f.length;if(T<2)return T?Ko(f[0]):[];for(var L=-1,K=me(T);++L<T;)for(var Q=f[L],re=-1;++re<T;)re!=L&&(K[L]=uo(K[L]||Q,f[re],y,_));return Ko(tr(K,1),y,_)}function zd(f,y,_){for(var T=-1,L=f.length,K=y.length,Q={};++T<L;){var re=T<K?y[T]:r;_(Q,f[T],re)}return Q}function eu(f){return Nr(f)?f:[]}function Hf(f){return typeof f=="function"?f:hs}function go(f,y){return Tt(f)?f:et(f,y)?[f]:zy(vn(f))}var f1=Rt;function Wo(f,y,_){var T=f.length;return _=_===r?T:_,!y&&_>=T?f:ti(f,y,_)}var Cy=e1||function(f){return Bn.clearTimeout(f)};function Ey(f,y){if(y)return f.slice();var _=f.length,T=ry?ry(_):new f.constructor(_);return f.copy(T),T}function Vd(f){var y=new f.constructor(f.byteLength);return new Sd(y).set(new Sd(f)),y}function p1(f,y){var _=y?Vd(f.buffer):f.buffer;return new f.constructor(_,f.byteOffset,f.byteLength)}function g1(f){var y=new f.constructor(f.source,kg.exec(f));return y.lastIndex=f.lastIndex,y}function y1(f){return Li?mn(Li.call(f)):{}}function m1(f,y){var _=y?Vd(f.buffer):f.buffer;return new f.constructor(_,f.byteOffset,f.length)}function xy(f,y){if(f!==y){var _=f!==r,T=f===null,L=f===f,K=js(f),Q=y!==r,re=y===null,de=y===y,De=js(y);if(!re&&!De&&!K&&f>y||K&&Q&&de&&!re&&!De||T&&Q&&de||!_&&de||!L)return 1;if(!T&&!K&&!De&&f<y||De&&_&&L&&!T&&!K||re&&_&&L||!Q&&L||!de)return-1}return 0}function Y_(f,y,_){for(var T=-1,L=f.criteria,K=y.criteria,Q=L.length,re=_.length;++T<Q;){var de=xy(L[T],K[T]);if(de){if(T>=re)return de;var De=_[T];return de*(De=="desc"?-1:1)}}return f.index-y.index}function v1(f,y,_,T){for(var L=-1,K=f.length,Q=_.length,re=-1,de=y.length,De=br(K-Q,0),Ie=me(de+De),Pe=!T;++re<de;)Ie[re]=y[re];for(;++L<Q;)(Pe||L<K)&&(Ie[_[L]]=f[L]);for(;De--;)Ie[re++]=f[L++];return Ie}function Sy(f,y,_,T){for(var L=-1,K=f.length,Q=-1,re=_.length,de=-1,De=y.length,Ie=br(K-re,0),Pe=me(Ie+De),Ye=!T;++L<Ie;)Pe[L]=f[L];for(var dt=L;++de<De;)Pe[dt+de]=y[de];for(;++Q<re;)(Ye||L<K)&&(Pe[dt+_[Q]]=f[L++]);return Pe}function fi(f,y){var _=-1,T=f.length;for(y||(y=me(T));++_<T;)y[_]=f[_];return y}function Ts(f,y,_,T){var L=!_;_||(_={});for(var K=-1,Q=y.length;++K<Q;){var re=y[K],de=T?T(_[re],f[re],re,_,f):r;de===r&&(de=f[re]),L?co(_,re,de):kl(_,re,de)}return _}function Uf(f,y){return Ts(f,Ms(f),y)}function X_(f,y){return Ts(f,E1(f),y)}function Kf(f,y){return function(_,T){var L=Tt(_)?Kg:ji,K=y?y():{};return L(_,f,gt(T,2),K)}}function tu(f){return Rt(function(y,_){var T=-1,L=_.length,K=L>1?_[L-1]:r,Q=L>2?_[2]:r;for(K=f.length>3&&typeof K=="function"?(L--,K):r,Q&&gi(_[0],_[1],Q)&&(K=L<3?r:K,L=1),y=mn(y);++T<L;){var re=_[T];re&&f(y,re,T,K)}return y})}function as(f,y){return function(_,T){if(_==null)return _;if(!us(_))return f(_,T);for(var L=_.length,K=y?L:-1,Q=mn(_);(y?K--:++K<L)&&T(Q[K],K,Q)!==!1;);return _}}function Wf(f){return function(y,_,T){for(var L=-1,K=mn(y),Q=T(y),re=Q.length;re--;){var de=Q[f?re:++L];if(_(K[de],de,K)===!1)break}return y}}function qf(f,y,_){var T=y&x,L=nu(f);function K(){var Q=this&&this!==Bn&&this instanceof K?L:f;return Q.apply(T?_:this,arguments)}return K}function Dy(f){return function(y){y=vn(y);var _=kc(y)?ki(y):r,T=_?_[0]:y.charAt(0),L=_?Wo(_,1).join(""):y.slice(1);return T[f]()+L}}function Vl(f){return function(y){return Gg(AT(PT(y).replace(M_,"")),f,"")}}function nu(f){return function(){var y=arguments;switch(y.length){case 0:return new f;case 1:return new f(y[0]);case 2:return new f(y[0],y[1]);case 3:return new f(y[0],y[1],y[2]);case 4:return new f(y[0],y[1],y[2],y[3]);case 5:return new f(y[0],y[1],y[2],y[3],y[4]);case 6:return new f(y[0],y[1],y[2],y[3],y[4],y[5]);case 7:return new f(y[0],y[1],y[2],y[3],y[4],y[5],y[6])}var _=Uc(f.prototype),T=f.apply(_,y);return hr(T)?T:_}}function Ny(f,y,_){var T=nu(f);function L(){for(var K=arguments.length,Q=me(K),re=K,de=qo(L);re--;)Q[re]=arguments[re];var De=K<3&&Q[0]!==de&&Q[K-1]!==de?[]:Qi(Q,de);if(K-=De.length,K<_)return pi(f,y,ru,L.placeholder,r,Q,De,r,r,_-K);var Ie=this&&this!==Bn&&this instanceof L?T:f;return di(Ie,this,Q)}return L}function Bl(f){return function(y,_,T){var L=mn(y);if(!us(y)){var K=gt(_,3);y=ni(y),_=function(re){return K(L[re],re,L)}}var Q=f(y,_,T);return Q>-1?L[K?y[Q]:Q]:r}}function Gf(f){return mo(function(y){var _=y.length,T=_,L=Xr.prototype.thru;for(f&&y.reverse();T--;){var K=y[T];if(typeof K!="function")throw new Ji(a);if(L&&!Q&&iu(K)=="wrapper")var Q=new Xr([],!0)}for(T=Q?T:_;++T<_;){K=y[T];var re=iu(K),de=re=="wrapper"?Zf(K):r;de&&Yd(de[0])&&de[1]==(V|M|A|$)&&!de[4].length&&de[9]==1?Q=Q[iu(de[0])].apply(Q,de[3]):Q=K.length==1&&Yd(K)?Q[re]():Q.thru(K)}return function(){var De=arguments,Ie=De[0];if(Q&&De.length==1&&Tt(Ie))return Q.plant(Ie).value();for(var Pe=0,Ye=_?y[Pe].apply(this,De):Ie;++Pe<_;)Ye=y[Pe].call(this,Ye);return Ye}})}function ru(f,y,_,T,L,K,Q,re,de,De){var Ie=y&V,Pe=y&x,Ye=y&I,dt=y&(M|k),vt=y&W,Lt=Ye?r:nu(f);function bt(){for(var Ht=arguments.length,Zt=me(Ht),Fs=Ht;Fs--;)Zt[Fs]=arguments[Fs];if(dt)var Vi=qo(bt),$s=U0(Zt,Vi);if(T&&(Zt=v1(Zt,T,L,dt)),K&&(Zt=Sy(Zt,K,Q,dt)),Ht-=$s,dt&&Ht<De){var Ir=Qi(Zt,Vi);return pi(f,y,ru,bt.placeholder,_,Zt,Ir,re,de,De-Ht)}var Zo=Pe?_:this,Zl=Ye?Zo[f]:f;return Ht=Zt.length,re?Zt=Ps(Zt,re):vt&&Ht>1&&Zt.reverse(),Ie&&de<Ht&&(Zt.length=de),this&&this!==Bn&&this instanceof bt&&(Zl=Lt||nu(Zl)),Zl.apply(Zo,Zt)}return bt}function b1(f,y){return function(_,T){return Bo(_,f,y(T),{})}}function Bd(f,y){return function(_,T){var L;if(_===r&&T===r)return y;if(_!==r&&(L=_),T!==r){if(L===r)return T;typeof _=="string"||typeof T=="string"?(_=Ni(_),T=Ni(T)):(_=wy(_),T=wy(T)),L=f(_,T)}return L}}function Yf(f){return mo(function(y){return y=Pn(y,Ri(gt())),Rt(function(_){var T=this;return f(y,function(L){return di(L,T,_)})})})}function Hd(f,y){y=y===r?" ":Ni(y);var _=y.length;if(_<2)return _?$l(y,f):y;var T=$l(y,Tl(f/Il(y)));return kc(y)?Wo(ki(T),0,f).join(""):T.slice(0,f)}function w1(f,y,_,T){var L=y&x,K=nu(f);function Q(){for(var re=-1,de=arguments.length,De=-1,Ie=T.length,Pe=me(Ie+de),Ye=this&&this!==Bn&&this instanceof Q?K:f;++De<Ie;)Pe[De]=T[De];for(;de--;)Pe[De++]=arguments[++re];return di(Ye,L?_:this,Pe)}return Q}function Iy(f){return function(y,_,T){return T&&typeof T!="number"&&gi(y,_,T)&&(_=T=r),y=Xl(y),_===r?(_=y,y=0):_=Xl(_),T=T===r?y<_?1:-1:Xl(T),Fd(y,_,T,f)}}function Xf(f){return function(y,_){return typeof y=="string"&&typeof _=="string"||(y=bo(y),_=bo(_)),f(y,_)}}function pi(f,y,_,T,L,K,Q,re,de,De){var Ie=y&M,Pe=Ie?Q:r,Ye=Ie?r:Q,dt=Ie?K:r,vt=Ie?r:K;y|=Ie?A:j,y&=~(Ie?j:A),y&P||(y&=-4);var Lt=[f,y,L,dt,Pe,vt,Ye,re,de,De],bt=_.apply(r,Lt);return Yd(f)&&Fy(bt,Lt),bt.placeholder=T,$y(bt,f,y)}function zr(f){var y=vr[f];return function(_,T){if(_=bo(_),T=T==null?0:Yr(kt(T),292),T&&$c(_)){var L=(vn(_)+"e").split("e"),K=y(L[0]+"e"+(+L[1]+T));return L=(vn(K)+"e").split("e"),+(L[0]+"e"+(+L[1]-T))}return y(_)}}var _1=Da&&1/xa(new Da([,-0]))[1]==q?function(f){return new Da(f)}:xC;function Oy(f){return function(y){var _=Vr(y);return _==_t?ff(y):_==St?H_(y):z_(y,f(y))}}function yo(f,y,_,T,L,K,Q,re){var de=y&I;if(!de&&typeof f!="function")throw new Ji(a);var De=T?T.length:0;if(De||(y&=-97,T=L=r),Q=Q===r?Q:br(kt(Q),0),re=re===r?re:kt(re),De-=L?L.length:0,y&j){var Ie=T,Pe=L;T=L=r}var Ye=de?r:Zf(f),dt=[f,y,_,T,L,Ie,Pe,K,Q,re];if(Ye&&N1(dt,Ye),f=dt[0],y=dt[1],_=dt[2],T=dt[3],L=dt[4],re=dt[9]=dt[9]===r?de?0:f.length:br(dt[9]-De,0),!re&&y&(M|k)&&(y&=-25),!y||y==x)var vt=qf(f,y,_);else y==M||y==k?vt=Ny(f,y,re):(y==A||y==(x|A))&&!L.length?vt=w1(f,y,_,T):vt=ru.apply(r,dt);var Lt=Ye?$f:Fy;return $y(Lt(vt,dt),f,y)}function Ty(f,y,_,T){return f===r||Xo(f,io[_])&&!tn.call(T,_)?y:f}function My(f,y,_,T,L,K){return hr(f)&&hr(y)&&(K.set(y,f),Fl(f,y,r,My,K),K.delete(y)),f}function Py(f){return tm(f)?r:f}function Ay(f,y,_,T,L,K){var Q=_&S,re=f.length,de=y.length;if(re!=de&&!(Q&&de>re))return!1;var De=K.get(f),Ie=K.get(y);if(De&&Ie)return De==y&&Ie==f;var Pe=-1,Ye=!0,dt=_&E?new Pl:r;for(K.set(f,y),K.set(y,f);++Pe<re;){var vt=f[Pe],Lt=y[Pe];if(T)var bt=Q?T(Lt,vt,Pe,y,f,K):T(vt,Lt,Pe,f,y,K);if(bt!==r){if(bt)continue;Ye=!1;break}if(dt){if(!Yg(y,function(Ht,Zt){if(!ko(dt,Zt)&&(vt===Ht||L(vt,Ht,_,T,K)))return dt.push(Zt)})){Ye=!1;break}}else if(!(vt===Lt||L(vt,Lt,_,T,K))){Ye=!1;break}}return K.delete(f),K.delete(y),Ye}function Ry(f,y,_,T,L,K,Q){switch(_){case At:if(f.byteLength!=y.byteLength||f.byteOffset!=y.byteOffset)return!1;f=f.buffer,y=y.buffer;case dn:return!(f.byteLength!=y.byteLength||!K(new Sd(f),new Sd(y)));case be:case Oe:case Ge:return Xo(+f,+y);case Le:return f.name==y.name&&f.message==y.message;case yt:case Bt:return f==y+"";case _t:var re=ff;case St:var de=T&S;if(re||(re=xa),f.size!=y.size&&!de)return!1;var De=Q.get(f);if(De)return De==y;T|=E,Q.set(f,y);var Ie=Ay(re(f),re(y),T,L,K,Q);return Q.delete(f),Ie;case Nt:if(Li)return Li.call(f)==Li.call(y)}return!1}function C1(f,y,_,T,L,K){var Q=_&S,re=Ud(f),de=re.length,De=Ud(y),Ie=De.length;if(de!=Ie&&!Q)return!1;for(var Pe=de;Pe--;){var Ye=re[Pe];if(!(Q?Ye in y:tn.call(y,Ye)))return!1}var dt=K.get(f),vt=K.get(y);if(dt&&vt)return dt==y&&vt==f;var Lt=!0;K.set(f,y),K.set(y,f);for(var bt=Q;++Pe<de;){Ye=re[Pe];var Ht=f[Ye],Zt=y[Ye];if(T)var Fs=Q?T(Zt,Ht,Ye,y,f,K):T(Ht,Zt,Ye,f,y,K);if(!(Fs===r?Ht===Zt||L(Ht,Zt,_,T,K):Fs)){Lt=!1;break}bt||(bt=Ye=="constructor")}if(Lt&&!bt){var Vi=f.constructor,$s=y.constructor;Vi!=$s&&"constructor"in f&&"constructor"in y&&!(typeof Vi=="function"&&Vi instanceof Vi&&typeof $s=="function"&&$s instanceof $s)&&(Lt=!1)}return K.delete(f),K.delete(y),Lt}function mo(f){return $i(tp(f,r,ip),f+"")}function Ud(f){return Af(f,ni,Ms)}function Kd(f){return Af(f,ds,E1)}var Zf=xf?function(f){return xf.get(f)}:xC;function iu(f){for(var y=f.name+"",_=Bc[y],T=tn.call(Bc,y)?_.length:0;T--;){var L=_[T],K=L.func;if(K==null||K==f)return L.name}return y}function qo(f){var y=tn.call(U,"placeholder")?U:f;return y.placeholder}function gt(){var f=U.iteratee||CC;return f=f===CC?Xc:f,arguments.length?f(arguments[0],arguments[1]):f}function Wd(f,y){var _=f.__data__;return su(y)?_[typeof y=="string"?"string":"hash"]:_.map}function qd(f){for(var y=ni(f),_=y.length;_--;){var T=y[_],L=f[T];y[_]=[T,L,Xd(L)]}return y}function ka(f,y){var _=Rc(f,y);return hy(_)?_:r}function Qf(f){var y=tn.call(f,Ol),_=f[Ol];try{f[Ol]=r;var T=!0}catch{}var L=Ed.call(f);return T&&(y?f[Ol]=_:delete f[Ol]),L}var Ms=_f?function(f){return f==null?[]:(f=mn(f),Ca(_f(f),function(y){return bf.call(f,y)}))}:SC,E1=_f?function(f){for(var y=[];f;)Ea(y,Ms(f)),f=Is(f);return y}:SC,Vr=$r;(Id&&Vr(new Id(new ArrayBuffer(1)))!=At||Ml&&Vr(new Ml)!=_t||Od&&Vr(Od.resolve())!=zt||Da&&Vr(new Da)!=St||Td&&Vr(new Td)!=It)&&(Vr=function(f){var y=$r(f),_=y==Ke?f.constructor:r,T=_?La(_):"";if(T)switch(T){case oy:return At;case Na:return _t;case n1:return zt;case Hc:return St;case so:return It}return y});function ky(f,y,_){for(var T=-1,L=_.length;++T<L;){var K=_[T],Q=K.size;switch(K.type){case"drop":f+=Q;break;case"dropRight":y-=Q;break;case"take":y=Yr(y,f+Q);break;case"takeRight":f=br(f,y-Q);break}}return{start:f,end:y}}function x1(f){var y=f.match(to);return y?y[1].split(Ro):[]}function Ly(f,y,_){y=go(y,f);for(var T=-1,L=y.length,K=!1;++T<L;){var Q=Rs(y[T]);if(!(K=f!=null&&_(f,Q)))break;f=f[Q]}return K||++T!=L?K:(L=f==null?0:f.length,!!L&&U1(L)&&Un(Q,L)&&(Tt(f)||ih(f)))}function Gd(f){var y=f.length,_=new f.constructor(y);return y&&typeof f[0]=="string"&&tn.call(f,"index")&&(_.index=f.index,_.input=f.input),_}function Br(f){return typeof f.constructor=="function"&&!Go(f)?Uc(Is(f)):{}}function Z_(f,y,_){var T=f.constructor;switch(y){case dn:return Vd(f);case be:case Oe:return new T(+f);case At:return p1(f,_);case mr:case Er:case Mn:case ce:case fe:case _e:case ze:case it:case Gt:return m1(f,_);case _t:return new T;case Ge:case Bt:return new T(f);case yt:return g1(f);case St:return new T;case Nt:return y1(f)}}function Q_(f,y){var _=y.length;if(!_)return f;var T=_-1;return y[T]=(_>1?"& ":"")+y[T],y=y.join(_>2?", ":" "),f.replace(Cl,`{
|
||
/* [wrapped with `+y+`] */
|
||
`)}function Jf(f){return Tt(f)||ih(f)||!!(J0&&f&&f[J0])}function Un(f,y){var _=typeof f;return y=y??G,!!y&&(_=="number"||_!="symbol"&&C0.test(f))&&f>-1&&f%1==0&&f<y}function gi(f,y,_){if(!hr(_))return!1;var T=typeof y;return(T=="number"?us(_)&&Un(y,_.length):T=="string"&&y in _)?Xo(_[y],f):!1}function et(f,y){if(Tt(f))return!1;var _=typeof f;return _=="number"||_=="symbol"||_=="boolean"||f==null||js(f)?!0:xs.test(f)||!Fr.test(f)||y!=null&&f in mn(y)}function su(f){var y=typeof f;return y=="string"||y=="number"||y=="symbol"||y=="boolean"?f!=="__proto__":f===null}function Yd(f){var y=iu(f),_=U[y];if(typeof _!="function"||!(y in Ot.prototype))return!1;if(f===_)return!0;var T=Zf(_);return!!T&&f===T[0]}function S1(f){return!!yf&&yf in f}var J_=jc?Yl:DC;function Go(f){var y=f&&f.constructor,_=typeof y=="function"&&y.prototype||io;return f===_}function Xd(f){return f===f&&!hr(f)}function ep(f,y){return function(_){return _==null?!1:_[f]===y&&(y!==r||f in mn(_))}}function D1(f){var y=pe(f,function(T){return _.size===h&&_.clear(),T}),_=y.cache;return y}function N1(f,y){var _=f[1],T=y[1],L=_|T,K=L<(x|I|V),Q=T==V&&_==M||T==V&&_==$&&f[7].length<=y[8]||T==(V|$)&&y[7].length<=y[8]&&_==M;if(!(K||Q))return f;T&x&&(f[2]=y[2],L|=_&x?0:P);var re=y[3];if(re){var de=f[3];f[3]=de?v1(de,re,y[4]):re,f[4]=de?Qi(f[3],p):y[4]}return re=y[5],re&&(de=f[5],f[5]=de?Sy(de,re,y[6]):re,f[6]=de?Qi(f[5],p):y[6]),re=y[7],re&&(f[7]=re),T&V&&(f[8]=f[8]==null?y[8]:Yr(f[8],y[8])),f[9]==null&&(f[9]=y[9]),f[0]=y[0],f[1]=L,f}function I1(f){var y=[];if(f!=null)for(var _ in mn(f))y.push(_);return y}function jy(f){return Ed.call(f)}function tp(f,y,_){return y=br(y===r?f.length-1:y,0),function(){for(var T=arguments,L=-1,K=br(T.length-y,0),Q=me(K);++L<K;)Q[L]=T[y+L];L=-1;for(var re=me(y+1);++L<y;)re[L]=T[L];return re[y]=_(Q),di(f,this,re)}}function Pr(f,y){return y.length<2?f:Vo(f,ti(y,0,-1))}function Ps(f,y){for(var _=f.length,T=Yr(y.length,_),L=fi(f);T--;){var K=y[T];f[T]=Un(K,_)?L[K]:r}return f}function vo(f,y){if(!(y==="constructor"&&typeof f[y]=="function")&&y!="__proto__")return f[y]}var Fy=As($f),ou=iy||function(f,y){return Bn.setTimeout(f,y)},$i=As(po);function $y(f,y,_){var T=y+"";return $i(f,Q_(T,O1(x1(T),_)))}function As(f){var y=0,_=0;return function(){var T=G_(),L=te-(T-_);if(_=T,L>0){if(++y>=Y)return arguments[0]}else y=0;return f.apply(r,arguments)}}function np(f,y){var _=-1,T=f.length,L=T-1;for(y=y===r?T:y;++_<y;){var K=Zc(_,L),Q=f[K];f[K]=f[_],f[_]=Q}return f.length=y,f}var zy=D1(function(f){var y=[];return f.charCodeAt(0)===46&&y.push(""),f.replace(xr,function(_,T,L,K){y.push(L?K.replace(S_,"$1"):T||_)}),y});function Rs(f){if(typeof f=="string"||js(f))return f;var y=f+"";return y=="0"&&1/f==-1/0?"-0":y}function La(f){if(f!=null){try{return Cd.call(f)}catch{}try{return f+""}catch{}}return""}function O1(f,y){return Gr(we,function(_){var T="_."+_[0];y&_[1]&&!uf(f,T)&&f.push(T)}),f.sort()}function T1(f){if(f instanceof Ot)return f.clone();var y=new Xr(f.__wrapped__,f.__chain__);return y.__actions__=fi(f.__actions__),y.__index__=f.__index__,y.__values__=f.__values__,y}function rp(f,y,_){(_?gi(f,y,_):y===r)?y=1:y=br(kt(y),0);var T=f==null?0:f.length;if(!T||y<1)return[];for(var L=0,K=0,Q=me(Tl(T/y));L<T;)Q[K++]=ti(f,L,L+=y);return Q}function Vy(f){for(var y=-1,_=f==null?0:f.length,T=0,L=[];++y<_;){var K=f[y];K&&(L[T++]=K)}return L}function ls(){var f=arguments.length;if(!f)return[];for(var y=me(f-1),_=arguments[0],T=f;T--;)y[T-1]=arguments[T];return Ea(Tt(_)?fi(_):[_],tr(y,1))}var Xt=Rt(function(f,y){return Nr(f)?uo(f,tr(y,1,Nr,!0)):[]}),Ar=Rt(function(f,y){var _=yi(y);return Nr(_)&&(_=r),Nr(f)?uo(f,tr(y,1,Nr,!0),gt(_,2)):[]}),wr=Rt(function(f,y){var _=yi(y);return Nr(_)&&(_=r),Nr(f)?uo(f,tr(y,1,Nr,!0),r,_):[]});function Hr(f,y,_){var T=f==null?0:f.length;return T?(y=_||y===r?1:kt(y),ti(f,y<0?0:y,T)):[]}function zi(f,y,_){var T=f==null?0:f.length;return T?(y=_||y===r?1:kt(y),y=T-y,ti(f,0,y<0?0:y)):[]}function au(f,y){return f&&f.length?$d(f,gt(y,3),!0,!0):[]}function Dr(f,y){return f&&f.length?$d(f,gt(y,3),!0):[]}function Zd(f,y,_,T){var L=f==null?0:f.length;return L?(_&&typeof _!="number"&&gi(f,y,_)&&(_=0,T=L),u1(f,y,_,T)):[]}function ja(f,y,_){var T=f==null?0:f.length;if(!T)return-1;var L=_==null?0:kt(_);return L<0&&(L=br(T+L,0)),df(f,gt(y,3),L)}function Qd(f,y,_){var T=f==null?0:f.length;if(!T)return-1;var L=T-1;return _!==r&&(L=kt(_),L=_<0?br(T+L,0):Yr(L,T-1)),df(f,gt(y,3),L,!0)}function ip(f){var y=f==null?0:f.length;return y?tr(f,1):[]}function Jd(f){var y=f==null?0:f.length;return y?tr(f,q):[]}function Ii(f,y){var _=f==null?0:f.length;return _?(y=y===r?1:kt(y),tr(f,y)):[]}function By(f){for(var y=-1,_=f==null?0:f.length,T={};++y<_;){var L=f[y];T[L[0]]=L[1]}return T}function Hl(f){return f&&f.length?f[0]:r}function Yo(f,y,_){var T=f==null?0:f.length;if(!T)return-1;var L=_==null?0:kt(_);return L<0&&(L=br(T+L,0)),Ac(f,y,L)}function sp(f){var y=f==null?0:f.length;return y?ti(f,0,-1):[]}var Hy=Rt(function(f){var y=Pn(f,eu);return y.length&&y[0]===f[0]?Rf(y):[]}),Fa=Rt(function(f){var y=yi(f),_=Pn(f,eu);return y===yi(_)?y=r:_.pop(),_.length&&_[0]===f[0]?Rf(_,gt(y,2)):[]}),op=Rt(function(f){var y=yi(f),_=Pn(f,eu);return y=typeof y=="function"?y:r,y&&_.pop(),_.length&&_[0]===f[0]?Rf(_,r,y):[]});function $a(f,y){return f==null?"":Cf.call(f,y)}function yi(f){var y=f==null?0:f.length;return y?f[y-1]:r}function eh(f,y,_){var T=f==null?0:f.length;if(!T)return-1;var L=T;return _!==r&&(L=kt(_),L=L<0?br(T+L,0):Yr(L,T-1)),y===y?U_(f,y,L):df(f,$0,L,!0)}function Uy(f,y){return f&&f.length?Ff(f,kt(y)):r}var ap=Rt(th);function th(f,y){return f&&f.length&&y&&y.length?ur(f,y):f}function mi(f,y,_){return f&&f.length&&y&&y.length?ur(f,y,gt(_,2)):f}function za(f,y,_){return f&&f.length&&y&&y.length?ur(f,y,r,_):f}var ks=mo(function(f,y){var _=f==null?0:f.length,T=Mf(f,y);return Sr(f,Pn(y,function(L){return Un(L,_)?+L:L}).sort(xy)),T});function Oi(f,y){var _=[];if(!(f&&f.length))return _;var T=-1,L=[],K=f.length;for(y=gt(y,3);++T<K;){var Q=f[T];y(Q,T,f)&&(_.push(Q),L.push(T))}return Sr(f,L),_}function lp(f){return f==null?f:Ef.call(f)}function Ky(f,y,_){var T=f==null?0:f.length;return T?(_&&typeof _!="number"&&gi(f,y,_)?(y=0,_=T):(y=y==null?0:kt(y),_=_===r?T:kt(_)),ti(f,y,_)):[]}function Wy(f,y){return Qc(f,y)}function eC(f,y,_){return zf(f,y,gt(_,2))}function Va(f,y){var _=f==null?0:f.length;if(_){var T=Qc(f,y);if(T<_&&Xo(f[T],y))return T}return-1}function M1(f,y){return Qc(f,y,!0)}function qy(f,y,_){return zf(f,y,gt(_,2),!0)}function Ul(f,y){var _=f==null?0:f.length;if(_){var T=Qc(f,y,!0)-1;if(Xo(f[T],y))return T}return-1}function Gy(f){return f&&f.length?by(f):[]}function Kl(f,y){return f&&f.length?by(f,gt(y,2)):[]}function P1(f){var y=f==null?0:f.length;return y?ti(f,1,y):[]}function A1(f,y,_){return f&&f.length?(y=_||y===r?1:kt(y),ti(f,0,y<0?0:y)):[]}function Yy(f,y,_){var T=f==null?0:f.length;return T?(y=_||y===r?1:kt(y),y=T-y,ti(f,y<0?0:y,T)):[]}function cp(f,y){return f&&f.length?$d(f,gt(y,3),!1,!0):[]}function tC(f,y){return f&&f.length?$d(f,gt(y,3)):[]}var nC=Rt(function(f){return Ko(tr(f,1,Nr,!0))}),R1=Rt(function(f){var y=yi(f);return Nr(y)&&(y=r),Ko(tr(f,1,Nr,!0),gt(y,2))}),k1=Rt(function(f){var y=yi(f);return y=typeof y=="function"?y:r,Ko(tr(f,1,Nr,!0),r,y)});function Wl(f){return f&&f.length?Ko(f):[]}function rC(f,y){return f&&f.length?Ko(f,gt(y,2)):[]}function lu(f,y){return y=typeof y=="function"?y:r,f&&f.length?Ko(f,r,y):[]}function up(f){if(!(f&&f.length))return[];var y=0;return f=Ca(f,function(_){if(Nr(_))return y=br(_.length,y),!0}),Jg(y,function(_){return Pn(f,Zg(_))})}function Xn(f,y){if(!(f&&f.length))return[];var _=up(f);return y==null?_:Pn(_,function(T){return di(y,r,T)})}var iC=Rt(function(f,y){return Nr(f)?uo(f,y):[]}),L1=Rt(function(f){return Bf(Ca(f,Nr))}),sC=Rt(function(f){var y=yi(f);return Nr(y)&&(y=r),Bf(Ca(f,Nr),gt(y,2))}),oC=Rt(function(f){var y=yi(f);return y=typeof y=="function"?y:r,Bf(Ca(f,Nr),r,y)}),j1=Rt(up);function F1(f,y){return zd(f||[],y||[],kl)}function aC(f,y){return zd(f||[],y||[],zl)}var cs=Rt(function(f){var y=f.length,_=y>1?f[y-1]:r;return _=typeof _=="function"?(f.pop(),_):r,Xn(f,_)});function dp(f){var y=U(f);return y.__chain__=!0,y}function lC(f,y){return y(f),f}function Ls(f,y){return y(f)}var hp=mo(function(f){var y=f.length,_=y?f[0]:0,T=this.__wrapped__,L=function(K){return Mf(K,f)};return y>1||this.__actions__.length||!(T instanceof Ot)||!Un(_)?this.thru(L):(T=T.slice(_,+_+(y?1:0)),T.__actions__.push({func:Ls,args:[L],thisArg:r}),new Xr(T,this.__chain__).thru(function(K){return y&&!K.length&&K.push(r),K}))});function ql(){return dp(this)}function fp(){return new Xr(this.value(),this.__chain__)}function Xy(){this.__values__===r&&(this.__values__=ET(this.value()));var f=this.__index__>=this.__values__.length,y=f?r:this.__values__[this.__index__++];return{done:f,value:y}}function Zy(){return this}function cC(f){for(var y,_=this;_ instanceof oo;){var T=T1(_);T.__index__=0,T.__values__=r,y?L.__wrapped__=T:y=T;var L=T;_=_.__wrapped__}return L.__wrapped__=f,y}function Qy(){var f=this.__wrapped__;if(f instanceof Ot){var y=f;return this.__actions__.length&&(y=new Ot(this)),y=y.reverse(),y.__actions__.push({func:Ls,args:[lp],thisArg:r}),new Xr(y,this.__chain__)}return this.thru(lp)}function uC(){return Jc(this.__wrapped__,this.__actions__)}var $1=Kf(function(f,y,_){tn.call(f,_)?++f[_]:co(f,_,1)});function z1(f,y,_){var T=Tt(f)?Wg:Ad;return _&&gi(f,y,_)&&(y=r),T(f,gt(y,3))}function pp(f,y){var _=Tt(f)?Ca:uy;return _(f,gt(y,3))}var gp=Bl(ja),V1=Bl(Qd);function Jy(f,y){return tr(Gl(f,y),1)}function dC(f,y){return tr(Gl(f,y),q)}function B1(f,y,_){return _=_===r?1:kt(_),tr(Gl(f,y),_)}function yp(f,y){var _=Tt(f)?Gr:ho;return _(f,gt(y,3))}function nh(f,y){var _=Tt(f)?cf:c1;return _(f,gt(y,3))}var em=Kf(function(f,y,_){tn.call(f,_)?f[_].push(y):co(f,_,[y])});function mp(f,y,_,T){f=us(f)?f:wp(f),_=_&&!T?kt(_):0;var L=f.length;return _<0&&(_=br(L+_,0)),K1(f)?_<=L&&f.indexOf(y,_)>-1:!!L&&Ac(f,y,_)>-1}var H1=Rt(function(f,y,_){var T=-1,L=typeof y=="function",K=us(f)?me(f.length):[];return ho(f,function(Q){K[++T]=L?di(y,Q,_):is(Q,y,_)}),K}),hC=Kf(function(f,y,_){co(f,_,y)});function Gl(f,y){var _=Tt(f)?Pn:py;return _(f,gt(y,3))}function fC(f,y,_,T){return f==null?[]:(Tt(y)||(y=y==null?[]:[y]),_=T?r:_,Tt(_)||(_=_==null?[]:[_]),jd(f,y,_))}var rh=Kf(function(f,y,_){f[_?0:1].push(y)},function(){return[[],[]]});function pC(f,y,_){var T=Tt(f)?Gg:V0,L=arguments.length<3;return T(f,gt(y,4),_,L,ho)}function vp(f,y,_){var T=Tt(f)?L_:V0,L=arguments.length<3;return T(f,gt(y,4),_,L,c1)}function c(f,y){var _=Tt(f)?Ca:uy;return _(f,Fe(gt(y,3)))}function d(f){var y=Tt(f)?lo:ei;return y(f)}function m(f,y,_){(_?gi(f,y,_):y===r)?y=1:y=kt(y);var T=Tt(f)?Rl:my;return T(f,y)}function b(f){var y=Tt(f)?a1:os;return y(f)}function N(f){if(f==null)return 0;if(us(f))return K1(f)?Il(f):f.length;var y=Vr(f);return y==_t||y==St?f.size:Uo(f).length}function O(f,y,_){var T=Tt(f)?Yg:vy;return _&&gi(f,y,_)&&(y=r),T(f,gt(y,3))}var z=Rt(function(f,y){if(f==null)return[];var _=y.length;return _>1&&gi(f,y[0],y[1])?y=[]:_>2&&gi(y[0],y[1],y[2])&&(y=[y[0]]),jd(f,tr(y,1),[])}),Z=Ln||function(){return Bn.Date.now()};function ne(f,y){if(typeof y!="function")throw new Ji(a);return f=kt(f),function(){if(--f<1)return y.apply(this,arguments)}}function ve(f,y,_){return y=_?r:y,y=f&&y==null?f.length:y,yo(f,V,r,r,r,r,y)}function Me(f,y){var _;if(typeof y!="function")throw new Ji(a);return f=kt(f),function(){return--f>0&&(_=y.apply(this,arguments)),f<=1&&(y=r),_}}var Ae=Rt(function(f,y,_){var T=x;if(_.length){var L=Qi(_,qo(Ae));T|=A}return yo(f,T,y,_,L)}),Te=Rt(function(f,y,_){var T=x|I;if(_.length){var L=Qi(_,qo(Te));T|=A}return yo(y,T,f,_,L)});function Ze(f,y,_){y=_?r:y;var T=yo(f,M,r,r,r,r,r,y);return T.placeholder=Ze.placeholder,T}function nt(f,y,_){y=_?r:y;var T=yo(f,k,r,r,r,r,r,y);return T.placeholder=nt.placeholder,T}function st(f,y,_){var T,L,K,Q,re,de,De=0,Ie=!1,Pe=!1,Ye=!0;if(typeof f!="function")throw new Ji(a);y=bo(y)||0,hr(_)&&(Ie=!!_.leading,Pe="maxWait"in _,K=Pe?br(bo(_.maxWait)||0,y):K,Ye="trailing"in _?!!_.trailing:Ye);function dt(Ir){var Zo=T,Zl=L;return T=L=r,De=Ir,Q=f.apply(Zl,Zo),Q}function vt(Ir){return De=Ir,re=ou(Ht,y),Ie?dt(Ir):Q}function Lt(Ir){var Zo=Ir-de,Zl=Ir-De,LT=y-Zo;return Pe?Yr(LT,K-Zl):LT}function bt(Ir){var Zo=Ir-de,Zl=Ir-De;return de===r||Zo>=y||Zo<0||Pe&&Zl>=K}function Ht(){var Ir=Z();if(bt(Ir))return Zt(Ir);re=ou(Ht,Lt(Ir))}function Zt(Ir){return re=r,Ye&&T?dt(Ir):(T=L=r,Q)}function Fs(){re!==r&&Cy(re),De=0,T=de=L=re=r}function Vi(){return re===r?Q:Zt(Z())}function $s(){var Ir=Z(),Zo=bt(Ir);if(T=arguments,L=this,de=Ir,Zo){if(re===r)return vt(de);if(Pe)return Cy(re),re=ou(Ht,y),dt(de)}return re===r&&(re=ou(Ht,y)),Q}return $s.cancel=Fs,$s.flush=Vi,$s}var dr=Rt(function(f,y){return cy(f,1,y)}),he=Rt(function(f,y,_){return cy(f,bo(y)||0,_)});function se(f){return yo(f,W)}function pe(f,y){if(typeof f!="function"||y!=null&&typeof y!="function")throw new Ji(a);var _=function(){var T=arguments,L=y?y.apply(this,T):T[0],K=_.cache;if(K.has(L))return K.get(L);var Q=f.apply(this,T);return _.cache=K.set(L,Q)||K,Q};return _.cache=new(pe.Cache||es),_}pe.Cache=es;function Fe(f){if(typeof f!="function")throw new Ji(a);return function(){var y=arguments;switch(y.length){case 0:return!f.call(this);case 1:return!f.call(this,y[0]);case 2:return!f.call(this,y[0],y[1]);case 3:return!f.call(this,y[0],y[1],y[2])}return!f.apply(this,y)}}function ut(f){return Me(2,f)}var pt=f1(function(f,y){y=y.length==1&&Tt(y[0])?Pn(y[0],Ri(gt())):Pn(tr(y,1),Ri(gt()));var _=y.length;return Rt(function(T){for(var L=-1,K=Yr(T.length,_);++L<K;)T[L]=y[L].call(this,T[L]);return di(f,this,T)})}),ht=Rt(function(f,y){var _=Qi(y,qo(ht));return yo(f,A,r,y,_)}),mt=Rt(function(f,y){var _=Qi(y,qo(mt));return yo(f,j,r,y,_)}),Rr=mo(function(f,y){return yo(f,$,r,r,r,y)});function nn(f,y){if(typeof f!="function")throw new Ji(a);return y=y===r?y:kt(y),Rt(f,y)}function Ba(f,y){if(typeof f!="function")throw new Ji(a);return y=y==null?0:br(kt(y),0),Rt(function(_){var T=_[y],L=Wo(_,0,y);return T&&Ea(L,T),di(f,this,L)})}function gC(f,y,_){var T=!0,L=!0;if(typeof f!="function")throw new Ji(a);return hr(_)&&(T="leading"in _?!!_.leading:T,L="trailing"in _?!!_.trailing:L),st(f,y,{leading:T,maxWait:y,trailing:L})}function M$(f){return ve(f,1)}function P$(f,y){return ht(Hf(y),f)}function A$(){if(!arguments.length)return[];var f=arguments[0];return Tt(f)?f:[f]}function R$(f){return Di(f,w)}function k$(f,y){return y=typeof y=="function"?y:r,Di(f,w,y)}function L$(f){return Di(f,g|w)}function j$(f,y){return y=typeof y=="function"?y:r,Di(f,g|w,y)}function F$(f,y){return y==null||Pd(f,y,ni(y))}function Xo(f,y){return f===y||f!==f&&y!==y}var $$=Xf(Pa),z$=Xf(function(f,y){return f>=y}),ih=kf(function(){return arguments}())?kf:function(f){return _r(f)&&tn.call(f,"callee")&&!bf.call(f,"callee")},Tt=me.isArray,V$=Ug?Ri(Ug):d1;function us(f){return f!=null&&U1(f.length)&&!Yl(f)}function Nr(f){return _r(f)&&us(f)}function B$(f){return f===!0||f===!1||_r(f)&&$r(f)==be}var cu=sy||DC,H$=Ci?Ri(Ci):Ho;function U$(f){return _r(f)&&f.nodeType===1&&!tm(f)}function K$(f){if(f==null)return!0;if(us(f)&&(Tt(f)||typeof f=="string"||typeof f.splice=="function"||cu(f)||bp(f)||ih(f)))return!f.length;var y=Vr(f);if(y==_t||y==St)return!f.size;if(Go(f))return!Uo(f).length;for(var _ in f)if(tn.call(f,_))return!1;return!0}function W$(f,y){return ss(f,y)}function q$(f,y,_){_=typeof _=="function"?_:r;var T=_?_(f,y):r;return T===r?ss(f,y,r,_):!!T}function yC(f){if(!_r(f))return!1;var y=$r(f);return y==Le||y==Ee||typeof f.message=="string"&&typeof f.name=="string"&&!tm(f)}function G$(f){return typeof f=="number"&&$c(f)}function Yl(f){if(!hr(f))return!1;var y=$r(f);return y==tt||y==Pt||y==Re||y==kn}function bT(f){return typeof f=="number"&&f==kt(f)}function U1(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=G}function hr(f){var y=typeof f;return f!=null&&(y=="object"||y=="function")}function _r(f){return f!=null&&typeof f=="object"}var wT=Nl?Ri(Nl):h1;function Y$(f,y){return f===y||Yc(f,y,qd(y))}function X$(f,y,_){return _=typeof _=="function"?_:r,Yc(f,y,qd(y),_)}function Z$(f){return _T(f)&&f!=+f}function Q$(f){if(J_(f))throw new Ct(o);return hy(f)}function J$(f){return f===null}function ez(f){return f==null}function _T(f){return typeof f=="number"||_r(f)&&$r(f)==Ge}function tm(f){if(!_r(f)||$r(f)!=Ke)return!1;var y=Is(f);if(y===null)return!0;var _=tn.call(y,"constructor")&&y.constructor;return typeof _=="function"&&_ instanceof _&&Cd.call(_)==mf}var mC=lf?Ri(lf):kd;function tz(f){return bT(f)&&f>=-9007199254740991&&f<=G}var CT=Pc?Ri(Pc):fo;function K1(f){return typeof f=="string"||!Tt(f)&&_r(f)&&$r(f)==Bt}function js(f){return typeof f=="symbol"||_r(f)&&$r(f)==Nt}var bp=L0?Ri(L0):Ld;function nz(f){return f===r}function rz(f){return _r(f)&&Vr(f)==It}function iz(f){return _r(f)&&$r(f)==ci}var sz=Xf(Aa),oz=Xf(function(f,y){return f<=y});function ET(f){if(!f)return[];if(us(f))return K1(f)?ki(f):fi(f);if(Fo&&f[Fo])return B_(f[Fo]());var y=Vr(f),_=y==_t?ff:y==St?xa:wp;return _(f)}function Xl(f){if(!f)return f===0?f:0;if(f=bo(f),f===q||f===-1/0){var y=f<0?-1:1;return y*ae}return f===f?f:0}function kt(f){var y=Xl(f),_=y%1;return y===y?_?y-_:y:0}function xT(f){return f?zo(kt(f),0,X):0}function bo(f){if(typeof f=="number")return f;if(js(f))return ge;if(hr(f)){var y=typeof f.valueOf=="function"?f.valueOf():f;f=hr(y)?y+"":y}if(typeof f!="string")return f===0?f:+f;f=B0(f);var _=D_.test(f);return _||_0.test(f)?of(f.slice(2),_?2:8):b0.test(f)?ge:+f}function ST(f){return Ts(f,ds(f))}function az(f){return f?zo(kt(f),-9007199254740991,G):f===0?f:0}function vn(f){return f==null?"":Ni(f)}var lz=tu(function(f,y){if(Go(y)||us(y)){Ts(y,ni(y),f);return}for(var _ in y)tn.call(y,_)&&kl(f,_,y[_])}),DT=tu(function(f,y){Ts(y,ds(y),f)}),W1=tu(function(f,y,_,T){Ts(y,ds(y),f,T)}),cz=tu(function(f,y,_,T){Ts(y,ni(y),f,T)}),uz=mo(Mf);function dz(f,y){var _=Uc(f);return y==null?_:Fn(_,y)}var hz=Rt(function(f,y){f=mn(f);var _=-1,T=y.length,L=T>2?y[2]:r;for(L&&gi(y[0],y[1],L)&&(T=1);++_<T;)for(var K=y[_],Q=ds(K),re=-1,de=Q.length;++re<de;){var De=Q[re],Ie=f[De];(Ie===r||Xo(Ie,io[De])&&!tn.call(f,De))&&(f[De]=K[De])}return f}),fz=Rt(function(f){return f.push(r,My),di(NT,r,f)});function pz(f,y){return F0(f,gt(y,3),Fi)}function gz(f,y){return F0(f,gt(y,3),Ma)}function yz(f,y){return f==null?f:Pf(f,gt(y,3),ds)}function mz(f,y){return f==null?f:Rd(f,gt(y,3),ds)}function vz(f,y){return f&&Fi(f,gt(y,3))}function bz(f,y){return f&&Ma(f,gt(y,3))}function wz(f){return f==null?[]:Gc(f,ni(f))}function _z(f){return f==null?[]:Gc(f,ds(f))}function vC(f,y,_){var T=f==null?r:Vo(f,y);return T===r?_:T}function Cz(f,y){return f!=null&&Ly(f,y,rs)}function bC(f,y){return f!=null&&Ly(f,y,jl)}var Ez=b1(function(f,y,_){y!=null&&typeof y.toString!="function"&&(y=Ed.call(y)),f[y]=_},_C(hs)),xz=b1(function(f,y,_){y!=null&&typeof y.toString!="function"&&(y=Ed.call(y)),tn.call(f,y)?f[y].push(_):f[y]=[_]},gt),Sz=Rt(is);function ni(f){return us(f)?ao(f):Uo(f)}function ds(f){return us(f)?ao(f,!0):fy(f)}function Dz(f,y){var _={};return y=gt(y,3),Fi(f,function(T,L,K){co(_,y(T,L,K),T)}),_}function Nz(f,y){var _={};return y=gt(y,3),Fi(f,function(T,L,K){co(_,L,y(T,L,K))}),_}var Iz=tu(function(f,y,_){Fl(f,y,_)}),NT=tu(function(f,y,_,T){Fl(f,y,_,T)}),Oz=mo(function(f,y){var _={};if(f==null)return _;var T=!1;y=Pn(y,function(K){return K=go(K,f),T||(T=K.length>1),K}),Ts(f,Kd(f),_),T&&(_=Di(_,g|v|w,Py));for(var L=y.length;L--;)Vf(_,y[L]);return _});function Tz(f,y){return IT(f,Fe(gt(y)))}var Mz=mo(function(f,y){return f==null?{}:yy(f,y)});function IT(f,y){if(f==null)return{};var _=Pn(Kd(f),function(T){return[T]});return y=gt(y),Ra(f,_,function(T,L){return y(T,L[0])})}function Pz(f,y,_){y=go(y,f);var T=-1,L=y.length;for(L||(L=1,f=r);++T<L;){var K=f==null?r:f[Rs(y[T])];K===r&&(T=L,K=_),f=Yl(K)?K.call(f):K}return f}function Az(f,y,_){return f==null?f:zl(f,y,_)}function Rz(f,y,_,T){return T=typeof T=="function"?T:r,f==null?f:zl(f,y,_,T)}var OT=Oy(ni),TT=Oy(ds);function kz(f,y,_){var T=Tt(f),L=T||cu(f)||bp(f);if(y=gt(y,4),_==null){var K=f&&f.constructor;L?_=T?new K:[]:hr(f)?_=Yl(K)?Uc(Is(f)):{}:_={}}return(L?Gr:Fi)(f,function(Q,re,de){return y(_,Q,re,de)}),_}function Lz(f,y){return f==null?!0:Vf(f,y)}function jz(f,y,_){return f==null?f:_y(f,y,Hf(_))}function Fz(f,y,_,T){return T=typeof T=="function"?T:r,f==null?f:_y(f,y,Hf(_),T)}function wp(f){return f==null?[]:wd(f,ni(f))}function $z(f){return f==null?[]:wd(f,ds(f))}function zz(f,y,_){return _===r&&(_=y,y=r),_!==r&&(_=bo(_),_=_===_?_:0),y!==r&&(y=bo(y),y=y===y?y:0),zo(bo(f),y,_)}function Vz(f,y,_){return y=Xl(y),_===r?(_=y,y=0):_=Xl(_),f=bo(f),dy(f,y,_)}function Bz(f,y,_){if(_&&typeof _!="boolean"&&gi(f,y,_)&&(y=_=r),_===r&&(typeof y=="boolean"?(_=y,y=r):typeof f=="boolean"&&(_=f,f=r)),f===r&&y===r?(f=0,y=1):(f=Xl(f),y===r?(y=f,f=0):y=Xl(y)),f>y){var T=f;f=y,y=T}if(_||f%1||y%1){var L=Nd();return Yr(f+L*(y-f+Bg("1e-"+((L+"").length-1))),y)}return Zc(f,y)}var Hz=Vl(function(f,y,_){return y=y.toLowerCase(),f+(_?MT(y):y)});function MT(f){return wC(vn(f).toLowerCase())}function PT(f){return f=vn(f),f&&f.replace(E0,K0).replace(P0,"")}function Uz(f,y,_){f=vn(f),y=Ni(y);var T=f.length;_=_===r?T:zo(kt(_),0,T);var L=_;return _-=y.length,_>=0&&f.slice(_,L)==y}function Kz(f){return f=vn(f),f&&ct.test(f)?f.replace(ke,W0):f}function Wz(f){return f=vn(f),f&&Ds.test(f)?f.replace(Ss,"\\$&"):f}var qz=Vl(function(f,y,_){return f+(_?"-":"")+y.toLowerCase()}),Gz=Vl(function(f,y,_){return f+(_?" ":"")+y.toLowerCase()}),Yz=Dy("toLowerCase");function Xz(f,y,_){f=vn(f),y=kt(y);var T=y?Il(f):0;if(!y||T>=y)return f;var L=(y-T)/2;return Hd(Sa(L),_)+f+Hd(Tl(L),_)}function Zz(f,y,_){f=vn(f),y=kt(y);var T=y?Il(f):0;return y&&T<y?f+Hd(y-T,_):f}function Qz(f,y,_){f=vn(f),y=kt(y);var T=y?Il(f):0;return y&&T<y?Hd(y-T,_)+f:f}function Jz(f,y,_){return _||y==null?y=0:y&&(y=+y),t1(vn(f).replace(ma,""),y||0)}function eV(f,y,_){return(_?gi(f,y,_):y===r)?y=1:y=kt(y),$l(vn(f),y)}function tV(){var f=arguments,y=vn(f[0]);return f.length<3?y:y.replace(f[1],f[2])}var nV=Vl(function(f,y,_){return f+(_?"_":"")+y.toLowerCase()});function rV(f,y,_){return _&&typeof _!="number"&&gi(f,y,_)&&(y=_=r),_=_===r?X:_>>>0,_?(f=vn(f),f&&(typeof y=="string"||y!=null&&!mC(y))&&(y=Ni(y),!y&&kc(f))?Wo(ki(f),0,_):f.split(y,_)):[]}var iV=Vl(function(f,y,_){return f+(_?" ":"")+wC(y)});function sV(f,y,_){return f=vn(f),_=_==null?0:zo(kt(_),0,f.length),y=Ni(y),f.slice(_,_+y.length)==y}function oV(f,y,_){var T=U.templateSettings;_&&gi(f,y,_)&&(y=r),f=vn(f),y=W1({},y,T,Ty);var L=W1({},y.imports,T.imports,Ty),K=ni(L),Q=wd(L,K),re,de,De=0,Ie=y.interpolate||Zh,Pe="__p += '",Ye=_d((y.escape||Zh).source+"|"+Ie.source+"|"+(Ie===Jt?El:Zh).source+"|"+(y.evaluate||Zh).source+"|$","g"),dt="//# sourceURL="+(tn.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++A_+"]")+`
|
||
`;f.replace(Ye,function(bt,Ht,Zt,Fs,Vi,$s){return Zt||(Zt=Fs),Pe+=f.slice(De,$s).replace(N_,q0),Ht&&(re=!0,Pe+=`' +
|
||
__e(`+Ht+`) +
|
||
'`),Vi&&(de=!0,Pe+=`';
|
||
`+Vi+`;
|
||
__p += '`),Zt&&(Pe+=`' +
|
||
((__t = (`+Zt+`)) == null ? '' : __t) +
|
||
'`),De=$s+bt.length,bt}),Pe+=`';
|
||
`;var vt=tn.call(y,"variable")&&y.variable;if(!vt)Pe=`with (obj) {
|
||
`+Pe+`
|
||
}
|
||
`;else if(x_.test(vt))throw new Ct(l);Pe=(de?Pe.replace(hn,""):Pe).replace(wt,"$1").replace(He,"$1;"),Pe="function("+(vt||"obj")+`) {
|
||
`+(vt?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(re?", __e = _.escape":"")+(de?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Pe+`return __p
|
||
}`;var Lt=RT(function(){return en(K,dt+"return "+Pe).apply(r,Q)});if(Lt.source=Pe,yC(Lt))throw Lt;return Lt}function aV(f){return vn(f).toLowerCase()}function lV(f){return vn(f).toUpperCase()}function cV(f,y,_){if(f=vn(f),f&&(_||y===r))return B0(f);if(!f||!(y=Ni(y)))return f;var T=ki(f),L=ki(y),K=H0(T,L),Q=ey(T,L)+1;return Wo(T,K,Q).join("")}function uV(f,y,_){if(f=vn(f),f&&(_||y===r))return f.slice(0,gf(f)+1);if(!f||!(y=Ni(y)))return f;var T=ki(f),L=ey(T,ki(y))+1;return Wo(T,0,L).join("")}function dV(f,y,_){if(f=vn(f),f&&(_||y===r))return f.replace(ma,"");if(!f||!(y=Ni(y)))return f;var T=ki(f),L=H0(T,ki(y));return Wo(T,L).join("")}function hV(f,y){var _=B,T=H;if(hr(y)){var L="separator"in y?y.separator:L;_="length"in y?kt(y.length):_,T="omission"in y?Ni(y.omission):T}f=vn(f);var K=f.length;if(kc(f)){var Q=ki(f);K=Q.length}if(_>=K)return f;var re=_-Il(T);if(re<1)return T;var de=Q?Wo(Q,0,re).join(""):f.slice(0,re);if(L===r)return de+T;if(Q&&(re+=de.length-re),mC(L)){if(f.slice(re).search(L)){var De,Ie=de;for(L.global||(L=_d(L.source,vn(kg.exec(L))+"g")),L.lastIndex=0;De=L.exec(Ie);)var Pe=De.index;de=de.slice(0,Pe===r?re:Pe)}}else if(f.indexOf(Ni(L),re)!=re){var Ye=de.lastIndexOf(L);Ye>-1&&(de=de.slice(0,Ye))}return de+T}function fV(f){return f=vn(f),f&&Be.test(f)?f.replace(We,G0):f}var pV=Vl(function(f,y,_){return f+(_?" ":"")+y.toUpperCase()}),wC=Dy("toUpperCase");function AT(f,y,_){return f=vn(f),y=_?r:y,y===r?V_(f)?K_(f):F_(f):f.match(y)||[]}var RT=Rt(function(f,y){try{return di(f,r,y)}catch(_){return yC(_)?_:new Ct(_)}}),gV=mo(function(f,y){return Gr(y,function(_){_=Rs(_),co(f,_,Ae(f[_],f))}),f});function yV(f){var y=f==null?0:f.length,_=gt();return f=y?Pn(f,function(T){if(typeof T[1]!="function")throw new Ji(a);return[_(T[0]),T[1]]}):[],Rt(function(T){for(var L=-1;++L<y;){var K=f[L];if(di(K[0],this,T))return di(K[1],this,T)}})}function mV(f){return l1(Di(f,g))}function _C(f){return function(){return f}}function vV(f,y){return f==null||f!==f?y:f}var bV=Gf(),wV=Gf(!0);function hs(f){return f}function CC(f){return Xc(typeof f=="function"?f:Di(f,g))}function _V(f){return jf(Di(f,g))}function CV(f,y){return Hn(f,Di(y,g))}var EV=Rt(function(f,y){return function(_){return is(_,f,y)}}),xV=Rt(function(f,y){return function(_){return is(f,_,y)}});function EC(f,y,_){var T=ni(y),L=Gc(y,T);_==null&&!(hr(y)&&(L.length||!T.length))&&(_=y,y=f,f=this,L=Gc(y,ni(y)));var K=!(hr(_)&&"chain"in _)||!!_.chain,Q=Yl(f);return Gr(L,function(re){var de=y[re];f[re]=de,Q&&(f.prototype[re]=function(){var De=this.__chain__;if(K||De){var Ie=f(this.__wrapped__),Pe=Ie.__actions__=fi(this.__actions__);return Pe.push({func:de,args:arguments,thisArg:f}),Ie.__chain__=De,Ie}return de.apply(f,Ea([this.value()],arguments))})}),f}function SV(){return Bn._===this&&(Bn._=Z0),this}function xC(){}function DV(f){return f=kt(f),Rt(function(y){return Ff(y,f)})}var NV=Yf(Pn),IV=Yf(Wg),OV=Yf(Yg);function kT(f){return et(f)?Zg(Rs(f)):Yn(f)}function TV(f){return function(y){return f==null?r:Vo(f,y)}}var MV=Iy(),PV=Iy(!0);function SC(){return[]}function DC(){return!1}function AV(){return{}}function RV(){return""}function kV(){return!0}function LV(f,y){if(f=kt(f),f<1||f>G)return[];var _=X,T=Yr(f,X);y=gt(y),f-=X;for(var L=Jg(T,y);++_<f;)y(_);return L}function jV(f){return Tt(f)?Pn(f,Rs):js(f)?[f]:fi(zy(vn(f)))}function FV(f){var y=++Fc;return vn(f)+y}var $V=Bd(function(f,y){return f+y},0),zV=zr("ceil"),VV=Bd(function(f,y){return f/y},1),BV=zr("floor");function HV(f){return f&&f.length?Ll(f,hs,Pa):r}function UV(f,y){return f&&f.length?Ll(f,gt(y,2),Pa):r}function KV(f){return z0(f,hs)}function WV(f,y){return z0(f,gt(y,2))}function qV(f){return f&&f.length?Ll(f,hs,Aa):r}function GV(f,y){return f&&f.length?Ll(f,gt(y,2),Aa):r}var YV=Bd(function(f,y){return f*y},1),XV=zr("round"),ZV=Bd(function(f,y){return f-y},0);function QV(f){return f&&f.length?Qg(f,hs):0}function JV(f,y){return f&&f.length?Qg(f,gt(y,2)):0}return U.after=ne,U.ary=ve,U.assign=lz,U.assignIn=DT,U.assignInWith=W1,U.assignWith=cz,U.at=uz,U.before=Me,U.bind=Ae,U.bindAll=gV,U.bindKey=Te,U.castArray=A$,U.chain=dp,U.chunk=rp,U.compact=Vy,U.concat=ls,U.cond=yV,U.conforms=mV,U.constant=_C,U.countBy=$1,U.create=dz,U.curry=Ze,U.curryRight=nt,U.debounce=st,U.defaults=hz,U.defaultsDeep=fz,U.defer=dr,U.delay=he,U.difference=Xt,U.differenceBy=Ar,U.differenceWith=wr,U.drop=Hr,U.dropRight=zi,U.dropRightWhile=au,U.dropWhile=Dr,U.fill=Zd,U.filter=pp,U.flatMap=Jy,U.flatMapDeep=dC,U.flatMapDepth=B1,U.flatten=ip,U.flattenDeep=Jd,U.flattenDepth=Ii,U.flip=se,U.flow=bV,U.flowRight=wV,U.fromPairs=By,U.functions=wz,U.functionsIn=_z,U.groupBy=em,U.initial=sp,U.intersection=Hy,U.intersectionBy=Fa,U.intersectionWith=op,U.invert=Ez,U.invertBy=xz,U.invokeMap=H1,U.iteratee=CC,U.keyBy=hC,U.keys=ni,U.keysIn=ds,U.map=Gl,U.mapKeys=Dz,U.mapValues=Nz,U.matches=_V,U.matchesProperty=CV,U.memoize=pe,U.merge=Iz,U.mergeWith=NT,U.method=EV,U.methodOf=xV,U.mixin=EC,U.negate=Fe,U.nthArg=DV,U.omit=Oz,U.omitBy=Tz,U.once=ut,U.orderBy=fC,U.over=NV,U.overArgs=pt,U.overEvery=IV,U.overSome=OV,U.partial=ht,U.partialRight=mt,U.partition=rh,U.pick=Mz,U.pickBy=IT,U.property=kT,U.propertyOf=TV,U.pull=ap,U.pullAll=th,U.pullAllBy=mi,U.pullAllWith=za,U.pullAt=ks,U.range=MV,U.rangeRight=PV,U.rearg=Rr,U.reject=c,U.remove=Oi,U.rest=nn,U.reverse=lp,U.sampleSize=m,U.set=Az,U.setWith=Rz,U.shuffle=b,U.slice=Ky,U.sortBy=z,U.sortedUniq=Gy,U.sortedUniqBy=Kl,U.split=rV,U.spread=Ba,U.tail=P1,U.take=A1,U.takeRight=Yy,U.takeRightWhile=cp,U.takeWhile=tC,U.tap=lC,U.throttle=gC,U.thru=Ls,U.toArray=ET,U.toPairs=OT,U.toPairsIn=TT,U.toPath=jV,U.toPlainObject=ST,U.transform=kz,U.unary=M$,U.union=nC,U.unionBy=R1,U.unionWith=k1,U.uniq=Wl,U.uniqBy=rC,U.uniqWith=lu,U.unset=Lz,U.unzip=up,U.unzipWith=Xn,U.update=jz,U.updateWith=Fz,U.values=wp,U.valuesIn=$z,U.without=iC,U.words=AT,U.wrap=P$,U.xor=L1,U.xorBy=sC,U.xorWith=oC,U.zip=j1,U.zipObject=F1,U.zipObjectDeep=aC,U.zipWith=cs,U.entries=OT,U.entriesIn=TT,U.extend=DT,U.extendWith=W1,EC(U,U),U.add=$V,U.attempt=RT,U.camelCase=Hz,U.capitalize=MT,U.ceil=zV,U.clamp=zz,U.clone=R$,U.cloneDeep=L$,U.cloneDeepWith=j$,U.cloneWith=k$,U.conformsTo=F$,U.deburr=PT,U.defaultTo=vV,U.divide=VV,U.endsWith=Uz,U.eq=Xo,U.escape=Kz,U.escapeRegExp=Wz,U.every=z1,U.find=gp,U.findIndex=ja,U.findKey=pz,U.findLast=V1,U.findLastIndex=Qd,U.findLastKey=gz,U.floor=BV,U.forEach=yp,U.forEachRight=nh,U.forIn=yz,U.forInRight=mz,U.forOwn=vz,U.forOwnRight=bz,U.get=vC,U.gt=$$,U.gte=z$,U.has=Cz,U.hasIn=bC,U.head=Hl,U.identity=hs,U.includes=mp,U.indexOf=Yo,U.inRange=Vz,U.invoke=Sz,U.isArguments=ih,U.isArray=Tt,U.isArrayBuffer=V$,U.isArrayLike=us,U.isArrayLikeObject=Nr,U.isBoolean=B$,U.isBuffer=cu,U.isDate=H$,U.isElement=U$,U.isEmpty=K$,U.isEqual=W$,U.isEqualWith=q$,U.isError=yC,U.isFinite=G$,U.isFunction=Yl,U.isInteger=bT,U.isLength=U1,U.isMap=wT,U.isMatch=Y$,U.isMatchWith=X$,U.isNaN=Z$,U.isNative=Q$,U.isNil=ez,U.isNull=J$,U.isNumber=_T,U.isObject=hr,U.isObjectLike=_r,U.isPlainObject=tm,U.isRegExp=mC,U.isSafeInteger=tz,U.isSet=CT,U.isString=K1,U.isSymbol=js,U.isTypedArray=bp,U.isUndefined=nz,U.isWeakMap=rz,U.isWeakSet=iz,U.join=$a,U.kebabCase=qz,U.last=yi,U.lastIndexOf=eh,U.lowerCase=Gz,U.lowerFirst=Yz,U.lt=sz,U.lte=oz,U.max=HV,U.maxBy=UV,U.mean=KV,U.meanBy=WV,U.min=qV,U.minBy=GV,U.stubArray=SC,U.stubFalse=DC,U.stubObject=AV,U.stubString=RV,U.stubTrue=kV,U.multiply=YV,U.nth=Uy,U.noConflict=SV,U.noop=xC,U.now=Z,U.pad=Xz,U.padEnd=Zz,U.padStart=Qz,U.parseInt=Jz,U.random=Bz,U.reduce=pC,U.reduceRight=vp,U.repeat=eV,U.replace=tV,U.result=Pz,U.round=XV,U.runInContext=le,U.sample=d,U.size=N,U.snakeCase=nV,U.some=O,U.sortedIndex=Wy,U.sortedIndexBy=eC,U.sortedIndexOf=Va,U.sortedLastIndex=M1,U.sortedLastIndexBy=qy,U.sortedLastIndexOf=Ul,U.startCase=iV,U.startsWith=sV,U.subtract=ZV,U.sum=QV,U.sumBy=JV,U.template=oV,U.times=LV,U.toFinite=Xl,U.toInteger=kt,U.toLength=xT,U.toLower=aV,U.toNumber=bo,U.toSafeInteger=az,U.toString=vn,U.toUpper=lV,U.trim=cV,U.trimEnd=uV,U.trimStart=dV,U.truncate=hV,U.unescape=fV,U.uniqueId=FV,U.upperCase=pV,U.upperFirst=wC,U.each=yp,U.eachRight=nh,U.first=Hl,EC(U,function(){var f={};return Fi(U,function(y,_){tn.call(U.prototype,_)||(f[_]=y)}),f}(),{chain:!1}),U.VERSION=i,Gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){U[f].placeholder=U}),Gr(["drop","take"],function(f,y){Ot.prototype[f]=function(_){_=_===r?1:br(kt(_),0);var T=this.__filtered__&&!y?new Ot(this):this.clone();return T.__filtered__?T.__takeCount__=Yr(_,T.__takeCount__):T.__views__.push({size:Yr(_,X),type:f+(T.__dir__<0?"Right":"")}),T},Ot.prototype[f+"Right"]=function(_){return this.reverse()[f](_).reverse()}}),Gr(["filter","map","takeWhile"],function(f,y){var _=y+1,T=_==ue||_==Ne;Ot.prototype[f]=function(L){var K=this.clone();return K.__iteratees__.push({iteratee:gt(L,3),type:_}),K.__filtered__=K.__filtered__||T,K}}),Gr(["head","last"],function(f,y){var _="take"+(y?"Right":"");Ot.prototype[f]=function(){return this[_](1).value()[0]}}),Gr(["initial","tail"],function(f,y){var _="drop"+(y?"":"Right");Ot.prototype[f]=function(){return this.__filtered__?new Ot(this):this[_](1)}}),Ot.prototype.compact=function(){return this.filter(hs)},Ot.prototype.find=function(f){return this.filter(f).head()},Ot.prototype.findLast=function(f){return this.reverse().find(f)},Ot.prototype.invokeMap=Rt(function(f,y){return typeof f=="function"?new Ot(this):this.map(function(_){return is(_,f,y)})}),Ot.prototype.reject=function(f){return this.filter(Fe(gt(f)))},Ot.prototype.slice=function(f,y){f=kt(f);var _=this;return _.__filtered__&&(f>0||y<0)?new Ot(_):(f<0?_=_.takeRight(-f):f&&(_=_.drop(f)),y!==r&&(y=kt(y),_=y<0?_.dropRight(-y):_.take(y-f)),_)},Ot.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Ot.prototype.toArray=function(){return this.take(X)},Fi(Ot.prototype,function(f,y){var _=/^(?:filter|find|map|reject)|While$/.test(y),T=/^(?:head|last)$/.test(y),L=U[T?"take"+(y=="last"?"Right":""):y],K=T||/^find/.test(y);L&&(U.prototype[y]=function(){var Q=this.__wrapped__,re=T?[1]:arguments,de=Q instanceof Ot,De=re[0],Ie=de||Tt(Q),Pe=function(Ht){var Zt=L.apply(U,Ea([Ht],re));return T&&Ye?Zt[0]:Zt};Ie&&_&&typeof De=="function"&&De.length!=1&&(de=Ie=!1);var Ye=this.__chain__,dt=!!this.__actions__.length,vt=K&&!Ye,Lt=de&&!dt;if(!K&&Ie){Q=Lt?Q:new Ot(this);var bt=f.apply(Q,re);return bt.__actions__.push({func:Ls,args:[Pe],thisArg:r}),new Xr(bt,Ye)}return vt&&Lt?f.apply(this,re):(bt=this.thru(Pe),vt?T?bt.value()[0]:bt.value():bt)})}),Gr(["pop","push","shift","sort","splice","unshift"],function(f){var y=Lo[f],_=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",T=/^(?:pop|shift)$/.test(f);U.prototype[f]=function(){var L=arguments;if(T&&!this.__chain__){var K=this.value();return y.apply(Tt(K)?K:[],L)}return this[_](function(Q){return y.apply(Tt(Q)?Q:[],L)})}}),Fi(Ot.prototype,function(f,y){var _=U[y];if(_){var T=_.name+"";tn.call(Bc,T)||(Bc[T]=[]),Bc[T].push({name:y,func:_})}}),Bc[ru(r,I).name]=[{name:"wrapper",func:r}],Ot.prototype.clone=Df,Ot.prototype.reverse=ay,Ot.prototype.value=Kc,U.prototype.at=hp,U.prototype.chain=ql,U.prototype.commit=fp,U.prototype.next=Xy,U.prototype.plant=cC,U.prototype.reverse=Qy,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=uC,U.prototype.first=U.prototype.head,Fo&&(U.prototype[Fo]=Zy),U},Lc=W_();ro?((ro.exports=Lc)._=Lc,bd._=Lc):Bn._=Lc}).call(hB)}(Dm,Dm.exports)),Dm.exports}var je=fB();function sL(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(r=sL(e[n]))&&(i&&(i+=" "),i+=r);else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function ic(){for(var e,n,r=0,i="";r<arguments.length;)(e=arguments[r++])&&(n=sL(e))&&(i&&(i+=" "),i+=n);return i}var R=nI();const D=cn(R);var{PI:oL}=Math,aL=oL*2,pB=180/oL,PC=class lL{constructor(n=0,r=0){this.x=n,this.y=r}sub(n){return new lL(this.x-n.x,this.y-n.y)}dot(n){return this.x*n.x+this.y*n.y}},qs=class cL{constructor(n=0,r=0){this.x=n,this.y=r}clone(){return new cL(this.x,this.y)}copyFrom(n){return this.set(n.x,n.y),this}copyTo(n){return n.x=this.x,n.y=this.y,n}equals(n){return n.x===this.x&&n.y===this.y}set(n=0,r=n){return this.x=n,this.y=r,this}};(e=>{e.EMPTY={x:0,y:0};function n(l,u){return Math.sqrt((l.x-u.x)**2+(l.y-u.y)**2)}e.getDistance=n;function r(l,u){return i(l,u,.5)}e.getMiddlePoint=r;function i(l,u,h){return{x:l.x+h*(u.x-l.x),y:l.y+h*(u.y-l.y)}}e.getRatioPoint=i;function s(l){return l.x===0&&(l.x=0),l.y===0&&(l.y=0),l}e.fixZero=s;function o(l,u){return{x:l.x+(u.x||0),y:l.y+(u.y||0)}}e.move=o;function a(l,u,h){const p=u.x-l.x,g=u.y-l.y,v=p===0?0:Math.sqrt(h**2/(1+g**2/p**2)),w=p>0?v:-v,S=p===0?h:Math.abs(v*g/p),E=g>0?S:-S;return{x:l.x+w,y:l.y+E}}e.moveDistanceToDirection=a})(qs||(qs={}));var Qe=class GD{constructor(n=0,r=0,i=0,s=0){this.x=n,this.y=r,this.width=i,this.height=s,this.type=1}static get EMPTY(){return new GD(0,0,0,0)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new GD(this.x,this.y,this.width,this.height)}copyFrom(n){return this.x=n.x,this.y=n.y,this.width=n.width,this.height=n.height,this}copyTo(n){return n.x=this.x,n.y=this.y,n.width=this.width,n.height=this.height,n}contains(n,r){return this.width<=0||this.height<=0?!1:n>=this.x&&n<=this.right&&r>=this.y&&r<=this.bottom}isEqual(n){return this.x===n.x&&this.y===n.y&&this.width===n.width&&this.height===n.height}containsRectangle(n){return n.left>=this.left&&n.right<=this.right&&n.top>=this.top&&n.bottom<=this.bottom}pad(n=0,r=n){return this.x-=n,this.y-=r,this.width+=n*2,this.height+=r*2,this}fit(n){const r=Math.max(this.x,n.x),i=Math.min(this.x+this.width,n.x+n.width),s=Math.max(this.y,n.y),o=Math.min(this.y+this.height,n.y+n.height);return this.x=r,this.width=Math.max(i-r,0),this.y=s,this.height=Math.max(o-s,0),this}ceil(n=1,r=.001){const i=Math.ceil((this.x+this.width-r)*n)/n,s=Math.ceil((this.y+this.height-r)*n)/n;return this.x=Math.floor((this.x+r)*n)/n,this.y=Math.floor((this.y+r)*n)/n,this.width=i-this.x,this.height=s-this.y,this}enlarge(n){const r=Math.min(this.x,n.x),i=Math.max(this.x+this.width,n.x+n.width),s=Math.min(this.y,n.y),o=Math.max(this.y+this.height,n.y+n.height);return this.x=r,this.width=i-r,this.y=s,this.height=o-s,this}get center(){return{x:this.x+this.width/2,y:this.y+this.height/2}}get rightBottom(){return{x:this.right,y:this.bottom}}get leftBottom(){return{x:this.left,y:this.bottom}}get rightTop(){return{x:this.right,y:this.top}}get leftTop(){return{x:this.left,y:this.top}}get bottomCenter(){return{x:this.x+this.width/2,y:this.bottom}}get topCenter(){return{x:this.x+this.width/2,y:this.top}}get rightCenter(){return{x:this.right,y:this.y+this.height/2}}get leftCenter(){return{x:this.left,y:this.y+this.height/2}}update(n){return n(this)}get crossDistance(){return qs.getDistance(this.leftTop,this.rightBottom)}toStyleStr(){return`left: ${this.x}px; top: ${this.y}px; width: ${this.width}px; height: ${this.height}px;`}withPadding(n){return this.x-=n.left,this.y-=n.top,this.width+=n.left+n.right,this.height+=n.top+n.bottom,this}withoutPadding(n){return this.x+=n.left,this.y+=n.top,this.width=this.width-n.left-n.right,this.height=this.height-n.top-n.bottom,this}withHeight(n){return this.height=n,this}clearSpace(){return this.width=0,this.height=0,this}};(e=>{function n(u,h){if(u.length<=1)return u;switch(h){case"align-bottom":const p=Math.max(...u.map(j=>j.bottom));u.forEach(j=>{j.y=p-j.height});break;case"align-center":const g=r(u).center.x;u.forEach(j=>{j.x=g-j.width/2});break;case"align-left":const v=Math.min(...u.map(j=>j.left));u.forEach(j=>{j.x=v});break;case"align-middle":const w=r(u).center.y;u.forEach(j=>{j.y=w-j.height/2});break;case"align-right":const S=Math.max(...u.map(j=>j.right));u.forEach(j=>{j.x=S-j.width});break;case"align-top":const E=Math.min(...u.map(j=>j.top));u.forEach(j=>{j.y=E});break;case"distribute-horizontal":if(u.length<=2)break;const x=u.slice().sort((j,V)=>j.left-V.left),I=r(u),P=u.reduce((j,V)=>j-V.width,I.width)/(u.length-1);x.reduce((j,V)=>(V.x=j,j+V.width+P),I.x);break;case"distribute-vertical":if(u.length<=2)break;const M=u.slice().sort((j,V)=>j.top-V.top),k=r(u),A=u.reduce((j,V)=>j-V.height,k.height)/(u.length-1);M.reduce((j,V)=>(V.y=j,j+V.height+A),k.y);break}return u}e.align=n;function r(u){const h=e.EMPTY.clone();if(!u.length)return h;const p=[],g=[],v=[],w=[];u.forEach(P=>{p.push(P.left),v.push(P.right),w.push(P.bottom),g.push(P.top)});const S=Math.min.apply(Math,p),E=Math.max.apply(Math,v),x=Math.min.apply(Math,g),I=Math.max.apply(Math,w);return h.x=S,h.width=E-S,h.y=x,h.height=I-x,h}e.enlarge=r;function i(u,h,p){const g=u.left,v=u.top,w=u.right,S=u.bottom,E=h.left,x=h.top,I=h.right,P=h.bottom;return p==="horizontal"?w>E&&g<I:p==="vertical"?S>x&&v<P:w>E&&g<I&&S>x&&v<P}e.intersects=i;function s(u,h,p,g){const v=new ZT(u.center,u.width,u.height,h),w=new ZT(p.center,p.width,p.height,g),S=v.centerPoint.sub(w.centerPoint),E=v.axesX;if(v.getProjectionRadius(E)+w.getProjectionRadius(E)<=Math.abs(S.dot(E)))return!1;const x=v.axesY;if(v.getProjectionRadius(x)+w.getProjectionRadius(x)<=Math.abs(S.dot(x)))return!1;const I=w.axesX;if(v.getProjectionRadius(I)+w.getProjectionRadius(I)<=Math.abs(S.dot(I)))return!1;const P=w.axesY;return!(v.getProjectionRadius(P)+w.getProjectionRadius(P)<=Math.abs(S.dot(P)))}e.intersectsWithRotation=s;function o(u,h,p=0,g=!1){return g?h.containsRectangle(u):p===0?e.intersects(u,h):e.intersectsWithRotation(u,p,h,0)}e.isViewportVisible=o;function a(u,h,p=0){const{left:g,right:v,top:w,bottom:S,width:E,height:x}=u,{left:I,right:P,top:M,bottom:k}=h;return g<=I?u.x=I+p:v>=P&&(u.x=P-p-E),w<=M?u.y=M+p:S>=k&&(u.y=k-p-x),u}e.setViewportVisible=a;function l(u,h){const p=u.x<h.x?u.x:h.x,g=u.y<h.y?u.y:h.y,v=Math.abs(u.x-h.x),w=Math.abs(u.y-h.y);return new e(p,g,v,w)}e.createRectangleWithTwoPoints=l})(Qe||(Qe={}));var ZT=class{constructor(e,n,r,i){this.width=n,this.height=r,this.centerPoint=new PC(e.x,e.y),this.axesX=new PC(Math.cos(i),Math.sin(i)),this.axesY=new PC(-1*this.axesX.y,this.axesX.x)}getProjectionRadius(e){return this.width/2*Math.abs(e.dot(this.axesX))+this.height/2*Math.abs(e.dot(this.axesY))}},gB=class uL{constructor(n=0,r=0,i=0){this.x=n,this.y=r,this.radius=i,this.type=2}clone(){return new uL(this.x,this.y,this.radius)}contains(n,r){if(this.radius<=0)return!1;const i=this.radius*this.radius;let s=this.x-n,o=this.y-r;return s*=s,o*=o,s+o<=i}getBounds(){return new Qe(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}},Vm=class yb{constructor(n=1,r=0,i=0,s=1,o=0,a=0){this.a=n,this.b=r,this.c=i,this.d=s,this.tx=o,this.ty=a,this.array=null}static get IDENTITY(){return new yb}static get TEMP_MATRIX(){return new yb}fromArray(n){return n.length<6?this:(this.a=n[0],this.b=n[1],this.c=n[3],this.d=n[4],this.tx=n[2],this.ty=n[5],this)}set(n,r,i,s,o,a){return this.a=n,this.b=r,this.c=i,this.d=s,this.tx=o,this.ty=a,this}toArray(n,r){this.array||(this.array=new Float32Array(9));const i=r||this.array;return n?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(n,r){r=r||{x:0,y:0};const{x:i,y:s}=n;return r.x=this.a*i+this.c*s+this.tx,r.y=this.b*i+this.d*s+this.ty,r}applyInverse(n,r){r=r||{x:0,y:0};const i=1/(this.a*this.d+this.c*-this.b),{x:s}=n,{y:o}=n;return r.x=this.d*i*s+-this.c*i*o+(this.ty*this.c-this.tx*this.d)*i,r.y=this.a*i*o+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,r}translate(n,r){return this.tx+=n,this.ty+=r,this}scale(n,r){return this.a*=n,this.d*=r,this.c*=n,this.b*=r,this.tx*=n,this.ty*=r,this}rotate(n){const r=Math.cos(n),i=Math.sin(n),s=this.a,o=this.c,a=this.tx;return this.a=s*r-this.b*i,this.b=s*i+this.b*r,this.c=o*r-this.d*i,this.d=o*i+this.d*r,this.tx=a*r-this.ty*i,this.ty=a*i+this.ty*r,this}append(n){const r=this.a,i=this.b,s=this.c,o=this.d;return this.a=n.a*r+n.b*s,this.b=n.a*i+n.b*o,this.c=n.c*r+n.d*s,this.d=n.c*i+n.d*o,this.tx=n.tx*r+n.ty*s+this.tx,this.ty=n.tx*i+n.ty*o+this.ty,this}setTransform(n,r,i,s,o,a,l,u,h){return this.a=Math.cos(l+h)*o,this.b=Math.sin(l+h)*o,this.c=-Math.sin(l-u)*a,this.d=Math.cos(l-u)*a,this.tx=n-(i*this.a+s*this.c),this.ty=r-(i*this.b+s*this.d),this}prepend(n){const r=this.tx;if(n.a!==1||n.b!==0||n.c!==0||n.d!==1){const i=this.a,s=this.c;this.a=i*n.a+this.b*n.c,this.b=i*n.b+this.b*n.d,this.c=s*n.a+this.d*n.c,this.d=s*n.b+this.d*n.d}return this.tx=r*n.a+this.ty*n.c+n.tx,this.ty=r*n.b+this.ty*n.d+n.ty,this}decompose(n){const{a:r}=this,{b:i}=this,{c:s}=this,{d:o}=this,a=-Math.atan2(-s,o),l=Math.atan2(i,r),u=Math.abs(a+l);return u<1e-5||Math.abs(aL-u)<1e-5?(n.rotation=l,n.skew.x=0,n.skew.y=0):(n.rotation=0,n.skew.x=a,n.skew.y=l),n.scale.x=Math.sqrt(r*r+i*i),n.scale.y=Math.sqrt(s*s+o*o),n.position.x=this.tx,n.position.y=this.ty,n}invert(){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.tx,a=n*s-r*i;return this.a=s/a,this.b=-r/a,this.c=-i/a,this.d=n/a,this.tx=(i*this.ty-s*o)/a,this.ty=-(n*this.ty-r*o)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}isSimple(){return this.a===1&&this.b===0&&this.c===0&&this.d===1}clone(){const n=new yb;return n.a=this.a,n.b=this.b,n.c=this.c,n.d=this.d,n.tx=this.tx,n.ty=this.ty,n}copyTo(n){return n.a=this.a,n.b=this.b,n.c=this.c,n.d=this.d,n.tx=this.tx,n.ty=this.ty,n}copyFrom(n){return this.a=n.a,this.b=n.b,this.c=n.c,this.d=n.d,this.tx=n.tx,this.ty=n.ty,this}},G1=class dL{constructor(n,r,i=0,s=0){this._x=i,this._y=s,this.cb=n,this.scope=r}get x(){return this._x}set x(n){this._x!==n&&(this._x=n,this.cb.call(this.scope))}get y(){return this._y}set y(n){this._y!==n&&(this._y=n,this.cb.call(this.scope))}clone(n=this.cb,r=this.scope){return new dL(n,r,this._x,this._y)}set(n=0,r=n){return(this._x!==n||this._y!==r)&&(this._x=n,this._y=r,this.cb.call(this.scope)),this}copyFrom(n){return(this._x!==n.x||this._y!==n.y)&&(this._x=n.x,this._y=n.y,this.cb.call(this.scope)),this}copyTo(n){return n.x=this._x,n.y=this._y,n}equals(n){return n.x===this._x&&n.y===this._y}},QT=class{constructor(){this.worldTransform=new Vm,this.localTransform=new Vm,this.position=new G1(this.onChange,this,0,0),this.scale=new G1(this.onChange,this,1,1),this.pivot=new G1(this.onChange,this,0,0),this.skew=new G1(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const n=this.localTransform;this._localID!==this._currentLocalID&&(n.a=this._cx*this.scale.x,n.b=this._sx*this.scale.x,n.c=this._cy*this.scale.y,n.d=this._sy*this.scale.y,n.tx=this.position.x-(this.pivot.x*n.a+this.pivot.y*n.c),n.ty=this.position.y-(this.pivot.x*n.b+this.pivot.y*n.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(n){const r=this.localTransform;if(this._localID!==this._currentLocalID&&(r.a=this._cx*this.scale.x,r.b=this._sx*this.scale.x,r.c=this._cy*this.scale.y,r.d=this._sy*this.scale.y,r.tx=this.position.x-(this.pivot.x*r.a+this.pivot.y*r.c),r.ty=this.position.y-(this.pivot.x*r.b+this.pivot.y*r.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==n._worldID){const i=n.worldTransform,s=this.worldTransform;s.a=r.a*i.a+r.b*i.c,s.b=r.a*i.b+r.b*i.d,s.c=r.c*i.a+r.d*i.c,s.d=r.c*i.b+r.d*i.d,s.tx=r.tx*i.a+r.ty*i.c+i.tx,s.ty=r.tx*i.b+r.ty*i.d+i.ty,this._parentID=n._worldID,this._worldID++}}setFromMatrix(n){n.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(n){this._rotation!==n&&(this._rotation=n,this.updateSkew())}};QT.IDENTITY=new QT;function JT(e,n,r){const i=r-n;return n+((e-n)%i+i)%i}var Sb;(e=>{function n(s){return JT(s,-Math.PI,Math.PI)}e.wrap=n;function r(s){return JT(s,-180,180)}e.wrapDegrees=r;function i(s,o,a={x:0,y:0}){const l={x:s.x-a.x,y:s.y-a.y},u={x:o.x-a.x,y:o.y-a.y};return Math.atan2(l.x*u.y-l.y*u.x,l.x*u.x+l.y*u.y)}e.betweenPoints=i})(Sb||(Sb={}));var{keys:hL}=Object,yB=(e,n)=>hL(e).forEach(r=>n(e[r],r)),mB=(e,n,r={})=>hL(e).reduce((i,s)=>n(i,e[s],s),r),vB=(e,n)=>mB(e,(r,i,s)=>Object.assign(r,{[s]:n(i,s)})),Db=()=>{},fL=Object.freeze({dispose:Db}),YD;(e=>{e.None=()=>fL})(YD||(YD={}));var pL=class XD{constructor(){this._disposed=!1}get event(){return this._event||(this._event=(n,r)=>{if(this._disposed)return fL;this._listeners||(this._listeners=[]);const i=r?n.bind(r):n;this._listeners.length>=XD.LEAK_WARNING_THRESHHOLD&&console.warn(`[Emitter] Listeners length >= ${XD.LEAK_WARNING_THRESHHOLD}`),this._listeners.push(i);const s={dispose:()=>{if(s.dispose=Db,!this._disposed){const o=this._listeners.indexOf(i);o!==-1&&this._listeners.splice(o,1)}}};return s}),this._event}fire(n){this._listeners&&this._listeners.forEach(r=>r(n))}get disposed(){return this._disposed}dispose(){this._listeners&&(this._listeners=void 0),this._disposed=!0}};pL.LEAK_WARNING_THRESHHOLD=175;var qe=pL,on;(e=>{function n(i){return typeof i=="object"&&i!==null&&typeof i.dispose=="function"}e.is=n;function r(i){return{dispose:i}}e.create=r,e.NULL=Object.freeze(r(()=>{}))})(on||(on={}));var gL=class{constructor(){this.toDispose=new jt}dispose(){this.toDispose.dispose()}get disposed(){return this.toDispose.disposed}get onDispose(){return this.toDispose.onDispose}},jt=class{constructor(...e){this.disposables=[],this.onDisposeEmitter=new qe,this._disposed=!1,e.forEach(n=>this.push(n))}get onDispose(){return this.onDisposeEmitter.event}get disposed(){return this._disposed}dispose(){this.disposed||(this._disposed=!0,this.disposables.slice().reverse().forEach(e=>{try{e.dispose()}catch(n){console.error(n)}}),this.onDisposeEmitter.fire(void 0),this.onDisposeEmitter.dispose())}push(e){if(this.disposed)return on.NULL;const{disposables:n}=this;if(n.find(s=>s._origin===e))return on.NULL;let r;const i=on.create(()=>{const s=n.indexOf(r);s!==-1&&n.splice(s,1)});return r={dispose:()=>{i.dispose(),e.dispose()},_origin:e},n.push(r),i}pushAll(e){return e.map(n=>this.push(n))}},yL=Object.freeze(function(e,n){const r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),ZD;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof bB?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:YD.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:yL})})(ZD||(ZD={}));var bB=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?yL:(this._emitter||(this._emitter=new qe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},wB="Cancelled";function _B(){return new Error(wB)}var Nb=class{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}};function bc(e,n=ZD.None){const r=new Nb,i=setTimeout(()=>r.resolve(),e);return n.onCancellationRequested(()=>{clearTimeout(i),r.reject(_B())}),r.promise}var ju;(e=>{function n(s,o,a=1,l=!0){if(s===o)return!1;if(a===0||typeof s!="object"||typeof o!="object")return s!==o;const u=Object.keys(o);if(!l){const h=Object.keys(s);if(u.length!==h.length)return!0}for(let h=0,p=u.length;h<p;h++){const g=u[h];if(n(s[g],o[g],a-1,l))return!0}return!1}e.isChanged=n;function r(s,o,a){return n(s,o,1/0,a)}e.isDeepChanged=r;function i(s,o){if(s.length!==o.length)return!0;for(let a=0,l=s.length;a<l;a++)if(s[a]!==o[a])return!0;return!1}e.isArrayShallowChanged=i})(ju||(ju={}));var nv;(e=>{function n(o,a={}){let l=[];return{getFromCache(){return l},getMore(u,h=!0){if(u!==l.length){if(u>l.length){let p=u-l.length;for(;p>0;)l.push(o()),p--}else if(h){const p=a.deleteLimit??0;l.length-u>p&&l.splice(u).forEach(v=>v.dispose&&v.dispose())}}return l.slice(0,u)},getMoreByItemKeys(u){const h=[],p=new Map;return l.forEach(g=>{var w;u.find(S=>S.key===g.key)?p.set(g.key,g):(w=g.dispose)==null||w.call(g)}),u.forEach(g=>{if(!g.key)throw new Error("getMoreByItemKeys need a key");const v=p.get(g.key);v?h.push(v):h.push(o(g))}),l=h,l},getMoreByItems(u){const h=[],p=new Map;return l.forEach(g=>{var w;u.find(S=>S===g.key)?p.set(g.key,g):(w=g.dispose)==null||w.call(g)}),u.forEach(g=>{const v=p.get(g);v?h.push(v):h.push({...o(g),key:g})}),l=h,l},get(){return l.length>0||l.push(o()),l[0]},getFromCacheByKey(u){return l.find(h=>h.key===u)},dispose(){l.forEach(u=>u.dispose&&u.dispose()),l.length=0},clear(){this.dispose()}}}e.create=n;function r(o,a){return Object.assign(o,a)}e.assign=r;function i(o=1e3){let a,l;function u(){l&&clearTimeout(l),l=setTimeout(()=>{l=void 0,a=void 0},o)}return{get(h){return a?(u(),a):(a=h(),u(),a)}}}e.createShortCache=i;function s(){const o=new WeakMap;return{get:a=>o.get(a),save:(a,l)=>o.set(a,l),isChanged:(a,l)=>ju.isChanged(o.get(a),l)}}e.createWeakCache=s})(nv||(nv={}));var eM;(e=>{function n(r,i,s){return{type:"object",properties:{...i==null?void 0:i.properties,...r},mixinDefaults:{...i==null?void 0:i.mixinDefaults,...s}}}e.create=n})(eM||(eM={}));var ia;(e=>{function n(i,s,o){s={...i.mixinDefaults,...s};const a=o?`${o}.`:"";return i.properties?vB(i.properties,(l,u)=>{const h=a+u;return s&&s[h]!==void 0?s[h]:n(l,s,h)}):typeof i.default=="function"?i.default():i.default}e.createDefault=n;function r(i){return i.type==="string"||i.type==="float"||i.type==="integer"||i.type==="boolean"||i.type==="enum"||i.type==="color"||i.type==="range"}e.isBaseType=r})(ia||(ia={}));var mL={label:"大小",properties:{width:{label:"宽",default:0,type:"float"},height:{label:"高",default:0,type:"float"},locked:{label:"等比锁",default:!1,type:"boolean"}},type:"object"},vL={label:"原点",description:"用于设置旋转的中心位置",properties:{x:{label:"x",default:.5,type:"float"},y:{label:"y",default:.5,type:"float"}},type:"object"},bL={label:"位置",properties:{x:{label:"x",default:0,type:"float"},y:{label:"y",default:0,type:"float"}},type:"object"},wL={label:"旋转",type:"float",default:0},_L={label:"缩放",properties:{x:{label:"x",default:1,type:"float"},y:{label:"y",default:1,type:"float"}},type:"object"},CL={label:"倾斜",properties:{x:{label:"x",default:0,type:"float"},y:{label:"y",default:0,type:"float"}},type:"object"},EL={properties:{position:bL,size:mL,origin:vL,scale:_L,skew:CL,rotation:wL},type:"object"},QD;(e=>{function n(){return ia.createDefault(EL)}e.createDefault=n;function r(a){return{position:{x:a.position.x,y:a.position.y},size:{width:a.size.width,height:a.size.height,locked:a.size.locked},origin:{x:a.origin.x,y:a.origin.y},scale:{x:a.scale.x,y:a.scale.y},skew:{x:a.skew.x,y:a.skew.y},rotation:a.rotation}}e.toJSON=r;function i(a,l){return{position:{x:l.position.x-a.position.x,y:l.position.y-a.position.y},size:{width:l.size.width-a.size.width,height:l.size.height-a.size.height},origin:{x:l.origin.x-a.origin.x,y:l.origin.y-a.origin.y},scale:{x:l.scale.x-a.scale.x,y:l.scale.y-a.scale.y},skew:{x:l.skew.x-a.skew.x,y:l.skew.y-a.skew.y},rotation:l.rotation-a.rotation}}e.getDelta=i;function s(a,l,u){const h=u!==void 0?p=>Math.round(p*100)/100:p=>p;return{position:{x:h(l.position.x+a.position.x),y:h(l.position.y+a.position.y)},size:{width:h(l.size.width+a.size.width),height:h(l.size.height+a.size.height),locked:a.size.locked},origin:{x:h(l.origin.x+a.origin.x),y:h(l.origin.y+a.origin.y)},scale:{x:h(l.scale.x+a.scale.x),y:h(l.scale.y+a.scale.y)},skew:{x:h(l.skew.x+a.skew.x),y:h(l.skew.y+a.skew.y)},rotation:l.rotation+a.rotation}}e.mergeDelta=s;function o(a){return a&&a.position&&a.size&&typeof a.position.x=="number"&&typeof a.size.width=="number"}e.is=o})(QD||(QD={}));var Hp;(e=>{function n(s,o){if(s.width<=o.width&&s.height<=o.height)return 1;const a=s.width/o.width,l=s.height/o.height;return 1/(a>l?a:l)}e.fixSize=n;function r(s,o){const a=s.width/o.width,l=s.height/o.height;return 1/(a<l?a:l)}e.coverSize=r;function i(){return{width:0,height:0}}e.empty=i})(Hp||(Hp={}));var JD;(e=>{e.empty=()=>({left:0,right:0,top:0,bottom:0})})(JD||(JD={}));var tM;(e=>{function n(r){return r?r.topLeft===void 0&&r.topRight===void 0&&r.bottomLeft===void 0&&r.bottomRight===void 0:!0}e.isEmpty=n})(tM||(tM={}));var CB={label:"透明度",type:"float",min:0,max:1,default:1},EB=e=>e.replace(/([A-Z])/,n=>`-${n.toLowerCase()}`),ft;(e=>{function n(M){return`${M}px`}e.toPixel=n;function r(M){return parseFloat(M.substring(0,M.length-1))}e.fromPercent=r;function i(M){return`${M}%`}e.toPercent=i;function s(M){M.style.pointerEvents="all"}e.enableEvent=s;function o(M){M.style.pointerEvents="none"}e.disableEvent=o;function a(M,...k){const A=document.createElement(M);return k.length>0&&(A.className=ic(k)),A}e.createElement=a;function l(...M){return a("div",...M)}e.createDivWithClass=l;function u(M,...k){M.className=ic(k.concat(M.className.split(" ")))}e.addClass=u;function h(M,...k){k.forEach(A=>{M.classList.remove(A)}),M.className=M.classList.toString()}e.delClass=h;function p(M,...k){M.className=ic(k)}e.coverClass=p;function g(M){M.innerHTML=""}e.clearChildren=g;function v(M,k,A){M.style.transform=`translate(${k}%, ${A}%)`}e.translatePercent=v;function w(M,k){M.style.transform=`translateX(${k}%)`}e.translateXPercent=w;function S(M,k){M.style.transform=`translateY(${k}%)`}e.translateYPercent=S;function E(M,k){const A=[];yB(k,($,W)=>{$!==void 0&&(typeof $=="number"&&W!=="opacity"&&W!=="zIndex"&&W!=="scale"&&($=n($)),A.push(`${EB(W)}:${$}`))});const j=M.getAttribute("style"),V=A.join(";");j!==V&&M.setAttribute("style",V)}e.setStyle=E;function x(M){return(k,A)=>ic(k.split(/\s+/).map(j=>`${M}-${j}`).join(" "),A)}e.classNameWithPrefix=x;function I(M,k,A,j){return M.addEventListener(k,A,j),on.create(()=>{M.removeEventListener(k,A)})}e.addStandardDisposableListener=I;function P(M,k,A){return nv.create(()=>{const j=typeof k=="string"?e.createDivWithClass(k):k();return A&&(j.innerHTML=A),M.appendChild(j),Object.assign(j,{dispose:()=>{const{parentNode:V}=j;V&&V.removeChild(j)},setStyle:V=>{e.setStyle(j,V)}})})}e.createDOMCache=P})(ft||(ft={}));var AC=0;function xB(){return AC===Number.MAX_SAFE_INTEGER&&(AC=0),AC++}function Lv(e,n,r){e(n).toSelf().inSingletonScope(),r.forEach(i=>e(i).toService(n))}var rI=Symbol("ContributionProvider"),SB=class{constructor(e,n){this.container=e,this.identifier=n}forEach(e){this.getContributions().forEach(e)}getContributions(){if(!this.services){const e=[];let{container:n}=this;if(n.isBound(this.identifier))try{e.push(...n.getAll(this.identifier))}catch(r){console.error(r)}this.services=e}return this.services}};function iI(e,n){e(rI).toDynamicValue(r=>new SB(r.container,n)).inSingletonScope().whenTargetNamed(n)}function Cs(e){const[,n]=R.useState(e);return R.useCallback(r=>n(r!==void 0?r:{}),[])}const RC=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");var Qk,Mv,Jk;let DB=(Qk=RC,Jk=class{constructor(n){Ue(this,Qk);Ql(this,Mv);Ha(this,Mv,n),this[RC]=!0}static is(n){return typeof n=="object"&&n!==null&&n[RC]===!0}unwrap(){return Kn(this,Mv).call(this)}},Mv=new WeakMap,Jk);function fc(e,n){return Reflect.getMetadata(n,e)}function nM(e,n,r,i){const s=i(fc(e,n)??r);Reflect.defineMetadata(n,s,e)}const _w="named",sI="name",oI="unmanaged",aI="optional",lI="inject",cI="multi_inject",xL="post_construct",SL="pre_destroy",NB=[lI,cI,sI,oI,_w,aI],kC=Symbol.for("@inversifyjs/core/InversifyCoreError");var eL,tL;let bh=class DL extends(tL=Error,eL=kC,tL){constructor(r,i,s){super(i,s);Ue(this,eL);Ue(this,"kind");this[kC]=!0,this.kind=r}static is(r){return typeof r=="object"&&r!==null&&r[kC]===!0}static isErrorOfKind(r,i){return DL.is(r)&&r.kind===i}};var pc,vs;function NL(e,n){const r=[];for(let i=0;i<n.length;++i)n[i]===void 0&&r.push(i);if(r.length>0)throw new bh(pc.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${r.join('", "')}".
|
||
|
||
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
|
||
|
||
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}function IL(e){return{kind:vs.singleInjection,name:void 0,optional:!1,tags:new Map,targetName:void 0,value:e}}function Cw(e){const n=e.find(a=>a.key===lI),r=e.find(a=>a.key===cI);if(e.find(a=>a.key===oI)!==void 0)return function(a,l){if(l!==void 0||a!==void 0)throw new bh(pc.missingInjectionDecorator,"Expected a single @inject, @multiInject or @unmanaged metadata");return{kind:vs.unmanaged}}(n,r);if(r===void 0&&n===void 0)throw new bh(pc.missingInjectionDecorator,"Expected @inject, @multiInject or @unmanaged metadata");const i=e.find(a=>a.key===_w),s=e.find(a=>a.key===aI),o=e.find(a=>a.key===sI);return{kind:n===void 0?vs.multipleInjection:vs.singleInjection,name:i==null?void 0:i.value,optional:s!==void 0,tags:new Map(e.filter(a=>NB.every(l=>a.key!==l)).map(a=>[a.key,a.value])),targetName:o==null?void 0:o.value,value:n===void 0?r==null?void 0:r.value:n.value}}function OL(e,n,r){try{return Cw(r)}catch(i){throw bh.isErrorOfKind(i,pc.missingInjectionDecorator)?new bh(pc.missingInjectionDecorator,`Expected a single @inject, @multiInject or @unmanaged decorator at type "${e.name}" at constructor arguments at index "${n.toString()}"`,{cause:i}):i}}function IB(e){const n=fc(e,"design:paramtypes"),r=fc(e,"inversify:tagged"),i=[];if(r!==void 0)for(const[s,o]of Object.entries(r)){const a=parseInt(s);i[a]=OL(e,a,o)}if(n!==void 0){for(let s=0;s<n.length;++s)if(i[s]===void 0){const o=n[s];i[s]=IL(o)}}return NL(e,i),i}function TL(e,n,r){try{return Cw(r)}catch(i){throw bh.isErrorOfKind(i,pc.missingInjectionDecorator)?new bh(pc.missingInjectionDecorator,`Expected a single @inject, @multiInject or @unmanaged decorator at type "${e.name}" at property "${n.toString()}"`,{cause:i}):i}}function ML(e){const n=fc(e,"inversify:tagged_props"),r=new Map;if(n!==void 0)for(const i of Reflect.ownKeys(n)){const s=n[i];r.set(i,TL(e,i,s))}return r}function OB(e){const n=fc(e,xL),r=fc(e,SL);return{constructorArguments:IB(e),lifecycle:{postConstructMethodName:n==null?void 0:n.value,preDestroyMethodName:r==null?void 0:r.value},properties:ML(e)}}function TB(e,n){const r=n.getConstructorMetadata(e),i=[];for(const[s,o]of Object.entries(r.userGeneratedMetadata)){const a=parseInt(s);i[a]=OL(e,a,o)}if(r.compilerGeneratedMetadata!==void 0){for(let s=0;s<r.compilerGeneratedMetadata.length;++s)if(i[s]===void 0){const o=r.compilerGeneratedMetadata[s];i[s]=IL(o)}}return NL(e,i),i}function PL(e,n){const r=n.getPropertiesMetadata(e),i=new Map;for(const s of Reflect.ownKeys(r)){const o=r[s];i.set(s,TL(e,s,o))}return i}function MB(e,n){const r=fc(e,xL),i=fc(e,SL);return{constructorArguments:TB(e,n),lifecycle:{postConstructMethodName:r==null?void 0:r.value,preDestroyMethodName:i==null?void 0:i.value},properties:PL(e,n)}}function rM(e){const n=Object.getPrototypeOf(e.prototype);return n==null?void 0:n.constructor}function PB(e){return e.kind===vs.unmanaged?[{key:oI,value:!0}]:function(n){const r=[AB(n)];n.name!==void 0&&r.push({key:_w,value:n.name}),n.optional&&r.push({key:aI,value:!0});for(const[i,s]of n.tags)r.push({key:i,value:s});return n.targetName!==void 0&&r.push({key:sI,value:n.targetName}),r}(e)}function AB(e){let n;switch(e.kind){case vs.multipleInjection:n={key:cI,value:e.value};break;case vs.singleInjection:n={key:lI,value:e.value}}return n}(function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.unknown=3]="unknown"})(pc||(pc={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(vs||(vs={}));var nc,nL;let RB=(nL=class{constructor(n){Ql(this,nc);Ha(this,nc,n)}startsWith(n){return Kn(this,nc).startsWith(n)}endsWith(n){return Kn(this,nc).endsWith(n)}contains(n){return Kn(this,nc).includes(n)}equals(n){return Kn(this,nc)===n}value(){return Kn(this,nc)}},nc=new WeakMap,nL);const LC="@inversifyjs/core/targetId";var wi,Pv,Av,yh,Rv,kv,rL;let Ib=(rL=class{constructor(n,r,i){Ql(this,wi);Ql(this,Pv);Ql(this,Av);Ql(this,yh);Ql(this,Rv);Ql(this,kv);Ha(this,Pv,function(){const s=fc(Object,LC)??0;return s===Number.MAX_SAFE_INTEGER?nM(Object,LC,s,()=>Number.MIN_SAFE_INTEGER):nM(Object,LC,s,o=>o+1),s}()),Ha(this,Av,n),Ha(this,yh,void 0),Ha(this,wi,r),Ha(this,Rv,new RB(typeof n=="string"?n:n.toString().slice(7,-1))),Ha(this,kv,i)}get id(){return Kn(this,Pv)}get identifier(){return Kn(this,Av)}get metadata(){return Kn(this,yh)===void 0&&Ha(this,yh,PB(Kn(this,wi))),Kn(this,yh)}get name(){return Kn(this,Rv)}get type(){return Kn(this,kv)}get serviceIdentifier(){return DB.is(Kn(this,wi).value)?Kn(this,wi).value.unwrap():Kn(this,wi).value}getCustomTags(){return[...Kn(this,wi).tags.entries()].map(([n,r])=>({key:n,value:r}))}getNamedTag(){return Kn(this,wi).name===void 0?null:{key:_w,value:Kn(this,wi).name}}hasTag(n){return this.metadata.some(r=>r.key===n)}isArray(){return Kn(this,wi).kind===vs.multipleInjection}isNamed(){return Kn(this,wi).name!==void 0}isOptional(){return Kn(this,wi).optional}isTagged(){return Kn(this,wi).tags.size>0}matchesArray(n){return this.isArray()&&Kn(this,wi).value===n}matchesNamedTag(n){return Kn(this,wi).name===n}matchesTag(n){return r=>this.metadata.some(i=>i.key===n&&i.value===r)}},wi=new WeakMap,Pv=new WeakMap,Av=new WeakMap,yh=new WeakMap,Rv=new WeakMap,kv=new WeakMap,rL);const AL=e=>function(n,r){return function(i){const s=n(i);let o=rM(i);for(;o!==void 0&&o!==Object;){const l=r(o);for(const[u,h]of l)s.properties.has(u)||s.properties.set(u,h);o=rM(o)}const a=[];for(const l of s.constructorArguments)if(l.kind!==vs.unmanaged){const u=l.targetName??"";a.push(new Ib(u,l,"ConstructorArgument"))}for(const[l,u]of s.properties)if(u.kind!==vs.unmanaged){const h=u.targetName??l;a.push(new Ib(h,u,"ClassProperty"))}return a}}(e===void 0?OB:n=>MB(n,e),e===void 0?ML:n=>PL(n,e)),Co="named",kB="unmanaged",RL="optional",kL="inject",LL="multi_inject",jL="inversify:tagged",FL="inversify:tagged_props",iM="inversify:paramtypes",$L="design:paramtypes",eN="post_construct",Ob="pre_destroy",Or={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Wn={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},zL={ConstructorArgument:"ConstructorArgument",Variable:"Variable"};let LB=0;function jv(){return LB++}let jB=class VL{constructor(n,r){Ue(this,"id");Ue(this,"moduleId");Ue(this,"activated");Ue(this,"serviceIdentifier");Ue(this,"implementationType");Ue(this,"cache");Ue(this,"dynamicValue");Ue(this,"scope");Ue(this,"type");Ue(this,"factory");Ue(this,"provider");Ue(this,"constraint");Ue(this,"onActivation");Ue(this,"onDeactivation");this.id=jv(),this.activated=!1,this.serviceIdentifier=n,this.scope=r,this.type=Wn.Invalid,this.constraint=i=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}clone(){const n=new VL(this.serviceIdentifier,this.scope);return n.activated=n.scope===Or.Singleton&&this.activated,n.implementationType=this.implementationType,n.dynamicValue=this.dynamicValue,n.scope=this.scope,n.type=this.type,n.factory=this.factory,n.provider=this.provider,n.constraint=this.constraint,n.onActivation=this.onActivation,n.onDeactivation=this.onDeactivation,n.cache=this.cache,n}};const BL="Metadata key was used more than once in a parameter:",sM="NULL argument",oM="Key Not Found",FB="Ambiguous match found for serviceIdentifier:",$B="No matching bindings found for serviceIdentifier:",HL="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",tN=(e,n)=>`onDeactivation() error in class ${e}: ${n}`;let zB=class{getConstructorMetadata(n){return{compilerGeneratedMetadata:Reflect.getMetadata($L,n)??[],userGeneratedMetadata:Reflect.getMetadata(jL,n)??{}}}getPropertiesMetadata(n){return Reflect.getMetadata(FL,n)??{}}};var Mp;function UL(e){return e instanceof RangeError||e.message==="Maximum call stack size exceeded"}(function(e){e[e.MultipleBindingsAvailable=2]="MultipleBindingsAvailable",e[e.NoBindingsAvailable=0]="NoBindingsAvailable",e[e.OnlyOneBindingAvailable=1]="OnlyOneBindingAvailable"})(Mp||(Mp={}));function Ou(e){return typeof e=="function"?e.name:typeof e=="symbol"?e.toString():e}function aM(e,n,r){let i="";const s=r(e,n);return s.length!==0&&(i=`
|
||
Registered bindings:`,s.forEach(o=>{let a="Object";o.implementationType!==null&&(a=qL(o.implementationType)),i=`${i}
|
||
${a}`,o.constraint.metaData&&(i=`${i} - ${o.constraint.metaData}`)})),i}function KL(e,n){return e.parentRequest!==null&&(e.parentRequest.serviceIdentifier===n||KL(e.parentRequest,n))}function WL(e){e.childRequests.forEach(n=>{if(KL(e,n.serviceIdentifier)){const r=function(i){return function o(a,l=[]){const u=Ou(a.serviceIdentifier);return l.push(u),a.parentRequest!==null?o(a.parentRequest,l):l}(i).reverse().join(" --> ")}(n);throw new Error(`Circular dependency found: ${r}`)}WL(n)})}function qL(e){if(e.name!=null&&e.name!=="")return e.name;{const n=e.toString(),r=n.match(/^function\s*([^\s(]+)/);return r===null?`Anonymous function: ${n}`:r[1]}}function lM(e){return`{"key":"${e.key.toString()}","value":"${e.value.toString()}"}`}let GL=class{constructor(n){Ue(this,"id");Ue(this,"container");Ue(this,"plan");Ue(this,"currentRequest");this.id=jv(),this.container=n}addPlan(n){this.plan=n}setCurrentRequest(n){this.currentRequest=n}},Tu=class{constructor(n,r){Ue(this,"key");Ue(this,"value");this.key=n,this.value=r}toString(){return this.key===Co?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}},VB=class{constructor(n,r){Ue(this,"parentContext");Ue(this,"rootRequest");this.parentContext=n,this.rootRequest=r}};function YL(e,n){const r=function(l){const u=Object.getPrototypeOf(l.prototype);return u==null?void 0:u.constructor}(n);if(r===void 0||r===Object)return 0;const i=AL(e)(r),s=i.map(l=>l.metadata.filter(u=>u.key===kB)),o=[].concat.apply([],s).length,a=i.length-o;return a>0?a:YL(e,r)}let uI=class XL{constructor(n,r,i,s,o){Ue(this,"id");Ue(this,"serviceIdentifier");Ue(this,"parentContext");Ue(this,"parentRequest");Ue(this,"bindings");Ue(this,"childRequests");Ue(this,"target");Ue(this,"requestScope");this.id=jv(),this.serviceIdentifier=n,this.parentContext=r,this.parentRequest=i,this.target=o,this.childRequests=[],this.bindings=Array.isArray(s)?s:[s],this.requestScope=i===null?new Map:null}addChildRequest(n,r,i){const s=new XL(n,this.parentContext,this,r,i);return this.childRequests.push(s),s}};function Tb(e){return e._bindingDictionary}function cM(e,n,r,i,s){let o=Nm(r.container,s.serviceIdentifier),a=[];return o.length===Mp.NoBindingsAvailable&&r.container.options.autoBindInjectable===!0&&typeof s.serviceIdentifier=="function"&&e.getConstructorMetadata(s.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(s.serviceIdentifier).toSelf(),o=Nm(r.container,s.serviceIdentifier)),a=n?o:o.filter(l=>{const u=new uI(l.serviceIdentifier,r,i,l,s);return l.constraint(u)}),function(l,u,h,p,g){switch(u.length){case Mp.NoBindingsAvailable:if(p.isOptional())return u;{const v=Ou(l);let w=$B;throw w+=function(S,E){if(E.isTagged()||E.isNamed()){let x="";const I=E.getNamedTag(),P=E.getCustomTags();return I!==null&&(x+=lM(I)+`
|
||
`),P!==null&&P.forEach(M=>{x+=lM(M)+`
|
||
`}),` ${S}
|
||
${S} - ${x}`}return` ${S}`}(v,p),w+=aM(g,v,Nm),h!==null&&(w+=`
|
||
Trying to resolve bindings for "${Ou(h.serviceIdentifier)}"`),new Error(w)}case Mp.OnlyOneBindingAvailable:return u;case Mp.MultipleBindingsAvailable:default:if(p.isArray())return u;{const v=Ou(l);let w=`${FB} ${v}`;throw w+=aM(g,v,Nm),new Error(w)}}}(s.serviceIdentifier,a,i,s,r.container),a}function ZL(e,n){const r=n.isMultiInject?LL:kL,i=[new Tu(r,e)];return n.customTag!==void 0&&i.push(new Tu(n.customTag.key,n.customTag.value)),n.isOptional===!0&&i.push(new Tu(RL,!0)),i}function QL(e,n,r,i,s,o){let a,l;if(s===null){a=cM(e,n,i,null,o),l=new uI(r,i,null,a,o);const u=new VB(i,l);i.addPlan(u)}else a=cM(e,n,i,s,o),l=s.addChildRequest(o.serviceIdentifier,a,o);a.forEach(u=>{let h=null;if(o.isArray())h=l.addChildRequest(u.serviceIdentifier,u,o);else{if(u.cache!==null)return;h=l}if(u.type===Wn.Instance&&u.implementationType!==null){const p=function(g,v){return AL(g)(v)}(e,u.implementationType);if(i.container.options.skipBaseClassChecks!==!0){const g=YL(e,u.implementationType);if(p.length<g){const v=`The number of constructor arguments in the derived class ${qL(u.implementationType)} must be >= than the number of constructor arguments of its base class.`;throw new Error(v)}}p.forEach(g=>{QL(e,!1,g.serviceIdentifier,i,h,g)})}})}function Nm(e,n){let r=[];const i=Tb(e);return i.hasKey(n)?r=i.get(n):e.parent!==null&&(r=Nm(e.parent,n)),r}function BB(e,n,r,i,s,o=!1){const a=new GL(n),l=function(u,h,p){const g=ZL(h,p),v=Cw(g);if(v.kind===vs.unmanaged)throw new Error("Unexpected metadata when creating target");return new Ib("",v,u)}(r,i,s);try{return QL(e,o,i,a,null,l),a}catch(u){throw UL(u)&&WL(a.plan.rootRequest),u}}function gs(e){return(typeof e=="object"&&e!==null||typeof e=="function")&&typeof e.then=="function"}function JL(e){return!!gs(e)||Array.isArray(e)&&e.some(gs)}const HB=(e,n,r)=>{e.has(n.id)||e.set(n.id,r)},UB=(e,n)=>{e.cache=n,e.activated=!0,gs(n)&&KB(e,n)},KB=async(e,n)=>{try{const r=await n;e.cache=r}catch(r){throw e.cache=null,e.activated=!1,r}};var Bm;(function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"})(Bm||(Bm={}));function WB(e,n,r){let i;if(n.length>0){const s=function(a,l){return a.reduce((u,h)=>{const p=l(h);return h.target.type===zL.ConstructorArgument?u.constructorInjections.push(p):(u.propertyRequests.push(h),u.propertyInjections.push(p)),u.isAsync||(u.isAsync=JL(p)),u},{constructorInjections:[],isAsync:!1,propertyInjections:[],propertyRequests:[]})}(n,r),o={...s,constr:e};i=s.isAsync?async function(a){const l=await dM(a.constructorInjections),u=await dM(a.propertyInjections);return uM({...a,constructorInjections:l,propertyInjections:u})}(o):uM(o)}else i=new e;return i}function uM(e){const n=new e.constr(...e.constructorInjections);return e.propertyRequests.forEach((r,i)=>{const s=r.target.identifier,o=e.propertyInjections[i];r.target.isOptional()&&o===void 0||(n[s]=o)}),n}async function dM(e){const n=[];for(const r of e)Array.isArray(r)?n.push(Promise.all(r)):n.push(r);return Promise.all(n)}function hM(e,n){const r=function(i,s){var l;if(Reflect.hasMetadata(eN,i)){const u=Reflect.getMetadata(eN,i);try{return(l=s[u.value])==null?void 0:l.call(s)}catch(h){if(h instanceof Error)throw new Error((o=i.name,a=h.message,`@postConstruct error in class ${o}: ${a}`))}}var o,a}(e,n);return gs(r)?r.then(()=>n):n}function qB(e,n){e.scope!==Or.Singleton&&function(r,i){const s=`Class cannot be instantiated in ${r.scope===Or.Request?"request":"transient"} scope.`;if(typeof r.onDeactivation=="function")throw new Error(tN(i.name,s));if(Reflect.hasMetadata(Ob,i))throw new Error(`@preDestroy error in class ${i.name}: ${s}`)}(e,n)}const dI=e=>n=>{n.parentContext.setCurrentRequest(n);const r=n.bindings,i=n.childRequests,s=n.target&&n.target.isArray(),o=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(s&&o)return i.map(a=>dI(e)(a));{if(n.target.isOptional()&&r.length===0)return;const a=r[0];return ZB(e,n,a)}},GB=(e,n)=>{const r=(i=>{switch(i.type){case Wn.Factory:return{factory:i.factory,factoryType:Bm.Factory};case Wn.Provider:return{factory:i.provider,factoryType:Bm.Provider};case Wn.DynamicValue:return{factory:i.dynamicValue,factoryType:Bm.DynamicValue};default:throw new Error(`Unexpected factory type ${i.type}`)}})(e);return((i,s)=>{try{return i()}catch(o){throw UL(o)?s():o}})(()=>r.factory.bind(e)(n),()=>{return new Error((i=r.factoryType,s=n.currentRequest.serviceIdentifier.toString(),`It looks like there is a circular dependency in one of the '${i}' bindings. Please investigate bindings with service identifier '${s}'.`));var i,s})},YB=(e,n,r)=>{let i;const s=n.childRequests;switch((o=>{let a=null;switch(o.type){case Wn.ConstantValue:case Wn.Function:a=o.cache;break;case Wn.Constructor:case Wn.Instance:a=o.implementationType;break;case Wn.DynamicValue:a=o.dynamicValue;break;case Wn.Provider:a=o.provider;break;case Wn.Factory:a=o.factory}if(a===null){const l=Ou(o.serviceIdentifier);throw new Error(`Invalid binding type: ${l}`)}})(r),r.type){case Wn.ConstantValue:case Wn.Function:i=r.cache;break;case Wn.Constructor:i=r.implementationType;break;case Wn.Instance:i=function(o,a,l,u){qB(o,a);const h=WB(a,l,u);return gs(h)?h.then(p=>hM(a,p)):hM(a,h)}(r,r.implementationType,s,dI(e));break;default:i=GB(r,n.parentContext)}return i},XB=(e,n,r)=>{let i=((s,o)=>o.scope===Or.Singleton&&o.activated?o.cache:o.scope===Or.Request&&s.has(o.id)?s.get(o.id):null)(e,n);return i!==null||(i=r(),((s,o,a)=>{o.scope===Or.Singleton&&UB(o,a),o.scope===Or.Request&&HB(s,o,a)})(e,n,i)),i},ZB=(e,n,r)=>XB(e,r,()=>{let i=YB(e,n,r);return i=gs(i)?i.then(s=>fM(n,r,s)):fM(n,r,i),i});function fM(e,n,r){let i=QB(e.parentContext,n,r);const s=tH(e.parentContext.container);let o,a=s.next();do{o=a.value;const l=e.parentContext,u=e.serviceIdentifier,h=eH(o,u);i=gs(i)?e6(h,l,i):JB(h,l,i),a=s.next()}while(a.done!==!0&&!Tb(o).hasKey(e.serviceIdentifier));return i}const QB=(e,n,r)=>{let i;return i=typeof n.onActivation=="function"?n.onActivation(e,r):r,i},JB=(e,n,r)=>{let i=e.next();for(;i.done!==!0;){if(gs(r=i.value(n,r)))return e6(e,n,r);i=e.next()}return r},e6=async(e,n,r)=>{let i=await r,s=e.next();for(;s.done!==!0;)i=await s.value(n,i),s=e.next();return i},eH=(e,n)=>{const r=e._activations;return r.hasKey(n)?r.get(n).values():[].values()},tH=e=>{const n=[e];let r=e.parent;for(;r!==null;)n.push(r),r=r.parent;return{next:()=>{const i=n.pop();return i!==void 0?{done:!1,value:i}:{done:!0,value:void 0}}}},ec=(e,n)=>{const r=e.parentRequest;return r!==null&&(!!n(r)||ec(r,n))},Im=e=>n=>{const r=i=>i!==null&&i.target!==null&&i.target.matchesTag(e)(n);return r.metaData=new Tu(e,n),r},Y1=Im(Co),jC=e=>n=>{let r=null;if(n!==null){if(r=n.bindings[0],typeof e=="string")return r.serviceIdentifier===e;{const i=n.bindings[0].implementationType;return e===i}}return!1};class Mb{constructor(n){Ue(this,"_binding");this._binding=n}when(n){return this._binding.constraint=n,new bi(this._binding)}whenTargetNamed(n){return this._binding.constraint=Y1(n),new bi(this._binding)}whenTargetIsDefault(){return this._binding.constraint=n=>n===null?!1:n.target!==null&&!n.target.isNamed()&&!n.target.isTagged(),new bi(this._binding)}whenTargetTagged(n,r){return this._binding.constraint=Im(n)(r),new bi(this._binding)}whenInjectedInto(n){return this._binding.constraint=r=>r!==null&&jC(n)(r.parentRequest),new bi(this._binding)}whenParentNamed(n){return this._binding.constraint=r=>r!==null&&Y1(n)(r.parentRequest),new bi(this._binding)}whenParentTagged(n,r){return this._binding.constraint=i=>i!==null&&Im(n)(r)(i.parentRequest),new bi(this._binding)}whenAnyAncestorIs(n){return this._binding.constraint=r=>r!==null&&ec(r,jC(n)),new bi(this._binding)}whenNoAncestorIs(n){return this._binding.constraint=r=>r!==null&&!ec(r,jC(n)),new bi(this._binding)}whenAnyAncestorNamed(n){return this._binding.constraint=r=>r!==null&&ec(r,Y1(n)),new bi(this._binding)}whenNoAncestorNamed(n){return this._binding.constraint=r=>r!==null&&!ec(r,Y1(n)),new bi(this._binding)}whenAnyAncestorTagged(n,r){return this._binding.constraint=i=>i!==null&&ec(i,Im(n)(r)),new bi(this._binding)}whenNoAncestorTagged(n,r){return this._binding.constraint=i=>i!==null&&!ec(i,Im(n)(r)),new bi(this._binding)}whenAnyAncestorMatches(n){return this._binding.constraint=r=>r!==null&&ec(r,n),new bi(this._binding)}whenNoAncestorMatches(n){return this._binding.constraint=r=>r!==null&&!ec(r,n),new bi(this._binding)}}class bi{constructor(n){Ue(this,"_binding");this._binding=n}onActivation(n){return this._binding.onActivation=n,new Mb(this._binding)}onDeactivation(n){return this._binding.onDeactivation=n,new Mb(this._binding)}}class tc{constructor(n){Ue(this,"_bindingWhenSyntax");Ue(this,"_bindingOnSyntax");Ue(this,"_binding");this._binding=n,this._bindingWhenSyntax=new Mb(this._binding),this._bindingOnSyntax=new bi(this._binding)}when(n){return this._bindingWhenSyntax.when(n)}whenTargetNamed(n){return this._bindingWhenSyntax.whenTargetNamed(n)}whenTargetIsDefault(){return this._bindingWhenSyntax.whenTargetIsDefault()}whenTargetTagged(n,r){return this._bindingWhenSyntax.whenTargetTagged(n,r)}whenInjectedInto(n){return this._bindingWhenSyntax.whenInjectedInto(n)}whenParentNamed(n){return this._bindingWhenSyntax.whenParentNamed(n)}whenParentTagged(n,r){return this._bindingWhenSyntax.whenParentTagged(n,r)}whenAnyAncestorIs(n){return this._bindingWhenSyntax.whenAnyAncestorIs(n)}whenNoAncestorIs(n){return this._bindingWhenSyntax.whenNoAncestorIs(n)}whenAnyAncestorNamed(n){return this._bindingWhenSyntax.whenAnyAncestorNamed(n)}whenAnyAncestorTagged(n,r){return this._bindingWhenSyntax.whenAnyAncestorTagged(n,r)}whenNoAncestorNamed(n){return this._bindingWhenSyntax.whenNoAncestorNamed(n)}whenNoAncestorTagged(n,r){return this._bindingWhenSyntax.whenNoAncestorTagged(n,r)}whenAnyAncestorMatches(n){return this._bindingWhenSyntax.whenAnyAncestorMatches(n)}whenNoAncestorMatches(n){return this._bindingWhenSyntax.whenNoAncestorMatches(n)}onActivation(n){return this._bindingOnSyntax.onActivation(n)}onDeactivation(n){return this._bindingOnSyntax.onDeactivation(n)}}class nH{constructor(n){Ue(this,"_binding");this._binding=n}inRequestScope(){return this._binding.scope=Or.Request,new tc(this._binding)}inSingletonScope(){return this._binding.scope=Or.Singleton,new tc(this._binding)}inTransientScope(){return this._binding.scope=Or.Transient,new tc(this._binding)}}class pM{constructor(n){Ue(this,"_bindingInSyntax");Ue(this,"_bindingWhenSyntax");Ue(this,"_bindingOnSyntax");Ue(this,"_binding");this._binding=n,this._bindingWhenSyntax=new Mb(this._binding),this._bindingOnSyntax=new bi(this._binding),this._bindingInSyntax=new nH(n)}inRequestScope(){return this._bindingInSyntax.inRequestScope()}inSingletonScope(){return this._bindingInSyntax.inSingletonScope()}inTransientScope(){return this._bindingInSyntax.inTransientScope()}when(n){return this._bindingWhenSyntax.when(n)}whenTargetNamed(n){return this._bindingWhenSyntax.whenTargetNamed(n)}whenTargetIsDefault(){return this._bindingWhenSyntax.whenTargetIsDefault()}whenTargetTagged(n,r){return this._bindingWhenSyntax.whenTargetTagged(n,r)}whenInjectedInto(n){return this._bindingWhenSyntax.whenInjectedInto(n)}whenParentNamed(n){return this._bindingWhenSyntax.whenParentNamed(n)}whenParentTagged(n,r){return this._bindingWhenSyntax.whenParentTagged(n,r)}whenAnyAncestorIs(n){return this._bindingWhenSyntax.whenAnyAncestorIs(n)}whenNoAncestorIs(n){return this._bindingWhenSyntax.whenNoAncestorIs(n)}whenAnyAncestorNamed(n){return this._bindingWhenSyntax.whenAnyAncestorNamed(n)}whenAnyAncestorTagged(n,r){return this._bindingWhenSyntax.whenAnyAncestorTagged(n,r)}whenNoAncestorNamed(n){return this._bindingWhenSyntax.whenNoAncestorNamed(n)}whenNoAncestorTagged(n,r){return this._bindingWhenSyntax.whenNoAncestorTagged(n,r)}whenAnyAncestorMatches(n){return this._bindingWhenSyntax.whenAnyAncestorMatches(n)}whenNoAncestorMatches(n){return this._bindingWhenSyntax.whenNoAncestorMatches(n)}onActivation(n){return this._bindingOnSyntax.onActivation(n)}onDeactivation(n){return this._bindingOnSyntax.onDeactivation(n)}}class rH{constructor(n){Ue(this,"_binding");this._binding=n}to(n){return this._binding.type=Wn.Instance,this._binding.implementationType=n,new pM(this._binding)}toSelf(){if(typeof this._binding.serviceIdentifier!="function")throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");const n=this._binding.serviceIdentifier;return this.to(n)}toConstantValue(n){return this._binding.type=Wn.ConstantValue,this._binding.cache=n,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Or.Singleton,new tc(this._binding)}toDynamicValue(n){return this._binding.type=Wn.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=n,this._binding.implementationType=null,new pM(this._binding)}toConstructor(n){return this._binding.type=Wn.Constructor,this._binding.implementationType=n,this._binding.scope=Or.Singleton,new tc(this._binding)}toFactory(n){return this._binding.type=Wn.Factory,this._binding.factory=n,this._binding.scope=Or.Singleton,new tc(this._binding)}toFunction(n){if(typeof n!="function")throw new Error("Value provided to function binding must be a function!");const r=this.toConstantValue(n);return this._binding.type=Wn.Function,this._binding.scope=Or.Singleton,r}toAutoFactory(n){return this._binding.type=Wn.Factory,this._binding.factory=r=>()=>r.container.get(n),this._binding.scope=Or.Singleton,new tc(this._binding)}toAutoNamedFactory(n){return this._binding.type=Wn.Factory,this._binding.factory=r=>i=>r.container.getNamed(n,i),new tc(this._binding)}toProvider(n){return this._binding.type=Wn.Provider,this._binding.provider=n,this._binding.scope=Or.Singleton,new tc(this._binding)}toService(n){this._binding.type=Wn.DynamicValue,Object.defineProperty(this._binding,"cache",{configurable:!0,enumerable:!0,get:()=>null,set(r){}}),this._binding.dynamicValue=r=>{try{return r.container.get(n)}catch{return r.container.getAsync(n)}},this._binding.implementationType=null}}class hI{constructor(){Ue(this,"bindings");Ue(this,"activations");Ue(this,"deactivations");Ue(this,"middleware");Ue(this,"moduleActivationStore")}static of(n,r,i,s,o){const a=new hI;return a.bindings=n,a.middleware=r,a.deactivations=s,a.activations=i,a.moduleActivationStore=o,a}}class rc{constructor(){Ue(this,"_map");this._map=new Map}getMap(){return this._map}add(n,r){if(this._checkNonNulish(n),r==null)throw new Error(sM);const i=this._map.get(n);i!==void 0?i.push(r):this._map.set(n,[r])}get(n){this._checkNonNulish(n);const r=this._map.get(n);if(r!==void 0)return r;throw new Error(oM)}remove(n){if(this._checkNonNulish(n),!this._map.delete(n))throw new Error(oM)}removeIntersection(n){this.traverse((r,i)=>{const s=n.hasKey(r)?n.get(r):void 0;if(s!==void 0){const o=i.filter(a=>!s.some(l=>a===l));this._setValue(r,o)}})}removeByCondition(n){const r=[];return this._map.forEach((i,s)=>{const o=[];for(const a of i)n(a)?r.push(a):o.push(a);this._setValue(s,o)}),r}hasKey(n){return this._checkNonNulish(n),this._map.has(n)}clone(){const n=new rc;return this._map.forEach((r,i)=>{r.forEach(s=>{var o;n.add(i,typeof(o=s)=="object"&&o!==null&&"clone"in o&&typeof o.clone=="function"?s.clone():s)})}),n}traverse(n){this._map.forEach((r,i)=>{n(i,r)})}_checkNonNulish(n){if(n==null)throw new Error(sM)}_setValue(n,r){r.length>0?this._map.set(n,r):this._map.delete(n)}}class fI{constructor(){Ue(this,"_map",new Map)}remove(n){const r=this._map.get(n);return r===void 0?this._getEmptyHandlersStore():(this._map.delete(n),r)}addDeactivation(n,r,i){this._getModuleActivationHandlers(n).onDeactivations.add(r,i)}addActivation(n,r,i){this._getModuleActivationHandlers(n).onActivations.add(r,i)}clone(){const n=new fI;return this._map.forEach((r,i)=>{n._map.set(i,{onActivations:r.onActivations.clone(),onDeactivations:r.onDeactivations.clone()})}),n}_getModuleActivationHandlers(n){let r=this._map.get(n);return r===void 0&&(r=this._getEmptyHandlersStore(),this._map.set(n,r)),r}_getEmptyHandlersStore(){return{onActivations:new rc,onDeactivations:new rc}}}class Pb{constructor(n){Ue(this,"id");Ue(this,"parent");Ue(this,"options");Ue(this,"_middleware");Ue(this,"_bindingDictionary");Ue(this,"_activations");Ue(this,"_deactivations");Ue(this,"_snapshots");Ue(this,"_metadataReader");Ue(this,"_moduleActivationStore");const r=n||{};if(typeof r!="object")throw new Error("Invalid Container constructor argument. Container options must be an object.");if(r.defaultScope===void 0)r.defaultScope=Or.Transient;else if(r.defaultScope!==Or.Singleton&&r.defaultScope!==Or.Transient&&r.defaultScope!==Or.Request)throw new Error('Invalid Container option. Default scope must be a string ("singleton" or "transient").');if(r.autoBindInjectable===void 0)r.autoBindInjectable=!1;else if(typeof r.autoBindInjectable!="boolean")throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(r.skipBaseClassChecks===void 0)r.skipBaseClassChecks=!1;else if(typeof r.skipBaseClassChecks!="boolean")throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:r.autoBindInjectable,defaultScope:r.defaultScope,skipBaseClassChecks:r.skipBaseClassChecks},this.id=jv(),this._bindingDictionary=new rc,this._snapshots=[],this._middleware=null,this._activations=new rc,this._deactivations=new rc,this.parent=null,this._metadataReader=new zB,this._moduleActivationStore=new fI}static merge(n,r,...i){const s=new Pb,o=[n,r,...i].map(l=>Tb(l)),a=Tb(s);return o.forEach(l=>{var u;u=a,l.traverse((h,p)=>{p.forEach(g=>{u.add(g.serviceIdentifier,g.clone())})})}),s}load(...n){const r=this._getContainerModuleHelpersFactory();for(const i of n){const s=r(i.id);i.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)}}async loadAsync(...n){const r=this._getContainerModuleHelpersFactory();for(const i of n){const s=r(i.id);await i.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)}}unload(...n){n.forEach(r=>{const i=this._removeModuleBindings(r.id);this._deactivateSingletons(i),this._removeModuleHandlers(r.id)})}async unloadAsync(...n){for(const r of n){const i=this._removeModuleBindings(r.id);await this._deactivateSingletonsAsync(i),this._removeModuleHandlers(r.id)}}bind(n){return this._bind(this._buildBinding(n))}rebind(n){return this.unbind(n),this.bind(n)}async rebindAsync(n){return await this.unbindAsync(n),this.bind(n)}unbind(n){if(this._bindingDictionary.hasKey(n)){const r=this._bindingDictionary.get(n);this._deactivateSingletons(r)}this._removeServiceFromDictionary(n)}async unbindAsync(n){if(this._bindingDictionary.hasKey(n)){const r=this._bindingDictionary.get(n);await this._deactivateSingletonsAsync(r)}this._removeServiceFromDictionary(n)}unbindAll(){this._bindingDictionary.traverse((n,r)=>{this._deactivateSingletons(r)}),this._bindingDictionary=new rc}async unbindAllAsync(){const n=[];this._bindingDictionary.traverse((r,i)=>{n.push(this._deactivateSingletonsAsync(i))}),await Promise.all(n),this._bindingDictionary=new rc}onActivation(n,r){this._activations.add(n,r)}onDeactivation(n,r){this._deactivations.add(n,r)}isBound(n){let r=this._bindingDictionary.hasKey(n);return!r&&this.parent&&(r=this.parent.isBound(n)),r}isCurrentBound(n){return this._bindingDictionary.hasKey(n)}isBoundNamed(n,r){return this.isBoundTagged(n,Co,r)}isBoundTagged(n,r,i){let s=!1;if(this._bindingDictionary.hasKey(n)){const o=this._bindingDictionary.get(n),a=function(l,u,h){const p=ZL(u,h),g=Cw(p);if(g.kind===vs.unmanaged)throw new Error("Unexpected metadata when creating target");const v=new Ib("",g,"Variable"),w=new GL(l);return new uI(u,w,null,[],v)}(this,n,{customTag:{key:r,value:i},isMultiInject:!1});s=o.some(l=>l.constraint(a))}return!s&&this.parent&&(s=this.parent.isBoundTagged(n,r,i)),s}snapshot(){this._snapshots.push(hI.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))}restore(){const n=this._snapshots.pop();if(n===void 0)throw new Error("No snapshot available to restore.");this._bindingDictionary=n.bindings,this._activations=n.activations,this._deactivations=n.deactivations,this._middleware=n.middleware,this._moduleActivationStore=n.moduleActivationStore}createChild(n){const r=new Pb(n||this.options);return r.parent=this,r}applyMiddleware(...n){const r=this._middleware?this._middleware:this._planAndResolve();this._middleware=n.reduce((i,s)=>s(i),r)}applyCustomMetadataReader(n){this._metadataReader=n}get(n){const r=this._getNotAllArgs(n,!1,!1);return this._getButThrowIfAsync(r)}async getAsync(n){const r=this._getNotAllArgs(n,!1,!1);return this._get(r)}getTagged(n,r,i){const s=this._getNotAllArgs(n,!1,!1,r,i);return this._getButThrowIfAsync(s)}async getTaggedAsync(n,r,i){const s=this._getNotAllArgs(n,!1,!1,r,i);return this._get(s)}getNamed(n,r){return this.getTagged(n,Co,r)}async getNamedAsync(n,r){return this.getTaggedAsync(n,Co,r)}getAll(n,r){const i=this._getAllArgs(n,r,!1);return this._getButThrowIfAsync(i)}async getAllAsync(n,r){const i=this._getAllArgs(n,r,!1);return this._getAll(i)}getAllTagged(n,r,i){const s=this._getNotAllArgs(n,!0,!1,r,i);return this._getButThrowIfAsync(s)}async getAllTaggedAsync(n,r,i){const s=this._getNotAllArgs(n,!0,!1,r,i);return this._getAll(s)}getAllNamed(n,r){return this.getAllTagged(n,Co,r)}async getAllNamedAsync(n,r){return this.getAllTaggedAsync(n,Co,r)}resolve(n){const r=this.isBound(n);r||this.bind(n).toSelf();const i=this.get(n);return r||this.unbind(n),i}tryGet(n){const r=this._getNotAllArgs(n,!1,!0);return this._getButThrowIfAsync(r)}async tryGetAsync(n){const r=this._getNotAllArgs(n,!1,!0);return this._get(r)}tryGetTagged(n,r,i){const s=this._getNotAllArgs(n,!1,!0,r,i);return this._getButThrowIfAsync(s)}async tryGetTaggedAsync(n,r,i){const s=this._getNotAllArgs(n,!1,!0,r,i);return this._get(s)}tryGetNamed(n,r){return this.tryGetTagged(n,Co,r)}async tryGetNamedAsync(n,r){return this.tryGetTaggedAsync(n,Co,r)}tryGetAll(n,r){const i=this._getAllArgs(n,r,!0);return this._getButThrowIfAsync(i)}async tryGetAllAsync(n,r){const i=this._getAllArgs(n,r,!0);return this._getAll(i)}tryGetAllTagged(n,r,i){const s=this._getNotAllArgs(n,!0,!0,r,i);return this._getButThrowIfAsync(s)}async tryGetAllTaggedAsync(n,r,i){const s=this._getNotAllArgs(n,!0,!0,r,i);return this._getAll(s)}tryGetAllNamed(n,r){return this.tryGetAllTagged(n,Co,r)}async tryGetAllNamedAsync(n,r){return this.tryGetAllTaggedAsync(n,Co,r)}_preDestroy(n,r){var i;if(n!==void 0&&Reflect.hasMetadata(Ob,n)){const s=Reflect.getMetadata(Ob,n);return(i=r[s.value])==null?void 0:i.call(r)}}_removeModuleHandlers(n){const r=this._moduleActivationStore.remove(n);this._activations.removeIntersection(r.onActivations),this._deactivations.removeIntersection(r.onDeactivations)}_removeModuleBindings(n){return this._bindingDictionary.removeByCondition(r=>r.moduleId===n)}_deactivate(n,r){const i=r==null?void 0:Object.getPrototypeOf(r).constructor;try{if(this._deactivations.hasKey(n.serviceIdentifier)){const o=this._deactivateContainer(r,this._deactivations.get(n.serviceIdentifier).values());if(gs(o))return this._handleDeactivationError(o.then(async()=>this._propagateContainerDeactivationThenBindingAndPreDestroyAsync(n,r,i)),n.serviceIdentifier)}const s=this._propagateContainerDeactivationThenBindingAndPreDestroy(n,r,i);if(gs(s))return this._handleDeactivationError(s,n.serviceIdentifier)}catch(s){if(s instanceof Error)throw new Error(tN(Ou(n.serviceIdentifier),s.message))}}async _handleDeactivationError(n,r){try{await n}catch(i){if(i instanceof Error)throw new Error(tN(Ou(r),i.message))}}_deactivateContainer(n,r){let i=r.next();for(;typeof i.value=="function";){const s=i.value(n);if(gs(s))return s.then(async()=>this._deactivateContainerAsync(n,r));i=r.next()}}async _deactivateContainerAsync(n,r){let i=r.next();for(;typeof i.value=="function";)await i.value(n),i=r.next()}_getContainerModuleHelpersFactory(){const n=u=>h=>{const p=this._buildBinding(h);return p.moduleId=u,this._bind(p)},r=()=>u=>{this.unbind(u)},i=()=>async u=>this.unbindAsync(u),s=()=>u=>this.isBound(u),o=u=>{const h=n(u);return p=>(this.unbind(p),h(p))},a=u=>(h,p)=>{this._moduleActivationStore.addActivation(u,h,p),this.onActivation(h,p)},l=u=>(h,p)=>{this._moduleActivationStore.addDeactivation(u,h,p),this.onDeactivation(h,p)};return u=>({bindFunction:n(u),isboundFunction:s(),onActivationFunction:a(u),onDeactivationFunction:l(u),rebindFunction:o(u),unbindAsyncFunction:i(),unbindFunction:r()})}_bind(n){return this._bindingDictionary.add(n.serviceIdentifier,n),new rH(n)}_buildBinding(n){const r=this.options.defaultScope||Or.Transient;return new jB(n,r)}async _getAll(n){return Promise.all(this._get(n))}_get(n){const r={...n,contextInterceptor:i=>i,targetType:zL.Variable};if(this._middleware){const i=this._middleware(r);if(i==null)throw new Error("Invalid return type in middleware. Middleware must return!");return i}return this._planAndResolve()(r)}_getButThrowIfAsync(n){const r=this._get(n);if(JL(r))throw new Error(`You are attempting to construct ${function(i){return typeof i=="function"?`[function/class ${i.name||"<anonymous>"}]`:typeof i=="symbol"?i.toString():`'${i}'`}(n.serviceIdentifier)} in a synchronous way but it has asynchronous dependencies.`);return r}_getAllArgs(n,r,i){return{avoidConstraints:!(r!=null&&r.enforceBindingConstraints),isMultiInject:!0,isOptional:i,serviceIdentifier:n}}_getNotAllArgs(n,r,i,s,o){return{avoidConstraints:!1,isMultiInject:r,isOptional:i,key:s,serviceIdentifier:n,value:o}}_getPlanMetadataFromNextArgs(n){const r={isMultiInject:n.isMultiInject};return n.key!==void 0&&(r.customTag={key:n.key,value:n.value}),n.isOptional===!0&&(r.isOptional=!0),r}_planAndResolve(){return n=>{let r=BB(this._metadataReader,this,n.targetType,n.serviceIdentifier,this._getPlanMetadataFromNextArgs(n),n.avoidConstraints);return r=n.contextInterceptor(r),function(s){return dI(s.plan.rootRequest.requestScope)(s.plan.rootRequest)}(r)}}_deactivateIfSingleton(n){if(n.activated)return gs(n.cache)?n.cache.then(r=>this._deactivate(n,r)):this._deactivate(n,n.cache)}_deactivateSingletons(n){for(const r of n)if(gs(this._deactivateIfSingleton(r)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}async _deactivateSingletonsAsync(n){await Promise.all(n.map(async r=>this._deactivateIfSingleton(r)))}_propagateContainerDeactivationThenBindingAndPreDestroy(n,r,i){return this.parent?this._deactivate.bind(this.parent)(n,r):this._bindingDeactivationAndPreDestroy(n,r,i)}async _propagateContainerDeactivationThenBindingAndPreDestroyAsync(n,r,i){this.parent?await this._deactivate.bind(this.parent)(n,r):await this._bindingDeactivationAndPreDestroyAsync(n,r,i)}_removeServiceFromDictionary(n){try{this._bindingDictionary.remove(n)}catch{throw new Error(`Could not unbind serviceIdentifier: ${Ou(n)}`)}}_bindingDeactivationAndPreDestroy(n,r,i){if(typeof n.onDeactivation=="function"){const s=n.onDeactivation(r);if(gs(s))return s.then(()=>this._preDestroy(i,r))}return this._preDestroy(i,r)}async _bindingDeactivationAndPreDestroyAsync(n,r,i){typeof n.onDeactivation=="function"&&await n.onDeactivation(r),await this._preDestroy(i,r)}}class Mo{constructor(n){Ue(this,"id");Ue(this,"registry");this.id=jv(),this.registry=n}}function iH(e,n,r,i){(function(s){if(s!==void 0)throw new Error(HL)})(n),t6(jL,e,r.toString(),i)}function sH(e){let n=[];if(Array.isArray(e)){n=e;const r=function(i){const s=new Set;for(const o of i){if(s.has(o))return o;s.add(o)}}(n.map(i=>i.key));if(r!==void 0)throw new Error(`${BL} ${r.toString()}`)}else n=[e];return n}function t6(e,n,r,i){const s=sH(i);let o={};Reflect.hasOwnMetadata(e,n)&&(o=Reflect.getMetadata(e,n));let a=o[r];if(a===void 0)a=[];else for(const l of a)if(s.some(u=>u.key===l.key))throw new Error(`${BL} ${l.key.toString()}`);a.push(...s),o[r]=a,Reflect.defineMetadata(e,o,n)}function pI(e){return(n,r,i)=>{typeof i=="number"?iH(n,r,i,e):function(s,o,a){if(s.prototype!==void 0)throw new Error(HL);t6(FL,s.constructor,o,a)}(n,r,e)}}function $e(){return function(e){if(Reflect.hasOwnMetadata(iM,e))throw new Error("Cannot apply @injectable decorator multiple times.");const n=Reflect.getMetadata($L,e)||[];return Reflect.defineMetadata(iM,n,e),e}}function n6(e){return pI(new Tu(Co,e))}function r6(e){return n=>(r,i,s)=>{if(n===void 0){const o=typeof r=="function"?r.name:r.constructor.name;throw new Error(`@inject called with undefined this could mean that the class ${o} has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.`)}pI(new Tu(e,n))(r,i,s)}}const oe=r6(kL);function pr(){return pI(new Tu(RL,!0))}const wc=r6(LL);function i6(e,n){return()=>(r,i)=>{const s=new Tu(e,i);if(Reflect.hasOwnMetadata(e,r.constructor))throw new Error(n);Reflect.defineMetadata(e,s,r.constructor)}}const Ai=i6(eN,"Cannot apply @postConstruct decorator multiple times in the same class"),s6=i6(Ob,"Cannot apply @preDestroy decorator multiple times in the same class");let oH=e=>crypto.getRandomValues(new Uint8Array(e)),aH=(e,n,r)=>{let i=(2<<Math.log(e.length-1)/Math.LN2)-1,s=-~(1.6*i*n/e.length);return(o=n)=>{let a="";for(;;){let l=r(s),u=s;for(;u--;)if(a+=e[l[u]&i]||"",a.length===o)return a}}},o6=(e,n=21)=>aH(e,n,oH),Wi=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");var Hm={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}},Back:{In:function(e){var n=1.70158;return e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}},Bounce:{In:function(e){return 1-Hm.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Hm.Bounce.In(e*2)*.5:Hm.Bounce.Out(e*2-1)*.5+.5}}},Om;typeof self>"u"&&typeof process<"u"&&process.hrtime?Om=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Om=self.performance.now.bind(self.performance):Date.now!==void 0?Om=Date.now:Om=function(){return new Date().getTime()};var hh=Om,a6=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=hh()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var o=this._tweens[i[s]],a=!r;o&&o.update(n,a)===!1&&!r&&delete this._tweens[i[s]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),Pp={Linear:function(e,n){var r=e.length-1,i=r*n,s=Math.floor(i),o=Pp.Utils.Linear;return n<0?o(e[0],e[1],i):n>1?o(e[r],e[r-1],r-i):o(e[s],e[s+1>r?r:s+1],i-s)},Bezier:function(e,n){for(var r=0,i=e.length-1,s=Math.pow,o=Pp.Utils.Bernstein,a=0;a<=i;a++)r+=s(1-n,i-a)*s(n,a)*e[a]*o(i,a);return r},CatmullRom:function(e,n){var r=e.length-1,i=r*n,s=Math.floor(i),o=Pp.Utils.CatmullRom;return e[0]===e[r]?(n<0&&(s=Math.floor(i=r*(1+n))),o(e[(s-1+r)%r],e[s],e[(s+1)%r],e[(s+2)%r],i-s)):n<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):o(e[s?s-1:0],e[s],e[r<s+1?r:s+1],e[r<s+2?r:s+2],i-s)},Utils:{Linear:function(e,n,r){return(n-e)*r+e},Bernstein:function(e,n){var r=Pp.Utils.Factorial;return r(e)/r(n)/r(e-n)},Factorial:function(){var e=[1];return function(n){var r=1;if(e[n])return e[n];for(var i=n;i>1;i--)r*=i;return e[n]=r,r}}(),CatmullRom:function(e,n,r,i,s){var o=(r-e)*.5,a=(i-n)*.5,l=s*s,u=s*l;return(2*n-2*r+o+a)*u+(-3*n+3*r-2*o-a)*l+o*s+n}}},gI=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),l6=new a6,lH=function(){function e(n,r){r===void 0&&(r=l6),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Hm.Linear.None,this._interpolationFunction=Pp.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=gI.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(n,r){return this._valuesEnd=Object.create(n),r!==void 0&&(this._duration=r),this},e.prototype.duration=function(n){return this._duration=n,this},e.prototype.start=function(n){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n!==void 0?typeof n=="string"?hh()+parseFloat(n):n:hh(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(n,r,i,s){for(var o in i){var a=n[o],l=Array.isArray(a),u=l?"array":typeof a,h=!l&&Array.isArray(i[o]);if(!(u==="undefined"||u==="function")){if(h){var p=i[o];if(p.length===0)continue;p=p.map(this._handleRelativeValue.bind(this,a)),i[o]=[a].concat(p)}if((u==="object"||l)&&a&&!h){r[o]=l?[]:{};for(var g in a)r[o][g]=a[g];s[o]=l?[]:{},this._setupProperties(a,r[o],i[o],s[o])}else typeof r[o]>"u"&&(r[o]=a),l||(r[o]*=1),h?s[o]=i[o].slice().reverse():s[o]=r[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=hh()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=hh()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return this._group=n,this},e.prototype.delay=function(n){return this._delayTime=n,this},e.prototype.repeat=function(n){return this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return this._yoyo=n,this},e.prototype.easing=function(n){return this._easingFunction=n,this},e.prototype.interpolation=function(n){return this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){if(n===void 0&&(n=hh()),r===void 0&&(r=!0),this._isPaused)return!0;var i,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>o)return!1;r&&this.start(n)}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),s=(n-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var a=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=n+this._repeatDelayTime:this._startTime=n+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var l=0,u=this._chainedTweens.length;l<u;l++)this._chainedTweens[l].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,s){for(var o in i)if(r[o]!==void 0){var a=r[o]||0,l=i[o],u=Array.isArray(n[o]),h=Array.isArray(l),p=!u&&h;p?n[o]=this._interpolationFunction(l,s):typeof l=="object"&&l?this._updateProperties(n[o],a,l,s):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(n[o]=a+(l-a)*s))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e}(),cH="18.6.4",uH=gI.nextId,sl=l6,dH=sl.getAll.bind(sl),hH=sl.removeAll.bind(sl),fH=sl.add.bind(sl),pH=sl.remove.bind(sl),gH=sl.update.bind(sl),nN={Easing:Hm,Group:a6,Interpolation:Pp,now:hh,Sequence:gI,nextId:uH,Tween:lH,VERSION:cH,getAll:dH,removeAll:hH,add:fH,remove:pH,update:gH},rm={},FC={},$C={},gM;function yH(){return gM||(gM=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(n){function r($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(Y===0)return-1;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);var te;H<B?te=H+1+(Y-B):te=H-B+1;for(var ue=0;ue<te;++ue){var ye=(B+ue)%Y;if($[ye]===W)return ye}return-1}n.firstIndexOf=r;function i($,W,B,H){B===void 0&&(B=-1),H===void 0&&(H=0);var Y=$.length;if(Y===0)return-1;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);var te;B<H?te=B+1+(Y-H):te=B-H+1;for(var ue=0;ue<te;++ue){var ye=(B-ue+Y)%Y;if($[ye]===W)return ye}return-1}n.lastIndexOf=i;function s($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(Y===0)return-1;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);var te;H<B?te=H+1+(Y-B):te=H-B+1;for(var ue=0;ue<te;++ue){var ye=(B+ue)%Y;if(W($[ye],ye))return ye}return-1}n.findFirstIndex=s;function o($,W,B,H){B===void 0&&(B=-1),H===void 0&&(H=0);var Y=$.length;if(Y===0)return-1;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);var te;B<H?te=B+1+(Y-H):te=B-H+1;for(var ue=0;ue<te;++ue){var ye=(B-ue+Y)%Y;if(W($[ye],ye))return ye}return-1}n.findLastIndex=o;function a($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=s($,W,B,H);return Y!==-1?$[Y]:void 0}n.findFirstValue=a;function l($,W,B,H){B===void 0&&(B=-1),H===void 0&&(H=0);var Y=o($,W,B,H);return Y!==-1?$[Y]:void 0}n.findLastValue=l;function u($,W,B,H,Y){H===void 0&&(H=0),Y===void 0&&(Y=-1);var te=$.length;if(te===0)return 0;H<0?H=Math.max(0,H+te):H=Math.min(H,te-1),Y<0?Y=Math.max(0,Y+te):Y=Math.min(Y,te-1);for(var ue=H,ye=Y-H+1;ye>0;){var Ne=ye>>1,q=ue+Ne;B($[q],W)<0?(ue=q+1,ye-=Ne+1):ye=Ne}return ue}n.lowerBound=u;function h($,W,B,H,Y){H===void 0&&(H=0),Y===void 0&&(Y=-1);var te=$.length;if(te===0)return 0;H<0?H=Math.max(0,H+te):H=Math.min(H,te-1),Y<0?Y=Math.max(0,Y+te):Y=Math.min(Y,te-1);for(var ue=H,ye=Y-H+1;ye>0;){var Ne=ye>>1,q=ue+Ne;B($[q],W)>0?ye=Ne:(ue=q+1,ye-=Ne+1)}return ue}n.upperBound=h;function p($,W,B){if($===W)return!0;if($.length!==W.length)return!1;for(var H=0,Y=$.length;H<Y;++H)if(B?!B($[H],W[H]):$[H]!==W[H])return!1;return!0}n.shallowEqual=p;function g($,W){W===void 0&&(W={});var B=W.start,H=W.stop,Y=W.step;if(Y===void 0&&(Y=1),Y===0)throw new Error("Slice `step` cannot be zero.");var te=$.length;B===void 0?B=Y<0?te-1:0:B<0?B=Math.max(B+te,Y<0?-1:0):B>=te&&(B=Y<0?te-1:te),H===void 0?H=Y<0?-1:te:H<0?H=Math.max(H+te,Y<0?-1:0):H>=te&&(H=Y<0?te-1:te);var ue;Y<0&&H>=B||Y>0&&B>=H?ue=0:Y<0?ue=Math.floor((H-B+1)/Y+1):ue=Math.floor((H-B-1)/Y+1);for(var ye=[],Ne=0;Ne<ue;++Ne)ye[Ne]=$[B+Ne*Y];return ye}n.slice=g;function v($,W,B){var H=$.length;if(!(H<=1)&&(W<0?W=Math.max(0,W+H):W=Math.min(W,H-1),B<0?B=Math.max(0,B+H):B=Math.min(B,H-1),W!==B)){for(var Y=$[W],te=W<B?1:-1,ue=W;ue!==B;ue+=te)$[ue]=$[ue+te];$[B]=Y}}n.move=v;function w($,W,B){W===void 0&&(W=0),B===void 0&&(B=-1);var H=$.length;if(!(H<=1))for(W<0?W=Math.max(0,W+H):W=Math.min(W,H-1),B<0?B=Math.max(0,B+H):B=Math.min(B,H-1);W<B;){var Y=$[W],te=$[B];$[W++]=te,$[B--]=Y}}n.reverse=w;function S($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(!(Y<=1)&&(B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1),!(B>=H))){var te=H-B+1;if(W>0?W=W%te:W<0&&(W=(W%te+te)%te),W!==0){var ue=B+W;w($,B,ue-1),w($,ue,H),w($,B,H)}}}n.rotate=S;function E($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(Y!==0){B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);var te;H<B?te=H+1+(Y-B):te=H-B+1;for(var ue=0;ue<te;++ue)$[(B+ue)%Y]=W}}n.fill=E;function x($,W,B){var H=$.length;W<0?W=Math.max(0,W+H):W=Math.min(W,H);for(var Y=H;Y>W;--Y)$[Y]=$[Y-1];$[W]=B}n.insert=x;function I($,W){var B=$.length;if(W<0&&(W+=B),!(W<0||W>=B)){for(var H=$[W],Y=W+1;Y<B;++Y)$[Y-1]=$[Y];return $.length=B-1,H}}n.removeAt=I;function P($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=r($,W,B,H);return Y!==-1&&I($,Y),Y}n.removeFirstOf=P;function M($,W,B,H){B===void 0&&(B=-1),H===void 0&&(H=0);var Y=i($,W,B,H);return Y!==-1&&I($,Y),Y}n.removeLastOf=M;function k($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(Y===0)return 0;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);for(var te=0,ue=0;ue<Y;++ue)B<=H&&ue>=B&&ue<=H&&$[ue]===W||H<B&&(ue<=H||ue>=B)&&$[ue]===W?te++:te>0&&($[ue-te]=$[ue]);return te>0&&($.length=Y-te),te}n.removeAllOf=k;function A($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y,te=s($,W,B,H);return te!==-1&&(Y=I($,te)),{index:te,value:Y}}n.removeFirstWhere=A;function j($,W,B,H){B===void 0&&(B=-1),H===void 0&&(H=0);var Y,te=o($,W,B,H);return te!==-1&&(Y=I($,te)),{index:te,value:Y}}n.removeLastWhere=j;function V($,W,B,H){B===void 0&&(B=0),H===void 0&&(H=-1);var Y=$.length;if(Y===0)return 0;B<0?B=Math.max(0,B+Y):B=Math.min(B,Y-1),H<0?H=Math.max(0,H+Y):H=Math.min(H,Y-1);for(var te=0,ue=0;ue<Y;++ue)B<=H&&ue>=B&&ue<=H&&W($[ue],ue)||H<B&&(ue<=H||ue>=B)&&W($[ue],ue)?te++:te>0&&($[ue-te]=$[ue]);return te>0&&($.length=Y-te),te}n.removeAllWhere=V}(e.ArrayExt||(e.ArrayExt={}))}($C)),$C}var im={},ri={},yM;function fa(){if(yM)return ri;yM=1,Object.defineProperty(ri,"__esModule",{value:!0});function e(E){var x;return typeof E.iter=="function"?x=E.iter():x=new p(E),x}ri.iter=e;function n(E){return new g(E)}ri.iterKeys=n;function r(E){return new v(E)}ri.iterValues=r;function i(E){return new w(E)}ri.iterItems=i;function s(E){return new S(E)}ri.iterFn=s;function o(E,x){for(var I=0,P=e(E),M;(M=P.next())!==void 0;)if(x(M,I++)===!1)return}ri.each=o;function a(E,x){for(var I=0,P=e(E),M;(M=P.next())!==void 0;)if(!x(M,I++))return!1;return!0}ri.every=a;function l(E,x){for(var I=0,P=e(E),M;(M=P.next())!==void 0;)if(x(M,I++))return!0;return!1}ri.some=l;function u(E){for(var x=0,I=[],P=e(E),M;(M=P.next())!==void 0;)I[x++]=M;return I}ri.toArray=u;function h(E){for(var x=e(E),I,P={};(I=x.next())!==void 0;)P[I[0]]=I[1];return P}ri.toObject=h;var p=function(){function E(x){this._index=0,this._source=x}return E.prototype.iter=function(){return this},E.prototype.clone=function(){var x=new E(this._source);return x._index=this._index,x},E.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},E}();ri.ArrayIterator=p;var g=function(){function E(x,I){I===void 0&&(I=Object.keys(x)),this._index=0,this._source=x,this._keys=I}return E.prototype.iter=function(){return this},E.prototype.clone=function(){var x=new E(this._source,this._keys);return x._index=this._index,x},E.prototype.next=function(){if(!(this._index>=this._keys.length)){var x=this._keys[this._index++];return x in this._source?x:this.next()}},E}();ri.KeyIterator=g;var v=function(){function E(x,I){I===void 0&&(I=Object.keys(x)),this._index=0,this._source=x,this._keys=I}return E.prototype.iter=function(){return this},E.prototype.clone=function(){var x=new E(this._source,this._keys);return x._index=this._index,x},E.prototype.next=function(){if(!(this._index>=this._keys.length)){var x=this._keys[this._index++];return x in this._source?this._source[x]:this.next()}},E}();ri.ValueIterator=v;var w=function(){function E(x,I){I===void 0&&(I=Object.keys(x)),this._index=0,this._source=x,this._keys=I}return E.prototype.iter=function(){return this},E.prototype.clone=function(){var x=new E(this._source,this._keys);return x._index=this._index,x},E.prototype.next=function(){if(!(this._index>=this._keys.length)){var x=this._keys[this._index++];return x in this._source?[x,this._source[x]]:this.next()}},E}();ri.ItemIterator=w;var S=function(){function E(x){this._fn=x}return E.prototype.iter=function(){return this},E.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},E.prototype.next=function(){return this._fn.call(void 0)},E}();return ri.FnIterator=S,ri}var mM;function mH(){if(mM)return im;mM=1,Object.defineProperty(im,"__esModule",{value:!0});var e=fa();function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return new r(e.iter(i.map(e.iter)))}im.chain=n;var r=function(){function i(s){this._cloned=!1,this._source=s,this._active=void 0}return i.prototype.iter=function(){return this},i.prototype.clone=function(){var s=new i(this._source.clone());return s._active=this._active&&this._active.clone(),s._cloned=!0,this._cloned=!0,s},i.prototype.next=function(){if(this._active===void 0){var s=this._source.next();if(s===void 0)return;this._active=this._cloned?s.clone():s}var o=this._active.next();return o!==void 0?o:(this._active=void 0,this.next())},i}();return im.ChainIterator=r,im}var sm={},vM;function vH(){if(vM)return sm;vM=1,Object.defineProperty(sm,"__esModule",{value:!0});function e(){return new n}sm.empty=e;var n=function(){function r(){}return r.prototype.iter=function(){return this},r.prototype.clone=function(){return new r},r.prototype.next=function(){},r}();return sm.EmptyIterator=n,sm}var om={},bM;function bH(){if(bM)return om;bM=1,Object.defineProperty(om,"__esModule",{value:!0});var e=fa();function n(i,s){return s===void 0&&(s=0),new r(e.iter(i),s)}om.enumerate=n;var r=function(){function i(s,o){this._source=s,this._index=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){return new i(this._source.clone(),this._index)},i.prototype.next=function(){var s=this._source.next();if(s!==void 0)return[this._index++,s]},i}();return om.EnumerateIterator=r,om}var am={},wM;function wH(){if(wM)return am;wM=1,Object.defineProperty(am,"__esModule",{value:!0});var e=fa();function n(i,s){return new r(e.iter(i),s)}am.filter=n;var r=function(){function i(s,o){this._index=0,this._source=s,this._fn=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){var s=new i(this._source.clone(),this._fn);return s._index=this._index,s},i.prototype.next=function(){for(var s=this._fn,o=this._source,a;(a=o.next())!==void 0;)if(s(a,this._index++))return a},i}();return am.FilterIterator=r,am}var uu={},_M;function _H(){if(_M)return uu;_M=1,Object.defineProperty(uu,"__esModule",{value:!0});var e=fa();function n(a,l){for(var u=0,h=e.iter(a),p;(p=h.next())!==void 0;)if(l(p,u++))return p}uu.find=n;function r(a,l){for(var u=0,h=e.iter(a),p;(p=h.next())!==void 0;)if(l(p,u++))return u-1;return-1}uu.findIndex=r;function i(a,l){var u=e.iter(a),h=u.next();if(h!==void 0){for(var p=h;(h=u.next())!==void 0;)l(h,p)<0&&(p=h);return p}}uu.min=i;function s(a,l){var u=e.iter(a),h=u.next();if(h!==void 0){for(var p=h;(h=u.next())!==void 0;)l(h,p)>0&&(p=h);return p}}uu.max=s;function o(a,l){var u=e.iter(a),h=u.next();if(h!==void 0){for(var p=h,g=h;(h=u.next())!==void 0;)l(h,p)<0?p=h:l(h,g)>0&&(g=h);return[p,g]}}return uu.minmax=o,uu}var lm={},CM;function CH(){if(CM)return lm;CM=1,Object.defineProperty(lm,"__esModule",{value:!0});var e=fa();function n(i,s){return new r(e.iter(i),s)}lm.map=n;var r=function(){function i(s,o){this._index=0,this._source=s,this._fn=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){var s=new i(this._source.clone(),this._fn);return s._index=this._index,s},i.prototype.next=function(){var s=this._source.next();if(s!==void 0)return this._fn.call(void 0,s,this._index++)},i}();return lm.MapIterator=r,lm}var cm={},EM;function EH(){if(EM)return cm;EM=1,Object.defineProperty(cm,"__esModule",{value:!0});function e(i,s,o){return s===void 0?new n(0,i,1):o===void 0?new n(i,s,1):new n(i,s,o)}cm.range=e;var n=function(){function i(s,o,a){this._index=0,this._start=s,this._stop=o,this._step=a,this._length=r.rangeLength(s,o,a)}return i.prototype.iter=function(){return this},i.prototype.clone=function(){var s=new i(this._start,this._stop,this._step);return s._index=this._index,s},i.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},i}();cm.RangeIterator=n;var r;return function(i){function s(o,a,l){return l===0?1/0:o>a&&l>0||o<a&&l<0?0:Math.ceil((a-o)/l)}i.rangeLength=s}(r||(r={})),cm}var X1={},xM;function xH(){if(xM)return X1;xM=1,Object.defineProperty(X1,"__esModule",{value:!0});var e=fa();function n(r,i,s){var o=0,a=e.iter(r),l=a.next();if(l===void 0&&s===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if(l===void 0)return s;var u=a.next();if(u===void 0&&s===void 0)return l;if(u===void 0)return i(s,l,o++);var h;s===void 0?h=i(l,u,o++):h=i(i(s,l,o++),u,o++);for(var p;(p=a.next())!==void 0;)h=i(h,p,o++);return h}return X1.reduce=n,X1}var _p={},SM;function SH(){if(SM)return _p;SM=1,Object.defineProperty(_p,"__esModule",{value:!0});function e(i,s){return new r(i,s)}_p.repeat=e;function n(i){return new r(i,1)}_p.once=n;var r=function(){function i(s,o){this._value=s,this._count=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){return new i(this._value,this._count)},i.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},i}();return _p.RepeatIterator=r,_p}var um={},DM;function DH(){if(DM)return um;DM=1,Object.defineProperty(um,"__esModule",{value:!0});function e(r){var i;return typeof r.retro=="function"?i=r.retro():i=new n(r),i}um.retro=e;var n=function(){function r(i){this._source=i,this._index=i.length-1}return r.prototype.iter=function(){return this},r.prototype.clone=function(){var i=new r(this._source);return i._index=this._index,i},r.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},r}();return um.RetroArrayIterator=n,um}var Z1={},NM;function NH(){if(NM)return Z1;NM=1,Object.defineProperty(Z1,"__esModule",{value:!0});var e=fa();function n(r){var i=[],s=new Set,o=new Map;return e.each(r,a),o.forEach(function(u,h){l(h)}),i;function a(u){var h=u[0],p=u[1],g=o.get(p);g?g.push(h):o.set(p,[h])}function l(u){if(!s.has(u)){s.add(u);var h=o.get(u);h&&h.forEach(l),i.push(u)}}}return Z1.topologicSort=n,Z1}var dm={},IM;function IH(){if(IM)return dm;IM=1,Object.defineProperty(dm,"__esModule",{value:!0});var e=fa();function n(i,s){return new r(e.iter(i),s)}dm.stride=n;var r=function(){function i(s,o){this._source=s,this._step=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){return new i(this._source.clone(),this._step)},i.prototype.next=function(){for(var s=this._source.next(),o=this._step-1;o>0;--o)this._source.next();return s},i}();return dm.StrideIterator=r,dm}var zC={},OM;function OH(){return OM||(OM=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(n){function r(l,u,h){h===void 0&&(h=0);for(var p=new Array(u.length),g=0,v=h,w=u.length;g<w;++g,++v){if(v=l.indexOf(u[g],v),v===-1)return null;p[g]=v}return p}n.findIndices=r;function i(l,u,h){h===void 0&&(h=0);var p=r(l,u,h);if(!p)return null;for(var g=0,v=0,w=p.length;v<w;++v){var S=p[v]-h;g+=S*S}return{score:g,indices:p}}n.matchSumOfSquares=i;function s(l,u,h){h===void 0&&(h=0);var p=r(l,u,h);if(!p)return null;for(var g=0,v=h-1,w=0,S=p.length;w<S;++w){var E=p[w];g+=E-v-1,v=E}return{score:g,indices:p}}n.matchSumOfDeltas=s;function o(l,u,h){for(var p=[],g=0,v=0,w=u.length;g<w;){for(var S=u[g],E=u[g];++g<w&&u[g]===E+1;)E++;v<S&&p.push(l.slice(v,S)),S<E+1&&p.push(h(l.slice(S,E+1))),v=E+1}return v<l.length&&p.push(l.slice(v)),p}n.highlight=o;function a(l,u){return l<u?-1:l>u?1:0}n.cmp=a}(e.StringExt||(e.StringExt={}))}(zC)),zC}var hm={},TM;function TH(){if(TM)return hm;TM=1,Object.defineProperty(hm,"__esModule",{value:!0});var e=fa();function n(i,s){return new r(e.iter(i),s)}hm.take=n;var r=function(){function i(s,o){this._source=s,this._count=o}return i.prototype.iter=function(){return this},i.prototype.clone=function(){return new i(this._source.clone(),this._count)},i.prototype.next=function(){if(!(this._count<=0)){var s=this._source.next();if(s!==void 0)return this._count--,s}},i}();return hm.TakeIterator=r,hm}var fm={},MM;function MH(){if(MM)return fm;MM=1,Object.defineProperty(fm,"__esModule",{value:!0});var e=fa();function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return new r(i.map(e.iter))}fm.zip=n;var r=function(){function i(s){this._source=s}return i.prototype.iter=function(){return this},i.prototype.clone=function(){return new i(this._source.map(function(s){return s.clone()}))},i.prototype.next=function(){for(var s=new Array(this._source.length),o=0,a=this._source.length;o<a;++o){var l=this._source[o].next();if(l===void 0)return;s[o]=l}return s},i}();return fm.ZipIterator=r,fm}var PM;function yI(){return PM||(PM=1,function(e){function n(r){for(var i in r)e.hasOwnProperty(i)||(e[i]=r[i])}Object.defineProperty(e,"__esModule",{value:!0}),n(yH()),n(mH()),n(vH()),n(bH()),n(wH()),n(_H()),n(fa()),n(CH()),n(EH()),n(xH()),n(SH()),n(DH()),n(NH()),n(IH()),n(OH()),n(TH()),n(MH())}(FC)),FC}var VC={},BC={},AM;function PH(){return AM||(AM=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var n=yI(),r=function(){function s(o){this._root=new i.LeafNode,this.cmp=o}return Object.defineProperty(s.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"first",{get:function(){var o=i.firstLeaf(this._root);return o.size>0?o.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"last",{get:function(){var o=i.lastLeaf(this._root);return o.size>0?o.items[o.size-1]:void 0},enumerable:!0,configurable:!0}),s.prototype.iter=function(){return i.iterItems(this._root)},s.prototype.retro=function(){return i.retroItems(this._root)},s.prototype.slice=function(o,a){return i.sliceItems(this._root,o,a)},s.prototype.retroSlice=function(o,a){return i.retroSliceItems(this._root,o,a)},s.prototype.at=function(o){return i.itemAt(this._root,o)},s.prototype.has=function(o,a){return i.hasItem(this._root,o,a)},s.prototype.indexOf=function(o,a){return i.indexOf(this._root,o,a)},s.prototype.get=function(o,a){return i.getItem(this._root,o,a)},s.prototype.assign=function(o){this.clear(),this.update(o)},s.prototype.insert=function(o){var a=i.insertItem(this._root,o,this.cmp);return this._root=i.maybeSplitRoot(this._root),a},s.prototype.update=function(o){var a=this;n.each(o,function(l){a.insert(l)})},s.prototype.delete=function(o,a){var l=i.deleteItem(this._root,o,a);return this._root=i.maybeExtractRoot(this._root),l},s.prototype.remove=function(o){var a=i.removeItem(this._root,o);return this._root=i.maybeExtractRoot(this._root),a},s.prototype.clear=function(){i.clear(this._root),this._root=new i.LeafNode},s}();e.BPlusTree=r,function(s){function o(a,l){var u=new s(l);return u.assign(a),u}s.from=o}(r=e.BPlusTree||(e.BPlusTree={})),e.BPlusTree=r;var i;(function(s){var o=function(){function q(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(q.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(q.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(q.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),q}();s.BranchNode=o;var a=function(){function q(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(q.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(q.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(q.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),q}();s.LeafNode=a;function l(q){for(;q.type===0;)q=q.children[0];return q}s.firstLeaf=l;function u(q){for(;q.type===0;)q=q.children[q.children.length-1];return q}s.lastLeaf=u;function h(q){var G=l(q);return new W(G,0,-1)}s.iterItems=h;function p(q){var G=u(q);return new B(G,G.size-1,-1)}s.retroItems=p;function g(q,G,ae){G===void 0?G=0:G<0?G=Math.max(0,G+q.size):G=Math.min(G,q.size),ae===void 0?ae=q.size:ae<0?ae=Math.max(0,ae+q.size):ae=Math.min(ae,q.size);var ge=Math.max(0,ae-G);if(ge===0)return n.empty();for(;q.type===0;){var X=H(q.sizes,G);X>0&&(G-=q.sizes[X-1]),q=q.children[X]}return new W(q,G,ge)}s.sliceItems=g;function v(q,G,ae){G===void 0?G=q.size-1:G<0?G=Math.max(-1,G+q.size):G=Math.min(G,q.size-1),ae===void 0?ae=-1:ae<0?ae=Math.max(-1,ae+q.size):ae=Math.min(ae,q.size-1);var ge=Math.max(0,G-ae);if(ge===0)return n.empty();for(;q.type===0;){var X=H(q.sizes,G);X>0&&(G-=q.sizes[X-1]),q=q.children[X]}return new B(q,G,ge)}s.retroSliceItems=v;function w(q,G){if(G<0&&(G+=q.size),!(G<0||G>=q.size)){for(;q.type===0;){var ae=H(q.sizes,G);ae>0&&(G-=q.sizes[ae-1]),q=q.children[ae]}return q.items[G]}}s.itemAt=w;function S(q,G,ae){for(;q.type===0;){var ge=Y(q.items,G,ae);q=q.children[ge]}var X=te(q.items,G,ae);return X>=0}s.hasItem=S;function E(q,G,ae){for(var ge=0;q.type===0;){var X=Y(q.items,G,ae);X>0&&(ge+=q.sizes[X-1]),q=q.children[X]}var ee=te(q.items,G,ae);return ee>=0?ge+ee:-ge+ee}s.indexOf=E;function x(q,G,ae){for(;q.type===0;){var ge=Y(q.items,G,ae);q=q.children[ge]}var X=te(q.items,G,ae);return X>=0?q.items[X]:void 0}s.getItem=x;function I(q,G,ae){if(q.type===1){var ge=te(q.items,G,ae),X;return ge>=0?(X=q.items[ge],q.items[ge]=G):(X=void 0,n.ArrayExt.insert(q.items,-ge-1,G)),X}var ee=Y(q.items,G,ae),ie=q.children[ee],we=ie.size,Se=I(ie,G,ae),J=ie.size;if(q.items[ee]=ie.items[0],we===J)return Se;if(ie.width>V){var Re=ye(ie);n.ArrayExt.insert(q.children,ee+1,Re),n.ArrayExt.insert(q.items,ee+1,Re.items[0])}return ue(q,ee),Se}s.insertItem=I;function P(q,G,ae){if(q.type===1){var ge=te(q.items,G,ae);return ge<0?void 0:n.ArrayExt.removeAt(q.items,ge)}var X=Y(q.items,G,ae),ee=q.children[X],ie=ee.size,we=P(ee,G,ae),Se=ee.size;return ie===Se||(q.items[X]=ee.items[0],ee.width<$&&(X=Ne(q,X)),ue(q,X)),we}s.deleteItem=P;function M(q,G){if(G<0&&(G+=q.size),!(G<0||G>=q.size)){if(q.type===1)return n.ArrayExt.removeAt(q.items,G);var ae=H(q.sizes,G);ae>0&&(G-=q.sizes[ae]);var ge=q.children[ae],X=M(ge,G);return q.items[ae]=ge.items[0],ge.width<$&&(ae=Ne(q,ae)),ue(q,ae),X}}s.removeItem=M;function k(q){q.type===0?(n.each(q.children,k),q.children.length=0,q.sizes.length=0,q.items.length=0):(q.items.length=0,q.next=null,q.prev=null)}s.clear=k;function A(q){if(q.width<=V)return q;var G=new o,ae=ye(q);return G.sizes[0]=q.size,G.sizes[1]=q.size+ae.size,G.children[0]=q,G.children[1]=ae,G.items[0]=q.items[0],G.items[1]=ae.items[0],G}s.maybeSplitRoot=A;function j(q){if(q.type===1||q.children.length>1)return q;var G=q.children.pop();return k(q),G}s.maybeExtractRoot=j;var V=32,$=V>>1,W=function(){function q(G,ae,ge){this._node=G,this._index=ae,this._count=ge}return q.prototype.iter=function(){return this},q.prototype.clone=function(){return new q(this._node,this._index,this._count)},q.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},q}(),B=function(){function q(G,ae,ge){this._node=G,this._index=ae,this._count=ge}return q.prototype.iter=function(){return this},q.prototype.clone=function(){return new q(this._node,this._index,this._count)},q.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},q}();function H(q,G){for(var ae=q.length,ge=0;ge<ae;++ge)if(q[ge]>G)return ge;return ae-1}function Y(q,G,ae){for(var ge=q.length,X=1;X<ge;++X)if(ae(q[X],G)>0)return X-1;return ge-1}function te(q,G,ae){for(var ge=q.length,X=0;X<ge;++X){var ee=ae(q[X],G);if(ee===0)return X;if(ee>0)return-X-1}return-ge-1}function ue(q,G){for(var ae=q.sizes,ge=q.children,X=G>0?ae[G-1]:0,ee=ge.length;G<ee;++G)X=ae[G]=X+ge[G].size;ae.length=ge.length}function ye(q){if(q.type===1){for(var G=new a,ae=q.items,ge=G.items,X=$,ee=ae.length;X<ee;++X)ge.push(ae[X]);return ae.length=$,q.next&&(q.next.prev=G),G.next=q.next,G.prev=q,q.next=G,G}for(var ie=new o,we=q.children,Se=ie.children,X=$,ee=we.length;X<ee;++X)Se.push(we[X]);we.length=$;for(var J=q.items,Re=ie.items,X=$,ee=J.length;X<ee;++X)Re.push(J[X]);return J.length=$,ue(q,$),ue(ie,0),ie}function Ne(q,G){var ae,ge,X,ee,ie,we,Se=q.children[G],J=G===0?q.children[G+1]:q.children[G-1],Re=G===0,be=Se.type===1,Oe=J.width>$;if(be&&Oe&&Re){var Ee=Se,Le=J;return Ee.items.push(Le.items.shift()),q.items[G+1]=Le.items[0],G}if(be&&Oe&&!Re){var Ee=Se,Le=J;return Ee.items.unshift(Le.items.pop()),q.items[G]=Ee.items[0],G-1}if(be&&!Oe&&Re){var Ee=Se,Le=J;return(ae=Le.items).unshift.apply(ae,Ee.items),n.ArrayExt.removeAt(q.children,G),n.ArrayExt.removeAt(q.items,G+1),Ee.prev&&(Ee.prev.next=Le),Le.prev=Ee.prev,k(Ee),G}if(be&&!Oe&&!Re){var Ee=Se,Le=J;return(ge=Le.items).push.apply(ge,Ee.items),n.ArrayExt.removeAt(q.children,G),n.ArrayExt.removeAt(q.items,G),Ee.next&&(Ee.next.prev=Le),Le.next=Ee.next,k(Ee),G-1}if(!be&&Oe&&Re){var Ee=Se,Le=J;return Ee.children.push(Le.children.shift()),Ee.items.push(Le.items.shift()),q.items[G+1]=Le.items[0],ue(Ee,Ee.width-1),ue(Le,0),G}if(!be&&Oe&&!Re){var Ee=Se,Le=J;return Ee.children.unshift(Le.children.pop()),Ee.items.unshift(Le.items.pop()),q.items[G]=Ee.items[0],ue(Ee,0),ue(Le,Le.width-1),G-1}if(!be&&!Oe&&Re){var Ee=Se,Le=J;return(X=Le.children).unshift.apply(X,Ee.children),(ee=Le.items).unshift.apply(ee,Ee.items),n.ArrayExt.removeAt(q.children,G),n.ArrayExt.removeAt(q.items,G+1),ue(Le,0),Ee.children.length=0,k(Ee),G}if(!be&&!Oe&&!Re){var Ee=Se,Le=J;return(ie=Le.children).push.apply(ie,Ee.children),(we=Le.items).push.apply(we,Ee.items),n.ArrayExt.removeAt(q.children,G),n.ArrayExt.removeAt(q.items,G),ue(Le,0),Ee.children.length=0,k(Ee),G-1}throw"unreachable"}})(i||(i={}))}(BC)),BC}var HC={},RM;function AH(){return RM||(RM=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var n=yI(),r=function(){function s(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(s.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),s.prototype.iter=function(){return new s.ForwardValueIterator(this._first)},s.prototype.retro=function(){return new s.RetroValueIterator(this._last)},s.prototype.nodes=function(){return new s.ForwardNodeIterator(this._first)},s.prototype.retroNodes=function(){return new s.RetroNodeIterator(this._last)},s.prototype.assign=function(o){var a=this;this.clear(),n.each(o,function(l){a.addLast(l)})},s.prototype.push=function(o){this.addLast(o)},s.prototype.pop=function(){return this.removeLast()},s.prototype.shift=function(o){this.addFirst(o)},s.prototype.unshift=function(){return this.removeFirst()},s.prototype.addFirst=function(o){var a=new i.LinkedListNode(this,o);return this._first?(a.next=this._first,this._first.prev=a,this._first=a):(this._first=a,this._last=a),this._size++,a},s.prototype.addLast=function(o){var a=new i.LinkedListNode(this,o);return this._last?(a.prev=this._last,this._last.next=a,this._last=a):(this._first=a,this._last=a),this._size++,a},s.prototype.insertBefore=function(o,a){if(!a||a===this._first)return this.addFirst(o);if(!(a instanceof i.LinkedListNode)||a.list!==this)throw new Error("Reference node is not owned by the list.");var l=new i.LinkedListNode(this,o),u=a,h=u.prev;return l.next=u,l.prev=h,u.prev=l,h.next=l,this._size++,l},s.prototype.insertAfter=function(o,a){if(!a||a===this._last)return this.addLast(o);if(!(a instanceof i.LinkedListNode)||a.list!==this)throw new Error("Reference node is not owned by the list.");var l=new i.LinkedListNode(this,o),u=a,h=u.next;return l.next=h,l.prev=u,u.next=l,h.prev=l,this._size++,l},s.prototype.removeFirst=function(){var o=this._first;if(o)return o===this._last?(this._first=null,this._last=null):(this._first=o.next,this._first.prev=null),o.list=null,o.next=null,o.prev=null,this._size--,o.value},s.prototype.removeLast=function(){var o=this._last;if(o)return o===this._first?(this._first=null,this._last=null):(this._last=o.prev,this._last.next=null),o.list=null,o.next=null,o.prev=null,this._size--,o.value},s.prototype.removeNode=function(o){if(!(o instanceof i.LinkedListNode)||o.list!==this)throw new Error("Node is not owned by the list.");var a=o;a===this._first&&a===this._last?(this._first=null,this._last=null):a===this._first?(this._first=a.next,this._first.prev=null):a===this._last?(this._last=a.prev,this._last.next=null):(a.next.prev=a.prev,a.prev.next=a.next),a.list=null,a.next=null,a.prev=null,this._size--},s.prototype.clear=function(){for(var o=this._first;o;){var a=o.next;o.list=null,o.prev=null,o.next=null,o=a}this._first=null,this._last=null,this._size=0},s}();e.LinkedList=r,function(s){function o(p){var g=new s;return g.assign(p),g}s.from=o;var a=function(){function p(g){this._node=g}return p.prototype.iter=function(){return this},p.prototype.clone=function(){return new p(this._node)},p.prototype.next=function(){if(this._node){var g=this._node;return this._node=g.next,g.value}},p}();s.ForwardValueIterator=a;var l=function(){function p(g){this._node=g}return p.prototype.iter=function(){return this},p.prototype.clone=function(){return new p(this._node)},p.prototype.next=function(){if(this._node){var g=this._node;return this._node=g.prev,g.value}},p}();s.RetroValueIterator=l;var u=function(){function p(g){this._node=g}return p.prototype.iter=function(){return this},p.prototype.clone=function(){return new p(this._node)},p.prototype.next=function(){if(this._node){var g=this._node;return this._node=g.next,g}},p}();s.ForwardNodeIterator=u;var h=function(){function p(g){this._node=g}return p.prototype.iter=function(){return this},p.prototype.clone=function(){return new p(this._node)},p.prototype.next=function(){if(this._node){var g=this._node;return this._node=g.prev,g}},p}();s.RetroNodeIterator=h}(r=e.LinkedList||(e.LinkedList={})),e.LinkedList=r;var i;(function(s){var o=function(){function a(l,u){this.list=null,this.next=null,this.prev=null,this.list=l,this.value=u}return a}();s.LinkedListNode=o})(i||(i={}))}(HC)),HC}var kM;function RH(){return kM||(kM=1,function(e){function n(r){for(var i in r)e.hasOwnProperty(i)||(e[i]=r[i])}Object.defineProperty(e,"__esModule",{value:!0}),n(PH()),n(AH())}(VC)),VC}var LM;function kH(){return LM||(LM=1,function(e){var n=rm&&rm.__extends||function(){var a=function(l,u){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var g in p)p.hasOwnProperty(g)&&(h[g]=p[g])},a(l,u)};return function(l,u){a(l,u);function h(){this.constructor=l}l.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=yI(),i=RH(),s=function(){function a(l){this.type=l}return Object.defineProperty(a.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),a.prototype.conflate=function(l){return!1},a}();e.Message=s;var o=function(a){n(l,a);function l(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(l.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),l.prototype.conflate=function(u){return!0},l}(s);e.ConflatableMessage=o,function(a){function l(ye,Ne){var q=x.get(ye);if(!q||q.length===0){$(ye,Ne);return}var G=r.every(r.retro(q),function(ae){return ae?V(ae,ye,Ne):!0});G&&$(ye,Ne)}a.sendMessage=l;function u(ye,Ne){if(!Ne.isConflatable){W(ye,Ne);return}var q=r.some(E,function(G){return G.handler!==ye||!G.msg||G.msg.type!==Ne.type||!G.msg.isConflatable?!1:G.msg.conflate(Ne)});q||W(ye,Ne)}a.postMessage=u;function h(ye,Ne){var q=x.get(ye);q&&q.indexOf(Ne)!==-1||(q?q.push(Ne):x.set(ye,[Ne]))}a.installMessageHook=h;function p(ye,Ne){var q=x.get(ye);if(q){var G=q.indexOf(Ne);G!==-1&&(q[G]=null,H(q))}}a.removeMessageHook=p;function g(ye){var Ne=x.get(ye);Ne&&Ne.length>0&&(r.ArrayExt.fill(Ne,null),H(Ne)),r.each(E,function(q){q.handler===ye&&(q.handler=null,q.msg=null)})}a.clearData=g;function v(){k||M===0||(j(M),k=!0,B(),k=!1)}a.flush=v;function w(){return P}a.getExceptionHandler=w;function S(ye){var Ne=P;return P=ye,Ne}a.setExceptionHandler=S;var E=new i.LinkedList,x=new WeakMap,I=new Set,P=function(ye){console.error(ye)},M=0,k=!1,A=function(){var ye=typeof requestAnimationFrame=="function";return ye?requestAnimationFrame:setImmediate}(),j=function(){var ye=typeof cancelAnimationFrame=="function";return ye?cancelAnimationFrame:clearImmediate}();function V(ye,Ne,q){var G=!0;try{typeof ye=="function"?G=ye(Ne,q):G=ye.messageHook(Ne,q)}catch(ae){P(ae)}return G}function $(ye,Ne){try{ye.processMessage(Ne)}catch(q){P(q)}}function W(ye,Ne){E.addLast({handler:ye,msg:Ne}),M===0&&(M=A(B))}function B(){if(M=0,!E.isEmpty){var ye={handler:null,msg:null};for(E.addLast(ye);;){var Ne=E.removeFirst();if(Ne===ye)return;Ne.handler&&Ne.msg&&l(Ne.handler,Ne.msg)}}}function H(ye){I.size===0&&A(Y),I.add(ye)}function Y(){I.forEach(te),I.clear()}function te(ye){r.ArrayExt.removeAllWhere(ye,ue)}function ue(ye){return ye===null}}(e.MessageLoop||(e.MessageLoop={}))}(rm)),rm}var Up=kH(),Ya=iL();const Ks=cn(Ya);var LH=Object.defineProperty,jH=Object.getOwnPropertyDescriptor,c6=(e,n,r,i)=>{for(var s=i>1?void 0:i?jH(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&LH(n,r,s),s},wh;(e=>{(r=>{r.ZOOM_IN="ZOOM_IN",r.ZOOM_OUT="ZOOM_OUT",r.DELETE="DELETE",r.COPY="COPY",r.PASTE="PASTE",r.UNDO="UNDO",r.REDO="REDO",r.VIEW_CLOSE_ALL_WIDGET="view.closeAllWidget",r.VIEW_CLOSE_CURRENT_WIDGET="view.closeCurrentWidget",r.VIEW_REOPEN_LAST_WIDGET="view.reopenLastWidget",r.VIEW_CLOSE_OTHER_WIDGET="view.closeOtherWidget",r.VIEW_CLOSE_BOTTOM_PANEL="view.closeBottomPannel",r.VIEW_OPEN_NEXT_TAB="view.openNextTab",r.VIEW_OEPN_LAST_TAB="view.openLastTab",r.VIEW_FULL_SCREEN="view.fullScreen",r.VIEW_SAVING_WIDGET_CLOSE_CONFIRM="view.savingWidgetCloseConfirm",r.VIEW_SHORTCUTS="view.shortcuts",r.VIEW_PREFERENCES="view.preferences",r.VIEW_LOG="view.log",r.VIEW_PROBLEMS="view.problems"})(e.Default||(e.Default={}));function n(r){return!!r&&r===Object(r)&&"id"in r}e.is=n})(wh||(wh={}));var u6=Symbol("CommandContribution"),rN;(e=>{function n(r,i){for(const s of r.values())if(s.id===i.id&&s.args.length===i.args.length&&s.args.every((o,a)=>i[a]===o))return s}e.findSimple=n})(rN||(rN={}));var FH="CommandRegistryFactory",Qa=class{constructor(){this._handlers={},this._commands={},this._commandExecutings=new Set,this.toUnregisterCommands=new Map,this.onDidExecuteCommandEmitter=new qe,this.onDidExecuteCommand=this.onDidExecuteCommandEmitter.event,this.onWillExecuteCommandEmitter=new qe,this.onWillExecuteCommand=this.onWillExecuteCommandEmitter.event}init(){for(const e of this.contributions)e.registerCommands(this)}get commands(){const e=[];for(const n of this.commandIds){const r=this.getCommand(n);r&&e.push(r)}return e}get commandIds(){return Object.keys(this._commands)}registerCommand(e,n){const r=typeof e=="string"?{id:e}:e;if(this._commands[r.id])return console.warn(`A command ${r.id} is already registered.`),on.NULL;const i=new jt(this.doRegisterCommand(r));return n&&i.push(this.registerHandler(r.id,n)),this.toUnregisterCommands.set(r.id,i),i.push(on.create(()=>this.toUnregisterCommands.delete(r.id))),i}unregisterCommand(e){const n=wh.is(e)?e.id:e,r=this.toUnregisterCommands.get(n);r&&r.dispose()}registerHandler(e,n){let r=this._handlers[e];return r||(this._handlers[e]=r=[]),r.unshift(n),{dispose:()=>{const i=r.indexOf(n);i>=0&&r.splice(i,1)}}}isVisible(e,...n){return typeof this.getVisibleHandler(e,...n)<"u"}isEnabled(e,...n){return typeof this.getActiveHandler(e,...n)<"u"}isToggled(e,...n){return typeof this.getToggledHandler(e,...n)<"u"}async executeCommand(e,...n){const r=this.getActiveHandler(e,...n),i={id:e,args:n};if(rN.findSimple(this._commandExecutings,i))return i.promise;if(r)try{this._commandExecutings.add(i),this.onWillExecuteCommandEmitter.fire({commandId:e,args:n});const o=r.execute(...n);i.promise=o;const a=await o;return this.onDidExecuteCommandEmitter.fire({commandId:e,args:n}),a}finally{this._commandExecutings.delete(i)}}getVisibleHandler(e,...n){const r=this._handlers[e];if(r)for(const i of r)try{if(!i.isVisible||i.isVisible(...n))return i}catch(s){console.error(s)}}getActiveHandler(e,...n){const r=this._handlers[e];if(r)for(const i of r)try{if(!i.isEnabled||i.isEnabled(...n))return i}catch(s){console.error(s)}}getAllHandlers(e){const n=this._handlers[e];return n?n.slice():[]}getToggledHandler(e,...n){const r=this._handlers[e];if(r)for(const i of r)try{if(i.isToggled&&i.isToggled(...n))return i}catch(s){console.error(s)}}getCommand(e){return this._commands[e]}doRegisterCommand(e){return this._commands[e.id]=e,{dispose:()=>{delete this._commands[e.id]}}}updateCommand(e,n){this._commands[e]&&(this._commands[e]={...this._commands[e],...n})}dispose(){this.onWillExecuteCommandEmitter.dispose(),this.onDidExecuteCommandEmitter.dispose()}};c6([wc(u6),pr()],Qa.prototype,"contributions",2);Qa=c6([$e()],Qa);var Ew=Symbol("CommandService"),$H=new Mo(e=>{iI(e,u6),e(Qa).toSelf().inSingletonScope(),e(Ew).toService(Qa),e(FH).toFactory(n=>()=>n.container.get(Qa))}),zH=Object.defineProperty,VH=Object.getOwnPropertyDescriptor,an=(e,n,r,i)=>{for(var s=i>1?void 0:i?VH(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&zH(n,r,s),s},ps=(e,n)=>(r,i)=>n(r,i,e),BH=Object.__proto__,HH=0,ol=class{constructor(e){this.onEntityChangeEmitter=new qe,this.onDataChangeEmitter=new qe,this.initializeDataKeys=[],this.dataManager=new Map,this.toDispose=new jt,this.preDispose=new jt,this.onEntityChange=this.onEntityChangeEmitter.event,this.onDataChange=this.onDataChangeEmitter.event,this._changeLockedTimes=0,this.isInitialized=!0,this._version=HH++,this._savedInManager=!0,this.entityManager=e.entityManager,this._id=e.id||Wi(),this._savedInManager=e.savedInManager===void 0?!0:e.savedInManager,this.isInitialized=!0,this.toDispose.push(this.onEntityChangeEmitter),this.toDispose.push(this.onDataChangeEmitter),this.register(),e.datas&&e.datas.forEach(n=>this.addData(n.registry,n.data)),this.isInitialized=!1}getDefaultDataRegistries(){return[]}get changeLocked(){return this._changeLockedTimes>0}set changeLocked(e){this._changeLockedTimes=e?this._changeLockedTimes+1:this._changeLockedTimes-1,this._changeLockedTimes<0&&(this._changeLockedTimes=0)}get type(){if(!this.constructor.type)throw new Error(`Entity Registry need a type: ${this.constructor.name}`);return this.constructor.type}get context(){return this.entityManager.context}addInitializeData(e,n){this.isInitialized=!0,e.forEach(r=>this.addData(r,n)),this.isInitialized=!1}get version(){return this._version}toJSON(){const e=[];for(const n of this.dataManager.values())e.push({type:n.type,data:n.toJSON()});return{type:this.type,id:this.id,dataList:e}}fromJSON(e){!e||!e.id||!e.type||(this.changeLocked=!0,this.reset(),e.dataList&&e.dataList.forEach(n=>{const r=this.entityManager.getDataRegistryByType(n.type);r&&this.addData(r).update(n.data)}),this.changeLocked=!1,this.fireChange())}get id(){return this._id}dispose(){this.preDispose.dispose(),this.toDispose.dispose()}get disposed(){return this.toDispose.disposed}reset(){this.changeLocked=!0;for(const e of this.dataManager.values())this.initializeDataKeys.includes(e.type)||e.dispose();this.register(),this.changeLocked=!1,this.fireChange()}get onDispose(){return this.toDispose.onDispose}fireChange(){this.changeLocked||this.isInitialized||this.disposed||(this._version++,this._version>=Number.MAX_SAFE_INTEGER&&(this._version=0),this.onEntityChangeEmitter.fire(this))}addData(e,n){this.entityManager.registerEntityData(e);let r=this.dataManager.get(e.type);if(r)return n&&this.updateData(e,n),r;const i=this.entityManager.getDataInjector(e);r=new e(this,i==null?void 0:i()),this.isInitialized&&this.initializeDataKeys.push(r.type),this.dataManager.set(e.type,r),this.toDispose.push(r),r.onDataChange(()=>{const o={type:"update",data:r,entity:this};this.onDataChangeEmitter.fire(o),this.fireChange()}),r.toDispose.push(on.create(()=>{this.initializeDataKeys.includes(e.type)||this.dataManager.delete(e.type);const o={type:"delete",data:r,entity:this};this.onDataChangeEmitter.fire(o),this.fireChange()})),r.changeLocked=!0,this.updateData(e,n||r.getDefaultData()),r.changeLocked=!1;const s={type:"add",data:r,entity:this};return this.onDataChangeEmitter.fire(s),r}get savedInManager(){return this._savedInManager}updateData(e,n){const r=this.dataManager.get(e.type);r&&r.update(n)}getData(e){return this.dataManager.get(e.type)}hasData(e){return this.dataManager.has(e.type)}removeData(e){if(this.initializeDataKeys.includes(e.type))return;const n=this.dataManager.get(e.type);n&&n.dispose()}getService(e){return this.entityManager.getService(e)}register(){this.getDefaultDataRegistries().forEach(e=>this.addData(e))}};ol.type="Entity";(e=>{function n(s){return s.type}e.getType=n;function r(s,o){return ju.isChanged(s,o)}e.checkDataChanged=r;function i(s,o){if(s===o)return!0;let a=s.__proto__;for(;a&&a!==BH;){if(a.prototype===o.prototype)return!0;a=a.__proto__}return!1}e.isRegistryOf=i})(ol||(ol={}));var Wr=class extends gL{constructor(e,n){super(),this.opts=n,this.onDataChangeEmitter=new qe,this.onWillChangeEmitter=new qe,this._changeLocked=!1,this._version=0,this.onDataChange=this.onDataChangeEmitter.event,this.onWillChange=this.onWillChangeEmitter.event,this.entity=e,this._data=this.getDefaultData(),this.toDispose.push(this.onDataChangeEmitter),this.toDispose.push(this.onWillChangeEmitter)}get type(){if(!this.constructor.type)throw new Error(`Entity Data Registry need a type: ${this.constructor.name}`);return this.constructor.type}get data(){return this._data}update(e,n){arguments.length===2?this._data[e]!==n&&(this.fireWillChange(),this._data[e]=n,this.fireChange()):this.checkChanged(e)&&(this.fireWillChange(),typeof e!="object"?this._data=e:this._data={...this._data,...e},this.fireChange())}fullyUpdate(e){ju.isChanged(this._data,e,1,!1)&&(this.fireWillChange(),this._data=e,this.fireChange())}checkChanged(e){return ol.checkDataChanged(this._data,e)}toJSON(){return this.data}fromJSON(e){this.update(e)}get changeLocked(){return this._changeLocked}set changeLocked(e){this._changeLocked=e}fireWillChange(){this.onWillChangeEmitter.fire(this)}fireChange(){this._changeLocked||(this._version++,this._version>=Number.MAX_SAFE_INTEGER&&(this._version=0),this.onDataChangeEmitter.fire(this))}bindChange(e,n){this.toDispose.push(e.onDataChange(()=>{n&&n(),this.fireChange()}))}get version(){return this._version}};Wr.type="EntityData";var Tm=class extends Wr{getDefaultData(){return ia.createDefault(vL)}get x(){return this.data.x}get y(){return this.data.y}set x(e){this.update("x",e)}set y(e){this.update("y",e)}};Tm.type="OriginData";var UH=class extends Wr{getDefaultData(){return ia.createDefault(CB)}};UH.type="OpacityData";var xu=class extends Wr{getDefaultData(){return ia.createDefault(bL)}get x(){return this.data.x}get y(){return this.data.y}set x(e){this.update("x",e)}set y(e){this.update("y",e)}};xu.type="PositionData";var Mm=class extends Wr{getDefaultData(){return ia.createDefault(wL)}};Mm.type="RotationData";var Pm=class extends Wr{getDefaultData(){return ia.createDefault(_L)}get x(){return this.data.x}get y(){return this.data.y}set x(e){this.update("x",e)}set y(e){this.update("y",e)}};Pm.type="ScaleData";var sc=class extends Wr{getDefaultData(){return ia.createDefault(mL)}get width(){return this.data.width}get height(){return this.data.height}set width(e){this.update("width",e)}set height(e){this.update("height",e)}get locked(){return!!this.data.locked}set locked(e){this.update("locked",e)}};sc.type="SizeData";var Am=class extends Wr{getDefaultData(){return ia.createDefault(CL)}get x(){return this.data.x}get y(){return this.data.y}set x(e){this.update("x",e)}set y(e){this.update("y",e)}};Am.type="SkewData";var{fixZero:UC}=qs,Fp;(e=>{function n(E,x){return x&&x.apply(E,E),UC(E),E}e.getPointWithMatrix=n;function r(E,x){const I=new Qe;if(!x||x.isSimple()){const{size:P,origin:M}=E;I.x=-(P.width*M.x)+((x==null?void 0:x.tx)||0),I.y=-(P.height*M.y)+((x==null?void 0:x.ty)||0),I.width=P.width,I.height=P.height,UC(I)}else{const P=l(E,x),M=h(E,x),k=v(E,x),A=S(E,x);I.x=Math.min(P.x,M.x,k.x,A.x),I.y=Math.min(P.y,M.y,k.y,A.y),I.width=Math.max(P.x,M.x,k.x,A.x)-I.x,I.height=Math.max(P.y,M.y,k.y,A.y)-I.y}return I}e.getBounds=r;function i(E,x){const I=new Qe;if(x.isSimple())I.x=E.x+x.tx,I.y=E.y+x.ty,I.width=E.width,I.height=E.height,UC(I);else{const P=n(E.leftTop,x),M=n(E.rightTop,x),k=n(E.leftBottom,x),A=n(E.rightBottom,x);I.x=Math.min(P.x,M.x,k.x,A.x),I.y=Math.min(P.y,M.y,k.y,A.y),I.width=Math.max(P.x,M.x,k.x,A.x)-I.x,I.height=Math.max(P.y,M.y,k.y,A.y)-I.y}return I}e.applyMatrix=i;function s(E,x){const I=l(E,x),P=h(E,x),M=v(E,x),k=S(E,x);return[I,P,M,k].sort((j,V)=>j.x-V.x)[0]}e.getLeftPointFromBounds=s;function o(E,x){const I=l(E,x),P=h(E,x),M=v(E,x),k=S(E,x);return[I,P,M,k].sort((j,V)=>j.y-V.y)[0]}e.getTopPointFromBounds=o;function a(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width/2,y:-(I.height*P.y)+I.height/2};return n(M,x)}e.getCenter=a;function l(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x),y:-(I.height*P.y)};return n(M,x)}e.getTopLeft=l;function u(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width/2,y:-(I.height*P.y)};return n(M,x)}e.getTopCenter=u;function h(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width,y:-(I.height*P.y)};return n(M,x)}e.getTopRight=h;function p(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x),y:-(I.height*P.y)+I.height/2};return n(M,x)}e.getLeftCenter=p;function g(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width,y:-(I.height*P.y)+I.height/2};return n(M,x)}e.getRightCenter=g;function v(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x),y:-(I.height*P.y)+I.height};return n(M,x)}e.getBottomLeft=v;function w(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width/2,y:-(I.height*P.y)+I.height};return n(M,x)}e.getBottomCenter=w;function S(E,x){const{size:I,origin:P}=E,M={x:-(I.width*P.x)+I.width,y:-(I.height*P.y)+I.height};return n(M,x)}e.getBottomRight=S})(Fp||(Fp={}));var qt=class extends Wr{constructor(e){super(e),this._worldTransform=new Vm,this._localTransform=new Vm,this.mutationCache=new Map,this.sizeToScale=!1,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0,this.bindChange(this.entity.addData(xu)),this.bindChange(this.entity.addData(sc)),this.bindChange(this.entity.addData(Tm)),this.bindChange(this.entity.addData(Pm)),this.bindChange(this.entity.addData(Am),()=>this.updateSkew()),this.bindChange(this.entity.addData(Mm),()=>this.updateSkew())}get children(){return this._children||[]}clearChildren(){this._children&&this._children.slice().forEach(e=>{e.setParent(void 0)})}get isContainer(){return!!this._children&&this._children.length>0}fireChange(){this.changeLocked||(this._localID++,this.mutationCache.clear(),super.fireChange())}get localTransform(){return this.updateLocalTransformMatrix(),this._localTransform}get worldTransform(){return this.updateTransformMatrix(),this._worldTransform}getDefaultData(){return ia.createDefault(EL)}update(e){e.position&&this.entity.updateData(xu,e.position),e.size&&this.entity.updateData(sc,e.size),e.origin&&this.entity.updateData(Tm,e.origin),e.scale&&this.entity.updateData(Pm,e.scale),e.skew&&this.entity.updateData(Am,e.skew),e.rotation!==void 0&&this.entity.updateData(Mm,e.rotation)}get position(){return this.entity.getData(xu)}set position(e){this.entity.updateData(xu,e)}get size(){return this.entity.getData(sc)}set size(e){this.entity.updateData(sc,e)}get origin(){return this.entity.getData(Tm)}set origin(e){this.entity.updateData(Tm,e)}get scale(){return this.entity.getData(Pm)}set scale(e){this.entity.updateData(Pm,e)}get skew(){return this.entity.getData(Am)}set skew(e){this.entity.updateData(Am,e)}get rotation(){return this.entity.getData(Mm).data}set rotation(e){this.entity.updateData(Mm,e)}get data(){return QD.toJSON(this)}updateSkew(){const{rotation:e}=this;this._cx=Math.cos(e+this.skew.y),this._sx=Math.sin(e+this.skew.y),this._cy=-Math.sin(e-this.skew.x),this._sy=Math.cos(e-this.skew.x),this._localID++}updateLocalTransformMatrix(){const e=this._localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x,e.ty=this.position.y,this._currentLocalID=this._localID,this._parentID=-1)}get localID(){return this._localID}get worldID(){return this._worldID}updateTransformMatrix(){const e=this._localTransform;this.updateLocalTransformMatrix();let n=Vm.TEMP_MATRIX,r=0;if(this.parent&&(n=this.parent.worldTransform,r=this.parent._worldID),this._parentID!==r){const i=n,s=this._worldTransform;s.a=e.a*i.a+e.b*i.c,s.b=e.a*i.b+e.b*i.d,s.c=e.c*i.a+e.d*i.c,s.d=e.c*i.b+e.d*i.d,s.tx=e.tx*i.a+e.ty*i.c+i.tx,s.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=r,this._worldID++}}setFromMatrix(e){const{a:n,b:r,c:i,d:s}=e,o=-Math.atan2(-i,s),a=Math.atan2(r,n),l=Math.abs(o+a);l<1e-5||Math.abs(aL-l)<1e-5?(this.rotation=a,this.skew.x=this.skew.y=0):(this.rotation=0,this.skew.x=o,this.skew.y=a),this.scale.x=Math.sqrt(n*n+r*r),this.scale.y=Math.sqrt(i*i+s*s),this.position.x=e.tx,this.position.y=e.ty,this.fireChange()}getMutationCache(e,n){if(this.mutationCache.has(e))return this.mutationCache.get(e);const r=n();return this.mutationCache.set(e,r),r}get bounds(){if(this.isContainer){const e=this._children;return Qe.enlarge(e.map(n=>n.bounds))}return Fp.getBounds(this,this.worldTransform)}get boundsWithoutRotation(){const{center:e}=this.bounds,{worldScale:n}=this,r=this.localSize,i=n.x*r.width,s=n.y*r.height,o={x:e.x-i/2,y:e.y-s/2};return new Qe(o.x,o.y,i,s)}get localSize(){let{size:e}=this;if(this.isContainer){const n=Qe.enlarge(this.children.map(r=>r.localBounds));e={width:n.width,height:n.height}}return{width:e.width,height:e.height}}get worldSize(){const{localSize:e}=this,{worldScale:n}=this;return{width:e.width*n.x,height:e.height*n.y}}get localBounds(){if(this.isContainer){const e=this._children,n=Qe.enlarge(e.map(r=>r.localBounds));return Fp.applyMatrix(n,this.localTransform)}return this.getMutationCache("localBounds",()=>Fp.getBounds(this,this.localTransform))}contains(e,n,r){if(this.isContainer)return this.bounds.contains(e,n);const i=this.worldTransform.applyInverse({x:e,y:n}),{width:s,height:o}=this.size;if(s===0||o===0)return!1;const a=-s*this.origin.x,l=-o*this.origin.y;return r?new gB(a+s/2,l+o/2,Math.min(s/2,o/2)).contains(i.x,i.y):i.x>=a&&i.x<a+s&&i.y>=l&&i.y<l+o}get parent(){return this._parent}isParent(e){let n=this.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}isParentTransform(e){let n=this.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}setParent(e,n=!0){this._parent!==e&&(this._parentChangedDispose&&(this._parentChangedDispose.dispose(),this._parentChangedDispose=void 0),this._parentID=-1,e&&n&&(e._children||(e._children=[]),e._children.push(this),this._parentChangedDispose=new jt,this.toDispose.push(this._parentChangedDispose),this._parentChangedDispose.pushAll([e.onDispose(()=>{this.setParent(void 0)}),on.create(()=>{const r=e._children.indexOf(this);r!==-1&&e._children.splice(r,1)})])),this._parent=e,this.fireChange())}intersects(e){return!this.isContainer&&(this.size.width===0||this.size.height===0)?!1:Qe.intersectsWithRotation(this.boundsWithoutRotation,this.worldRotation,e,0)}get worldScale(){const{parent:e}=this,n=e?e.worldScale:{x:1,y:1};return{x:this.scale.x*n.x,y:this.scale.y*n.y}}get worldRotation(){const{parent:e}=this;return e?Sb.wrap(this.rotation+e.worldRotation):Sb.wrap(this.rotation)}get worldDegree(){return Math.round(this.worldRotation*pB)}get localOrigin(){const e=this.localTransform,n=this.localBounds;return e.apply({x:this.origin.x*n.width,y:this.origin.y*n.height})}get worldOrigin(){const e=this.worldTransform,{bounds:n}=this;return e.apply({x:this.origin.x*n.width,y:this.origin.y*n.height})}widthToScaleX(e,n){const r=n&&this.parent?this.parent.worldScale.x:1;return e/r/this.localSize.width}heightToScaleY(e,n){const r=n&&this.parent?this.parent.worldScale.y:1;return e/r/this.localSize.height}sizeToScaleValue(e,n){return{x:this.widthToScaleX(e.width,n),y:this.heightToScaleY(e.height,n)}}};qt.type="TransformData";(e=>{function n(r,i){const s=i.getData(e);if(!s)return!1;for(const o of r.values()){const a=o.getData(e);if(a&&(a.isParent(s)||s.isParent(a)))return!0}return!1}e.isParentOrChildrenTransform=n})(qt||(qt={}));var KH=class{constructor(){this.execMap=new Map}push(e,n){const{execMap:r}=this;let i=r.get(e);i||(i=je.throttle(n,0),r.set(e,i)),i()}dispose(){this.execMap.clear()}},jM=4,Q1=20,FM=20;function J1(e,n,r){const i=document.createEvent("MouseEvent");return i.initMouseEvent(e,!0,!0,void 0,0,0,0,n,r,!1,!1,!1,!1,0,null),i}var Ja=class{constructor(e={}){this.onDragStartEmitter=new qe,this.onDragEndEmitter=new qe,this.onDragEmitter=new qe,this._stopGlobalEventNames=["mouseenter","mouseleave","mouseover","mouseout","contextmenu"],this.onDrag=this.onDragEmitter.event,this.onDragStart=this.onDragStartEmitter.event,this.onDragEnd=this.onDragEndEmitter.event,this._lastPos={x:0,y:0},this._updateDragScroll=n=>{if(!this._playgroundConfigEntity)return;const r=this._playgroundConfigEntity.config,i=n.endPos,{scrollX:s,width:o,height:a,scrollY:l}=r;i.x>o+s-Q1?this._startScrollX(s,!0):i.x<s+Q1?this._startScrollX(s,!1):this._stopScrollX(),i.y>a+l-Q1?this._startScrollY(l,!0):i.y<l+Q1?this._startScrollY(l,!1):this._stopScrollY()},this._disposed=!1,e.onDragStart&&this.onDragStart(n=>e.onDragStart(n,this.context)),e.onDrag&&this.onDrag(n=>e.onDrag(n,this.context)),e.onDragEnd&&this.onDragEnd(n=>e.onDragEnd(n,this.context)),e.stopGlobalEventNames&&(this._stopGlobalEventNames=e.stopGlobalEventNames)}get isStarted(){return!!this._promise}start(e,n,r,i){if(this._disposed)return Promise.resolve();if(this._promise)return this._promise;this.context=i,this.localId=xB(),this._addListeners(),this._promise=new Promise(o=>{this._resolve=o}),this._playgroundConfigEntity=r;const s=J1("mousedown",e,n);return this._startPos=this.getRelativePos(s),this.onDragStartEmitter.fire(this.getDragEvent(s)),this._promise}stop(e,n){if(this._disposed||!this._promise)return;const r=J1("mouseup",e,n);this.handleEvent(r)}dispose(){this._disposed||(this._stopScrollX(),this._stopScrollY(),this._disposed=!0,this.onDragEmitter.dispose(),this.onDragStartEmitter.dispose(),this.onDragEndEmitter.dispose(),this._finalize())}handleEvent(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._stopScrollX(),this._stopScrollY(),this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":const n=J1("mouseup",e.clientX,e.clientY);this._evtMouseUp(n);break;default:e.preventDefault(),e.stopPropagation();break}}get scale(){return this._playgroundConfigEntity?this._playgroundConfigEntity.finalScale:1}getRelativePos(e){return this._playgroundConfigEntity?this._playgroundConfigEntity.getPosFromMouseEvent(e,!1):{x:e.clientX,y:e.clientY}}getDragEvent(e){const n=this._startPos,{scale:r}=this;switch(e.type){case"mousedown":return this._lastPos=n,Object.assign(e,{id:this.localId,startPos:n,endPos:n,scale:r,movingDelta:{x:0,y:0},isStart:!0,isMoving:!1});case"mousemove":const i=this.getRelativePos(e),s={x:i.x-this._lastPos.x,y:i.y-this._lastPos.y};return this._lastPos=i,Object.assign(e,{id:this.localId,startPos:n,endPos:i,scale:r,isStart:!0,movingDelta:s,isMoving:!0});case"mouseup":return this._lastPos={x:0,y:0},Object.assign(e,{id:this.localId,startPos:n,endPos:this.getRelativePos(e),movingDelta:{x:0,y:0},scale:r,isStart:!1,isMoving:!1});default:throw new Error("unknown event")}}_finalize(){const e=this._resolve;this._removeListeners(),this._startPos=void 0,this._promise=void 0,this._resolve=void 0,e&&e()}_evtMouseMove(e){e.preventDefault(),e.stopPropagation(),this._lastMouseMoveEvent=e;const n=this.getDragEvent(e);this._updateDragScroll(n),this.onDragEmitter.fire(n)}_evtMouseUp(e){this._lastMouseMoveEvent=void 0,e.preventDefault(),e.stopPropagation(),!(e.button!==0&&e.button!==1)&&(this.onDragEndEmitter.fire(this.getDragEvent(e)),this._finalize())}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.stop(NaN,NaN)}_addListeners(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),this._stopGlobalEventNames.forEach(e=>{document.addEventListener(e,this,!0)})}_removeListeners(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._stopGlobalEventNames.forEach(e=>{document.removeEventListener(e,this,!0)})}_startScrollX(e,n){if(this._scrollXInterval)return;const r=window.setInterval(()=>{this._scrollXInterval&&this.fireScroll("scrollX",n)},FM);this._scrollXInterval={interval:r,origin:e}}_stopScrollX(){this._scrollXInterval&&(clearInterval(this._scrollXInterval.interval),this._scrollXInterval=void 0)}_startScrollY(e,n){if(this._scrollYInterval)return;const r=window.setInterval(()=>{this.fireScroll("scrollY",n)},FM);this._scrollYInterval={interval:r,origin:e}}_stopScrollY(){this._scrollYInterval&&(clearInterval(this._scrollYInterval.interval),this._scrollYInterval=void 0)}fireScroll(e,n){const r=e==="scrollY"?this._scrollYInterval:this._scrollXInterval;if(!r)return;const i=r.origin=n?r.origin+jM:r.origin-jM,s=this._playgroundConfigEntity.config[e];this._playgroundConfigEntity.updateConfig({[e]:i});const o=this._playgroundConfigEntity.config[e];if(o!==s){const a=this._lastMouseMoveEvent,l={x:e==="scrollX"?o-r.origin:0,y:e==="scrollY"?o-r.origin:0},u=J1("mousemove",a.clientX+l.x,a.clientY+l.y),h=this.getDragEvent(u);this.onDragEmitter.fire(h)}}},sh;(e=>{function n(r,i,s={}){sh&&sh.stop(NaN,NaN);const o=sh=new e({onDragStart(a,l){s.onDragStart&&s.onDragStart(a,l)},onDrag(a,l){s.onDrag&&s.onDrag(a,l)},onDragEnd(a,l){s.onDragEnd&&s.onDragEnd(a,l),o.dispose(),sh===o&&(sh=void 0)}});return o.start(r,i,s.config,s.context),on.create(()=>{o.stop(0,0),o.dispose(),sh===o&&(sh=void 0)})}e.startDrag=n})(Ja||(Ja={}));var iN=0;function WH(){iN++;function e(n){iN<=0||(requestAnimationFrame(e),nN.update(n))}requestAnimationFrame(e)}function $M(){iN--}function mI(e){WH();let n=!1;const r=new nN.Tween(e.from).to(e.to,e.duration).easing(e.easing||nN.Easing.Quadratic.Out).onUpdate(()=>{n||e.onUpdate&&e.onUpdate(e.from)}).onComplete(()=>{n||(n=!0,$M(),e.onComplete&&e.onComplete(e.from))}).start();return on.create(()=>{n||(n=!0,$M(),r.stop(),e.onDispose&&e.onDispose(e.from))})}function d6(e){const[n,r]=e.overflow,[i,s]=e._delta,[o,a]=e._direction;(n<0&&i>0&&o<0||n>0&&i<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&s>0&&a<0||r>0&&s<0&&a>0)&&(e._movement[1]=e._movementBound[1])}function qH(e,n,r){return Math.max(n,Math.min(e,r))}var Jn={toVector(e,n){return e===void 0&&(e=n),Array.isArray(e)?e:[e,e]},add(e,n){return[e[0]+n[0],e[1]+n[1]]},sub(e,n){return[e[0]-n[0],e[1]-n[1]]},addTo(e,n){e[0]+=n[0],e[1]+=n[1]},subTo(e,n){e[0]-=n[0],e[1]-=n[1]}};function zM(e,n,r){return n===0||Math.abs(n)===1/0?Math.pow(e,r*5):e*n*r/(n+r*e)}function VM(e,n,r,i=.15){return i===0?qH(e,n,r):e<n?-zM(n-e,r-n,i)+n:e>r?+zM(e-r,r-n,i)+r:e}function GH(e,[n,r],[i,s]){const[[o,a],[l,u]]=e;return[VM(n,o,a,i),VM(r,l,u,s)]}var h6={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function BM(e){return e?e[0].toUpperCase()+e.slice(1):""}var YH=["enter","leave"];function XH(e=!1,n){return e&&!YH.includes(n)}function ZH(e,n="",r=!1){const i=h6[e],s=i&&i[n]||n;return"on"+BM(e)+BM(s)+(XH(r,s)?"Capture":"")}var QH=["gotpointercapture","lostpointercapture"];function JH(e){let n=e.substring(2).toLowerCase();const r=!!~n.indexOf("passive");r&&(n=n.replace("passive",""));const i=QH.includes(n)?"capturecapture":"capture",s=!!~n.indexOf(i);return s&&(n=n.replace("capture","")),{device:n,capture:s,passive:r}}function eU(e,n=""){const r=h6[e],i=r&&r[n]||n;return e+i}function xw(e){return"touches"in e}function f6(e){return xw(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function tU(e){return Array.from(e.touches).filter(n=>{var r,i;return n.target===e.currentTarget||((i=(r=e.currentTarget)==null?void 0:r.contains)==null?void 0:i.call(r,n.target))})}function nU(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function p6(e){return xw(e)?nU(e)[0]:e}function sN(e,n){try{const r=n.clientX-e.clientX,i=n.clientY-e.clientY,s=(n.clientX+e.clientX)/2,o=(n.clientY+e.clientY)/2,a=Math.hypot(r,i);return{angle:-(Math.atan2(r,i)*180)/Math.PI,distance:a,origin:[s,o]}}catch{}return null}function rU(e){return tU(e).map(n=>n.identifier)}function HM(e,n){const[r,i]=Array.from(e.touches).filter(s=>n.includes(s.identifier));return sN(r,i)}function KC(e){const n=p6(e);return xw(e)?n.identifier:n.pointerId}function Kp(e){const n=p6(e);return[n.clientX,n.clientY]}var UM=40,KM=800;function g6(e){let{deltaX:n,deltaY:r,deltaMode:i}=e;return i===1?(n*=UM,r*=UM):i===2&&(n*=KM,r*=KM),[n,r]}function iU(e){const{scrollX:n,scrollY:r,scrollLeft:i,scrollTop:s}=e.currentTarget;return[n??i??0,r??s??0]}function sU(e){const n={};if("buttons"in e&&(n.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:i,metaKey:s,ctrlKey:o}=e;Object.assign(n,{shiftKey:r,altKey:i,metaKey:s,ctrlKey:o})}return n}function Ab(e,...n){return typeof e=="function"?e(...n):e}function oU(){}function aU(...e){return e.length===0?oU:e.length===1?e[0]:function(){let n;for(const r of e)n=r.apply(this,arguments)||n;return n}}function WM(e,n){return Object.assign({},n,e||{})}var lU=32,y6=class{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:i}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?Ab(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=e.timeStamp)}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:i}=this;n.args=this.args;let s=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,sU(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const A=n._delta.map(Math.abs);Jn.addTo(n._distance,A)}this.axisIntent&&this.axisIntent(e);const[o,a]=n._movement,[l,u]=r.threshold,{_step:h,values:p}=n;if(r.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(o)>=l&&p[0]),h[1]===!1&&(h[1]=Math.abs(a)>=u&&p[1])):(h[0]===!1&&(h[0]=Math.abs(o)>=l&&Math.sign(o)*l),h[1]===!1&&(h[1]=Math.abs(a)>=u&&Math.sign(a)*u)),n.intentional=h[0]!==!1||h[1]!==!1,!n.intentional)return;const g=[0,0];if(r.hasCustomTransform){const[A,j]=p;g[0]=h[0]!==!1?A-h[0]:0,g[1]=h[1]!==!1?j-h[1]:0}else g[0]=h[0]!==!1?o-h[0]:0,g[1]=h[1]!==!1?a-h[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(g);const v=n.offset,w=n._active&&!n._blocked||n.active;w&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=Ab(r.bounds,n)),this.setup&&this.setup()),n.movement=g,this.computeOffset()));const[S,E]=n.offset,[[x,I],[P,M]]=n._bounds;n.overflow=[S<x?-1:S>I?1:0,E<P?-1:E>M?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const k=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=GH(n._bounds,n.offset,k),n.delta=Jn.sub(n.offset,v),this.computeMovement(),w&&(!n.last||s>lU)){n.delta=Jn.sub(n.offset,v);const A=n.delta.map(Math.abs);Jn.addTo(n.distance,A),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&s>0&&(n.velocity=[A[0]/s,A[1]/s],n.timeDelta=s)}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const i=this.handler({...n,...e,[this.aliasKey]:e.values});i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}};function cU([e,n],r){const i=Math.abs(e),s=Math.abs(n);if(i>s&&i>r)return"x";if(s>i&&s>r)return"y"}var Fv=class extends y6{constructor(){super(...arguments),this.aliasKey="xy"}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=Jn.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=Jn.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const i=typeof r.axisThreshold=="object"?r.axisThreshold[f6(e)]:r.axisThreshold;n.axis=cU(n._movement,i)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}},uU=class extends Fv{constructor(){super(...arguments),this.ingKey="wheeling"}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const n=this.state;n._delta=g6(e),Jn.addTo(n._movement,n._delta),d6(n),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},dU=class extends Fv{constructor(){super(...arguments),this.ingKey="scrolling"}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const n=this.state,r=iU(e);n._delta=Jn.sub(r,n._values),Jn.addTo(n._movement,n._delta),this.computeValues(r),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},hU=30,fU=100,pU=class extends y6{constructor(){super(...arguments),this.ingKey="pinching",this.aliasKey="da"}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:n,lastOffset:r}=this.state;e==="wheel"?this.state.offset=Jn.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:n}=this.state;this.state.movement=[e[0]/n[0],e[1]-n[1]]}axisIntent(){const e=this.state,[n,r]=e._movement;if(!e.axis){const i=Math.abs(n)*hU-Math.abs(r);i<0?e.axis="angle":i>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(s=>r.has(s))||r.size<2)return;this.start(e),n._touchIds=Array.from(r).slice(0,2);const i=HM(e,n._touchIds);i&&this.pinchStart(e,i)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const n=this.state,r=n._pointerEvents,i=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(o=>i.has(o))||(r.size<2&&r.set(e.pointerId,e),n._pointerEvents.size<2))return;this.start(e);const s=sN(...Array.from(r.values()));s&&this.pinchStart(e,s)}pinchStart(e,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const n=HM(e,this.state._touchIds);n&&this.pinchMove(e,n)}pointerMove(e){const n=this.state._pointerEvents;if(n.has(e.pointerId)&&n.set(e.pointerId,e),!this.state._active)return;const r=sN(...Array.from(n.values()));r&&this.pinchMove(e,r)}pinchMove(e,n){const r=this.state,i=r._values[1],s=n.angle-i;let o=0;Math.abs(s)>270&&(o+=Math.sign(s)),this.computeValues([n.distance,n.angle-360*o]),r.origin=n.origin,r.turns=o,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const n=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}n._pointerEvents.has(e.pointerId)&&n._pointerEvents.delete(e.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const n=this.state;n._active||(this.start(e),this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY];const r=n._movement;n._movement=[e.scale-1,e.rotation],n._delta=Jn.sub(n._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>e[r]):!e[n])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const r=this.state;let i=-g6(e)[1]/fU*r.offset[0];Math.abs(i)>.1&&(i=.1*Math.sign(i)),r._delta=[i,0],Jn.addTo(r._movement,r._delta),d6(r),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const n=this.config.device;n&&(e(n,"start",this[n+"Start"].bind(this)),e(n,"change",this[n+"Move"].bind(this)),e(n,"end",this[n+"End"].bind(this)),e(n,"cancel",this[n+"End"].bind(this)),e("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},gU=class extends Fv{constructor(){super(...arguments),this.ingKey="moving"}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(Kp(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const n=Kp(e),r=this.state;r._delta=Jn.sub(n,r._values),Jn.addTo(r._movement,r._delta),this.computeValues(n),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},yU=class extends Fv{constructor(){super(...arguments),this.ingKey="hovering"}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(Kp(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const n=this.state;if(!n._active)return;n._active=!1;const r=Kp(e);n._movement=n._delta=Jn.sub(r,n._values),this.computeValues(r),this.compute(e),n.delta=n.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},mU=e=>e,qM=.15,m6={enabled(e=!0){return e},eventOptions(e,n,r){return{...r.shared.eventOptions,...e}},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[qM,qM];case!1:return[0,0];default:return Jn.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return Jn.toVector(e)},transform(e,n,r){const i=e||r.shared.transform;return this.hasCustomTransform=!!i,i||mU},threshold(e){return Jn.toVector(e,0)}},vU=0,Fh={...m6,axis(e,n,{axis:r}){if(this.lockDirection=r==="lock",!this.lockDirection)return r},axisThreshold(e=vU){return e},bounds(e={}){if(typeof e=="function")return o=>Fh.bounds(e(o));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:n=-1/0,right:r=1/0,top:i=-1/0,bottom:s=1/0}=e;return[[n,r],[i,s]]}},GM={ArrowRight:(e,n=1)=>[e*n,0],ArrowLeft:(e,n=1)=>[-1*e*n,0],ArrowUp:(e,n=1)=>[0,-1*e*n],ArrowDown:(e,n=1)=>[0,e*n]},bU=class extends Fv{constructor(){super(...arguments),this.ingKey="dragging"}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),i={left:n.left-r.left+e.offset[0],right:n.right-r.right+e.offset[0],top:n.top-r.top+e.offset[1],bottom:n.bottom-r.bottom+e.offset[1]};e._bounds=Fh.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(i&&i.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=KC(e),r._pointerActive=!0,this.computeValues(Kp(e)),this.computeInitial(),n.preventScrollAxis&&f6(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,r=this.config;if(!n._pointerActive)return;const i=KC(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;const s=Kp(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=Jn.sub(s,n._values),this.computeValues(s)),Jn.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const i=KC(e);if(n._pointerId!==void 0&&i!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,o]=n._distance;if(n.tap=s<=r.tapsThreshold&&o<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[a,l]=n._delta,[u,h]=n._movement,[p,g]=r.swipe.velocity,[v,w]=r.swipe.distance,S=r.swipe.duration;if(n.elapsedTime<S){const E=Math.abs(a/n.timeDelta),x=Math.abs(l/n.timeDelta);E>p&&Math.abs(u)>v&&(n.swipe[0]=Math.sign(a)),x>g&&Math.abs(h)>w&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,r=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,wU(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=GM[e.key];if(n){const r=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=n(this.config.keyboardDisplacement,i),r._keyboardActive=!0,Jn.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in GM&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}};function wU(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}var _U=Fh,CU=Fh,$v=typeof window<"u"&&window.document&&window.document.createElement;function v6(){return $v&&"ontouchstart"in window}function EU(){return v6()||$v&&window.navigator.maxTouchPoints>1}function xU(){return $v&&"onpointerdown"in window}function SU(){return $v&&"exitPointerLock"in window.document}function DU(){try{return"constructor"in GestureEvent}catch{return!1}}var So={isBrowser:$v,gesture:DU(),touch:v6(),touchscreen:EU(),pointer:xU(),pointerLock:SU()},NU={...m6,device(e,n,{shared:r,pointer:{touch:i=!1}={}}){if(r.target&&!So.touch&&So.gesture)return"gesture";if(So.touch&&i)return"touch";if(So.touchscreen){if(So.pointer)return"pointer";if(So.touch)return"touch"}},bounds(e,n,{scaleBounds:r={},angleBounds:i={}}){const s=a=>{const l=WM(Ab(r,a),{min:-1/0,max:1/0});return[l.min,l.max]},o=a=>{const l=WM(Ab(i,a),{min:-1/0,max:1/0});return[l.min,l.max]};return typeof r!="function"&&typeof i!="function"?[s(),o()]:a=>[s(a),o(a)]},threshold(e,n,r){return this.lockDirection=r.axis==="lock",Jn.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}},IU={...Fh,mouseOnly:(e=!0)=>e},OU={...Fh,mouseOnly:(e=!0)=>e},TU=250,MU=180,PU=.5,AU=50,RU=250,kU=10,YM={mouse:0,touch:0,pen:8},LU={...Fh,device(e,n,{pointer:{touch:r=!1,lock:i=!1,mouse:s=!1}={}}){return this.pointerLock=i&&So.pointerLock,So.touch&&r?"touch":this.pointerLock?"mouse":So.pointer&&!s?"pointer":So.touch?"touch":"mouse"},preventScrollAxis(e,n,{preventScroll:r}){if(this.preventScrollDelay=typeof r=="number"?r:r||r===void 0&&e?TU:void 0,!(!So.touchscreen||r===!1))return e||(r!==void 0?"y":void 0)},pointerCapture(e,n,{pointer:{capture:r=!0,buttons:i=1,keys:s=!0}={}}){return this.pointerButtons=i,this.keys=s,!this.pointerLock&&this.device==="pointer"&&r},threshold(e,n,{filterTaps:r=!1,tapsThreshold:i=3,axis:s=void 0}){const o=Jn.toVector(e,r?i:s?1:0);return this.filterTaps=r,this.tapsThreshold=i,o},swipe({velocity:e=PU,distance:n=AU,duration:r=RU}={}){return{velocity:this.transform(Jn.toVector(e)),distance:this.transform(Jn.toVector(n)),duration:r}},delay(e=0){switch(e){case!0:return MU;case!1:return 0;default:return e}},axisThreshold(e){return e?{...YM,...e}:YM},keyboardDisplacement(e=kU){return e}},vI=new Map,oN=new Map;function jU(e){vI.set(e.key,e.engine),oN.set(e.key,e.resolver)}var FU={key:"drag",engine:bU,resolver:LU},$U={key:"hover",engine:yU,resolver:OU},zU={key:"move",engine:gU,resolver:IU},VU={key:"pinch",engine:pU,resolver:NU},BU={key:"scroll",engine:dU,resolver:CU},HU={key:"wheel",engine:uU,resolver:_U},UU=class{constructor(){this._timeouts=new Map}add(e,n,r=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...i))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}},b6=class{constructor(e,n){this._listeners=new Set,this._ctrl=e,this._gestureKey=n}add(e,n,r,i,s){const o=this._listeners,a=eU(n,r),u={...this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},...s};e.addEventListener(a,i,u);const h=()=>{e.removeEventListener(a,i,u),o.delete(h)};return o.add(h),h}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}},KU={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=So.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:n=!1}={}){return{passive:e,capture:n}},transform(e){return e}};function mb(e={},n){const r={};for(const[i,s]of Object.entries(n))switch(typeof s){case"function":r[i]=s.call(r,e[i],i,e);break;case"object":r[i]=mb(e[i],s);break;case"boolean":s&&(r[i]=e[i]);break}return r}function WU(e,n,r={}){const{target:i,eventOptions:s,window:o,enabled:a,transform:l,...u}=e;if(r.shared=mb({target:i,eventOptions:s,window:o,enabled:a,transform:l},KU),n){const h=oN.get(n);r[n]=mb({shared:r.shared,...u},h)}else for(const h in u){const p=oN.get(h);p&&(r[h]=mb({shared:r.shared,...u[h]},p))}return r}var qU=class{constructor(e){this.gestures=new Set,this._targetEventStore=new b6(this),this.gestureEventStores={},this.gestureTimeoutStores={},this.handlers={},this.config={},this.pointerIds=new Set,this.touchIds=new Set,this.state={shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}},GU(this,e)}setEventIds(e){if(xw(e))return this.touchIds=new Set(rU(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=WU(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const o of this.gestures){const a=this.config[o],l=XM(r,a.eventOptions,!!i);if(a.enabled){const u=vI.get(o);new u(this,e,o).bind(l)}}const s=XM(r,n.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o]({...this.state.shared,event:a,args:e}),void 0,!0)}for(const s in r)r[s]=aU(...r[s]);if(!i)return r;for(const s in r){const{device:o,capture:a,passive:l}=JH(s);this._targetEventStore.add(i,o,"",r[s],{capture:a,passive:l})}}}};function Cp(e,n){e.gestures.add(n),e.gestureEventStores[n]=new b6(e,n),e.gestureTimeoutStores[n]=new UU}function GU(e,n){n.drag&&Cp(e,"drag"),n.wheel&&Cp(e,"wheel"),n.scroll&&Cp(e,"scroll"),n.move&&Cp(e,"move"),n.pinch&&Cp(e,"pinch"),n.hover&&Cp(e,"hover")}var XM=(e,n,r)=>(i,s,o,a={},l=!1)=>{const u=a.capture??n.capture,h=a.passive??n.passive;let p=l?i:ZH(i,s,u);r&&h&&(p+="Passive"),e[p]=e[p]||[],e[p].push(o)},YU=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function XU(e){const n={},r={},i=new Set;for(let s in e)YU.test(s)?(i.add(RegExp.lastMatch),r[s]=e[s]):n[s]=e[s];return[r,n,i]}function Ep(e,n,r,i,s,o){if(!e.has(r)||!vI.has(i))return;const a=r+"Start",l=r+"End",u=h=>{let p;return h.first&&a in n&&n[a](h),r in n&&(p=n[r](h)),h.last&&l in n&&n[l](h),p};s[i]=u,o[i]=o[i]||{}}function ZU(e,n){const[r,i,s]=XU(e),o={};return Ep(s,r,"onDrag","drag",o,n),Ep(s,r,"onWheel","wheel",o,n),Ep(s,r,"onScroll","scroll",o,n),Ep(s,r,"onPinch","pinch",o,n),Ep(s,r,"onMove","move",o,n),Ep(s,r,"onHover","hover",o,n),{handlers:o,config:n,nativeHandlers:i}}var QU=class{constructor(e,n,r,i,s){this._target=e,this._gestureKey=i,this._ctrl=new qU(n),this._ctrl.applyHandlers(n,s),this._ctrl.applyConfig({...r,target:e},i),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(e){this._ctrl.clean(),this._ctrl.applyConfig({...e,target:this._target},this._gestureKey),this._ctrl.effect()}};function JU(e){return e.forEach(jU),function(n,r,i){const{handlers:s,nativeHandlers:o,config:a}=ZU(r,i||{});return new QU(n,s,a,void 0,o)}}var w6=function(e,n,r){return JU([FU,VU,BU,HU,zU,$U])(e,n,r||{})},eK=class extends gL{constructor(e,n){super(),this.target=e,this.config=n,this._pinching=!1,this.preventDefault();const r=new w6(e,{onPinch:({origin:[i,s],first:o,last:a,movement:[l],offset:[u,h]})=>{this.handlePinch({first:o,last:a,originX:i,originY:s,newScale:u})}},{pinch:{scaleBounds:()=>this.getScaleBounds(),from:()=>[this.config.finalScale,0],modifierKey:["metaKey","ctrlKey"]}});this.toDispose.push(on.create(()=>{r.destroy()}))}handlePinch(e){const{first:n,last:r,originX:i,originY:s,newScale:o}=e;if(Number.isNaN(e.newScale))return;n&&(this._pinching=!0),r&&(this._pinching=!1);const a=this.config.finalScale,l=this.config.getPosFromMouseEvent({clientX:i,clientY:s},!1),u={x:l.x/a*o,y:l.y/a*o};this.config.updateConfig({scrollX:this.config.config.scrollX+u.x-l.x,scrollY:this.config.config.scrollY+u.y-l.y,zoom:o})}getScaleBounds(){return{min:this.config.config.minZoom,max:this.config.config.maxZoom}}preventDefault(){const e=n=>n.preventDefault();document.addEventListener("gesturestart",e),document.addEventListener("gesturechange",e),this.toDispose.push(on.create(()=>{document.removeEventListener("gesturestart",e),document.removeEventListener("gesturechange",e)}))}get pinching(){return this._pinching}},tK=e=>function(n,r){const i=`${r}Provider`;return oe(e)(n,i),pr()(n,i),{get(){var s;return(s=this[i])==null?void 0:s.call(this)},configurable:!0,enumerable:!0}},nK=Symbol("LazyInjectContext"),_h=Symbol("PlaygroundContext"),bI=Symbol("PlaygroundContextProvider"),gg=()=>tK(bI),rK=e=>{e(bI).toDynamicValue(n=>()=>{if(n.container.isBound(_h))return n.container.get(_h)})},_6=Symbol("PlaygroundContainerFactory"),iK=Symbol("EntityManagerContribution");function sK(e){class n extends Wr{getDefaultData(){return e.getDefaultConfig()}checkChanged(i){return e.checkChanged(this.data,i)}toJSON(){return super.toJSON()}}return Object.defineProperty(n,"type",{value:`_${e.type}DataMixin`}),n}var sa=class extends ol{constructor(e){super(e),this.isInitialized=!0,this.ConfigDataRegistry=sK(this),this.addData(this.ConfigDataRegistry),this.isInitialized=!1}getDefaultConfig(){return{}}checkChanged(e,n){return ol.checkDataChanged(e,n)}get config(){return this.getData(this.ConfigDataRegistry).data}updateConfig(e){this.updateData(this.ConfigDataRegistry,e)}onConfigChanged(e){return this.getData(this.ConfigDataRegistry).onDataChange(n=>e(n.data))}};sa.type="ConfigEntity";function oK(e,n){e(n).toDynamicValue(r=>r.container.get(Sn).createEntity(n)).inSingletonScope()}var Sn=class{constructor(){this.toDispose=new jt,this.onEntityChangeEmitter=new qe,this.onEntityLifeCycleEmitter=new qe,this.onEntityDataChangeEmitter=new qe,this.registryMap=new Map,this.dataRegistryMap=new Map,this.dataInjectorMap=new Map,this.entityInstanceMap=new Map,this.entityVersionMap=new Map,this.entityDataVersionMap=new Map,this.entityInstanceMapByType=new Map,this.configEntities=new Map,this.onEntityChange=this.onEntityChangeEmitter.event,this.onEntityDataChange=this.onEntityDataChangeEmitter.event,this.onEntityLifeCycleChange=this.onEntityLifeCycleEmitter.event,this.changeEntityLocked=!1,this.schedule=new KH,this.fireEntityChanged=e=>{const n=typeof e=="string"?e:e.type;let r=this.entityVersionMap.get(n)||0;r===Number.MAX_SAFE_INTEGER&&(r=0),this.entityVersionMap.set(n,r+1),!this.changeEntityLocked&&this.schedule.push(n,()=>{this.onEntityChangeEmitter.fire(n)})},this.fireEntityDataChanged=(e,n)=>{let r=this.entityDataVersionMap.get(n)||0;r===Number.MAX_SAFE_INTEGER&&(r=0),this.entityDataVersionMap.set(n,r+1),this.schedule.push(`${e}/${n}`,()=>{this.onEntityDataChangeEmitter.fire({entityType:e,entityDataType:n})})},this.fireEntityLifeCycleChanged=({type:e,entity:n})=>{this.schedule.push(`${e}/${n.id}`,()=>{this.onEntityLifeCycleEmitter.fire({type:e,entity:n})})},this.toDispose.pushAll([this.onEntityChangeEmitter,this.schedule])}init(){this.contributions.forEach(e=>{var n;return(n=e.registerEntityManager)==null?void 0:n.call(e,this)})}createEntity(e,n){if(!e.type)throw new Error(`[EntityManager] createEntity need a type: ${e}`);if(this.configEntities.has(e.type))return this.configEntities.get(e.type);const r={entityManager:this,savedInManager:!0,...n},i=new e(r);return r.savedInManager&&this.saveEntity(i),i}isConfigEntity(e){return this.configEntities.has(e)}removeEntities(e){for(const n of this.getEntities(e).values())n.dispose()}removeEntityById(e){const n=this.getEntityById(e);return n?(n.dispose(),!0):!1}resetEntities(e){this.getEntities(e).forEach(r=>{r.reset()})}resetEntity(e,n){const r=this.getEntity(e,n);r==null||r.reset()}updateConfigEntity(e,n){const r=this.configEntities.get(e.type);r&&r.updateConfig(n)}getRegistryByType(e){return this.registryMap.get(e)}registerEntity(e){if(!e.type)throw new Error(`Registry entity need a type: ${e.name}`);const n=this.registryMap.get(e.type);if(n){if(n!==e)throw new Error(`Entity registry ${e.type} need a new type`);return}this.registryMap.set(e.type,e)}registerEntityData(e,n){if(!e.type)throw new Error(`Registry entity data need a type: ${e.name}`);this.dataRegistryMap.get(e.type)||this.dataRegistryMap.set(e.type,e),!this.dataInjectorMap.get(e.type)&&n&&this.dataInjectorMap.set(e.type,n)}getDataRegistryByType(e){return this.dataRegistryMap.get(e)}getEntityById(e){return this.entityInstanceMap.get(e)}getEntity(e,n){const r=this.getEntities(e)[0];return!r&&n?this.createEntity(e):r}getEntities(e){return this.entityInstanceMapByType.get(e.type)||[]}getEntityDatas(e,n){return this.getEntities(e).map(r=>r.getData(n)).filter(r=>!!r)}hasEntity(e){return!!this.getEntity(e)}storeState({configOnly:e=!0}={}){const n=[];for(const r of this.entityInstanceMap.values())if((!e||r instanceof sa)&&r.toJSON&&r.toJSON){const i=r.toJSON();i&&n.push(i)}return n}restoreState(e){!e||!Array.isArray(e)||e.forEach(n=>{if(!n||!n.type||!n.id)return;const r=this.getRegistryByType(n.type);if(!r){console.warn(`Playground entity registry lost: ${n.type}`);return}const i=this.createEntity(r,{id:n.id});i.fromJSON&&i.fromJSON(n)})}saveEntity(e){const{id:n}=e;if(n&&this.entityInstanceMap.has(n)){console.error(`Entity ${e.type} ${n} is created before`);return}this.entityInstanceMap.set(e.id,e);let r=this.entityInstanceMapByType.get(e.type);r||(r=[],this.entityInstanceMapByType.set(e.type,r)),e instanceof sa&&this.configEntities.set(e.type,e),r.push(e),e.onEntityChange(i=>{this.fireEntityChanged(i),this.fireEntityLifeCycleChanged({type:"update",entity:i})}),e.onDataChange(i=>{this.fireEntityDataChanged(e.type,i.data.type)}),e.toDispose.push(on.create(()=>{this.removeEntity(e),this.fireEntityLifeCycleChanged({type:"delete",entity:e})})),e.getDefaultDataRegistries().forEach(i=>this.fireEntityDataChanged(e.type,i.type)),this.fireEntityChanged(e),this.fireEntityLifeCycleChanged({type:"add",entity:e})}removeEntity(e){if(this.entityInstanceMap.has(e.id)&&this.entityInstanceMapByType.has(e.type)){const n=this.entityInstanceMapByType.get(e.type);n.indexOf(e)!==-1&&(this.entityInstanceMapByType.set(e.type,n.filter(i=>i!==e)),this.entityInstanceMap.delete(e.id),this.configEntities.has(e.type)&&this.configEntities.delete(e.type),this.fireEntityChanged(e))}}reset(){for(const e of this.entityInstanceMap.values())e.reset()}getEntityVersion(e){return this.entityVersionMap.get(typeof e=="string"?e:e.type)||0}getEntityDataVersion(e){return this.entityDataVersionMap.get(typeof e=="string"?e:e.type)||0}dispose(){this.toDispose.dispose()}getDataInjector(e){return this.dataInjectorMap.get(typeof e=="string"?e:e.type)}getService(e){var n;return(n=this.containerFactory)==null?void 0:n.get(e)}};an([wc(iK),pr()],Sn.prototype,"contributions",2);an([gg()],Sn.prototype,"context",2);an([oe(_6),pr()],Sn.prototype,"containerFactory",2);an([Ai()],Sn.prototype,"init",1);Sn=an([$e()],Sn);var wI=Symbol("EntitiesDecorator"),C6=Symbol("EntitiesByDataDecorator"),E6=Symbol("PropertiesInjected");function x6(e,n){return Reflect.getMetadata(n,e.prototype)||[]}function S6(e){return Reflect.getMetadata(E6,e)||[]}function aK(e,n){const r=S6(e);r.push(n),Reflect.defineMetadata(E6,r,e)}function lK(e){typeof e=="object"&&S6(e.constructor.prototype).forEach(r=>{e.hasOwnProperty(r)&&e[r]===void 0&&delete e[r]})}function _I(e,n,r,i){return(s,o)=>{let a=Reflect.getMetadata(e,s);if(a||(a=[],Reflect.defineMetadata(e,a,s)),Array.isArray(n)||(n=[n]),n.forEach(l=>{a.includes(l)||a.push(l)}),o&&r)return aK(s,o),{enumerable:!1,configurable:!1,get(){return r(this,o)}}}}function cK(e){return x6(e,wI)}function uK(e){return x6(e,C6)}function Tn(e){return _I(wI,e,r=>r.observeManager.get(e))}function CI(e){return _I(wI,e,r=>r.observeManager.getEntities(e))}function ml(e,n){return _I(C6,{entity:e,data:n},i=>i.observeManager.getEntityDatas(e,n))}var dK=Symbol("ProtectWheelArea"),EI=(e=>(e[e.BASE_LAYER=-2]="BASE_LAYER",e[e.TOOL_LAYER=-1]="TOOL_LAYER",e[e.NORMAL_LAYER=0]="NORMAL_LAYER",e))(EI||{}),xI=Symbol("PipelineLayerFactory"),oa=class{constructor(){this.onSelectionChangedEmitter=new qe,this.onSelectionChanged=this.onSelectionChangedEmitter.event,this.currentSelection=[],this.disposers=[]}get selection(){return this.currentSelection}isEmpty(){return this.currentSelection.length===0}set selection(e){ju.isArrayShallowChanged(this.currentSelection,e)&&(this.disposers.forEach(n=>n.dispose()),this.changeSelection(e),this.disposers=this.currentSelection.map(n=>n.onDispose(()=>{const r=this.currentSelection.filter(i=>i!==n);this.changeSelection(r)})))}changeSelection(e){this.currentSelection=e,this.onSelectionChangedEmitter.fire(this.currentSelection)}dispose(){this.onSelectionChangedEmitter.dispose()}};oa=an([$e()],oa);var hK=Symbol("StorageService"),Rb=class{constructor(){this._prefix="__gedit:"}setData(e,n){this.storage[this.prefix(e)]=JSON.stringify(n)}getData(e,n){const r=this.storage[this.prefix(e)];return r===void 0?n:JSON.parse(r)}prefix(e){return`${this._prefix}${e}`}setPrefix(e){this._prefix=e}init(){typeof window<"u"&&window.localStorage?this.storage=window.localStorage:this.storage={}}};an([Ai()],Rb.prototype,"init",1);Rb=an([$e()],Rb);var D6=Symbol("ClipboardService"),aN=class{constructor(){this.onClipboardChangedEmitter=new qe,this.onClipboardChanged=this.onClipboardChangedEmitter.event}readText(){return this._currentData}writeText(e){this._currentData!==e&&(this._currentData=e,this.onClipboardChangedEmitter.fire(e))}};aN=an([$e()],aN);var rv=class{get rightPanelVisible(){return this.isRightPanelVisible}set rightPanelVisible(e){this.isRightPanelVisible=e}};rv=an([$e()],rv);var kb=class{constructor(){this.onLoggerEmitter=new qe,this.onLogger=this.onLoggerEmitter.event}onAllLayersRendered(){this.onLoggerEmitter.fire({event:0})}onFlushRequest(e){if(e<=0)return;const n=1e3/e;this.onLoggerEmitter.fire({event:1,props:{rfi:e,fps:n}})}dispose(){this.onLoggerEmitter.dispose()}};kb=an([$e()],kb);function fK({originRenderer:e,renderedCb:n}){return R.useEffect(()=>{n()},[]),e()||null}function pK(e,n,r,i){let s=Db;function o(){const[,a]=R.useState({}),l=R.useCallback(()=>{r(e)},[e]);R.useEffect(()=>(s=()=>a({}),()=>{s=Db}));let u;try{u=i.isReady?D.createElement(fK,{originRenderer:n,renderedCb:l}):D.createElement(D.Fragment,null)}catch(h){console.error(`Render Layer "${e.constructor.name}" error `,h),u=D.createElement(D.Fragment,null)}return Ks.createPortal(u,e.node)}return{autorun:()=>s(),portal:e.renderWithReactMemo?D.memo(o):o}}var Wp=class{constructor(){this.layerEntitiesSelectorMap=new WeakMap,this.entityLayerMap=new Map,this.ableLayerMap=new Map}subscribeEntities(e,n){const r=this.getSelector(e);n.forEach(i=>{r.entities.includes(i)||r.entities.push(i);let s=this.entityLayerMap.get(i.type);s||(s=new Set,this.entityLayerMap.set(i.type,s)),s.add(e)})}subscribleEntityByData(e,n,r){const i=this.getSelector(e);let s=this.entityLayerMap.get(n.type);s||(s=new Set,this.entityLayerMap.set(n.type,s)),s.add(e);const o=[n,r];i.datas.find(a=>a[0]===n&&a[1]===r)||i.datas.push(o)}getSelector(e){let n=this.layerEntitiesSelectorMap.get(e);return n||(n={entities:[],datas:[]},this.layerEntitiesSelectorMap.set(e,n)),n}getLayerEntities(e){const n=this.layerEntitiesSelectorMap.get(e);if(!n)return{entities:[],changed:!1};const r=new Set,i=new Map;let s=!1;n.entities.forEach(a=>{const l=this.entityManager.getEntities(a),u=this.entityManager.getEntityVersion(a);i.set(a.type,u);for(const h of l)r.add(h)});const o=[];for(const a of r.values())o.push(a);return ZM(i,n.lastEntityVersion)&&(n.lastEntityVersion=i,s=!0),{entities:o,changed:s}}getLayerEntityDatas(e){const n=this.layerEntitiesSelectorMap.get(e);if(!n)return{datas:[],changed:!1};const r=[],i=new Map;let s=!1;return n.datas.forEach(o=>{const[a,l]=o,u=this.entityManager.getEntityDatas(a,l),h=this.entityManager.getEntityDataVersion(l);i.set(l.type,h);for(const p of u)r.push(p)}),ZM(i,n.lastDataVersion)&&(n.lastDataVersion=i,s=!0),{datas:r,changed:s}}getLayerData(e){const n=this.getLayerEntities(e),r=this.getLayerEntityDatas(e);return{observeEntities:n.entities,observeDatas:r.datas,changed:r.changed||n.changed}}};an([oe(Sn)],Wp.prototype,"entityManager",2);Wp=an([$e()],Wp);function ZM(e=new Map,n=new Map){if(e.size!==n.size)return!0;for(const r of e.keys())if(e.get(r)!==n.get(r))return!0;return!1}var gK="flush-layer-request",yK=0,QM=class extends Up.ConflatableMessage{constructor(e){super(`${gK}_layer${yK++}`),this.layer=e}},Ch=class{constructor(e,n){this.selector=e,this.isReady=!1,this.onAllLayersRenderedEmitter=new qe,this.toDispose=new jt,this.layers=[],this.forceUpdates=new Set,this.layerAutorunMap=new Map,this.layerRenderedMap=new Map,this.layerFlushMessages=new Map,this.reactPortals=[],this.node=ft.createDivWithClass("gedit-playground-pipeline"),this.onAllLayersRendered=this.onAllLayersRenderedEmitter.event,this.toDispose.push(n.onEntityChange(r=>{const i=this.selector.entityLayerMap.get(r);i&&i.forEach(s=>this.updateLayer(s))})),this.toDispose.push(this.onAllLayersRenderedEmitter)}reportLayerRendered(e){this.layerRenderedMap.set(e,!0),Array.from(this.layerRenderedMap.values()).every(r=>r)&&(this.loggerService.onAllLayersRendered(),this.onAllLayersRenderedEmitter.fire(),window.REPORT_TTI_FOR_E2E&&window.REPORT_TTI_FOR_E2E(performance.now(),performance.getEntriesByType("resource")))}addLayer(e){if(this.layers.push(e),this.toDispose.push(e),this.layerFlushMessages.set(e,new QM(e)),e.pipelineNode=this.node,e.playgroundNode=this.node.parentElement,(e.autorun||e.render)&&!e.node&&(e.node=document.createElement("div")),e.node&&(this.node.appendChild(e.node),e.node.classList.add("gedit-playground-layer")),e.autorun){const n=e.autorun.bind(e);this.layerAutorunMap.set(e,n),e.autorun=()=>{this.updateLayer(e,!0)}}else if(e.render){this.layerRenderedMap.set(e,!1);const n=e.render.bind(e),r=pK(e,n,this.reportLayerRendered.bind(this),this);this.reactPortals.push(r.portal),this.layerAutorunMap.set(e,r.autorun),e.render=()=>{this.updateLayer(e,!0)}}}flush(e){this.layers.forEach(n=>{this.updateLayer(n,e)})}ready(){this.layers.forEach(e=>{this.loadLayerEntities(e),e.onReady&&e.onReady()}),this.isReady=!0,this.flush(!0)}dispose(){this.toDispose.dispose(),this.node.remove()}processMessage(e){e instanceof QM&&this.onFlushRequest(e.layer)}loadLayerEntities(e){const n=this.selector.getLayerData(e);return n.changed&&e.observeManager.load(n.observeEntities,n.observeDatas),n.changed}onFlushRequest(e){if(!this.isReady||this.toDispose.disposed)return!1;const n=performance.now(),r=()=>{const o=performance.now()-n;o<4||this.loggerService.onFlushRequest(o)},i=this.layerAutorunMap.get(e),s=this.loadLayerEntities(e);if(i&&(s||this.forceUpdates.has(e))){this.forceUpdates.delete(e);try{i()}catch(o){console.error(o)}return r(),!0}return r(),!1}updateLayer(e,n){n&&this.forceUpdates.add(e),Up.MessageLoop.postMessage(this,this.layerFlushMessages.get(e))}toReactComponent(){if(this.reactComp)return this.reactComp;const e=this.reactPortals,n=()=>D.createElement(D.Fragment,null,e.map((r,i)=>D.createElement(r,{key:i})));return this.reactComp=n,n}};an([oe(kb)],Ch.prototype,"loggerService",2);Ch=an([$e(),ps(0,oe(Wp)),ps(1,oe(Sn))],Ch);var xn;(e=>{e.STATE_SELECT={id:"STATE_SELECT",cursor:"",shortcut:"",cancelMode:"hold"},e.STATE_MOUSE_FRIENDLY_SELECT={id:"STATE_MOUSE_FRIENDLY_SELECT",cursor:"grab",shortcut:"",cancelMode:"hold"},e.STATE_GRAB={id:"STATE_GRAB",cursor:"grab",shortcut:"SPACE",shortcutAutoEsc:!0,shortcutWorksOnlyOnStateChanged:!0,cancelMode:"hold"}})(xn||(xn={}));var mK=[xn.STATE_SELECT,xn.STATE_MOUSE_FRIENDLY_SELECT,xn.STATE_GRAB],al=class extends sa{constructor(e){super(e),this._isPressingSpaceBar=!1,this._isPressingShift=!1,this.states=mK.slice(),this.selected=xn.STATE_SELECT.id,this.onStateChangeEmitter=new qe,this.onStateChange=this.onStateChangeEmitter.event,this.toDispose.push(this.onStateChangeEmitter)}get isPressingSpaceBar(){return this._isPressingSpaceBar}set isPressingSpaceBar(e){this._isPressingSpaceBar=e}get isPressingShift(){return this._isPressingShift}set isPressingShift(e){this._isPressingShift=e}onCancel(e,n){return this.onStateChange(r=>{r.lastState&&r.lastState.id===e&&n()})}getCurrentState(){return this.states.find(e=>e.id===this.selected)}is(e){return this.selected===e}changeState(e,n){const r=this.states.find(i=>i.id===e);if(!r)throw new Error(`Unknown editor state ${e}`);if(this.selected!==e){const i=this.getCurrentState();this.selected=e,this.onStateChangeEmitter.fire({state:r,event:n,lastState:i}),this.fireChange()}}toDefaultState(){this.changeState(xn.STATE_SELECT.id)}registerState(e){this.states.push(e),this.fireChange()}getStates(){return this.states}isMouseFriendlyMode(){return this.getCurrentState()===xn.STATE_MOUSE_FRIENDLY_SELECT}getStateFromShortcut(e){return this.states.find(n=>{if((n.shortcut==="SPACE"?" ":(n.shortcut||"").toLowerCase())===e.key.toLowerCase())return n})}};al.type="EditorStateConfigEntity";var eb=0,N6=.05,qn=class extends sa{constructor(e){super(e),this._loading=!1,this._zoomEnable=!0,this._onReadonlyOrDisabledChangeEmitter=new qe,this._onGrabDisableChangeEmitter=new qe,this.onGrabDisableChange=this._onGrabDisableChangeEmitter.event,this.onReadonlyOrDisabledChange=this._onReadonlyOrDisabledChangeEmitter.event,this.cursor="default",this.toDispose.push(this._onReadonlyOrDisabledChangeEmitter)}get grabDisable(){return this.config.grabDisable}set grabDisable(e){this.updateConfig({grabDisable:e})}getDefaultConfig(){return{scrollX:0,scrollY:0,originX:0,originY:0,width:0,height:0,minZoom:.1,maxZoom:2,zoom:1,clientX:0,clientY:0,reverseScroll:!0,overflowX:"scroll",overflowY:"scroll",disabled:!1,readonly:!1,grabDisable:!1,mouseScrollDelta:N6}}addScrollLimit(e){this._scrollLimitFn=e}updateConfig(e){e.zoom!==void 0&&(e={...e,zoom:this.normalizeZoom(e.zoom)}),e={...this.config,...e},e.reverseScroll||(e.scrollX<this.config.originX&&(e.scrollX=this.config.originX),e.scrollY<this.config.originY&&(e.scrollY=this.config.originY)),e.scrollLimitX!==void 0&&e.scrollX<e.scrollLimitX&&(e.scrollX=e.scrollLimitX),e.scrollLimitY!==void 0&&e.scrollY<e.scrollLimitY&&(e.scrollY=e.scrollLimitY),e.overflowX==="hidden"&&(e.scrollX=this.config.originX),e.overflowY==="hidden"&&(e.scrollY=this.config.originY);const{readonly:n,disabled:r,grabDisable:i}=this;super.updateConfig(this._scrollLimitFn?{...e,...this._scrollLimitFn({scrollX:e.scrollX,scrollY:e.scrollY})}:e),(n!==this.readonly||r!==this.disabled)&&this._onReadonlyOrDisabledChangeEmitter.fire({readonly:this.readonly,disabled:this.disabled}),i!==this.grabDisable&&this._onGrabDisableChangeEmitter.fire(this.grabDisable)}get finalScale(){return this.zoomEnable?this.config.zoom:1}get zoom(){return this.zoomEnable?this.config.zoom:1}get scrollData(){return{scrollX:this.config.scrollX,scrollY:this.config.scrollY}}normalizeZoom(e){return this.zoomEnable?(e<this.config.minZoom?e=this.config.minZoom:e>this.config.maxZoom&&(e=this.config.maxZoom),e):1}updateCursor(e){this.cursor!==e&&(this.cursor=e,this.fireChange())}getPosFromMouseEvent(e,n=!0){const{config:r}=this,i=n?this.finalScale:1;return{x:(e.clientX+r.scrollX-r.clientX)/i,y:(e.clientY+r.scrollY-r.clientY)/i}}toFixedPos(e){const{config:n}=this;return{x:e.x-n.scrollX+n.clientX,y:e.y-n.scrollY+n.clientY}}getViewport(e=!0){const{config:n}=this,r=e?this.finalScale:1;return new Qe(n.scrollX/r,n.scrollY/r,n.width/r,n.height/r)}isViewportVisible(e,n=0,r=!1){return Qe.isViewportVisible(e,this.getViewport(),n,r)}scrollToView(e={}){const{scrollDelta:n,position:r,easing:i=!0,easingDuration:s=300,entities:o}=e,{config:a}=this,l=e.zoom?e.zoom:this.finalScale;let u;if(o&&o.length>0){const p=o.map(g=>{const v=g.getData(qt);if(v)return v.bounds;const w=g.getData(xu),S=g.getData(sc)||{width:0,height:0};if(w)return new Qe(w.x,w.y,S.width,S.height||0)}).filter(g=>!!g);p.length>0&&(u=Qe.enlarge(p))}else r?u=new Qe(r.x,r.y,0,0):e.bounds&&(u=e.bounds);if(!u){const p=this.getDefaultConfig();u=new Qe((p.scrollX+a.width/2)/l,(p.scrollY+a.height/2)/l,0,0)}if(!e.scrollToCenter&&this.getViewport().containsRectangle(u))return Promise.resolve();const h={scrollX:(u.x+u.width/2+(n?n.x:0))*l-a.width/2,scrollY:(u.y+u.height/2+(n?n.y:0))*l-a.height/2,zoom:e.zoom};return this.scroll(h,i,s)}setPageBounds(e){this.updateConfig({pageBounds:{x:e.x,y:e.y,width:e.width,height:e.height}})}getPageBounds(){const{pageBounds:e}=this.config;if(e)return new Qe(e.x,e.y,e.width,e.height)}scrollPageBoundsToCenter(e=!0,n=16,r=!0){const i=this.getPageBounds();if(i){let s;const o=n*2;return e&&(s=Hp.fixSize({width:i.width,height:i.height},{width:o>this.config.width?o:this.config.width-o,height:o>this.config.height?o:this.config.height-o})),this.scrollToView({bounds:i,zoom:s,scrollToCenter:!0,easing:r})}return this.scrollToView({easing:r})}scroll(e,n=!0,r=300){const i=new Nb;if(this.cancelScrollTeeen&&this.cancelScrollTeeen.dispose(),n){const s={scrollX:this.config.scrollX,scrollY:this.config.scrollY,zoom:this.config.zoom};this.cancelScrollTeeen=mI({from:s,to:{...s,...e},onUpdate:o=>{this.updateConfig(o)},onComplete:()=>{this.cancelScrollTeeen=void 0,i.resolve()},onDispose:()=>{i.resolve()},duration:r})}else this.updateConfig(e),i.resolve();return i.promise}fixLayerPosition(e){ft.setStyle(e,{left:this.config.scrollX,top:this.config.scrollY})}get loading(){return this._loading}set loading(e){this.loading!==e&&(this._loading=e,this.fireChange())}get zoomEnable(){return this._zoomEnable}set zoomEnable(e){this._zoomEnable!==e&&(this._zoomEnable=e,this.fireChange())}zoomin(e,n){const r=this.config.zoom/10,i=Math.ceil((this.config.zoom+r)*10)/10;this.updateZoom(i,e,n)}zoomout(e,n){const r=this.config.zoom/10,i=Math.floor((this.config.zoom-r)*10)/10;this.updateZoom(i,e,n)}updateZoom(e,n=!0,r=200){e=this.normalizeZoom(e);const{center:i}=this.getViewport(),s=this.finalScale,o=this.zoomEnable?e:s;if(o!==s){const a={x:i.x*o-i.x*s,y:i.y*o-i.y*s};this.scroll({scrollX:this.config.scrollX+a.x,scrollY:this.config.scrollY+a.y,zoom:e},n,r)}}get disabled(){return this.config.disabled}get readonly(){return this.config.readonly}get readonlyOrDisabled(){return this.config.readonly||this.config.disabled}set readonly(e){this.updateConfig({readonly:e})}set disabled(e){this.updateConfig({disabled:e})}fitView(e,n=!0,r=0){const i=this.getViewport(!1),s=Hp.fixSize(e.pad(r,r),i);return this.scrollToView({bounds:e,zoom:s,easing:n,scrollToCenter:!0})}};qn.type="PlaygroundConfigEntity";var I6=Symbol("LayerOptions"),er=class{constructor(){this.toDispose=new jt,this.renderWithReactMemo=!0}dispose(){this.toDispose.dispose()}createDOMCache(e,n){if(!this.node)throw new Error("DomCache need a parent dom node.");return ft.createDOMCache(this.node,e,n)}getPosFromMouseEvent(e,n=!0){const r=this.config.getPosFromMouseEvent(e,n);return{x:r.x,y:r.y}}};an([oe(I6)],er.prototype,"options",2);an([oe(Sn)],er.prototype,"entityManager",2);an([gg()],er.prototype,"context",2);er=an([$e()],er);var qp=class extends er{constructor(){super(...arguments),this.startGrabScroll={scrollX:0,scrollY:0},this.cursorStyle=document.createElement("style"),this.maskNode=document.createElement("div"),this.grabDragger=new Ja({onDragStart:e=>{this.config.grabDisable||(this.config.updateCursor("grabbing"),this.startGrabScroll={scrollX:this.config.config.scrollX,scrollY:this.config.config.scrollY})},onDrag:e=>{this.config.grabDisable||this.config.updateConfig({scrollX:this.startGrabScroll.scrollX-e.endPos.x+e.startPos.x,scrollY:this.startGrabScroll.scrollY-e.endPos.y+e.startPos.y})},onDragEnd:e=>{this.isGrab()&&this.config.updateCursor("grab"),e.button===1&&(this.isMouseMode()?(this.editorStateConfig.changeState(xn.STATE_MOUSE_FRIENDLY_SELECT.id),this.config.updateCursor("grab")):(this.editorStateConfig.toDefaultState(),this.config.updateCursor("")))}})}onReady(){if(this.options={preventGlobalGesture:!1,...this.options},this.options.preventGlobalGesture){const e=new w6(document.body,{onPinch:()=>{}});document.documentElement&&(document.documentElement.style.overscrollBehaviorX="none"),document.body.style.overscrollBehaviorX="none",this.toDispose.push(on.create(()=>e.destroy()))}this.toDispose.pushAll([this.config.onGrabDisableChange(e=>{e&&this.grabDragger.stop(0,0)}),ft.addStandardDisposableListener(this.playgroundNode,"wheel",e=>{this.getScrollParent(e.target)||(e.preventDefault(),e.stopPropagation())}),this.listenPlaygroundEvent("wheel",this.handleWheelEvent.bind(this),-2,{passive:!0}),this.listenPlaygroundEvent("mousedown",e=>{const n=e.button===1;n&&!this.isMouseMode()&&this.editorStateConfig.changeState(xn.STATE_GRAB.id),this.isGrab()&&(this.editorStateConfig.isPressingSpaceBar||n)&&this.grabDragger.start(e.clientX,e.clientY)},-2),this.listenPlaygroundEvent("mousedown",e=>{var r,i;const n=(i=(r=this.options)==null?void 0:r.hoverService)==null?void 0:i.isSomeHovered();this.isMouseMode()&&!n&&!this.editorStateConfig.isPressingShift&&this.grabDragger.start(e.clientX,e.clientY)},0),this.editorStateConfig.onStateChange(this.onStateChanged.bind(this)),this.listenGlobalEvent("keydown",e=>{e.shiftKey&&(this.editorStateConfig.isPressingShift=!0,this.isMouseMode()&&this.config.updateCursor(""))},-2),this.listenGlobalEvent("keypress",e=>{if(!this.isFocused||e.target!==this.playgroundNode||this.isMouseMode())return;const n=this.editorStateConfig.getStateFromShortcut(e);e.key===" "&&(this.editorStateConfig.isPressingSpaceBar=!0),!((n==null?void 0:n.shortcutWorksOnlyOnStateChanged)===!0&&n===this.editorStateConfig.getCurrentState())&&(this.lastShortcutState=n,n&&this.editorStateConfig.changeState(n.id))},-2),this.listenGlobalEvent("keyup",e=>{e.key===" "&&(this.editorStateConfig.isPressingSpaceBar=!1),this.editorStateConfig.isPressingShift=!1,this.lastShortcutState&&this.lastShortcutState.shortcutAutoEsc&&this.editorStateConfig.toDefaultState(),this.lastShortcutState=void 0}),{dispose:()=>{this.maskNode.parentNode&&this.maskNode.parentNode.removeChild(this.maskNode),this.cursorStyle.parentNode&&this.cursorStyle.parentNode.removeChild(this.cursorStyle)}}]),this.options.ineractiveType==="MOUSE"&&this.editorStateConfig.changeState(xn.STATE_MOUSE_FRIENDLY_SELECT.id)}getCursor(e){var n,r,i;return e?((i=(r=(n=this.playgroundConfigEntity).getCursors)==null?void 0:r.call(n))==null?void 0:i[e])??e:""}isMouseMode(){return this.editorStateConfig.isMouseFriendlyMode()}onStateChanged(e){const{state:n}=e;if(this.cancelStateListen&&(this.cancelStateListen.dispose(),this.cancelStateListen=void 0),n.handle&&n.handle(this.config,e),n.cursor?(this.playgroundConfigEntity.updateCursor(n.cursor),this.currentGesture&&this.currentGesture.target.parentNode&&(this.currentGesture.target.parentNode.style.cursor=this.getCursor(n.cursor))):(this.playgroundConfigEntity.updateCursor(""),this.currentGesture&&this.currentGesture.target.parentNode&&(this.currentGesture.target.parentNode.style.cursor="")),n.cursor==="grab"||n.cursor==="grabbing"){if(n===xn.STATE_MOUSE_FRIENDLY_SELECT)return;this.maskNode.style.cssText=`
|
||
position: absolute;
|
||
width: 100%;
|
||
height: 100%;
|
||
z-index: 100;
|
||
`,this.playgroundNode.appendChild(this.maskNode)}else this.maskNode.parentNode&&this.maskNode.parentNode.removeChild(this.maskNode);n.cancelMode==="esc"?this.cancelStateListen=ft.addStandardDisposableListener(document.body,"keydown",r=>{(r.key==="Escape"||r.key==="Enter")&&this.editorStateConfig.toDefaultState()},!0):n.cancelMode==="once"&&this.editorStateConfig.toDefaultState()}isGrab(){const e=this.editorStateConfig.getCurrentState();return e===xn.STATE_GRAB||e===xn.STATE_MOUSE_FRIENDLY_SELECT}createGesture(){this.currentGesture||(this.currentGesture=new eK(this.pipelineNode.parentElement,this.config),this.currentGesture.onDispose(()=>{this.currentGesture=void 0}),this.toDispose.push(this.currentGesture))}onResize(e){this.size={...e},this.updateSizeWithRulerConfig()}updateSizeWithRulerConfig(){const{size:e}=this;e&&this.config.updateConfig({width:e.width,height:e.height,clientX:e.clientX,clientY:e.clientY})}handleScrollEvent(e){const{playgroundConfigEntity:n}=this,r=n.config.scrollX+e.deltaX,i=n.config.scrollY+e.deltaY,s={scrollX:r,scrollY:i};n.updateConfig(s)}getMouseScaleDelta(){const{mouseScrollDelta:e,zoom:n}=this.config.config;return typeof e=="function"?e(n):e??N6}handleWheelEvent(e){const n=e;if(!(this.currentGesture&&this.currentGesture.pinching||e.ctrlKey||e.metaKey)&&!this.getScrollParent(e.target)){if(this.isMouseMode()){const{zoom:r,minZoom:i,maxZoom:s,scrollX:o,scrollY:a}=this.playgroundConfigEntity.config,l=this.getMouseScaleDelta(),u=i,h=s,p=M=>M>0?-l:l,g=Math.abs(n.deltaY)>0?n.deltaY:n.deltaX,v=p(g),w=this.config.finalScale,S=e.clientX,E=e.clientY,x=Math.max(u,Math.min(h,r+v)),I=this.config.getPosFromMouseEvent({clientX:S,clientY:E},!1),P={x:I.x/w*x,y:I.y/w*x};this.config.updateConfig({scrollX:o+P.x-I.x,scrollY:a+P.y-I.y,zoom:x});return}this.handleScrollEvent(n)}}getScrollParent(e){var u;if(!e||e===this.pipelineNode.parentElement)return null;const n=e.scrollWidth>e.clientWidth,r=e.scrollHeight>e.clientHeight,i=window.getComputedStyle(e).overflowX,s=window.getComputedStyle(e).overflowY,o=["auto","scroll","overlay"].includes(i),a=["auto","scroll","overlay"].includes(s);return n&&o||r&&a||(u=this.protectWheelArea)!=null&&u.call(this,e)?e:this.getScrollParent(e.parentElement)}autorun(){const e=this.playgroundConfigEntity.config,{cursor:n}=this.playgroundConfigEntity,r=this.getCursor(n);if(this.config.zoomEnable?this.createGesture():this.currentGesture&&this.currentGesture.dispose(),ft.setStyle(this.pipelineNode,{left:-e.scrollX,top:-e.scrollY,width:e.width,height:e.height}),this.pipelineNode.parentElement.style.cursor=r,n==="grab"||n==="grabbing"){let i="";this.playgroundNode.classList.forEach(s=>{i+=`.${s}`}),this.cursorStyle.innerText=`.${i} * { cursor: ${r} }`,this.cursorStyle.parentNode||document.head.appendChild(this.cursorStyle)}else this.cursorStyle.parentNode&&this.cursorStyle.parentNode.removeChild(this.cursorStyle)}};an([Tn(qn)],qp.prototype,"playgroundConfigEntity",2);an([Tn(al)],qp.prototype,"editorStateConfig",2);an([pr(),oe(dK)],qp.prototype,"protectWheelArea",2);qp=an([$e()],qp);var vK=class{constructor(e){this.entityManager=e,this.observeEntities=[],this.observeDatas=[],this.entitiesTypeCache=new Map,this.entitiesAbleCache=new Map,this.entitiyDataCache=new Map}get size(){return this.observeEntities.length}load(e,n){this.observeEntities=e,this.observeDatas=n,this.entitiesTypeCache.clear(),this.entitiesAbleCache.clear(),this.entitiyDataCache.clear()}get(e,n){const r=this.getEntities(e);return n!==void 0?r.find(i=>i.id===n):r[0]}has(e){return!!this.get(e)}getEntities(e){let n=this.entitiesTypeCache.get(e);return n||(n=[],this.observeEntities.forEach(r=>{r.type===e.type&&n.push(r)}),this.entitiesTypeCache.set(e,n)),n.filter(r=>!r.disposed)}getEntityDatas(e,n){const r=`${e.type}:${n.type}`;let i=this.entitiyDataCache.get(r);return i||(i=this.observeDatas.filter(s=>s.type===n.type&&s.entity.type===e.type),this.entitiyDataCache.set(r,i),i)}updateConfig(e,n){const r=this.get(e);r&&r.updateConfig&&r.updateConfig(n)}getConfig(e){const n=this.get(e);if(n)return n.config}createEntity(e,n){return this.entityManager.createEntity(e,n)}removeEntities(e){this.entityManager.removeEntities(e)}[Symbol.iterator](){let e=0;const n=this.observeEntities.length;return{next:()=>{const r=e++,i=r===n;return{value:this.observeEntities[r],done:i}}}}},bK=new Up.ConflatableMessage("PIPELINE_ZOOM"),wK=new Up.ConflatableMessage("PIPELINE_SCROLL"),Io=class{constructor(){this._isFocused=!1,this.toDispose=new jt,this.allLayersMap=new Map,this.onResizeEmitter=new qe,this.onFocusEmitter=new qe,this.onBlurEmitter=new qe,this.onZoomEmitter=new qe,this.onScrollEmitter=new qe,this.onFocus=this.onFocusEmitter.event,this.onBlur=this.onBlurEmitter.event,this.onZoom=this.onZoomEmitter.event,this.onScroll=this.onScrollEmitter.event,this.playgroundEvents={},this.globalEvents={},this.onResize=this.onResizeEmitter.event,this.toDispose.pushAll([this.onResizeEmitter,this.onFocusEmitter,this.onZoomEmitter,this.onBlurEmitter,this.onScrollEmitter]),this.onFocusEmitter.event(()=>{this._isFocused=!0}),this.onBlurEmitter.event(()=>{this._isFocused=!1})}_listenEvent(e,n,r,i=0,s){const o=r?this.globalEvents:this.playgroundEvents,a=r?document:this.renderer.node.parentNode;let l=o[e];if(!l){const g={handleEvent:v=>{const w=l.handlers;for(let S=0,E=w.length;S<E;S++)if(w[S].handle(v))return}};a.addEventListener(e,g,s),l=o[e]={handlers:[],dispose:()=>{a.removeEventListener(e,g),delete o[e]}}}const{handlers:u}=l,h={handle:n,priority:i};u.unshift(h),u.sort((g,v)=>v.priority-g.priority);const p=on.create(()=>{const g=l.handlers.indexOf(h);g!==-1&&l.handlers.splice(g,1),l.handlers.length===0&&l.dispose()});return this.toDispose.push(p),p}listenPlaygroundEvent(e,n,r,i){return this._listenEvent(e,n,!1,r,i)}listenGlobalEvent(e,n,r,i){return this._listenEvent(e,n,!0,r,i)}registerLayer(e,n){if(this.allLayersMap.has(e))return;const r=this.layerFactory(e,n);this.allLayersMap.set(e,r);const i=cK(e),s=uK(e);if(i.forEach(o=>{this.entityManager.registerEntity(o),ol.isRegistryOf(o,sa)&&this.entityManager.createEntity(o)}),s.forEach(o=>{this.entityManager.registerEntity(o.entity),this.entityManager.registerEntityData(o.data)}),this.selector.subscribeEntities(r,i),s.forEach(o=>this.selector.subscribleEntityByData(r,o.entity,o.data)),r.observeManager=new vK(this.entityManager),r.reloadEntities=()=>{const o=this.selector.getLayerData(r);return o.changed&&r.observeManager.load(o.observeEntities,o.observeDatas),o.changed},r.listenPlaygroundEvent=this.listenPlaygroundEvent.bind(this),r.listenGlobalEvent=this.listenGlobalEvent.bind(this),r.config=this.configEntity,r.getOtherLayer=this.getLayer.bind(this),Object.defineProperty(r,"isFocused",{get:()=>this._isFocused}),r.onResize&&this.onResize(r.onResize.bind(r)),r.onBlur&&this.onBlurEmitter.event(r.onBlur.bind(r)),r.onFocus&&this.onFocusEmitter.event(r.onFocus.bind(r)),r.onZoom&&this.onZoomEmitter.event(r.onZoom.bind(r)),r.onScroll&&this.onScrollEmitter.event(r.onScroll.bind(r)),r.onViewportChange){const o=r.onViewportChange.bind(r);this.onResize(o),this.onZoomEmitter.event(o),this.onScrollEmitter.event(o)}r.onReadonlyOrDisabledChange&&this.configEntity.onReadonlyOrDisabledChange(r.onReadonlyOrDisabledChange.bind(r)),this.renderer.addLayer(r)}getLayer(e){return this.allLayersMap.get(e)}get configEntity(){return this.entityManager.getEntity(qn,!0)}ready(){const e=this.configEntity;let n=e.finalScale,r=e.scrollData;e.onConfigChanged(()=>{const i=e.finalScale,s=e.scrollData;i!==n&&(n=i,Up.MessageLoop.postMessage(this,bK)),(r.scrollX!==s.scrollX||r.scrollY!==s.scrollY)&&(r=s,Up.MessageLoop.postMessage(this,wK))})}processMessage(e){const n=this.configEntity;switch(e.type){case"PIPELINE_SCROLL":this.onScrollEmitter.fire(n.scrollData);break;case"PIPELINE_ZOOM":this.onZoomEmitter.fire(n.finalScale);break}}dispose(){this.toDispose.dispose()}};an([oe(Ch)],Io.prototype,"renderer",2);an([oe(Wp)],Io.prototype,"selector",2);an([oe(Sn)],Io.prototype,"entityManager",2);an([gg()],Io.prototype,"context",2);an([oe(xI)],Io.prototype,"layerFactory",2);Io=an([$e()],Io);var _K=D.createContext({}),O6=D.createContext({}),T6=D.createContext({}),Sw=D.createContext(void 0),yg=Symbol("PlaygroundConfig");function CK(){return{autoFocus:!0,autoResize:!0,zoomEnable:!0,layers:[]}}var SI=Symbol("PlaygroundContribution"),Eh=class{config(e){Object.assign(this.playgroundConfig,e)}registerLayer(e){this.pipeline.registerLayer(e)}registerEntity(e){this.entityManager.registerEntity(e)}registerEditorState(e){const n=this.entityManager.getEntity(al);n==null||n.registerState(e)}};an([oe(Io)],Eh.prototype,"pipeline",2);an([oe(Sn)],Eh.prototype,"entityManager",2);an([oe(yg)],Eh.prototype,"playgroundConfig",2);Eh=an([$e()],Eh);var Mu=Symbol("PluginContext");function EK(e,n){const r=new Set,i=new Set;e.reduceRight((o,a)=>{const l=a.singleton&&i.has(a.pluginId);return a.singleton&&i.add(a.pluginId),l?o:[a,...o]},[]).reduce((o,a)=>{if(r.has(a.pluginId)||(a.initPlugin(),r.add(a.pluginId)),a.containerModules&&a.containerModules.length>0){for(let l of a.containerModules)o.includes(l)||o.push(l);return o}return o},[]).forEach(o=>n.load(o)),e.forEach(o=>{if(o.contributionKeys)for(const a of o.contributionKeys)n.bind(a).toConstantValue(o.options)})}function xK(e,n){return new Mo(r=>{r(SI).toDynamicValue(i=>{const s=i.container.get(Mu);return{onInit:()=>{var o;(o=e.onInit)==null||o.call(e,s,n)},onReady:()=>{var o;(o=e.onReady)==null||o.call(e,s,n)},onDispose:()=>{var o;(o=e.onDispose)==null||o.call(e,s,n)},onAllLayersRendered:()=>{var o;(o=e.onAllLayersRendered)==null||o.call(e,s,n)}}})})}var JM=0;function Gn(e){const{contributionKeys:n,singleton:r=!1}=e;JM+=1;const i=`Playground_${JM}`;return s=>{const o=[];let a=!1;return{pluginId:i,singleton:r,initPlugin:()=>{a||(a=!0,e.containerModules&&o.push(...e.containerModules),e.onBind&&o.push(new Mo((l,u,h,p)=>{e.onBind({bind:l,unbind:u,isBound:h,rebind:p},s)})),(e.onInit||e.onDispose||e.onReady||e.onAllLayersRendered)&&o.push(xK(e,s)))},options:s,contributionKeys:n,containerModules:o}}}var Dw=e=>Gn(e)(void 0),WC=new Set,M6=new qe,P6=new qe,qi=class{constructor(e,n,r,i,s,o,a,l,u){this.entityManager=e,this.registry=n,this.contextProvider=r,this.pipelineRenderer=i,this.pipelineRegistry=s,this.playgroundConfig=o,this.contributionProvider=a,this.commandService=l,this.selectionService=u,this.toDispose=new jt,this._focused=!1,this.playgroundClassName=Wi(),this.isReady=!1,this.toDispose.pushAll([this.pipelineRenderer,this.pipelineRegistry,this.entityManager,this.commandService,this.selectionService,on.create(()=>{WC.delete(this),this.node.remove(),P6.fire(this)}),i.onAllLayersRendered(()=>{this.contributions.forEach(p=>{var g;return(g=p.onAllLayersRendered)==null?void 0:g.call(p,this)})})]);const h=this.entityManager.createEntity(al);if(this.entityManager.createEntity(qn),this.node=o.node||document.createElement("div"),this.toDispose.pushAll([ft.addStandardDisposableListener(this.node,"scroll",p=>{this.node.scrollTop=0,this.node.scrollLeft=0,p.preventDefault(),p.stopPropagation()})]),this.node.classList.add("gedit-playground"),this.node.classList.add(this.playgroundClassName),this.node.dataset.testid="sdk.workflow.canvas",o.layers&&o.layers.forEach(p=>this.registry.registerLayer(p)),o.editorStates&&o.editorStates.forEach(p=>h.registerState(p)),o.zoomEnable!==void 0&&(this.zoomEnable=o.zoomEnable),o.entityConfigs)for(const[p,g]of o.entityConfigs){const v=this.entityManager.getEntity(p,!0);v==null||v.updateConfig(g)}this.node.addEventListener("blur",()=>{this.blur()}),this.node.addEventListener("focus",()=>{this.focus()}),this.node.tabIndex=0,this.node.appendChild(this.pipelineRenderer.node),this.onBlur=this.pipelineRegistry.onBlurEmitter.event,this.onFocus=this.pipelineRegistry.onFocusEmitter.event,this.onZoom=this.pipelineRegistry.onZoomEmitter.event,this.onScroll=this.pipelineRegistry.onScrollEmitter.event,WC.add(this)}static getLatest(){const e=qi.getAllInstances();return e[e.length-1]}static getAllInstances(){const e=[];for(const n of WC.values())e.push(n);return e}get context(){var e;return(e=this.contextProvider)==null?void 0:e.call(this)}get contributions(){return this.contributionProvider.getContributions()}init(){const{contributions:e}=this;for(const n of e)n.registerPlayground&&n.registerPlayground(this.registry);for(const n of e)n.onInit&&n.onInit(this);M6.fire(this)}get pipelineNode(){return this.pipelineRenderer.node}setParent(e){e.appendChild(this.node),this.resize()}get zoomEnable(){return this.config.zoomEnable}set zoomEnable(e){this.config.zoomEnable=e}flush(){this.pipelineRenderer.flush()}ready(){if(this.isReady)return;if(this.isReady=!0,this.playgroundConfig.autoResize){const n=je.debounce(()=>{this.disposed||this.resize()},0);if(typeof ResizeObserver<"u"){const r=new ResizeObserver(n);r.observe(this.node),this.toDispose.push(on.create(()=>{r.disconnect()}))}else this.toDispose.push(ft.addStandardDisposableListener(window.document.body,"resize",n,{passive:!0}));this.toDispose.push(ft.addStandardDisposableListener(window.document,"scroll",n,{passive:!0})),this.resize()}this.pipelineRegistry.ready(),this.pipelineRenderer.ready();const{contributions:e}=this;for(const n of e)n.onReady&&n.onReady(this)}scrollToView(e){return this.entityManager.getEntity(qn).scrollToView(e)}resize(e,n=!0){if(!e){const a=this.node.getBoundingClientRect();e={clientX:a.left,clientY:a.top,width:a.width,height:a.height}}const{width:r,height:i}=this.config.config;if(e.width===0||e.height===0)return;let{scrollX:s,scrollY:o}=this.config.config;n&&r&&Math.round(e.width)!==r&&(s+=(r-e.width)/2),n&&i&&Math.round(e.height)!==i&&(o+=(i-e.height)/2),this.config.updateConfig({...e,scrollX:s,scrollY:o}),this.pipelineRegistry.onResizeEmitter.fire(e)}focus(){this._focused||(this._focused=!0,this.pipelineRegistry.onFocusEmitter.fire())}blur(){this._focused&&(this._focused=!1,this.pipelineRegistry.onBlurEmitter.fire())}get focused(){return this._focused}get config(){return this.entityManager.getEntity(qn)}get editorState(){return this.entityManager.getEntity(al)}getConfigEntity(e){return this.entityManager.getEntity(e,!0)}dispose(){if(this.disposed)return;const{contributions:e}=this;for(const n of e)n.onDispose&&n.onDispose(this);this.toDispose.dispose()}get disposed(){return this.toDispose.disposed}toReactComponent(){return this.pipelineRenderer.toReactComponent()}registerLayer(e,n){this.pipelineRegistry.registerLayer(e,n)}registerLayers(...e){e.forEach(n=>this.pipelineRegistry.registerLayer(n))}getLayer(e){return this.pipelineRegistry.getLayer(e)}get onAllLayersRendered(){return this.pipelineRenderer.onAllLayersRendered}};qi.onInstanceCreate=M6.event;qi.onInstanceDispose=P6.event;qi=an([$e(),ps(0,oe(Sn)),ps(1,oe(Eh)),ps(2,oe(bI)),ps(2,pr()),ps(3,oe(Ch)),ps(4,oe(Io)),ps(5,oe(yg)),ps(6,oe(rI)),ps(6,n6(SI)),ps(6,pr()),ps(7,oe(Ew)),ps(8,oe(oa))],qi);function A6(e){return{container:e,playground:e.get(qi),get(n){return e.get(n)},getAll(n){return e.getAll(n)}}}function R6(e,n,r={}){const i=e.createChild();i.bind(n).toSelf().inSingletonScope(),i.bind(I6).toConstantValue(r);const s=i.get(n);return lK(s),s}var SK=new Mo(e=>{e(Sn).toSelf().inSingletonScope(),e(Ch).toSelf().inSingletonScope(),e(Eh).toSelf().inSingletonScope(),e(qi).toSelf().inSingletonScope(),e(Wp).toSelf().inSingletonScope(),e(xI).toDynamicValue(n=>(r,i)=>R6(n.container,r,i)).inSingletonScope(),e(Io).toSelf().inSingletonScope(),e(_6).toDynamicValue(n=>n.container).inSingletonScope(),e(yg).toConstantValue(CK()),e(_h).toConstantValue({}),rK(e),e(kb).toSelf().inSingletonScope(),e(rv).toSelf().inSingletonScope(),e(oa).toSelf().inSingletonScope(),e(hK).to(Rb).inSingletonScope(),e(D6).to(aN).inSingletonScope(),oK(e,qn),iI(e,SI),e(Mu).toDynamicValue(n=>A6(n.container)).inSingletonScope(),e(nK).toService(Mu)});function k6(e,n,r){const i=r||new Pb({defaultScope:"Singleton"});return n&&(i.parent=n),i.load(SK),i.isBound(Ew)||i.load($H),e&&(i.rebind(yg).toConstantValue(e),e.context&&i.rebind(_h).toConstantValue(e.context)),i}var L6=R.forwardRef(function(n,r){const{containerModules:i,playgroundContext:s,parentContainer:o,playgroundContainer:a,plugins:l,customPluginContext:u,...h}=n,p=R.useMemo(()=>{let v;return a?v=a:(v=k6({autoFocus:!0,autoResize:!0,zoomEnable:!0,...h},o),s&&v.rebind(_h).toConstantValue(s),i&&i.forEach(w=>v.load(w))),v},[]),g=R.useMemo(()=>{const v=p.get(qi);let w;return u?(w=u(p),p.rebind(Mu).toConstantValue(w)):w=p.get(Mu),l&&EK(l(w),p),v.init(),v},[]);return R.useImperativeHandle(r,()=>p.get(Mu),[]),D.createElement(O6.Provider,{value:p},D.createElement(T6.Provider,{value:g},D.createElement(_K.Provider,{value:s},n.children)))});function ai(){return D.useContext(T6)}function DI(){return D.useContext(O6)}function NI(e=!1){const n=DI().get(Sn),r=R.useContext(Sw);if(!r)throw new Error('[useEntityFromContext] Unknown entity from "PlaygroundEntityContext"');const i=Cs(r.version);return R.useLayoutEffect(()=>{let s;return e&&(s=r.onEntityChange(()=>i(r.version))),()=>s==null?void 0:s.dispose()},[n,i,r,e]),r}function DK(...e){const n=Cs();R.useLayoutEffect(()=>{const r=new jt;return r.pushAll(e.map(i=>i(()=>n()))),()=>r.dispose()},[e,n])}function Wt(e){return DI().get(e)}var II=e=>{const n=ai(),r=Wt(yg),i=R.useRef();R.useEffect(()=>{if(i.current)return n.setParent(i.current),n.ready(),r.autoFocus&&n.node.focus(),()=>{n.dispose()}},[]);const s=n.toReactComponent();return D.createElement(D.Fragment,null,D.createElement("div",{ref:i,className:`gedit-playground-container${e.className?` ${e.className}`:""}`,style:e.style}),D.createElement(s,null),e.children?Ks.createPortal(D.createElement(D.Fragment,null,e.children),n.node):null)},eP;(e=>{const n=Symbol("LayerStateProvider");class r{constructor(u,h,p){this.instance=u,this.playground=h,this.container=p,this.hijackMethod(u,"autorun"),this.hijackMethod(u,"render"),this.hijackMethod(u,"onReady"),this.hijackMethod(u,"onResize"),this.hijackMethod(u,"onFocus"),this.hijackMethod(u,"onBlur"),this.hijackMethod(u,"onZoom"),this.hijackMethod(u,"onScroll"),this.hijackMethod(u,"onViewportChange"),this.hijackMethod(u,"onReadonlyOrDisabledChange")}hijackMethod(u,h){typeof u[h]=="function"&&(this[h]=vi.spyOn(u,h))}}e.LayerTestState=r;function i(l){const u=k6();return u.bind(n).toConstantValue(new WeakMap),u.rebind(xI).toDynamicValue(h=>(p,g)=>{const v=R6(h.container,p,g);return h.container.get(n).set(p,new r(v,u.get(qi),u)),v}),l&&l.forEach(h=>u.load(h)),u}e.createContainer=i;function s(l){return i(l).get(qi)}e.createPlayground=s;function o(l,u){return l.get(n).get(u)}e.getLayerTestState=o;function a(l,u,h){const p=i(h),g=p.get(qi);return g.registerLayer(l,u),g.init(),g.ready(),o(p,l)}e.createLayerTestState=a})(eP||(eP={}));var NK=Object.defineProperty,IK=Object.getOwnPropertyDescriptor,Mr=(e,n,r,i)=>{for(var s=i>1?void 0:i?IK(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&NK(n,r,s),s},OI=Symbol("NodeContribution"),ll=class{constructor(){this.materialRenderRegistry=new Map,this.pluginRenderRegistry=new Map,this.nodeRenderHocs=[],this.nodeContributions=[]}registerMaterialRender(e,n){this.materialRenderRegistry.set(e,n)}getMaterialRender(e){return this.materialRenderRegistry.get(e)}registerPluginRender(e,n){this.pluginRenderRegistry.set(e,n)}getPluginRender(e){return this.pluginRenderRegistry.get(e)}registerNodeErrorRender(e){this.registerMaterialRender("Material_CustomNodeError",e)}get nodeRenderHoc(){return je.flow(this.nodeRenderHocs)}registerNodeRenderHoc(e){this.nodeRenderHocs.push(e)}get nodeErrorRender(){return this.materialRenderRegistry.get("Material_CustomNodeError")}init(){this.nodeContributions.forEach(e=>{var n;return(n=e.onRegister)==null?void 0:n.call(e,this)})}};Mr([wc(OI),pr()],ll.prototype,"nodeContributions",2);Mr([Ai()],ll.prototype,"init",1);ll=Mr([$e()],ll);var Ys=class{constructor(){this.onChangeEmitter=new qe,this.onChange=this.onChangeEmitter.event,this._readonly=Ys.DEFAULT_READONLY,this._json=Ys.DEFAULT_JSON}get json(){return this._json}get readonly(){return this._readonly}set readonly(e){this._readonly=e,this.fireChange()}fireChange(){this.updateJSON(),this.onChangeEmitter.fire(this)}updateJSON(){this._json={readonly:this._readonly}}};Ys.DEFAULT_READONLY=!1;Ys.DEFAULT_JSON={readonly:Ys.DEFAULT_READONLY};Ys=Mr([$e()],Ys);var iv=class{};Mr([oe(ll)],iv.prototype,"nodeManager",2);Mr([oe(Ys)],iv.prototype,"context",2);iv=Mr([$e()],iv);var OK=new Mo((e,n,r,i)=>{e(iv).toSelf().inSingletonScope(),e(ll).toSelf().inSingletonScope(),e(Ys).toSelf().inSingletonScope()}),Lb={FORM:"Plugin_Form",ERROR:"Plugin_Error"},Nw={NODE_ERROR_RENDER:"node_error_render",NODE_PLACEHOLDER_RENDER:"node_placeholder_render"},$h=class extends Wr{getDefaultData(){return{error:null}}setError(e){this.update({error:e})}getError(){return this.data.error}};$h.type="FlowNodeErrorData";var TK={color:"#f54a45"},MK=({error:e})=>D.createElement("div",{style:TK},e.message),PK=({node:e,playgroundContext:n})=>{const r=Cs(),i=e.getData($h),s=i.getError(),a=Wt(ll).getMaterialRender(Nw.NODE_ERROR_RENDER),l=R.useCallback(()=>a?a({error:s,context:{node:e,playgroundContext:n}}):MK({error:s}),[s,e,n]);return R.useEffect(()=>{const u=i.onDataChange(()=>{r()});return()=>{u.dispose()}},[]),s?l():null},AK=e=>D.createElement(PK,{...e}),lN=class{onRegister(e){e.registerPluginRender(Lb.ERROR,AK)}};lN=Mr([$e()],lN);var RK=new Mo(e=>{Lv(e,lN,[OI])});function kK(e){return e.getData($h).getError()}var Gp=class{makeFormItemMaterialContext(e,n){return{meta:e.meta,path:e.path,readonly:this.nodeEngineContext.readonly,getFormItemValueByPath:e.formModel.getFormItemValueByPath.bind(e.formModel),onFormValidate:e.formModel.onValidate.bind(e.formModel),form:e.formModel,node:e.formModel.flowNodeEntity,playgroundContext:this.playgroundContext,index:n==null?void 0:n.getIndex()}}};Mr([oe(Ys)],Gp.prototype,"nodeEngineContext",2);Mr([gg()],Gp.prototype,"playgroundContext",2);Gp=Mr([$e()],Gp);var Zn=class{static normalize(e){return e===Zn.ROOT||e.endsWith(Zn.DIVIDER)&&(e=e.slice(0,-1)),e}static join(e){if(e[1].startsWith(Zn.ROOT))throw new Error(`FormPathService Error: join failed, invalid paths[1], paths[1]= ${e[1]}`);return e[0].endsWith(Zn.DIVIDER)?`${e[0]}${e[1]}`:e.join(Zn.DIVIDER)}static toArrayPath(e){return Zn.join([e,Zn.ARRAY])}static parseArrayItemPath(e){const n=e.split("/");let r=0;for(;r<n.length;){const i=parseInt(n[r]);if(!isNaN(i)){const s=Zn.toArrayPath(n.slice(0,r).join(Zn.DIVIDER)),o=n.slice(r+1).join(Zn.DIVIDER),a=Zn.join([s,o]);return{itemIndex:i,arrayPath:s,itemMetaPath:a}}r=r+1}return null}simplify(e){const n=e.split(Zn.DIVIDER),r=[];for(let i=0;i<n.length;i++){if(!n[i])throw new Error("FormPathService: join failed");n[i]!==Zn.RELATIVE_CURRENT&&(n[i]===Zn.RELATIVE_PARENT&&r.pop(),r.push(n[i]))}return r.join(Zn.DIVIDER)}};Zn.ROOT="/";Zn.DIVIDER="/";Zn.RELATIVE_PARENT="..";Zn.RELATIVE_CURRENT=".";Zn.ARRAY="[]";Zn=Mr([$e()],Zn);var cN=class{constructor(){this.toDispose=new jt}};cN=Mr([$e()],cN);var uN=class{constructor(){this.registry=new Map}register(e){this.registry.set(e.key,e)}get(e){return this.registry.get(e)}get objectMap(){return Object.fromEntries(this.registry)}get collection(){return Array.from(this.registry.values())}};uN=Mr([$e()],uN);var LK=Symbol("FormContribution"),j6=class F6{get type(){return F6.type}};j6.type="setter";var $6=j6,z6=class V6{get type(){return V6.type}};z6.type="decorator";var B6=z6,H6=class U6{get type(){return U6.type}};H6.type="effect";var jK=H6,K6=class W6{get type(){return W6.type}};K6.type="validation";var FK=K6,Oo=class{constructor(){this.abilityRegistry=new Map,this.setterHocs=[],this.extensionRegistryMap=new Map,this.formContributions=[],this.onFormModelWillInitEmitter=new qe,this.onFormModelWillInit=this.onFormModelWillInitEmitter.event}get components(){var e;return je.mapValues(((e=this.extensionRegistryMap.get($6.type))==null?void 0:e.objectMap)||{},n=>n.component)}get decorators(){var e;return je.mapValues(((e=this.extensionRegistryMap.get(B6.type))==null?void 0:e.objectMap)||{},n=>n.component)}registerAbilityExtension(e,n){this.extensionRegistryMap.get(e)||this.extensionRegistryMap.set(e,new uN);const r=this.extensionRegistryMap.get(e);r&&r.register(n)}getAbilityExtension(e,n){var r;return(r=this.extensionRegistryMap.get(e))==null?void 0:r.get(n)}registerAbility(e){const n=new e;this.abilityRegistry.set(n.type,n)}registerAbilities(e){e.forEach(this.registerAbility.bind(this))}getAbility(e){return this.abilityRegistry.get(e)}registerSetterHoc(e){this.setterHocs.push(e)}fireFormModelWillInit(e,n){this.onFormModelWillInitEmitter.fire({model:e,data:n})}dispose(){this.onFormModelWillInitEmitter.dispose()}init(){this.formContributions.forEach(e=>{var n;return(n=e.onRegister)==null?void 0:n.call(e,this)})}};Mr([oe(Zn)],Oo.prototype,"pathManager",2);Mr([oe(Gp)],Oo.prototype,"formContextMaker",2);Mr([gg()],Oo.prototype,"playgroundContext",2);Mr([wc(LK),pr()],Oo.prototype,"formContributions",2);Mr([Ai()],Oo.prototype,"init",1);Oo=Mr([$e()],Oo);var gr=class extends Wr{constructor(e,n){super(e),this.onDetailChangeEmitter=new qe,this.onDetailChange=this.onDetailChangeEmitter.event,this.flowNodeEntity=e,this.formModel=n.formModelFactory(e),this.toDispose.push(this.onDetailChangeEmitter),this.toDispose.push(on.create(()=>{this.formModel.dispose()}))}getFormModel(){return this.formModel}getDefaultData(){return{}}createForm(e,n){const r=this.flowNodeEntity.getData($h);r.setError(null);try{this.formModel.init(e,n)}catch(i){r.setError(i)}}recreateForm(e,n){this.createForm(e,n)}toJSON(){return this.formModel.toJSON()}dispose(){super.dispose()}fireDetaiChange(e){this.onDetailChangeEmitter.fire(e)}};gr.type="FlowNodeEntityFormData";function $K(e){var n;return(n=e.getData(gr))==null?void 0:n.getFormModel()}function zK({node:e}){const n=Cs(),r=$K(e);return R.useEffect(()=>{const i=r==null?void 0:r.onInitialized(()=>{n()});return()=>{i.dispose()}},[r]),r!=null&&r.initialized?r.render():null}var VK=e=>D.createElement(zK,{...e}),dN=class{onRegister(e){e.registerPluginRender(Lb.FORM,VK)}};dN=Mr([$e()],dN);var BK=new Mo(e=>{e(Oo).toSelf().inSingletonScope(),e(Zn).toSelf().inSingletonScope(),e(Gp).toSelf().inSingletonScope(),Lv(e,dN,[OI])});function HK(e){return e.getData(gr).getFormModel().initialized}function UK(e){return e.getData(gr).formModel}function KK(){return[OK,BK,RK]}var WK=D.createContext(Ys.DEFAULT_JSON);function qK(){const e=Cs(),n=Wt(Ys);return R.useEffect(()=>{const r=n.onChange(()=>{e()});return()=>{r.dispose()}},[]),n}var GK=({node:e})=>{const n=Cs(),r=e.getData($h),i=UK(e),s=!!kK(e),o=HK(e),a=Wt(_h),l=Wt(ll),u=l.getPluginRender(Lb.FORM),h=l.getPluginRender(Lb.ERROR),p=l.getMaterialRender(Nw.NODE_PLACEHOLDER_RENDER),g=qK();R.useEffect(()=>{const w=r.onDataChange(()=>{n()}),S=i.onInitialized(()=>{n()});return()=>{w.dispose(),S.dispose()}},[]);const v=R.useCallback(()=>s?h({node:e,playgroundContext:a}):i.formMeta?o?u({node:e,playgroundContext:a}):(p==null?void 0:p({node:e,playgroundContext:a}))||null:null,[s,o,h,u,p,e,a]);return D.createElement(WK.Provider,{value:g.json},l.nodeRenderHoc(v)())},YK=R.memo(GK);function XK(e,n){e.registerMaterialRender(Nw.NODE_ERROR_RENDER,n)}function ZK(e,n){e.registerMaterialRender(Nw.NODE_PLACEHOLDER_RENDER,n)}function QK(){return[gr,$h]}var xh;(e=>{const n=[],r=[];let i=!1,s=!1,o=!1,a,l=!1;function u(j,V){if(l)throw V;console.error(`[Tracker error] ${j}`,V)}function h(j){if(I())throw new Error("Can't call Tracker.flush while flushing");if(o)throw new Error("Can't flush inside Tracker.autorun");j=j||{},s=!0,i=!0,l=!!j.throwFirstError;var V=0,$=!1;try{for(;n.length||r.length;){for(;n.length;){var W=n.shift();if(W._recompute(),W._needsRecompute()&&n.unshift(W),!j.finishSynchronously&&++V>100){$=!0;return}}if(r.length){var B=r.shift();try{B()}catch(H){u("afterFlush",H)}}}$=!0}finally{if($||(s=!1,h({finishSynchronously:j.finishSynchronously,throwFirstError:!1})),i=!1,s=!1,n.length||r.length){if(j.finishSynchronously)throw new Error("still have more to do?");setTimeout(p,10)}}}function p(){i||(setTimeout(h,0),i=!0)}function g(j,V){let $=a;a=j;try{return V.call(null,j)}finally{a=$}}e.withComputation=g;function v(j){let V=a;a=void 0;try{return j(void 0)}finally{a=V}}e.withoutComputation=v;function w(){return!!a}e.isActive=w;function S(){return a}e.getCurrentComputation=S;function E(j,V){var $=new k(j,a,V==null?void 0:V.onError);return w()&&e.onInvalidate(function(){$.stop()}),$}e.autorun=E;function x(j){if(!a)throw new Error("Tracker.onInvalidate requires a currentComputation");a.onInvalidate(j)}e.onInvalidate=x;function I(){return s}e.inFlush=I;function P(j){h({finishSynchronously:!0,throwFirstError:j&&j.throwFirstError})}e.flush=P;function M(j){r.push(j),p()}e.afterFlush=M;class k{constructor(V,$,W){this._fn=V,this.parent=$,this._onError=W,this._onInvalidateCallbacks=[],this._onStopCallbacks=[],this._recomputing=!1,this.stopped=!1,this.invalidated=!1,this.firstRun=!0;let B=!0;try{this._compute(),B=!1}finally{this.firstRun=!1,B&&this.stop()}}onInvalidate(V){this.invalidated?v(V.bind(null,this)):this._onInvalidateCallbacks.push(V)}invalidate(){if(!this.invalidated){!this._recomputing&&!this.stopped&&(p(),n.push(this)),this.invalidated=!0;for(var V=0,$;$=this._onInvalidateCallbacks[V];V++)v($.bind(null,this));this._onInvalidateCallbacks=[]}}stop(){if(!this.stopped){this.stopped=!0,this.invalidate();for(let V=0,$;$=this._onStopCallbacks[V];V++)v($.bind(null,this));this._onStopCallbacks=[]}}onStop(V){this.stopped?v(V.bind(null,this)):this._onStopCallbacks.push(V)}_compute(){this.invalidated=!1;var V=o;o=!0;try{this._result=e.withComputation(this,this._fn)}finally{o=V}}_needsRecompute(){return this.invalidated&&!this.stopped}_recompute(){this._recomputing=!0;try{if(this._needsRecompute())try{this._compute()}catch(V){this._onError?this._onError(V):u("recompute",V)}}finally{this._recomputing=!1}}flush(){this._recomputing||this._recompute()}run(){this.invalidate(),this.flush()}get result(){return this._result}}e.Computation=k;class A{constructor(){this._dependents=new Set}depend(V){if(!V){if(!w())return!1;V=a}return this._dependents.has(V)?!1:(this._dependents.add(V),V.onInvalidate(()=>{this._dependents.delete(V)}),!0)}changed(){for(const V of this._dependents)V.invalidate()}hasDependents(){return this._dependents.size!==0}}e.Dependency=A})(xh||(xh={}));var JK=class{constructor(e,n){this._dep=new xh.Dependency,this._isEqual=(r,i)=>r==i,this._value=e,n!=null&&n.isEqual&&(this._isEqual=n.isEqual)}_addDepend(e){xh.isActive()&&e.depend()}hasDependents(){return this._dep.hasDependents()}get value(){return this._addDepend(this._dep),this._value}set value(e){this._isEqual(this._value,e)||(this._value=e,this._dep.changed())}};function hN(e,n){if("Proxy"in window)return new Proxy(e,n);const i={};for(const s in e)Object.defineProperty(i,s,{enumerable:!0,get:n.get?()=>n.get(e,s):void 0,set:n.set?o=>n.set(e,s,o):void 0});return i}var eW=xh.Dependency,q6=class extends JK{constructor(){super(...arguments),this._keyDeps=new Map}set(e,n){this._ensureKey(e);const r=this._value[e];return this._isEqual(r,n)?!1:(this._value[e]=n,this._keyDeps.get(e).changed(),!0)}get(e){return this._ensureKey(e),this._addDepend(this._keyDeps.get(e)),this._value[e]}_ensureKey(e){this._keyDeps.has(e)||this._keyDeps.set(e,new eW)}hasDependents(){if(this._dep.hasDependents())return!0;for(const e of this._keyDeps.values())if(e.hasDependents())return!0;return!1}keys(){return Object.keys(this._value)}set value(e){this._isEqual(this._value,e)||(this._value=e,this._keyDeps.clear(),this._dep.changed())}get value(){return this._addDepend(this._dep),this._proxyValue||(this._proxyValue=hN(this._value,{get:(e,n)=>this.get(n),set:(e,n,r)=>(this.set(n,r),!0)})),this._proxyValue}get readonlyValue(){return this._addDepend(this._dep),this._proxyReadonlyValue||(this._proxyReadonlyValue=hN(this._value,{get:(e,n)=>this.get(n),set:(e,n)=>{throw new Error(`[ReactiveState] Cannnot set readonly field "${n}"`)}})),this._proxyReadonlyValue}};function G6(e){const n=Cs(),r=R.useMemo(()=>new Map,[]),i=R.useCallback(()=>{r.forEach(s=>s.stop()),r.clear()},[]);return R.useEffect(()=>i,[]),i(),R.useMemo(()=>e===void 0?{}:hN(e,{get(s,o){let a=r.get(o);return a||(a=new xh.Computation(l=>{if(!l.firstRun){n();return}return e[o]}),r.set(o,a)),e[o]}}),[e])}function jb(e){return G6(e.readonlyValue)}var{Dependency:ame,Computation:lme}=xh,tW=e=>e!==null&&typeof e=="object",nW=e=>String(Math.floor(Number(e)))===e;function rW(e,n,r,i=0){const s=je.toPath(n);for(;e&&i<s.length;)e=e[s[i++]];return i!==s.length&&!e||e===void 0?r:e}function iW(e,n,r){let i=je.clone(e),s=i,o=0,a=je.toPath(n);for(;o<a.length-1;o++){const l=a[o];let u=rW(e,a.slice(0,o+1));if(u&&(tW(u)||Array.isArray(u)))s=s[l]=je.clone(u);else{const h=a[o+1];s=s[l]=nW(h)&&Number(h)>=0?[]:{}}}return(o===0?e:s)[a[o]]===r?e:(s[a[o]]=r,i)}function tb(e,n){const r=new Set(n),i={};return Object.keys(e).forEach(s=>{r.has(s)&&(i[s]=e[s])}),i}function sW(e){return typeof e=="object"&&e!==null&&"target"in e&&typeof e.target=="object"}function oW(e){return typeof e=="object"&&e!==null&&"target"in e&&typeof e.target=="object"&&e.target.type==="checkbox"}var oc;(e=>{e.DIVIDER=".",e.ALL="*";function n(h,p){const g=h.split(e.DIVIDER),v=p.split(e.DIVIDER);return g.length!==v.length?!1:g.every((w,S)=>w===e.ALL?!0:w===v[S])}e.isMatch=n;function r(h,p){if(h==="")return!0;const g=h.split(e.DIVIDER),v=p.split(e.DIVIDER);if(g.length>v.length)return!1;for(let w=0;w<g.length;w++)if(g[w]!==e.ALL&&g[w]!==v[w])return!1;return!0}e.isMatchOrParent=r;function i(h,p){const g=h.split(e.DIVIDER);return p.split(e.DIVIDER).slice(0,g.length).join(e.DIVIDER)}e.getParentPathByPattern=i;function s(h,...p){const g=p.shift();if(g===void 0)return h.toString();let v="";return h===""&&g===""?v="":h!==""&&g===""?v=h.toString():h===""&&g!==""?v=g.toString():v=`${h}${e.DIVIDER}${g}`,p.length>0?s(v,...p):v}function o(h,p){return!p||typeof p!="object"?[]:je.flatten(h.map(g=>{const v=g===""?p:je.get(p,g);return je.isArray(v)?v.map((w,S)=>s(g,S)):je.isObject(v)?Object.keys(v).map(w=>s(g,w)):[]}))}e.getSubPaths=o;function a(h){const p=h.split(e.DIVIDER),g=[];let v=0,w=[];for(;v<p.length;)p[v]===e.ALL?(w.length&&g.push(w.join(e.DIVIDER)),g.push(e.ALL),w=[]):w.push(p[v]),v+=1;return w.length&&g.push(w.join(e.DIVIDER)),g}e.splitPattern=a;function l(h,p,g){if(!h||!p)return[];const v=p.split(e.DIVIDER);let w=v.shift(),S=[],E=h;for(;w;){if(!(typeof E=="object"))return[];if(w===e.ALL){const I=S.join(e.DIVIDER);return je.flatten(Object.keys(E).map(P=>v.length===0?s(I,P):l(E[P],`${v.join(e.DIVIDER)}`,g).map(M=>s(I,P,M))))}if(!(w in E)&&!g)return[];E=E[w],S.push(w),w=v.shift()}return[p]}e.findMatchPaths=l;function u(h,p){return p.includes("*")?l(h,p,!0):[p]}e.findMatchPathsWithEmptyValue=u})(oc||(oc={}));var zv=(e=>(e.onChange="onChange",e.onBlur="onBlur",e))(zv||{}),ys=class uh{constructor(n){this._path=[],this._path=je.toPath(n)}get parent(){if(!(this._path.length<2))return new uh(this._path.slice(0,-1))}toString(){return this._path.join(".")}get value(){return this._path}isChild(n){const r=new uh(n).value,i=this.value;if(r.length-i.length!==1)return!1;for(let s=0;s<i.length;s++)if(r[s]!==i[s])return!1;return!0}static compareArrayPath(n,r){let i=0;for(;n.value[i]&&r.value[i];){const s=parseInt(n.value[i]),o=parseInt(r.value[i]);if(!isNaN(s)&&!isNaN(o))return s-o;if(n.value[i]!==r.value[i])throw new Error(`[Form] Path.compareArrayPath invalid input Error: two path should refers to the same array, but got path1: ${n.toString()}, path2: ${r.toString()}`);i++}throw new Error(`[Form] Path.compareArrayPath invalid input Error: got path1: ${n.toString()}, path2: ${r.toString()}`)}isChildOrGrandChild(n){const r=new uh(n).value,i=this.value;if(r.length-i.length<1)return!1;for(let s=0;s<i.length;s++)if(r[s]!==i[s])return!1;return!0}getArrayIndex(n){return parseInt(this._path[n.value.length])}concat(n){if(typeof n=="string"||typeof n=="number")return new uh(this._path.concat(new uh(n.toString())._path));throw new Error(`[Form] Error in Path.concat: invalid param type, require number or string, but got ${typeof n}`)}replaceParent(n,r){if(n.value.length>this.value.length)throw new Error(`[Form] Error in Path.replaceParent: invalid parent param: ${n}, parent length should not greater than current length.`);const i=[];for(let s=0;s<this.value.length;s++){if(s<n.value.length&&n.value[s]!==this.value[s])throw new Error(`[Form] Error in Path.replaceParent: invalid parent param: '${n}' is not a parent of '${this.toString()}'`);s>=n.value.length&&i.push(this.value[s])}return new uh(r.value.concat(i))}};function tP(e,n){return(e||[]).map(r=>({...r,name:n}))}function Ap(e,n){return n?e?Object.keys(n).some(i=>!je.isEqual(e[i],n[i]))?{...e,...n}:e:{...n}:e}function nb(e,n){return n&&(e in n&&delete n[e],n)}function Y6(e,n){return e===n}function aW(e){return e?Object.keys(e).every(n=>je.isEmpty(e[n])):!0}var Fb;(e=>{function n(i,s){var l;const{name:o,options:a}=i;return oc.isMatchOrParent(s,o)?!0:new ys(o).isChildOrGrandChild(s)?(a==null?void 0:a.action)==="array-append"?!new ys(o).isChildOrGrandChild(s):(a==null?void 0:a.action)==="array-splice"&&((l=a==null?void 0:a.indexes)!=null&&l.length)?ys.compareArrayPath(new ys(s),new ys(o).concat(a.indexes[0]))>=0:!0:!1}e.shouldTriggerFieldChangeEvent=n;function r(i,s){const{name:o,options:a}=i;return(a==null?void 0:a.action)==="array-splice"||(a==null?void 0:a.action)==="array-swap"?s===o:e.shouldTriggerFieldChangeEvent(i,s)}e.shouldTriggerFieldValidateWhenChange=r})(Fb||(Fb={}));function $b(e){const n={get name(){return e.name},get value(){return e.value},onChange:r=>{sW(r)?e.value=oW(r)?r.target.checked:r.target.value:e.value=r},onBlur(){Y6("onBlur",e.form.validationTrigger)&&e.validate()},onFocus(){e.state.isTouched=!0}};return Object.defineProperty(n,"key",{enumerable:!1,get(){return e.id}}),Object.defineProperty(n,"_fieldModel",{enumerable:!1,get(){return e}}),n}function X6(e){return{get isTouched(){return e.isTouched},get invalid(){return e.invalid},get isDirty(){return e.isDirty},get isValidating(){return e.isValidating},get errors(){if(e.errors)return Object.values(e.errors).reduce((n,r)=>n.concat(r),[])},get warnings(){if(e.warnings)return Object.values(e.warnings).reduce((n,r)=>n.concat(r),[])}}}function Um(e){const n={initialValues:e.initialValues,get values(){return e.values},set values(r){e.values=r},state:TI(e.state),getValueIn:r=>e.getValueIn(r),setValueIn:(r,i)=>e.setValueIn(r,i),validate:e.validate.bind(e)};return Object.defineProperty(n,"_formModel",{enumerable:!1,get(){return e}}),n}function TI(e){return{get isTouched(){return e.isTouched},get invalid(){return e.invalid},get isDirty(){return e.isDirty},get isValidating(){return e.isValidating},get errors(){return e.errors},get warnings(){return e.warnings}}}var Z6=D.createContext({}),Q6=D.createContext({});function MI(){return R.useContext(Z6)}function cl({name:e,defaultValue:n,render:r,children:i,deps:s}){const o=MI(),a=o.getField(e)||o.createField(e),l=R.useMemo(()=>$b(a),[a]),u=jb(a.reactiveState),h=jb(o.reactiveState),p=R.useMemo(()=>X6(u),[u]),g=TI(h),v=Cs();R.useEffect(()=>{a.renderCount=a.renderCount+1,!o.getValueIn(e)!==void 0&&n!==void 0&&(o.setInitValueIn(e,n),v());const S=new jt;return S.push(a.onValueChange(()=>{v()})),s&&s.forEach(E=>{var I;const x=(I=o.getField(E))==null?void 0:I.onValueChange(()=>{v()});x&&S.push(x)}),()=>{S.dispose(),a.renderCount>1?a.renderCount=a.renderCount-1:o.getField(a.name)===a&&a.dispose()}},[a]);const w=()=>r?r({field:l,fieldState:p,formState:g}):je.isFunction(i)?i({field:l,fieldState:p,formState:g}):R.cloneElement(i,{...l});return R.createElement(Q6.Provider,{value:a},w())}function J6(e){const n={get key(){return e.id},get name(){return e.path.toString()},get value(){return e.value},onChange:r=>{e.value=r},map:r=>e.map((i,s)=>r($b(i),s)),append:r=>$b(e.append(r)),delete:r=>e.delete(r),remove:r=>e.delete(r),swap:(r,i)=>e.swap(r,i),move:(r,i)=>e.move(r,i)};return Object.defineProperty(n,"_fieldModel",{enumerable:!1,get(){return e}}),n}function e8(e,n){if(typeof e=="string")return{name:n,message:e,level:"error"};if(e!=null&&e.message)return{...e,name:n}}function nP(e,n){return{[e]:n?[n]:[]}}var lW=e=>Object.keys(e).some(n=>{var r;return((r=e[n])==null?void 0:r.length)>0}),Rm={invalid:!1,isDirty:!1,isTouched:!1,isValidating:!1},cW={invalid:!1,isDirty:!1,isTouched:!1,isValidating:!1};function uW(e){return{...cW}}function dW(e){return{...Rm}}var hW=class{get values(){return this._values}set values(e){this._values=e}setInitialValues(e){this._values=e}setIn(e,n){this._values=iW(this._values||{},e.toString(),n)}getIn(e){return je.get(this._values,e.value)}dispose(){}},t8=class{constructor(e,n){this.onValueChangeEmitter=new qe,this.onValueChange=this.onValueChangeEmitter.event,this.toDispose=new jt,this._state=new q6(dW()),this._renderCount=0,this._mount=!1,this._path=e,this.form=n,this.id=Wi();const r=this.form.onFormValuesChange(i=>{const{values:s,prevValues:o}=i;Fb.shouldTriggerFieldChangeEvent(i,this.name)&&(this.onValueChangeEmitter.fire({value:je.get(s,this.name),prevValue:je.get(o,this.name),formValues:s,prevFormValues:o}),Y6("onChange",this.form.validationTrigger)&&Fb.shouldTriggerFieldValidateWhenChange(i,this.name)&&this.validate())});this.toDispose.push(r),this.toDispose.push(this.onValueChangeEmitter),this.initState()}get renderCount(){return this._renderCount}set renderCount(e){this._renderCount=e}initState(){const e=je.get(this.form.state.errors,this.name),n=je.get(this.form.state.warnings,this.name);e&&(this.state.errors={[this.name]:e}),n&&(this.state.warnings={[this.name]:n})}get path(){return this._path}get name(){return this._path.toString()}set name(e){this._path=new ys(e)}get ref(){return this._ref}set ref(e){this._ref=e}get state(){return this._state.value}get reactiveState(){return this._state}get value(){return this.form.getValueIn(this.name)}set value(e){this.form.setValueIn(this.name,e),this.state.isTouched||(this.state.isTouched=!0,this.bubbleState())}updateNameForLeafState(e){var o,a;const{errors:n,warnings:r}=this.state,i=n?(o=Object.keys(n))==null?void 0:o[0]:void 0;i&&(n!=null&&n[i])&&i!==e&&(this.state.errors={[e]:n!=null&&n[i]?tP(n==null?void 0:n[i],e):n==null?void 0:n[i]});const s=r?(a=Object.keys(r))==null?void 0:a[0]:void 0;s&&(r!=null&&r[s])&&s!==e&&(this.state.warnings={[e]:r!=null&&r[s]?tP(r==null?void 0:r[s],e):r==null?void 0:r[s]})}updateValidate(e,n){n==="ui"?this.originalValidate||(this.originalValidate=e):this.originalValidate=e}bubbleState(){const{errors:e,warnings:n}=this.state;if(this.parent){this.parent.state.isTouched=je.some(this.parent.children.map(r=>r.state.isTouched),Boolean),this.parent.state.invalid=je.some(this.parent.children.map(r=>r.state.invalid),Boolean),this.parent.state.isDirty=je.some(this.parent.children.map(r=>r.state.isDirty),Boolean),this.parent.state.isValidating=je.some(this.parent.children.map(r=>r.state.isValidating),Boolean),this.parent.state.errors=e?Ap(this.parent.state.errors,e):nb(this.name,this.parent.state.errors),this.parent.state.warnings=n?Ap(this.parent.state.warnings,n):nb(this.name,this.parent.state.warnings),this.parent.bubbleState();return}this.form.state.isTouched=je.some(this.form.fields.map(r=>r.state.isTouched),Boolean),this.form.state.invalid=je.some(this.form.fields.map(r=>r.state.invalid),Boolean),this.form.state.isDirty=je.some(this.form.fields.map(r=>r.state.isDirty),Boolean),this.form.state.isValidating=je.some(this.form.fields.map(r=>r.state.isValidating),Boolean),this.form.state.errors=e?Ap(this.form.state.errors,e):nb(this.name,this.form.state.errors),this.form.state.warnings=n?Ap(this.form.state.warnings,n):nb(this.name,this.form.state.warnings)}clearState(){this.state.errors=Rm.errors,this.state.warnings=Rm.warnings,this.state.isTouched=Rm.isTouched,this.state.isDirty=Rm.isDirty,this.bubbleState()}get children(){const e=[];return this.form.fieldMap.forEach((n,r)=>{this.path.isChild(r)&&e.push(n)}),e}get parent(){const e=this.path.parent;if(e)return this.form.fieldMap.get(e.toString())}clear(){this.value&&(this.value=void 0)}async validate(){await this.validateSelf()}async validateSelf(){this.state.isValidating=!0,this.bubbleState();const{errors:e,warnings:n}=await this._runAsyncValidate();e!=null&&e.length?(this.state.errors=je.groupBy(e,"name"),this.state.invalid=!0):(this.state.errors={[this.name]:[]},this.state.invalid=!1),n!=null&&n.length?this.state.warnings=je.groupBy(n,"name"):this.state.warnings={[this.name]:[]},this.state.isValidating=!1,this.bubbleState(),this.form.onValidateEmitter.fire(this.form.state)}async _runAsyncValidate(){let e=[],n=[];const r=await this.form.validateIn(this.name);if(r!=null&&r.length){const i=r.map(o=>e8(o,this.name)).filter(Boolean);if(!(i!=null&&i.length))return{};const s=je.groupBy(i,"level");n=n.concat(s.warning),e=e.concat(s.error)}else return{};return{errors:e,warnings:n}}updateState(e){}dispose(){this.children.map(e=>e.dispose()),this.toDispose.dispose(),this.form.fieldMap.delete(this.path.toString())}onDispose(e){this.toDispose.onDispose(e)}},zb=class extends t8{constructor(){super(...arguments),this.onAppendEmitter=new qe,this.onAppend=this.onAppendEmitter.event,this.onDeleteEmitter=new qe,this.onDelete=this.onDeleteEmitter.event}get children(){const e=[];return this.form.fieldMap.forEach((n,r)=>{this.path.isChild(r)&&e.push(n)}),e.sort((n,r)=>{const i=n.path.value,s=r.path.value,o=parseInt(i[i.length-1]),a=parseInt(i[s.length-1]);return o-a})}map(e){return(this.value||[]).map((r,i)=>{const s=this.path.concat(i).toString();let o=this.form.getField(s);return o||(o=this.form.createField(s)),o}).map(e)}append(e){var a;const n=((a=this.value)==null?void 0:a.length)||0,r=this.path.concat(n).toString(),i=this.form.createField(r),s=this.value?[...this.value,e]:[e],o=this.form.values;return this.form.store.setIn(new ys(this.name),s),this.form.fireOnFormValuesChange({values:this.form.values,prevValues:o,name:this.name,options:{action:"array-append",indexes:[n]}}),this.form.fireOnFormValuesInit({values:this.form.values,prevValues:o,name:r}),this.onAppendEmitter.fire({value:e,arrayValue:this.value,index:this.value.length-1}),i}delete(e){this._splice(e,1),this.onDeleteEmitter.fire({arrayValue:this.value,index:e})}_splice(e,n=1){var u;if(e<0||n<0)throw new Error("[Form] Error in FieldArrayModel.splice: Invalid Params, start and deleteCount should > 0");if(!this.value||this.value.length===0||n>this.value.length)throw new Error(`[Form] Error in FieldArrayModel.splice: delete count exceeds array length, tried to delete ${n} elements, but array length is ${((u=this.value)==null?void 0:u.length)||0}`);const r=this.form.values,i=[...this.value];i.splice(e,n),this.form.store.setIn(new ys(this.name),i),this.form.fireOnFormValuesChange({values:this.form.values,prevValues:r,name:this.name,options:{action:"array-splice",indexes:Array.from({length:n},(h,p)=>p+e)}});const s=this.children;if(e+n>=s.length)for(let h=e;h<s.length;h++)this.form.disposeField(s[h].name);const o=[],a=new Map(this.form.fieldMap),l=(h,p)=>{var g;if((g=h.children)!=null&&g.length&&h.children.forEach(v=>{l(v,p)}),p<e)a.set(h.name,h);else if(p<e+n)o.push(h);else{const v=h.name,w=h.path.replaceParent(this.path.concat(p),this.path.concat(p-n)).toString();a.set(w,h),h.children.length||(h.updateNameForLeafState(w),h.bubbleState()),h.name=w,p>s.length-n-1&&a.delete(v)}};s.map((h,p)=>{l(h,p)}),o.forEach(h=>{h.dispose()}),this.form.fieldMap=a,this.form.alignStateWithFieldMap()}swap(e,n){if(!this.value)return;if(e<0||n<0||e>this.value.length-1||n>this.value.length-1)throw new Error(`[Form]: FieldArrayModel.swap Error: invalid params 'form' and 'to', form=${e} to=${n}. expect the value between 0 to ${length-1}`);const r=this.form.values,i=[...this.value],s=i[e],o=i[n];i[n]=s,i[e]=o,this.form.store.setIn(this.path,i),this.form.fireOnFormValuesChange({values:this.form.values,prevValues:r,name:this.name,options:{action:"array-swap",indexes:[e,n]}});const a=new Map(this.form.fieldMap),l=this.findAllFieldsAt(e),u=this.findAllFieldsAt(n),h=this.getPathAt(e),p=this.getPathAt(n),g=[];l.forEach(v=>{const w=v.path.replaceParent(h,p).toString();v.name=w,v.children.length||(v.updateNameForLeafState(w),g.push(v)),a.set(w,v)}),u.forEach(v=>{const w=v.path.replaceParent(p,h).toString();v.name=w,v.children.length||v.updateNameForLeafState(w),a.set(w,v),g.push(v)}),this.form.fieldMap=a,g.forEach(v=>v.bubbleState()),this.form.alignStateWithFieldMap()}move(e,n){if(!this.value)return;if(e<0||n<0||e>this.value.length-1||n>this.value.length-1)throw new Error(`[Form]: FieldArrayModel.move Error: invalid params 'form' and 'to', form=${e} to=${n}. expect the value between 0 to ${length-1}`);const r=[...this.value],i=r[e];r.splice(e,1),r.splice(n,0,i),this.form.setValueIn(this.name,r)}insertAt(e,n){if(!this.value)return;if(e<0||e>this.value.length)throw new Error("[Form]: FieldArrayModel.insertAt Error: index exceeds array boundary");const r=[...this.value];r.splice(e,0,n),this.form.setValueIn(this.name,r)}getPathAt(e){return this.path.concat(e)}findAllFieldsAt(e){const n=this.getPathAt(e),r=n.toString(),i=this.form.fieldMap.get(r)?[this.form.fieldMap.get(r)]:[];return this.form.fieldMap.forEach((s,o)=>{n.isChildOrGrandChild(o)&&i.push(s)}),i}},fW=class{constructor(){this._fieldMap=new Map,this.store=new hW,this._options={},this.onFieldModelCreateEmitter=new qe,this.onFieldModelCreate=this.onFieldModelCreateEmitter.event,this.onFormValuesChangeEmitter=new qe,this.onFormValuesChange=this.onFormValuesChangeEmitter.event,this.onFormValuesInitEmitter=new qe,this.onFormValuesInit=this.onFormValuesInitEmitter.event,this.onFormValuesUpdatedEmitter=new qe,this.onFormValuesUpdated=this.onFormValuesUpdatedEmitter.event,this.onValidateEmitter=new qe,this.onValidate=this.onValidateEmitter.event,this._state=new q6(uW()),this._initialized=!1}set fieldMap(e){this._fieldMap=e}get fieldMap(){return this._fieldMap}get context(){return this._options.context}get initialValues(){return this._options.initialValues}get values(){return je.cloneDeep(this.store.values)||je.cloneDeep(this.initialValues)}set values(e){const n=this.values;this.store.values=e,this.fireOnFormValuesChange({values:this.values,prevValues:n,name:""})}get validationTrigger(){return this._options.validateTrigger}get state(){return this._state.value}get reactiveState(){return this._state}get fields(){return Array.from(this.fieldMap.values())}updateState(e){}get initialized(){return this._initialized}fireOnFormValuesChange(e){this.onFormValuesChangeEmitter.fire(e),this.onFormValuesUpdatedEmitter.fire(e)}fireOnFormValuesInit(e){this.onFormValuesInitEmitter.fire(e),this.onFormValuesUpdatedEmitter.fire(e)}init(e){if(this._options=e,e.initialValues){const n=this.store.values;this.store.setInitialValues(e.initialValues),this.fireOnFormValuesInit({values:e.initialValues,prevValues:n,name:""})}this._initialized=!0}createField(e,n){const r=new ys(e),i=r.toString();if(this.fieldMap.get(i))return this.fieldMap.get(i);const s=n?new zb(r,this):new t8(r,this);return this.fieldMap.set(i,s),s.onDispose(()=>{this.fieldMap.delete(i)}),this.onFieldModelCreateEmitter.fire(s),s}createFieldArray(e,n){return this.createField(e,!0)}disposeField(e){const n=this.fieldMap.get(e);n&&n.dispose()}deleteField(e){const n=this.fieldMap.get(e);n&&(n.clear(),n.dispose())}getField(e){return this.fieldMap.get(new ys(e).toString())}getValueIn(e){return this.store.getIn(new ys(e))}setValueIn(e,n){const r=this.values;this.store.setIn(new ys(e),n),this.fireOnFormValuesChange({values:this.values,prevValues:r,name:e})}setInitValueIn(e,n){const r=new ys(e);if(this.store.getIn(r)===void 0){const s=this.values;this.store.setIn(new ys(e),n),this.fireOnFormValuesInit({values:this.values,prevValues:s,name:e})}}clearValueIn(e){this.setValueIn(e,void 0)}async validateIn(e){if(!this._options.validate)return;const r=Object.keys(this._options.validate).filter(i=>oc.isMatch(i,e)).map(async i=>{const s=this._options.validate[i];return s({value:this.getValueIn(e),formValues:this.values,context:this.context,name:e})});return Promise.all(r)}async validate(){if(!this._options.validate)return[];const e=Object.keys(this._options.validate).map(async r=>{const i=this._options.validate[r],s=oc.findMatchPathsWithEmptyValue(this.values,r);return Promise.all(s.map(async o=>{const a=await i({value:je.get(this.values,o),formValues:this.values,context:this.context,name:o}),l=e8(a,o),u=this.getField(o),h=nP(o,l),p=nP(o,l);return u&&(u.state.errors=h,u.state.warnings=p,u.state.invalid=lW(h),u.bubbleState()),this.state.errors=Ap(this.state.errors,h),this.state.warnings=Ap(this.state.warnings,p),this.state.invalid=!aW(this.state.errors),l}))});this.state.isValidating=!0;const n=await Promise.all(e);return this.state.isValidating=!1,this.onValidateEmitter.fire(this.state),je.flatten(n).filter(Boolean)}alignStateWithFieldMap(){const e=Array.from(this.fieldMap.keys());this.state.errors&&(this.state.errors=tb(this.state.errors,e)),this.state.warnings&&(this.state.warnings=tb(this.state.warnings,e)),this.fieldMap.forEach(n=>{n.state.errors&&(n.state.errors=tb(n.state.errors,e)),n.state.warnings&&(n.state.warnings=tb(n.state.warnings,e))})}dispose(){this.fieldMap.forEach(e=>e.dispose()),this.store.dispose(),this._initialized=!1}};function n8(e){const{disableAutoInit:n=!1,...r}=e||{},i=new fW;return n||i.init(r||{}),{form:Um(i),control:{_formModel:i,getField:s=>{const o=i.getField(s);if(o)return o instanceof zb?J6(o):$b(o)},init:()=>i.init(r||{})}}}function PI(e){const{children:n,keepModelOnUnMount:r=!1,control:i,...s}=e,{_formModel:o}=R.useMemo(()=>i||n8(s).control,[i]);R.useEffect(()=>()=>{r||o.dispose()},[]);const a=R.useMemo(()=>Um(o),[o]);return D.createElement(Z6.Provider,{value:o},n?je.isFunction(n)?n({form:a}):R.Children.only(n):null)}function r8(e){const n=Cs(),r=MI();if(!r)throw new Error("[Form] error in useWatch, formModel not found");const i=r.getValueIn(e);return R.useEffect(()=>{const s=r.onFormValuesUpdated(({name:o})=>{o===e&&n()});return()=>s.dispose()},[e,r]),i}function pW({name:e,defaultValue:n,deps:r,render:i,children:s}){const o=MI(),a=R.useMemo(()=>o.getField(e)||o.createFieldArray(e),[e]),l=R.useMemo(()=>J6(a),[a]),u=Cs(),h=jb(a.reactiveState),p=jb(o.reactiveState),g=X6(h),v=R.useMemo(()=>TI(p),[p]);R.useEffect(()=>{a.renderCount=a.renderCount+1,!o.getValueIn(e)!==void 0&&n!==void 0&&(o.setInitValueIn(e,n),u());const S=new jt;return S.push(a.onValueChange(()=>{u()})),r&&r.forEach(E=>{var I;const x=(I=o.getField(E))==null?void 0:I.onValueChange(()=>{u()});x&&S.push(x)}),()=>{S.dispose(),a.renderCount>1?a.renderCount=a.renderCount-1:o.getField(a.name)===a&&a.dispose()}},[a]);const w=()=>i&&je.isFunction(i)?i({field:l,fieldState:g,formState:v}):je.isFunction(s)?s({field:l,fieldState:g,formState:v}):R.createElement(R.Fragment,null,"Invalid Array render");return R.createElement(Q6.Provider,{value:a},w())}var i8=(e=>(e.onValueChange="onValueChange",e.onValueInit="onValueInit",e.onValueInitOrChange="onValueInitOrChange",e.onArrayAppend="onArrayAppend",e.onArrayDelete="onArrayDelete",e))(i8||{});function gW(e){return"onFormValuesChange"in e}function yW(e,n){if(!n)return;if(n[e.name])return n[e.name];const r=je.find(Object.keys(n),i=>i.startsWith("regex:")?RegExp(i.split(":")[1]).test(e.name):!1);if(r)return n[r]}function mW(e){return e.map(n=>({feedbackStatus:n.level,feedbackText:n.message,path:n.name}))}function pm(e){return e.startsWith("/")?Zn.normalize(e).slice(1).split("/").join("."):e}function vW(e,n){return je.mergeWith(e,n,function(r,i){return(r||[]).concat(i)})}var bW=({formModel:e})=>e!=null&&e.formControl?D.createElement(D.Fragment,null,D.createElement(PI,{control:e==null?void 0:e.formControl,keepModelOnUnMount:!0},e.formMeta.render)):null;function wW(e){return D.createElement(bW,{formModel:e})}var du={EFFECT_MAP:{},EFFECT_RETURN_MAP:new Map([["onValueInitOrChange",{}],["onValueChange",{}],["onValueInit",{}],["onArrayAppend",{}],["onArrayDelete",{}]]),FORM_FEEDBACKS:[],VALID:null},_W=class extends cN{constructor(e){super(),this.effectMap=du.EFFECT_MAP,this.effectReturnMap=du.EFFECT_RETURN_MAP,this.plugins=[],this.formFeedbacks=du.FORM_FEEDBACKS,this.onInitializedEmitter=new qe,this.onValidateEmitter=new qe,this.onValidate=this.onValidateEmitter.event,this.onInitialized=this.onInitializedEmitter.event,this.onDisposeEmitter=new qe,this.onDispose=this.onDisposeEmitter.event,this.toDispose=new jt,this.onFormValuesChangeEmitter=new qe,this.onFormValuesChange=this.onFormValuesChangeEmitter.event,this.onValidChangeEmitter=new qe,this.onValidChange=this.onValidChangeEmitter.event,this.onFeedbacksChangeEmitter=new qe,this.onFeedbacksChange=this.onFeedbacksChangeEmitter.event,this._valid=du.VALID,this._feedbacks=[],this._initialized=!1,this.node=e,this.toDispose.pushAll([this.onInitializedEmitter,this.onValidateEmitter,this.onValidChangeEmitter,this.onFeedbacksChangeEmitter,this.onFormValuesChangeEmitter])}get valid(){return this._valid}set valid(e){this._valid=e,this.onValidChangeEmitter.fire(e)}get flowNodeEntity(){return this.node}get formManager(){return this.node.getService(Oo)}get formControl(){return this._formControl}get formMeta(){return this.node.getNodeRegistry().formMeta}get values(){var e;return(e=this.nativeFormModel)==null?void 0:e.values}get feedbacks(){return this._feedbacks}set feedbacks(e){this._feedbacks=e,this.onFeedbacksChangeEmitter.fire(e)}get formItemPathMap(){return new Map}get initialized(){return this._initialized}get nodeContext(){return{node:this.node,playgroundContext:this.node.getService(_h)}}get nativeFormModel(){var e;return(e=this._formControl)==null?void 0:e._formModel}render(){return wW(this)}initPlugins(e){e.length&&(this.plugins=e,e.forEach(n=>{var r;n.init(this),(r=n.config)!=null&&r.effect&&vW(this.effectMap,n.config.effect)}))}init(e,n){const r=this.node.getData(gr);this.onFormValuesChange(()=>{this._valid=null,r.fireChange()});const{validateTrigger:i,validate:s,effect:o}=e;o&&(this.effectMap=o);const a=typeof e.defaultValues=="function"?e.defaultValues(this.nodeContext):e.defaultValues,l=e.formatOnInit?e.formatOnInit(n,this.nodeContext):n,{control:u}=n8({initialValues:l||a,validateTrigger:i,context:this.nodeContext,validate:s,disableAutoInit:!0});this._formControl=u;const h=u._formModel;this.toDispose.push(h),h.onFormValuesChange(p=>{this.onFormValuesChangeEmitter.fire(p)}),e.plugins&&this.initPlugins(e.plugins),h.onFormValuesChange(({values:p,prevValues:g,name:v})=>{Object.keys(this.effectMap).filter(S=>oc.isMatchOrParent(S,v)).forEach(S=>{this.effectMap[S].forEach(({effect:x,event:I})=>{var P;if(I==="onValueChange"||I==="onValueInitOrChange"){const M=oc.getParentPathByPattern(S,v),k=(P=this.effectReturnMap.get(I))==null?void 0:P[M];k&&k();const A=x({name:M,value:je.get(p,M),prevValue:je.get(g,M),formValues:p,form:Um(this.nativeFormModel),context:this.nodeContext});if(A&&typeof A=="function"&&this.effectReturnMap.has(I)){const j=this.effectReturnMap.get(I);j[M]=A}}})})}),h.onFormValuesInit(({values:p,name:g,prevValues:v})=>{Object.keys(this.effectMap).forEach(w=>{const S=oc.findMatchPaths(p,w);this.effectMap[w].forEach(({event:x,effect:I})=>{(x==="onValueInit"||x==="onValueInitOrChange")&&S.forEach(P=>{var M;if(oc.isMatchOrParent(g,P)||g===P){const k=(M=this.effectReturnMap.get(x))==null?void 0:M[P];k&&k();const A=I({name:P,value:je.get(p,P),formValues:p,prevValue:je.get(v,P),form:Um(this.nativeFormModel),context:this.nodeContext});if(A&&typeof A=="function"&&this.effectReturnMap.has(x)){const j=this.effectReturnMap.get(x);j[P]=A}}})})})}),h.onFieldModelCreate(p=>{const g=yW(p,this.effectMap);if(g!=null&&g.length){const v=je.groupBy(g,"event");je.mapKeys(v,(w,S)=>{const E=x=>{w.forEach(({effect:I})=>I({...x,formValues:h.values,form:Um(this.nativeFormModel),context:this.nodeContext}))};switch(S){case"onArrayAppend":p instanceof zb&&p.onAppend(E);break;case"onArrayDelete":p instanceof zb&&p.onDelete(E);break}})}}),this._formControl.init(),this._initialized=!0,this.onInitializedEmitter.fire(this),this.onDispose(()=>{this._initialized=!1,this.effectMap={},h.dispose()})}toJSON(){var e,n;return this.formMeta.formatOnSubmit?this.formMeta.formatOnSubmit((e=this.nativeFormModel)==null?void 0:e.values,this.nodeContext):(n=this.nativeFormModel)==null?void 0:n.values}clearValid(){this.valid!==null&&(this.valid=null)}async validate(){var e,n;return this.formFeedbacks=await((e=this.nativeFormModel)==null?void 0:e.validate()),this.valid=je.isEmpty((n=this.formFeedbacks)==null?void 0:n.filter(r=>r.level==="error")),this.onValidateEmitter.fire(this),this.valid}getValues(){var e;return(e=this._formControl)==null?void 0:e._formModel.values}getField(e){var r;let n=e.includes("/")?pm(e):e;return(r=this.formControl)==null?void 0:r.getField(n)}getValueIn(e){var r;let n=e.includes("/")?pm(e):e;return(r=this.nativeFormModel)==null?void 0:r.getValueIn(n)}setValueIn(e,n){var i;let r=e.includes("/")?pm(e):e;(i=this.nativeFormModel)==null||i.setValueIn(r,n)}onFormValueChangeIn(e,n){if(!this._initialized)throw new Error("[NodeEngine] FormModel Error: onFormValueChangeIn can not be called before initialized");return this.formControl._formModel.onFormValuesChange(({name:r,values:i,prevValues:s})=>{r===e&&n({value:je.get(i,e),prevValue:je.get(s,e),formValues:i,prevFormValues:s})})}getFormItemValueByPath(e){var r;if(!e)return;if(e==="/")return(r=this._formControl)==null?void 0:r._formModel.values;const n=pm(e);return this.getValueIn(n)}async validateWithFeedbacks(){return await this.validate(),mW(this.formFeedbacks)}getFormItemByPath(e){if(!this.nativeFormModel)return;const n=this;if(e==="/")return{get value(){return n.nativeFormModel.values},set value(s){n.nativeFormModel.values=s}};const r=pm(e),i=n.getValueIn(r);return{get value(){return i},set value(s){n.setValueIn(r,s)}}}dispose(){this.onDisposeEmitter.fire(),this.effectReturnMap.forEach(e=>{Object.values(e).forEach(n=>{n()})}),this.effectMap=du.EFFECT_MAP,this.effectReturnMap=du.EFFECT_RETURN_MAP,this.plugins.forEach(e=>{e.dispose()}),this.plugins=[],this.formFeedbacks=du.FORM_FEEDBACKS,this._valid=du.VALID,this._formControl=void 0,this._initialized=!1,this.toDispose.dispose()}},CW=class{constructor(e,n,r){this.name=e,this.pluginId=`${e}__${Wi()}`,this.config=n,this.opts=r}get formModel(){return this._formModel}get ctx(){return{formModel:this.formModel,node:this.formModel.nodeContext.node,playgroundContext:this.formModel.nodeContext.playgroundContext}}init(e){var n,r;this._formModel=e,(r=(n=this.config)==null?void 0:n.onInit)==null||r.call(n,this.ctx,this.opts)}dispose(){var e,n;(e=this.config)!=null&&e.onDispose&&((n=this.config)==null||n.onDispose(this.ctx,this.opts))}};function EW(e,n){return function(r){return new CW(e,n,r)}}function Km(e){var s;const n=(s=e.getData(gr))==null?void 0:s.getFormModel(),r=n==null?void 0:n.nativeFormModel;if(!n||!r)return;const i={initialValues:r.initialValues,get values(){return r.values},state:r.state,getValueIn:o=>r.getValueIn(o),setValueIn:(o,a)=>r.setValueIn(o,a),render:()=>D.createElement(YK,{node:e}),onFormValuesChange:n.onFormValuesChange.bind(n),onFormValueChangeIn:n.onFormValueChangeIn.bind(n),onValidate:n.nativeFormModel.onValidate,validate:n.validate.bind(n)};return Object.defineProperty(i,"_formModel",{enumerable:!1,get(){return n}}),i}var xW=Object.defineProperty,SW=Object.getOwnPropertyDescriptor,lr=(e,n,r,i)=>{for(var s=i>1?void 0:i?SW(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&xW(n,r,s),s},rP=(e,n)=>(r,i)=>n(r,i,e),In=(e=>(e.START="start",e.DEFAULT="default",e.ROOT="root",e.EMPTY="empty",e.INLINE_BLOCKS="inlineBlocks",e.BLOCK_ICON="blockIcon",e.BLOCK="block",e.BLOCK_ORDER_ICON="blockOrderIcon",e.GROUP="group",e.END="end",e.CONDITION="condition",e.SUB_CANVAS="subCanvas",e))(In||{}),DW=["root","inlineBlocks","block"],s8=Symbol("FlowLayoutContribution"),Vb=(e=>(e.VERTICAL_FIXED_LAYOUT="vertical-fixed-layout",e.HORIZONTAL_FIXED_LAYOUT="horizontal-fixed-layout",e))(Vb||{});(e=>{function n(r){return r.name==="vertical-fixed-layout"}e.isVertical=n})(Vb||(Vb={}));var Bi=(e=>(e[e.STRAIGHT_LINE=0]="STRAIGHT_LINE",e[e.DIVERGE_LINE=1]="DIVERGE_LINE",e[e.MERGE_LINE=2]="MERGE_LINE",e[e.ROUNDED_LINE=3]="ROUNDED_LINE",e[e.CUSTOM_LINE=4]="CUSTOM_LINE",e[e.DRAGGING_LINE=5]="DRAGGING_LINE",e))(Bi||{}),Wa=(e=>(e[e.ADDER_LABEL=0]="ADDER_LABEL",e[e.TEXT_LABEL=1]="TEXT_LABEL",e[e.COLLAPSE_LABEL=2]="COLLAPSE_LABEL",e[e.COLLAPSE_ADDER_LABEL=3]="COLLAPSE_ADDER_LABEL",e[e.CUSTOM_LABEL=4]="CUSTOM_LABEL",e[e.BRANCH_DRAGGING_LABEL=5]="BRANCH_DRAGGING_LABEL",e))(Wa||{}),qa={NODE_SPACING:"SPACING",ROUNDED_LINE_X_RADIUS:"ROUNDED_LINE_X_RADIUS",ROUNDED_LINE_Y_RADIUS:"ROUNDED_LINE_Y_RADIUS",INLINE_BLOCKS_PADDING_BOTTOM:"INLINE_BLOCKS_PADDING_BOTTOM",COLLAPSED_SPACING:"COLLAPSED_SPACING",HOVER_AREA_WIDTH:"HOVER_AREA_WIDTH"},Wm={NULL:0,[qa.NODE_SPACING]:32,MARGIN_RIGHT:20,INLINE_BLOCK_PADDING_BOTTOM:16,INLINE_BLOCKS_PADDING_TOP:30,[qa.INLINE_BLOCKS_PADDING_BOTTOM]:40,MIN_INLINE_BLOCK_SPACING:200,MIN_INLINE_BLOCK_SPACING_HORIZONTAL:80,[qa.COLLAPSED_SPACING]:12,[qa.ROUNDED_LINE_X_RADIUS]:16,[qa.ROUNDED_LINE_Y_RADIUS]:20,[qa.HOVER_AREA_WIDTH]:20},o8=(e=>(e.PRE_BRANCH="pre_branch",e.NORMAL_BRANCH="normal_branch",e))(o8||{}),NW={width:280,height:60},IW=(e,n)=>{const r=DW.includes(e);return{isStart:e==="start",hidden:r,defaultExpanded:n.options.allNodesDefaultExpanded,expandedSize:{width:520,height:300},size:NW,origin:n.layout.getDefaultNodeOrigin(),isInlineBlocks:e==="inlineBlocks",spacing:Wm.SPACING,inlineSpacingPre:0,inlineSpacingAfter:0,expandable:!0,draggable:!0,selectable:!0,renderKey:"",minInlineBlockSpacing:()=>Vb.isVertical(n.layout)?Wm.MIN_INLINE_BLOCK_SPACING:Wm.MIN_INLINE_BLOCK_SPACING_HORIZONTAL}},Bb;(e=>{function n(i,s,o){return{...i,...s,meta:{...i.meta,...s.meta},extend:void 0,type:o}}e.merge=n;function r(i,s){return s.length?s.reduce((o,a)=>n(o,a,i.type),i):i}e.extend=r})(Bb||(Bb={}));var AI=(e=>(e.addFromNode="addFromNode",e.deleteFromNode="deleteFromNode",e.addBlock="addBlock",e.deleteBlock="deleteBlock",e.createGroup="createGroup",e.ungroup="ungroup",e.moveNodes="moveNodes",e.moveBlock="moveBlock",e.moveChildNodes="moveChildNodes",e.addNodes="addNodes",e.deleteNodes="deleteNodes",e.changeNode="changeNode",e.addChildNode="addChildNode",e.deleteChildNode="deleteChildNode",e.addNode="addNode",e.deleteNode="deleteNode",e))(AI||{}),Iw=Symbol("FlowOperationBaseService"),a8=class km extends Wr{constructor(n){super(n),this.onExtInfoChangeEmitter=new qe,this.onExtInfoChange=this.onExtInfoChangeEmitter.event,this.toDispose.push(on.create(()=>{this._node&&this._node.remove()}))}get key(){return this.entity.id}getDefaultData(){const{addable:n,expandable:r,defaultExpanded:i}=this.entity.getNodeMeta();return{addable:n,expandable:r,expanded:i||!1,activated:!1,hovered:!1,dragging:!1,stackIndex:0}}updateExtInfo(n){if(ju.isChanged(this.data.extInfo,n)){const r=this.data.extInfo;this.update({extInfo:n}),this.onExtInfoChangeEmitter.fire({oldInfo:r,newInfo:n})}}getExtInfo(){return this.data.extInfo}get addable(){return this.data.addable}get expandable(){return this.data.expandable}get draggable(){const{draggable:n}=this.entity.getNodeMeta();return typeof n=="function"?n(this.entity):n}get expanded(){return this.data.expanded}set expanded(n){this.expandable&&this.data.expanded!==n&&(this.data.expanded=n,this.fireChange())}toggleExpand(){this.expanded=!this.expanded}toggleMouseEnter(n=!1){var i;if(this.entity.document.renderState.setNodeHovered(this.entity),n)return;const r=this.entity.getData(at);r.renderState.hidden||(this.mouseLeaveTimeout&&(clearTimeout(this.mouseLeaveTimeout),this.mouseLeaveTimeout=void 0),r.renderState.hovered=!0,this.entity.isFirst&&((i=this.entity.parent)==null?void 0:i.id)!=="root"?r.parent.renderState.activated=!0:r.renderState.activated=!0)}toggleMouseLeave(n=!1){if(this.entity.document.renderState.setNodeHovered(void 0),n)return;const r=this.entity.getData(at);this.mouseLeaveTimeout=setTimeout(()=>{var i;r.renderState.hovered=!1,this.entity.isFirst&&((i=this.entity.parent)==null?void 0:i.id)!=="root"&&(r.parent.renderState.activated=!1),r.renderState.activated=!1},200)}get hidden(){return this.entity.hidden}set hovered(n){this.data.hovered=n,this.fireChange()}get hovered(){return this.data.hovered}get dragging(){return this.data.dragging}set dragging(n){this.data.dragging!==n&&(this.data.dragging=n,this.fireChange())}set activated(n){if(this.entity.flowNodeType==="blockIcon"&&this.entity.parent){this.entity.parent.getData(km).activated=n;return}this.data.activated!==n&&(this.data.activated=n,this.fireChange())}get activated(){const{entity:n}=this;return n.parent&&n.parent.getData(km).activated?!0:this.data.activated}get stackIndex(){return this.data.stackIndex}set stackIndex(n){this.data.stackIndex=n}get lineActivated(){var r,i,s;const{activated:n}=this;return n?!!((i=(r=this.entity.parent)==null?void 0:r.getData(km))!=null&&i.activated||this.entity.isInlineBlock||(s=this.entity.next)!=null&&s.getData(km).activated):!1}get node(){return this._node?this._node:(this._node=ft.createDivWithClass("gedit-flow-activity-node"),this._node.dataset.testid="sdk.workflow.canvas.node",this._node.dataset.nodeId=this.entity.id,this._node)}dispose(){super.dispose(),this.onExtInfoChangeEmitter.dispose()}};a8.type="FlowNodeRenderData";var zn=a8,l8=class ea extends Wr{constructor(n){super(n),this.localDirty=!0;const{origin:r}=this.entity.getNodeMeta();this.transform=this.entity.addData(qt),this.transform.changeLocked=!0,this.transform.update({origin:{...r}}),this.transform.changeLocked=!1,this.renderState=this.entity.addData(zn),this.bindChange(this.transform),this.toDispose.push(on.create(()=>{const{next:i,parent:s}=this;i&&(i.localDirty=!0),s&&(s.localDirty=!0)}))}get origin(){return this.transform.origin}get key(){return this.entity.id}getDefaultData(){const{size:n,defaultExpanded:r,expandedSize:i,hidden:s}=this.entity.getNodeMeta();return{size:s?{width:0,height:0}:{...r?i:n}}}get collapsed(){return this.entity.collapsed}set collapsed(n){this.entity.collapsed=n,this.localDirty=!0,this.firstChild&&(this.firstChild.localDirty=!0),this.fireChange()}get size(){return this.entity.memoGlobal("size",()=>this.isContainer?this.transform.localSize:this.data.size)}get position(){const{position:n}=this.transform;return{x:n.x,y:n.y}}set size(n){const{width:r,height:i}=this.data.size;this.isContainer||(n.width!==r||n.height!==i)&&(this._data.size={...n},this.localDirty=!0,this.fireChange())}get inputPoint(){return this.entity.memoGlobal("inputPoint",()=>{const{getInputPoint:n}=this.entity.getNodeRegistry();return n?n(this,this.entity.document.layout):this.defaultInputPoint})}get defaultInputPoint(){return this.entity.memoGlobal("defaultInputPoint",()=>this.entity.document.layout.getDefaultInputPoint(this.entity))}get defaultOutputPoint(){return this.entity.memoGlobal("defaultOutputPoint",()=>this.entity.document.layout.getDefaultOutputPoint(this.entity))}get outputPoint(){return this.entity.memoGlobal("outputPoint",()=>{const{getOutputPoint:n}=this.entity.getNodeRegistry();return n?n(this,this.entity.document.layout):this.defaultOutputPoint})}get originDeltaX(){return this.entity.memoLocal("originDeltaX",()=>{const{children:n}=this,{getOriginDeltaX:r}=this.entity.getNodeRegistry();return r?r(this,this.entity.document.layout):n.length===0?-this.size.width*this.origin.x:n.length===1?n[0].originDeltaX:this.entity.isInlineBlocks&&n.length>1?n[0].originDeltaX+this.transform.position.x:n.reduce((i,s)=>{const o=s.originDeltaX;return i===void 0||o<i?o:i},void 0)})}get originDeltaY(){return this.entity.memoLocal("originDeltaY",()=>{const{children:n}=this,{getOriginDeltaY:r}=this.entity.getNodeRegistry();return r?r(this,this.entity.document.layout):n.length===0?-this.size.height*this.origin.y:n.length===1?n[0].originDeltaY:this.entity.isInlineBlocks&&n.length>1?n[0].originDeltaY+this.transform.position.y:n.reduce((i,s)=>{const o=s.originDeltaY;return i===void 0||o<i?o:i},void 0)})}get bounds(){return this.entity.memoGlobal("bounds",()=>{const{transform:n}=this;if(this.isContainer){const r=n.children.map(i=>i.entity.getData(ea).boundsWithPadding);return Qe.enlarge(r).withPadding(this.padding)}return n.bounds})}get boundsWithPadding(){return this.entity.memoGlobal("boundsWithPadding",()=>{const{transform:n}=this;if(this.isContainer){const r=n.children.map(i=>i.entity.getData(ea).boundsWithPadding);return Qe.enlarge(r).withPadding(this.padding)}return n.bounds.clone().withPadding(this.padding)})}get isContainer(){return this.transform.isContainer}get localBounds(){return this.entity.memoLocal("localBounds",()=>{const{transform:n}=this;if(this.isContainer){const r=n.children.map(s=>s.entity.getData(ea).localBounds),i=Qe.enlarge(r).withPadding(this.padding);return Fp.applyMatrix(i,n.localTransform)}return n.localBounds.clone().withPadding(this.padding)})}get padding(){return this.entity.document.layout.getPadding(this.entity)}setParentTransform(n){this.transform.parent!==(n==null?void 0:n.transform)&&(this.localDirty=!0),this.transform.setParent(n==null?void 0:n.transform)}get spacing(){const{spacing:n}=this.entity.getNodeMeta();return typeof n=="function"?n(this):n}get inlineSpacingPre(){const{inlineSpacingPre:n}=this.entity.getNodeMeta();return typeof n=="function"?n(this):n}get inlineSpacingAfter(){const{inlineSpacingAfter:n}=this.entity.getNodeMeta();return typeof n=="function"?n(this):n}get minInlineBlockSpacing(){const{minInlineBlockSpacing:n}=this.entity.getNodeMeta();return typeof n=="function"?n(this):n}get children(){return this.entity.children.map(n=>n.getData(ea))}get pre(){var n;return(n=this.entity.pre)==null?void 0:n.getData(ea)}get originParent(){var n;return(n=this.entity.originParent)==null?void 0:n.getData(ea)}get isFirst(){return this.entity.isFirst}get isLast(){return this.entity.isLast}get lastChild(){var n;return(n=this.entity.lastChild)==null?void 0:n.getData(ea)}get firstChild(){var n;return(n=this.entity.firstChild)==null?void 0:n.getData(ea)}get next(){var n;return(n=this.entity.next)==null?void 0:n.getData(ea)}get parent(){var n;return(n=this.entity.parent)==null?void 0:n.getData(ea)}};l8.type="FlowNodeTransformData";var at=l8,OW=e=>{const{transform:n}=e,r=n.outputPoint;return n.next?[{type:0,from:r,to:n.next.inputPoint}]:[]},TW=e=>{var s;const{transform:n}=e,r=n.outputPoint,i=(s=n.parent)==null?void 0:s.outputPoint;return!n.next&&i&&!new qs().copyFrom(r).equals(i)&&!e.isNodeEnd?[{type:0,from:r,to:i}]:[]},mg=class extends Wr{getDefaultData(){return{}}formatLines(e){var n,r,i;return(n=this.entity.document.options)!=null&&n.formatNodeLines?(i=(r=this.entity.document.options)==null?void 0:r.formatNodeLines)==null?void 0:i.call(r,this.entity,e):e}formatLabels(e){var n,r;return this.entity.document.options.formatNodeLabels?(r=(n=this.entity.document.options)==null?void 0:n.formatNodeLabels)==null?void 0:r.call(n,this.entity,e):e}get lines(){return this.entity.memoGlobal("lines",()=>{var r;const{getChildLines:e}=((r=this.entity.parent)==null?void 0:r.getNodeRegistry())||{};if(e)return this.formatLines(e(this,this.entity.document.layout));const{getLines:n}=this.entity.getNodeRegistry();return n?this.formatLines(n(this,this.entity.document.layout)):this.transform.entity.isInlineBlock?[]:this.formatLines([...OW(this),...TW(this)])})}get labels(){return this.entity.memoGlobal("labels",()=>{var s,o;const{getChildLabels:e}=((s=this.entity.parent)==null?void 0:s.getNodeRegistry())||{};if(e)return this.formatLabels(e(this,this.entity.document.layout));const{getLabels:n}=this.entity.getNodeRegistry();if(n)return this.formatLabels(n(this,this.entity.document.layout));if(this.transform.entity.isInlineBlock)return[];const r=this.transform.outputPoint;if(this.transform.next)return this.formatLabels([{offset:qs.getMiddlePoint(r,this.transform.next.inputPoint),type:0}]);const i=(o=this.transform.parent)==null?void 0:o.outputPoint;return i&&!new qs().copyFrom(r).equals(i)&&!this.isNodeEnd?this.formatLabels([{offset:i,type:0}]):[]})}constructor(e){super(e),this.transform=this.entity.addData(at),this.renderData=this.entity.addData(zn),this.bindChange(this.transform),this.bindChange(this.renderData)}get collapsed(){return this.entity.collapsed}get isNodeEnd(){return this.entity.isNodeEnd}};mg.type="FlowNodeTransitionData";var Kr=class extends ol{constructor(e){super(e),this._memoLocalCache=new Map,this._memoGlobalCache=new Map,this.flowNodeType="unknown",this._hidden=!1,this.index=-1,this.document=e.document,this.flowNodeType=e.flowNodeType,this.originParent=e.originParent,this.metaFromJSON=e.meta,this.onDispose(()=>{this.document.originTree.getChildren(this).slice().forEach(n=>{n.dispose()}),this.document.originTree.remove(this,!1),this.originParent=void 0})}initData(e){e.originParent!==this.originParent&&(this.originParent=e.originParent,this._registerCache=void 0),e.parent&&e.parent.addChild(this,e.index),e.meta!==this.metaFromJSON&&(this._metaCache=void 0,this.metaFromJSON=e.meta),this._hidden=!!(this.getNodeMeta().hidden||e.hidden)}get isStart(){return this.getNodeMeta().isStart}get isFirst(){return!this.pre}get isLast(){return!this.next}get isInlineBlocks(){const e=this.getNodeMeta().isInlineBlocks;return typeof e=="function"?e(this):e}get isInlineBlock(){const e=this.document.renderTree.getParent(this);return!!(e&&e.isInlineBlocks)}get isNodeEnd(){return this.memoLocal("isNodeEnd",()=>this.getNodeMeta().isNodeEnd?!0:this.isInlineBlocks&&this.collapsedChildren.length?this.collapsedChildren.every(e=>e.isNodeEnd):this.lastCollapsedChild?this.lastCollapsedChild.isNodeEnd:!1)}addChild(e,n){e.parent!==this&&this.document.originTree.addChild(this,e,n)}get hasChild(){return this.children.length>0}get pre(){return this.document.renderTree.getPre(this)}get next(){return this.document.renderTree.getNext(this)}get parent(){return this.document.renderTree.getParent(this)}getNodeRegistry(){return this._registerCache?this._registerCache:(this._registerCache=this.document.getNodeRegistry(this.flowNodeType,this.originParent),this._registerCache)}getNodeRegister(){return this.getNodeRegistry()}getNodeMeta(){return this._metaCache?this._metaCache:(this.metaFromJSON?this._metaCache={...this.getNodeRegistry().meta,...this.metaFromJSON}:this._metaCache=this.getNodeRegistry().meta,this._metaCache)}get allChildren(){const e=[];for(const n of this.children)e.push(n),e.push(...n.allChildren);return e}get allCollapsedChildren(){const e=[];for(const n of this.collapsedChildren)e.push(n),e.push(...n.allCollapsedChildren);return e}get collapsedChildren(){return this.document.renderTree.getCollapsedChildren(this)}get blocks(){return this.collapsedChildren}get lastBlock(){return this.lastCollapsedChild}get lastCollapsedChild(){const{collapsedChildren:e}=this;return e[e.length-1]}get children(){return this.document.renderTree.getChildren(this)}get lastChild(){const{children:e}=this;return e[e.length-1]}get firstChild(){return this.children[0]}memoLocal(e,n){if(this._memoLocalCache.has(e))return this._memoLocalCache.get(e);const r=n();return this._memoLocalCache.set(e,r),r}memoGlobal(e,n){if(this._memoGlobalCache.has(e))return this._memoGlobalCache.get(e);const r=n();return this._memoGlobalCache.set(e,r),r}clearMemoGlobal(){this._memoGlobalCache.clear()}clearMemoLocal(){this._memoLocalCache.clear()}get childrenLength(){return this.children.length}get collapsed(){var e;return this.document.renderTree.isCollapsed(this)?!0:!!((e=this.parent)!=null&&e.collapsed)}set collapsed(e){this.document.renderTree.setCollapsed(this,e),this.clearMemoGlobal(),this.clearMemoLocal()}get hidden(){return this._hidden}openInsideCollapsed(){this.document.renderTree.openNodeInsideCollapsed(this)}getJSONData(){return this.getExtInfo()}toJSON(){if(this.document.options.toNodeJSON)return this.document.options.toNodeJSON(this);const e={};let n;return this.document.traverse(r=>{if(r.id.startsWith("$"))return;const s=this.getJSONData(),o={id:r.id,type:r.flowNodeType};s!==void 0&&(o.data=s),n||(n=o);let{parent:a}=r;a&&a.id.startsWith("$")&&(a=a.originParent);const l=a?e[a.id]:void 0;l&&(l.blocks||(l.blocks=[]),l.blocks.push(o)),e[r.id]=o},this),n}get isVertical(){return this.document.layout.name==="vertical-fixed-layout"}updateExtInfo(e){this.getData(zn).updateExtInfo(e)}getExtInfo(){return this.getData(zn).getExtInfo()}get onExtInfoChange(){return this.renderData.onExtInfoChange}get renderData(){return this.getData(zn)}get transform(){return this.getData(at)}get bounds(){return this.transform.bounds}};Kr.type="FlowNodeEntity";(e=>{function n(r){return r instanceof e}e.is=n})(Kr||(Kr={}));var Fu=class extends sa{constructor(e){super(e),this.onRefreshEmitter=new qe,this.lastTransformVersion=-1,this.lastTreeVersion=-1,this.onRefresh=this.onRefreshEmitter.event,this.document=e.document,this.toDispose.push(this.document.originTree.onTreeChange(()=>{this.config.treeVersion+=1,this.fireChange()})),this.toDispose.push(this.onRefreshEmitter)}getDefaultConfig(){return{loading:!0,treeVersion:0}}get loading(){return this.config.loading}set loading(e){this.config.loading!==e&&(this.config.loading=e,this.fireChange())}updateTransformsTree(){this.document.renderTree.traverse((e,n,r)=>{const i=e.getData(at);i.collapsed&&i.transform.clearChildren(),e.parent&&i.setParentTransform(e.parent.getData(at)),e.index=r})}clear(){this.lastTreeVersion=-1,this.lastTransformVersion=-1}isTreeDirty(){const e=this.entityManager.getEntityDataVersion(at),n=this.lastTreeVersion!==this.config.treeVersion,r=this.lastTransformVersion!==e;return n||r}refresh(){const e=this.entityManager.getEntityDataVersion(at),n=this.lastTreeVersion!==this.config.treeVersion,r=this.lastTransformVersion!==e;this.entityManager.changeEntityLocked=!0,n&&(this.document.renderTree.updateRenderStruct(),this.updateTransformsTree(),this.lastTreeVersion=this.config.treeVersion),(n||r)&&(this.document.layout.update(),this.lastTransformVersion=this.entityManager.getEntityDataVersion(at),this.lastTreeVersion=this.config.treeVersion,this.onRefreshEmitter.fire()),this.entityManager.changeEntityLocked=!1}};Fu.type="FlowDocumentTransformerEntity";var Vv=class extends sa{getDefaultConfig(){return{}}constructor(e){super(e)}getNodeHovered(){return this.config.nodeHoveredId?this.entityManager.getEntityById(this.config.nodeHoveredId):void 0}setNodeHovered(e){this.updateConfig({nodeHoveredId:e==null?void 0:e.id})}getDragLabelSide(){return this.config.dragLabelSide}setDragLabelSide(e){this.updateConfig({dragLabelSide:e})}getNodeDroppingId(){return this.config.nodeDroppingId}setNodeDroppingId(e){this.updateConfig({nodeDroppingId:e})}getDragStartEntity(){const{nodeDragStartId:e}=this.config;return this.entityManager.getEntityById(e)}setDragStartEntity(e){this.updateConfig({nodeDragStartId:e==null?void 0:e.id})}getDragEntities(){const{nodeDragIds:e}=this.config;return(e||[]).map(n=>this.entityManager.getEntityById(n))}setDragEntities(e){this.updateConfig({nodeDragIds:e.map(n=>n.id),nodeDragIdsWithChildren:e.map(n=>[n.id,...n.allCollapsedChildren.map(r=>r.id)]).flat()})}onNodeHoveredChange(e,n=100){return this.onConfigChanged(je.debounce(()=>e(this.getNodeHovered()),n))}};Vv.type="FlowRendererStateEntity";var c8=class u8{constructor(n){this.root=n,this.onTreeChangeEmitter=new qe,this.onTreeChange=this.onTreeChangeEmitter.event,this.map=new Map}dispose(){this.map.clear(),this.onTreeChangeEmitter.dispose()}getInfo(n){let r=this.map.get(n);return r||(r={children:[]},this.map.set(n,r)),r}clear(){this.map.clear()}cloneMap(){const n=new Map;for(const[r,i]of this.map)n.set(r,{...i,children:i.children.slice()});return n}clone(){const n=new u8(this.root);return n.map=this.cloneMap(),n}remove(n,r=!0){this.removeParent(n),r&&this._removeChildren(n),this.map.delete(n),this.fireTreeChange()}addChild(n,r,i){const s=this.getInfo(n),o=this.getInfo(r);if(o.parent){if(o.parent===n)return r;o.parent!==n&&this.removeParent(r)}const a=s.children.length,l=typeof i>"u"?a-1:i-1,u=s.children[l],h=s.children[l+1];return u&&(this.getInfo(u).next=r),h&&(this.getInfo(h).pre=r),o.pre=u,o.next=h,s.children.splice(l+1,0,r),o.parent=n,this.fireTreeChange(),r}moveChilds(n,r,i){const s=this.getInfo(n),o=s.children.length;let a=i??o;return r.forEach(l=>{this.getInfo(l).parent&&this.removeParent(l)}),r.forEach(l=>{const u=this.getInfo(l);let h=s.children[a-1],p=s.children[a];h&&(this.getInfo(h).next=l),p&&(this.getInfo(p).pre=l),u.pre=h,u.next=p,s.children.splice(a,0,l),u.parent=n,a++}),this.fireTreeChange(),r}getById(n){for(const r of this.map.keys())if(r.id===n)return r}insertAfter(n,r){const i=this.getInfo(n),s=this.getInfo(r);if(this.removeParent(r),i.parent){const o=this.getInfo(i.parent);o.children.splice(o.children.indexOf(n)+1,0,r);const{next:a}=i;a&&(this.getInfo(a).pre=r),s.next=a,i.next=r,s.pre=n,s.parent=i.parent}this.fireTreeChange()}removeParent(n){const r=this.getInfo(n);if(!r.parent)return;const i=this.getInfo(r.parent),s=i.children.indexOf(n);i.children.splice(s,1);const{pre:o,next:a}=r;o&&(this.getInfo(o).next=a),a&&(this.getInfo(a).pre=o),this.fireTreeChange()}_removeChildren(n){const r=this.getChildren(n);r.length>0&&r.forEach(i=>{this._removeChildren(i),this.map.delete(i)})}getParent(n){return this.getInfo(n).parent}getPre(n){return this.getInfo(n).pre}getNext(n){return this.getInfo(n).next}getChildren(n){return this.getInfo(n).children}traverse(n,r=this.root,i=0,s=0){if(n(r,i,s)||this.getInfo(r).children.find((u,h)=>this.traverse(n,u,i+1,h)))return!0}fireTreeChange(){this.onTreeChangeEmitter.fire()}get size(){return this.map.size}toString(){const n=[];return this.traverse((r,i)=>{i===0?n.push(r.id):n.push(`|${new Array(i).fill("--").join("")} ${r.id}`)}),`${n.join(`
|
||
`)}`}},MW=class extends c8{constructor(e,n,r){super(e),this.root=e,this.nodesCollapsed=new Set,this.originTree=n,this.onTreeChange=this.originTree.onTreeChange,this.document=r}isCollapsed(e){return this.nodesCollapsed.has(e)}get collapsedNodeList(){return Array.from(this.nodesCollapsed)}setCollapsed(e,n){n?this.nodesCollapsed.add(e):this.nodesCollapsed.delete(e),this.originTree.fireTreeChange()}openNodeInsideCollapsed(e){var r;let n=(r=this.originTree.getInfo(e))==null?void 0:r.parent;for(;n;){this.nodesCollapsed.has(n)&&this.nodesCollapsed.delete(n);const{parent:i}=this.originTree.getInfo(n)||{};n=i}this.originTree.fireTreeChange()}updateRenderStruct(){this.map=this.originTree.cloneMap(),this.document.config.get("END_NODES_REFINE_BRANCH")&&this.refineBranch(this.root),this.hideCollapsed()}hideCollapsed(){this.nodesCollapsed.forEach(e=>{const n=this.getInfo(e);if(!n){this.nodesCollapsed.delete(e);return}const r=n.children.find(i=>i.flowNodeType==="blockIcon"||i.flowNodeType==="blockOrderIcon");if(r){const i=this.getInfo(r);i.next=void 0,i.pre=void 0,n.children=[r];return}n.children=[]})}isNodeEnd(e){if(e.getNodeMeta().isNodeEnd)return!0;const{children:n}=this.getInfo(e);return n.length>0&&e.isInlineBlocks?n.every(r=>this.isNodeEnd(r)):e.isInlineBlock?this.isNodeEnd(n[n.length-1]):!1}refineBranch(e){let n=this.getInfo(e).children[0];for(;n;){if(n.flowNodeType==="dynamicSplit"||n.flowNodeType==="staticSplit"){const{next:r,children:i}=this.getInfo(n),{children:s}=this.getInfo(i[1]),o=(s||[]).filter(l=>!this.isNodeEnd(l)),a=o.length===1;if(a&&r&&this.dragNextNodesToBlock(o[0],r),s==null||s.forEach(l=>{this.refineBranch(l)}),a)break}n=n.next}}dragNextNodesToBlock(e,n){const r=this.getInfo(e),i=this.getInfo(n),s=r.children[e.children.length-1];if(i.parent){const o=this.getInfo(i.parent);if(i.pre&&(this.getInfo(i.pre).next=void 0),s){const u=this.getInfo(s);u.next=n,i.pre=s}const a=o.children.indexOf(n),l=o.children.slice(a);o.children=o.children.slice(0,a);for(const u of l){const h=this.getInfo(u);r.children.push(u),h.parent=e}}}getInfo(e){return this.map.get(e)||this.originTree.getInfo(e)}getOriginInfo(e){return this.originTree.getInfo(e)}getCollapsedChildren(e){return this.getOriginInfo(e).children||[]}remove(){throw new Error("Render Tree cannot use remove node")}addChild(){throw new Error("Render tree cannot use add child")}insertAfter(){throw new Error("Render tree cannot use insert after")}removeParent(){throw new Error("Render tree cannot use remove parent")}},RI=Symbol("FlowDocumentOptions"),PW={allNodesDefaultExpanded:!1},fN={...qa,BASE_COLOR:"BASE_COLOR",BASE_ACTIVATED_COLOR:"BASE_ACTIVATED_COLOR"},kI=Symbol("FlowDocumentContribution"),AW=Symbol("FlowDocumentConfigDefaultData"),Hb=class{constructor(e={}){this._data=e,this.onDataChangeEmitter=new qe,this.onChange=this.onDataChangeEmitter.event}get(e){return this._data[e]}set(e,n){this.get(e)!==n&&(this._data[e]=n,this.onDataChangeEmitter.fire(e))}registerConfigs(e){Object.keys(e).forEach(n=>{this.set(n,e[n])})}};Hb=lr([$e(),rP(0,oe(AW)),rP(0,pr())],Hb);var Ow=Symbol("FlowDocumentProvider"),On=class{constructor(){this.contributions=[],this.registers=new Map,this.nodeRegistryCache=new Map,this.nodeDataRegistries=[],this.layouts=[],this.currentLayoutKey="",this.onNodeUpdateEmitter=new qe,this.onNodeCreateEmitter=new qe,this.onNodeDisposeEmitter=new qe,this.onLayoutChangeEmitter=new qe,this.onNodeUpdate=this.onNodeUpdateEmitter.event,this.onNodeCreate=this.onNodeCreateEmitter.event,this.onNodeDispose=this.onNodeDisposeEmitter.event,this.onLayoutChange=this.onLayoutChangeEmitter.event}init(){var e,n;this.options||(this.options=PW),this.currentLayoutKey=this.options.defaultLayout||"vertical-fixed-layout",this.contributions.forEach(r=>{var i;return(i=r.registerDocument)==null?void 0:i.call(r,this)}),this.root=this.addNode({id:"root",type:"root"}),this.originTree=new c8(this.root),this.transformer=this.entityManager.createEntity(Fu,{document:this}),this.renderState=this.entityManager.createEntity(Vv),this.renderTree=new MW(this.root,this.originTree,this),(n=(e=this.layout).reload)==null||n.call(e)}fromJSON(e,n=!0){this.originTree.clear(),this.renderTree.clear(),this.entityManager.changeEntityLocked=!0;const r=this.entityManager.getEntities(Kr),i=[this.root];this.addBlocksAsChildren(this.root,e.nodes||[],i),r.forEach(s=>{i.includes(s)||s.dispose()}),this.entityManager.changeEntityLocked=!1,this.transformer.loading=!1,n&&this.fireRender()}get layout(){const e=this.layouts.find(n=>n.name==this.currentLayoutKey);if(!e)throw new Error(`Unknown flow layout: ${this.currentLayoutKey}`);return e}async load(){await Promise.all(this.contributions.map(e=>{var n;return(n=e.loadDocument)==null?void 0:n.call(e,this)}))}get loading(){return this.transformer.loading}fireRender(){this.transformer.isTreeDirty()&&(this.entityManager.fireEntityChanged(Kr.type),this.entityManager.fireEntityChanged(Fu.type))}addFromNode(e,n){const r=typeof e=="string"?this.getNode(e):e;this.entityManager.changeEntityLocked=!0;const{parent:i}=r,s=this.addNode({...n,parent:i});return this.originTree.insertAfter(r,s),this.entityManager.changeEntityLocked=!1,this.entityManager.fireEntityChanged(Kr.type),s}removeNode(e){var n;typeof e=="string"?(n=this.getNode(e))==null||n.dispose():e.dispose()}addNode(e,n,r){const{id:i,type:s="block",originParent:o,parent:a,meta:l,hidden:u,index:h}=e;let p=this.getNode(i),g=!1;const v=this.getNodeRegistry(s,e.originParent);if(p&&p.flowNodeType!==e.type&&(p.dispose(),p=void 0),!p){const{dataRegistries:w}=v;p=this.entityManager.createEntity(Kr,{id:i,document:this,flowNodeType:s,originParent:o,meta:l});const S=w?this.nodeDataRegistries.concat(...w):this.nodeDataRegistries;p.addInitializeData(S),p.onDispose(()=>this.onNodeDisposeEmitter.fire({node:p})),this.options.fromNodeJSON&&this.options.fromNodeJSON(p,e),g=!0}if(p.initData({originParent:o,parent:a,meta:l,hidden:u,index:h}),p.isStart&&this.root.addChild(p),this.onNodeUpdateEmitter.fire({node:p,data:e}),n==null||n.push(p),v.onCreate){const w=v.onCreate(p,e);w&&n&&n.push(...w)}else e.blocks&&e.blocks.length>0&&(e.blocks[0].type?this.addBlocksAsChildren(p,e.blocks,n):this.addInlineBlocks(p,e.blocks,n));return g&&!r&&this.onNodeCreateEmitter.fire({node:p,data:e}),p}addBlocksAsChildren(e,n,r){for(const i of n)this.addNode({...i,parent:e},r)}addInlineBlocks(e,n,r=[]){const i=this.addNode({id:`$blockIcon$${e.id}`,type:"blockIcon",originParent:e,parent:e});if(r.push(i),n.length>0){const s=this.addNode({id:`$inlineBlocks$${e.id}`,type:"inlineBlocks",originParent:e,parent:e});r.push(s),n.forEach(o=>{this.addBlock(e,o,r)})}return r}addBlock(e,n,r,i,s){var h;const o=typeof e=="string"?this.getNode(e):e,{onBlockChildCreate:a}=o.getNodeRegistry();if(a)return a(o,n,r);i=i||this.getNode(`$inlineBlocks$${o.id}`);const l=this.addNode({...je.omit(n,"blocks"),type:n.type||"block",originParent:o,parent:i,index:s});(h=n.meta)!=null&&h.defaultCollapsed&&(l.collapsed=!0);const u=this.addNode({id:`$blockOrderIcon$${n.id}`,type:"blockOrderIcon",originParent:o,meta:n.meta,data:n.data,parent:l});return r==null||r.push(l,u),n.blocks&&this.addBlocksAsChildren(l,n.blocks,r),l}getNode(e){if(e)return this.entityManager.getEntityById(e)}registerFlowNodes(...e){e.forEach(n=>{if(!n)throw new Error("[FlowDocument] registerFlowNodes parameters get undefined registry.");const r=this.registers.get(n.type);this.registers.set(n.type,{...r,...n,meta:{...r==null?void 0:r.meta,...n==null?void 0:n.meta}})})}toJSON(){return{nodes:this.root.toJSON().blocks}}getNodeRegister(e,n){return this.getNodeRegistry(e,n)}getNodeRegistry(e,n){var u,h,p,g,v;const r=`${e}_${(n==null?void 0:n.flowNodeType)||""}`;if(this.nodeRegistryCache.has(r))return this.nodeRegistryCache.get(r);const i=(h=(u=this.options).getNodeDefaultRegistry)==null?void 0:h.call(u,e);let s=this.registers.get(e)||{type:e};const o=[];if(s.extend&&this.registers.has(s.extend)&&(s=Bb.merge(this.getNodeRegistry(s.extend),s,s.type)),n){const w=(p=this.getNodeRegistry(n.flowNodeType).extendChildRegistries)==null?void 0:p.find(S=>S.type===e);w&&(w.extend&&this.registers.has(w.extend)&&o.push(this.registers.get(w.extend)),o.push(w))}s=Bb.extend(s,o);const a=IW(e,this);a.spacing=((v=(g=this.options)==null?void 0:g.constants)==null?void 0:v[fN.NODE_SPACING])||a.spacing;const l={...i,...s,meta:{...a,...i==null?void 0:i.meta,...s.meta}};return this.nodeRegistryCache.set(r,l),l}registerNodeDatas(...e){this.nodeDataRegistries.push(...e)}traverse(e,n=this.root,r=0){return this.originTree.traverse(e,n,r)}get size(){return this.getAllNodes().length}hasNode(e){return!!this.entityManager.getEntityById(e)}getAllNodes(){return this.entityManager.getEntities(Kr)}toString(){return this.originTree.toString()}getRenderDatas(e,n=!0){const r=[];return this.renderTree.traverse(i=>{!n&&i.hidden||r.push(i.getData(e))}),r}moveNodes({dropNodeId:e,sortNodeIds:n,inside:r=!1}){const i=this.getNode(e);if(!i)return;const s=n.map(o=>this.getNode(o));this.entityManager.changeEntityLocked=!0;for(const o of s.reverse())r?this.originTree.addChild(i,o,0):this.originTree.insertAfter(i,o);this.entityManager.changeEntityLocked=!1,this.fireRender()}moveChildNodes({toParentId:e,toIndex:n,nodeIds:r}){if(r.length===0)return;const i=this.getNode(e);i&&(this.entityManager.changeEntityLocked=!0,this.originTree.moveChilds(i,r.map(s=>this.getNode(s)),n),this.entityManager.changeEntityLocked=!1,this.fireRender())}registerLayout(e){this.layouts.push(e)}setLayout(e){var r;if(this.currentLayoutKey===e)return;const n=this.layouts.find(i=>i.name===e);n&&(this.currentLayoutKey=e,this.transformer.clear(),(r=n.reload)==null||r.call(n),this.fireRender(),this.onLayoutChangeEmitter.fire(this.layout))}toggleFixedLayout(){this.setLayout(this.layout.name==="horizontal-fixed-layout"?"vertical-fixed-layout":"horizontal-fixed-layout")}dispose(){this.registers.clear(),this.nodeRegistryCache.clear(),this.originTree.dispose(),this.renderTree.dispose(),this.onNodeUpdateEmitter.dispose(),this.onNodeCreateEmitter.dispose(),this.onNodeDisposeEmitter.dispose(),this.onLayoutChangeEmitter.dispose()}};lr([oe(Sn)],On.prototype,"entityManager",2);lr([oe(Hb)],On.prototype,"config",2);lr([oe(RI),pr()],On.prototype,"options",2);lr([wc(kI),pr()],On.prototype,"contributions",2);lr([Ai()],On.prototype,"init",1);On=lr([$e()],On);var d8=class h8{constructor(n){this.groupNode=n}get nodes(){return this.groupNode.collapsedChildren||[]}get collapsed(){return this.groupNode.getData(at).collapsed}collapse(){this.collapsed=!0}expand(){this.collapsed=!1}get bounds(){return this.groupNode.getData(at).bounds}isStartNode(n){if(!n)return!1;const r=this.nodes;return r[0]?n.id===r[0].id:!1}isEndNode(n){if(!n)return!1;const r=this.nodes;return r[r.length-1]?n.id===r[r.length-1].id:!1}set note(n){this.groupNode.getNodeMeta().note=n}get note(){return this.groupNode.getNodeMeta().note||""}set noteHeight(n){this.groupNode.getNodeMeta().noteHeight=n}get noteHeight(){return this.groupNode.getNodeMeta().noteHeight||0}get positionConfig(){return this.groupNode.getNodeMeta().positionConfig}set collapsed(n){var i;const r=this.groupNode.getData(at);r.collapsed=n,r.localDirty=!0,r.parent&&(r.parent.localDirty=!0),(i=r.parent)!=null&&i.firstChild&&(r.parent.firstChild.localDirty=!0)}set hovered(n){const r=this.groupNode.getData(zn);n?r.toggleMouseEnter():r.toggleMouseLeave(),r.hovered!==n&&(r.hovered=n)}get hovered(){return this.groupNode.getData(zn).hovered}static create(n){if(n&&Yp.isGroupNode(n))return new h8(n)}},Yp;(e=>{const n=i=>{const s=[];let o=i.parent;for(;o;)s.push(o),o=o.parent;return s},r=i=>{var s;return((s=i==null?void 0:i.parent)==null?void 0:s.flowNodeType)==="group"};e.validate=i=>{if(!i||!Array.isArray(i)||i.length===0||i.some(v=>(0,e.isGroupNode)(v))||i.some(v=>v&&r(v)))return!1;const a=i[0].parent;return!(!i.every(v=>v.parent===a)||!i.map(v=>v.index).sort((v,w)=>v-w).every((v,w,S)=>w===0?!0:v===S[w-1]+1)||n(i[0]).some(v=>r(v)))},e.getNodeGroupController=i=>{if(!i||!r(i))return;const s=i==null?void 0:i.parent;return d8.create(s)},e.getNodeRecursionGroupController=i=>{if(!i)return;const s=(0,e.getNodeGroupController)(i);if(s)return s;if(i.parent)return(0,e.getNodeRecursionGroupController)(i.parent)},e.isGroupNode=i=>i.flowNodeType==="group"})(Yp||(Yp={}));var ul=class{constructor(){this.onDropEmitter=new qe,this.onDrop=this.onDropEmitter.event}get renderState(){return this.document.renderState}get dragStartNode(){return this.renderState.getDragStartEntity()}get dragNodes(){return this.renderState.getDragEntities()}get dropNodeId(){return this.renderState.getNodeDroppingId()}get isDragBranch(){var e;return(e=this.dragStartNode)==null?void 0:e.isInlineBlock}get nodeDragIdsWithChildren(){return this.renderState.config.nodeDragIdsWithChildren||[]}get dragging(){var n;const e=(n=this.dragStartNode)==null?void 0:n.getData(zn);return!!(e!=null&&e.dragging)}get labelSide(){return this.renderState.config.dragLabelSide}dropBranch(){this.dropNode()}dropNode(){const e=this.document.getNode(this.dropNodeId);if(!e)return;const n=[];let r=this.dragStartNode;for(;r&&this.dragNodes.includes(r);)n.push(r),r=r.next;this.operationService.dragNodes({dropNode:e,nodes:n}),n.length>0&&this.onDropEmitter.fire({dropNode:e,dragNodes:n})}isDroppableNode(e){return!(!this.dragging||this.isDragBranch||this.nodeDragIdsWithChildren.includes(e.id)||e.next&&this.nodeDragIdsWithChildren.includes(e.next.id)||e.isInlineBlocks||e.isInlineBlock||this.dragNodes.some(r=>r.flowNodeType==="group")&&Yp.getNodeRecursionGroupController(e))}isDroppableBranch(e,n="normal_branch"){if(this.isDragBranch){if(!e.isInlineBlock||e.parent!==this.dragStartNode.parent||e===this.dragStartNode)return!1;if(n==="normal_branch"&&e.next!==this.dragStartNode||n==="pre_branch"&&e.pre!==this.dragStartNode)return!0}return!1}};lr([oe(On)],ul.prototype,"document",2);lr([oe(Iw)],ul.prototype,"operationService",2);lr([oe(Sn)],ul.prototype,"entityManager",2);ul=lr([$e()],ul);var Sh=class{constructor(){this.onNodeAddEmitter=new qe,this.onNodeAdd=this.onNodeAddEmitter.event,this.toDispose=new jt,this.onNodeMoveEmitter=new qe,this.onNodeMove=this.onNodeMoveEmitter.event}init(){this.toDispose.pushAll([this.onNodeAddEmitter,this.onNodeMoveEmitter])}addNode(e,n={}){const{parent:r,index:i,hidden:s}=n;let o;r&&(o=this.toNodeEntity(r));let a;o&&(a=o.getNodeRegistry());const l={...e,type:e.type||"block"},u={...l,parent:o,index:i,hidden:s};let h;return o&&(a!=null&&a.addChild)?h=a.addChild(o,l,{index:i,hidden:s}):h=this.document.addNode(u),this.onNodeAddEmitter.fire({node:h,data:u}),h}addFromNode(e,n){return this.document.addFromNode(e,n)}deleteNode(e){this.document.removeNode(e)}deleteNodes(e){(e||[]).forEach(n=>{this.deleteNode(n)})}addBlock(e,n,r={}){const{parent:i,index:s}=r;return this.document.addBlock(e,n,void 0,i,s)}moveNode(e,n={}){const{parent:r,index:i}=n,s=this.toNodeEntity(e),o=s==null?void 0:s.parent;if(!o)return;const a=r?this.toNodeEntity(r):o;if(!a){console.warn("no new parent found",r);return}let l=typeof i>"u"?a.collapsedChildren.length:i;return this.doMoveNode(s,a,l)}dragNodes({dropNode:e,nodes:n}){if(n.length===0)return;const r=n[0],i=r.parent,s=e.parent;if(!i||!s)return;const o=i.children.findIndex(h=>h===r),a=s.children.findIndex(h=>h===e);let l=a+1;i===s&&o<a&&(l=l-n.length);const u={nodeIds:n.map(h=>h.id),fromParentId:i.id,toParentId:s.id,fromIndex:o,toIndex:l};return this.apply({type:"moveChildNodes",value:u})}apply(e){var r,i,s,o,a,l;const n=this.document;switch(e.type){case"addFromNode":return n.addFromNode(e.value.fromId,e.value.data);case"deleteFromNode":return(s=n.getNode((i=(r=e.value)==null?void 0:r.data)==null?void 0:i.id))==null?void 0:s.dispose();case"addBlock":{let u;return e.value.parentId&&(u=n.getNode(e.value.parentId)),n.addBlock(e.value.targetId,e.value.blockData,void 0,u,e.value.index)}case"deleteBlock":{const u=n.getNode((o=e.value)==null?void 0:o.blockData.id);return u==null?void 0:u.dispose()}case"createGroup":{const u=n.addFromNode(e.value.targetId,{id:e.value.groupId,type:"group"});return n.moveNodes({dropNodeId:e.value.groupId,sortNodeIds:e.value.nodeIds,inside:!0}),u}case"ungroup":return n.moveNodes({dropNodeId:e.value.groupId,sortNodeIds:e.value.nodeIds}),(a=n.getNode(e.value.groupId))==null?void 0:a.dispose();case"moveNodes":return n.moveNodes({dropNodeId:e.value.toId,sortNodeIds:e.value.nodeIds});case"moveBlock":return n.moveChildNodes({...e.value,nodeIds:[e.value.nodeId]});case"addNodes":{let u=e.value.fromId;(e.value.nodes||[]).forEach(h=>{u=n.addFromNode(u,h).id});break}case"deleteNodes":{(e.value.nodes||[]).forEach(u=>{const h=n.getNode(u.id);h==null||h.dispose()});break}case"addChildNode":return n.addNode({...e.value.data,parent:e.value.parentId?n.getNode(e.value.parentId):void 0,originParent:e.value.originParentId?n.getNode(e.value.originParentId):void 0,index:e.value.index,hidden:e.value.hidden});case"deleteChildNode":return(l=n.getNode(e.value.data.id))==null?void 0:l.dispose();case"moveChildNodes":return n.moveChildNodes(e.value);default:throw new Error("unknown operation type")}}transact(e){e()}dispose(){this.toDispose.dispose()}toId(e){return typeof e=="string"?e:e.id}toNodeEntity(e){return typeof e=="string"?this.document.getNode(e):e}getNodeIndex(e){const n=this.toNodeEntity(e),r=n==null?void 0:n.parent;return r?r.children.findIndex(i=>i===n):-1}doMoveNode(e,n,r){if(!e.parent)throw new Error("root node cannot move");const i={node:e,fromParent:e.parent,toParent:n,fromIndex:this.getNodeIndex(e),toIndex:r};this.document.moveChildNodes({nodeIds:[this.toId(e)],toParentId:this.toId(n),toIndex:r}),this.onNodeMoveEmitter.fire(i)}};lr([oe(Sn)],Sh.prototype,"entityManager",2);lr([oe(On)],Sh.prototype,"document",2);lr([Ai()],Sh.prototype,"init",1);Sh=lr([$e()],Sh);var Dh=class{createGroup(e){if(!e||!Array.isArray(e)||e.length===0||!Yp.validate(e))return;const r=e.sort((a,l)=>a.index-l.index)[0],i=`group_${Wi(5)}`;this.operationService.apply({type:"createGroup",value:{targetId:r.id,groupId:i,nodeIds:e.map(a=>a.id)}});const s=this.entityManager.getEntityById(i);if(!s)return;const o=this.groupController(s);if(o)return o.expand(),s}deleteGroup(e){const n=e.toJSON();!e.pre||!n||this.operationService.apply({type:"deleteNodes",value:{fromId:e.pre.id,nodes:[n]}})}ungroup(e){const n=this.groupController(e);if(!n)return;const r=n.nodes;e.pre&&(n.collapse(),this.operationService.apply({type:"ungroup",value:{groupId:e.id,targetId:e.pre.id,nodeIds:r.map(i=>i.id)}}))}getAllGroups(){return this.entityManager.getEntities(Kr).filter(r=>r.flowNodeType==="group").map(r=>this.groupController(r)).filter(Boolean)}groupController(e){return d8.create(e)}static validate(e){return Yp.validate(e)}};lr([oe(Sn)],Dh.prototype,"entityManager",2);lr([oe(Iw)],Dh.prototype,"operationService",2);Dh=lr([$e()],Dh);var RW=-36;function kW(e,n){return e.childrenLength===n.childrenLength&&e.index===n.index}var Xp=class{constructor(){this.name="vertical-fixed-layout",this.structDataMap=new WeakMap}get document(){return this.documentProvider()}reload(){this.structDataMap=new WeakMap}update(){this.updateLocalTransform(this.document.root)}updateLocalTransform(e,n=!1){var I,P,M,k;const{children:r,parent:i,isInlineBlock:s}=e,o=e.getData(at),{getDelta:a,getOrigin:l}=e.getNodeRegistry(),u=this.structDataMap.get(e)||{childrenLength:0,index:-1};e.clearMemoGlobal();let h=o.localDirty||n;const p={index:e.index,childrenLength:e.children.length};kW(u,p)||(h=!0,this.structDataMap.set(e,p));let g=!1;if(r.length>0)for(const A of r)this.updateLocalTransform(A,g)&&(g=!0,h=!0);if(!h)return!1;e.clearMemoLocal(),o.transform.update({origin:l?l(o,this):this.getDefaultNodeOrigin()});const v=o.pre,w=(a==null?void 0:a(o,this))||{x:0,y:0},S=s&&((I=o.parent)!=null&&I.inlineSpacingPre)?(P=o.parent)==null?void 0:P.inlineSpacingPre:0,E=((k=i==null?void 0:(M=i.getNodeRegistry()).getChildDelta)==null?void 0:k.call(M,o,this))||{x:0,y:0};w.x+=E.x,w.y+=E.y;const x={x:w.x,y:w.y};return s?x.y+=S:(x.y+=(v==null?void 0:v.localBounds.bottom)||0,x.y+=(v==null?void 0:v.spacing)||0),o.transform.update({size:o.data.size,position:x}),this.onAfterUpdateLocalTransform(o),o.localDirty=!1,!0}onAfterUpdateLocalTransform(e){var r;const{onAfterUpdateLocalTransform:n}=e.entity.getNodeRegistry();n==null||n(e,this),(r=this.contribs)==null||r.forEach(i=>{var s;(s=i==null?void 0:i.onAfterUpdateLocalTransform)==null||s.call(i,e,this)})}getNodeTransform(e){return e.getData(at)}getPadding(e){const{inlineSpacingPre:n,inlineSpacingAfter:r,padding:i}=e.getNodeMeta(),s=this.getNodeTransform(e);if(i)return typeof i=="function"?i(s):i;const o=typeof n=="function"?n(s):n,a=typeof r=="function"?r(s):r;return{left:0,top:o,right:0,bottom:a}}getInitScroll(e){return{scrollX:-e.width/2,scrollY:RW}}getDefaultInputPoint(e){return this.getNodeTransform(e).bounds.topCenter}getDefaultOutputPoint(e){return this.getNodeTransform(e).bounds.bottomCenter}getDefaultNodeOrigin(){return{x:.5,y:0}}};lr([oe(Ow)],Xp.prototype,"documentProvider",2);lr([wc(s8),pr()],Xp.prototype,"contribs",2);Xp=lr([$e()],Xp);var LW=-36;function jW(e,n){return e.childrenLength===n.childrenLength&&e.index===n.index}var Zp=class{constructor(){this.name="horizontal-fixed-layout",this.structDataMap=new WeakMap}get document(){return this.documentProvider()}reload(){this.structDataMap=new WeakMap}update(){this.updateLocalTransform(this.document.root)}updateLocalTransform(e,n=!1){var I,P,M,k;const{children:r,parent:i,isInlineBlock:s}=e,o=e.getData(at),{getDelta:a,getOrigin:l}=e.getNodeRegistry(),u=this.structDataMap.get(e)||{childrenLength:0,index:-1};e.clearMemoGlobal();let h=o.localDirty||n;const p={index:e.index,childrenLength:e.children.length};jW(u,p)||(h=!0,this.structDataMap.set(e,p));let g=!1;if(r.length>0)for(const A of r)this.updateLocalTransform(A,g)&&(g=!0,h=!0);if(!h)return!1;e.clearMemoLocal(),o.transform.update({origin:l?l(o,this):this.getDefaultNodeOrigin()});const v=o.pre,w=(a==null?void 0:a(o,this))||{x:0,y:0},S=s&&((I=o.parent)!=null&&I.inlineSpacingPre)?(P=o.parent)==null?void 0:P.inlineSpacingPre:0,E=((k=i==null?void 0:(M=i.getNodeRegistry()).getChildDelta)==null?void 0:k.call(M,o,this))||{x:0,y:0};w.x+=E.x,w.y+=E.y;const x={x:w.x,y:w.y};return s?x.x+=S:(x.x+=(v==null?void 0:v.localBounds.right)||0,x.x+=(v==null?void 0:v.spacing)||0),o.transform.update({size:o.data.size,position:x}),this.onAfterUpdateLocalTransform(o),o.localDirty=!1,!0}onAfterUpdateLocalTransform(e){var r;const{onAfterUpdateLocalTransform:n}=e.entity.getNodeRegistry();n==null||n(e,this),(r=this.contribs)==null||r.forEach(i=>{var s;(s=i==null?void 0:i.onAfterUpdateLocalTransform)==null||s.call(i,e,this)})}getNodeTransform(e){return e.getData(at)}getPadding(e){const{inlineSpacingPre:n,inlineSpacingAfter:r,padding:i}=e.getNodeMeta(),s=this.getNodeTransform(e);if(i)return typeof i=="function"?i(s):i;const o=typeof n=="function"?n(s):n,a=typeof r=="function"?r(s):r;return{left:o,top:0,right:a,bottom:0}}getInitScroll(e){return{scrollX:LW,scrollY:-e.height/2}}getDefaultInputPoint(e){return this.getNodeTransform(e).bounds.leftCenter}getDefaultOutputPoint(e){return this.getNodeTransform(e).bounds.rightCenter}getDefaultNodeOrigin(){return{x:0,y:.5}}};lr([oe(Ow)],Zp.prototype,"documentProvider",2);lr([wc(s8),pr()],Zp.prototype,"contribs",2);Zp=lr([$e()],Zp);var FW=new Mo(e=>{e(On).toSelf().inSingletonScope(),e(Ow).toDynamicValue(n=>()=>n.container.get(On)).inSingletonScope(),e(Hb).toSelf().inSingletonScope(),e(Xp).toSelf().inSingletonScope(),e(Zp).toSelf().inSingletonScope(),e(ul).toSelf().inSingletonScope(),e(Iw).to(Sh).inSingletonScope(),e(Dh).toSelf().inSingletonScope(),e(kI).toDynamicValue(n=>({registerDocument:r=>{r.registerLayout(n.container.get(Xp)),r.registerLayout(n.container.get(Zp))}}))}),iP=(e,n,r)=>{var o;const i=e.getService(RI);return((o=i==null?void 0:i.constants)==null?void 0:o[n])||r||Wm[n]},$W={languageId:"zh-CN",languageName:"Chinese",localizedLanguageName:"中文(中国)",contents:{Yes:"是",No:"否"}},zW={languageId:"en-US",languageName:"English",localizedLanguageName:"English",contents:{Yes:"Yes",No:"No"}},VW=class{constructor(e){this._languages=new Map,this._localLanguage="en-US",this._onLanguageChangeEmitter=new qe,this.onLanguageChange=this._onLanguageChangeEmitter.event,e.forEach(n=>this.addLanguage(n))}t(e,n){var i;const r=((i=this._languages.get(this._localLanguage))==null?void 0:i.contents)||{};return r[e]?r[e]:n!=null&&n.disableReturnKey?"":e}getLocalLanguage(){return this._localLanguage}setLocalLanguage(e){e!==this._localLanguage&&(this._localLanguage=e,this._onLanguageChangeEmitter.fire(e))}getLangauges(){return this._languages}addLanguage(e){let n=this._languages.get(e.languageId);n?this._languages.set(e.languageId,{...n,...e,contents:{...n.contents,...e.contents}}):this._languages.set(e.languageId,e)}},vb=new VW([zW,$W]),BW=Object.defineProperty,HW=Object.getOwnPropertyDescriptor,Je=(e,n,r,i)=>{for(var s=i>1?void 0:i?HW(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&BW(n,r,s),s},f8="#BBBFC4",UW="#82A7FC";function Bv(){var n,r;const e=Wt(RI);return{baseColor:((n=e.constants)==null?void 0:n[fN.BASE_COLOR])||f8,baseActivatedColor:((r=e.constants)==null?void 0:r[fN.BASE_ACTIVATED_COLOR])||UW}}var p8={stroke:f8,fill:"transparent",strokeLinecap:"round",strokeLinejoin:"round"},KW=16,Ub=32;function WW(e,n=16,r=20){const{from:i,to:s,type:o}=e||{},a=Math.abs(s.y-i.y),l=Math.abs(s.x-i.x),u=l/n,h=a/r;let p=[];if(u<1)return[];switch(o){case Bi.DIVERGE_LINE:case Bi.DRAGGING_LINE:if(u<=1)return[{x:s.x,y:i.y,radiusX:l}];if(p=[{x:i.x+r,y:i.y},{x:i.x+r,y:s.y}],u<2){const g=l-r;p=[{x:i.x+g,y:i.y,radiusX:g},{x:i.x+g,y:s.y}]}return h<2&&(p[0].moveY=a/2,p[1].moveY=a/2),p;case Bi.MERGE_LINE:return u<2?[{x:s.x,y:i.y}]:(p=[{x:s.x-r,y:i.y},{x:s.x-r,y:s.y}],h<2&&(p[0].moveY=a/2,p[1].moveY=a/2),p)}return[]}function qW(e,n=16,r=20){const{from:i,to:s,type:o}=e||{},a=Math.abs(s.y-i.y),l=Math.abs(s.x-i.x),u=a/r,h=l/n;let p=[];if(u<1)return[];switch(o){case Bi.DIVERGE_LINE:case Bi.DRAGGING_LINE:if(u<=1)return[{x:s.x,y:i.y,radiusY:a}];if(p=[{x:i.x,y:i.y+r},{x:s.x,y:i.y+r}],u<2){const g=a-r;p=[{x:i.x,y:i.y+g,radiusY:g},{x:s.x,y:i.y+g}]}return h<2&&(p[0].moveX=l/2,p[1].moveX=l/2),p;case Bi.MERGE_LINE:return u<2?[{x:i.x,y:s.y}]:(p=[{x:i.x,y:s.y-r},{x:s.x,y:s.y-r}],h<2&&(p[0].moveX=l/2,p[1].moveX=l/2),p)}return[]}function g8(e){var r,i,s;const{isVertical:n}=e.entity;if(n){const o=(r=e.entity.next)!=null&&r.firstChild&&!e.entity.next.isInlineBlocks?e.entity.next.firstChild.getData(at).size.width:(i=e.entity.next)==null?void 0:i.getData(at).size.width;return Math.max(((s=e.entity.getData(at))==null?void 0:s.size.width)??Wm[qa.HOVER_AREA_WIDTH],o||0)}return e.transform.next?e.transform.next.inputPoint.x-e.transform.outputPoint.x:Ub}function y8(e){var s,o,a;const{isVertical:n}=e.entity;if(n)return e.transform.next?e.transform.next.inputPoint.y-e.transform.outputPoint.y:Ub;const r=(s=e.entity.next)!=null&&s.firstChild&&!e.entity.next.isInlineBlocks?e.entity.next.firstChild.getData(at).size.height:(o=e.entity.next)==null?void 0:o.getData(at).size.height;return Math.max(((a=e.entity.getData(at))==null?void 0:a.size.height)||280,r||0)}var sP=64,hu=4,oP=20,rb=20,GW=60,m8=class extends sa{constructor(e){super(e),this.containerX=0,this.containerY=0,this.playgroundConfigEntity=this.entityManager.getEntity(qn,!0)}get hasScroll(){return!!(this._scrollXInterval||this._scrollYInterval)}isCollision(e,n,r){const i=this.playgroundConfigEntity.finalScale||0;return r?this.isBranchCollision(e,n,i):this.isNodeCollision(e,n,i)}isNodeCollision(e,n,r){const{labels:i}=e,{isVertical:s}=e.entity;return{hasCollision:i.some(a=>{if(!a||![Wa.ADDER_LABEL,Wa.COLLAPSE_ADDER_LABEL].includes(a.type))return!1;const l=s?e.transform.bounds.width:Ub,u=s?Ub:e.transform.bounds.height,h=new Qe((a.offset.x-l/2)*r,(a.offset.y-u/2)*r,l*r,u*r);return Qe.intersects(h,n)}),labelOffsetType:void 0}}isBranchCollision(e,n,r){const{labels:i}=e,{isVertical:s}=e.entity;let o=o8.NORMAL_BRANCH;return{hasCollision:i.some(l=>{if(!l||l.type!==Wa.BRANCH_DRAGGING_LABEL)return!1;const u=s?sP:l.width||0,h=s?l.width||0:sP,p=new Qe((l.offset.x-h/2)*r,(l.offset.y-u/2)*r,h*r,u*r),g=Qe.intersects(p,n);return g&&(o=l.props.side),g}),labelOffsetType:o}}_startScrollX(e,n){if(this._scrollXInterval)return;const r=window.setInterval(()=>{const i=this._scrollXInterval;if(!i)return;const s=i.origin=n?i.origin+hu:i.origin-hu;this.playgroundConfigEntity.updateConfig({scrollX:s});const o=this.playgroundConfigEntity.config;(o==null?void 0:o.scrollX)===s&&(n?this.containerX+=hu:this.containerX-=hu,this.setDomStyle())},oP);this._scrollXInterval={interval:r,origin:e}}_stopScrollX(){this._scrollXInterval&&(clearInterval(this._scrollXInterval.interval),this._scrollXInterval=void 0)}_startScrollY(e,n){if(this._scrollYInterval)return;const r=window.setInterval(()=>{const i=this._scrollYInterval;if(!i)return;const s=i.origin=n?i.origin+hu:i.origin-hu;this.playgroundConfigEntity.updateConfig({scrollY:s});const o=this.playgroundConfigEntity.config;(o==null?void 0:o.scrollY)===s&&(n?this.containerY+=hu:this.containerY-=hu,this.setDomStyle())},oP);this._scrollYInterval={interval:r,origin:e}}_stopScrollY(){this._scrollYInterval&&(clearInterval(this._scrollYInterval.interval),this._scrollYInterval=void 0)}stopAllScroll(){this._stopScrollX(),this._stopScrollY()}setDomStyle(){this.containerDom.style.left=`${this.containerX}px`,this.containerDom.style.top=`${this.containerY}px`}scrollDirection(e,n,r,i){const s=this.playgroundConfigEntity.config,o=s.scrollX,a=s.scrollY;if(this.containerDom=n,this.containerX=r,this.containerY=i,s.height+s.clientY-e.clientY<rb)return this._startScrollY(a,!0),1;if(e.clientY-s.clientY<rb)return this._startScrollY(a,!1),0;if(this._stopScrollY(),s.width+s.clientX-e.clientX<rb)return this._startScrollX(o,!0),3;if(e.clientX-s.clientX<rb+GW)return this._startScrollX(o,!1),2;this._stopScrollX()}dispose(){this.toDispose.dispose()}};m8.type="FlowDragEntity";function YW(e){const n=[e];for(e=e.parent;e;)n.push(e),e=e.parent;return n.reverse()}function XW(e){for(;e.originParent;)e=e.originParent;return e}function ZW(e){if(e.length===0)return[];const n=e.map(o=>YW(o)),r=Math.min(...n.map(o=>o.length));let i=0,s=[];for(;i<r&&(s=je.uniq(n.map(o=>o[i])),!(s.length>1));)i+=1;return je.uniq(s.map(o=>XW(o)))}var QW=10,Hv=class extends sa{constructor(){super(...arguments),this.boundsPadding=QW}getDefaultConfig(){return{selectedNodes:[]}}get selectedNodes(){return this.config.selectedNodes}set selectedNodes(e){e=ZW(e),(e.length!==this.config.selectedNodes.length||e.some(n=>!this.config.selectedNodes.includes(n)))&&(this.config.selectedNodes.forEach(n=>{e.includes(n)||(n.getData(zn).activated=!1)}),e.forEach(n=>{n.getData(zn).activated=!0}),ju.isArrayShallowChanged(this.config.selectedNodes,e)&&this.updateConfig({selectedNodes:e}))}clearSelectedNodes(){this.config.selectedNodes.length!==0&&(this.config.selectedNodes.forEach(e=>{e.getData(zn).activated=!1}),this.updateConfig({selectedNodes:[]}))}selectFromBounds(e,n){const r=[];n.forEach(i=>{Qe.intersects(e,i.bounds)&&(i.entity.originParent?r.push(i.entity.originParent):r.push(i.entity))}),this.selectedNodes=r}getSelectedBounds(){const e=this.selectedNodes;return e.length===0?Qe.EMPTY:Qe.enlarge(e.map(n=>n.getData(at).bounds)).pad(this.boundsPadding)}};Hv.type="FlowSelectConfigEntity";var Uv=class extends sa{get dragInfo(){return this.config}setDragInfo(e){this.updateConfig(e)}get disabled(){return this.config&&!!this.config.disabled}set disabled(e){this.updateConfig({disabled:e})}get isStart(){return this.dragInfo.isStart}get isMoving(){return this.dragInfo.isMoving}get position(){const{dragInfo:e}=this;return{x:e.startPos.x<e.endPos.x?e.startPos.x:e.endPos.x,y:e.startPos.y<e.endPos.y?e.startPos.y:e.endPos.y}}get size(){const{dragInfo:e}=this;return{width:Math.abs(e.startPos.x-e.endPos.x),height:Math.abs(e.startPos.y-e.endPos.y)}}get collapsed(){const{size:e}=this;return e.width===0&&e.height===0}collapse(){this.setDragInfo({...this.dragInfo,isMoving:!1,isStart:!1})}toRectangle(e){const{position:n,size:r}=this;return new Qe(n.x/e,n.y/e,r.width/e,r.height/e)}};Uv.type="SelectorBoxConfigEntity";var JW=e=>{if(!e||je.isNil(e==null?void 0:e.offsetParent))return!0;const n=window.getComputedStyle(e);return(n==null?void 0:n.display)==="none"},eq=e=>!(!e||e.bottom===0&&e.height===0&&e.left===0&&e.right===0&&e.top===0&&e.width===0&&e.x===0&&e.y===0),Kb=class{observe(e,n){const r=new ResizeObserver(i=>{window.requestAnimationFrame(()=>{if(!Array.isArray(i)||!i.length)return;const s=i[0],{contentRect:o,target:a}=s,l=eq(o),u=!a.parentNode,h=JW(a.parentNode);l&&!u&&!h&&(n.size={width:Math.round(o.width*10)/10,height:Math.round(o.height*10)/10})})});return r.observe(e),on.create(()=>{r.unobserve(e)})}};Kb=Je([$e()],Kb);var Nh=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-flow-nodes-layer"),this.renderCache=nv.create(e=>{const{renderState:n}=e,{node:r}=n,{entity:i}=e;r.id=i.id;let s;const o=()=>{s||(this.renderElement.appendChild(r),s=this.resizeObserver.observe(r,e))},a=()=>{s&&(r.parentElement&&this.renderElement.removeChild(r),s.dispose(),s=void 0)};return o(),{dispose:a,updateBounds:()=>{const{bounds:l}=e,u=parseFloat(r.style.left),h=parseFloat(r.style.top);(!this.isCoordEqual(u,l.x)||!this.isCoordEqual(h,l.y))&&(r.style.left=`${l.x}px`,r.style.top=`${l.y}px`)}}})}get transformVisibles(){return this.document.getRenderDatas(at,!1)}onZoom(e){this.node.style.transform=`scale(${e})`}dispose(){this.renderCache.dispose(),super.dispose()}isCoordEqual(e,n){return Math.abs(e-n)<.05}onReady(){this.node.style.zIndex="10"}get visibeBounds(){return this.transformVisibles.map(e=>e.bounds)}updateNodesBounds(){this.renderCache.getMoreByItems(this.transformVisibles).forEach(e=>e.updateBounds())}autorun(){this.documentTransformer.loading||(this.documentTransformer.refresh(),this.updateNodesBounds())}get renderElement(){if(typeof this.options.renderElement=="function"){const e=this.options.renderElement();if(e)return e}else if(typeof this.options.renderElement<"u")return this.options.renderElement;return this.node}};Je([oe(On)],Nh.prototype,"document",2);Je([oe(Kb)],Nh.prototype,"resizeObserver",2);Je([Tn(Fu)],Nh.prototype,"documentTransformer",2);Je([ml(Kr,at)],Nh.prototype,"_transforms",2);Nh=Je([$e()],Nh);var tq=Symbol("FlowRendererContribution"),v8=(e=>(e.NODE_RENDER="node-render",e.ADDER="adder",e.COLLAPSE="collapse",e.BRANCH_ADDER="branch-adder",e.TRY_CATCH_COLLAPSE="try-catch-collapse",e.DRAG_NODE="drag-node",e.DRAGGABLE_ADDER="draggable-adder",e.DRAG_HIGHLIGHT_ADDER="drag-highlight-adder",e.DRAG_BRANCH_HIGHLIGHT_ADDER="drag-branch-highlight-adder",e.SELECTOR_BOX_POPOVER="selector-box-popover",e.CONTEXT_MENU_POPOVER="context-menu-popover",e.SUB_CANVAS="sub-canvas",e.MARKER_ARROW="marker-arrow",e.MARKER_ACTIVATE_ARROW="marker-active-arrow",e))(v8||{}),bs=class{constructor(){this.componentsMap=new Map,this.textMap=new Map,this.contribs=[]}init(){this.contribs.forEach(e=>{var n;return(n=e.registerRenderer)==null?void 0:n.call(e,this)})}registerRendererComponents(e,n){this.componentsMap.set(e,n)}registerReactComponent(e,n){this.componentsMap.set(e,{type:0,renderer:n})}registerText(e){Object.entries(e).forEach(([n,r])=>{this.textMap.set(n,r)})}getText(e){return vb.t(e,{disableReturnKey:!0})||this.textMap.get(e)}getRendererComponent(e){const n=this.componentsMap.get(e);if(!n)throw new Error(`Unknown render key ${e}`);return n}tryToGetRendererComponent(e){return this.componentsMap.get(e)}registerLayers(...e){e.forEach(n=>this.pipeline.registerLayer(n))}registerLayer(e,n){this.pipeline.registerLayer(e,n)}};Je([wc(tq),pr()],bs.prototype,"contribs",2);Je([oe(Io)],bs.prototype,"pipeline",2);bs=Je([$e()],bs);var Ih=class extends er{constructor(){super(...arguments),this.renderMemoCache=new WeakMap,this.node=ft.createDivWithClass("gedit-flow-nodes-layer"),this.reactPortals=nv.create(e=>{const{node:n,entity:r}=e,{config:i}=this,s=this.getPortalRenderer(e);function o(){return D.useEffect(()=>{if(n.clientWidth&&n.clientHeight){const a=r.getData(at);a&&(a.size={width:n.clientWidth,height:n.clientHeight})}},[]),Ks.createPortal(D.createElement(Sw.Provider,{value:r},D.createElement(s,{node:r,version:e==null?void 0:e.version,activated:e==null?void 0:e.activated,readonly:i.readonly,disabled:i.disabled})),n)}return{id:n.id||r.id,dispose:()=>{},Portal:o}})}get renderStatesVisible(){return this.document.getRenderDatas(zn,!1)}getPortalRenderer(e){const n=e.entity.getNodeMeta(),i=this.rendererRegistry.getRendererComponent(n.renderKey||"node-render").renderer;let s=this.renderMemoCache.get(i);return s||(s=D.memo(i),this.renderMemoCache.set(i,s)),s}onZoom(e){this.node.style.transform=`scale(${e})`}dispose(){this.reactPortals.dispose(),super.dispose()}onReady(){this.node.style.zIndex="10"}onReadonlyOrDisabledChange(){this.render()}getPortals(){return this.reactPortals.getMoreByItems(this.renderStatesVisible)}render(){return this.documentTransformer.loading?D.createElement(D.Fragment,null):(this.documentTransformer.refresh(),D.createElement(D.Fragment,null,this.getPortals().map(e=>D.createElement(e.Portal,{key:e.id}))))}};Je([oe(On)],Ih.prototype,"document",2);Je([oe(bs)],Ih.prototype,"rendererRegistry",2);Je([Tn(Fu)],Ih.prototype,"documentTransformer",2);Je([ml(Kr,zn)],Ih.prototype,"_renderStates",2);Ih=Je([$e()],Ih);var b8="line-marker-arrow",nq=`url(#${b8})`;function rq(){const{baseColor:e}=Bv();return D.createElement("marker",{id:b8,markerWidth:"11",markerHeight:"14",refX:"10",refY:"7",orient:"auto"},D.createElement("path",{d:"M9.6 5.2C10.8 6.1 10.8 7.9 9.6 8.8L3.6 13.3C2.11672 14.4125 0 13.3541 0 11.5L0 2.5C0 0.645898 2.11672 -0.412461 3.6 0.7L9.6 5.2Z",fill:e}))}var iq=rq,w8="line-marker-arrow-activated",sq=`url(#${w8})`;function oq(){const{baseActivatedColor:e}=Bv();return D.createElement("marker",{id:w8,markerWidth:"11",markerHeight:"14",refX:"10",refY:"7",orient:"auto"},D.createElement("path",{d:"M9.6 5.2C10.8 6.1 10.8 7.9 9.6 8.8L3.6 13.3C2.11672 14.4125 0 13.3541 0 11.5L0 2.5C0 0.645898 2.11672 -0.412461 3.6 0.7L9.6 5.2Z",fill:e}))}var aq=oq;function lq(e){const{from:n,to:r,activated:i,style:s}=e,{baseColor:o,baseActivatedColor:a}=Bv();return D.createElement("path",{d:`M ${n.x} ${n.y} L ${r.x} ${r.y}`,...p8,stroke:i?a:o,style:s})}var cq=lq;function uq(e){const{vertices:n,radius:r=KW,hide:i,xRadius:s,yRadius:o,...a}=e,{from:l,to:u,arrow:h,activated:p,style:g}=a||{},{baseActivatedColor:v,baseColor:w}=Bv(),S=n||(e.isHorizontal?WW(a,s,o):qW(a,s,o)),E=R.useMemo(()=>S.map((I,P)=>{const M=S[P-1]||l,k=S[P+1]||u,A={x:Math.abs(M.x-I.x),y:Math.abs(M.y-I.y)},j={x:Math.abs(k.x-I.x),y:Math.abs(k.y-I.y)},V=A.x===0&&j.y===0,$=A.y===0&&j.x===0;V||$||console.error(`vertex ${I.x},${I.y} is not right angle`);const B=new qs().copyFrom(I),H=new qs().copyFrom(I),Y=je.isNil(I.radiusX)?r:I.radiusX,te=je.isNil(I.radiusY)?r:I.radiusY;let ue=Y,ye=te;if(V){ye=Math.min(A.y,te);const G=je.isNil(I.moveY)?ye:I.moveY;B.y+=l.y<I.y?-G:+G,ue=Math.min(j.x,Y);const ae=je.isNil(I.moveX)?ue:I.moveX;H.x+=u.x<I.x?-ae:+ae}if($){ue=Math.min(A.x,Y);const G=je.isNil(I.moveX)?ue:I.moveX;B.x+=l.x<I.x?-G:+G,ye=Math.min(j.y,te);const ae=je.isNil(I.moveY)?ye:I.moveY;H.y+=u.y<I.y?-ae:+ae}const q=(I.x-B.x)*(H.y-B.y)-(I.y-B.y)*(H.x-B.x)>0;return`L ${B.x} ${B.y} A ${ue} ${ye} 0 0 ${q?1:0} ${H.x} ${H.y}`}).join(" "),[S]);if(i)return null;const x=`M ${l.x} ${l.y} ${E} L ${u.x} ${u.y}`;return D.createElement("path",{d:x,...p8,stroke:p?v:w,...h?{markerEnd:p?sq:nq}:{},style:g})}var dq=uq;function hq(e){const{renderKey:n,rendererRegistry:r,...i}=e;if(!n)return D.createElement(D.Fragment,null);const s=r.getRendererComponent(n);if(!s)return D.createElement(D.Fragment,null);const o=s.renderer;return D.createElement(o,{...i})}var fq=hq;function pq(e){const{data:n,rendererRegistry:r,linesSave:i,dragService:s}=e,{lines:o,entity:a}=n||{},l=iP(a,qa.ROUNDED_LINE_X_RADIUS),u=iP(a,qa.ROUNDED_LINE_Y_RADIUS),h=(p,g)=>{var I;const{renderData:v}=n,{isVertical:w}=n.entity,{lineActivated:S}=v||{},E=p.type===Bi.DRAGGING_LINE&&!s.isDroppableBranch(n.entity,p.side),x=p.type===Bi.DRAGGING_LINE&&((I=n.entity)==null?void 0:I.id)===s.dropNodeId&&p.side===s.labelSide;switch(p.type){case Bi.STRAIGHT_LINE:return D.createElement(cq,{key:`${n.entity.id}${g}`,activated:S,...p});case Bi.DIVERGE_LINE:case Bi.DRAGGING_LINE:case Bi.MERGE_LINE:case Bi.ROUNDED_LINE:return D.createElement(dq,{key:`${n.entity.id}${g}`,isHorizontal:!w,activated:S||x,...p,xRadius:l,yRadius:u,hide:E});case Bi.CUSTOM_LINE:return D.createElement(fq,{key:`${n.entity.id}${g}`,...p,rendererRegistry:r})}};o.forEach((p,g)=>{const v=Qe.createRectangleWithTwoPoints(p.from,p.to).pad(10);if(e.isViewportVisible(v)){const w=h(p,g);w&&i.push(w)}})}var $u=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-flow-lines-layer"),this.onViewportChange=je.throttle(()=>{this.render()},100)}get transitions(){return this.document.getRenderDatas(mg)}onZoom(){var n;const e=this.node.querySelector("svg.flow-lines-container");(n=e==null?void 0:e.setAttribute)==null||n.call(e,"viewBox",this.viewBox)}onReady(){this.node.style.zIndex="1"}get viewBox(){const e=1e3/this.config.finalScale;return`0 0 ${e} ${e}`}render(){const e=[],n=this.config.isViewportVisible.bind(this.config);if(this.documentTransformer.loading)return D.createElement(D.Fragment,null);this.documentTransformer.refresh(),this.transitions.forEach(h=>{pq({data:h,rendererRegistry:this.rendererRegistry,isViewportVisible:n,linesSave:e,dragService:this.dragService})});const{activateLines:r=[],normalLines:i=[]}=je.groupBy(e,h=>h.props.activated?"activateLines":"normalLines"),s=[...i,...r],o=this.rendererRegistry.tryToGetRendererComponent("marker-arrow"),a=this.rendererRegistry.tryToGetRendererComponent("marker-active-arrow"),l=o?D.createElement(o.renderer):null,u=a?D.createElement(a.renderer):null;return D.createElement("svg",{className:"flow-lines-container",width:"1000",height:"1000",overflow:"visible",viewBox:this.viewBox,xmlns:"http://www.w3.org/2000/svg"},D.createElement("defs",null,o?l:D.createElement(iq,null),u||D.createElement(aq,null)),s)}};Je([oe(On)],$u.prototype,"document",2);Je([oe(ul)],$u.prototype,"dragService",2);Je([oe(bs)],$u.prototype,"rendererRegistry",2);Je([Tn(Fu)],$u.prototype,"documentTransformer",2);Je([Tn(Vv)],$u.prototype,"flowRenderState",2);Je([ml(Kr,mg)],$u.prototype,"_transitions",2);$u=Je([$e()],$u);function pN(e){const{data:n,rendererRegistry:r,forceVisible:i,hoverHeight:s=y8(n),hoverWidth:o=g8(n),wrapperStyle:a,...l}=e,{activateNode:u}=l,[h,p]=R.useState(!1),g=u==null?void 0:u.getData(zn),v=R.useCallback(()=>{p(!0),g==null||g.toggleMouseEnter()},[]),w=R.useCallback(()=>{p(!1),g==null||g.toggleMouseLeave()},[]),S=r.getRendererComponent("collapse"),E=n.entity,x=D.createElement(S.renderer,{node:E,collapseNode:E,...l,hoverActivated:h}),I=n.collapsed||(g==null?void 0:g.hovered)||h||i;return D.createElement("div",{className:"flow-canvas-collapse",onMouseEnter:v,onMouseLeave:w,style:{width:o,height:s,display:"flex",justifyContent:"center",alignItems:"center",...a}},I?x:null)}var gq=(e,{dragService:n})=>n&&n.dragging&&n.isDroppableNode(e)?n.dropNodeId===e.id?"drag-highlight-adder":"draggable-adder":"adder";function gN(e){const{data:n,rendererRegistry:r,hoverHeight:i=y8(n),hoverWidth:s=g8(n),...o}=e,[a,l]=R.useState(!1),u=R.useCallback(()=>l(!0),[]),h=R.useCallback(()=>l(!1),[]),p=n.entity,g=Wt(ul),v=gq(p,{dragService:g}),w=r.getRendererComponent(v),S=p,E=n.entity.document.renderTree.getOriginInfo(p).next,x=p.next,I=D.createElement(w.renderer,{node:p,from:S,to:E,renderTo:x,hoverActivated:a,setHoverActivated:l,hoverWidth:s,hoverHeight:i,...o});return D.createElement("div",{className:"flow-canvas-adder","data-testid":"sdk.flowcanvas.line.adder","data-from":S.id,"data-to":(E==null?void 0:E.id)??"",onMouseEnter:u,onMouseLeave:h,style:{width:s,height:i,display:"flex",justifyContent:"center",alignItems:"center"}},I)}function yq(e){const{data:n,rendererRegistry:r,...i}=e,{activateNode:s}=i,[o,a]=R.useState(!1),l=s==null?void 0:s.getData(zn),u=R.useCallback(()=>{a(!0)},[]),h=R.useCallback(()=>{a(!1)},[]),p=s==null?void 0:s.isVertical,g=(l==null?void 0:l.hovered)||o;return p?D.createElement("div",{className:"flow-canvas-collapse-adder",onMouseEnter:u,onMouseLeave:h},(g||n.collapsed)&&D.createElement(pN,{forceVisible:!0,...e,wrapperStyle:{alignItems:"flex-end"},hoverHeight:20}),!n.collapsed&&D.createElement(gN,{...e,hoverHeight:g?20:40,hoverActivated:g})):D.createElement("div",{className:"flow-canvas-collapse-adder",onMouseEnter:u,onMouseLeave:h,style:{display:n.collapsed?"block":"flex"}},(g||n.collapsed)&&D.createElement(pN,{forceVisible:!0,...e,wrapperStyle:{justifyContent:"flex-end"},hoverWidth:20}),!n.collapsed&&D.createElement(gN,{...e,hoverWidth:g?20:40,hoverActivated:g}))}var mq=(e,{dragService:n,side:r})=>n.isDragBranch&&r&&n.labelSide===r&&n.isDroppableBranch(e,r)?n.dropNodeId===e.id?"drag-branch-highlight-adder":"draggable-adder":"";function vq(e){const{data:n,rendererRegistry:r,side:i,...s}=e,o=n.entity,a=Wt(ul),l=mq(o,{side:i,dragService:a});if(!l)return null;const u=r.getRendererComponent(l),h=o,p=n.entity.document.renderTree.getOriginInfo(o).next,g=o.next,v=D.createElement(u.renderer,{node:o,from:h,to:p,renderTo:g,...s});return D.createElement("div",{className:"flow-canvas-branch-draggable-adder"},v)}var bq={fontSize:12,color:"#8F959E",textAlign:"center",whiteSpace:"nowrap",backgroundColor:"var(--g-editor-background)",lineHeight:"20px"},aP=150,lP=60;function wq(e){return new Qe(e.x-aP/2,e.y-lP/2,aP,lP)}function _q(e){const{data:n,rendererRegistry:r,labelsSave:i,getLabelColor:s}=e,{labels:o,renderData:a}=n||{},{activated:l}=a||{},u=(h,p)=>{const{offset:g,renderKey:v,props:w,rotate:S,type:E}=h||{},x=g.x,I=g.y;let P=null;switch(E){case Wa.BRANCH_DRAGGING_LABEL:P=D.createElement(vq,{rendererRegistry:r,data:n,...w});break;case Wa.ADDER_LABEL:P=D.createElement(gN,{rendererRegistry:r,data:n,...w});break;case Wa.COLLAPSE_LABEL:P=D.createElement(pN,{rendererRegistry:r,data:n,...w});break;case Wa.COLLAPSE_ADDER_LABEL:P=D.createElement(yq,{rendererRegistry:r,data:n,...w});break;case Wa.TEXT_LABEL:if(!v)return null;const M=r.getText(v)||v;P=D.createElement("div",{style:{...bq,...w==null?void 0:w.style,color:s(l),transform:S?`rotate(${S})`:void 0}},M);break;case Wa.CUSTOM_LABEL:if(!v)return null;try{const k=r.getRendererComponent(v);P=D.createElement(k.renderer,{node:n.entity,...w})}catch(k){console.error(k),P=v}break}return D.createElement("div",{key:`${n.entity.id}${p}`,style:{position:"absolute",left:x,top:I,transform:"translate(-50%, -50%)"}},P)};o.forEach((h,p)=>{e.isViewportVisible(wq(h.offset))&&i.push(u(h,p))})}var Oh=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-flow-labels-layer"),this.onViewportChange=je.throttle(()=>{this.render()},100)}get transitions(){return this.document.getRenderDatas(mg)}onZoom(e){this.node.style.transform=`scale(${e})`}onReady(){this.node.style.zIndex="9"}onReadonlyOrDisabledChange(){this.render()}render(){var s,o,a;const e=[];if((s=this.documentTransformer)!=null&&s.loading)return D.createElement(D.Fragment,null);(a=(o=this.documentTransformer)==null?void 0:o.refresh)==null||a.call(o);const{baseActivatedColor:n,baseColor:r}=Bv(),i=this.config.isViewportVisible.bind(this.config);return this.transitions.forEach(l=>{_q({data:l,rendererRegistry:this.rendererRegistry,isViewportVisible:i,labelsSave:e,getLabelColor:u=>u?n:r})}),D.createElement(D.Fragment,null,e)}};Je([oe(On)],Oh.prototype,"document",2);Je([oe(bs)],Oh.prototype,"rendererRegistry",2);Je([Tn(Fu)],Oh.prototype,"documentTransformer",2);Je([Tn(Vv)],Oh.prototype,"flowRenderState",2);Je([ml(Kr,mg)],Oh.prototype,"_transitions",2);Oh=Je([$e()],Oh);var cP=-120;function Wb(e,n){const r=n.finalScale;return new Qe(e.scrollX/r,e.scrollY/r,n.config.width/r,n.config.height/r).pad(cP/r,cP/r)}function Cq(e,n,r,i){e={...e};const s=r.config,o={scrollX:s.scrollX,scrollY:s.scrollY};if(n.length===0||s.width===0||s.height===0)return e;const a=Wb(e,r);if(!n.find(u=>Qe.isViewportVisible(u,a))){const u=Wb(o,r);return n.find(p=>Qe.isViewportVisible(p,u))?o:i()}return e}var Eq=Symbol("ScrollBarEvents"),uP=0;function dP(e){const n=Math.min(e/10*255,255);uP+=1;const r=uP%3,i=()=>Math.floor(Math.random()*n);return`rgb(${r===0?i():0}, ${r===1?i():0}, ${r===2?i():0})`}var sv=class extends er{constructor(){var e;super(...arguments),this.node=document.createElement("div"),this.viewport=ft.createDivWithClass("gedit-flow-debug-bounds"),this.boundsNodes=ft.createDivWithClass("gedit-flow-debug-bounds"),this.pointsNodes=ft.createDivWithClass("gedit-flow-debug-points"),this.versionNodes=ft.createDivWithClass("gedit-flow-debug-versions gedit-hidden"),this.filterKey=((e=window.location.search.match(/debug=([^&]+)/))==null?void 0:e[1])||"",this.originLine=document.createElement("div"),this.domCache=new WeakMap}get transforms(){return this.document.getRenderDatas(at)}onReady(){this.node.style.zIndex="20",ft.setStyle(this.originLine,{position:"absolute",width:1,height:"100%",left:this.pipelineNode.style.left,top:0,borderLeft:"1px dashed rgba(255, 0, 0, 0.5)"}),this.pipelineNode.parentElement.appendChild(this.originLine),this.node.appendChild(this.viewport),this.node.appendChild(this.versionNodes),this.node.appendChild(this.boundsNodes),this.node.appendChild(this.pointsNodes),this.renderScrollViewportBounds()}onScroll(){this.originLine.style.left=this.pipelineNode.style.left,this.renderScrollViewportBounds()}onResize(){this.renderScrollViewportBounds()}onZoom(e){this.node.style.transform=`scale(${e})`,this.renderScrollViewportBounds()}createBounds(e,n,r){if(this.filterKey&&e.key.indexOf(this.filterKey)===-1)return;let i=this.domCache.get(e);const{bounds:s,inputPoint:o,outputPoint:a}=e;if(!i){const l=ft.createDivWithClass(""),u=ft.createDivWithClass(""),h=ft.createDivWithClass(""),p=ft.createDivWithClass("");l.title=e.key,u.title=e.key+"(input)",h.title=e.key+"(output)",p.title=e.key,this.boundsNodes.appendChild(l),this.pointsNodes.appendChild(u),this.pointsNodes.appendChild(h),this.versionNodes.appendChild(p),e.onDispose(()=>{l.remove(),u.remove(),h.remove()}),i={bbox:l,input:u,output:h,version:p,color:n},this.domCache.set(e,i)}ft.setStyle(i.version,{position:"absolute",marginLeft:"-9px",marginTop:"-10px",borderRadius:12,background:"#f54a45",padding:4,color:"navajowhite",display:e.renderState.hidden?"none":"block",zIndex:r+1e3,left:s.center.x,top:s.center.y}),i.version.innerHTML=e.version.toString(),ft.setStyle(i.input,{position:"absolute",width:10,height:10,marginLeft:-5,marginTop:-5,borderRadius:5,left:o.x,top:o.y,opacity:.4,zIndex:r,backgroundColor:i.color,whiteSpace:"nowrap",overflow:"visible"}),i.input.innerHTML=`${o.x},${o.y}`,ft.setStyle(i.output,{position:"absolute",width:10,height:10,marginLeft:-5,marginTop:-5,borderRadius:5,left:a.x,top:a.y,opacity:.4,zIndex:r,backgroundColor:i.color,whiteSpace:"nowrap",overflow:"visible"}),i.output.innerHTML=`${a.x},${a.y}`,ft.setStyle(i.bbox,{position:"absolute",width:s.width,height:s.height,left:s.left,top:s.top,opacity:`${r/30}`,backgroundColor:i.color})}renderScrollViewportBounds(){const e=Wb({scrollX:this.config.config.scrollX,scrollY:this.config.config.scrollY},this.config);ft.setStyle(this.viewport,{position:"absolute",width:e.width-2,height:e.height-2,left:e.left+1,top:e.top+1,border:"1px solid rgba(200, 200, 255, 0.5)"})}autorun(){if(this.documentTransformer.loading)return;this.documentTransformer.refresh();let e=dP(0);this.document.traverse((n,r)=>{const i=n.getData(at);e=dP(r),this.createBounds(i,e,r)}),this.renderScrollViewportBounds()}};Je([oe(On)],sv.prototype,"document",2);Je([Tn(Fu)],sv.prototype,"documentTransformer",2);Je([ml(Kr,at)],sv.prototype,"_transforms",2);sv=Je([$e()],sv);var hP=2,fP=11,pP="7px",Qp=class extends er{constructor(){super(...arguments),this.rightScrollBar=ft.createDivWithClass("gedit-playground-scroll-right"),this.rightScrollBarBlock=ft.createDivWithClass("gedit-playground-scroll-right-block"),this.bottomScrollBar=ft.createDivWithClass("gedit-playground-scroll-bottom"),this.bottomScrollBarBlock=ft.createDivWithClass("gedit-playground-scroll-bottom-block"),this.sum=0,this.initialScrollX=0,this.initialScrollY=0,this.bottomGrabDragger=new Ja({onDragStart:e=>{this.config.updateCursor("grabbing"),this.sum=0,this.initialScrollX=this.config.getViewport().x,this.onBoardingToast()},onDrag:e=>{this.sum+=e.movingDelta.x,this.playgroundConfigEntity.scroll({scrollX:(this.initialScrollX+this.sum*this.viewportFullWidth/(this.clientViewportWidth-this.scrollBottomWidth))*this.scale},!1)},onDragEnd:e=>{this.config.updateCursor("default")}}),this.rightGrabDragger=new Ja({onDragStart:e=>{this.config.updateCursor("grabbing"),this.sum=0,this.initialScrollY=this.config.getViewport().y,this.onBoardingToast()},onDrag:e=>{this.sum+=e.movingDelta.y,this.playgroundConfigEntity.scroll({scrollY:(this.initialScrollY+this.sum*this.viewportFullHeight/(this.clientViewportHeight-this.scrollRightHeight))*this.scale},!1)},onDragEnd:e=>{this.config.updateCursor("default")}})}get clientViewportWidth(){return this.viewportWidth*this.scale-fP}get clientViewportHeight(){return this.viewportHeight*this.scale-fP}get viewportFullWidth(){return this.mostLeft-this.mostRight}get viewportFullHeight(){return this.mostTop-this.mostBottom}get viewportMoveWidth(){return this.mostLeft-this.mostRight+this.width}get viewportMoveHeight(){return this.mostTop-this.mostBottom+this.height}getToLeft(e){return(e-this.mostRight)/this.viewportMoveWidth*this.clientViewportWidth}getToTop(e){return(e-this.mostBottom)/this.viewportMoveHeight*this.clientViewportHeight}clickRightScrollBar(e){e.preventDefault(),e.stopPropagation();const n=1-((e==null?void 0:e.y)||0)/this.clientViewportHeight,r=(this.mostTop-this.viewportFullHeight*n)*this.scale;this.playgroundConfigEntity.scroll({scrollY:r},!1)}clickBottomScrollBar(e){e.preventDefault(),e.stopPropagation();const n=1-((e==null?void 0:e.x)||0)/this.clientViewportWidth,r=(this.mostLeft-this.viewportFullWidth*n)*this.scale;this.playgroundConfigEntity.scroll({scrollX:r},!1)}onBoardingToast(){var e;(e=this.events)==null||e.dragStart()}changeScrollBarVisibility(e,n){const r=n==="show"?"gedit-playground-scroll-show":"gedit-playground-scroll-hidden",i=n==="show"?"gedit-playground-scroll-hidden":"gedit-playground-scroll-show";ft.addClass(e,r),ft.delClass(e,i)}onReady(){this.options.getBounds||(this.options={getBounds:()=>{const e=this.flowDocument;return e?(e.transformer.refresh(),e.root.getData(at).bounds):Qe.EMPTY},showScrollBars:"whenScrolling"}),this.pipelineNode.parentNode.appendChild(this.rightScrollBar),this.pipelineNode.parentNode.appendChild(this.rightScrollBarBlock),this.pipelineNode.parentNode.appendChild(this.bottomScrollBar),this.pipelineNode.parentNode.appendChild(this.bottomScrollBarBlock),this.rightScrollBar.onclick=this.clickRightScrollBar.bind(this),this.bottomScrollBar.onclick=this.clickBottomScrollBar.bind(this),this.options.showScrollBars==="whenScrolling"&&(this.rightScrollBar.addEventListener("mouseenter",e=>{this.changeScrollBarVisibility(this.rightScrollBarBlock,"show")}),this.rightScrollBar.addEventListener("mouseleave",e=>{this.changeScrollBarVisibility(this.rightScrollBarBlock,"hidden")}),this.bottomScrollBar.addEventListener("mouseenter",e=>{this.changeScrollBarVisibility(this.bottomScrollBarBlock,"show")}),this.bottomScrollBar.addEventListener("mouseleave",e=>{this.changeScrollBarVisibility(this.bottomScrollBarBlock,"hidden")})),this.bottomScrollBarBlock.addEventListener("mousedown",e=>{this.bottomGrabDragger.start(e.clientX,e.clientY),e.stopPropagation()}),this.rightScrollBarBlock.addEventListener("mousedown",e=>{this.rightGrabDragger.start(e.clientX,e.clientY),e.stopPropagation()})}autorun(){this.hideTimeout&&clearTimeout(this.hideTimeout);const e=Wb({scrollX:this.config.config.scrollX,scrollY:this.config.config.scrollY},this.config),n=this.config.getViewport();this.viewportWidth=n.width,this.viewportHeight=n.height;const r=this.options.getBounds();this.width=(r==null?void 0:r.width)||0,this.height=(r==null?void 0:r.height)||0;const i=(this.viewportWidth-e.width)/2-hP,s=(this.viewportHeight-e.height)/2-hP,o=this.width+e.width,a=this.height+e.height,l=r.x,u=r.y;this.mostLeft=this.width+l-i,this.mostRight=this.mostLeft-o,this.mostTop=this.height+u-s,this.mostBottom=this.mostTop-a,this.scale=this.config.finalScale;const h=this.clientViewportWidth,p=this.clientViewportHeight;this.scrollBottomWidth=h-h*(this.mostLeft-this.mostRight)/this.viewportMoveWidth,this.scrollRightHeight=p-p*(this.mostTop-this.mostBottom)/this.viewportMoveHeight;const g=this.getToLeft(n.x),v=this.getToTop(n.y);ft.setStyle(this.rightScrollBarBlock,{right:2,top:v,background:"#1F2329",zIndex:10,height:this.scrollRightHeight,width:pP}),ft.setStyle(this.bottomScrollBarBlock,{left:g,bottom:2,background:"#1F2329",zIndex:10,height:pP,width:this.scrollBottomWidth}),this.changeScrollBarVisibility(this.rightScrollBarBlock,"show"),this.changeScrollBarVisibility(this.bottomScrollBarBlock,"show"),this.options.showScrollBars==="whenScrolling"&&(this.hideTimeout=window.setTimeout(()=>{this.changeScrollBarVisibility(this.rightScrollBarBlock,"hidden"),this.changeScrollBarVisibility(this.bottomScrollBarBlock,"hidden"),this.hideTimeout=void 0},1e3))}};Je([pr(),oe(Eq)],Qp.prototype,"events",2);Je([oe(On),pr()],Qp.prototype,"flowDocument",2);Je([Tn(qn)],Qp.prototype,"playgroundConfigEntity",2);Qp=Je([$e()],Qp);var gP=10,yP=8,mP=8,aa=class extends er{constructor(){super(...arguments),this.dragOffset={x:yP,y:mP},this.containerRef=D.createRef(),this.draggingNodeMask=document.createElement("div"),this._dragger=new Ja({onDrag:e=>{this.handleMouseMove(e)},onDragEnd:()=>{this.handleMouseUp()},stopGlobalEventNames:["contextmenu"]})}get transitions(){const e=[];return this.document.traverse(n=>{e.push(n.getData(mg))}),e}get dragStartEntity(){return this.flowRenderStateEntity.getDragStartEntity()}set dragStartEntity(e){this.flowRenderStateEntity.setDragStartEntity(e)}get dragEntities(){return this.flowRenderStateEntity.getDragEntities()}set dragEntities(e){this.flowRenderStateEntity.setDragEntities(e)}isGrab(){return this.editorStateConfig.getCurrentState()===xn.STATE_GRAB}setDraggingStatus(e){this.service.nodeDragIdsWithChildren.length&&this.service.nodeDragIdsWithChildren.forEach(n=>{const r=this.entityManager.getEntityById(n),i=r==null?void 0:r.getData(zn);i.dragging=e})}dragEnable(e){return Math.abs(e.clientX-this.initialPosition.x)>gP||Math.abs(e.clientY-this.initialPosition.y)>gP}handleMouseMove(e){var n;if(this.dragStartEntity&&this.dragEnable(e)){this.setDraggingStatus(!0);const r=this.playgroundConfigEntity.finalScale;if(this.containerRef.current){const i=(n=this.containerRef.current.children)==null?void 0:n[0],s=e.clientX-(this.pipelineNode.offsetLeft||0)-this.playgroundConfigEntity.config.clientX-(i.clientWidth-this.dragOffset.x)*r,o=e.clientY-(this.pipelineNode.offsetTop||0)-this.playgroundConfigEntity.config.clientY-(i.clientHeight-this.dragOffset.y)*r,a=this.service.isDragBranch,l=new Qe(s,o,i.clientWidth*r,i.clientHeight*r);let u;const h=this.transitions.find(p=>{var w,S;if((S=(w=p==null?void 0:p.entity)==null?void 0:w.parent)!=null&&S.collapsed)return!1;const{hasCollision:g,labelOffsetType:v}=this.flowDragConfigEntity.isCollision(p,l,a);return u=v,g});h&&(a?this.service.isDroppableBranch(h.entity,u):this.service.isDroppableNode(h.entity))&&(!this.options.canDrop||this.options.canDrop({dragNodes:this.dragEntities,dropNode:h.entity,isBranch:a}))?this.flowRenderStateEntity.setNodeDroppingId(h.entity.id):this.flowRenderStateEntity.setNodeDroppingId(""),this.flowRenderStateEntity.setDragLabelSide(u),this.containerRef.current.style.visibility="visible",this.pipelineNode.parentElement.appendChild(this.draggingNodeMask),this.containerRef.current.style.left=`${s}px`,this.containerRef.current.style.top=`${o}px`,this.containerRef.current.style.transformOrigin="top left",this.containerRef.current.style.transform=`scale(${r})`,this.flowDragConfigEntity.scrollDirection(e,this.containerRef.current,s,o)}}}handleMouseUp(){this.setDraggingStatus(!1),this.dragStartEntity&&(this.service.dropNodeId&&(this.service.isDragBranch?this.service.dropBranch():(this.service.dropNode(),this.selectConfigEntity.clearSelectedNodes())),this.flowRenderStateEntity.setNodeDroppingId(""),this.flowRenderStateEntity.setDragLabelSide(),this.dragStartEntity=void 0,this.dragEntities=[],this.flowDragConfigEntity.stopAllScroll()),this.containerRef.current&&(this.containerRef.current.style.visibility="hidden",this.pipelineNode.parentElement.contains(this.draggingNodeMask)&&this.pipelineNode.parentElement.removeChild(this.draggingNodeMask))}async startDrag(e,{dragStartEntity:n,dragEntities:r},i){if(this.isGrab()||this.config.disabled||this.config.readonly)return;this.dragOffset.x=(i==null?void 0:i.dragOffsetX)||yP,this.dragOffset.y=(i==null?void 0:i.dragOffsetY)||mP;const s=n.flowNodeType===In.BLOCK_ICON,o=n.flowNodeType===In.BLOCK_ORDER_ICON,a=s||o?n.parent:n;if(a.getData(zn).draggable)return this.initialPosition={x:e.clientX,y:e.clientY},this.dragStartEntity=a,this.dragEntities=r||[this.dragStartEntity],this._dragger.start(e.clientX,e.clientY)}onReady(){this.draggingNodeMask.style.width="100%",this.draggingNodeMask.style.height="100%",this.draggingNodeMask.style.position="absolute",this.draggingNodeMask.classList.add("dragging-node"),this.draggingNodeMask.style.zIndex="99",this.draggingNodeMask.style.cursor="pointer",this.dragNodeComp=this.rendererRegistry.getRendererComponent("drag-node"),this.options.onDrop&&this.toDispose.push(this.service.onDrop(this.options.onDrop))}render(){const e=this.dragNodeComp.renderer;return D.createElement("div",{ref:this.containerRef,style:{position:"absolute",zIndex:99999,visibility:"hidden"},onMouseEnter:n=>n.stopPropagation()},D.createElement(e,{dragStart:this.dragStartEntity,dragNodes:this.dragEntities}))}};Je([oe(On)],aa.prototype,"document",2);Je([oe(ul)],aa.prototype,"service",2);Je([ml(Kr,at)],aa.prototype,"transforms",2);Je([Tn(al)],aa.prototype,"editorStateConfig",2);Je([Tn(qn)],aa.prototype,"playgroundConfigEntity",2);Je([Tn(m8)],aa.prototype,"flowDragConfigEntity",2);Je([Tn(Vv)],aa.prototype,"flowRenderStateEntity",2);Je([Tn(Hv)],aa.prototype,"selectConfigEntity",2);Je([oe(bs)],aa.prototype,"rendererRegistry",2);aa=Je([$e()],aa);var dl=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-selector-box-layer"),this.selectorBox=this.createDOMCache("gedit-selector-box"),this.selectorBoxBlock=this.createDOMCache("gedit-selector-box-block"),this.selectboxDragger=new Ja({onDragStart:e=>{this.selectConfigEntity.clearSelectedNodes();const n=this.playgroundConfigEntity.getPosFromMouseEvent(e);this.transformVisibles=this.flowDocument.getRenderDatas(at,!1).filter(r=>{const{entity:i}=r;return i.originParent?this.nodeSelectable(i,n)&&this.nodeSelectable(i.originParent,n):this.nodeSelectable(i,n)}),this.selectorBoxConfigEntity.setDragInfo(e),this.updateSelectorBox(this.selectorBoxConfigEntity)},onDrag:e=>{this.selectorBoxConfigEntity.setDragInfo(e),this.selectConfigEntity.selectFromBounds(this.selectorBoxConfigEntity.toRectangle(this.playgroundConfigEntity.finalScale),this.transformVisibles),this.updateSelectorBox(this.selectorBoxConfigEntity)},onDragEnd:e=>{this.selectorBoxConfigEntity.setDragInfo(e),this.transformVisibles.length=0,this.updateSelectorBox(this.selectorBoxConfigEntity)}})}onReady(){this.options.canSelect||(this.options.canSelect=e=>{const n=e.target;return n===this.pipelineNode||n===this.playgroundNode}),this.toDispose.pushAll([this.selectConfigEntity.onConfigChanged(()=>{this.selectionService.selection=this.selectConfigEntity.selectedNodes}),this.selectionService.onSelectionChanged(()=>{const e=this.selectionService.selection.filter(n=>n instanceof Kr);this.selectConfigEntity.selectedNodes=e})]),this.listenPlaygroundEvent("mousedown",e=>!this.isEnabled()||this.options.canSelect&&!this.options.canSelect(e,this.selectorBoxConfigEntity)?void 0:(this.editorStateConfig.getCurrentState()===xn.STATE_MOUSE_FRIENDLY_SELECT&&this.selectConfigEntity.clearSelectedNodes(),this.selectboxDragger.start(e.clientX,e.clientY,this.config),!0),EI.BASE_LAYER)}isEnabled(){const e=this.editorStateConfig.getCurrentState(),n=e===xn.STATE_MOUSE_FRIENDLY_SELECT;return!this.config.disabled&&!this.config.readonly&&(n&&this.editorStateConfig.isPressingShift||e===xn.STATE_SELECT)&&!this.selectorBoxConfigEntity.disabled}dispose(){this.selectorBox.dispose(),this.selectorBoxBlock.dispose(),super.dispose()}updateSelectorBox(e){const n=this.selectorBox.get(),r=this.selectorBoxBlock.get();!this.isEnabled()&&e.isMoving&&this.selectorBoxConfigEntity.collapse(),!this.isEnabled()||!e.isMoving?(n.setStyle({display:"none"}),r.setStyle({display:"none"})):(n.setStyle({display:"block",left:e.position.x,top:e.position.y,width:e.size.width,height:e.size.height}),r.setStyle({display:"block",left:e.position.x-10,top:e.position.y-10,width:e.size.width+20,height:e.size.height+20}))}nodeSelectable(e,n){const r=e.getNodeMeta().selectable;return typeof r=="function"?r(e,n):r}};Je([oe(On)],dl.prototype,"flowDocument",2);Je([oe(rv)],dl.prototype,"contextMenuService",2);Je([Tn(qn)],dl.prototype,"playgroundConfigEntity",2);Je([oe(oa)],dl.prototype,"selectionService",2);Je([Tn(Uv)],dl.prototype,"selectorBoxConfigEntity",2);Je([Tn(Hv)],dl.prototype,"selectConfigEntity",2);Je([Tn(al)],dl.prototype,"editorStateConfig",2);dl=Je([$e()],dl);var hl=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-selector-bounds-layer"),this.selectBoundsBackground=ft.createDivWithClass("gedit-selector-bounds-background")}onReady(){this.node.style.zIndex="20";const{firstChild:e}=this.pipelineNode;this.options.boundsPadding!==void 0&&(this.flowSelectConfigEntity.boundsPadding=this.options.boundsPadding),this.options.backgroundClassName&&this.selectBoundsBackground.classList.add(this.options.backgroundClassName);const n=ft.createDivWithClass("gedit-playground-layer");n.appendChild(this.selectBoundsBackground),this.pipelineNode.insertBefore(n,e)}onZoom(e){this.node.style.transform=`scale(${e})`,this.selectBoundsBackground.parentElement.style.transform=`scale(${e})`}onViewportChange(){this.render()}isEnabled(){return this.editorStateConfig.getCurrentState()===xn.STATE_SELECT}render(){var v;const{ignoreOneSelect:e,ignoreChildrenLength:n,SelectorBoxPopover:r,disableBackground:i,CustomBoundsRenderer:s}=this.options,o=this.flowSelectConfigEntity.getSelectedBounds(),a=this.flowSelectConfigEntity.selectedNodes,l=this.selectBoundsBackground,u=!this.selectorBoxConfigEntity.isStart;if(o.width===0||o.height===0||e&&a.length===1&&(n||a[0].childrenLength<=1))return ft.setStyle(l,{display:"none"}),D.createElement(D.Fragment,null);if(s)return D.createElement(s,{bounds:o,config:this.config,flowSelectConfig:this.flowSelectConfigEntity,commandRegistry:this.commandRegistry});const h={display:"block",left:o.left,top:o.top,width:o.width,height:o.height};i||ft.setStyle(l,h);let p="gedit-selector-bounds-foreground";this.options.foregroundClassName&&(p+=" "+this.options.foregroundClassName);const g=r||((v=this.rendererRegistry.tryToGetRendererComponent("selector-box-popover"))==null?void 0:v.renderer);return!u||!g?D.createElement("div",{className:p,style:h}):D.createElement(g,{bounds:o,config:this.config,flowSelectConfig:this.flowSelectConfigEntity,commandRegistry:this.commandRegistry},D.createElement("div",{className:p,style:h}))}};Je([oe(bs)],hl.prototype,"rendererRegistry",2);Je([oe(Qa)],hl.prototype,"commandRegistry",2);Je([Tn(Hv)],hl.prototype,"flowSelectConfigEntity",2);Je([Tn(al)],hl.prototype,"editorStateConfig",2);Je([Tn(Uv)],hl.prototype,"selectorBoxConfigEntity",2);Je([ml(Kr,zn)],hl.prototype,"renderStates",2);Je([ml(Kr,at)],hl.prototype,"_transforms",2);hl=Je([$e()],hl);var fl=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-context-menu-layer"),this.nodeRef=D.createRef()}isEnabled(){const e=this.editorStateConfig.getCurrentState();return!this.config.disabled&&!this.config.readonly&&e===xn.STATE_SELECT&&!this.selectorBoxConfigEntity.disabled}onReady(){this.node.style.zIndex="30",this.node.style.display="block",this.toDispose.pushAll([this.listenPlaygroundEvent("contextmenu",e=>{var s;if(!this.isEnabled())return;this.contextMenuService.rightPanelVisible=!0;const n=this.flowSelectConfigEntity.getSelectedBounds();if(n.width===0||n.height===0)return;e.stopPropagation(),e.preventDefault(),(s=this.nodeRef.current)==null||s.setVisible(!0);const r=e.clientX-(this.pipelineNode.offsetLeft||0)-this.playgroundConfigEntity.config.clientX,i=e.clientY-(this.pipelineNode.offsetTop||0)-this.playgroundConfigEntity.config.clientY;this.node.style.left=`${r}px`,this.node.style.top=`${i}px`},EI.BASE_LAYER),this.listenPlaygroundEvent("mousedown",()=>{var e;(e=this.nodeRef.current)==null||e.setVisible(!1),this.contextMenuService.rightPanelVisible=!1})])}onScroll(){var e;(e=this.nodeRef.current)==null||e.setVisible(!1)}onZoom(){var e;(e=this.nodeRef.current)==null||e.setVisible(!1)}dispose(){super.dispose()}renderCommandMenus(){return this.commandRegistry.commands.filter(e=>e.category==="SELECTOR_BOX").map(e=>{var r;const n=(r=this.rendererRegistry.getRendererComponent(e.icon||e.id))==null?void 0:r.renderer;return D.createElement(n,{key:e.id,command:e,isContextMenu:!0,disabled:!this.commandRegistry.isEnabled(e.id),onClick:i=>this.commandRegistry.executeCommand(e.id,i)})}).filter(e=>e)}render(){const e=this.rendererRegistry.getRendererComponent("context-menu-popover").renderer;return D.createElement(e,{ref:this.nodeRef,content:this.renderCommandMenus()})}};Je([oe(Qa)],fl.prototype,"commandRegistry",2);Je([oe(bs)],fl.prototype,"rendererRegistry",2);Je([oe(rv)],fl.prototype,"contextMenuService",2);Je([Tn(Hv)],fl.prototype,"flowSelectConfigEntity",2);Je([oe(oa)],fl.prototype,"selectionService",2);Je([Tn(qn)],fl.prototype,"playgroundConfigEntity",2);Je([Tn(al)],fl.prototype,"editorStateConfig",2);Je([Tn(Uv)],fl.prototype,"selectorBoxConfigEntity",2);fl=Je([$e()],fl);var qb=class extends er{getInitScroll(){return this.document.layout.getInitScroll(this.pipelineNode.getBoundingClientRect())}onReady(){const e=()=>this.getInitScroll();this.config.updateConfig(e()),this.config.addScrollLimit(n=>Cq(n,[this.document.root.getData(at).bounds],this.config,e))}};Je([oe(On)],qb.prototype,"document",2);qb=Je([$e()],qb);var xq=new Mo(e=>{e(bs).toSelf().inSingletonScope(),e(Kb).toSelf().inSingletonScope()}),yN=function(e,n){return yN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},yN(e,n)};function pa(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");yN(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}function Sq(e,n,r,i){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(p){try{h(i.next(p))}catch(g){a(g)}}function u(p){try{h(i.throw(p))}catch(g){a(g)}}function h(p){p.done?o(p.value):s(p.value).then(l,u)}h((i=i.apply(e,n||[])).next())})}function _8(e,n){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(h){return function(p){return u([h,p])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,h[0]&&(r=0)),r;)try{if(i=1,s&&(o=h[0]&2?s.return:h[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,h[1])).done)return o;switch(s=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,s=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=n.call(e,r)}catch(p){h=[6,p],s=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Jp(e){var n=typeof Symbol=="function"&&Symbol.iterator,r=n&&e[n],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function zu(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),s,o=[],a;try{for(;(n===void 0||n-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(l){a={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o}function Vu(e,n,r){if(r||arguments.length===2)for(var i=0,s=n.length,o;i<s;i++)(o||!(i in n))&&(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}function $p(e){return this instanceof $p?(this.v=e,this):new $p(e)}function Dq(e,n,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,n||[]),s,o=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",a),s[Symbol.asyncIterator]=function(){return this},s;function a(w){return function(S){return Promise.resolve(S).then(w,g)}}function l(w,S){i[w]&&(s[w]=function(E){return new Promise(function(x,I){o.push([w,E,x,I])>1||u(w,E)})},S&&(s[w]=S(s[w])))}function u(w,S){try{h(i[w](S))}catch(E){v(o[0][3],E)}}function h(w){w.value instanceof $p?Promise.resolve(w.value.v).then(p,g):v(o[0][2],w)}function p(w){u("next",w)}function g(w){u("throw",w)}function v(w,S){w(S),o.shift(),o.length&&u(o[0][0],o[0][1])}}function Nq(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],r;return n?n.call(e):(e=typeof Jp=="function"?Jp(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(l,u){a=e[o](a),s(l,u,a.done,a.value)})}}function s(o,a,l,u){Promise.resolve(u).then(function(h){o({value:h,done:l})},a)}}function Tr(e){return typeof e=="function"}function C8(e){var n=function(i){Error.call(i),i.stack=new Error().stack},r=e(n);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var qC=C8(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
||
`+r.map(function(i,s){return s+1+") "+i.toString()}).join(`
|
||
`):"",this.name="UnsubscriptionError",this.errors=r}});function Gb(e,n){if(e){var r=e.indexOf(n);0<=r&&e.splice(r,1)}}var vg=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,r,i,s,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var l=Jp(a),u=l.next();!u.done;u=l.next()){var h=u.value;h.remove(this)}}catch(E){n={error:E}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}else a.remove(this);var p=this.initialTeardown;if(Tr(p))try{p()}catch(E){o=E instanceof qC?E.errors:[E]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var v=Jp(g),w=v.next();!w.done;w=v.next()){var S=w.value;try{vP(S)}catch(E){o=o??[],E instanceof qC?o=Vu(Vu([],zu(o)),zu(E.errors)):o.push(E)}}}catch(E){i={error:E}}finally{try{w&&!w.done&&(s=v.return)&&s.call(v)}finally{if(i)throw i.error}}}if(o)throw new qC(o)}},e.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)vP(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(n)}},e.prototype._hasParent=function(n){var r=this._parentage;return r===n||Array.isArray(r)&&r.includes(n)},e.prototype._addParent=function(n){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(n),r):r?[r,n]:n},e.prototype._removeParent=function(n){var r=this._parentage;r===n?this._parentage=null:Array.isArray(r)&&Gb(r,n)},e.prototype.remove=function(n){var r=this._finalizers;r&&Gb(r,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),E8=vg.EMPTY;function x8(e){return e instanceof vg||e&&"closed"in e&&Tr(e.remove)&&Tr(e.add)&&Tr(e.unsubscribe)}function vP(e){Tr(e)?e():e.unsubscribe()}var Iq={Promise:void 0},Oq={setTimeout:function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Vu([e,n],zu(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function S8(e){Oq.setTimeout(function(){throw e})}function bP(){}function bb(e){e()}var LI=function(e){pa(n,e);function n(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,x8(r)&&r.add(i)):i.destination=Pq,i}return n.create=function(r,i,s){return new ov(r,i,s)},n.prototype.next=function(r){this.isStopped||this._next(r)},n.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(r){this.destination.next(r)},n.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(vg),Tq=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var r=this.partialObserver;if(r.next)try{r.next(n)}catch(i){ib(i)}},e.prototype.error=function(n){var r=this.partialObserver;if(r.error)try{r.error(n)}catch(i){ib(i)}else ib(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(r){ib(r)}},e}(),ov=function(e){pa(n,e);function n(r,i,s){var o=e.call(this)||this,a;return Tr(r)||!r?a={next:r??void 0,error:i??void 0,complete:s??void 0}:a=r,o.destination=new Tq(a),o}return n}(LI);function ib(e){S8(e)}function Mq(e){throw e}var Pq={closed:!0,next:bP,error:Mq,complete:bP},jI=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function bg(e){return e}function Aq(e){return e.length===0?bg:e.length===1?e[0]:function(r){return e.reduce(function(i,s){return s(i)},r)}}var Xs=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var r=new e;return r.source=this,r.operator=n,r},e.prototype.subscribe=function(n,r,i){var s=this,o=kq(n)?n:new ov(n,r,i);return bb(function(){var a=s,l=a.operator,u=a.source;o.add(l?l.call(o,u):u?s._subscribe(o):s._trySubscribe(o))}),o},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(r){n.error(r)}},e.prototype.forEach=function(n,r){var i=this;return r=wP(r),new r(function(s,o){var a=new ov({next:function(l){try{n(l)}catch(u){o(u),a.unsubscribe()}},error:o,complete:s});i.subscribe(a)})},e.prototype._subscribe=function(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)},e.prototype[jI]=function(){return this},e.prototype.pipe=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Aq(n)(this)},e.prototype.toPromise=function(n){var r=this;return n=wP(n),new n(function(i,s){var o;r.subscribe(function(a){return o=a},function(a){return s(a)},function(){return i(o)})})},e.create=function(n){return new e(n)},e}();function wP(e){var n;return(n=e??Iq.Promise)!==null&&n!==void 0?n:Promise}function Rq(e){return e&&Tr(e.next)&&Tr(e.error)&&Tr(e.complete)}function kq(e){return e&&e instanceof LI||Rq(e)&&x8(e)}function Lq(e){return Tr(e==null?void 0:e.lift)}function vl(e){return function(n){if(Lq(n))return n.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function la(e,n,r,i,s){return new jq(e,n,r,i,s)}var jq=function(e){pa(n,e);function n(r,i,s,o,a,l){var u=e.call(this,r)||this;return u.onFinalize=a,u.shouldUnsubscribe=l,u._next=i?function(h){try{i(h)}catch(p){r.error(p)}}:e.prototype._next,u._error=o?function(h){try{o(h)}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=s?function(){try{s()}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._complete,u}return n.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},n}(LI),_P={schedule:function(e){var n=requestAnimationFrame,r=cancelAnimationFrame,i=n(function(s){r=void 0,e(s)});return new vg(function(){return r==null?void 0:r(i)})},requestAnimationFrame:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return requestAnimationFrame.apply(void 0,Vu([],zu(e)))},cancelAnimationFrame:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return cancelAnimationFrame.apply(void 0,Vu([],zu(e)))},delegate:void 0},Fq=C8(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),td=function(e){pa(n,e);function n(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return n.prototype.lift=function(r){var i=new CP(this,this);return i.operator=r,i},n.prototype._throwIfClosed=function(){if(this.closed)throw new Fq},n.prototype.next=function(r){var i=this;bb(function(){var s,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=Jp(i.currentObservers),l=a.next();!l.done;l=a.next()){var u=l.value;u.next(r)}}catch(h){s={error:h}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(s)throw s.error}}}})},n.prototype.error=function(r){var i=this;bb(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},n.prototype.complete=function(){var r=this;bb(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},n.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},n.prototype._innerSubscribe=function(r){var i=this,s=this,o=s.hasError,a=s.isStopped,l=s.observers;return o||a?E8:(this.currentObservers=null,l.push(r),new vg(function(){i.currentObservers=null,Gb(l,r)}))},n.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,o=i.thrownError,a=i.isStopped;s?r.error(o):a&&r.complete()},n.prototype.asObservable=function(){var r=new Xs;return r.source=this,r},n.create=function(r,i){return new CP(r,i)},n}(Xs),CP=function(e){pa(n,e);function n(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return n.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},n.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},n.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},n.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:E8},n}(td),$q=function(e){pa(n,e);function n(r){var i=e.call(this)||this;return i._value=r,i}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(r){var i=e.prototype._subscribe.call(this,r);return!i.closed&&r.next(this._value),i},n.prototype.getValue=function(){var r=this,i=r.hasError,s=r.thrownError,o=r._value;if(i)throw s;return this._throwIfClosed(),o},n.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},n}(td),zq={now:function(){return Date.now()}},Vq=function(e){pa(n,e);function n(r,i){return e.call(this)||this}return n.prototype.schedule=function(r,i){return this},n}(vg),EP={setInterval:function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,Vu([e,n],zu(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},D8=function(e){pa(n,e);function n(r,i){var s=e.call(this,r,i)||this;return s.scheduler=r,s.work=i,s.pending=!1,s}return n.prototype.schedule=function(r,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(a,this.id,i),this},n.prototype.requestAsyncId=function(r,i,s){return s===void 0&&(s=0),EP.setInterval(r.flush.bind(r,this),s)},n.prototype.recycleAsyncId=function(r,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&EP.clearInterval(i)},n.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(r,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(r,i){var s=!1,o;try{this.work(r)}catch(a){s=!0,o=a||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),o},n.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,s=r.scheduler,o=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Gb(o,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n}(Vq),xP=function(){function e(n,r){r===void 0&&(r=e.now),this.schedulerActionCtor=n,this.now=r}return e.prototype.schedule=function(n,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,n).schedule(i,r)},e.now=zq.now,e}(),N8=function(e){pa(n,e);function n(r,i){i===void 0&&(i=xP.now);var s=e.call(this,r,i)||this;return s.actions=[],s._active=!1,s}return n.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var s;this._active=!0;do if(s=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,s){for(;r=i.shift();)r.unsubscribe();throw s}},n}(xP),Bq=new N8(D8),Hq=function(e){pa(n,e);function n(r,i){var s=e.call(this,r,i)||this;return s.scheduler=r,s.work=i,s}return n.prototype.requestAsyncId=function(r,i,s){return s===void 0&&(s=0),s!==null&&s>0?e.prototype.requestAsyncId.call(this,r,i,s):(r.actions.push(this),r._scheduled||(r._scheduled=_P.requestAnimationFrame(function(){return r.flush(void 0)})))},n.prototype.recycleAsyncId=function(r,i,s){var o;if(s===void 0&&(s=0),s!=null?s>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,i,s);var a=r.actions;i!=null&&((o=a[a.length-1])===null||o===void 0?void 0:o.id)!==i&&(_P.cancelAnimationFrame(i),r._scheduled=void 0)},n}(D8),Uq=function(e){pa(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.flush=function(r){this._active=!0;var i=this._scheduled;this._scheduled=void 0;var s=this.actions,o;r=r||s.shift();do if(o=r.execute(r.state,r.delay))break;while((r=s[0])&&r.id===i&&s.shift());if(this._active=!1,o){for(;(r=s[0])&&r.id===i&&s.shift();)r.unsubscribe();throw o}},n}(N8),Kq=new Uq(Hq),Wq=new Xs(function(e){return e.complete()});function qq(e){return e&&Tr(e.schedule)}function FI(e){return e[e.length-1]}function Gq(e){return Tr(FI(e))?e.pop():void 0}function $I(e){return qq(FI(e))?e.pop():void 0}function Yq(e,n){return typeof FI(e)=="number"?e.pop():n}var I8=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function O8(e){return Tr(e==null?void 0:e.then)}function T8(e){return Tr(e[jI])}function M8(e){return Symbol.asyncIterator&&Tr(e==null?void 0:e[Symbol.asyncIterator])}function P8(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Xq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var A8=Xq();function R8(e){return Tr(e==null?void 0:e[A8])}function k8(e){return Dq(this,arguments,function(){var r,i,s,o;return _8(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,$p(r.read())];case 3:return i=a.sent(),s=i.value,o=i.done,o?[4,$p(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,$p(s)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function L8(e){return Tr(e==null?void 0:e.getReader)}function _c(e){if(e instanceof Xs)return e;if(e!=null){if(T8(e))return Zq(e);if(I8(e))return Qq(e);if(O8(e))return Jq(e);if(M8(e))return j8(e);if(R8(e))return eG(e);if(L8(e))return tG(e)}throw P8(e)}function Zq(e){return new Xs(function(n){var r=e[jI]();if(Tr(r.subscribe))return r.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Qq(e){return new Xs(function(n){for(var r=0;r<e.length&&!n.closed;r++)n.next(e[r]);n.complete()})}function Jq(e){return new Xs(function(n){e.then(function(r){n.closed||(n.next(r),n.complete())},function(r){return n.error(r)}).then(null,S8)})}function eG(e){return new Xs(function(n){var r,i;try{for(var s=Jp(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(n.next(a),n.closed)return}}catch(l){r={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}n.complete()})}function j8(e){return new Xs(function(n){nG(e,n).catch(function(r){return n.error(r)})})}function tG(e){return j8(k8(e))}function nG(e,n){var r,i,s,o;return Sq(this,void 0,void 0,function(){var a,l;return _8(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=Nq(e),u.label=1;case 1:return[4,r.next()];case 2:if(i=u.sent(),!!i.done)return[3,4];if(a=i.value,n.next(a),n.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=u.sent(),s={error:l},[3,11];case 6:return u.trys.push([6,,9,10]),i&&!i.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function Pu(e,n,r,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var o=n.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!s)return o}function F8(e,n){return n===void 0&&(n=0),vl(function(r,i){r.subscribe(la(i,function(s){return Pu(i,e,function(){return i.next(s)},n)},function(){return Pu(i,e,function(){return i.complete()},n)},function(s){return Pu(i,e,function(){return i.error(s)},n)}))})}function $8(e,n){return n===void 0&&(n=0),vl(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},n))})}function rG(e,n){return _c(e).pipe($8(n),F8(n))}function iG(e,n){return _c(e).pipe($8(n),F8(n))}function sG(e,n){return new Xs(function(r){var i=0;return n.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function oG(e,n){return new Xs(function(r){var i;return Pu(r,n,function(){i=e[A8](),Pu(r,n,function(){var s,o,a;try{s=i.next(),o=s.value,a=s.done}catch(l){r.error(l);return}a?r.complete():r.next(o)},0,!0)}),function(){return Tr(i==null?void 0:i.return)&&i.return()}})}function z8(e,n){if(!e)throw new Error("Iterable cannot be null");return new Xs(function(r){Pu(r,n,function(){var i=e[Symbol.asyncIterator]();Pu(r,n,function(){i.next().then(function(s){s.done?r.complete():r.next(s.value)})},0,!0)})})}function aG(e,n){return z8(k8(e),n)}function lG(e,n){if(e!=null){if(T8(e))return rG(e,n);if(I8(e))return sG(e,n);if(O8(e))return iG(e,n);if(M8(e))return z8(e,n);if(R8(e))return oG(e,n);if(L8(e))return aG(e,n)}throw P8(e)}function Tw(e,n){return n?lG(e,n):_c(e)}function SP(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=$I(e);return Tw(e,r)}function Kv(e,n){return vl(function(r,i){var s=0;r.subscribe(la(i,function(o){i.next(e.call(n,o,s++))}))})}var cG=Array.isArray;function uG(e,n){return cG(n)?e.apply(void 0,Vu([],zu(n))):e(n)}function dG(e){return Kv(function(n){return uG(e,n)})}var hG=Array.isArray,fG=Object.getPrototypeOf,pG=Object.prototype,gG=Object.keys;function yG(e){if(e.length===1){var n=e[0];if(hG(n))return{args:n,keys:null};if(mG(n)){var r=gG(n);return{args:r.map(function(i){return n[i]}),keys:r}}}return{args:e,keys:null}}function mG(e){return e&&typeof e=="object"&&fG(e)===pG}function vG(e,n){return e.reduce(function(r,i,s){return r[i]=n[s],r},{})}function bG(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=$I(e),i=Gq(e),s=yG(e),o=s.args,a=s.keys;if(o.length===0)return Tw([],r);var l=new Xs(wG(o,r,a?function(u){return vG(a,u)}:bg));return i?l.pipe(dG(i)):l}function wG(e,n,r){return r===void 0&&(r=bg),function(i){DP(n,function(){for(var s=e.length,o=new Array(s),a=s,l=s,u=function(p){DP(n,function(){var g=Tw(e[p],n),v=!1;g.subscribe(la(i,function(w){o[p]=w,v||(v=!0,l--),l||i.next(r(o.slice()))},function(){--a||i.complete()}))},i)},h=0;h<s;h++)u(h)},i)}}function DP(e,n,r){e?Pu(r,e,n):n()}function _G(e,n,r,i,s,o,a,l){var u=[],h=0,p=0,g=!1,v=function(){g&&!u.length&&!h&&n.complete()},w=function(E){return h<i?S(E):u.push(E)},S=function(E){h++;var x=!1;_c(r(E,p++)).subscribe(la(n,function(I){n.next(I)},function(){x=!0},void 0,function(){if(x)try{h--;for(var I=function(){var P=u.shift();a||S(P)};u.length&&h<i;)I();v()}catch(P){n.error(P)}}))};return e.subscribe(la(n,w,function(){g=!0,v()})),function(){}}function V8(e,n,r){return r===void 0&&(r=1/0),Tr(n)?V8(function(i,s){return Kv(function(o,a){return n(i,o,s,a)})(_c(e(i,s)))},r):(typeof n=="number"&&(r=n),vl(function(i,s){return _G(i,s,e,r)}))}function CG(e){return e===void 0&&(e=1/0),V8(bg,e)}function B8(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=$I(e),i=Yq(e,1/0),s=e;return s.length?s.length===1?_c(s[0]):CG(i)(Tw(s,r)):Wq}function H8(e,n){return vl(function(r,i){var s=0;r.subscribe(la(i,function(o){return e.call(n,o,s++)&&i.next(o)}))})}function EG(e,n){return n===void 0&&(n=Bq),vl(function(r,i){var s=null,o=null,a=null,l=function(){if(s){s.unsubscribe(),s=null;var h=o;o=null,i.next(h)}};function u(){var h=a+e,p=n.now();if(p<h){s=this.schedule(void 0,h-p),i.add(s);return}l()}r.subscribe(la(i,function(h){o=h,a=n.now(),s||(s=n.schedule(u,e),i.add(s))},function(){l(),i.complete()},void 0,function(){o=s=null}))})}function zI(e,n){return n===void 0&&(n=bg),e=e??xG,vl(function(r,i){var s,o=!0;r.subscribe(la(i,function(a){var l=n(a);(o||!e(s,l))&&(o=!1,s=l,i.next(a))}))})}function xG(e,n){return e===n}function Yb(e){e===void 0&&(e={});var n=e.connector,r=n===void 0?function(){return new td}:n,i=e.resetOnError,s=i===void 0?!0:i,o=e.resetOnComplete,a=o===void 0?!0:o,l=e.resetOnRefCountZero,u=l===void 0?!0:l;return function(h){var p,g,v,w=0,S=!1,E=!1,x=function(){g==null||g.unsubscribe(),g=void 0},I=function(){x(),p=v=void 0,S=E=!1},P=function(){var M=p;I(),M==null||M.unsubscribe()};return vl(function(M,k){w++,!E&&!S&&x();var A=v=v??r();k.add(function(){w--,w===0&&!E&&!S&&(g=GC(P,u))}),A.subscribe(k),!p&&w>0&&(p=new ov({next:function(j){return A.next(j)},error:function(j){E=!0,x(),g=GC(I,s,j),A.error(j)},complete:function(){S=!0,x(),g=GC(I,a),A.complete()}}),_c(M).subscribe(p))})(h)}}function GC(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(n===!0){e();return}if(n!==!1){var s=new ov({next:function(){s.unsubscribe(),e()}});return _c(n.apply(void 0,Vu([],zu(r)))).subscribe(s)}}function VI(e){return H8(function(n,r){return e<=r})}function BI(e,n){return vl(function(r,i){var s=null,o=0,a=!1,l=function(){return a&&!s&&i.complete()};r.subscribe(la(i,function(u){s==null||s.unsubscribe();var h=0,p=o++;_c(e(u,p)).subscribe(s=la(i,function(g){return i.next(n?n(u,g,p,h++):g)},function(){s=null,l()}))},function(){a=!0,l()}))})}function NP(e,n,r){var i=Tr(e)||n||r?{next:e,error:n,complete:r}:e;return i?vl(function(s,o){var a;(a=i.subscribe)===null||a===void 0||a.call(i);var l=!0;s.subscribe(la(o,function(u){var h;(h=i.next)===null||h===void 0||h.call(i,u),o.next(u)},function(){var u;l=!1,(u=i.complete)===null||u===void 0||u.call(i),o.complete()},function(u){var h;l=!1,(h=i.error)===null||h===void 0||h.call(i,u),o.error(u)},function(){var u,h;l&&((u=i.unsubscribe)===null||u===void 0||u.call(i)),(h=i.finalize)===null||h===void 0||h.call(i)}))}):bg}var SG=typeof WeakSet=="function",IP=Object.keys;function HI(e,n){return e===n||e!==e&&n!==n}function OP(e){return e.constructor===Object||e.constructor==null}function TP(e){return!!e&&typeof e.then=="function"}function MP(e){return!!(e&&e.$$typeof)}function DG(){var e=[];return{add:function(n){e.push(n)},has:function(n){return e.indexOf(n)!==-1}}}var NG=function(e){return e?function(){return new WeakSet}:DG}(SG);function U8(e){return function(r){var i=e||r;return function(o,a,l){l===void 0&&(l=NG());var u=!!o&&typeof o=="object",h=!!a&&typeof a=="object";if(u||h){var p=u&&l.has(o),g=h&&l.has(a);if(p||g)return p&&g;u&&l.add(o),h&&l.add(a)}return i(o,a,l)}}}function IG(e,n,r,i){var s=e.length;if(n.length!==s)return!1;for(;s-- >0;)if(!r(e[s],n[s],i))return!1;return!0}function OG(e,n,r,i){var s=e.size===n.size;if(s&&e.size){var o={};e.forEach(function(a,l){if(s){var u=!1,h=0;n.forEach(function(p,g){!u&&!o[h]&&(u=r(l,g,i)&&r(a,p,i),u&&(o[h]=!0)),h++}),s=u}})}return s}var TG="_owner",MG=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function PP(e,n,r,i){var s=IP(e),o=s.length;if(IP(n).length!==o)return!1;if(o)for(var a=void 0;o-- >0;){if(a=s[o],a===TG){var l=MP(e),u=MP(n);if((l||u)&&l!==u)return!1}if(!MG(n,a)||!r(e[a],n[a],i))return!1}return!0}function PG(e,n){return e.source===n.source&&e.global===n.global&&e.ignoreCase===n.ignoreCase&&e.multiline===n.multiline&&e.unicode===n.unicode&&e.sticky===n.sticky&&e.lastIndex===n.lastIndex}function AG(e,n,r,i){var s=e.size===n.size;if(s&&e.size){var o={};e.forEach(function(a){if(s){var l=!1,u=0;n.forEach(function(h){!l&&!o[u]&&(l=r(a,h,i),l&&(o[u]=!0)),u++}),s=l}})}return s}var RG=typeof Map=="function",kG=typeof Set=="function";function Mw(e){var n=typeof e=="function"?e(r):r;function r(i,s,o){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(OP(i)&&OP(s))return PP(i,s,n,o);var a=Array.isArray(i),l=Array.isArray(s);return a||l?a===l&&IG(i,s,n,o):(a=i instanceof Date,l=s instanceof Date,a||l?a===l&&HI(i.getTime(),s.getTime()):(a=i instanceof RegExp,l=s instanceof RegExp,a||l?a===l&&PG(i,s):TP(i)||TP(s)?i===s:RG&&(a=i instanceof Map,l=s instanceof Map,a||l)?a===l&&OG(i,s,n,o):kG&&(a=i instanceof Set,l=s instanceof Set,a||l)?a===l&&AG(i,s,n,o):PP(i,s,n,o)))}return i!==i&&s!==s}return r}Mw();var Bu=Mw(function(){return HI});Mw(U8());Mw(U8(HI));var LG=Object.defineProperty,jG=Object.getOwnPropertyDescriptor,bl=(e,n,r,i)=>{for(var s=i>1?void 0:i?jG(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&LG(n,r,s),s},AP=(e,n)=>(r,i)=>n(r,i,e);function gc(e){return on.create(()=>e.unsubscribe())}var Pw=()=>{const e=new Map,n=(i,s)=>{if(e.has(i))return e.get(i);const o=s();return e.set(i,o),o},r=i=>{i?e.delete(i):e.clear()};return n.clear=r,n},K8=class{constructor(e){this.parentTable=e,this.table=new Map,this.onDataChangeEmitter=new qe,this.variables$=new td,this.anyVariableChange$=this.variables$.pipe(BI(n=>B8(...n.map(r=>r.value$.pipe(VI(1))))),Yb()),this.onDataChange=this.onDataChangeEmitter.event,this._version=0}onAnyVariableChange(e){return gc(this.anyVariableChange$.subscribe(e))}onAnyChange(e){const n=new jt;return n.pushAll([this.onDataChange(e),this.onAnyVariableChange(e)]),n}fireChange(){var e;this._version++,this.onDataChangeEmitter.fire(),(e=this.parentTable)==null||e.fireChange()}get version(){return this._version}get variables(){return Array.from(this.table.values())}get variableKeys(){return Array.from(this.table.keys())}getByKeyPath(e){const[n,...r]=e||[];if(!n)return;const i=this.getVariableByKey(n);return r.length?i==null?void 0:i.getByKeyPath(r):i}getVariableByKey(e){return this.table.get(e)}addVariableToTable(e){this.table.set(e.key,e),this.parentTable&&this.parentTable.addVariableToTable(e),this.variables$.next(this.variables)}removeVariableFromTable(e){this.table.delete(e),this.parentTable&&this.parentTable.removeVariableFromTable(e),this.variables$.next(this.variables)}dispose(){this.variableKeys.forEach(e=>{var n;return(n=this.parentTable)==null?void 0:n.removeVariableFromTable(e)}),this.onDataChangeEmitter.dispose()}},W8=Symbol("DynamicVariableEngine"),q8=Symbol("ContainerProvider"),Hu=class{constructor(){this.toDispose=new jt}get variableEngine(){return this.variableEngineProvider()}refreshAllChange(){this.variableEngine.getAllScopes().forEach(e=>{e.refreshCovers(),e.refreshDeps()})}dispose(){this.toDispose.dispose()}get disposed(){return this.toDispose.disposed}get onDispose(){return this.toDispose.onDispose}};bl([oe(W8)],Hu.prototype,"variableEngineProvider",2);Hu=bl([$e()],Hu);var RP=Symbol("post_construct_ast"),qm;(e=>{e.isString=r=>(r==null?void 0:r.kind)==="String",e.isNumber=r=>(r==null?void 0:r.kind)==="Number",e.isBoolean=r=>(r==null?void 0:r.kind)==="Boolean",e.isInteger=r=>(r==null?void 0:r.kind)==="Integer",e.isObject=r=>(r==null?void 0:r.kind)==="Object",e.isArray=r=>(r==null?void 0:r.kind)==="Array",e.isMap=r=>(r==null?void 0:r.kind)==="Map",e.isCustomType=r=>(r==null?void 0:r.kind)==="CustomType",e.isVariableDeclaration=r=>(r==null?void 0:r.kind)==="VariableDeclaration",e.isProperty=r=>(r==null?void 0:r.kind)==="Property",e.isVariableDeclarationList=r=>(r==null?void 0:r.kind)==="VariableDeclarationList",e.isEnumerateExpression=r=>(r==null?void 0:r.kind)==="EnumerateExpression",e.isKeyPathExpression=r=>(r==null?void 0:r.kind)==="KeyPathExpression";function n(r,i){return(r==null?void 0:r.kind)===(i==null?void 0:i.kind)}e.is=n})(qm||(qm={}));function G8({getChildNode:e,updateChildNode:n,removeChildNode:r,nextJSON:i}){const s=e(),o=(s==null?void 0:s.kind)!==(i==null?void 0:i.kind),a=(i==null?void 0:i.key)&&(i==null?void 0:i.key)!==(s==null?void 0:s.key);if(o||a)if(s&&(s.dispose(),r()),i){const l=this.createChildNode(i);return n(l),this.fireChange(),l}else this.fireChange();else i&&(s==null||s.fromJSON(i));return s}function Au(e){return typeof e=="string"?{kind:e}:e}function Y8(e){return[...e.children,...e.children.map(n=>Y8(n)).flat()]}var nd=class X8{constructor({key:n,parent:r,scope:i},s){this.flags=0,this._version=0,this.changeLocked=!1,this._batch={batching:!1,hasChangesInBatch:!1},this.value$=new $q(this),this._children=new Set,this.toDispose=new jt(on.create(()=>{var o;(o=this.parent)==null||o.fireChange(),this.children.forEach(a=>a.dispose())})),this.onDispose=this.toDispose.onDispose,this.scope=i,this.parent=r,this.opts=s,this.key=n||Wi(),this.fromJSON=this.withBatchUpdate(this.fromJSON.bind(this)),this.dispatchGlobalEvent({type:"NewAST"})}get kind(){if(!this.constructor.kind)throw new Error(`ASTNode Registry need a kind: ${this.constructor.name}`);return this.constructor.kind}get children(){return Array.from(this._children)}toJSON(){return console.warn("[VariableEngine] Please Implement toJSON method for "+this.kind),{kind:this.kind}}createChildNode(n){const i=this.scope.variableEngine.astRegisters.createAST(n,{parent:this,scope:this.scope});return this._children.add(i),i.toDispose.push(on.create(()=>{this._children.delete(i)})),i}updateChildNodeByKey(n,r){this.withBatchUpdate(G8).call(this,{getChildNode:()=>this[n],updateChildNode:i=>this[n]=i,removeChildNode:()=>this[n]=void 0,nextJSON:r})}withBatchUpdate(n){return(...r)=>{if(this._batch.batching)return n.call(this,...r);this._batch.hasChangesInBatch=!1,this._batch.batching=!0;const i=n.call(this,...r);return this._batch.batching=!1,this._batch.hasChangesInBatch&&this.fireChange(),this._batch.hasChangesInBatch=!1,i}}fireChange(){var n;if(!(this.changeLocked||this.disposed)){if(this._batch.batching){this._batch.hasChangesInBatch=!0;return}this._version++,this.value$.next(this),this.dispatchGlobalEvent({type:"UpdateAST"}),(n=this.parent)==null||n.fireChange()}}get version(){return this._version}get hash(){return`${this._version}${this.kind}${this.key}`}subscribe(n,{selector:r,debounceAnimation:i,triggerOnInit:s}={}){return gc(this.value$.pipe(Kv(()=>r?r(this):this),zI((o,a)=>Bu(o,a),o=>o instanceof X8?o.hash:o),s?NP(()=>null):VI(1),i?EG(0,Kq):NP(()=>null)).subscribe(n))}dispatchGlobalEvent(n){this.scope.event.dispatch({...n,ast:this})}dispose(){this.toDispose.disposed||(this.toDispose.dispose(),this.dispatchGlobalEvent({type:"DisposeAST"}),this.value$.complete(),this.value$.unsubscribe())}get disposed(){return this.toDispose.disposed}},rd=class extends nd{constructor(){super(...arguments),this.flags=8}isTypeEqual(e){var r;const n=Au(e);return(n==null?void 0:n.kind)==="Union"?(r=(n==null?void 0:n.types)||[])==null?void 0:r.some(i=>this.isTypeEqual(i)):this.kind===(n==null?void 0:n.kind)}getByKeyPath(e=[]){throw new Error(`Get By Key Path is not implemented for Type: ${this.kind}`)}toJSON(){return{kind:this.kind}}},Z8=class extends rd{constructor(){super(...arguments),this.flags=48}fromJSON({items:e}){this.updateChildNodeByKey("items",Au(e))}get canDrilldownItems(){var e;return!!(((e=this.items)==null?void 0:e.flags)&16)}getByKeyPath(e){const[n,...r]=e||[];if(n==="0"&&this.canDrilldownItems)return this.items.getByKeyPath(r)}isTypeEqual(e){const n=Au(e),r=super.isTypeEqual(e);return n!=null&&n.weak||(n==null?void 0:n.kind)==="Union"?r:n&&r&&((n==null?void 0:n.weak)||this.customStrongEqual(n))}customStrongEqual(e){var n;return this.items?(n=this.items)==null?void 0:n.isTypeEqual(e.items):!(e!=null&&e.items)}toJSON(){var e;return{kind:"Array",items:(e=this.items)==null?void 0:e.toJSON()}}};Z8.kind="Array";var Q8=class extends rd{constructor(){super(...arguments),this.flags=8}fromJSON(){}};Q8.kind="String";var J8=class extends rd{constructor(){super(...arguments),this.flags=8}fromJSON(){}};J8.kind="Integer";var e9=class extends rd{fromJSON(){}};e9.kind="Boolean";var t9=class extends rd{fromJSON(){}};t9.kind="Number";var n9=class extends rd{fromJSON({keyType:e="String",valueType:n}){this.updateChildNodeByKey("keyType",Au(e)),this.updateChildNodeByKey("valueType",Au(n))}isTypeEqual(e){const n=Au(e),r=super.isTypeEqual(e);return n!=null&&n.weak||(n==null?void 0:n.kind)==="Union"?r:n&&r&&((n==null?void 0:n.weak)||this.customStrongEqual(n))}customStrongEqual(e){var s,o;const{keyType:n="String",valueType:r}=e;return(!r&&!this.valueType||((s=this.valueType)==null?void 0:s.isTypeEqual(r)))&&((o=this.keyType)==null?void 0:o.isTypeEqual(n))}toJSON(){var e,n;return{kind:"Map",keyType:(e=this.keyType)==null?void 0:e.toJSON(),valueType:(n=this.valueType)==null?void 0:n.toJSON()}}};n9.kind="Map";var r9=class extends rd{constructor(){super(...arguments),this.flags=16,this.propertyTable=new Map}fromJSON({properties:e}){const n=new Set(this.propertyTable.keys()),r=[...this.properties||[]];this.properties=(e||[]).map(i=>{const s=this.propertyTable.get(i.key);if(n.delete(i.key),s)return s.fromJSON(i),s;{const o=this.createChildNode({...i,kind:"Property"});return this.fireChange(),this.propertyTable.set(i.key,o),o}}),n.forEach(i=>{const s=this.propertyTable.get(i);s==null||s.dispose(),this.propertyTable.delete(i),this.fireChange()}),this.dispatchGlobalEvent({type:"ObjectPropertiesChange",payload:{prev:r,next:[...this.properties]}})}toJSON(){return{kind:"Object",properties:this.properties.map(e=>e.toJSON())}}getByKeyPath(e){var s;const[n,...r]=e,i=this.propertyTable.get(n);if(!r.length)return i;if(i!=null&&i.type&&((s=i==null?void 0:i.type)==null?void 0:s.flags)&16)return i.type.getByKeyPath(r)}isTypeEqual(e){const n=Au(e),r=super.isTypeEqual(e);return n!=null&&n.weak||(n==null?void 0:n.kind)==="Union"?r:n&&r&&((n==null?void 0:n.weak)||this.customStrongEqual(n))}customStrongEqual(e){const n=e.properties||[],r=Array.from(this.propertyTable.keys()),i=n.map(o=>o.key);return!je.xor(r,i).length&&n.every(o=>{var l;const a=this.propertyTable.get(o.key);return a&&a.key===o.key&&((l=a.type)==null?void 0:l.isTypeEqual(o==null?void 0:o.type))})}};r9.kind="Object";var i9=class extends rd{get typeName(){return this._typeName}fromJSON(e){this._typeName!==e.typeName&&(this._typeName=e.typeName,this.fireChange())}isTypeEqual(e){var r;const n=Au(e);return(n==null?void 0:n.kind)==="Union"?(r=(n==null?void 0:n.types)||[])==null?void 0:r.some(i=>this.isTypeEqual(i)):(n==null?void 0:n.kind)===this.kind&&(n==null?void 0:n.typeName)===this.typeName}};i9.kind="CustomType";function UI(e){let n=e.parent;const r=[];for(;n;)n.flags&1&&r.push(n),n=n.parent;return r}var KI=class extends nd{constructor(e,n){super(e,n),this.flags=4,this._refs=[],this.refreshRefs$=new td,this.refs$=this.refreshRefs$.pipe(Kv(()=>this.getRefFields()),zI(Bu),BI(r=>r!=null&&r.length?bG(r.map(i=>i?i.value$:SP(void 0))):SP([])),Yb()),this.toDispose.push(gc(this.refs$.subscribe(r=>{this._refs=r,this.fireChange()})))}get globalVariableTable(){return this.scope.variableEngine.globalVariableTable}get parentFields(){return UI(this)}get refs(){return this._refs}refreshRefs(){this.refreshRefs$.next()}},s9=class extends nd{fromJSON({expressions:e}){this.expressions=e.map((n,r)=>{const i=this.expressions[r];return i.kind!==n.kind?(i.dispose(),this.fireChange(),this.createChildNode(n)):(i.fromJSON(n),i)})}toJSON(){return{kind:"ExpressionList",properties:this.expressions.map(e=>e.toJSON())}}};s9.kind="ExpressionList";var o9=class extends KI{constructor(e,n){super(e,n),this._keyPath=[],this.toDispose.pushAll([this.scope.available.onVariableListChange(()=>{this.refreshRefs()}),this.scope.available.onAnyVariableChange(r=>{r.key===this._keyPath[0]&&this.refreshRefs()})])}get keyPath(){return this._keyPath}getRefFields(){const e=this.scope.available.getByKeyPath(this._keyPath);return e?[e]:[]}get returnType(){const[e]=this._refs||[];if(e&&e.flags&1)return e.type}parseToKeyPath(e){return e.keyPath}fromJSON(e){const n=this.parseToKeyPath(e);Bu(n,this._keyPath)||(this._keyPath=n,this.refreshRefs())}toJSON(){return{kind:"KeyPathExpression",keyPath:this._keyPath}}};o9.kind="KeyPathExpression";var a9=class extends KI{get enumerateFor(){return this._enumerateFor}get returnType(){var n;const e=(n=this.enumerateFor)==null?void 0:n.returnType;if((e==null?void 0:e.kind)==="Array")return e.items}getRefFields(){return[]}fromJSON({enumerateFor:e}){this.updateChildNodeByKey("_enumerateFor",e)}toJSON(){var e;return{kind:"EnumerateExpression",enumerateFor:(e=this.enumerateFor)==null?void 0:e.toJSON()}}};a9.kind="EnumerateExpression";function FG(e){return Y8(e).filter(n=>n.flags&4).map(n=>n.refs).flat().filter(Boolean)}function $G(e,n){if(je.intersection(e.scope.coverScopes,n.map(s=>s==null?void 0:s.scope).filter(Boolean)).length===0)return!1;const r=new Set,i=[...n];for(;i.length;){const s=i.shift();r.add(s);for(const o of FG(s).filter(a=>!r.has(a)))i.push(o)}return je.intersection(Array.from(r),UI(e)).length>0}var zG=class extends KI{constructor(e,n){super(e,n),this._keyPath=[],this.toDispose.pushAll([this.scope.available.onVariableListChange(()=>{this.refreshRefs()}),this.scope.available.onAnyVariableChange(r=>{r.key===this._keyPath[0]&&this.refreshRefs()}),gc(this.refs$.subscribe(r=>{var s,o;const[i]=this._refs;this.prevRefTypeHash!==((s=i==null?void 0:i.type)==null?void 0:s.hash)&&(this.prevRefTypeHash=(o=i==null?void 0:i.type)==null?void 0:o.hash,this.updateChildNodeByKey("_returnType",this.getReturnTypeJSONByRef(i)))}))])}get keyPath(){return this._keyPath}getRefFields(){const e=this.scope.available.getByKeyPath(this._keyPath);return $G(this,[e])?(console.warn("[CustomKeyPathExpression] checkRefCycle: Reference Cycle Existed",this.parentFields.map(n=>n.key).reverse()),[]):e?[e]:[]}get returnType(){return this._returnType}parseToKeyPath(e){return e.keyPath}fromJSON(e){const n=this.parseToKeyPath(e);Bu(n,this._keyPath)||(this._keyPath=n,this.refreshRefs())}getReturnTypeJSONByRef(e){var n;return(n=e==null?void 0:e.type)==null?void 0:n.toJSON()}toJSON(){return{kind:"KeyPathExpression",keyPath:this._keyPath}}};zG.kind="KeyPathExpression";var l9=class extends nd{constructor(){super(...arguments),this.flags=1,this._meta={}}get parentFields(){return UI(this)}get meta(){return this._meta}get type(){var e;return((e=this._initializer)==null?void 0:e.returnType)||this._type}get initializer(){return this._initializer}fromJSON({type:e,initializer:n,meta:r}){this.updateType(e),this.updateInitializer(n),this.updateMeta(r)}updateType(e){const n=typeof e=="string"?{kind:e}:e;this.updateChildNodeByKey("_type",n)}updateInitializer(e){this.updateChildNodeByKey("_initializer",e)}updateMeta(e){Bu(e,this._meta)||(this._meta=e,this.fireChange())}getByKeyPath(e){var n;if(((n=this.type)==null?void 0:n.flags)&16)return this.type.getByKeyPath(e)}onTypeChange(e){return this.subscribe(e,{selector:n=>n.type})}toJSON(){var e,n;return{kind:this.kind,key:this.key,type:(e=this.type)==null?void 0:e.toJSON(),initializer:(n=this.initializer)==null?void 0:n.toJSON(),meta:this._meta}}},c9=class extends l9{constructor(e){super(e),this._order=0}get order(){return this._order}fromJSON({order:e,...n}){this.updateOrder(e),super.fromJSON(n)}updateOrder(e=0){e!==this._order&&(this._order=e,this.dispatchGlobalEvent({type:"ReSortVariableDeclarations"}),this.fireChange())}onTypeChange(e){return this.subscribe(e,{selector:n=>n.type})}};c9.kind="VariableDeclaration";var u9=class extends nd{constructor(){super(...arguments),this.declarationTable=new Map}fromJSON({declarations:e,startOrder:n}){const r=new Set(this.declarationTable.keys()),i=[...this.declarations||[]];this.declarations=(e||[]).map((s,o)=>{var h,p;const a=(n||0)+o,l=s.key||((p=(h=this.declarations)==null?void 0:h[o])==null?void 0:p.key),u=this.declarationTable.get(l);if(l&&r.delete(l),u)return u.fromJSON({order:a,...s}),u;{const g=this.createChildNode({order:a,...s,kind:"VariableDeclaration"});return this.fireChange(),this.declarationTable.set(g.key,g),g}}),r.forEach(s=>{const o=this.declarationTable.get(s);o==null||o.dispose(),this.declarationTable.delete(s)}),this.dispatchGlobalEvent({type:"VariableListChange",payload:{prev:i,next:[...this.declarations]}})}toJSON(){return{kind:"VariableDeclarationList",properties:this.declarations.map(e=>e.toJSON())}}};u9.kind="VariableDeclarationList";var d9=class extends l9{};d9.kind="Property";var h9=class extends nd{get data(){return this._data}fromJSON(e){const{kind:n,...r}=e;Bu(r,this._data)||(this._data=r,this.fireChange())}toJSON(){return{kind:"DataNode",...this._data}}partialUpdate(e){Bu(e,this._data)||(this._data={...this._data,...e},this.fireChange())}};h9.kind="DataNode";var VG=class extends nd{get list(){return this._list}fromJSON({list:e}){this._list.slice(e.length).forEach(n=>{n.dispose(),this.fireChange()}),this._list=e.map((n,r)=>{const i=this._list[r];return i.kind!==n.kind?(i.dispose(),this.fireChange(),this.createChildNode(n)):(i.fromJSON(n),i)})}toJSON(){return{kind:"ListNode",list:this._list.map(e=>e.toJSON())}}};VG.kind="ListNode";var f9=class extends nd{constructor(){super(...arguments),this.map=new Map}fromJSON({map:e}){const n=new Set(this.map.keys());for(const[r,i]of e||[])n.delete(r),this.set(r,i);for(const r of Array.from(n))this.remove(r)}toJSON(){return{kind:"MapNode",map:Array.from(this.map.entries())}}set(e,n){return this.withBatchUpdate(G8).call(this,{getChildNode:()=>this.get(e),removeChildNode:()=>this.map.delete(e),updateChildNode:r=>this.map.set(e,r),nextJSON:n})}remove(e){var n;(n=this.get(e))==null||n.dispose(),this.map.delete(e),this.fireChange()}get(e){return this.map.get(e)}};f9.kind="MapNode";var av=class{constructor(){this.injectors=new Map,this.astMap=new Map,this.registerAST(Q8),this.registerAST(t9),this.registerAST(e9),this.registerAST(J8),this.registerAST(r9),this.registerAST(Z8),this.registerAST(n9),this.registerAST(i9),this.registerAST(d9),this.registerAST(c9),this.registerAST(u9),this.registerAST(o9),this.registerAST(a9),this.registerAST(s9),this.registerAST(f9),this.registerAST(h9)}createAST(e,{parent:n,scope:r}){var a;const i=this.astMap.get(e.kind);if(!i)throw Error(`ASTKind: ${String(e.kind)} can not find its ASTNode Registry`);const s=this.injectors.get(e.kind),o=new i({key:e.key,scope:r,parent:n},(s==null?void 0:s())||{});if(o.changeLocked=!0,o.fromJSON(je.omit(e,["key","kind"])),o.changeLocked=!1,Reflect.hasMetadata(RP,o)){const l=Reflect.getMetadata(RP,o);(a=o[l])==null||a.call(o)}return o}getASTRegistryByKind(e){return this.astMap.get(e)}registerAST(e,n){this.astMap.set(e.kind,e),n&&this.injectors.set(e.kind,n)}};av=bl([$e()],av);var Ka;(e=>{e.createString=()=>({kind:"String"}),e.createNumber=()=>({kind:"Number"}),e.createBoolean=()=>({kind:"Boolean"}),e.createInteger=()=>({kind:"Integer"}),e.createObject=n=>({kind:"Object",...n}),e.createArray=n=>({kind:"Array",...n}),e.createMap=n=>({kind:"Map",...n}),e.createUnion=n=>({kind:"Union",...n}),e.createCustomType=n=>({kind:"CustomType",...n}),e.createVariableDeclaration=n=>({kind:"VariableDeclaration",...n}),e.createProperty=n=>({kind:"Property",...n}),e.createVariableDeclarationList=n=>({kind:"VariableDeclarationList",...n}),e.createEnumerateExpression=n=>({kind:"EnumerateExpression",...n}),e.createKeyPathExpression=n=>({kind:"KeyPathExpression",...n}),e.create=(n,r)=>({kind:n.kind,...r})})(Ka||(Ka={}));var BG=class{constructor(e){this.scope=e,this.memo=Pw(),this._hasChanges=!1,this.variableTable=new K8(e.variableEngine.globalVariableTable),this.scope.toDispose.pushAll([this.scope.ast.subscribe(()=>{this._hasChanges&&(this.memo.clear(),this.notifyCoversChange(),this.variableTable.fireChange(),this._hasChanges=!1)}),this.scope.event.on("DisposeAST",n=>{var r;((r=n.ast)==null?void 0:r.kind)==="VariableDeclaration"&&this.removeVariableFromTable(n.ast.key)}),this.scope.event.on("NewAST",n=>{var r;((r=n.ast)==null?void 0:r.kind)==="VariableDeclaration"&&this.addVariableToTable(n.ast)}),this.scope.event.on("ReSortVariableDeclarations",()=>{this._hasChanges=!0}),this.variableTable])}get variableEngine(){return this.scope.variableEngine}get globalVariableTable(){return this.scope.variableEngine.globalVariableTable}get onDataChange(){return this.variableTable.onDataChange.bind(this.variableTable)}get onAnyVariableChange(){return this.variableTable.onAnyVariableChange.bind(this.variableTable)}get variables(){return this.memo("variables",()=>this.variableTable.variables.sort((e,n)=>e.order-n.order))}get variableKeys(){return this.memo("variableKeys",()=>this.variableTable.variableKeys)}addVariableToTable(e){if(e.scope!==this.scope)throw Error("VariableDeclaration must be a ast node in scope");this.variableTable.addVariableToTable(e),this._hasChanges=!0}removeVariableFromTable(e){this.variableTable.removeVariableFromTable(e),this._hasChanges=!0}getVariableByKey(e){return this.variableTable.getVariableByKey(e)}notifyCoversChange(){this.scope.coverScopes.forEach(e=>e.available.refresh())}},HG=class{constructor(e){this.scope=e,this.memo=Pw(),this.refresh$=new td,this._variables=[],this.variables$=this.refresh$.pipe(Kv(()=>je.flatten(this.depScopes.map(n=>n.output.variables||[]))),zI(Bu),Yb()),this.anyVariableChange$=this.variables$.pipe(BI(n=>B8(...n.map(r=>r.value$.pipe(VI(1))))),Yb()),this.onDataChangeEmitter=new qe,this.onDataChange=this.onDataChangeEmitter.event,this.scope.toDispose.pushAll([this.onVariableListChange(n=>{this._variables=n,this.memo.clear(),this.onDataChangeEmitter.fire(this._variables)}),this.onAnyVariableChange(()=>{this.onDataChangeEmitter.fire(this._variables)}),on.create(()=>{this.refresh$.complete(),this.refresh$.unsubscribe()})])}get globalVariableTable(){return this.scope.variableEngine.globalVariableTable}refresh(){this.scope.disposed||this.refresh$.next()}onAnyVariableChange(e){return gc(this.anyVariableChange$.subscribe(e))}onVariableListChange(e){return gc(this.variables$.subscribe(e))}get variables(){return this._variables}get variableKeys(){return this.memo("availableKeys",()=>this._variables.map(e=>e.key))}get depScopes(){return this.scope.depScopes}getByKeyPath(e=[]){if(this.variableKeys.includes(e[0]))return this.globalVariableTable.getByKeyPath(e)}},UG=class{constructor(e){this.scope=e,this.event$=new td,e.toDispose.pushAll([this.subscribe(n=>{e.variableEngine.fireGlobalEvent(n)})])}dispatch(e){this.scope.disposed||this.event$.next(e)}subscribe(e){return gc(this.event$.subscribe(e))}on(e,n){return gc(this.event$.pipe(H8(r=>r.type===e)).subscribe(n))}},p9=class{constructor(e){this.memo=Pw(),this.toDispose=new jt,this.onDispose=this.toDispose.onDispose,this.id=e.id,this.meta=e.meta||{},this.variableEngine=e.variableEngine,this.event=new UG(this),this.ast=this.variableEngine.astRegisters.createAST({kind:"MapNode",key:String(this.id)},{scope:this}),this.output=new BG(this),this.available=new HG(this)}refreshCovers(){this.memo.clear("covers")}refreshDeps(){this.memo.clear("deps"),this.available.refresh()}get depScopes(){return this.memo("deps",()=>this.variableEngine.chain.getDeps(this).filter(e=>!!e&&!(e!=null&&e.disposed)))}get coverScopes(){return this.memo("covers",()=>this.variableEngine.chain.getCovers(this).filter(e=>!!e&&!(e!=null&&e.disposed)))}dispose(){this.ast.dispose(),this.toDispose.dispose(),this.coverScopes.forEach(e=>e.refreshDeps()),this.depScopes.forEach(e=>e.refreshCovers())}get disposed(){return this.toDispose.disposed}},pl=class{constructor(e,n){this.chain=e,this.astRegisters=n,this.toDispose=new jt,this.memo=Pw(),this.scopeMap=new Map,this.globalEvent$=new td,this.onScopeChangeEmitter=new qe,this.globalVariableTable=new K8,this.onScopeChange=this.onScopeChangeEmitter.event,this.toDispose.pushAll([e,on.create(()=>{this.getAllScopes().forEach(r=>r.dispose()),this.globalVariableTable.dispose()})])}get container(){return this.containerProvider()}dispose(){this.toDispose.dispose()}getScopeById(e){return this.scopeMap.get(e)}removeScopeById(e){var n;(n=this.getScopeById(e))==null||n.dispose()}createScope(e,n,r={}){const{ScopeConstructor:i=p9}=r;let s=this.getScopeById(e);return s||(s=new i({variableEngine:this,meta:n,id:e}),this.scopeMap.set(e,s),this.onScopeChangeEmitter.fire({type:"add",scope:s}),s.toDispose.pushAll([s.ast.subscribe(()=>{this.onScopeChangeEmitter.fire({type:"update",scope:s})}),s.available.onDataChange(()=>{this.onScopeChangeEmitter.fire({type:"available",scope:s})})]),s.onDispose(()=>{this.scopeMap.delete(e),this.onScopeChangeEmitter.fire({type:"delete",scope:s})})),s}getAllScopes({sort:e}={}){const n=Array.from(this.scopeMap.values());if(e){const r=this.chain.sortAll(),i=new Set(n);return r.forEach(s=>i.delete(s)),[...r,...Array.from(i)]}return[...n]}fireGlobalEvent(e){this.globalEvent$.next(e)}onGlobalEvent(e,n){return gc(this.globalEvent$.subscribe(r=>{r.type===e&&n(r)}))}};bl([oe(q8)],pl.prototype,"containerProvider",2);bl([s6()],pl.prototype,"dispose",1);pl=bl([$e(),AP(0,oe(Hu)),AP(1,oe(av))],pl);var eg=class{constructor(){this.toDispose=new jt,this.renameEmitter=new qe,this.disposeInListEmitter=new qe,this.onRename=this.renameEmitter.event,this.onDisposeInList=this.disposeInListEmitter.event}handleFieldListChange(e,n,r){var o,a;if(!e||!(n!=null&&n.length)||!(r!=null&&r.length)){this.notifyFieldsDispose(n,r);return}if(n.length!==r.length){this.notifyFieldsDispose(n,r);return}let i=null,s=!1;for(const[l,u]of n.entries()){const h=r[l];if(u.key!==h.key){if(s){this.notifyFieldsDispose(n,r);return}s=!0,((o=u.type)==null?void 0:o.kind)===((a=h.type)==null?void 0:a.kind)&&(i={before:u,after:h})}}if(!i){this.notifyFieldsDispose(n,r);return}this.renameEmitter.fire(i)}notifyFieldsDispose(e,n){je.difference(e||[],n||[]).forEach(i=>this.disposeInListEmitter.fire(i))}init(){this.toDispose.pushAll([this.variableEngine.onGlobalEvent("VariableListChange",e=>{var n,r;this.handleFieldListChange(e.ast,(n=e.payload)==null?void 0:n.prev,(r=e.payload)==null?void 0:r.next)}),this.variableEngine.onGlobalEvent("ObjectPropertiesChange",e=>{var n,r;this.handleFieldListChange(e.ast,(n=e.payload)==null?void 0:n.prev,(r=e.payload)==null?void 0:r.next)})])}dispose(){this.toDispose.dispose()}};bl([oe(pl)],eg.prototype,"variableEngine",2);bl([Ai()],eg.prototype,"init",1);bl([s6()],eg.prototype,"dispose",1);eg=bl([$e()],eg);var KG=new Mo(e=>{e(pl).toSelf().inSingletonScope(),e(av).toSelf().inSingletonScope(),e(eg).toSelf().inSingletonScope(),e(W8).toDynamicValue(n=>()=>n.container.get(pl)),e(q8).toDynamicValue(n=>()=>n.container)}),g9=R.createContext(null),WG=g9.Provider,qG=()=>{var e;return(e=R.useContext(g9))==null?void 0:e.scope};function GG(){const e=qG(),n=Cs();return R.useEffect(()=>{const r=e.available.onDataChange(()=>{n()});return()=>r.dispose()},[]),e.available}var YG=Symbol(""),wg=(e=>(e.ADD_NODE="ADD_NODE",e.DELETE_NODE="DELETE_NODE",e.MOVE_NODE="MOVE_NODE",e.NODE_DATA_CHANGE="NODE_DATA_CHANGE",e.ADD_LINE="ADD_LINE",e.DELETE_LINE="DELETE_LINE",e.META_CHANGE="META_CHANGE",e))(wg||{}),WI=(e=>(e[e.BEZIER=0]="BEZIER",e[e.LINE_CHART=1]="LINE_CHART",e))(WI||{}),Aw=Symbol("WorkflowOperationBaseService"),XG=Object.defineProperty,ZG=Object.getOwnPropertyDescriptor,$t=(e,n,r,i)=>{for(var s=i>1?void 0:i?ZG(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&XG(n,r,s),s},y9=typeof global=="object"&&global&&global.Object===Object&&global,QG=typeof self=="object"&&self&&self.Object===Object&&self,wl=y9||QG||Function("return this")(),Uu=wl.Symbol,m9=Object.prototype,JG=m9.hasOwnProperty,eY=m9.toString,gm=Uu?Uu.toStringTag:void 0;function tY(e){var n=JG.call(e,gm),r=e[gm];try{e[gm]=void 0;var i=!0}catch{}var s=eY.call(e);return i&&(n?e[gm]=r:delete e[gm]),s}var nY=Object.prototype,rY=nY.toString;function iY(e){return rY.call(e)}var sY="[object Null]",oY="[object Undefined]",kP=Uu?Uu.toStringTag:void 0;function _g(e){return e==null?e===void 0?oY:sY:kP&&kP in Object(e)?tY(e):iY(e)}function tg(e){return e!=null&&typeof e=="object"}var aY="[object Symbol]";function Rw(e){return typeof e=="symbol"||tg(e)&&_g(e)==aY}function lY(e,n){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=n(e[r],r,e);return s}var Th=Array.isArray,LP=Uu?Uu.prototype:void 0,jP=LP?LP.toString:void 0;function v9(e){if(typeof e=="string")return e;if(Th(e))return lY(e,v9)+"";if(Rw(e))return jP?jP.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}var cY=/\s/;function uY(e){for(var n=e.length;n--&&cY.test(e.charAt(n)););return n}var dY=/^\s+/;function hY(e){return e&&e.slice(0,uY(e)+1).replace(dY,"")}function lv(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var FP=NaN,fY=/^[-+]0x[0-9a-f]+$/i,pY=/^0b[01]+$/i,gY=/^0o[0-7]+$/i,yY=parseInt;function $P(e){if(typeof e=="number")return e;if(Rw(e))return FP;if(lv(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=lv(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=hY(e);var r=pY.test(e);return r||gY.test(e)?yY(e.slice(2),r?2:8):fY.test(e)?FP:+e}var mY="[object AsyncFunction]",vY="[object Function]",bY="[object GeneratorFunction]",wY="[object Proxy]";function b9(e){if(!lv(e))return!1;var n=_g(e);return n==vY||n==bY||n==mY||n==wY}var YC=wl["__core-js_shared__"],zP=function(){var e=/[^.]+$/.exec(YC&&YC.keys&&YC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _Y(e){return!!zP&&zP in e}var CY=Function.prototype,EY=CY.toString;function zh(e){if(e!=null){try{return EY.call(e)}catch{}try{return e+""}catch{}}return""}var xY=/[\\^$.*+?()[\]{}|]/g,SY=/^\[object .+?Constructor\]$/,DY=Function.prototype,NY=Object.prototype,IY=DY.toString,OY=NY.hasOwnProperty,TY=RegExp("^"+IY.call(OY).replace(xY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MY(e){if(!lv(e)||_Y(e))return!1;var n=b9(e)?TY:SY;return n.test(zh(e))}function PY(e,n){return e==null?void 0:e[n]}function Cg(e,n){var r=PY(e,n);return MY(r)?r:void 0}var mN=Cg(wl,"WeakMap"),AY=9007199254740991,RY=/^(?:0|[1-9]\d*)$/;function kY(e,n){var r=typeof e;return n=n??AY,!!n&&(r=="number"||r!="symbol"&&RY.test(e))&&e>-1&&e%1==0&&e<n}function w9(e,n){return e===n||e!==e&&n!==n}var LY=9007199254740991;function _9(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=LY}function jY(e){return e!=null&&_9(e.length)&&!b9(e)}var FY=Object.prototype;function $Y(e){var n=e&&e.constructor,r=typeof n=="function"&&n.prototype||FY;return e===r}function zY(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}var VY="[object Arguments]";function VP(e){return tg(e)&&_g(e)==VY}var C9=Object.prototype,BY=C9.hasOwnProperty,HY=C9.propertyIsEnumerable,UY=VP(function(){return arguments}())?VP:function(e){return tg(e)&&BY.call(e,"callee")&&!HY.call(e,"callee")};function KY(){return!1}var E9=typeof uc=="object"&&uc&&!uc.nodeType&&uc,BP=E9&&typeof dc=="object"&&dc&&!dc.nodeType&&dc,WY=BP&&BP.exports===E9,HP=WY?wl.Buffer:void 0,qY=HP?HP.isBuffer:void 0,vN=qY||KY,GY="[object Arguments]",YY="[object Array]",XY="[object Boolean]",ZY="[object Date]",QY="[object Error]",JY="[object Function]",eX="[object Map]",tX="[object Number]",nX="[object Object]",rX="[object RegExp]",iX="[object Set]",sX="[object String]",oX="[object WeakMap]",aX="[object ArrayBuffer]",lX="[object DataView]",cX="[object Float32Array]",uX="[object Float64Array]",dX="[object Int8Array]",hX="[object Int16Array]",fX="[object Int32Array]",pX="[object Uint8Array]",gX="[object Uint8ClampedArray]",yX="[object Uint16Array]",mX="[object Uint32Array]",Qn={};Qn[cX]=Qn[uX]=Qn[dX]=Qn[hX]=Qn[fX]=Qn[pX]=Qn[gX]=Qn[yX]=Qn[mX]=!0;Qn[GY]=Qn[YY]=Qn[aX]=Qn[XY]=Qn[lX]=Qn[ZY]=Qn[QY]=Qn[JY]=Qn[eX]=Qn[tX]=Qn[nX]=Qn[rX]=Qn[iX]=Qn[sX]=Qn[oX]=!1;function vX(e){return tg(e)&&_9(e.length)&&!!Qn[_g(e)]}function bX(e){return function(n){return e(n)}}var x9=typeof uc=="object"&&uc&&!uc.nodeType&&uc,Gm=x9&&typeof dc=="object"&&dc&&!dc.nodeType&&dc,wX=Gm&&Gm.exports===x9,XC=wX&&y9.process,UP=function(){try{var e=Gm&&Gm.require&&Gm.require("util").types;return e||XC&&XC.binding&&XC.binding("util")}catch{}}(),KP=UP&&UP.isTypedArray,S9=KP?bX(KP):vX,_X=Object.prototype,CX=_X.hasOwnProperty;function EX(e,n){var r=Th(e),i=!r&&UY(e),s=!r&&!i&&vN(e),o=!r&&!i&&!s&&S9(e),a=r||i||s||o,l=a?zY(e.length,String):[],u=l.length;for(var h in e)CX.call(e,h)&&!(a&&(h=="length"||s&&(h=="offset"||h=="parent")||o&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||kY(h,u)))&&l.push(h);return l}function xX(e,n){return function(r){return e(n(r))}}var SX=xX(Object.keys,Object),DX=Object.prototype,NX=DX.hasOwnProperty;function IX(e){if(!$Y(e))return SX(e);var n=[];for(var r in Object(e))NX.call(e,r)&&r!="constructor"&&n.push(r);return n}function OX(e){return jY(e)?EX(e):IX(e)}var TX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MX=/^\w*$/;function PX(e,n){if(Th(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Rw(e)?!0:MX.test(e)||!TX.test(e)||n!=null&&e in Object(n)}var cv=Cg(Object,"create");function AX(){this.__data__=cv?cv(null):{},this.size=0}function RX(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var kX="__lodash_hash_undefined__",LX=Object.prototype,jX=LX.hasOwnProperty;function FX(e){var n=this.__data__;if(cv){var r=n[e];return r===kX?void 0:r}return jX.call(n,e)?n[e]:void 0}var $X=Object.prototype,zX=$X.hasOwnProperty;function VX(e){var n=this.__data__;return cv?n[e]!==void 0:zX.call(n,e)}var BX="__lodash_hash_undefined__";function HX(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=cv&&n===void 0?BX:n,this}function Mh(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var i=e[n];this.set(i[0],i[1])}}Mh.prototype.clear=AX;Mh.prototype.delete=RX;Mh.prototype.get=FX;Mh.prototype.has=VX;Mh.prototype.set=HX;function UX(){this.__data__=[],this.size=0}function kw(e,n){for(var r=e.length;r--;)if(w9(e[r][0],n))return r;return-1}var KX=Array.prototype,WX=KX.splice;function qX(e){var n=this.__data__,r=kw(n,e);if(r<0)return!1;var i=n.length-1;return r==i?n.pop():WX.call(n,r,1),--this.size,!0}function GX(e){var n=this.__data__,r=kw(n,e);return r<0?void 0:n[r][1]}function YX(e){return kw(this.__data__,e)>-1}function XX(e,n){var r=this.__data__,i=kw(r,e);return i<0?(++this.size,r.push([e,n])):r[i][1]=n,this}function Cc(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var i=e[n];this.set(i[0],i[1])}}Cc.prototype.clear=UX;Cc.prototype.delete=qX;Cc.prototype.get=GX;Cc.prototype.has=YX;Cc.prototype.set=XX;var uv=Cg(wl,"Map");function ZX(){this.size=0,this.__data__={hash:new Mh,map:new(uv||Cc),string:new Mh}}function QX(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Lw(e,n){var r=e.__data__;return QX(n)?r[typeof n=="string"?"string":"hash"]:r.map}function JX(e){var n=Lw(this,e).delete(e);return this.size-=n?1:0,n}function eZ(e){return Lw(this,e).get(e)}function tZ(e){return Lw(this,e).has(e)}function nZ(e,n){var r=Lw(this,e),i=r.size;return r.set(e,n),this.size+=r.size==i?0:1,this}function Ec(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var i=e[n];this.set(i[0],i[1])}}Ec.prototype.clear=ZX;Ec.prototype.delete=JX;Ec.prototype.get=eZ;Ec.prototype.has=tZ;Ec.prototype.set=nZ;var rZ="Expected a function";function qI(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(rZ);var r=function(){var i=arguments,s=n?n.apply(this,i):i[0],o=r.cache;if(o.has(s))return o.get(s);var a=e.apply(this,i);return r.cache=o.set(s,a)||o,a};return r.cache=new(qI.Cache||Ec),r}qI.Cache=Ec;var iZ=500;function sZ(e){var n=qI(e,function(i){return r.size===iZ&&r.clear(),i}),r=n.cache;return n}var oZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aZ=/\\(\\)?/g,lZ=sZ(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(oZ,function(r,i,s,o){n.push(s?o.replace(aZ,"$1"):i||r)}),n});function cZ(e){return e==null?"":v9(e)}function uZ(e,n){return Th(e)?e:PX(e,n)?[e]:lZ(cZ(e))}function dZ(e){if(typeof e=="string"||Rw(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function hZ(e,n){n=uZ(n,e);for(var r=0,i=n.length;e!=null&&r<i;)e=e[dZ(n[r++])];return r&&r==i?e:void 0}function WP(e,n,r){var i=e==null?void 0:hZ(e,n);return i===void 0?r:i}function fZ(e,n){for(var r=-1,i=n.length,s=e.length;++r<i;)e[s+r]=n[r];return e}function pZ(){this.__data__=new Cc,this.size=0}function gZ(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}function yZ(e){return this.__data__.get(e)}function mZ(e){return this.__data__.has(e)}var vZ=200;function bZ(e,n){var r=this.__data__;if(r instanceof Cc){var i=r.__data__;if(!uv||i.length<vZ-1)return i.push([e,n]),this.size=++r.size,this;r=this.__data__=new Ec(i)}return r.set(e,n),this.size=r.size,this}function Ru(e){var n=this.__data__=new Cc(e);this.size=n.size}Ru.prototype.clear=pZ;Ru.prototype.delete=gZ;Ru.prototype.get=yZ;Ru.prototype.has=mZ;Ru.prototype.set=bZ;function wZ(e,n){for(var r=-1,i=e==null?0:e.length,s=0,o=[];++r<i;){var a=e[r];n(a,r,e)&&(o[s++]=a)}return o}function _Z(){return[]}var CZ=Object.prototype,EZ=CZ.propertyIsEnumerable,qP=Object.getOwnPropertySymbols,xZ=qP?function(e){return e==null?[]:(e=Object(e),wZ(qP(e),function(n){return EZ.call(e,n)}))}:_Z;function SZ(e,n,r){var i=n(e);return Th(e)?i:fZ(i,r(e))}function GP(e){return SZ(e,OX,xZ)}var bN=Cg(wl,"DataView"),wN=Cg(wl,"Promise"),_N=Cg(wl,"Set"),YP="[object Map]",DZ="[object Object]",XP="[object Promise]",ZP="[object Set]",QP="[object WeakMap]",JP="[object DataView]",NZ=zh(bN),IZ=zh(uv),OZ=zh(wN),TZ=zh(_N),MZ=zh(mN),vu=_g;(bN&&vu(new bN(new ArrayBuffer(1)))!=JP||uv&&vu(new uv)!=YP||wN&&vu(wN.resolve())!=XP||_N&&vu(new _N)!=ZP||mN&&vu(new mN)!=QP)&&(vu=function(e){var n=_g(e),r=n==DZ?e.constructor:void 0,i=r?zh(r):"";if(i)switch(i){case NZ:return JP;case IZ:return YP;case OZ:return XP;case TZ:return ZP;case MZ:return QP}return n});var e3=wl.Uint8Array,PZ="__lodash_hash_undefined__";function AZ(e){return this.__data__.set(e,PZ),this}function RZ(e){return this.__data__.has(e)}function Xb(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new Ec;++n<r;)this.add(e[n])}Xb.prototype.add=Xb.prototype.push=AZ;Xb.prototype.has=RZ;function kZ(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}function LZ(e,n){return e.has(n)}var jZ=1,FZ=2;function D9(e,n,r,i,s,o){var a=r&jZ,l=e.length,u=n.length;if(l!=u&&!(a&&u>l))return!1;var h=o.get(e),p=o.get(n);if(h&&p)return h==n&&p==e;var g=-1,v=!0,w=r&FZ?new Xb:void 0;for(o.set(e,n),o.set(n,e);++g<l;){var S=e[g],E=n[g];if(i)var x=a?i(E,S,g,n,e,o):i(S,E,g,e,n,o);if(x!==void 0){if(x)continue;v=!1;break}if(w){if(!kZ(n,function(I,P){if(!LZ(w,P)&&(S===I||s(S,I,r,i,o)))return w.push(P)})){v=!1;break}}else if(!(S===E||s(S,E,r,i,o))){v=!1;break}}return o.delete(e),o.delete(n),v}function $Z(e){var n=-1,r=Array(e.size);return e.forEach(function(i,s){r[++n]=[s,i]}),r}function zZ(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}var VZ=1,BZ=2,HZ="[object Boolean]",UZ="[object Date]",KZ="[object Error]",WZ="[object Map]",qZ="[object Number]",GZ="[object RegExp]",YZ="[object Set]",XZ="[object String]",ZZ="[object Symbol]",QZ="[object ArrayBuffer]",JZ="[object DataView]",t3=Uu?Uu.prototype:void 0,ZC=t3?t3.valueOf:void 0;function eQ(e,n,r,i,s,o,a){switch(r){case JZ:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case QZ:return!(e.byteLength!=n.byteLength||!o(new e3(e),new e3(n)));case HZ:case UZ:case qZ:return w9(+e,+n);case KZ:return e.name==n.name&&e.message==n.message;case GZ:case XZ:return e==n+"";case WZ:var l=$Z;case YZ:var u=i&VZ;if(l||(l=zZ),e.size!=n.size&&!u)return!1;var h=a.get(e);if(h)return h==n;i|=BZ,a.set(e,n);var p=D9(l(e),l(n),i,s,o,a);return a.delete(e),p;case ZZ:if(ZC)return ZC.call(e)==ZC.call(n)}return!1}var tQ=1,nQ=Object.prototype,rQ=nQ.hasOwnProperty;function iQ(e,n,r,i,s,o){var a=r&tQ,l=GP(e),u=l.length,h=GP(n),p=h.length;if(u!=p&&!a)return!1;for(var g=u;g--;){var v=l[g];if(!(a?v in n:rQ.call(n,v)))return!1}var w=o.get(e),S=o.get(n);if(w&&S)return w==n&&S==e;var E=!0;o.set(e,n),o.set(n,e);for(var x=a;++g<u;){v=l[g];var I=e[v],P=n[v];if(i)var M=a?i(P,I,v,n,e,o):i(I,P,v,e,n,o);if(!(M===void 0?I===P||s(I,P,r,i,o):M)){E=!1;break}x||(x=v=="constructor")}if(E&&!x){var k=e.constructor,A=n.constructor;k!=A&&"constructor"in e&&"constructor"in n&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(E=!1)}return o.delete(e),o.delete(n),E}var sQ=1,n3="[object Arguments]",r3="[object Array]",sb="[object Object]",oQ=Object.prototype,i3=oQ.hasOwnProperty;function aQ(e,n,r,i,s,o){var a=Th(e),l=Th(n),u=a?r3:vu(e),h=l?r3:vu(n);u=u==n3?sb:u,h=h==n3?sb:h;var p=u==sb,g=h==sb,v=u==h;if(v&&vN(e)){if(!vN(n))return!1;a=!0,p=!1}if(v&&!p)return o||(o=new Ru),a||S9(e)?D9(e,n,r,i,s,o):eQ(e,n,u,r,i,s,o);if(!(r&sQ)){var w=p&&i3.call(e,"__wrapped__"),S=g&&i3.call(n,"__wrapped__");if(w||S){var E=w?e.value():e,x=S?n.value():n;return o||(o=new Ru),s(E,x,r,i,o)}}return v?(o||(o=new Ru),iQ(e,n,r,i,s,o)):!1}function N9(e,n,r,i,s){return e===n?!0:e==null||n==null||!tg(e)&&!tg(n)?e!==e&&n!==n:aQ(e,n,r,i,N9,s)}var QC=function(){return wl.Date.now()},lQ="Expected a function",cQ=Math.max,uQ=Math.min;function dQ(e,n,r){var i,s,o,a,l,u,h=0,p=!1,g=!1,v=!0;if(typeof e!="function")throw new TypeError(lQ);n=$P(n)||0,lv(r)&&(p=!!r.leading,g="maxWait"in r,o=g?cQ($P(r.maxWait)||0,n):o,v="trailing"in r?!!r.trailing:v);function w(j){var V=i,$=s;return i=s=void 0,h=j,a=e.apply($,V),a}function S(j){return h=j,l=setTimeout(I,n),p?w(j):a}function E(j){var V=j-u,$=j-h,W=n-V;return g?uQ(W,o-$):W}function x(j){var V=j-u,$=j-h;return u===void 0||V>=n||V<0||g&&$>=o}function I(){var j=QC();if(x(j))return P(j);l=setTimeout(I,E(j))}function P(j){return l=void 0,v&&i?w(j):(i=s=void 0,a)}function M(){l!==void 0&&clearTimeout(l),h=0,i=u=s=l=void 0}function k(){return l===void 0?a:P(QC())}function A(){var j=QC(),V=x(j);if(i=arguments,s=this,u=j,V){if(l===void 0)return S(u);if(g)return clearTimeout(l),l=setTimeout(I,n),w(u)}return l===void 0&&(l=setTimeout(I,n)),a}return A.cancel=M,A.flush=k,A}function s3(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function I9(e,n){return N9(e,n)}var O9=(e=>(e.DELETE_NODES="DELETE_NODES",e.COPY_NODES="COPY_NODES",e.PASTE_NODES="PASTE_NODES",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e.UNDO="UNDO",e.REDO="REDO",e))(O9||{});function GI(e){return Wi(e)}var jw=(e,n,r=!0)=>{const i=Qe.enlarge(e.getAllNodes().map(s=>s.getData(qt).bounds));return n.fitView(i,r,30)};function hQ(e,n,r){let{x:i,y:s}=n;const a=e.getAllNodes().map(u=>{const h=u.getData(qt);return{x:h.position.x,y:h.position.y}}).sort((u,h)=>u.y-h.y),l=3;for(const u of a){const{x:h,y:p}=u;if(s-p<-3)break;const g=Math.abs(i-h),v=Math.abs(s-p);g<=l&&v<=l&&(i+=30,s+=30)}return{x:i,y:s}}var T9=(e,n,r="")=>`port_${n}_${e.id}_${r}`,M9="WorkflowLineEntity";function fQ(e){return new Qe(e.x,e.y,e.width,e.height)}var To=Kr,JC=24,Ph=class extends ol{constructor(e){super(e),this.portID="",this._disabled=!1,this._hasError=!1,this._onErrorChangedEmitter=new qe,this.onErrorChanged=this._onErrorChangedEmitter.event,this.portID=e.portID||"",this.portType=e.type,this._disabled=e.disabled??!1,this.node=e.node,this.updateTargetElement(e.targetElement),this.toDispose.push(this.node.getData(qt).onDataChange(()=>this.fireChange())),this.toDispose.push(this.node.onDispose(this.dispose.bind(this)))}static getPortEntityId(e,n,r=""){return T9(e,n,r)}get hasError(){return this._hasError}set hasError(e){this._hasError=e,this._onErrorChangedEmitter.fire()}validate(){const e=this.allLines.some(r=>r.disposed||r.isHidden?!1:(r.validateSelf(),r.hasError)),n=this.node.document.isErrorPort(this);this.hasError=e||n}isErrorPort(){return this.node.document.isErrorPort(this)}get point(){const{targetElement:e}=this,{bounds:n}=this.node.getData(at);if(e){const r=fQ(e.getBoundingClientRect()).center;return this.entityManager.getEntity(qn).getPosFromMouseEvent({clientX:r.x,clientY:r.y})}return this.portType==="input"?n.leftCenter:n.rightCenter}get bounds(){const{point:e}=this,n=JC/2;return new Qe(e.x-n,e.y-n,JC,JC)}isHovered(e,n){return this.bounds.contains(e,n)}get relativePosition(){const{point:e}=this,{bounds:n}=this.node.getData(at);return{x:e.x-n.x,y:e.y-n.y}}updateTargetElement(e){e!==this.targetElement&&(this.targetElement=e,this.fireChange())}get disabled(){const e=this.node.document;if(typeof e.options.isDisabledPort=="function")return e.options.isDisabledPort(this);if(this._disabled)return!0;const n=this.node.getNodeMeta();return this.portType==="input"?!!n.inputDisable:!!n.outputDisable}get lines(){return this.allLines.filter(e=>!e.isDrawing)}get availableLines(){return this.allLines.filter(e=>!e.isDrawing&&!e.isHidden)}get allLines(){const e=[];return this.entityManager.getEntities({type:M9}).forEach(r=>{(r.toPort===this||r.fromPort===this)&&e.push(r)}),e}dispose(){this.lines.forEach(e=>e.dispose()),super.dispose()}};Ph.type="WorkflowPortEntity";var gl=class extends Wr{constructor(e){var i;super(e),this._staticPorts=[],this._portIDSet=new Set,this.entity=e;const n=e.getNodeMeta(),r=n.useDynamicPort?[]:[{type:"input"},{type:"output"}];this._staticPorts=((i=n.defaultPorts)==null?void 0:i.slice())||r,this.updatePorts(this._staticPorts),n.useDynamicPort&&this.toDispose.push(e.getData(sc).onDataChange(()=>{e.getData(sc).width&&e.getData(sc).height&&this.updateDynamicPorts()})),this.onDispose(()=>{this.allPorts.forEach(s=>s.dispose())})}getDefaultData(){return{}}updateStaticPorts(e){const n=this.entity.getNodeMeta();this._staticPorts=e,n.useDynamicPort?this.updateDynamicPorts():this.updatePorts(this._staticPorts)}updateDynamicPorts(){const n=this.entity.getData(zn).node.querySelectorAll("[data-port-id]"),r=this._staticPorts,i=[];n.length>0&&i.push(...Array.from(n).map(s=>({portID:s.getAttribute("data-port-id"),type:s.getAttribute("data-port-type"),targetElement:s}))),this.updatePorts(r.concat(i))}getPortEntityByKey(e,n){return this.getOrCreatePortEntity({type:e,portID:n})}updatePorts(e){if(!I9(this._prePorts,e)){const n=e.map(r=>this.getPortId(r.type,r.portID));this._portIDSet.forEach(r=>{var i;n.includes(r)||(i=this.getPortEntity(r))==null||i.dispose()}),e.forEach(r=>this.updatePortEntity(r)),this._prePorts=e,this.fireChange()}this.allPorts.forEach(n=>{n.allLines.forEach(r=>{r.validate()}),n.validate()})}get allPorts(){return Array.from(this._portIDSet).map(e=>this.getPortEntity(e)).filter(Boolean)}get inputPorts(){return this.allPorts.filter(e=>e.portType==="input")}get outputPorts(){return this.allPorts.filter(e=>e.portType==="output")}get inputPoints(){return this.inputPorts.map(e=>e.point)}get outputPoints(){return this.inputPorts.map(e=>e.point)}getInputPoint(e){return this.getPortEntityByKey("input",e).point}getOutputPoint(e){return this.getPortEntityByKey("output",e).point}getPortEntity(e){if(this._portIDSet.has(e))return this.entity.entityManager.getEntityById(e)}getPortId(e,n=""){return T9(this.entity,e,n)}createPortEntity(e){const n=this.getPortId(e.type,e.portID);let r=this.entity.entityManager.getEntityById(n);return r||(r=this.entity.entityManager.createEntity(Ph,{id:n,node:this.entity,...e})),r.onDispose(()=>{this._portIDSet.delete(n)}),this._portIDSet.add(n),r}getOrCreatePortEntity(e){const n=this.getPortId(e.type,e.portID);return this.getPortEntity(n)??this.createPortEntity(e)}updatePortEntity(e){const n=this.getOrCreatePortEntity(e);return e.targetElement&&n.updateTargetElement(e.targetElement),n}};gl.type="WorkflowNodePortsData";var P9=class CN extends Wr{getDefaultData(){return{inputLines:[],outputLines:[]}}constructor(n){super(n),this.entity=n,this.entity.preDispose.push(on.create(()=>{this.inputLines.slice().forEach(r=>r.dispose()),this.outputLines.slice().forEach(r=>r.dispose())}))}get inputLines(){return this.data.inputLines}get outputLines(){return this.data.outputLines}get inputNodes(){return this.inputLines.map(n=>n.from).filter(Boolean)}get allInputNodes(){const n=new Set,r=i=>{if(n.has(i))return;n.add(i);const{inputNodes:s}=i.getData(CN);!s||!s.length||s.forEach(o=>{(o==null?void 0:o.parent)===i||(i==null?void 0:i.parent)===o||r(o)})};return r(this.entity),n.delete(this.entity),Array.from(n)}get outputNodes(){return this.outputLines.map(n=>n.to).filter(Boolean)}get allOutputNodes(){const n=new Set,r=i=>{if(n.has(i))return;n.add(i);const{outputNodes:s}=i.getData(CN);!s||!s.length||s.forEach(o=>{(o==null?void 0:o.parent)===i||(i==null?void 0:i.parent)===o||r(o)})};return r(this.entity),n.delete(this.entity),Array.from(n)}addLine(n){n.from===this.entity?this.outputLines.push(n):this.inputLines.push(n),this.fireChange()}removeLine(n){const{inputLines:r,outputLines:i}=this,s=r.indexOf(n),o=i.indexOf(n);s!==-1&&(r.splice(s,1),this.fireChange()),o!==-1&&(i.splice(o,1),this.fireChange())}};P9.type="WorkflowNodeLinesData";var el=P9,hc=class extends Wr{constructor(e){super(e),this.syncContributions()}getDefaultData(){return{version:"",contributions:new Map,position:{from:{x:0,y:0},to:{x:0,y:0}}}}get renderVersion(){return this.data.version}get position(){return this.data.position}get path(){var e;return((e=this.currentLine)==null?void 0:e.path)??""}calcDistance(e){var n;return((n=this.currentLine)==null?void 0:n.calcDistance(e))??Number.MAX_SAFE_INTEGER}get bounds(){var e;return((e=this.currentLine)==null?void 0:e.bounds)??new Qe}update(){var r;this.syncContributions();const e=this.data.version;this.updatePosition();const n=this.data.version;e!==n&&(this.data.version=n,(r=this.currentLine)==null||r.update({fromPos:this.data.position.from,toPos:this.data.position.to}))}get lineType(){return this.entity.renderType??this.entity.linesManager.lineType}updatePosition(){var e,n;this.data.position.from=this.entity.from.getData(gl).getOutputPoint(this.entity.info.fromPort),this.data.position.to=this.entity.info.drawingTo??((n=(e=this.entity.to)==null?void 0:e.getData(gl))==null?void 0:n.getInputPoint(this.entity.info.toPort))??{x:this.data.position.from.x,y:this.data.position.from.y},this.data.version=[this.lineType,this.data.position.from.x,this.data.position.from.y,this.data.position.to.x,this.data.position.to.y].join("-")}get currentLine(){return this.data.contributions.get(this.lineType)}syncContributions(){this.entity.linesManager.contributionFactories.length!==this.data.contributions.size&&this.entity.linesManager.contributionFactories.forEach(e=>{this.registerContribution(e)})}registerContribution(e){if(this.data.contributions.has(e.type))return;const n=new e(this.entity);this.data.contributions.set(e.type,n)}};hc.type="WorkflowLineRenderData";var pQ=8,Xa=10,A9=class EN extends ol{constructor(n){super(n),this._processing=!1,this._hasError=!1,this.info={from:""},this.document=n.document,this.linesManager=n.linesManager,this.initInfo({from:n.from,to:n.to,drawingTo:n.drawingTo,fromPort:n.fromPort,toPort:n.toPort}),n.drawingTo&&(this.isDrawing=!0)}static portInfoToLineId(n){const{from:r,to:i,fromPort:s,toPort:o}=n;return`${r}_${s||""}-${i||""}_${o||""}`}get from(){return this._from}get to(){return this._to}get isHidden(){return this.highlightColor===this.linesManager.lineColor.hidden}get inContainer(){const n=r=>!!(r!=null&&r.parent)&&r.parent.flowNodeType!=="root";return n(this.from)||n(this.to)}get processing(){return this._processing}set processing(n){this._processing!==n&&(this._processing=n,this.fireChange())}get hasError(){return this._hasError}set hasError(n){this._hasError!==n&&(this._hasError=n,this.fireChange()),this._node&&(this._node.dataset.hasError=this.hasError?"true":"false")}setToPort(n){if(!this.isDrawing)throw new Error("[setToPort] only support drawing line.");if(this.toPort!==n){if(n&&n.portType==="input"&&this.linesManager.canAddLine(this.fromPort,n,!0)){const{node:r,portID:i}=n;this._to=r,this.info.drawingTo=void 0,this.info.isDefaultLine=!1,this.info.to=r.id,this.info.toPort=i}else this._to=void 0,this.info.to=void 0,this.info.toPort="";this.fireChange()}}set drawingTo(n){const r=this.info.drawingTo;if(!n){this.info.drawingTo=void 0,this.fireChange();return}(!r||n.x!==r.x||n.y!==r.y)&&(this.info.to=void 0,this.info.isDefaultLine=!1,this.info.drawingTo=n,this.fireChange())}get drawingTo(){return this.info.drawingTo}get highlightColor(){return this.info.highlightColor||""}set highlightColor(n){this.info.highlightColor!==n&&(this.info.highlightColor=n,this.fireChange())}get bounds(){return this.getData(hc).bounds}getHoverDist(n){return this.getData(hc).calcDistance(n)}get fromPort(){return this.from.getData(gl).getPortEntityByKey("output",this.info.fromPort)}get toPort(){if(this.to)return this.to.getData(gl).getPortEntityByKey("input",this.info.toPort)}get position(){return this.getData(hc).position}get reverse(){return this.linesManager.isReverseLine(this)}get hideArrow(){return this.linesManager.isHideArrowLine(this)}get flowing(){return this.linesManager.isFlowingLine(this)}get disabled(){return this.linesManager.isDisabledLine(this)}get vertical(){return this.linesManager.isVerticalLine(this)}get renderType(){return this.linesManager.setLineRenderType(this)}get className(){return this.linesManager.setLineClassName(this)??""}get color(){return this.linesManager.getLineColor(this)}initInfo(n){I9(n,this.info)||(this.info=n,this._from=this.document.getNode(n.from),this._to=n.to?this.document.getNode(n.to):void 0,this.fireChange())}validate(){const{fromPort:n,toPort:r}=this;this.validateSelf(),n==null||n.validate(),r==null||r.validate()}validateSelf(){const{fromPort:n,toPort:r}=this;n&&(this.hasError=this.linesManager.isErrorLine(n,r))}is(n){return n instanceof EN?this===n:EN.portInfoToLineId(n)===this.id}canRemove(n){return this.linesManager.canRemove(this,n)}get node(){var n,r,i;return this._node?this._node:(this._node=ft.createDivWithClass("gedit-flow-activity-line"),this._node.dataset.testid="sdk.workflow.canvas.line",this._node.dataset.lineId=this.id,this._node.dataset.fromNodeId=this.from.id,this._node.dataset.fromPortId=((n=this.fromPort)==null?void 0:n.id)??"",this._node.dataset.toNodeId=((r=this.to)==null?void 0:r.id)??"",this._node.dataset.toPortId=((i=this.toPort)==null?void 0:i.id)??"",this._node.dataset.hasError=this.hasError?"true":"false",this._node)}toJSON(){const n={sourceNodeID:this.info.from,targetNodeID:this.info.to,sourcePortID:this.info.fromPort,targetPortID:this.info.toPort};return n.sourcePortID||delete n.sourcePortID,n.targetPortID||delete n.targetPortID,n}fireRender(){this.fireChange()}};A9.type=M9;var zs=A9,or=class{get onSelectionChanged(){return this.selectionService.onSelectionChanged}get selection(){return this.selectionService.selection}set selection(e){this.selectionService.selection=e}get activatedNode(){const{selectedNodes:e}=this;if(e.length===1)return e[0]}isSelected(e){return this.selectionService.selection.some(n=>n.id===e)}isActivated(e){var n;return((n=this.activatedNode)==null?void 0:n.id)===e}get selectedNodes(){return this.selectionService.selection.filter(e=>e instanceof To)}selectNode(e){this.selectionService.selection=[e]}toggleSelect(e){this.selectionService.selection.includes(e)?this.selectionService.selection=this.selectionService.selection.filter(n=>n!==e):this.selectionService.selection=this.selectionService.selection.concat(e)}select(e){this.selectionService.selection=[e]}clear(){this.selectionService.selection=[]}async selectNodeAndScrollToView(e,n){this.selectNodeAndFocus(e),await bc(30);const i={entities:[e]};if(n){const s=Qe.enlarge([e.getData(qt).bounds]).pad(30,30),o=this.playground.config.getViewport(!1),a=Hp.fixSize(s,o);i.zoom=a,i.scrollToCenter=!0,i.easing=!0}return this.playground.config.scrollToView(i)}selectNodeAndFocus(e){this.select(e),this.playground.node.focus()}};$t([oe(oa)],or.prototype,"selectionService",2);$t([oe(qi)],or.prototype,"playground",2);or=$t([$e()],or);var Zs=class{constructor(){this.onHoveredChangeEmitter=new qe,this.onHoveredChange=this.onHoveredChangeEmitter.event,this.hoveredPos={x:0,y:0},this.hoveredKey=""}updateHoveredKey(e){this.hoveredKey!==e&&(this.hoveredKey=e,this.onHoveredChangeEmitter.fire(e))}clearHovered(){this.updateHoveredKey("")}isHovered(e){return e===this.hoveredKey}isSomeHovered(){return!!this.hoveredKey}get hoveredNode(){return this.entityManager.getEntityById(this.hoveredKey)}};$t([oe(Sn)],Zs.prototype,"entityManager",2);Zs=$t([$e()],Zs);function gQ(e){return e.getData(gr)}function yQ(e){const n=e.getData(gr);if(!(!n||!e.getNodeRegistry().formMeta))return n.toJSON()}function mQ(e,n){const r=e.getData(gr),i=e.getNodeRegistry(),{formMeta:s}=i;r&&s&&(r.createForm(s,n.data),r.onDataChange(()=>{e.document.fireContentChange({type:"NODE_DATA_CHANGE",toJSON:()=>r.toJSON(),entity:e})}))}var Wv=Symbol("WorkflowDocumentOptions"),Su={cursors:{grab:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMCAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC40ODczIDIuNjIzNzhDOS45MDczMSAyLjYyMzc4IDkuNDM3MTMgMy4wOTM5NiA5LjQzNzEzIDMuNjczOTZWNS4xNDM3NkM5LjM5NDI4IDQuNDAyNzQgOC43Nzk3OCAzLjgxNTA0IDguMDI4MDIgMy44MTUwNEM3LjI0ODQ4IDMuODE1MDQgNi42MTY1MyA0LjQ0Njk5IDYuNjE2NTMgNS4yMjY1M1YxMS44Mjg5TDUuNjc0MTggMTEuMDA0OUM1LjE1NDg3IDEwLjU1MDkgNC40MDk1IDEwLjQ2MzYgMy43OTkzOCAxMC43ODU1TDMuNjk2OTQgMTAuODM5NkMzLjA2MjE3IDExLjE3NDUgMi45MjI2IDEyLjAyMjggMy40MTY2MiAxMi41NDM0TDcuMzM5NTkgMTYuNjc3NVYxNy4zMjU5QzcuMzM5NTkgMTcuNzg2MiA3LjcxMjY5IDE4LjE1OTMgOC4xNzI5MiAxOC4xNTkzSDEzLjgwODRDMTQuMjY4NyAxOC4xNTkzIDE0LjY0MTcgMTcuNzg2MiAxNC42NDE3IDE3LjMyNTlWMTYuNzkzNUMxNS44MDk0IDE1LjY0ODUgMTYuNDY3MyAxNC4wODE5IDE2LjQ2NzMgMTIuNDQ2NVYxMS40OTY3TDE2LjQ2NzEgNi42MzY4NUMxNi40NjcxIDUuOTU2MyAxNS45MTU0IDUuNDA0NjEgMTUuMjM0OCA1LjQwNDYxQzE0LjU1NDMgNS40MDQ2MSAxNC4wMDI2IDUuOTU2MyAxNC4wMDI2IDYuNjM2ODVMMTQuMDAyMSA1LjA0NzI4QzE0LjAwMjEgNC4zNjY3MyAxMy40NTA0IDMuODE1MDQgMTIuNzY5OCAzLjgxNTA0QzEyLjA4OTMgMy44MTUwNCAxMS41Mzc2IDQuMzY2NzMgMTEuNTM3NiA1LjA0NzI4TDExLjUzNzUgMy42NzM5NUMxMS41Mzc1IDMuMDkzOTYgMTEuMDY3MyAyLjYyMzc4IDEwLjQ4NzMgMi42MjM3OFoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNDg3NCAxLjM3NDAyQzExLjM2MTIgMS4zNzQwMiAxMi4xMjExIDEuODYxMTggMTIuNTEwNSAyLjU3ODY4QzEyLjU5NTggMi41Njk4MyAxMi42ODIzIDIuNTY1MjggMTIuNzcgMi41NjUyOEMxMy44Mjc4IDIuNTY1MjggMTQuNzMxMSAzLjIyNzAxIDE1LjA4ODUgNC4xNTkxMUMxNS4xMzcgNC4xNTYyOSAxNS4xODU4IDQuMTU0ODYgMTUuMjM1IDQuMTU0ODZDMTYuNjA1OSA0LjE1NDg2IDE3LjcxNzIgNS4yNjYxOSAxNy43MTcyIDYuNjM3MDlMMTcuNzE3NCAxMi40NDY3QzE3LjcxNzQgMTQuMjM1NSAxNy4wNjQ0IDE1Ljk1NTkgMTUuODkxOSAxNy4yOTA0VjE3LjMyNjJDMTUuODkxOSAxOC40NzY4IDE0Ljk1OTEgMTkuNDA5NSAxMy44MDg1IDE5LjQwOTVIOC4xNzMwNkM3LjAyMjQ3IDE5LjQwOTUgNi4wODk3MyAxOC40NzY4IDYuMDg5NzMgMTcuMzI2MlYxNy4xNzY0TDIuNTEwMDMgMTMuNDA0MUMxLjQ0NTk5IDEyLjI4MjggMS43NDY2IDEwLjQ1NTUgMy4xMTM3OSA5LjczNDI0TDMuMjE2MjQgOS42ODAxOUMzLjg5MTY4IDkuMzIzODMgNC42NjE4NSA5LjI1NDAxIDUuMzY2NjYgOS40NTE5OFY1LjIyNjc4QzUuMzY2NjYgMy43NTY4NyA2LjU1ODI2IDIuNTY1MjggOC4wMjgxNiAyLjU2NTI4QzguMTcyOTMgMi41NjUyOCA4LjMxNDk5IDIuNTc2ODQgOC40NTM0NyAyLjU5OTA3QzguODM5NDMgMS44NzA0MiA5LjYwNTQ2IDEuMzc0MDIgMTAuNDg3NCAxLjM3NDAyWk0xMi40NDc2IDMuODU3ODdWOS40NzY0NkMxMi40NDc2IDkuNzI4NTIgMTIuMjQzMyA5LjkzMjg1IDExLjk5MTMgOS45MzI4NUMxMS43MzkyIDkuOTMyODUgMTEuNTM0OSA5LjcyODUyIDExLjUzNDkgOS40NzY0NlYzLjc5NjU1QzExLjUzNDkgMy43Nzk1NiAxMS41MzU4IDMuNzYyNzcgMTEuNTM3NiAzLjc0NjI2VjMuNjc0MkMxMS41Mzc2IDMuNDMyODIgMTEuNDU2MiAzLjIxMDQ2IDExLjMxOTMgMy4wMzMwOUMxMS4xMjcyIDIuNzg0MjggMTAuODI2MSAyLjYyNDAyIDEwLjQ4NzQgMi42MjQwMkMxMC4xMjM4IDIuNjI0MDIgOS44MDMzMiAyLjgwODg2IDkuNjE0ODMgMy4wODk3QzkuNTAyNjkgMy4yNTY3OSA5LjQzNzI2IDMuNDU3ODUgOS40MzcyNiAzLjY3NDJWMy43ODU3M0M5LjQzNzM1IDMuNzg5MzMgOS40MzczOSAzLjc5Mjk0IDkuNDM3MzkgMy43OTY1NVY5LjkwMTdDOS40MzczOSAxMC4xNTM3IDkuMjMzMDYgMTAuMzU4MSA4Ljk4MTAxIDEwLjM1ODFDOC43Mjg5NSAxMC4zNTgxIDguNTI0NjIgMTAuMTUzNyA4LjUyNDYyIDkuOTAxN1YzLjkwNTA3QzguNDE3NzMgMy44NjQ5IDguMzA0NjggMy44MzczMiA4LjE4NzI2IDMuODI0MTVDOC4xMzUwNCAzLjgxODI5IDguMDgxOTUgMy44MTUyOCA4LjAyODE2IDMuODE1MjhDNy4yNDg2MSAzLjgxNTI4IDYuNjE2NjYgNC40NDcyMyA2LjYxNjY2IDUuMjI2NzhWMTEuODI5Mkw1LjY3NDMxIDExLjAwNTJDNS41Nzg2OCAxMC45MjE2IDUuNDc1MzcgMTAuODUwNCA1LjM2NjY2IDEwLjc5MTlDNC44ODUwNiAxMC41MzI5IDQuMjk3MjggMTAuNTIzMSAzLjc5OTUyIDEwLjc4NThMMy42OTcwNyAxMC44Mzk4QzMuMDYyMzEgMTEuMTc0NyAyLjkyMjczIDEyLjAyMzEgMy40MTY3NSAxMi41NDM3TDcuMzM5NzMgMTYuNjc3N1YxNy4zMjYyQzcuMzM5NzMgMTcuNzg2NCA3LjcxMjgyIDE4LjE1OTUgOC4xNzMwNiAxOC4xNTk1SDEzLjgwODVDMTQuMjY4OCAxOC4xNTk1IDE0LjY0MTkgMTcuNzg2NCAxNC42NDE5IDE3LjMyNjJWMTYuNzkzOEMxNS43Mzc5IDE1LjcxOSAxNi4zODQ3IDE0LjI3MjggMTYuNDYgMTIuNzQ3QzE2LjQ2NDEgMTIuNjY0MSAxNi40NjY1IDEyLjU4MDkgMTYuNDY3MiAxMi40OTc1TDE2LjQ2NzQgMTIuNDQ2N0wxNi40NjcyIDYuNjM3MDlDMTYuNDY3MiA1Ljk2MjMgMTUuOTI0OCA1LjQxNDE5IDE1LjI1MjIgNS40MDQ5N0wxNS4yMzUgNS40MDQ4NkMxNS4xMjQ2IDUuNDA0ODYgMTUuMDE3NyA1LjQxOTM2IDE0LjkxNTkgNS40NDY1NlY5LjYwMjI2QzE0LjkxNTkgOS44NTQzMSAxNC43MTE2IDEwLjA1ODYgMTQuNDU5NSAxMC4wNTg2QzE0LjIwNzUgMTAuMDU4NiAxNC4wMDMxIDkuODU0MzEgMTQuMDAzMSA5LjYwMjI2VjYuNjA1MTRDMTQuMDAyOSA2LjYxNTc2IDE0LjAwMjcgNi42MjY0MSAxNC4wMDI3IDYuNjM3MDlWOS4yNzcwNUwxNC4wMDIyIDUuMDQ3NTJDMTQuMDAyMiA0Ljg2OTEzIDEzLjk2NDMgNC42OTk2IDEzLjg5NjEgNC41NDY1M0MxMy43MDY0IDQuMTIwNzIgMTMuMjgyMiAzLjgyMjM1IDEyLjc4NzYgMy44MTU0MUwxMi43NyAzLjgxNTI4QzEyLjY1ODQgMy44MTUyOCAxMi41NTA0IDMuODMwMSAxMi40NDc2IDMuODU3ODdaIiBmaWxsPSIjMUQxQzIzIi8+Cjwvc3ZnPg=="), auto',grabbing:'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMCAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02LjYxODE3IDUuNTk4NzVDNi42MTgxNyA0LjgxOTIgNy4yNTAxMiA0LjE4NzI2IDguMDI5NjcgNC4xODcyNkM4Ljc3ODczIDQuMTg3MjYgOS4zOTE1MiA0Ljc3MDc1IDkuNDM4MjkgNS41MDgwMUM5LjQ1OTkyIDQuOTQ3MSA5LjkyMTQ3IDQuNDk5MDIgMTAuNDg3NyA0LjQ5OTAyQzExLjA2NzcgNC40OTkwMiAxMS41Mzc4IDQuOTY5MiAxMS41Mzc4IDUuNTQ5MTlWOC43NjI0NkwxMS41Mzc5IDYuNzExNUMxMS41Mzc5IDYuMDMwOTUgMTIuMDg5NiA1LjQ3OTI2IDEyLjc3MDIgNS40NzkyNkMxMy40NTA3IDUuNDc5MjYgMTQuMDAyNCA2LjAzMDk1IDE0LjAwMjQgNi43MTE1TDE0LjAwMjQgOC43NjI0NkwxNC4wMDI5IDguMDE5ODNDMTQuMDAyOSA3LjMzOTI5IDE0LjU1NDYgNi43ODc1OSAxNS4yMzUyIDYuNzg3NTlDMTUuOTE1NyA2Ljc4NzU5IDE2LjQ2NzQgNy4zMzkyOCAxNi40Njc0IDguMDE5ODNWMTEuNDk3TDE2LjQ2NzUgMTIuNDQ2N0MxNi40Njc1IDE0LjA4MjEgMTUuODA5NiAxNS42NDg3IDE0LjY0MiAxNi43OTM4VjE3LjMyNjJDMTQuNjQyIDE3Ljc4NjQgMTQuMjY4OSAxOC4xNTk1IDEzLjgwODcgMTguMTU5NUg4LjE3MzE3QzcuNzEyOTMgMTguMTU5NSA3LjMzOTg0IDE3Ljc4NjQgNy4zMzk4NCAxNy4zMjYyVjE1Ljk0MjRMNS4zNDU2MiAxNC43NTM0QzQuNTg5MjQgMTQuMzAyNCA0LjEyNTkxIDEzLjQ4NjcgNC4xMjU4OSAxMi42MDYxTDQuMTI1ODMgOS4yODM4M0M0LjEyNTgyIDguOTU0MjcgNC4zMjAwMyA4LjY1NTY2IDQuNjIxMjkgOC41MjIwNUw2LjYxODE3IDcuNjM2MzRWNS41OTg3NVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNDg3OCAzLjI0OTAyQzExLjI3OTYgMy4yNDkwMiAxMS45Nzc4IDMuNjQ5MDIgMTIuMzkxNyA0LjI1Nzk2QzEyLjUxNTEgNC4yMzkwNiAxMi42NDE2IDQuMjI5MjYgMTIuNzcwMyA0LjIyOTI2QzEzLjcyMjQgNC4yMjkyNiAxNC41NDkzIDQuNzY1MzEgMTQuOTY1NyA1LjU1MjA3QzE1LjA1NDMgNS41NDI1IDE1LjE0NDIgNS41Mzc1OSAxNS4yMzUzIDUuNTM3NTlDMTYuNjA2MiA1LjUzNzU5IDE3LjcxNzYgNi42NDg5MyAxNy43MTc2IDguMDE5ODNMMTcuNzE3NyAxMi40NDY3QzE3LjcxNzcgMTQuMjM1NSAxNy4wNjQ3IDE1Ljk1NTkgMTUuODkyMSAxNy4yOTA0VjE3LjMyNjJDMTUuODkyMSAxOC40NzY4IDE0Ljk1OTQgMTkuNDA5NSAxMy44MDg4IDE5LjQwOTVIOC4xNzMzMkM3LjAyMjczIDE5LjQwOTUgNi4wODk5OCAxOC40NzY4IDYuMDg5OTggMTcuMzI2MlYxNi42NTI0TDQuNzA1NjMgMTUuODI3QzMuNTcxMDYgMTUuMTUwNSAyLjg3NjA3IDEzLjkyNzEgMi44NzYwNCAxMi42MDYxTDIuODc1OTggOS4yODM4NUMyLjg3NTk2IDguNDU5OTYgMy4zNjE0OSA3LjcxMzQ1IDQuMTE0NjIgNy4zNzk0TDUuMzY4MzIgNi44MjMzM1Y1LjU5ODc1QzUuMzY4MzIgNC4xMjg4NSA2LjU1OTkxIDIuOTM3MjYgOC4wMjk4MiAyLjkzNzI2QzguNjA4MzEgMi45MzcyNiA5LjE0MzU1IDMuMTIxNyA5LjU4MDA1IDMuNDM1MDVDOS44NTg1MyAzLjMxNTMyIDEwLjE2NTQgMy4yNDkwMiAxMC40ODc4IDMuMjQ5MDJaTTEyLjQ0NzkgNS41MjE4NlY5LjQ3NTU3QzEyLjQ0NzkgOS43Mjc2MiAxMi4yNDM2IDkuOTMxOTUgMTEuOTkxNiA5LjkzMTk1QzExLjc1NjggOS45MzE5NSAxMS41NjM0IDkuNzU0NjUgMTEuNTM4IDkuNTI2NjNDMTEuNTM2MSA5LjUwOTg3IDExLjUzNTIgOS40OTI4MyAxMS41MzUyIDkuNDc1NTdWNS40NzE1OEMxMS41MTU0IDUuMjAwODMgMTEuMzkzIDQuOTU4NTggMTEuMjA2NiA0Ljc4MzU4QzExLjAxODggNC42MDcxMSAxMC43NjU5IDQuNDk5MDIgMTAuNDg3OCA0LjQ5OTAyQzEwLjQ3NjYgNC40OTkwMiAxMC40NjU0IDQuNDk5MTkgMTAuNDU0MiA0LjQ5OTU0QzkuOTAzNDcgNC41MTY4NCA5LjQ1OTY0IDQuOTU4MjQgOS40Mzg0NCA1LjUwODAxQzkuNDM4MiA1LjUwNDMgOS40Mzc5NSA1LjUwMDU4IDkuNDM3NjkgNS40OTY4OFY5LjkwMjQzQzkuNDM3NjkgMTAuMTU0NSA5LjIzMzM2IDEwLjM1ODggOC45ODEzMSAxMC4zNTg4QzguNzI5MjUgMTAuMzU4OCA4LjUyNDkyIDEwLjE1NDUgOC41MjQ5MiA5LjkwMjQzVjQuMjc2NTNDOC4zNzA4NiA0LjIxODgyIDguMjA0MDIgNC4xODcyNiA4LjAyOTgyIDQuMTg3MjZDNy4yNTAyNyA0LjE4NzI2IDYuNjE4MzIgNC44MTkyIDYuNjE4MzIgNS41OTg3NUw2LjYxODI3IDkuOTc1OTlDNi42MTgyNyAxMC4yMjggNi40MTM5NCAxMC40MzI0IDYuMTYxODkgMTAuNDMyNEM1LjkwOTgzIDEwLjQzMjQgNS43MDU1IDEwLjIyOCA1LjcwNTUgOS45NzU5OVY4LjA0MTIyTDQuNjIxNDQgOC41MjIwNUM0LjMyMDE4IDguNjU1NjYgNC4xMjU5NyA4Ljk1NDI3IDQuMTI1OTggOS4yODM4M0w0LjEyNjA0IDEyLjYwNjFDNC4xMjYwNiAxMy40ODY3IDQuNTg5MzkgMTQuMzAyNCA1LjM0NTc2IDE0Ljc1MzRMNy4zMzk5OCAxNS45NDI0VjE3LjMyNjJDNy4zMzk5OCAxNy43ODY0IDcuNzEzMDggMTguMTU5NSA4LjE3MzMyIDE4LjE1OTVIMTMuODA4OEMxNC4yNjkgMTguMTU5NSAxNC42NDIxIDE3Ljc4NjQgMTQuNjQyMSAxNy4zMjYyVjE2Ljc5MzhDMTUuNzM4MSAxNS43MTkgMTYuMzg1IDE0LjI3MjggMTYuNDYwMyAxMi43NDdDMTYuNDY0NiAxMi42NiAxNi40NjcgMTIuNTcyOCAxNi40Njc2IDEyLjQ4NTRMMTYuNDY3NyAxMi40NDY3TDE2LjQ2NzYgOC4wMTk4M0MxNi40Njc2IDcuMzQ1MDQgMTUuOTI1MiA2Ljc5NjkzIDE1LjI1MjUgNi43ODc3MUwxNS4yMzUzIDYuNzg3NTlDMTUuMTI1IDYuNzg3NTkgMTUuMDE4IDYuODAyMSAxNC45MTYyIDYuODI5MzFWOS42MDEzNkMxNC45MTYyIDkuODUzNDIgMTQuNzExOSAxMC4wNTc3IDE0LjQ1OTggMTAuMDU3N0MxNC4yMDc4IDEwLjA1NzcgMTQuMDAzNCA5Ljg1MzQxIDE0LjAwMzQgOS42MDEzNlY3Ljk4OTg1QzE0LjAwMzIgNy45OTk4MiAxNC4wMDMxIDguMDA5ODEgMTQuMDAzMSA4LjAxOTgzTDE0LjAwMzQgOS42MDEzNkwxNC4wMDI1IDYuNzExNUMxNC4wMDI1IDYuNDQ5NzQgMTMuOTIwOSA2LjIwNzA1IDEzLjc4MTggNi4wMDc0OEMxMy41NjIgNS42OTI0MiAxMy4xOTg5IDUuNDg0ODMgMTIuNzg3IDUuNDc5MzdMMTIuNzcwMyA1LjQ3OTI2QzEyLjY1ODggNS40NzkyNiAxMi41NTA3IDUuNDk0MDggMTIuNDQ3OSA1LjUyMTg2WiIgZmlsbD0iIzFEMUMyMyIvPgo8L3N2Zz4="), auto'},fromNodeJSON(e,n){mQ(e,n)},toNodeJSON(e){var u,h;const n=(u=e.getData($h))==null?void 0:u.getError();if(n)throw n;const r=e.getData(qt);let i=yQ(e);const s={},o=e.getNodeMeta(),a=(h=o.subCanvas)==null?void 0:h.call(o,e);if((a==null?void 0:a.isCanvas)===!1){const p=a.canvasNode.getData(at),{x:g,y:v}=p.transform.position;s.canvasPosition={x:g,y:v}}return{id:e.id,type:e.flowNodeType,meta:{position:{x:r.position.x,y:r.position.y},...s},data:i}}},oi=class{constructor(){this.toDispose=new jt,this._lineType=0,this.onAvailableLinesChangeEmitter=new qe,this.onForceUpdateEmitter=new qe,this.onAvailableLinesChange=this.onAvailableLinesChangeEmitter.event,this.onForceUpdate=this.onForceUpdateEmitter.event,this.contributionFactories=[],this.isDrawing=!1}init(e){this.document=e}forceUpdate(){this.onForceUpdateEmitter.fire()}get lineType(){return this._lineType}get lineColor(){const e={default:"#4d53e8",error:"red",hidden:"transparent",drawing:"#5DD6E3",hovered:"#37d0ff",selected:"#37d0ff"};return this.options.lineColor&&Object.assign(e,this.options.lineColor),e}switchLineType(e){return e===void 0&&(this._lineType===0?e=1:e=0),e!==this._lineType&&(this._lineType=e,this.getAllLines().forEach(n=>{n.getData(hc).update()}),window.requestAnimationFrame(()=>{this.entityManager.fireEntityChanged(zs.type)})),this._lineType}getAllLines(){return this.entityManager.getEntities(zs)}hasLine(e){return!!this.entityManager.getEntityById(zs.portInfoToLineId(e))}getLine(e){return this.entityManager.getEntityById(zs.portInfoToLineId(e))}replaceLine(e,n){const r=this.getLine(e);return r&&r.dispose(),this.createLine(n)}createLine(e){var g;const{from:n,to:r,drawingTo:i,fromPort:s,toPort:o}=e,a=!!(n&&r),l=e.key||zs.portInfoToLineId(e);let u=this.entityManager.getEntityById(l);if(u)return u.highlightColor="",u.validate(),u;const h=(g=this.entityManager.getEntityById(n))==null?void 0:g.getData(el),p=r?this.entityManager.getEntityById(r).getData(el):void 0;if(h)return this.isDrawing=!!i,u=this.entityManager.createEntity(zs,{id:l,document:this.document,linesManager:this,from:n,fromPort:s,toPort:o,to:r,drawingTo:i}),this.registerData(u),h.addLine(u),p==null||p.addLine(u),u.onDispose(()=>{i&&(this.isDrawing=!1),h.removeLine(u),p==null||p.removeLine(u),u.validate()}),u.toDispose.push(on.create(()=>{a&&this.onAvailableLinesChangeEmitter.fire({type:"DELETE_LINE",toJSON:()=>u.toJSON(),entity:u})})),a&&this.onAvailableLinesChangeEmitter.fire({type:"ADD_LINE",toJSON:()=>u.toJSON(),entity:u}),u.validate(),u}getCloseInLineFromMousePos(e,n=pQ){let r,i;return this.getAllLines().forEach(s=>{const o=s.getHoverDist(e);o<=n&&(!i||i>=o)&&(i=o,r=s)}),r}dispose(){this.toDispose.dispose()}get disposed(){return this.toDispose.disposed}isErrorLine(e,n){return this.options.isErrorLine?this.options.isErrorLine(e,n,this):!1}isReverseLine(e){return this.options.isReverseLine?this.options.isReverseLine(e):!1}isHideArrowLine(e){return this.options.isHideArrowLine?this.options.isHideArrowLine(e):!1}isFlowingLine(e){return this.options.isFlowingLine?this.options.isFlowingLine(e):!1}isDisabledLine(e){return this.options.isDisabledLine?this.options.isDisabledLine(e):!1}isVerticalLine(e){return this.options.isVerticalLine?this.options.isVerticalLine(e):!1}setLineRenderType(e){if(this.options.setLineRenderType)return this.options.setLineRenderType(e)}setLineClassName(e){if(this.options.setLineClassName)return this.options.setLineClassName(e)}getLineColor(e){return e.isHidden?this.lineColor.hidden:e.hasError?this.lineColor.error:e.highlightColor?e.highlightColor:e.drawingTo?this.lineColor.drawing:this.hoverService.isHovered(e.id)?this.lineColor.hovered:this.selectService.isSelected(e.id)?this.lineColor.selected:this.lineColor.default}canAddLine(e,n,r){return e===n||e.node===n.node||e.portType!=="output"||n.portType!=="input"||n.disabled?!1:this.options.canAddLine?this.options.canAddLine(e,n,this,r):e.node!==n.node}toJSON(){return this.getAllLines().filter(e=>!e.isDrawing).map(e=>e.toJSON())}getPortById(e){return this.entityManager.getEntityById(e)}canRemove(e,n,r){return!(this.options&&this.options.canDeleteLine&&!this.options.canDeleteLine(e,n,r))}canReset(e,n,r){return!(this.options&&this.options.canResetLine&&!this.options.canResetLine(e,n,r,this))}getPortFromMousePos(e){const r=this.entityManager.getEntities(Ph).filter(i=>i.node.flowNodeType!=="root").find(i=>i.isHovered(e.x,e.y));if(r){const i=this.document.getAllNodes().slice().reverse().filter(s=>{var o,a;return((a=(o=r.node)==null?void 0:o.parent)==null?void 0:a.id)!==s.id}).find(s=>s.getData(qt).contains(e.x,e.y));if(i&&i!==r.node)return}return r}getNodeFromMousePos(e){var o,a;const n=this.document.getAllNodes().sort((l,u)=>this.getNodeIndex(l)-this.getNodeIndex(u)),r=[],{selection:i}=this.selectService,s=((a=(o=this.entityManager.getEntity(qn))==null?void 0:o.config)==null?void 0:a.zoom)||1;if(n.forEach(l=>{const{bounds:u}=l.getData(at);u.clone().pad(4/s).contains(e.x,e.y)&&r.push(l)}),i!=null&&i.length){const l=r.filter(u=>i.some(h=>u.id===h.id));if(l!=null&&l.length)return s3(l)}return s3(r)}registerContribution(e){return this.contributionFactories.push(e),this}registerData(e){e.addData(hc)}getNodeIndex(e){return e.getData(zn).stackIndex}};$t([oe(Zs)],oi.prototype,"hoverService",2);$t([oe(or)],oi.prototype,"selectService",2);$t([oe(Sn)],oi.prototype,"entityManager",2);$t([oe(Wv)],oi.prototype,"options",2);oi=$t([$e()],oi);var R9="free-layout",ng=class{constructor(){this.name=R9}get document(){return this.documentProvider()}update(){var e;(e=this.document.root.getData(at))!=null&&e.localDirty&&this.document.root.clearMemoGlobal()}syncTransform(e){const n=e.getData(at);if(!n.localDirty||(e.clearMemoGlobal(),e.clearMemoLocal(),n.transform.update({size:n.data.size}),!e.parent))return;e.parent.clearMemoGlobal(),e.parent.clearMemoLocal(),e.parent.getData(at).transform.fireChange()}updateAffectedTransform(e){if(!e.transform.localDirty)return;const r=this.getAllParents(e);[...this.getAllBlocks(e).reverse(),...r].forEach(o=>{this.fireChange(o)})}getPadding(e){const{padding:n}=e.getNodeMeta(),r=e.getData(at);return n?typeof n=="function"?n(r):n:JD.empty()}getInitScroll(e){const n=Qe.enlarge(this.document.getAllNodes().map(s=>s.getData(qt).bounds)).pad(30,30),r=this.playgroundConfig.getViewport(!1),i=Hp.fixSize(n,r);return{scrollX:(n.x+n.width/2)*i-this.playgroundConfig.config.width/2,scrollY:(n.y+n.height/2)*i-this.playgroundConfig.config.height/2}}getDefaultInputPoint(e){return e.getData(qt).bounds.leftCenter}getDefaultOutputPoint(e){return e.getData(qt).bounds.rightCenter}getDefaultNodeOrigin(){return{x:.5,y:0}}getAllParents(e){const n=[];let r=e.parent;for(;r;)n.push(r),r=r.parent;return n}getAllBlocks(e){return e.blocks.reduce((n,r)=>[...n,...this.getAllBlocks(r)],[e])}fireChange(e){const n=e==null?void 0:e.transform;!e||!(n!=null&&n.localDirty)||(e.clearMemoGlobal(),e.clearMemoLocal(),n.transform.fireChange())}};$t([oe(qn)],ng.prototype,"playgroundConfig",2);$t([oe(Ow)],ng.prototype,"documentProvider",2);ng=$t([$e()],ng);var eE=o6("1234567890",5),vQ=Symbol("WorkflowDocumentProvider"),Et=class extends On{constructor(){super(...arguments),this._onContentChangeEmitter=new qe,this.onLoadedEmitter=new qe,this.onContentChange=this._onContentChangeEmitter.event,this._onReloadEmitter=new qe,this.onReload=this._onReloadEmitter.event,this.disposed=!1,this.onLoaded=this.onLoadedEmitter.event,this._loading=!1,this.options={}}get loading(){return this._loading}async fitView(e){return jw(this,this.playgroundConfig,e).then(()=>{this.linesManager.forceUpdate()})}init(){super.init(),this.currentLayoutKey=this.options.defaultLayout||R9,this.linesManager.init(this),this.playgroundConfig.getCursors=()=>this.options.cursors,this.linesManager.onAvailableLinesChange(e=>this.fireContentChange(e)),this.playgroundConfig.onReadonlyOrDisabledChange(({readonly:e})=>{this.nodeEngineContext&&(this.nodeEngineContext.readonly=e)})}async load(){this._loading=!0,await super.load(),this._loading=!1,this.onLoadedEmitter.fire()}async reload(e,n=0){this._loading=!0,this.clear(),this.fromJSON(e),await bc(n),this._loading=!1,this._onReloadEmitter.fire(this)}fromJSON(e,n=!0){const r={nodes:e.nodes??[],edges:e.edges??[]};this.entityManager.changeEntityLocked=!0,this.renderJSON(r),this.entityManager.changeEntityLocked=!1,this.transformer.loading=!1,n&&this.fireRender()}clear(){this.getAllNodes().map(e=>e.dispose()),this.linesManager.getAllLines().map(e=>e.dispose()),this.getAllPorts().map(e=>e.dispose()),this.selectServices.clear()}createWorkflowNode(e,n=!1,r){var E;const i=this.getNode(e.id),s=this.getNode(r??this.root.id)??this.root,o=this.addNode({...e,parent:s},void 0,!0),a=o.getNodeRegistry(),{formMeta:l}=a,u=o.getNodeMeta(),h=gQ(o),p=o.getData(at),g=this.layout;p.onDataChange(()=>{g.syncTransform(o)});let{position:v}=u;v||(v=this.getNodeDefaultPosition(e.type)),o.getData(qt).update({position:v}),l&&h&&!h.formModel.initialized&&(h.createForm(l,e.data),h.onDataChange(()=>{this.fireContentChange({type:"NODE_DATA_CHANGE",toJSON:()=>h.toJSON(),entity:o})}));const w=o.getData(xu);w.onDataChange(()=>{this.fireContentChange({type:"MOVE_NODE",toJSON:()=>w.toJSON(),entity:o})});const S=this.getNodeSubCanvas(o);return!i&&!(S!=null&&S.isCanvas)&&(this.fireContentChange({type:"ADD_NODE",entity:o,toJSON:()=>this.toNodeJSON(o)}),o.toDispose.push(on.create(()=>{this.fireContentChange({type:"DELETE_NODE",entity:o,toJSON:()=>this.toNodeJSON(o)})})),o.toDispose.push(on.create(()=>{if(!o.parent||o.parent.flowNodeType===In.ROOT)return;const x=o.parent.getData(at);setTimeout(()=>{x.fireChange()},0)}))),e.blocks&&this.renderJSON({nodes:e.blocks,edges:e.edges??[]},{parent:o,isClone:n}),S&&(S.canvasNode.getData(qt).update({position:(E=S.parentNode.getNodeMeta())==null?void 0:E.canvasPosition}),S.parentNode.onDispose(()=>{S.canvasNode.dispose()}),S.canvasNode.onDispose(()=>{S.parentNode.dispose()})),this.onNodeCreateEmitter.fire({node:o,data:e}),o}get layout(){const e=this.layouts.find(n=>n.name==this.currentLayoutKey);if(!e)throw new Error(`Unknown flow layout: ${this.currentLayoutKey}`);return e}getNodeDefaultPosition(e){const{size:n}=this.getNodeRegistry(e).meta||{};let r=this.playgroundConfig.getViewport(!0).center;return n&&(r={x:r.x,y:r.y-n.height/2}),hQ(this,r)}createWorkflowNodeByType(e,n,r={},i){let s=r.id;if(s===void 0)do s=`1${eE()}`;while(this.entityManager.getEntityById(s));else if(this.entityManager.getEntityById(s))throw new Error(`[WorkflowDocument.createWorkflowNodeByType] Node Id "${s}" duplicated.`);return this.createWorkflowNode({...r,id:s,type:e,meta:{position:n,...r==null?void 0:r.meta},data:r==null?void 0:r.data,blocks:r==null?void 0:r.blocks,edges:r==null?void 0:r.edges},!1,i)}getAllNodes(){return this.entityManager.getEntities(To).filter(e=>e.id!==In.ROOT)}getAllPorts(){return this.entityManager.getEntities(Ph).filter(e=>e.node.id!==In.ROOT)}getAssociatedNodes(){const e=this.getAllNodes(),n=this.linesManager.getAllLines().filter(u=>u.from&&u.to).map(u=>({from:u.from.id,to:u.to.id})),r=e.find(u=>u.isStart).id,i=e.find(u=>u.isNodeEnd).id,s=e.filter(u=>{var h;return(h=u.parent)==null?void 0:h.getNodeMeta().isContainer}).map(u=>u.id),o=new Set([i,...s]),a=u=>{if(o.has(u))return;o.add(u),n.reduce((p,{from:g,to:v})=>(g===u&&!o.has(v)&&p.push(v),p),[]).forEach(a)};return a(r),e.filter(u=>o.has(u.id))}fireRender(){this.entityManager.fireEntityChanged(To.type),this.entityManager.fireEntityChanged(zs.type),this.entityManager.fireEntityChanged(Ph.type)}fireContentChange(e){this._loading||this.disposed||this.entityManager.changeEntityLocked||this._onContentChangeEmitter.fire(e)}toNodeJSON(e){const n=this.getNodeSubCanvas(e);if((n==null?void 0:n.isCanvas)===!0)return this.toNodeJSON(n.parentNode);const r=this.toNodeJSONFromOptions(e),i=this.getNodeChildren(e),s=i.map(l=>this.toNodeJSON(l)),o=new Map;i.forEach(l=>{const u=l.getData(el);[...u.inputLines,...u.outputLines].filter(Boolean).forEach(h=>{const p=this.toLineJSON(h);!p||o.has(h.id)||o.set(h.id,p)})});const a=Array.from(o.values());return s.length>0&&(r.blocks=s),a.length>0&&(r.edges=a),r}toNodeJSONFromOptions(e){return this.options.toNodeJSON?this.options.toNodeJSON(e):Su.toNodeJSON(e)}copyNode(e,n,r,i){var o;let s=this.toNodeJSON(e);return r&&(s=r(s)),i=i||{x:s.meta.position.x+30,y:s.meta.position.y+30},this.createWorkflowNode({id:n||`1${eE()}`,type:e.flowNodeType,meta:{...s.meta,position:i},data:s.data,blocks:s.blocks,edges:s.edges},!0,(o=e.parent)==null?void 0:o.id)}copyNodeFromJSON(e,n,r,i,s){return i=i||{x:n.meta.position.x+30,y:n.meta.position.y+30},this.createWorkflowNode({id:r||`1${eE()}`,type:e,meta:{...n.meta,position:i},data:n.data,blocks:n.blocks,edges:n.edges},!0,s)}canRemove(e,n){return!(e.getNodeMeta().deleteDisable||this.options.canDeleteNode&&!this.options.canDeleteNode(e,n))}isErrorPort(e){return typeof this.options.isErrorPort=="function"?this.options.isErrorPort(e):!1}toJSON(){const e=this.toNodeJSON(this.root);return{nodes:e.blocks??[],edges:e.edges??[]}}dispose(){this.disposed||(super.dispose(),this.disposed=!0,this._onReloadEmitter.dispose())}renderJSON(e,n){var l;const{parent:r=this.root,isClone:i=!1}=n??{},s=((l=this.getNodeSubCanvas(r))==null?void 0:l.canvasNode.id)??r.id,o=e.nodes.map(u=>this.createWorkflowNode(u,i,s)),a=e.edges.map(u=>this.createWorkflowLine(u,s)).filter(Boolean);return{nodes:o,edges:a}}getNodeSubCanvas(e){var i;if(!e)return;const n=e.getNodeMeta();return(i=n.subCanvas)==null?void 0:i.call(n,e)}getNodeChildren(e){if(!e)return[];const n=this.getNodeSubCanvas(e);return(n?n.canvasNode.collapsedChildren:e.collapsedChildren).filter(s=>{var a,l;const o=s.getNodeMeta();return!((l=(a=o.subCanvas)==null?void 0:a.call(o,e))!=null&&l.isCanvas)}).filter(Boolean)}toLineJSON(e){const n=e.toJSON();if(!e.from||!e.info.from||!e.fromPort||!e.to||!e.info.to||!e.toPort)return;const r=this.getNodeSubCanvas(e.from),i=this.getNodeSubCanvas(e.to);if(!(r&&!r.isCanvas&&i&&i.isCanvas))return e.from===e.to.parent&&r?{...n,sourceNodeID:r.parentNode.id}:e.to===e.from.parent&&i?{...n,targetNodeID:i.parentNode.id}:n}createWorkflowLine(e,n){const r=this.getNode(e.sourceNodeID),i=this.getNode(e.targetNodeID);if(!r||!i)return;const s={from:e.sourceNodeID,fromPort:e.sourcePortID,to:e.targetNodeID,toPort:e.targetPortID};if(!n)return this.linesManager.createLine(s);const o=this.getNode(n);if(!o)return this.linesManager.createLine(s);const a=this.getNodeSubCanvas(o);return a?s.from===a.parentNode.id?this.linesManager.createLine({...s,from:a.canvasNode.id}):s.to===a.parentNode.id?this.linesManager.createLine({...s,to:a.canvasNode.id}):this.linesManager.createLine(s):this.linesManager.createLine(s)}};$t([oe(oi)],Et.prototype,"linesManager",2);$t([oe(qn)],Et.prototype,"playgroundConfig",2);$t([gg()],Et.prototype,"playgroundContext",2);$t([oe(Wv)],Et.prototype,"options",2);$t([oe(Ys),pr()],Et.prototype,"nodeEngineContext",2);$t([oe(or)],Et.prototype,"selectServices",2);$t([Ai()],Et.prototype,"init",1);Et=$t([$e()],Et);var bQ=100,o3=5;function a3(e,n,r){return!r||e>bQ||Math.abs(n.endPos.x-n.startPos.x)>=o3||Math.abs(n.endPos.y-n.startPos.y)>=o3}var yr=class{constructor(){this._onDragLineEventEmitter=new qe,this.onDragLineEventChange=this._onDragLineEventEmitter.event,this.isDragging=!1,this._nodesDragEmitter=new qe,this.onNodesDrag=this._nodesDragEmitter.event,this._toDispose=new jt,this._droppableTransforms=[],this.posAdjusters=new Set,this._onDragLineEndCallbacks=new Map}init(){this._toDispose.pushAll([this._onDragLineEventEmitter,this._nodesDragEmitter]),this.options.onDragLineEnd&&this._toDispose.push(this.onDragLineEnd(this.options.onDragLineEnd))}dispose(){this._toDispose.dispose()}async startDragSelectedNodes(e){var u;let{selectedNodes:n}=this.selectService;if(n.length===0||this.playgroundConfig.readonly||this.playgroundConfig.disabled||this.isDragging)return Promise.resolve(!1);this.isDragging=!0;const r=this.childrenOfContainer(n);r&&r.flowNodeType!==In.ROOT&&(n=[r]);let i=this.getNodesPosition(n),s=n.map(h=>{const p=h.getData(qt);return{x:p.position.x,y:p.position.y}}),o=!1;const a=Date.now(),l=new Ja({onDragStart:h=>{this._nodesDragEmitter.fire({type:"onDragStart",nodes:n,startPositions:s,dragEvent:h,triggerEvent:e,dragger:l})},onDrag:h=>{!o&&a3(Date.now()-a,h)&&(o=!0);const p=this.getDragPosOffset({event:h,selectedNodes:n,startPosition:i}),g=[];n.forEach((v,w)=>{const S=v.getData(qt),E=s[w],x={x:E.x+p.x,y:E.y+p.y};S.update({position:x}),this.document.layout.updateAffectedTransform(v),g.push(x)}),this._nodesDragEmitter.fire({type:"onDragging",nodes:n,startPositions:s,positions:g,dragEvent:h,triggerEvent:e,dragger:l})},onDragEnd:h=>{this.isDragging=!1,this._nodesDragEmitter.fire({type:"onDragEnd",nodes:n,startPositions:s,dragEvent:h,triggerEvent:e,dragger:l})}});return(u=l.start(e.clientX,e.clientY,this.playgroundConfig))==null?void 0:u.then(()=>o)}async dropCard(e,n,r,i){const s=this.playgroundConfig.getPosFromMouseEvent(n);if(!this.playgroundConfig.getViewport().contains(s.x,s.y))return;const o=this.adjustSubNodePosition(e,i,s);return await this.document.createWorkflowNodeByType(e,o,r,i==null?void 0:i.id)}async startDragCard(e,n,r,i){let s,o={x:0,y:0};const a=new Nb;return await new Ja({onDragStart:u=>{const h=n.currentTarget;s=i?i(u):h.cloneNode(!0);const p=h.getBoundingClientRect();o={x:p.left,y:p.top},ft.setStyle(s,{zIndex:1e3,position:"absolute",left:o.x,top:o.y,boxShadow:"0 6px 8px 0 rgba(28, 31, 35, .2)"}),document.body.appendChild(s),this.updateDroppableTransforms()},onDrag:u=>{const h=u.endPos.x-u.startPos.x,p=u.endPos.y-u.startPos.y,g=o.x+h,v=o.y+p;s.style.left=`${g}px`,s.style.top=`${v}px`;const{x:w,y:S}=this.playgroundConfig.getPosFromMouseEvent(u),E=new Qe(w,S,170,90),x=this._droppableTransforms.find(I=>{const{bounds:P,entity:M}=I,k=this.document.layout.getPadding(M),A=new Qe(P.x+k.left+k.right,P.y,P.width,P.height);return Qe.intersects(E,A)});this.updateDropNode(x==null?void 0:x.entity)},onDragEnd:async u=>{const h=this._dropNode,{allowDrop:p}=this.canDropToNode({dragNodeType:e,dropNode:h}),g=p?await this.dropCard(e,u,r,h):void 0;this.clearDrop(),g?(s.remove(),a.resolve(g)):(s.style.transition="all ease .2s",s.style.left=`${o.x}px`,s.style.top=`${o.y}px`,await bc(200),s.remove(),a.resolve())}}).start(n.clientX,n.clientY),a.promise}adjustSubNodePosition(e,n,r,i=!0){if(!r)return{x:0,y:0};if(!e||!n||n.flowNodeType===In.ROOT)return r;const s=!n.children||n.children.length===0,o=this.document.layout.getPadding(n),a=n.getData(qt);return s&&i?{x:0,y:o.top}:{x:r.x-a.position.x,y:r.y-a.position.y}}registerPosAdjuster(e){return this.posAdjusters.add(e),{dispose:()=>this.posAdjusters.delete(e)}}canDropToNode(e){const{dragNodeType:n,dropNode:r}=e;return n?{allowDrop:!0,dropNode:r}:{allowDrop:!1,message:"Please select a node to drop"}}getDragPosOffset(e){const{event:n,selectedNodes:r,startPosition:i}=e,{finalScale:s}=this.playgroundConfig,o={x:(n.endPos.x-n.startPos.x)/s,y:(n.endPos.y-n.startPos.y)/s},a={x:i.x+o.x,y:i.y+o.y};return Array.from(this.posAdjusters.values()).map(h=>h({selectedNodes:r,position:a})).reduce((h,p)=>({x:h.x+p.x,y:h.y+p.y}),o)}updateDroppableTransforms(){this._droppableTransforms=this.document.getRenderDatas(at,!1).filter(e=>{const{entity:n}=e;return n.originParent?this.nodeSelectable(n)&&this.nodeSelectable(n.originParent):this.nodeSelectable(n)}).filter(e=>this.isContainer(e.entity))}isContainer(e){return(e==null?void 0:e.getNodeMeta().isContainer)??!1}getNodesPosition(e){const n=Qe.enlarge(e.map(i=>i.getData(at).bounds));return{x:n.x,y:n.y}}nodeSelectable(e){const n=e.getNodeMeta().selectable;return typeof n=="function"?n(e):n}updateDropNode(e){if(this._dropNode){if(this._dropNode.id===(e==null?void 0:e.id))return;this.selectService.clear()}e&&this.selectService.selectNode(e),this._dropNode=e}clearDrop(){this._dropNode&&this.selectService.clear(),this._dropNode=void 0,this._droppableTransforms=[]}setLineColor(e,n){e.highlightColor=n,this.hoverService.clearHovered()}handleDragOnNode(e,n,r,i,s){return i&&((s==null?void 0:s.toPort)===i||i.portType==="input"&&this.linesManager.canAddLine(n,i,!0))?(this.hoverService.updateHoveredKey(i.id),r.setToPort(i),this._onDragLineEventEmitter.fire({type:"onDrag",onDragNodeId:e.id}),{hasError:!1}):this.isContainer(e)?{hasError:!1}:(this.setLineColor(r,this.linesManager.lineColor.error),{hasError:!0})}childrenOfContainer(e){var i;if(e.length===0)return;const n=(i=e[0])==null?void 0:i.parent;if(!(!n||n.collapsedChildren.length!==e.length||!e.every(s=>(s==null?void 0:s.parent)===n)))return n}async startDrawingLine(e,n,r){const i=!r&&e.isErrorPort()&&e.disabled;if(r!=null&&r.disabled||i||this.playgroundConfig.readonly||this.playgroundConfig.disabled)return{dragSuccess:!1,newLine:void 0};this.selectService.clear();const s=this.playgroundConfig,o=new Nb,a=s.cursor;let l,u,h,p=!1;const g=Date.now();let v=!1;return await new Ja({onDrag:S=>{if(!l&&a3(Date.now()-g,S,r)){if(r&&(r.highlightColor=this.linesManager.lineColor.hidden),v=!0,l=this.linesManager.createLine({from:e.node.id,fromPort:e.portID,drawingTo:s.getPosFromMouseEvent(n)}),!l)return;s.updateCursor("grab"),l.highlightColor=this.linesManager.lineColor.drawing,this.hoverService.updateHoveredKey("")}if(!l)return;p=!1;const E=s.getPosFromMouseEvent(S);if(h=this.linesManager.getNodeFromMousePos(E),u=this.linesManager.getPortFromMousePos(E),u?this.linesManager.canAddLine(e,u,!0)?l.setToPort(u):(l.highlightColor=this.linesManager.lineColor.error,p=!0,l.setToPort(void 0)):l.setToPort(void 0),this._onDragLineEventEmitter.fire({type:"onDrag"}),this.setLineColor(l,this.linesManager.lineColor.drawing),h&&!this.isContainer(h)){const x=h.getData(gl),{inputPorts:I}=x;I.length===1&&(u=I[0]);const{hasError:P}=this.handleDragOnNode(h,e,l,u,r);p=P}l.toPort?l.drawingTo={x:l.toPort.point.x,y:l.toPort.point.y}:l.drawingTo={x:E.x,y:E.y},r==null||r.validate(),l.validate()},onDragEnd:async S=>{const E=s.getPosFromMouseEvent(S),x=Array.from(this._onDragLineEndCallbacks.values());s.updateCursor(a),await Promise.all(x.map(P=>P({fromPort:e,toPort:u,mousePos:E,line:l,originLine:r,event:S}))),l==null||l.dispose(),this._onDragLineEventEmitter.fire({type:"onDragEnd"}),r&&(r.highlightColor="");const I=()=>{r==null||r.validate(),o.resolve({dragSuccess:v})};if(v){if(r&&r.toPort===u||u&&u.portType!=="input")return I();const P=u?{from:e.node.id,fromPort:e.portID,to:u.node.id,toPort:u.portID}:void 0;if(r&&u&&!this.linesManager.canReset(r.fromPort,r.toPort,u)||r&&(!this.linesManager.canRemove(r,P,!1)||p)||(r==null||r.dispose(),!u||!this.linesManager.canAddLine(e,u,!1)))return I();const k=this.linesManager.createLine(P);k||I(),o.resolve({dragSuccess:v,newLine:k})}else I()}}).start(n.clientX,n.clientY,s),o.promise}async resetLine(e,n){const{fromPort:r}=e,{dragSuccess:i}=await this.startDrawingLine(r,n,e);i||this.selectService.select(e)}onDragLineEnd(e){const n=Wi();return this._onDragLineEndCallbacks.set(n,e),{dispose:()=>{this._onDragLineEndCallbacks.delete(n)}}}};$t([oe(qn)],yr.prototype,"playgroundConfig",2);$t([oe(Zs)],yr.prototype,"hoverService",2);$t([oe(Et)],yr.prototype,"document",2);$t([oe(oi)],yr.prototype,"linesManager",2);$t([oe(Ew)],yr.prototype,"commandService",2);$t([oe(or)],yr.prototype,"selectService",2);$t([oe(Iw)],yr.prototype,"operationService",2);$t([oe(Wv)],yr.prototype,"options",2);$t([Ai()],yr.prototype,"init",1);yr=$t([$e()],yr);var wQ=async(e,n)=>{const r={};return e.forEach(i=>{const s=i.getData(qt),o=i.getData(at);r[i.id]={x:s.position.x,y:s.position.y+o.bounds.height/2}}),new Promise(i=>{mI({from:{d:0},to:{d:100},duration:300,onUpdate:s=>{e.forEach(o=>{const a=o.getData(qt),l=(n[o.id].x-a.position.x)*s.d/100,u=(n[o.id].y-a.bounds.height/2-a.position.y)*s.d/100;a.update({position:{x:a.position.x+l,y:a.position.y+u}}),o.document.layout.updateAffectedTransform(o)})},onComplete:()=>{i(r)}})})},yc=class{constructor(){this._resetLayoutEmitter=new qe,this.onResetLayout=this._resetLayoutEmitter.event,this._toDispose=new jt}init(){this._toDispose.push(this._resetLayoutEmitter)}fireResetLayout(e,n,r){this._resetLayoutEmitter.fire({nodeIds:e,positionMap:n,oldPositionMap:r})}async layoutToPositions(e,n){const r=e.map(s=>this._entityManager.getEntityById(s)).filter(Boolean),i=await wQ(r,n);return jw(this._document,this._config,!0),i}dispose(){this._toDispose.dispose()}};$t([oe(qn)],yc.prototype,"_config",2);$t([oe(Et)],yc.prototype,"_document",2);$t([oe(Sn)],yc.prototype,"_entityManager",2);$t([Ai()],yc.prototype,"init",1);yc=$t([$e()],yc);var k9=class extends Sh{constructor(){super(...arguments),this.onNodePostionUpdateEmitter=new qe,this.onNodePostionUpdate=this.onNodePostionUpdateEmitter.event}updateNodePosition(e,n){const r=this.toNodeEntity(e);if(!r)return;const i=r.getData(qt),s={x:i.position.x,y:i.position.y};i.update({position:n}),this.onNodePostionUpdateEmitter.fire({node:r,oldPosition:s,newPosition:n})}};$t([oe(Et)],k9.prototype,"document",2);function L9(e){const n=ai();return Cs(),R.useEffect(()=>{let r;return()=>r==null?void 0:r.dispose()},[e]),n.config.readonly}function l3(e){return e&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!e.closest(".flow-canvas-not-draggable")}function xc(e){var j,V;const n=R.useContext(Sw),r=n.getData(zn),i=n.getData(gl),s=L9(),o=Wt(yr),a=Wt(or),l=R.useRef(!1),u=R.useRef(null),[h,p]=R.useState("");R.useEffect(()=>{const $=o.onDragLineEventChange(({type:W,onDragNodeId:B})=>{p(W==="onDrag"&&B||"")});return()=>{$.dispose()}},[]);const g=R.useCallback($=>{var W;$.preventDefault(),a.isSelected(n.id)||v($),!(!l3($.target)||!l3(document.activeElement))&&(l.current=!0,(W=o.startDragSelectedNodes($))==null||W.finally(()=>setTimeout(()=>{l.current=!1})))},[o,n]),v=R.useCallback($=>{l.current||($.shiftKey?a.toggleSelect(n):a.selectNode(n),$.target&&$.target.focus())},[n]),w=R.useCallback(()=>n.dispose(),[n]);DK(i.onDataChange);const S=(V=(j=navigator==null?void 0:navigator.userAgent)==null?void 0:j.includes)==null?void 0:V.call(j,"Firefox"),E=R.useCallback(()=>{var $;S&&(($=u.current)==null||$.setAttribute("draggable","false"))},[]),x=R.useCallback(()=>{var $;S&&(($=u.current)==null||$.setAttribute("draggable","true"))},[]),I=R.useCallback(()=>n.getExtInfo(),[n]),P=R.useCallback($=>{n.updateExtInfo($)},[n]),M=R.useMemo(()=>Km(n),[n]),k=G6(M==null?void 0:M.state),A=R.useCallback(()=>{r.toggleExpand()},[r]);return{node:n,selected:a.isSelected(n.id),activated:a.isActivated(n.id),expanded:r.expanded,startDrag:g,ports:i.allPorts,deleteNode:w,selectNode:v,readonly:s,linkingNodeId:h,nodeRef:u,onFocus:E,onBlur:x,getExtInfo:I,updateExtInfo:P,toggleExpand:A,get form(){if(M)return{...M,get values(){return M.values},get state(){return k}}}}}function Vh(){return NI()}var mu=(e=>(e.GRAB="GRAB",e.SELECT="SELECT",e))(mu||{}),Op=(e=>(e.MOUSE="MOUSE",e.PAD="PAD",e))(Op||{}),Zb=class{registerDocument(e){e.registerNodeDatas(at,zn,gl,el),e.registerLayout(this.freeLayout)}};$t([oe(ng)],Zb.prototype,"freeLayout",2);Zb=$t([$e()],Zb);function _Q(){return location.search.replace(/^\?/,"").split("&").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}var CQ=new Mo((e,n,r,i)=>{e(Et).toSelf().inSingletonScope(),e(oi).toSelf().inSingletonScope(),e(ng).toSelf().inSingletonScope(),e(yr).toSelf().inSingletonScope(),e(or).toSelf().inSingletonScope(),e(Zs).toSelf().inSingletonScope(),e(yc).toSelf().inSingletonScope(),e(Aw).to(k9).inSingletonScope(),e(YG).toDynamicValue(()=>_Q()).inSingletonScope(),Lv(e,Zb,[kI]),e(Wv).toConstantValue({...Su}),i(On).toService(Et),e(vQ).toDynamicValue(s=>()=>s.container.get(Et)).inSingletonScope()}),EQ=Object.defineProperty,xQ=Object.getOwnPropertyDescriptor,Eg=(e,n,r,i)=>{for(var s=i>1?void 0:i?xQ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&EQ(n,r,s),s},tE=(e,n)=>(r,i)=>n(r,i,e),na=class extends Wr{constructor(e,n){super(e),this.opts=n;const{variableEngine:r}=n||{};this.variableEngine=r,this._public=this.variableEngine.createScope(this.entity.id,{node:this.entity,type:"public"}),this.toDispose.push(this._public)}get private(){return this._private}get public(){return this._public}setVar(e,n){if(typeof e=="string"&&n!==void 0)return this.public.ast.set(e,n);if(typeof e=="object"&&n===void 0)return this.public.ast.set("outputs",e);throw new Error("Invalid arguments")}getVar(e="outputs"){return this.public.ast.get(e)}clearVar(e="outputs"){return this.public.ast.remove(e)}setPrivateVar(e,n){if(typeof e=="string"&&n!==void 0)return this.initPrivate().ast.set(e,n);if(typeof e=="object"&&n===void 0)return this.initPrivate().ast.set("outputs",e);throw new Error("Invalid arguments")}getPrivateVar(e="outputs"){var n;return(n=this.private)==null?void 0:n.ast.get(e)}clearPrivateVar(e="outputs"){var n;return(n=this.private)==null?void 0:n.ast.remove(e)}get allScopes(){const e=[];return this._public&&e.push(this._public),this._private&&e.push(this._private),e}getDefaultData(){return{}}initPrivate(){return this._private||(this._private=this.variableEngine.createScope(`${this.entity.id}_private`,{node:this.entity,type:"private"}),this._private.coverScopes.forEach(e=>{e.refreshDeps()}),this._private.depScopes.forEach(e=>{e.refreshCovers()}),this._private.available.refresh(),this.toDispose.push(this._private)),this._private}};na.type="FlowNodeVariableData";var YI=Symbol("VariableLayoutConfig"),ms=class extends p9{static is(e){return e.id===ms.ID}setVar(e,n){if(typeof e=="string"&&n!==void 0)return this.ast.set(e,n);if(typeof e=="object"&&n===void 0)return this.ast.set("outputs",e);throw new Error("Invalid arguments")}getVar(e="outputs"){return this.ast.get(e)}clearVar(e="outputs"){return this.ast.remove(e)}};ms.ID=Symbol("GlobalScope");ms=Eg([$e()],ms);var SQ=e=>{e(ms).toDynamicValue(n=>{const r=n.container.get(pl);let i=r.getScopeById(ms.ID);return i||(i=r.createScope(ms.ID,{},{ScopeConstructor:ms}),r.chain.refreshAllChange()),i})},qv=class extends Hu{get tree(){return this.flowDocument.originTree}onInit(){this.toDispose.pushAll([this.entityManager.onEntityDataChange(({entityDataType:e})=>{e===el.type&&this.refreshAllChange()}),this.tree.onTreeChange(()=>{this.refreshAllChange()})])}getAllInputLayerNodes(e){var n;return(((n=e.getData(el))==null?void 0:n.allInputNodes)||[]).filter(r=>r.parent===e.parent)}getAllOutputLayerNodes(e){var n;return(((n=e.getData(el))==null?void 0:n.allOutputNodes)||[]).filter(r=>r.parent===e.parent)}getDeps(e){const{node:n}=e.meta||{};if(!n)return this.transformDeps([],{scope:e});const r=[];let i=n;for(;i;){const a=this.getAllInputLayerNodes(i);r.push(...a.map(u=>u.getData(na).public).filter(Boolean));const l=i.getData(na);l!=null&&l.private&&e!==l.private&&r.push(l.private),i=this.getParent(i)}const s=this.variableEngine.getScopeById(ms.ID);s&&r.unshift(s);const o=Array.from(new Set(r));return this.transformDeps(o,{scope:e})}getCovers(e){if(ms.is(e))return this.variableEngine.getAllScopes({sort:!0}).filter(l=>!ms.is(l));const{node:n}=e.meta||{};if(!n)return this.transformCovers([],{scope:e});const r=e.meta.type==="private",i=[];r?i.push(...this.getChildren(n)):i.push(...this.getAllOutputLayerNodes(n)||[]);const s=[];for(;i.length;){const l=i.shift(),u=l.getData(na);s.push(...u.allScopes);const h=l&&this.getChildren(l);h!=null&&h.length&&i.push(...h)}const o=n.getData(na);r&&o.public&&s.push(o.public);const a=Array.from(new Set(s));return this.transformCovers(a,{scope:e})}transformCovers(e,{scope:n}){var r;return(r=this.configs)!=null&&r.transformCovers?this.configs.transformCovers(e,{scope:n,document:this.flowDocument,variableEngine:this.variableEngine}):e}transformDeps(e,{scope:n}){var r;return(r=this.configs)!=null&&r.transformDeps?this.configs.transformDeps(e,{scope:n,document:this.flowDocument,variableEngine:this.variableEngine}):e}getChildren(e){var i,s,o,a;if((i=this.configs)!=null&&i.getFreeChildren)return(o=(s=this.configs).getFreeChildren)==null?void 0:o.call(s,e);const n=e.getNodeMeta(),r=(a=n.subCanvas)==null?void 0:a.call(n,e);return r?r.isCanvas?[]:r.canvasNode.collapsedChildren:this.tree.getChildren(e)}getParent(e){var s,o;if((s=this.configs)!=null&&s.getFreeParent)return this.configs.getFreeParent(e);const n=e.document.originTree.getParent(e);if(!n)return n;const r=n.getNodeMeta(),i=(o=r.subCanvas)==null?void 0:o.call(r,n);return i!=null&&i.isCanvas?i.parentNode:n}sortAll(){return console.warn("FreeLayoutScopeChain.sortAll is not implemented"),[]}};Eg([oe(Sn)],qv.prototype,"entityManager",2);Eg([oe(On)],qv.prototype,"flowDocument",2);Eg([pr(),oe(YI)],qv.prototype,"configs",2);Eg([Ai()],qv.prototype,"onInit",1);var xN=class extends Hu{constructor(e,n){super(),this.flowDocument=e,this.configs=n,this.bindTree(e.originTree),this.toDispose.push(e.originTree.onTreeChange(()=>{this.refreshAllChange()}))}bindTree(e){this.tree=e}getDeps(e){if(!this.tree)return this.transformDeps([],{scope:e});const n=e.meta.node;if(!n)return this.transformDeps([],{scope:e});const r=[];let i=n;for(;i;){const{parent:o,pre:a}=this.tree.getInfo(i),l=this.getVariableData(i);if(i===n?e.meta.type==="public"&&(l!=null&&l.private)&&r.unshift(l.private):this.hasChildren(i)&&!this.isNodeChildrenPrivate(i)&&r.unshift(...this.getAllSortedChildScope(i,{ignoreNodeChildrenPrivate:!0})),l&&i!==n&&r.unshift(l.public),a){i=a;continue}if(o){let u=o,h=this.tree.getPre(u);for(;u;){const p=this.getVariableData(u);if(p&&r.unshift(...p.allScopes),h)break;u=this.tree.getParent(u),h=u?this.tree.getPre(u):void 0}i=h;continue}i=void 0}const s=this.variableEngine.getScopeById(ms.ID);return s&&r.unshift(s),this.transformDeps(r,{scope:e})}getCovers(e){if(!this.tree)return this.transformCovers([],{scope:e});if(ms.is(e))return this.variableEngine.getAllScopes({sort:!0}).filter(s=>!ms.is(s));const n=e.meta.node;if(!n)return this.transformCovers([],{scope:e});const r=[];if(e.meta.type==="private")return r.push(...this.getAllSortedChildScope(n,{addNodePrivateScope:!0})),this.transformCovers(r,{scope:e});let i=n;for(;i;){const{next:s,parent:o}=this.tree.getInfo(i),a=this.getVariableData(i);if(i!==n&&(this.hasChildren(i)?r.push(...this.getAllSortedChildScope(i,{addNodePrivateScope:!0})):a&&r.push(...a.allScopes)),s){i=s;continue}if(o){let l=o,u=this.tree.getNext(l);for(;l;){if(this.isNodeChildrenPrivate(l))return this.transformCovers(r,{scope:e});if(u)break;l=this.tree.getParent(l),u=l?this.tree.getNext(l):void 0}if(!u&&l)break;i=u;continue}i=void 0}return this.transformCovers(r,{scope:e})}transformCovers(e,{scope:n}){var r;return(r=this.configs)!=null&&r.transformCovers?this.configs.transformCovers(e,{scope:n,document:this.flowDocument,variableEngine:this.variableEngine}):e}transformDeps(e,{scope:n}){var r;return(r=this.configs)!=null&&r.transformDeps?this.configs.transformDeps(e,{scope:n,document:this.flowDocument,variableEngine:this.variableEngine}):e}sortAll(){const e=this.flowDocument.getAllNodes().find(o=>o.isStart);if(!e)return[];const r=e.getData(na).public,i=this.getDeps(r),s=this.getCovers(r).filter(o=>!i.includes(o)&&o!==r);return[...i,r,...s]}getVariableData(e){if(e.flowNodeType!=="virtualNode"&&!e.id.startsWith("$"))return e.getData(na)}isNodeChildrenPrivate(e){var r,i;return(r=this.configs)!=null&&r.isNodeChildrenPrivate?e?(i=this.configs)==null?void 0:i.isNodeChildrenPrivate(e):!1:!(e==null?void 0:e.id.startsWith("$"))&&this.hasChildren(e)}hasChildren(e){return!!(this.tree&&e&&this.tree.getChildren(e).length>0)}getAllSortedChildScope(e,{ignoreNodeChildrenPrivate:n,addNodePrivateScope:r}={}){var a;const i=[],s=this.getVariableData(e);if(s&&i.push(s.public),n&&this.isNodeChildrenPrivate(e))return i;r&&(s!=null&&s.private)&&i.push(s.private);const o=((a=this.tree)==null?void 0:a.getChildren(e))||[];return i.push(...o.map(l=>this.getAllSortedChildScope(l,{ignoreNodeChildrenPrivate:n,addNodePrivateScope:r})).flat()),i}};xN=Eg([tE(0,oe(On)),tE(1,pr()),tE(1,oe(YI))],xN);var DQ=Gn({onBind({bind:e},n){const{layout:r,layoutConfig:i}=n;r==="free"&&e(Hu).to(qv).inSingletonScope(),r==="fixed"&&e(Hu).to(xN).inSingletonScope(),i&&e(YI).toConstantValue(i||{}),SQ(e)},onInit(e,n){const{extendASTNodes:r}=n||{},i=e.get(pl),s=e.get(av),o=e.get(Sn),a=e.get(On);(r||[]).forEach(l=>{if(Array.isArray(l)){const[u,h]=l;s.registerAST(u,h?()=>h(e):void 0);return}s.registerAST(l)}),o.registerEntityData(na,()=>({variableEngine:i})),a.registerNodeDatas(na)},containerModules:[KG]}),NQ=Object.defineProperty,IQ=Object.getOwnPropertyDescriptor,Bh=(e,n,r,i)=>{for(var s=i>1?void 0:i?IQ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&NQ(n,r,s),s},SN=Symbol("ShortcutsContribution"),Ku=class{constructor(){this.shortcutsHandlers=[]}addHandlers(...e){e.forEach(n=>{this.commandRegistry.getCommand(n.commandId)?this.commandRegistry.registerHandler(n.commandId,{execute:n.execute,isEnabled:n.isEnabled}):this.commandRegistry.registerCommand({id:n.commandId,...n.commandDetail||{}},{execute:n.execute,isEnabled:n.isEnabled})}),this.shortcutsHandlers.unshift(...e)}addHandlersIfNotFound(...e){e.forEach(n=>{this.has(n.commandId)||this.addHandlers(n)})}has(e){return this.shortcutsHandlers.some(n=>n.commandId===e)}init(){var e;(e=this.contribs)==null||e.forEach(n=>n.registerShortcuts(this))}};Bh([oe(rI),n6(SN),pr()],Ku.prototype,"contribs",2);Bh([oe(Qa)],Ku.prototype,"commandRegistry",2);Bh([Ai()],Ku.prototype,"init",1);Ku=Bh([$e()],Ku);var OQ=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),j9={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:OQ?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,"=":187,comma:188,dash:189,"-":189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},DN={ctrl:e=>e.ctrlKey,shift:e=>e.shiftKey,alt:e=>e.altKey,meta:e=>e.type==="keyup"?j9.meta.includes(e.keyCode):e.metaKey};function TQ(e){const n=Object.keys(DN).reduce((r,i)=>DN[i](e)?r+1:r,0);return[16,17,18,91,92].includes(e.keyCode)?n:n+1}function MQ(e,n,r=!0){if(!e.key||!n)return!1;const i=n.split(/\s+/);let s=0;for(const o of i){const a=DN[o],l=j9[o.toLowerCase()];(a&&a(e)||l&&l===e.keyCode)&&s++}return r?s===i.length&&TQ(e)===i.length:s===i.length}function PQ(e,n){return n.some(r=>MQ(e,r))}var rg=class extends er{onReady(){this.shortcuts.addHandlersIfNotFound({commandId:wh.Default.ZOOM_IN,shortcuts:["meta =","ctrl ="],execute:()=>{this.config.zoomin()}},{commandId:wh.Default.ZOOM_OUT,shortcuts:["meta -","ctrl -"],execute:()=>{this.config.zoomout()}}),this.toDispose.pushAll([this.listenPlaygroundEvent("keydown",e=>{!this.isFocused||e.target!==this.playgroundNode||this.shortcuts.shortcutsHandlers.some(n=>{if(PQ(e,n.shortcuts)&&(!n.isEnabled||n.isEnabled(e)))return n.execute(e),e.preventDefault(),!0})})])}};rg.type="ShortcutsLayer";Bh([oe(Ku)],rg.prototype,"shortcuts",2);Bh([oe(oa)],rg.prototype,"selection",2);rg=Bh([$e()],rg);var F9=Gn({onBind:({bind:e})=>{e(Ku).toSelf().inSingletonScope(),iI(e,SN)},onInit:e=>{e.playground.registerLayer(rg)},contributionKeys:[SN]});function AQ({nodeManager:e,formManager:n,material:r}){const{setters:i=[],decorators:s=[],effects:o=[],validators:a=[],nodeErrorRender:l,nodePlaceholderRender:u}=r;l&&XK(e,l),u&&ZK(e,u),i.forEach(h=>{n.registerAbilityExtension($6.type,h)}),s.forEach(h=>{n.registerAbilityExtension(B6.type,h)}),o.forEach(h=>{n.registerAbilityExtension(jK.type,h)}),a.forEach(h=>{n.registerAbilityExtension(FK.type,h)})}var RQ=Gn({onInit(e,n){e.get(On).registerNodeDatas(...QK());const r=a=>new _W(a);if(e.get(Sn).registerEntityData(gr,()=>({formModelFactory:r})),!n.materials)return;const s=e.get(ll),o=e.get(Oo);if(!s||!o)throw new Error("NodeCorePlugin Error: nodeManager or formManager not found");AQ({nodeManager:s,formManager:o,material:n.materials})},onDispose(e){var n;(n=e.get(Oo))==null||n.dispose()},containerModules:KK()}),kQ=Gn({onInit:(e,n)=>{n.onLanguageChange&&e.playground.toDispose.push(vb.onLanguageChange(n.onLanguageChange)),n.languages&&n.languages.forEach(r=>vb.addLanguage(r)),n.localLanguage&&vb.setLocalLanguage(n.localLanguage)}}),LQ=Object.defineProperty,jQ=Object.getOwnPropertyDescriptor,xg=(e,n,r,i)=>{for(var s=i>1?void 0:i?jQ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&LQ(n,r,s),s},dv=class{constructor(){var e;this.devTools=(e=window.__REDUX_DEVTOOLS_EXTENSION__)==null?void 0:e.connect({name:this.getName()})}init(){this.devTools&&(this.devTools.init(this.getState()),this.devTools.subscribe(e=>{var n;((n=e==null?void 0:e.payload)==null?void 0:n.type)==="COMMIT"&&this.devTools.init(this.getState())}),this.onInit())}send(e,n){this.devTools&&this.devTools.send(e,n||this.getState())}};xg([Ai()],dv.prototype,"init",1);dv=xg([$e()],dv);var hv=class extends dv{getName(){return"@flowgram.ai/EntityManager"}getState(){return this.entityManager.storeState({configOnly:!1})}onInit(){this.entityManager.onEntityLifeCycleChange(e=>{this.send(`${e.type}/${e.entity.type}/${e.entity.id}`)})}};xg([oe(Sn)],hv.prototype,"entityManager",2);hv=xg([$e()],hv);var fv=class extends dv{constructor(){super(...arguments),this.scopes={}}getName(){return"@flowgram.ai/VariableEngine"}getState(){return{scopes:this.scopes,variables:this.variableEngine.globalVariableTable.variables}}getScopeState(e){return{ast:e==null?void 0:e.ast.toJSON(),output:e.output.variables,available:e.available.variables}}onInit(){this.variableEngine.onScopeChange(e=>{const{scope:n,type:r}=e;r==="delete"?delete this.scopes[String(n.id)]:this.scopes={...this.scopes,[n.id]:this.getScopeState(n)},this.send(`${r}/${String(n.id)}`)})}};xg([oe(pl)],fv.prototype,"variableEngine",2);fv=xg([$e()],fv);var FQ=Gn({onBind({bind:e},n){const{enable:r}=n;r&&(e(hv).toSelf().inSingletonScope(),e(fv).toSelf().inSingletonScope())},onInit(e,n){const{enable:r,ecs:i=!0,variable:s=!1}=n;r&&(i&&e.get(hv),s&&e.get(fv))}}),$Q=({children:e})=>{const n=NI(),r=R.useMemo(()=>n.getData(na).public,[n]);return D.createElement(WG,{value:{scope:r}},e)},zQ=e=>n=>D.createElement($Q,null,D.createElement(e,{...n})),VQ=Gn({onInit(e){e.get(ll).registerNodeRenderHoc(zQ)}});EW("VariableProviderPlugin",{onInit:(e,n)=>{},effect:{arr:[{event:i8.onValueInitOrChange,effect:()=>{}}]},onDispose:(e,n)=>{}});var BQ=Gn({onInit(e,n){const r=e.get(bs);r.registerReactComponent(v8.NODE_RENDER,n.renderDefaultNode||(()=>null)),n.renderTexts&&r.registerText(n.renderTexts),n.renderNodes&&Object.keys(n.renderNodes).forEach(i=>r.registerReactComponent(i,n.renderNodes[i]))}}),HQ=Object.defineProperty,UQ=Object.getOwnPropertyDescriptor,cr=(e,n,r,i)=>{for(var s=i>1?void 0:i?UQ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&HQ(n,r,s),s},XI=Symbol("OperationContribution"),Ah=class{constructor(){this._operationMetas=new Map,this.contributions=[]}init(){var e;for(const n of this.contributions)(e=n.registerOperationMeta)==null||e.call(n,this)}registerOperationMeta(e){return this._operationMetas.has(e.type)?(console.warn(`A operation meta ${e.type} is already registered.`),on.NULL):new jt(this._doRegisterOperationMetaMeta(e))}getOperationMeta(e){return this._operationMetas.get(e)}_doRegisterOperationMetaMeta(e){return this._operationMetas.set(e.type,e),{dispose:()=>{this._operationMetas.delete(e.type)}}}};cr([wc(XI),pr()],Ah.prototype,"contributions",2);cr([Ai()],Ah.prototype,"init",1);Ah=cr([$e()],Ah);var pv=class{};pv=cr([$e()],pv);var Rh=class{constructor(){this.generateId=()=>Wi(),this.getSnapshot=()=>""}};Rh=cr([$e()],Rh);var mc=class{constructor(){this.applyEmitter=new qe,this.onApply=this.applyEmitter.event,this._toDispose=new jt}init(){this._toDispose.push(this.applyEmitter)}applyOperation(e,n){const r=this.operationRegistry.getOperationMeta(e.type);if(!r)throw new Error(`Operation meta ${e.type} has not registered.`);let i;return n!=null&&n.noApply||(i=r.apply(e,this.context.source)),this.applyEmitter.fire(e),i}getOperationLabel(e){const n=this.operationRegistry.getOperationMeta(e.type);if(n&&n.getLabel)return n.getLabel(e,this.context.source)}getOperationDescription(e){const n=this.operationRegistry.getOperationMeta(e.type);if(n&&n.getDescription)return n.getDescription(e,this.context.source)}inverseOperations(e){return e.map(n=>this.inverseOperation(n)).reverse()}inverseOperation(e){const n=this.operationRegistry.getOperationMeta(e.type);if(!n)throw new Error(`Operation meta ${e.type} has not registered.`);return n.inverse(e)}dispose(){this._toDispose.dispose()}};cr([oe(Ah)],mc.prototype,"operationRegistry",2);cr([oe(pv)],mc.prototype,"context",2);cr([oe(Rh)],mc.prototype,"config",2);cr([Ai()],mc.prototype,"init",1);mc=cr([$e()],mc);var Qb=class{constructor(){this._undoing=!1,this._redoing=!1,this._limit=100,this.onChangeEmitter=new qe,this.onChange=this.onChangeEmitter.event,this._toDispose=new jt,this._undoStack=[],this._redoStack=[],this._toDispose.push(this.onChangeEmitter)}setLimit(e){this._limit=e}pushElement(e){this._redoStack=[],this._stackPush(this._undoStack,e),this._toDispose.push(e),this._emitChange("push",e)}getUndoStack(){return this._undoStack}getRedoStack(){return this._redoStack}getLastElement(){return this._undoStack[this._undoStack.length-1]}async undo(){if(!this.canUndo()||this._undoing)return;this._undoing=!0;const e=this._undoStack.pop();try{await e.undo()}finally{this._stackPush(this._redoStack,e),this._emitChange("undo",e),this._undoing=!1}}async redo(){if(!this.canRedo()||this._redoing)return;this._redoing=!0;const e=this._redoStack.pop();try{await e.redo()}finally{this._stackPush(this._undoStack,e),this._emitChange("redo",e),this._redoing=!1}}canUndo(){return this._undoStack.length>0}canRedo(){return this._redoStack.length>0}canPush(){return!this._redoing&&!this._undoing}clear(){this.clearRedoStack(),this.clearUndoStack(),this._emitChange("clear")}clearRedoStack(){this._redoStack.forEach(e=>{e.dispose()}),this._redoStack=[]}clearUndoStack(){this._undoStack.forEach(e=>{e.dispose()}),this._undoStack=[]}dispose(){this.clear(),this._toDispose.dispose()}_stackPush(e,n){e.push(n),e.length>this._limit&&e.shift()}_emitChange(e,n){n?this.onChangeEmitter.fire({type:e,element:n}):this.onChangeEmitter.fire({type:e})}};Qb=cr([$e()],Qb);var c3=class{constructor(e,n=[]){this._toDispose=new jt,this._timestamp=Date.now(),this._operationService=e,this._operations=n.map(r=>this._operation(r)),this._id=e.config.generateId()}get id(){return this._id}getTimestamp(){return this._timestamp}pushOperation(e){const n=this._operation(e);return this._operations.push(n),n}getOperations(){return this._operations}getChangeOperations(e){return e==="undo"?this._operationService.inverseOperations(this._operations):this._operations}getFirstOperation(){return this._operations[0]}getLastOperation(){return this._operations[this._operations.length-1]}async undo(){const e=this._operationService.inverseOperations(this._operations);for(const n of e)await this._apply(n)}async redo(){for(const e of this._operations)await this._apply(e)}revert(e){let n=this._operations;e!=="undo"&&(n=this._operations.map(r=>this._inverse(r)).reverse());for(const r of n)this._apply(r)}_inverse(e){return this._operationService.inverseOperation(e)}async _apply(e){await this._operationService.applyOperation(e)}_operation(e){return{...e,value:je.cloneDeep(e.value),id:this._operationService.config.generateId()}}dispose(){this._toDispose.dispose()}},ig=class{constructor(){this._items=[],this.onChangeEmitter=new qe,this.onChange=this.onChangeEmitter.event,this._toDispose=new jt,this.limit=100,this._toDispose.push(this.onChangeEmitter)}get items(){return this._items}add(e,n){const r=this._getHistoryItem(e,n);return this._items.unshift(r),this._items.length>this.limit&&this._items.pop(),this.onChangeEmitter.fire({type:"add",value:r,service:e}),r}findById(e){return this._items.find(n=>n.id===e)}changeByIndex(e,n,r){const i=this._getHistoryItem(n,r);this._items[e]=i,this.onChangeEmitter.fire({type:"update",value:i,service:n})}addOperation(e,n,r){const i=this._items.find(o=>o.id===n);if(!i){console.warn("no history item found");return}const s=this._getHistoryOperation(e,r);i.operations.push(s),this.onChangeEmitter.fire({type:"add_operation",value:{historyItem:i,operation:s},service:e})}updateOperation(e,n,r){const i=this._items.find(a=>a.id===n);if(!i){console.warn("no history item found");return}const s=i.operations.findIndex(a=>a.id===a.id);if(s<0){console.warn("no operation found");return}const o=this._getHistoryOperation(e,r);i.operations.splice(s,1,o),this.onChangeEmitter.fire({type:"update_operation",value:{historyItem:i,operation:o},service:e})}clear(){this._items=[]}dispose(){this._items=[],this._toDispose.dispose()}_getHistoryItem(e,n){return{...n,uri:e.context.uri,time:ig.dateFormat(n.timestamp),operations:n.operations.map(r=>this._getHistoryOperation(e,r,n.type!=="push"))}}_getHistoryOperation(e,n,r=!1){let i;if(r)i=this.historyConfig.generateId();else{const s=n.id;if(!s)throw new Error("no operation id found");i=s}return{...je.cloneDeep(n),id:i,label:e.operationService.getOperationLabel(n),description:e.operationService.getOperationDescription(n),timestamp:Date.now()}}static dateFormat(e){return new Date(e).toLocaleString()}};cr([oe(Rh)],ig.prototype,"historyConfig",2);ig=cr([$e()],ig);var ac=class{constructor(){this._historyServices=new Map,this._toDispose=new jt}registerHistoryService(e){const n=new jt;n.pushAll([e.undoRedoService.onChange(r=>{if(r.type==="clear")return;const{type:i,element:s}=r,o=s.getChangeOperations(i),a={id:i==="push"?s.id:this.historyConfig.generateId(),type:i,uri:e.context.uri,operations:o,timestamp:Date.now()};this.historyStack.add(e,a)}),e.onMerge(r=>{this._handleMerge(e,r)})]),this._historyServices.set(e,n),this._toDispose.push(e.onWillDispose(()=>{this.unregisterHistoryService(e)}))}unregisterHistoryService(e){const n=this._historyServices.get(e);n&&(n.dispose(),this._historyServices.delete(e))}getHistoryServiceByURI(e){for(const n of this._historyServices.keys())if(n.context.uri===e)return n}getFirstHistoryService(){for(const e of this._historyServices.keys())return e}dispose(){this._toDispose.dispose(),this.historyStack.dispose(),this._historyServices.forEach(e=>e.dispose()),this._historyServices.clear()}_handleMerge(e,n){const{element:r,operation:i}=n.value;if(this.historyStack.findById(r.id)){if(!i.id){console.warn("no operation id found");return}n.type==="UPDATE"&&this.historyStack.updateOperation(e,r.id,i),n.type==="ADD"&&this.historyStack.addOperation(e,r.id,i)}}};cr([oe(ig)],ac.prototype,"historyStack",2);cr([oe(Rh)],ac.prototype,"historyConfig",2);ac=cr([$e()],ac);var ar=class{constructor(){this._toDispose=new jt,this._transacting=!1,this._transactOperation=null,this._locked=!1,this._willDisposeEmitter=new qe,this._mergeEmitter=new qe,this.onWillDispose=this._willDisposeEmitter.event,this.onMerge=this._mergeEmitter.event}get onApply(){return this.operationService.onApply}init(){this._toDispose.push(this._willDisposeEmitter),this._toDispose.push(this._mergeEmitter)}start(){this._locked=!1}stop(){this._locked=!0}limit(e){this.undoRedoService.setLimit(e)}startTransaction(){if(this._transacting)return;this._transacting=!0;const e=new c3(this.operationService,[]);this._transactOperation=e}endTransaction(){const e=this._transactOperation;e&&(e.getOperations().length!==0&&this._pushStackOperation(e),this._transactOperation=null,this._transacting=!1)}transact(e){this._transacting||(this.startTransaction(),e(),this.endTransaction())}pushOperation(e,n){if(!this._canPush())return;const r=this._transactOperation||this.undoRedoService.getLastElement(),i=this.operationRegistry.getOperationMeta(e.type);if(!i)throw new Error(`Operation meta ${e.type} has not registered.`);if(i.shouldSave&&!i.shouldSave(e))return i.apply(e,this.context.source);const s=this.operationService.applyOperation(e,{noApply:n==null?void 0:n.noApply});i.getURI&&!e.uri&&(e.uri=i.getURI(e,this.context.source));const o=this._shouldMerge(e,r,i);if(o)if(typeof o=="object"){const a=r.getLastOperation();a.value=o.value,this._mergeEmitter.fire({type:"UPDATE",value:{element:r,operation:a,value:o.value}})}else{const a=r.pushOperation(e);this._mergeEmitter.fire({type:"ADD",value:{element:r,operation:a}})}else{const a=new c3(this.operationService,[e]);this._pushStackOperation(a)}return s}getHistoryOperations(){return this.historyManager.historyStack.items.reverse().map(e=>e.operations.map(n=>({...je.pick(n,["type","value"]),label:n.label||n.type}))).flat()}async undo(){await this.undoRedoService.undo()}async redo(){await this.undoRedoService.redo()}canUndo(){return this.undoRedoService.canUndo()}canRedo(){return this.undoRedoService.canRedo()}getSnapshot(){return this.config.getSnapshot()}getRecords(){throw new Error("Method not implemented.")}restore(e){throw new Error("Method not implemented.")}clear(){this.undoRedoService.clear()}dispose(){this._willDisposeEmitter.fire(this),this._toDispose.dispose()}_canPush(){return this._locked?!1:this.undoRedoService.canPush()}_pushStackOperation(e){this.undoRedoService.pushElement(e),this.undoRedoService.clearRedoStack()}_shouldMerge(e,n,r){return n?this._transacting?!0:r.shouldMerge&&r.shouldMerge(e,n.getLastOperation(),n):!1}};cr([oe(Qb)],ar.prototype,"undoRedoService",2);cr([oe(Ah)],ar.prototype,"operationRegistry",2);cr([oe(mc)],ar.prototype,"operationService",2);cr([oe(pv)],ar.prototype,"context",2);cr([oe(Rh)],ar.prototype,"config",2);cr([oe(ac)],ar.prototype,"historyManager",2);cr([Ai()],ar.prototype,"init",1);ar=cr([$e()],ar);var ZI=new Mo((e,n,r,i,s,o,a)=>{e(Ah).toSelf().inSingletonScope(),e(mc).toSelf().inSingletonScope(),e(Qb).toSelf().inSingletonScope(),e(ar).toSelf().inSingletonScope(),e(pv).toSelf().inSingletonScope(),e(ac).toSelf().inSingletonScope(),e(ig).toSelf().inSingletonScope(),e(Rh).toSelf().inSingletonScope(),o(ar,(l,u)=>{var p,g,v,w;let h;return(g=(p=l.container)==null?void 0:p.parent)!=null&&g.isBound(ac)?h=(w=(v=l.container)==null?void 0:v.parent)==null?void 0:w.get(ac):h=l.container.get(ac),h&&(u.historyManager=h,h.registerHistoryService(u)),u})});Gn({onInit:(e,n)=>{n.onApply&&e.get(mc).onApply(n.onApply.bind(null,e))},containerModules:[ZI]});var KQ=Object.getOwnPropertyDescriptor,WQ=(e,n,r,i)=>{for(var s=i>1?void 0:i?KQ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=a(s)||s);return s};function $9(e){var r;if(!e)return;const n=(r=e==null?void 0:e.getData(gr))==null?void 0:r.getFormModel();if(!(!n||!gW(n)))return n}function qQ(e,n,r){var i,s,o,a,l,u;return n&&Date.now()-r.getTimestamp()<500?e.type===n.type&&((i=e.value)==null?void 0:i.id)===((s=n.value)==null?void 0:s.id)&&((o=e.value)==null?void 0:o.path)===((a=n.value)==null?void 0:a.path)?{type:e.type,value:{...e.value,value:(l=e.value)==null?void 0:l.value,oldValue:(u=n.value)==null?void 0:u.oldValue}}:!0:!1}function GQ(e,n,r){e.onFormValuesChange(i=>{r.pushOperation({type:"changeFormValues",value:{id:n.id,path:i.name,value:je.get(i.values,i.name),oldValue:je.get(i.prevValues,i.name)}},{noApply:!0})})}var YQ={type:"changeFormValues",inverse:e=>({...e,value:{...e.value,value:e.value.oldValue,oldValue:e.value.value}}),apply:({value:{value:e,path:n,id:r}},i)=>{const s=i.get(On),o=$9(s.getNode(r));o&&o.setValueIn(n,e)},shouldMerge:qQ},XQ=[YQ],NN=class{registerOperationMeta(e){XQ.forEach(n=>{e.registerOperationMeta(n)})}};NN=WQ([$e()],NN);var ZQ=Gn({onBind:({bind:e})=>{Lv(e,NN,[XI])},onInit:(e,n)=>{const r=e.get(On),i=e.get(ar);r.onNodeCreate(({node:s})=>{const o=$9(s);o&&GQ(o,s,i)})},containerModules:[ZI]}),QQ=Object.defineProperty,JQ=(e,n,r,i)=>{for(var s=void 0,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=a(n,r,s)||s);return s&&QQ(n,r,s),s},eJ="gedit-background-pattern-",u3=20,tJ=1,nJ=0,QI=class extends er{constructor(){super(...arguments),this._patternId=`${eJ}${nJ++}`,this.node=ft.createDivWithClass("gedit-flow-background-layer"),this.grid=document.createElement("div")}get zoom(){return this.config.finalScale}onReady(){const{firstChild:e}=this.pipelineNode;this.pipelineNode.insertBefore(this.node,e),this.playgroundConfigEntity.updateConfig({minZoom:.1,maxZoom:2}),this.grid.style.zIndex="-1",this.grid.style.position="relative",this.node.appendChild(this.grid),this.grid.className="gedit-grid-svg"}getScaleUnit(){const{zoom:e}=this;return{realSize:u3,renderSize:Math.round(u3*e*100)/100,zoom:e}}autorun(){const e=this.playgroundConfigEntity.config,n=this.getScaleUnit(),r=n.renderSize*10,i=e.width+r*2,s=e.height+r*2,{scrollX:o}=e,{scrollY:a}=e,l=this.getScrollDelta(o,r),u=this.getScrollDelta(a,r);ft.setStyle(this.node,{left:o-eb,top:a-eb}),this.drawGrid(n),this.setSVGStyle(this.grid,{width:i,height:s,left:eb-l-r,top:eb-u-r})}drawGrid(e){const n=e.renderSize;if(!this.grid)return;const r=tJ*this.zoom,i=`
|
||
<svg width="100%" height="100%">
|
||
<pattern id="${this._patternId}" width="${n}" height="${n}" patternUnits="userSpaceOnUse">
|
||
<circle
|
||
cx="${r}"
|
||
cy="${r}"
|
||
r="${r}"
|
||
stroke="#eceeef"
|
||
fill-opacity="0.5"
|
||
/>
|
||
</pattern>
|
||
<rect width="100%" height="100%" fill="url(#${this._patternId})"/>
|
||
</svg>`;this.grid.innerHTML=i}setSVGStyle(e,n){e&&(e.style.width=`${n.width}px`,e.style.height=`${n.height}px`,e.style.left=`${n.left}px`,e.style.top=`${n.top}px`)}getScrollDelta(e,n){return e>=0?e%n:n-Math.abs(e)%n}};QI.type="WorkflowBackgroundLayer";JQ([Tn(qn)],QI.prototype,"playgroundConfigEntity");var rJ=Gn({onInit:(e,n)=>{e.playground.registerLayer(QI,n)}}),iJ=Object.getOwnPropertyDescriptor,sJ=(e,n,r,i)=>{for(var s=i>1?void 0:i?iJ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=a(s)||s);return s};function z9(e,n=[]){return r=>(n=n.slice(),(e.background||e.background===void 0)&&n.push(rJ(e.background||{})),e.shortcuts&&n.push(F9({registerShortcuts:i=>e.shortcuts(i,r)})),e.plugins&&n.push(...e.plugins(r)),n.push(Dw({onBind:i=>{var s;(s=e.onBind)==null||s.call(e,i)},onInit:i=>{const s=i.get(yg);e.playground&&(e.playground.autoFocus!==void 0&&(s.autoFocus=e.playground.autoFocus),e.playground.autoResize!==void 0&&(s.autoResize=e.playground.autoResize)),s.autoFocus=!1,i.playground.registerLayer(qp,e.playground),e.layers&&i.playground.registerLayers(...e.layers),e.onInit&&e.onInit(i)},onReady(i){e.onReady&&e.onReady(i)},onAllLayersRendered(){e.onAllLayersRendered&&e.onAllLayersRendered(r)},onDispose(){e.onDispose&&e.onDispose(r)},containerModules:e.containerModules||[]})),n)}var Jb=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-playground-layer gedit-playground-content-layer")}onZoom(e){this.node.style.transform=`scale(${e})`}onReady(){this.node.style.left="0px",this.node.style.top="0px"}updateOptions(e){this.options=e,this.render()}render(){return D.createElement("div",{className:this.options.className,style:{position:"absolute",...this.options.style}},this.options.children)}};Jb.type="PlaygroundContentLayer";Jb=sJ([$e()],Jb);R.forwardRef(function(n,r){const{parentContainer:i,children:s,...o}=n,a=R.useMemo(()=>Dw({onInit(u){u.playground.registerLayer(Jb)}}),[]),l=R.useMemo(()=>z9(o,[a]),[]);return D.createElement(L6,{ref:r,plugins:l,parentContainer:i},D.createElement(II,null,s))});var oJ=Object.defineProperty,aJ=Object.getOwnPropertyDescriptor,Hh=(e,n,r,i)=>{for(var s=i>1?void 0:i?aJ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&oJ(n,r,s),s},V9=Symbol("EditorOptions"),ew;(e=>{e.DEFAULT={background:{},fromNodeJSON(n,r){var s,o,a;const i=n.getData(gr);if(!i)r.data&&n.updateExtInfo(r.data);else{const l=(o=(s=n.getService(V9).nodeEngine)==null?void 0:s.createDefaultFormMeta)==null?void 0:o.call(s,n),u=((a=n.getNodeRegistry())==null?void 0:a.formMeta)||l;u&&i.createForm(u,r.data)}},toNodeJSON(n){const r={};let i;return n.document.traverse(s=>{var g;if(s.id.startsWith("$"))return;const a=s.getData(gr);let l=a&&a.formModel&&a.formModel.initialized?a.toJSON():void 0;const u={id:s.id,type:s.flowNodeType,data:a?l:s.getExtInfo(),blocks:[]};i||(i=u);let{parent:h}=s;h&&h.id.startsWith("$")&&(h=h.originParent);const p=h?r[h.id]:void 0;p&&((g=p.blocks)==null||g.push(u)),r[s.id]=u},n),i}}})(ew||(ew={}));var d3=e=>(n,r)=>{const i=e.filter(Boolean);return i.length?i.reduce((s,o)=>o(n,s),r):r},B9="flowide-highlight",lJ=`
|
||
@keyframes flowide-fade {
|
||
from {
|
||
opacity: 1.0;
|
||
}
|
||
to {
|
||
opacity: 0;
|
||
}
|
||
}
|
||
@-webkit-keyframes flowide-fade {
|
||
from {
|
||
opacity: 1.0;
|
||
}
|
||
to {
|
||
opacity: 0;
|
||
}
|
||
}
|
||
.${B9} {
|
||
background-color: rgba(238, 245, 40, 0.5);
|
||
animation: flowide-fade 2s 1 forwards;
|
||
-webkit-animation: flowide-fade 2s 1 forwards;
|
||
}
|
||
`,Du;function cJ(){Du||(Du=document.createElement("style"),Du.innerHTML=lJ,document.head.appendChild(Du))}function uJ(){Du==null||Du.remove(),Du=void 0}var dJ=0;function hJ(e,n){const r=e.formModel.flowNodeEntity.getData(zn).node,i=e.domRef.current;if(!i)return;const s=document.createElement("div"),{padding:o=dJ,overlayClassName:a}=n||{};s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex="9999",r.appendChild(s);const l=r.getBoundingClientRect(),u=i.getBoundingClientRect();return s.style.top=u.top-l.top-o+"px",s.style.left=u.left-l.left-o+"px",s.style.width=u.width+o*2+"px",s.style.height=u.height+o*2+"px",s.className=a||B9,setTimeout(()=>{s.remove()},2e3),s}var gv=class{highlightNodeFormItem(e,n){this.previousOverlay=hJ(e,n)}focusNodeFormItem(e,n){const r=e.formModel.flowNodeEntity,{canvas:i={},highlight:s}=n||{};this.previousOverlay&&(this.previousOverlay.remove(),this.previousOverlay=void 0);const o=this.playground.scrollToView({entities:[r],scrollToCenter:!0,...i}).then(()=>{!e||!s||this.currentPromise!==o||this.highlightNodeFormItem(e,typeof s=="boolean"?{}:s)});return this.currentPromise=o,this.currentPromise}};Hh([oe(qi)],gv.prototype,"playground",2);gv=Hh([$e()],gv);var yv=class{};Hh([oe(gv)],yv.prototype,"nodeFocusService",2);yv=Hh([$e()],yv);var fJ=Gn({onInit(){cJ()},onDispose(){uJ()}}),pJ=Gn({onBind({bind:e}){e(gv).toSelf().inSingletonScope(),e(yv).toSelf().inSingletonScope()}}),gJ=()=>[fJ({}),pJ({})],mv=class{focusNodeFormItem(e,n){this.nodeClient.nodeFocusService.focusNodeFormItem(e,n)}focusNode(e,n){this.playground.scrollToView({entities:[e],...n})}};Hh([oe(yv)],mv.prototype,"nodeClient",2);Hh([oe(qi)],mv.prototype,"playground",2);mv=Hh([$e()],mv);var yJ=Gn({onBind({bind:e}){e(mv).toSelf().inSingletonScope()}}),mJ=()=>[...gJ(),yJ({})];function vJ(e,n=[]){return r=>{var s,o,a;e={...ew.DEFAULT,...e},r.container.bind(V9).toConstantValue(e),e.i18n&&n.push(kQ(e.i18n)),n.push(...mJ()),(s=e.reduxDevTool)!=null&&s.enable&&n.push(FQ(e.reduxDevTool));const i=[FW,xq];return n.push(BQ(e.materials||{})),e.nodeEngine&&e.nodeEngine.enable!==!1&&(n.push(RQ({materials:e.nodeEngine.materials})),(o=e.variableEngine)!=null&&o.enable&&n.push(VQ({})),(a=e.history)!=null&&a.enable&&n.push(ZQ({}))),n.push(Dw({onInit:l=>{e.nodeRegistries&&l.document.registerFlowNodes(...e.nodeRegistries),e.constants&&(l.document.options.constants=e.constants),e.formatNodeLines&&(l.document.options.formatNodeLines=d3([l.document.options.formatNodeLines,e.formatNodeLines])),e.formatNodeLabels&&(l.document.options.formatNodeLabels=d3([l.document.options.formatNodeLabels,e.formatNodeLabels])),e.getNodeDefaultRegistry&&(l.document.options.getNodeDefaultRegistry=e.getNodeDefaultRegistry),l.get(bs).init()},onReady(l){e.initialData&&l.document.fromJSON(e.initialData),e.readonly&&(l.playground.config.readonly=e.readonly),l.document.load().then(()=>{e.onLoad&&e.onLoad(l)})},onDispose(l){l.document.dispose()},containerModules:i})),n}}var bJ=Object.defineProperty,wJ=Object.getOwnPropertyDescriptor,qr=(e,n,r,i)=>{for(var s=i>1?void 0:i?wJ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&bJ(n,r,s),s},sg=class{constructor(){this._entityDataValues=new Map,this._toDispose=new jt}addEntityData(e){this._entityDataValues.set(e,je.cloneDeep(e.toJSON())),this._toDispose.push(e.onWillChange(n=>{const r=n.toJSON(),i=this._entityDataValues.get(e);je.isEqual(r,i)||this._entityDataValues.set(e,je.cloneDeep(r))}))}getValue(e){return this._entityDataValues.get(e)}setValue(e,n){return this._entityDataValues.set(e,n)}dispose(){this._entityDataValues.clear(),this._toDispose.dispose()}};sg=qr([$e()],sg);var vv=(e=>(e.addLine="addLine",e.deleteLine="deleteLine",e.moveNode="moveNode",e.addNode="addNode",e.deleteNode="deleteNode",e.changeNodeData="changeNodeData",e.resetLayout="resetLayout",e.dragNodes="dragNodes",e.moveChildNodes="moveChildNodes",e))(vv||{}),bv=class{handle(e){e.type==="onDragEnd"&&this._dragNode(e)}_dragNode(e){this._historyService.pushOperation({type:"dragNodes",value:{ids:e.nodes.map(n=>n.id),value:e.nodes.map(n=>{const{x:r,y:i}=n.getData(qt).position;return{x:r,y:i}}),oldValue:e.startPositions}},{noApply:!0})}};qr([oe(ar)],bv.prototype,"_historyService",2);bv=qr([$e()],bv);var Gi=class{constructor(){this.enable=!1,this.nodeToJSON=e=>e.toJSON(),this.getNodeLabelById=e=>e,this.getNodeLabel=e=>e.id,this.getBlockLabel=e=>e.id,this.getNodeURI=e=>`node:${e}`,this.getLineURI=e=>`line:${e}`}init(e,n){this.enable=!!(n!=null&&n.enable),n.nodeToJSON&&(this.nodeToJSON=n.nodeToJSON(e)),n.getNodeLabelById&&(this.getNodeLabelById=n.getNodeLabelById(e)),n.getNodeLabel&&(this.getNodeLabel=n.getNodeLabel(e)),n.getBlockLabel&&(this.getBlockLabel=n.getBlockLabel(e)),n.getNodeURI&&(this.getNodeURI=n.getNodeURI(e)),n.getLineURI&&(this.getLineURI=n.getLineURI(e))}};Gi=qr([$e()],Gi);var Wu=class{handle(e){const{path:n,value:r,initialized:i,node:s}=e,o=s.getData(gr),a=this._entityManager.getValue(o),l=n.split("/").filter(Boolean).join("."),u=l?je.get(a,l):a;if(!je.isEqual(r,u)){if(i){let h=n,p=je.cloneDeep(r),g=u;if(n!=="/"){const v=je.cloneDeep(a);je.set(v,l,r),h=n.split("/").filter(Boolean)[0],p=je.get(v,h),g=je.get(a,h)}this._historyService.pushOperation({type:"changeNodeData",value:{id:s.id,path:h,value:p,oldValue:g},uri:this._config.getNodeURI(s.id)},{noApply:!0})}l?je.set(a,l,je.cloneDeep(r)):this._entityManager.setValue(o,je.cloneDeep(r))}}};qr([oe(ar)],Wu.prototype,"_historyService",2);qr([oe(Et)],Wu.prototype,"document",2);qr([oe(sg)],Wu.prototype,"_entityManager",2);qr([oe(Gi)],Wu.prototype,"_config",2);Wu=qr([$e()],Wu);var _J={type:wg.DELETE_NODE,toOperation:(e,n)=>{var l;const r=n.get(Gi),i=n.get(Et),s=e.entity,o=i.toNodeJSON(s),a=(l=s.parent)==null?void 0:l.id;return{type:"deleteNode",value:{node:o,parentID:a},uri:r.getNodeURI(s.id)}}},CJ={type:wg.DELETE_LINE,toOperation:(e,n)=>{const r=n.get(Gi),i=e.entity;return{type:"deleteLine",value:{from:i.info.from,to:i.info.to||"",fromPort:i.info.fromPort||"",toPort:i.info.toPort||"",id:i.id},uri:r.getNodeURI(i.id)}}},EJ={type:wg.ADD_NODE,toOperation:(e,n)=>{var l;const r=n.get(Gi),i=n.get(Et),s=e.entity,o=(l=s.parent)==null?void 0:l.id;return{type:"addNode",value:{node:i.toNodeJSON(s),parentID:o},uri:r.getNodeURI(s.id)}}},xJ={type:wg.ADD_LINE,toOperation:(e,n)=>{const r=n.get(Gi),i=e.entity;return{type:"addLine",value:{from:i.info.from,to:i.info.to||"",fromPort:i.info.fromPort||"",toPort:i.info.toPort||"",id:i.id},uri:r.getLineURI(i.id)}}},SJ=[xJ,CJ,EJ,_J],wv=class{handle(e,n){if(!this._historyService.undoRedoService.canPush())return;const r=SJ.find(s=>s.type===e.type);if(!r)return;const i=r.toOperation(e,n);i&&this._historyService.pushOperation(i,{noApply:!0})}};qr([oe(ar)],wv.prototype,"_historyService",2);wv=qr([$e()],wv);var id={shouldMerge:(e,n,r)=>n?Date.now()-r.getTimestamp()<500:!1},DJ={...id,type:"resetLayout",inverse:e=>({...e,value:{...e.value,value:e.value.oldValue,oldValue:e.value.value}}),apply:async(e,n)=>{await n.get(yc).layoutToPositions(e.value.ids,e.value.value)},shouldMerge:()=>!1},NJ={...id,type:AI.moveChildNodes,inverse:e=>({...e,value:{...e.value,fromIndex:e.value.toIndex,toIndex:e.value.fromIndex,fromParentId:e.value.toParentId,toParentId:e.value.fromParentId}}),apply:(e,n)=>{const r=n.get(Et);r.moveChildNodes(e.value);const i=r.getNode(e.value.fromParentId);requestAnimationFrame(()=>{i&&i.flowNodeType!==In.ROOT&&i.getData(qt).fireChange()})}},IJ={...id,type:"dragNodes",inverse:e=>({...e,value:{...e.value,value:e.value.oldValue,oldValue:e.value.value}}),apply:(e,n)=>{e.value.ids.forEach((r,i)=>{const s=n.get(Et),o=s.getNode(r);if(!o)return;const a=o.getData(qt),l=e.value.value[i];a.update({position:{x:l.x,y:l.y}}),s.layout.updateAffectedTransform(o)})}},OJ={...id,type:"deleteNode",inverse:e=>({...e,type:"addNode"}),apply:(e,n)=>{const i=n.get(Et).getNode(e.value.node.id);i&&i.dispose()},getLabel:(e,n)=>`Delete Node ${n.get(Gi).getNodeLabel(e.value.node)}`,getDescription:(e,n)=>{var s;let i=`Delete Node ${n.get(Gi).getNodeLabel(e.value.node)}`;return(s=e.value.node.meta)!=null&&s.position&&(i+=` at ${e.value.node.meta.position.x},${e.value.node.meta.position.y}`),i}},TJ={...id,type:"deleteLine",inverse:e=>({...e,type:"addLine"}),apply:(e,n)=>{n.get(Et).removeNode(e.value.id)},getLabel:(e,n)=>"Delete Line",getDescription:(e,n)=>{const r=n.get(Gi),{value:i}=e;if(!i.from||!i.to)return"Delete Line";const s=r.getNodeLabelById(i.from),o=r.getNodeLabelById(i.to);return`Delete Line from ${s} to ${o}`}},MJ={...id,type:"changeNodeData",inverse:e=>({...e,value:{...e.value,value:e.value.oldValue,oldValue:e.value.value}}),apply:(e,n)=>{const i=n.get(Et).getNode(e.value.id);if(!i)return;const s=i.getData(gr);if(!s)return;let{path:o}=e.value;o.endsWith("/")&&o!=="/"&&(o=o.slice(0,-1)),o.startsWith("/")||(o=`/${o}`);const a=s.formModel.getFormItemByPath(o);a&&(a.value=e.value.value)},shouldMerge:(e,n,r)=>{var i,s;return n&&Date.now()-r.getTimestamp()<500?e.type===n.type&&e.value.id===n.value.id&&((i=e.value)==null?void 0:i.path)===((s=n.value)==null?void 0:s.path)?{type:e.type,value:{...e.value,value:e.value.value,oldValue:n.value.oldValue}}:!0:!1}},PJ={...id,type:"addNode",inverse:e=>({...e,type:"deleteNode"}),apply:async(e,n)=>{await n.get(Et).createWorkflowNode(je.cloneDeep(e.value.node),!1,e.value.parentID)},getLabel:(e,n)=>`Create Node ${n.get(Gi).getNodeLabel(e.value.node)}`,getDescription:(e,n)=>{var s;let i=`Create Node ${n.get(Gi).getNodeLabel(e.value.node)}`;return(s=e.value.node.meta)!=null&&s.position&&(i+=` at ${e.value.node.meta.position.x},${e.value.node.meta.position.y}`),i}},AJ={...id,type:"addLine",inverse:e=>({...e,type:"deleteLine"}),apply:(e,n)=>{n.get(oi).createLine({...e.value,key:e.value.id})},getLabel:(e,n)=>"Create Line",getDescription:(e,n)=>{const r=n.get(Gi),{value:i}=e;if(!i.from||!i.to)return"Create Line";const s=r.getNodeLabelById(i.from),o=r.getNodeLabelById(i.to);return`Create Line from ${s} to ${o}`}},RJ=[AJ,TJ,PJ,OJ,MJ,DJ,IJ,NJ],IN=class{registerOperationMeta(e){RJ.forEach(n=>{e.registerOperationMeta(n)})}};IN=qr([$e()],IN);var yl=class{constructor(){this._toDispose=new jt}onInit(e,n){const r=e.get(Et),i=e.get(ar),s=e.get(yr),o=e.get(yc);n!=null&&n.limit&&i.limit(n.limit),i.context.source=e,this._toDispose.pushAll([s.onNodesDrag(async a=>{a.type==="onDragEnd"&&this._dragNodesHandler.handle(a)}),r.onNodeCreate(({node:a,data:l})=>{const u=a.getData(xu);u&&this._entityManager.addEntityData(u)}),this._formManager?this._formManager.onFormModelWillInit(({model:a,data:l})=>{const u=a.flowNodeEntity,h=u.getData(gr);h&&(this._entityManager.setValue(h,je.cloneDeep(l)),this._toDispose.push(h.onDetailChange(p=>{this._changeNodeDataHandler.handle({...p,node:u})})))}):on.NULL,r.onContentChange(a=>{this._changeContentHandler.handle(a,e)}),r.onReload(a=>{i.clear()}),o.onResetLayout(a=>{i.pushOperation({type:"resetLayout",value:{ids:a.nodeIds,value:a.positionMap,oldValue:a.oldPositionMap}},{noApply:!0})}),this._operationService.onNodeMove(({node:a,fromParent:l,fromIndex:u,toParent:h,toIndex:p})=>{i.pushOperation({type:AI.moveChildNodes,value:{fromParentId:l.id,fromIndex:u,nodeIds:[a.id],toParentId:h.id,toIndex:p}},{noApply:!0})}),this._operationService.onNodePostionUpdate(a=>{const l={ids:[a.node.id],value:[a.newPosition],oldValue:[a.oldPosition]};i.pushOperation({type:"dragNodes",value:l},{noApply:!0})})])}dispose(){this._entityManager.dispose(),this._toDispose.dispose()}};qr([oe(bv)],yl.prototype,"_dragNodesHandler",2);qr([oe(Wu)],yl.prototype,"_changeNodeDataHandler",2);qr([oe(wv)],yl.prototype,"_changeContentHandler",2);qr([oe(sg)],yl.prototype,"_entityManager",2);qr([oe(Oo),pr()],yl.prototype,"_formManager",2);qr([oe(Aw)],yl.prototype,"_operationService",2);yl=qr([$e()],yl);var kJ=Gn({onBind:({bind:e})=>{Lv(e,IN,[XI]),e(Gi).toSelf().inSingletonScope(),e(yl).toSelf().inSingletonScope(),e(sg).toSelf().inSingletonScope(),e(bv).toSelf().inSingletonScope(),e(Wu).toSelf().inSingletonScope(),e(wv).toSelf().inSingletonScope()},onInit(e,n){e.get(Gi).init(e,n),n.enable&&e.get(yl).onInit(e,n)},onDispose(e){e.get(sg).dispose()},containerModules:[ZI]}),LJ=Gn({onInit(e,n){n.enable!==!1&&(e.playground.registerLayer(hl,n),e.playground.registerLayer(dl,{canSelect:n.canSelect}))}}),jJ=Object.defineProperty,FJ=Object.getOwnPropertyDescriptor,Uh=(e,n,r,i)=>{for(var s=i>1?void 0:i?FJ(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&jJ(n,r,s),s},H9=class{compute(e){this.clearCache();const{root:n,nodes:r,context:i}=e;return this.context=i,this.nodeIndexes=this.computeNodeIndexesMap(r),this.topLevel=this.computeTopLevel(r),this.maxLevel=this.topLevel*2,this.layerHandler(n.blocks),{nodeLevel:this.nodeLevel,lineLevel:this.lineLevel,topLevel:this.topLevel,maxLevel:this.maxLevel}}clearCache(){this.currentLevel=0,this.topLevel=0,this.maxLevel=0,this.nodeIndexes=new Map,this.nodeLevel=new Map,this.lineLevel=new Map}computeNodeIndexesMap(e){const n=new Map;return e.forEach((r,i)=>{n.set(r.id,i)}),n}computeTopLevel(e){const n=e.filter(i=>i.id!==In.ROOT),r=n.reduce((i,s)=>s.blocks.length>0?i+1:i,0);return n.length+r+1}layerHandler(e,n=!1){const r=this.sortNodes(e);this.getNodesAllLines(r).forEach(s=>{s.isDrawing||this.context.hoveredEntityID===s.id||this.context.selectedIDs.includes(s.id)?this.lineLevel.set(s.id,this.maxLevel):this.lineLevel.set(s.id,this.getLevel(n))}),this.levelIncrease(),r.forEach(s=>{const o=this.context.selectedIDs.includes(s.id);o?this.nodeLevel.set(s.id,this.topLevel):this.nodeLevel.set(s.id,this.getLevel(n)),this.levelIncrease(),s.blocks.length>0&&this.layerHandler(s.blocks,n||o)})}sortNodes(e){return e.sort((n,r)=>{const i=this.nodeIndexes.get(n.id),s=this.nodeIndexes.get(r.id);return i===void 0||s===void 0?0:i-s})}getNodesAllLines(e){return e.map(i=>{const s=i.getData(el),o=s.outputLines.filter(Boolean),a=s.inputLines.filter(Boolean);return[...o,...a]}).flat().filter(i=>this.lineLevel.get(i.id)===void 0||this.isHigherFirstLine(i))}isHigherFirstLine(e){var n,r;return((n=e.to)==null?void 0:n.parent)===e.from||((r=e.from)==null?void 0:r.parent)===e.to}getLevel(e){return e?this.topLevel+this.currentLevel:this.currentLevel}levelIncrease(){this.currentLevel+=1}},U9=(e=>(e.Line="line",e.Node="node",e))(U9||{}),JI=(e=>(e.Line="line",e.Node="node",e))(JI||{}),K9={line:0,node:1},W9=8,q9=2,G9=Object.keys(JI).length,Y9=q9*2,$J=W9+Y9*G9,mh={startIndex:W9,allowLevel:q9,levelIndexStep:G9,maxLevel:Y9,maxIndex:$J},Ui=class{constructor(){this.node=ft.createDivWithClass("gedit-playground-layer gedit-flow-render-layer"),this.disposers=[],this.compute=je.debounce(this._compute,10)}init(){this.pipelineRenderer.node.appendChild(this.node),this.mountListener()}ready(){this.compute()}dispose(){this.disposers.forEach(e=>e.dispose())}_compute(){const e=this.context,n=new H9,{nodeLevel:r,lineLevel:i}=n.compute({root:this.document.root,nodes:this.nodes,context:e});this.nodes.forEach(s=>{const o=r.get(s.id),a=s.getData(zn),l=a.node;if(l.style.position="absolute",o===void 0){l.style.zIndex="auto",a.stackIndex=0;return}const u=mh.startIndex+o;l.style.zIndex=String(u),a.stackIndex=u}),this.lines.forEach(s=>{const o=i.get(s.id),a=s.node;if(a.style.position="absolute",o===void 0){a.style.zIndex="auto";return}a.style.zIndex=String(mh.startIndex+o)})}get nodes(){return this.entityManager.getEntities(To)}get lines(){return this.entityManager.getEntities(zs)}get context(){var e;return{hoveredEntity:this.hoverService.hoveredNode,hoveredEntityID:(e=this.hoverService.hoveredNode)==null?void 0:e.id,selectedEntities:this.selectService.selection,selectedIDs:this.selectService.selection.map(n=>n.id)}}mountListener(){const e=this.onEntityChange(),n=this.onZoom(),r=this.onHover(),i=this.onSelect();this.disposers=[e,n,r,i]}onZoom(){return this.pipelineRegistry.onZoom(e=>{this.node.style.transform=`scale(${e})`})}onHover(){return this.hoverService.onHoveredChange(()=>{this.compute()})}onEntityChange(){return this.entityManager.onEntityChange(()=>{this.compute()})}onSelect(){return this.selectService.onSelectionChanged(()=>{this.compute()})}};Uh([oe(Et)],Ui.prototype,"document",2);Uh([oe(Sn)],Ui.prototype,"entityManager",2);Uh([oe(Ch)],Ui.prototype,"pipelineRenderer",2);Uh([oe(Io)],Ui.prototype,"pipelineRegistry",2);Uh([oe(Zs)],Ui.prototype,"hoverService",2);Uh([oe(or)],Ui.prototype,"selectService",2);Ui=Uh([$e()],Ui);var X9=Gn({onBind({bind:e}){e(Ui).toSelf().inSingletonScope()},onInit(e){e.get(Ui).init()},onReady(e){e.get(Ui).ready()},onDispose(e){e.get(Ui).dispose()}}),gh;(e=>{e.compute=(i,s)=>{const o=n(i,s),a=r(i);a.style.position="absolute",a.style.zIndex=(0,e.zIndexStringify)(o)},e.stackingIndex=(i,s)=>{if(s<1)return;const o=K9[i];return mh.startIndex+mh.levelIndexStep*(s-1)+o},e.nodeStackingLevel=(i,s,o=!1)=>{const a=[];let l=i;for(;l;)a.push(l),l=l.parent;const u=a.reverse(),h=u.length-1,p=u.findIndex(v=>!!s.selectedIDs.includes(v.id)),g=mh.allowLevel+(u.length-p);return!o&&p!==-1?g:h},e.zIndexStringify=i=>i===void 0?"auto":i.toString();const n=(i,s)=>{const o=(0,e.nodeStackingLevel)(i,s);return(0,e.stackingIndex)("node",o)},r=i=>i.getData(zn).node})(gh||(gh={}));var ON;(e=>{e.compute=(i,s)=>{const o=r(i,s),a=i.node;a.style.position="absolute",a.style.zIndex=gh.zIndexStringify(o)};const n=(i,s)=>{if(i.isDrawing||s.hoveredEntityID===i.id||s.selectedIDs.includes(i.id))return mh.maxLevel+1;const o=gh.nodeStackingLevel(i.from,s,!0);if(!i.to)return o;const a=gh.nodeStackingLevel(i.to,s,!0);return Math.min(o,a)},r=(i,s)=>{const o=n(i,s);return gh.stackingIndex("line",o)}})(ON||(ON={}));var zJ=e=>{const{nodes:n,lines:r,context:i}=e;n.forEach(s=>{gh.compute(s,i)}),r.forEach(s=>{ON.compute(s,i)})};const VJ=Object.freeze(Object.defineProperty({__proto__:null,StackingBaseIndex:K9,StackingComputing:H9,StackingConfig:mh,get StackingContextManager(){return Ui},StackingItem:U9,StackingType:JI,createFreeStackPlugin:X9,layersComputing:zJ},Symbol.toStringTag,{value:"Module"}));var nE={exports:{}},bn={};/**
|
||
* @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 h3;function BJ(){if(h3)return bn;h3=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),S;S=Symbol.for("react.module.reference");function E(x){if(typeof x=="object"&&x!==null){var I=x.$$typeof;switch(I){case e:switch(x=x.type,x){case r:case s:case i:case h:case p:return x;default:switch(x=x&&x.$$typeof,x){case l:case a:case u:case v:case g:case o:return x;default:return I}}case n:return I}}}return bn.ContextConsumer=a,bn.ContextProvider=o,bn.Element=e,bn.ForwardRef=u,bn.Fragment=r,bn.Lazy=v,bn.Memo=g,bn.Portal=n,bn.Profiler=s,bn.StrictMode=i,bn.Suspense=h,bn.SuspenseList=p,bn.isAsyncMode=function(){return!1},bn.isConcurrentMode=function(){return!1},bn.isContextConsumer=function(x){return E(x)===a},bn.isContextProvider=function(x){return E(x)===o},bn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},bn.isForwardRef=function(x){return E(x)===u},bn.isFragment=function(x){return E(x)===r},bn.isLazy=function(x){return E(x)===v},bn.isMemo=function(x){return E(x)===g},bn.isPortal=function(x){return E(x)===n},bn.isProfiler=function(x){return E(x)===s},bn.isStrictMode=function(x){return E(x)===i},bn.isSuspense=function(x){return E(x)===h},bn.isSuspenseList=function(x){return E(x)===p},bn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===s||x===i||x===h||x===p||x===w||typeof x=="object"&&x!==null&&(x.$$typeof===v||x.$$typeof===g||x.$$typeof===o||x.$$typeof===a||x.$$typeof===u||x.$$typeof===S||x.getModuleId!==void 0)},bn.typeOf=E,bn}var f3;function HJ(){return f3||(f3=1,nE.exports=BJ()),nE.exports}var Z9=HJ();function UJ(e){function n(ee,ie,we,Se,J){for(var Re=0,be=0,Oe=0,Ee=0,Le,tt,Pt=0,_t=0,Ge,Ft=Ge=Le=0,Ke=0,zt=0,kn=0,yt=0,St=we.length,Bt=St-1,Nt,lt="",It="",ci="",dn="",At;Ke<St;){if(tt=we.charCodeAt(Ke),Ke===Bt&&be+Ee+Oe+Re!==0&&(be!==0&&(tt=be===47?10:47),Ee=Oe=Re=0,St++,Bt++),be+Ee+Oe+Re===0){if(Ke===Bt&&(0<zt&&(lt=lt.replace(v,"")),0<lt.trim().length)){switch(tt){case 32:case 9:case 59:case 13:case 10:break;default:lt+=we.charAt(Ke)}tt=59}switch(tt){case 123:for(lt=lt.trim(),Le=lt.charCodeAt(0),Ge=1,yt=++Ke;Ke<St;){switch(tt=we.charCodeAt(Ke)){case 123:Ge++;break;case 125:Ge--;break;case 47:switch(tt=we.charCodeAt(Ke+1)){case 42:case 47:e:{for(Ft=Ke+1;Ft<Bt;++Ft)switch(we.charCodeAt(Ft)){case 47:if(tt===42&&we.charCodeAt(Ft-1)===42&&Ke+2!==Ft){Ke=Ft+1;break e}break;case 10:if(tt===47){Ke=Ft+1;break e}}Ke=Ft}}break;case 91:tt++;case 40:tt++;case 34:case 39:for(;Ke++<Bt&&we.charCodeAt(Ke)!==tt;);}if(Ge===0)break;Ke++}switch(Ge=we.substring(yt,Ke),Le===0&&(Le=(lt=lt.replace(g,"").trim()).charCodeAt(0)),Le){case 64:switch(0<zt&&(lt=lt.replace(v,"")),tt=lt.charCodeAt(1),tt){case 100:case 109:case 115:case 45:zt=ie;break;default:zt=Ne}if(Ge=n(ie,zt,Ge,tt,J+1),yt=Ge.length,0<G&&(zt=r(Ne,lt,kn),At=l(3,Ge,zt,ie,te,Y,yt,tt,J,Se),lt=zt.join(""),At!==void 0&&(yt=(Ge=At.trim()).length)===0&&(tt=0,Ge="")),0<yt)switch(tt){case 115:lt=lt.replace(j,a);case 100:case 109:case 45:Ge=lt+"{"+Ge+"}";break;case 107:lt=lt.replace(P,"$1 $2"),Ge=lt+"{"+Ge+"}",Ge=ye===1||ye===2&&o("@"+Ge,3)?"@-webkit-"+Ge+"@"+Ge:"@"+Ge;break;default:Ge=lt+Ge,Se===112&&(Ge=(It+=Ge,""))}else Ge="";break;default:Ge=n(ie,r(ie,lt,kn),Ge,Se,J+1)}ci+=Ge,Ge=kn=zt=Ft=Le=0,lt="",tt=we.charCodeAt(++Ke);break;case 125:case 59:if(lt=(0<zt?lt.replace(v,""):lt).trim(),1<(yt=lt.length))switch(Ft===0&&(Le=lt.charCodeAt(0),Le===45||96<Le&&123>Le)&&(yt=(lt=lt.replace(" ",":")).length),0<G&&(At=l(1,lt,ie,ee,te,Y,It.length,Se,J,Se))!==void 0&&(yt=(lt=At.trim()).length)===0&&(lt="\0\0"),Le=lt.charCodeAt(0),tt=lt.charCodeAt(1),Le){case 0:break;case 64:if(tt===105||tt===99){dn+=lt+we.charAt(Ke);break}default:lt.charCodeAt(yt-1)!==58&&(It+=s(lt,Le,tt,lt.charCodeAt(2)))}kn=zt=Ft=Le=0,lt="",tt=we.charCodeAt(++Ke)}}switch(tt){case 13:case 10:be===47?be=0:1+Le===0&&Se!==107&&0<lt.length&&(zt=1,lt+="\0"),0<G*ge&&l(0,lt,ie,ee,te,Y,It.length,Se,J,Se),Y=1,te++;break;case 59:case 125:if(be+Ee+Oe+Re===0){Y++;break}default:switch(Y++,Nt=we.charAt(Ke),tt){case 9:case 32:if(Ee+Re+be===0)switch(Pt){case 44:case 58:case 9:case 32:Nt="";break;default:tt!==32&&(Nt=" ")}break;case 0:Nt="\\0";break;case 12:Nt="\\f";break;case 11:Nt="\\v";break;case 38:Ee+be+Re===0&&(zt=kn=1,Nt="\f"+Nt);break;case 108:if(Ee+be+Re+ue===0&&0<Ft)switch(Ke-Ft){case 2:Pt===112&&we.charCodeAt(Ke-3)===58&&(ue=Pt);case 8:_t===111&&(ue=_t)}break;case 58:Ee+be+Re===0&&(Ft=Ke);break;case 44:be+Oe+Ee+Re===0&&(zt=1,Nt+="\r");break;case 34:case 39:be===0&&(Ee=Ee===tt?0:Ee===0?tt:Ee);break;case 91:Ee+be+Oe===0&&Re++;break;case 93:Ee+be+Oe===0&&Re--;break;case 41:Ee+be+Re===0&&Oe--;break;case 40:if(Ee+be+Re===0){if(Le===0)switch(2*Pt+3*_t){case 533:break;default:Le=1}Oe++}break;case 64:be+Oe+Ee+Re+Ft+Ge===0&&(Ge=1);break;case 42:case 47:if(!(0<Ee+Re+Oe))switch(be){case 0:switch(2*tt+3*we.charCodeAt(Ke+1)){case 235:be=47;break;case 220:yt=Ke,be=42}break;case 42:tt===47&&Pt===42&&yt+2!==Ke&&(we.charCodeAt(yt+2)===33&&(It+=we.substring(yt,Ke+1)),Nt="",be=0)}}be===0&&(lt+=Nt)}_t=Pt,Pt=tt,Ke++}if(yt=It.length,0<yt){if(zt=ie,0<G&&(At=l(2,It,zt,ee,te,Y,yt,Se,J,Se),At!==void 0&&(It=At).length===0))return dn+It+ci;if(It=zt.join(",")+"{"+It+"}",ye*ue!==0){switch(ye!==2||o(It,2)||(ue=0),ue){case 111:It=It.replace(k,":-moz-$1")+It;break;case 112:It=It.replace(M,"::-webkit-input-$1")+It.replace(M,"::-moz-$1")+It.replace(M,":-ms-input-$1")+It}ue=0}}return dn+It+ci}function r(ee,ie,we){var Se=ie.trim().split(x);ie=Se;var J=Se.length,Re=ee.length;switch(Re){case 0:case 1:var be=0;for(ee=Re===0?"":ee[0]+" ";be<J;++be)ie[be]=i(ee,ie[be],we).trim();break;default:var Oe=be=0;for(ie=[];be<J;++be)for(var Ee=0;Ee<Re;++Ee)ie[Oe++]=i(ee[Ee]+" ",Se[be],we).trim()}return ie}function i(ee,ie,we){var Se=ie.charCodeAt(0);switch(33>Se&&(Se=(ie=ie.trim()).charCodeAt(0)),Se){case 38:return ie.replace(I,"$1"+ee.trim());case 58:return ee.trim()+ie.replace(I,"$1"+ee.trim());default:if(0<1*we&&0<ie.indexOf("\f"))return ie.replace(I,(ee.charCodeAt(0)===58?"":"$1")+ee.trim())}return ee+ie}function s(ee,ie,we,Se){var J=ee+";",Re=2*ie+3*we+4*Se;if(Re===944){ee=J.indexOf(":",9)+1;var be=J.substring(ee,J.length-1).trim();return be=J.substring(0,ee).trim()+be+";",ye===1||ye===2&&o(be,1)?"-webkit-"+be+be:be}if(ye===0||ye===2&&!o(J,1))return J;switch(Re){case 1015:return J.charCodeAt(10)===97?"-webkit-"+J+J:J;case 951:return J.charCodeAt(3)===116?"-webkit-"+J+J:J;case 963:return J.charCodeAt(5)===110?"-webkit-"+J+J:J;case 1009:if(J.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+J+J;case 978:return"-webkit-"+J+"-moz-"+J+J;case 1019:case 983:return"-webkit-"+J+"-moz-"+J+"-ms-"+J+J;case 883:if(J.charCodeAt(8)===45)return"-webkit-"+J+J;if(0<J.indexOf("image-set(",11))return J.replace(H,"$1-webkit-$2")+J;break;case 932:if(J.charCodeAt(4)===45)switch(J.charCodeAt(5)){case 103:return"-webkit-box-"+J.replace("-grow","")+"-webkit-"+J+"-ms-"+J.replace("grow","positive")+J;case 115:return"-webkit-"+J+"-ms-"+J.replace("shrink","negative")+J;case 98:return"-webkit-"+J+"-ms-"+J.replace("basis","preferred-size")+J}return"-webkit-"+J+"-ms-"+J+J;case 964:return"-webkit-"+J+"-ms-flex-"+J+J;case 1023:if(J.charCodeAt(8)!==99)break;return be=J.substring(J.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+be+"-webkit-"+J+"-ms-flex-pack"+be+J;case 1005:return S.test(J)?J.replace(w,":-webkit-")+J.replace(w,":-moz-")+J:J;case 1e3:switch(be=J.substring(13).trim(),ie=be.indexOf("-")+1,be.charCodeAt(0)+be.charCodeAt(ie)){case 226:be=J.replace(A,"tb");break;case 232:be=J.replace(A,"tb-rl");break;case 220:be=J.replace(A,"lr");break;default:return J}return"-webkit-"+J+"-ms-"+be+J;case 1017:if(J.indexOf("sticky",9)===-1)break;case 975:switch(ie=(J=ee).length-10,be=(J.charCodeAt(ie)===33?J.substring(0,ie):J).substring(ee.indexOf(":",7)+1).trim(),Re=be.charCodeAt(0)+(be.charCodeAt(7)|0)){case 203:if(111>be.charCodeAt(8))break;case 115:J=J.replace(be,"-webkit-"+be)+";"+J;break;case 207:case 102:J=J.replace(be,"-webkit-"+(102<Re?"inline-":"")+"box")+";"+J.replace(be,"-webkit-"+be)+";"+J.replace(be,"-ms-"+be+"box")+";"+J}return J+";";case 938:if(J.charCodeAt(5)===45)switch(J.charCodeAt(6)){case 105:return be=J.replace("-items",""),"-webkit-"+J+"-webkit-box-"+be+"-ms-flex-"+be+J;case 115:return"-webkit-"+J+"-ms-flex-item-"+J.replace($,"")+J;default:return"-webkit-"+J+"-ms-flex-line-pack"+J.replace("align-content","").replace($,"")+J}break;case 973:case 989:if(J.charCodeAt(3)!==45||J.charCodeAt(4)===122)break;case 931:case 953:if(B.test(ee)===!0)return(be=ee.substring(ee.indexOf(":")+1)).charCodeAt(0)===115?s(ee.replace("stretch","fill-available"),ie,we,Se).replace(":fill-available",":stretch"):J.replace(be,"-webkit-"+be)+J.replace(be,"-moz-"+be.replace("fill-",""))+J;break;case 962:if(J="-webkit-"+J+(J.charCodeAt(5)===102?"-ms-"+J:"")+J,we+Se===211&&J.charCodeAt(13)===105&&0<J.indexOf("transform",10))return J.substring(0,J.indexOf(";",27)+1).replace(E,"$1-webkit-$2")+J}return J}function o(ee,ie){var we=ee.indexOf(ie===1?":":"{"),Se=ee.substring(0,ie!==3?we:10);return we=ee.substring(we+1,ee.length-1),ae(ie!==2?Se:Se.replace(W,"$1"),we,ie)}function a(ee,ie){var we=s(ie,ie.charCodeAt(0),ie.charCodeAt(1),ie.charCodeAt(2));return we!==ie+";"?we.replace(V," or ($1)").substring(4):"("+ie+")"}function l(ee,ie,we,Se,J,Re,be,Oe,Ee,Le){for(var tt=0,Pt=ie,_t;tt<G;++tt)switch(_t=q[tt].call(p,ee,Pt,we,Se,J,Re,be,Oe,Ee,Le)){case void 0:case!1:case!0:case null:break;default:Pt=_t}if(Pt!==ie)return Pt}function u(ee){switch(ee){case void 0:case null:G=q.length=0;break;default:if(typeof ee=="function")q[G++]=ee;else if(typeof ee=="object")for(var ie=0,we=ee.length;ie<we;++ie)u(ee[ie]);else ge=!!ee|0}return u}function h(ee){return ee=ee.prefix,ee!==void 0&&(ae=null,ee?typeof ee!="function"?ye=1:(ye=2,ae=ee):ye=0),h}function p(ee,ie){var we=ee;if(33>we.charCodeAt(0)&&(we=we.trim()),X=we,we=[X],0<G){var Se=l(-1,ie,we,we,te,Y,0,0,0,0);Se!==void 0&&typeof Se=="string"&&(ie=Se)}var J=n(Ne,we,ie,0,0);return 0<G&&(Se=l(-2,J,we,we,te,Y,J.length,0,0,0),Se!==void 0&&(J=Se)),X="",ue=0,Y=te=1,J}var g=/^\0+/g,v=/[\0\r\f]/g,w=/: */g,S=/zoo|gra/,E=/([,: ])(transform)/g,x=/,\r+?/g,I=/([\t\r\n ])*\f?&/g,P=/@(k\w+)\s*(\S*)\s*/,M=/::(place)/g,k=/:(read-only)/g,A=/[svh]\w+-[tblr]{2}/,j=/\(\s*(.*)\s*\)/g,V=/([\s\S]*?);/g,$=/-self|flex-/g,W=/[^]*?(:[rp][el]a[\w-]+)[^]*/,B=/stretch|:\s*\w+\-(?:conte|avail)/,H=/([^-])(image-set\()/,Y=1,te=1,ue=0,ye=1,Ne=[],q=[],G=0,ae=null,ge=0,X="";return p.use=u,p.set=h,e!==void 0&&h(e),p}var KJ={animationIterationCount: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};function WJ(e){var n=Object.create(null);return function(r){return n[r]===void 0&&(n[r]=e(r)),n[r]}}var qJ=/^((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|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|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)-.*))$/,p3=WJ(function(e){return qJ.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),rE={exports:{}},wn={};/** @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 g3;function GJ(){if(g3)return wn;g3=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,w=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function M(A){if(typeof A=="object"&&A!==null){var j=A.$$typeof;switch(j){case n:switch(A=A.type,A){case u:case h:case i:case o:case s:case g:return A;default:switch(A=A&&A.$$typeof,A){case l:case p:case S:case w:case a:return A;default:return j}}case r:return j}}}function k(A){return M(A)===h}return wn.AsyncMode=u,wn.ConcurrentMode=h,wn.ContextConsumer=l,wn.ContextProvider=a,wn.Element=n,wn.ForwardRef=p,wn.Fragment=i,wn.Lazy=S,wn.Memo=w,wn.Portal=r,wn.Profiler=o,wn.StrictMode=s,wn.Suspense=g,wn.isAsyncMode=function(A){return k(A)||M(A)===u},wn.isConcurrentMode=k,wn.isContextConsumer=function(A){return M(A)===l},wn.isContextProvider=function(A){return M(A)===a},wn.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===n},wn.isForwardRef=function(A){return M(A)===p},wn.isFragment=function(A){return M(A)===i},wn.isLazy=function(A){return M(A)===S},wn.isMemo=function(A){return M(A)===w},wn.isPortal=function(A){return M(A)===r},wn.isProfiler=function(A){return M(A)===o},wn.isStrictMode=function(A){return M(A)===s},wn.isSuspense=function(A){return M(A)===g},wn.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===i||A===h||A===o||A===s||A===g||A===v||typeof A=="object"&&A!==null&&(A.$$typeof===S||A.$$typeof===w||A.$$typeof===a||A.$$typeof===l||A.$$typeof===p||A.$$typeof===x||A.$$typeof===I||A.$$typeof===P||A.$$typeof===E)},wn.typeOf=M,wn}var y3;function YJ(){return y3||(y3=1,rE.exports=GJ()),rE.exports}var iE,m3;function XJ(){if(m3)return iE;m3=1;var e=YJ(),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=i,o[e.Memo]=s;function a(S){return e.isMemo(S)?s:o[S.$$typeof]||n}var l=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,v=Object.prototype;function w(S,E,x){if(typeof E!="string"){if(v){var I=g(E);I&&I!==v&&w(S,I,x)}var P=u(E);h&&(P=P.concat(h(E)));for(var M=a(S),k=a(E),A=0;A<P.length;++A){var j=P[A];if(!r[j]&&!(x&&x[j])&&!(k&&k[j])&&!(M&&M[j])){var V=p(E,j);try{l(S,j,V)}catch{}}}}return S}return iE=w,iE}var ZJ=XJ();const QJ=cn(ZJ);var Eo={};function lc(){return(lc=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}var v3=function(e,n){for(var r=[e[0]],i=0,s=n.length;i<s;i+=1)r.push(n[i],e[i+1]);return r},TN=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!Z9.typeOf(e)},tw=Object.freeze([]),ku=Object.freeze({});function _v(e){return typeof e=="function"}function b3(e){return e.displayName||e.name||"Component"}function eO(e){return e&&typeof e.styledComponentId=="string"}var og=typeof process<"u"&&Eo!==void 0&&(Eo.REACT_APP_SC_ATTR||Eo.SC_ATTR)||"data-styled",tO=typeof window<"u"&&"HTMLElement"in window,JJ=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Eo!==void 0&&(Eo.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Eo.REACT_APP_SC_DISABLE_SPEEDY!==""?Eo.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Eo.REACT_APP_SC_DISABLE_SPEEDY:Eo.SC_DISABLE_SPEEDY!==void 0&&Eo.SC_DISABLE_SPEEDY!==""&&Eo.SC_DISABLE_SPEEDY!=="false"&&Eo.SC_DISABLE_SPEEDY));function Gv(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var eee=function(){function e(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var n=e.prototype;return n.indexOfGroup=function(r){for(var i=0,s=0;s<r;s++)i+=this.groupSizes[s];return i},n.insertRules=function(r,i){if(r>=this.groupSizes.length){for(var s=this.groupSizes,o=s.length,a=o;r>=a;)(a<<=1)<0&&Gv(16,""+r);this.groupSizes=new Uint32Array(a),this.groupSizes.set(s),this.length=a;for(var l=o;l<a;l++)this.groupSizes[l]=0}for(var u=this.indexOfGroup(r+1),h=0,p=i.length;h<p;h++)this.tag.insertRule(u,i[h])&&(this.groupSizes[r]++,u++)},n.clearGroup=function(r){if(r<this.length){var i=this.groupSizes[r],s=this.indexOfGroup(r),o=s+i;this.groupSizes[r]=0;for(var a=s;a<o;a++)this.tag.deleteRule(s)}},n.getGroup=function(r){var i="";if(r>=this.length||this.groupSizes[r]===0)return i;for(var s=this.groupSizes[r],o=this.indexOfGroup(r),a=o+s,l=o;l<a;l++)i+=this.tag.getRule(l)+`/*!sc*/
|
||
`;return i},e}(),wb=new Map,nw=new Map,Ym=1,ob=function(e){if(wb.has(e))return wb.get(e);for(;nw.has(Ym);)Ym++;var n=Ym++;return wb.set(e,n),nw.set(n,e),n},tee=function(e){return nw.get(e)},nee=function(e,n){n>=Ym&&(Ym=n+1),wb.set(e,n),nw.set(n,e)},ree="style["+og+'][data-styled-version="5.3.11"]',iee=new RegExp("^"+og+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),see=function(e,n,r){for(var i,s=r.split(","),o=0,a=s.length;o<a;o++)(i=s[o])&&e.registerName(n,i)},oee=function(e,n){for(var r=(n.textContent||"").split(`/*!sc*/
|
||
`),i=[],s=0,o=r.length;s<o;s++){var a=r[s].trim();if(a){var l=a.match(iee);if(l){var u=0|parseInt(l[1],10),h=l[2];u!==0&&(nee(h,u),see(e,h,l[3]),e.getTag().insertRules(u,i)),i.length=0}else i.push(a)}}},aee=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},Q9=function(e){var n=document.head,r=e||n,i=document.createElement("style"),s=function(l){for(var u=l.childNodes,h=u.length;h>=0;h--){var p=u[h];if(p&&p.nodeType===1&&p.hasAttribute(og))return p}}(r),o=s!==void 0?s.nextSibling:null;i.setAttribute(og,"active"),i.setAttribute("data-styled-version","5.3.11");var a=aee();return a&&i.setAttribute("nonce",a),r.insertBefore(i,o),i},lee=function(){function e(r){var i=this.element=Q9(r);i.appendChild(document.createTextNode("")),this.sheet=function(s){if(s.sheet)return s.sheet;for(var o=document.styleSheets,a=0,l=o.length;a<l;a++){var u=o[a];if(u.ownerNode===s)return u}Gv(17)}(i),this.length=0}var n=e.prototype;return n.insertRule=function(r,i){try{return this.sheet.insertRule(i,r),this.length++,!0}catch{return!1}},n.deleteRule=function(r){this.sheet.deleteRule(r),this.length--},n.getRule=function(r){var i=this.sheet.cssRules[r];return i!==void 0&&typeof i.cssText=="string"?i.cssText:""},e}(),cee=function(){function e(r){var i=this.element=Q9(r);this.nodes=i.childNodes,this.length=0}var n=e.prototype;return n.insertRule=function(r,i){if(r<=this.length&&r>=0){var s=document.createTextNode(i),o=this.nodes[r];return this.element.insertBefore(s,o||null),this.length++,!0}return!1},n.deleteRule=function(r){this.element.removeChild(this.nodes[r]),this.length--},n.getRule=function(r){return r<this.length?this.nodes[r].textContent:""},e}(),uee=function(){function e(r){this.rules=[],this.length=0}var n=e.prototype;return n.insertRule=function(r,i){return r<=this.length&&(this.rules.splice(r,0,i),this.length++,!0)},n.deleteRule=function(r){this.rules.splice(r,1),this.length--},n.getRule=function(r){return r<this.length?this.rules[r]:""},e}(),w3=tO,dee={isServer:!tO,useCSSOMInjection:!JJ},J9=function(){function e(r,i,s){r===void 0&&(r=ku),i===void 0&&(i={}),this.options=lc({},dee,{},r),this.gs=i,this.names=new Map(s),this.server=!!r.isServer,!this.server&&tO&&w3&&(w3=!1,function(o){for(var a=document.querySelectorAll(ree),l=0,u=a.length;l<u;l++){var h=a[l];h&&h.getAttribute(og)!=="active"&&(oee(o,h),h.parentNode&&h.parentNode.removeChild(h))}}(this))}e.registerId=function(r){return ob(r)};var n=e.prototype;return n.reconstructWithOptions=function(r,i){return i===void 0&&(i=!0),new e(lc({},this.options,{},r),this.gs,i&&this.names||void 0)},n.allocateGSInstance=function(r){return this.gs[r]=(this.gs[r]||0)+1},n.getTag=function(){return this.tag||(this.tag=(s=(i=this.options).isServer,o=i.useCSSOMInjection,a=i.target,r=s?new uee(a):o?new lee(a):new cee(a),new eee(r)));var r,i,s,o,a},n.hasNameForId=function(r,i){return this.names.has(r)&&this.names.get(r).has(i)},n.registerName=function(r,i){if(ob(r),this.names.has(r))this.names.get(r).add(i);else{var s=new Set;s.add(i),this.names.set(r,s)}},n.insertRules=function(r,i,s){this.registerName(r,i),this.getTag().insertRules(ob(r),s)},n.clearNames=function(r){this.names.has(r)&&this.names.get(r).clear()},n.clearRules=function(r){this.getTag().clearGroup(ob(r)),this.clearNames(r)},n.clearTag=function(){this.tag=void 0},n.toString=function(){return function(r){for(var i=r.getTag(),s=i.length,o="",a=0;a<s;a++){var l=tee(a);if(l!==void 0){var u=r.names.get(l),h=i.getGroup(a);if(u&&h&&u.size){var p=og+".g"+a+'[id="'+l+'"]',g="";u!==void 0&&u.forEach(function(v){v.length>0&&(g+=v+",")}),o+=""+h+p+'{content:"'+g+`"}/*!sc*/
|
||
`}}}return o}(this)},e}(),hee=/(a)(d)/gi,_3=function(e){return String.fromCharCode(e+(e>25?39:97))};function MN(e){var n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=_3(n%52)+r;return(_3(n%52)+r).replace(hee,"$1-$2")}var Rp=function(e,n){for(var r=n.length;r;)e=33*e^n.charCodeAt(--r);return e},e7=function(e){return Rp(5381,e)};function fee(e){for(var n=0;n<e.length;n+=1){var r=e[n];if(_v(r)&&!eO(r))return!1}return!0}var pee=e7("5.3.11"),gee=function(){function e(n,r,i){this.rules=n,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&fee(n),this.componentId=r,this.baseHash=Rp(pee,r),this.baseStyle=i,J9.registerId(r)}return e.prototype.generateAndInjectStyles=function(n,r,i){var s=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(n,r,i)),this.isStatic&&!i.hash)if(this.staticRulesId&&r.hasNameForId(s,this.staticRulesId))o.push(this.staticRulesId);else{var a=ag(this.rules,n,r,i).join(""),l=MN(Rp(this.baseHash,a)>>>0);if(!r.hasNameForId(s,l)){var u=i(a,"."+l,void 0,s);r.insertRules(s,l,u)}o.push(l),this.staticRulesId=l}else{for(var h=this.rules.length,p=Rp(this.baseHash,i.hash),g="",v=0;v<h;v++){var w=this.rules[v];if(typeof w=="string")g+=w;else if(w){var S=ag(w,n,r,i),E=Array.isArray(S)?S.join(""):S;p=Rp(p,E+v),g+=E}}if(g){var x=MN(p>>>0);if(!r.hasNameForId(s,x)){var I=i(g,"."+x,void 0,s);r.insertRules(s,x,I)}o.push(x)}}return o.join(" ")},e}(),yee=/^\s*\/\/.*$/gm,mee=[":","[",".","#"];function vee(e){var n,r,i,s,o=ku,a=o.options,l=a===void 0?ku:a,u=o.plugins,h=u===void 0?tw:u,p=new UJ(l),g=[],v=function(E){function x(I){if(I)try{E(I+"}")}catch{}}return function(I,P,M,k,A,j,V,$,W,B){switch(I){case 1:if(W===0&&P.charCodeAt(0)===64)return E(P+";"),"";break;case 2:if($===0)return P+"/*|*/";break;case 3:switch($){case 102:case 112:return E(M[0]+P),"";default:return P+(B===0?"/*|*/":"")}case-2:P.split("/*|*/}").forEach(x)}}}(function(E){g.push(E)}),w=function(E,x,I){return x===0&&mee.indexOf(I[r.length])!==-1||I.match(s)?E:"."+n};function S(E,x,I,P){P===void 0&&(P="&");var M=E.replace(yee,""),k=x&&I?I+" "+x+" { "+M+" }":M;return n=P,r=x,i=new RegExp("\\"+r+"\\b","g"),s=new RegExp("(\\"+r+"\\b){2,}"),p(I||!x?"":x,k)}return p.use([].concat(h,[function(E,x,I){E===2&&I.length&&I[0].lastIndexOf(r)>0&&(I[0]=I[0].replace(i,w))},v,function(E){if(E===-2){var x=g;return g=[],x}}])),S.hash=h.length?h.reduce(function(E,x){return x.name||Gv(15),Rp(E,x.name)},5381).toString():"",S}var t7=D.createContext();t7.Consumer;var n7=D.createContext(),bee=(n7.Consumer,new J9),PN=vee();function wee(){return R.useContext(t7)||bee}function _ee(){return R.useContext(n7)||PN}var Cee=function(){function e(n,r){var i=this;this.inject=function(s,o){o===void 0&&(o=PN);var a=i.name+o.hash;s.hasNameForId(i.id,a)||s.insertRules(i.id,a,o(i.rules,a,"@keyframes"))},this.toString=function(){return Gv(12,String(i.name))},this.name=n,this.id="sc-keyframes-"+n,this.rules=r}return e.prototype.getName=function(n){return n===void 0&&(n=PN),this.name+n.hash},e}(),Eee=/([A-Z])/,xee=/([A-Z])/g,See=/^ms-/,Dee=function(e){return"-"+e.toLowerCase()};function C3(e){return Eee.test(e)?e.replace(xee,Dee).replace(See,"-ms-"):e}var E3=function(e){return e==null||e===!1||e===""};function ag(e,n,r,i){if(Array.isArray(e)){for(var s,o=[],a=0,l=e.length;a<l;a+=1)(s=ag(e[a],n,r,i))!==""&&(Array.isArray(s)?o.push.apply(o,s):o.push(s));return o}if(E3(e))return"";if(eO(e))return"."+e.styledComponentId;if(_v(e)){if(typeof(h=e)!="function"||h.prototype&&h.prototype.isReactComponent||!n)return e;var u=e(n);return ag(u,n,r,i)}var h;return e instanceof Cee?r?(e.inject(r,i),e.getName(i)):e:TN(e)?function p(g,v){var w,S,E=[];for(var x in g)g.hasOwnProperty(x)&&!E3(g[x])&&(Array.isArray(g[x])&&g[x].isCss||_v(g[x])?E.push(C3(x)+":",g[x],";"):TN(g[x])?E.push.apply(E,p(g[x],x)):E.push(C3(x)+": "+(w=x,(S=g[x])==null||typeof S=="boolean"||S===""?"":typeof S!="number"||S===0||w in KJ||w.startsWith("--")?String(S).trim():S+"px")+";"));return v?[v+" {"].concat(E,["}"]):E}(e):e.toString()}var x3=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Yv(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return _v(e)||TN(e)?x3(ag(v3(tw,[e].concat(r)))):r.length===0&&e.length===1&&typeof e[0]=="string"?e:x3(ag(v3(e,r)))}var Nee=function(e,n,r){return r===void 0&&(r=ku),e.theme!==r.theme&&e.theme||n||r.theme},Iee=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Oee=/(^-|-$)/g;function sE(e){return e.replace(Iee,"-").replace(Oee,"")}var Tee=function(e){return MN(e7(e)>>>0)};function ab(e){return typeof e=="string"&&!0}var AN=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},Mee=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function Pee(e,n,r){var i=e[r];AN(n)&&AN(i)?r7(i,n):e[r]=n}function r7(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var s=0,o=r;s<o.length;s++){var a=o[s];if(AN(a))for(var l in a)Mee(l)&&Pee(e,a[l],l)}return e}var i7=D.createContext();i7.Consumer;var oE={};function s7(e,n,r){var i=eO(e),s=!ab(e),o=n.attrs,a=o===void 0?tw:o,l=n.componentId,u=l===void 0?function(P,M){var k=typeof P!="string"?"sc":sE(P);oE[k]=(oE[k]||0)+1;var A=k+"-"+Tee("5.3.11"+k+oE[k]);return M?M+"-"+A:A}(n.displayName,n.parentComponentId):l,h=n.displayName,p=h===void 0?function(P){return ab(P)?"styled."+P:"Styled("+b3(P)+")"}(e):h,g=n.displayName&&n.componentId?sE(n.displayName)+"-"+n.componentId:n.componentId||u,v=i&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,w=n.shouldForwardProp;i&&e.shouldForwardProp&&(w=n.shouldForwardProp?function(P,M,k){return e.shouldForwardProp(P,M,k)&&n.shouldForwardProp(P,M,k)}:e.shouldForwardProp);var S,E=new gee(r,g,i?e.componentStyle:void 0),x=E.isStatic&&a.length===0,I=function(P,M){return function(k,A,j,V){var $=k.attrs,W=k.componentStyle,B=k.defaultProps,H=k.foldedComponentIds,Y=k.shouldForwardProp,te=k.styledComponentId,ue=k.target,ye=function(Se,J,Re){Se===void 0&&(Se=ku);var be=lc({},J,{theme:Se}),Oe={};return Re.forEach(function(Ee){var Le,tt,Pt,_t=Ee;for(Le in _v(_t)&&(_t=_t(be)),_t)be[Le]=Oe[Le]=Le==="className"?(tt=Oe[Le],Pt=_t[Le],tt&&Pt?tt+" "+Pt:tt||Pt):_t[Le]}),[be,Oe]}(Nee(A,R.useContext(i7),B)||ku,A,$),Ne=ye[0],q=ye[1],G=function(Se,J,Re,be){var Oe=wee(),Ee=_ee(),Le=J?Se.generateAndInjectStyles(ku,Oe,Ee):Se.generateAndInjectStyles(Re,Oe,Ee);return Le}(W,V,Ne),ae=j,ge=q.$as||A.$as||q.as||A.as||ue,X=ab(ge),ee=q!==A?lc({},A,{},q):A,ie={};for(var we in ee)we[0]!=="$"&&we!=="as"&&(we==="forwardedAs"?ie.as=ee[we]:(Y?Y(we,p3,ge):!X||p3(we))&&(ie[we]=ee[we]));return A.style&&q.style!==A.style&&(ie.style=lc({},A.style,{},q.style)),ie.className=Array.prototype.concat(H,te,G!==te?G:null,A.className,q.className).filter(Boolean).join(" "),ie.ref=ae,R.createElement(ge,ie)}(S,P,M,x)};return I.displayName=p,(S=D.forwardRef(I)).attrs=v,S.componentStyle=E,S.displayName=p,S.shouldForwardProp=w,S.foldedComponentIds=i?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):tw,S.styledComponentId=g,S.target=i?e.target:e,S.withComponent=function(P){var M=n.componentId,k=function(j,V){if(j==null)return{};var $,W,B={},H=Object.keys(j);for(W=0;W<H.length;W++)$=H[W],V.indexOf($)>=0||(B[$]=j[$]);return B}(n,["componentId"]),A=M&&M+"-"+(ab(P)?P:sE(b3(P)));return s7(P,lc({},k,{attrs:v,componentId:A}),r)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(P){this._foldedDefaultProps=i?r7({},e.defaultProps,P):P}}),Object.defineProperty(S,"toString",{value:function(){return"."+S.styledComponentId}}),s&&QJ(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var xt=function(e){return function n(r,i,s){if(s===void 0&&(s=ku),!Z9.isValidElementType(i))return Gv(1,String(i));var o=function(){return r(i,s,Yv.apply(void 0,arguments))};return o.withConfig=function(a){return n(r,i,lc({},s,{},a))},o.attrs=function(a){return n(r,i,lc({},s,{attrs:Array.prototype.concat(s.attrs,a).filter(Boolean)}))},o}(s7,e)};["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","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){xt[e]=xt(e)});const{abs:ym,cos:Jl,sin:xp,acos:Aee,atan2:mm,sqrt:fu,pow:_o}=Math;function vm(e){return e<0?-_o(-e,1/3):_o(e,1/3)}const o7=Math.PI,lb=2*o7,pu=o7/2,Ree=1e-6,aE=Number.MAX_SAFE_INTEGER||9007199254740991,lE=Number.MIN_SAFE_INTEGER||-9007199254740991,kee={x:0,y:0,z:0},Ve={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),fu(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const s=1-e;let o=n;if(i===0)return n[0].t=e,n[0];if(i===1){const l={x:s*o[0].x+e*o[1].x,y:s*o[0].y+e*o[1].y,t:e};return r&&(l.z=s*o[0].z+e*o[1].z),l}if(i<4){let l=s*s,u=e*e,h,p,g,v=0;i===2?(o=[o[0],o[1],o[2],kee],h=l,p=s*e*2,g=u):i===3&&(h=l*s,p=l*e*3,g=s*u*3,v=e*u);const w={x:h*o[0].x+p*o[1].x+g*o[2].x+v*o[3].x,y:h*o[0].y+p*o[1].y+g*o[2].y+v*o[3].y,t:e};return r&&(w.z=h*o[0].z+p*o[1].z+g*o[2].z+v*o[3].z),w}const a=JSON.parse(JSON.stringify(n));for(;a.length>1;){for(let l=0;l<a.length-1;l++)a[l]={x:a[l].x+(a[l+1].x-a[l].x)*e,y:a[l].y+(a[l+1].y-a[l].y)*e},typeof a[l].z<"u"&&(a[l].z=a[l].z+(a[l+1].z-a[l].z)*e);a.splice(a.length-1,1)}return a[0].t=e,a[0]},computeWithRatios:function(e,n,r,i){const s=1-e,o=r,a=n;let l=o[0],u=o[1],h=o[2],p=o[3],g;if(l*=s,u*=e,a.length===2)return g=l+u,{x:(l*a[0].x+u*a[1].x)/g,y:(l*a[0].y+u*a[1].y)/g,z:i?(l*a[0].z+u*a[1].z)/g:!1,t:e};if(l*=s,u*=2*s,h*=e*e,a.length===3)return g=l+u+h,{x:(l*a[0].x+u*a[1].x+h*a[2].x)/g,y:(l*a[0].y+u*a[1].y+h*a[2].y)/g,z:i?(l*a[0].z+u*a[1].z+h*a[2].z)/g:!1,t:e};if(l*=s,u*=1.5*s,h*=3*s,p*=e*e*e,a.length===4)return g=l+u+h+p,{x:(l*a[0].x+u*a[1].x+h*a[2].x+p*a[3].x)/g,y:(l*a[0].y+u*a[1].y+h*a[2].y+p*a[3].y)/g,z:i?(l*a[0].z+u*a[1].z+h*a[2].z+p*a[3].z)/g:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,s=i.length,o=s-1;s>1;s--,o--){const a=[];for(let l=0,u;l<o;l++)u={x:o*(i[l+1].x-i[l].x),y:o*(i[l+1].y-i[l].y)},n&&(u.z=o*(i[l+1].z-i[l].z)),a.push(u);r.push(a),i=a}return r},between:function(e,n,r){return n<=e&&e<=r||Ve.approximately(e,n)||Ve.approximately(e,r)},approximately:function(e,n,r){return ym(e-n)<=(r||Ree)},length:function(e){const r=Ve.Tvalues.length;let i=0;for(let s=0,o;s<r;s++)o=.5*Ve.Tvalues[s]+.5,i+=Ve.Cvalues[s]*Ve.arcfn(o,e);return .5*i},map:function(e,n,r,i,s){const o=r-n,a=s-i,l=e-n,u=l/o;return i+a*u},lerp:function(e,n,r){const i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(Ve.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,s=n.y-e.y,o=r.x-e.x,a=r.y-e.y,l=i*a-s*o,u=i*o+s*a;return mm(l,u)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return fu(r*r+i*i)},closest:function(e,n){let r=_o(2,63),i,s;return e.forEach(function(o,a){s=Ve.dist(n,o),s<r&&(r=s,i=a)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=_o(e,n)+_o(1-e,n),i=r-1;return ym(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=_o(1-e,n),i=_o(e,n)+r;return r/i},lli8:function(e,n,r,i,s,o,a,l){const u=(e*i-n*r)*(s-a)-(e-r)*(s*l-o*a),h=(e*i-n*r)*(o-l)-(n-i)*(s*l-o*a),p=(e-r)*(o-l)-(n-i)*(s-a);return p==0?!1:{x:u/p,y:h/p}},lli4:function(e,n,r,i){const s=e.x,o=e.y,a=n.x,l=n.y,u=r.x,h=r.y,p=i.x,g=i.y;return Ve.lli8(s,o,a,l,u,h,p,g)},lli:function(e,n){return Ve.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new rr(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=aE,r=aE,i=lE,s=lE;return e.forEach(function(o){const a=o.bbox();n>a.x.min&&(n=a.x.min),r>a.y.min&&(r=a.y.min),i<a.x.max&&(i=a.x.max),s<a.y.max&&(s=a.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+s)/2,max:s,size:s-r}}},shapeintersections:function(e,n,r,i,s){if(!Ve.bboxoverlap(n,i))return[];const o=[],a=[e.startcap,e.forward,e.back,e.endcap],l=[r.startcap,r.forward,r.back,r.endcap];return a.forEach(function(u){u.virtual||l.forEach(function(h){if(h.virtual)return;const p=u.intersects(h,s);p.length>0&&(p.c1=u,p.c2=h,p.s1=e,p.s2=r,o.push(p))})}),o},makeshape:function(e,n,r){const i=n.points.length,s=e.points.length,o=Ve.makeline(n.points[i-1],e.points[0]),a=Ve.makeline(e.points[s-1],n.points[0]),l={startcap:o,forward:e,back:n,endcap:a,bbox:Ve.findbbox([o,e,n,a])};return l.intersections=function(u){return Ve.shapeintersections(l,l.bbox,u,u.bbox,r)},l},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=aE,s=lE,o,a;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let l=0,u=r.length;l<u;l++)o=r[l],a=e.get(o),a[n]<i&&(i=a[n]),a[n]>s&&(s=a[n]);return{min:i,mid:(i+s)/2,max:s,size:s-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,s=-mm(n.p2.y-i,n.p2.x-r),o=function(a){return{x:(a.x-r)*Jl(s)-(a.y-i)*xp(s),y:(a.x-r)*xp(s)+(a.y-i)*Jl(s)}};return e.map(o)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=Ve.align(e,n),s=function(V){return 0<=V&&V<=1};if(r===2){const V=i[0].y,$=i[1].y,W=i[2].y,B=V-2*$+W;if(B!==0){const H=-fu($*$-V*W),Y=-V+$,te=-(H+Y)/B,ue=-(-H+Y)/B;return[te,ue].filter(s)}else if($!==W&&B===0)return[(2*$-W)/(2*$-2*W)].filter(s);return[]}const o=i[0].y,a=i[1].y,l=i[2].y,u=i[3].y;let h=-o+3*a-3*l+u,p=3*o-6*a+3*l,g=-3*o+3*a,v=o;if(Ve.approximately(h,0)){if(Ve.approximately(p,0))return Ve.approximately(g,0)?[]:[-v/g].filter(s);const V=fu(g*g-4*p*v),$=2*p;return[(V-g)/$,(-g-V)/$].filter(s)}p/=h,g/=h,v/=h;const w=(3*g-p*p)/3,S=w/3,E=(2*p*p*p-9*p*g+27*v)/27,x=E/2,I=x*x+S*S*S;let P,M,k,A,j;if(I<0){const V=-w/3,$=V*V*V,W=fu($),B=-E/(2*W),H=B<-1?-1:B>1?1:B,Y=Aee(H),te=vm(W),ue=2*te;return k=ue*Jl(Y/3)-p/3,A=ue*Jl((Y+lb)/3)-p/3,j=ue*Jl((Y+2*lb)/3)-p/3,[k,A,j].filter(s)}else{if(I===0)return P=x<0?vm(-x):-vm(x),k=2*P-p/3,A=-P-p/3,[k,A].filter(s);{const V=fu(I);return P=vm(-x+V),M=vm(x+V),[P-M-p/3].filter(s)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],s=n-2*r+i;if(s!==0){const o=-fu(r*r-n*i),a=-n+r,l=-(o+a)/s,u=-(-o+a)/s;return[l,u]}else if(r!==i&&s===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,s){let o,a,l,u,h=0,p=0;const g=Ve.compute(e,n),v=Ve.compute(e,r),w=g.x*g.x+g.y*g.y;if(i?(o=fu(_o(g.y*v.z-v.y*g.z,2)+_o(g.z*v.x-v.z*g.x,2)+_o(g.x*v.y-v.x*g.y,2)),a=_o(w+g.z*g.z,3/2)):(o=g.x*v.y-g.y*v.x,a=_o(w,3/2)),o===0||a===0)return{k:0,r:0};if(h=o/a,p=a/o,!s){const S=Ve.curvature(e-.001,n,r,i,!0).k,E=Ve.curvature(e+.001,n,r,i,!0).k;u=(E-h+(h-S))/2,l=(ym(E-h)+ym(h-S))/2}return{k:h,r:p,dk:u,adk:l}},inflections:function(e){if(e.length<4)return[];const n=Ve.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,s=n[1].x*n[2].y,o=n[3].x*n[2].y,a=18*(-3*r+2*i+3*s-o),l=18*(3*r-i-3*s),u=18*(s-r);if(Ve.approximately(a,0)){if(!Ve.approximately(l,0)){let v=-u/l;if(0<=v&&v<=1)return[v]}return[]}const h=2*a;if(Ve.approximately(h,0))return[];const p=l*l-4*a*u;if(p<0)return[];const g=Math.sqrt(p);return[(g-l)/h,-(l+g)/h].filter(function(v){return 0<=v&&v<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let s=0,o,a,l,u;s<i;s++)if(o=r[s],a=e[o].mid,l=n[o].mid,u=(e[o].size+n[o].size)/2,ym(a-l)>=u)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),s=n.bbox(),o=1e5,a=r||.5;if(i.x.size+i.y.size<a&&s.x.size+s.y.size<a)return[(o*(e._t1+e._t2)/2|0)/o+"/"+(o*(n._t1+n._t2)/2|0)/o];let l=e.split(.5),u=n.split(.5),h=[{left:l.left,right:u.left},{left:l.left,right:u.right},{left:l.right,right:u.right},{left:l.right,right:u.left}];h=h.filter(function(g){return Ve.bboxoverlap(g.left.bbox(),g.right.bbox())});let p=[];return h.length===0||(h.forEach(function(g){p=p.concat(Ve.pairiteration(g.left,g.right,a))}),p=p.filter(function(g,v){return p.indexOf(g)===v})),p},getccenter:function(e,n,r){const i=n.x-e.x,s=n.y-e.y,o=r.x-n.x,a=r.y-n.y,l=i*Jl(pu)-s*xp(pu),u=i*xp(pu)+s*Jl(pu),h=o*Jl(pu)-a*xp(pu),p=o*xp(pu)+a*Jl(pu),g=(e.x+n.x)/2,v=(e.y+n.y)/2,w=(n.x+r.x)/2,S=(n.y+r.y)/2,E=g+l,x=v+u,I=w+h,P=S+p,M=Ve.lli8(g,v,E,x,w,S,I,P),k=Ve.dist(M,e);let A=mm(e.y-M.y,e.x-M.x),j=mm(n.y-M.y,n.x-M.x),V=mm(r.y-M.y,r.x-M.x),$;return A<V?((A>j||j>V)&&(A+=lb),A>V&&($=V,V=A,A=$)):V<j&&j<A?($=V,V=A,A=$):V+=lb,M.s=A,M.e=V,M.r=k,M},numberSort:function(e,n){return e-n}};class Xm{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return Ve.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)Ve.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new Xm(r)}}const{abs:bm,min:S3,max:D3,cos:Lee,sin:jee,acos:Fee,sqrt:wm}=Math,$ee=Math.PI;class rr{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const w=[];r.forEach(function(S){["x","y","z"].forEach(function(E){typeof S[E]<"u"&&w.push(S[E])})}),r=w}let s=!1;const o=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");s=!0}}else if(o!==6&&o!==8&&o!==9&&o!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const a=this._3d=!s&&(o===9||o===12)||n&&n[0]&&typeof n[0].z<"u",l=this.points=[];for(let w=0,S=a?3:2;w<o;w+=S){var u={x:r[w],y:r[w+1]};a&&(u.z=r[w+2]),l.push(u)}const h=this.order=l.length-1,p=this.dims=["x","y"];a&&p.push("z"),this.dimlen=p.length;const g=Ve.align(l,{p1:l[0],p2:l[h]}),v=Ve.dist(l[0],l[h]);this._linear=g.reduce((w,S)=>w+bm(S.y),0)<v/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,s){if(typeof s>"u"&&(s=.5),s===0)return new rr(r,r,i);if(s===1)return new rr(n,r,r);const o=rr.getABC(2,n,r,i,s);return new rr(n,o.A,i)}static cubicFromPoints(n,r,i,s,o){typeof s>"u"&&(s=.5);const a=rr.getABC(3,n,r,i,s);typeof o>"u"&&(o=Ve.dist(r,a.C));const l=o*(1-s)/s,u=Ve.dist(n,i),h=(i.x-n.x)/u,p=(i.y-n.y)/u,g=o*h,v=o*p,w=l*h,S=l*p,E={x:r.x-g,y:r.y-v},x={x:r.x+w,y:r.y+S},I=a.A,P={x:I.x+(E.x-I.x)/(1-s),y:I.y+(E.y-I.y)/(1-s)},M={x:I.x+(x.x-I.x)/s,y:I.y+(x.y-I.y)/s},k={x:n.x+(P.x-n.x)/s,y:n.y+(P.y-n.y)/s},A={x:i.x+(M.x-i.x)/(1-s),y:i.y+(M.y-i.y)/(1-s)};return new rr(n,k,A,i)}static getUtils(){return Ve}getUtils(){return rr.getUtils()}static get PolyBezier(){return Xm}valueOf(){return this.toString()}toString(){return Ve.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,s=["M",r,i,this.order===2?"Q":"C"];for(let o=1,a=n.length;o<a;o++)s.push(n[o].x),s.push(n[o].y);return s.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=Ve.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=Ve.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return Ve.length(this.derivative.bind(this))}static getABC(n=2,r,i,s,o=.5){const a=Ve.projectionratio(o,n),l=1-a,u={x:a*r.x+l*s.x,y:a*r.y+l*s.y},h=Ve.abcratio(o,n);return{A:{x:i.x+(i.x-u.x)/h,y:i.y+(i.y-u.y)/h},B:i,C:u,S:r,E:s}}getABC(n,r){r=r||this.get(n);let i=this.points[0],s=this.points[this.order];return rr.getABC(this.order,i,r,s,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,s;r<n;r++)s=r/(n-1),i=this.compute(s),i.t=s,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),s=[];for(let o=0,a,l=0;o<i.length;o++)a=i[o],Ve.dist(a,n)<r&&(s.push(a),l+=o/i.length);return s.length?t/=s.length:!1}project(n){const r=this.getLUT(),i=r.length-1,s=Ve.closest(r,n),o=s.mpos,a=(o-1)/i,l=(o+1)/i,u=.1/i;let h=s.mdist,p=a,g=p,v;h+=1;for(let w;p<l+u;p+=u)v=this.compute(p),w=Ve.dist(n,v),w<h&&(h=w,g=p);return g=g<0?0:g>1?1:g,v=this.compute(g),v.t=g,v.d=h,v}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?Ve.computeWithRatios(n,this.points,this.ratios,this._3d):Ve.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let s=1,o,a;s<i;s++)o=n[s],a=n[s-1],r[s]={x:(i-s)/i*o.x+s/i*a.x,y:(i-s)/i*o.y+s/i*a.y};return r[i]=n[i-1],new rr(r)}derivative(n){return Ve.compute(n,this.dpoints[0],this._3d)}dderivative(n){return Ve.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new rr(Ve.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return Ve.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return Ve.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=wm(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),s=wm(r.x*r.x+r.y*r.y+r.z*r.z),o=wm(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=s,r.y/=s,r.z/=s,i.x/=o,i.y/=o,i.z/=o;const a={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},l=wm(a.x*a.x+a.y*a.y+a.z*a.z);a.x/=l,a.y/=l,a.z/=l;const u=[a.x*a.x,a.x*a.y-a.z,a.x*a.z+a.y,a.x*a.y+a.z,a.y*a.y,a.y*a.z-a.x,a.x*a.z-a.y,a.y*a.z+a.x,a.z*a.z];return{t:n,x:u[0]*r.x+u[1]*r.y+u[2]*r.z,y:u[3]*r.x+u[4]*r.y+u[5]*r.z,z:u[6]*r.x+u[7]*r.y+u[8]*r.z}}hull(n){let r=this.points,i=[],s=[],o=0;for(s[o++]=r[0],s[o++]=r[1],s[o++]=r[2],this.order===3&&(s[o++]=r[3]);r.length>1;){i=[];for(let a=0,l,u=r.length-1;a<u;a++)l=Ve.lerp(n,r[a],r[a+1]),s[o++]=l,i.push(l);r=i}return s}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),s={left:this.order===2?new rr([i[0],i[3],i[5]]):new rr([i[0],i[4],i[7],i[9]]),right:this.order===2?new rr([i[5],i[4],i[2]]):new rr([i[9],i[8],i[6],i[3]]),span:i};return s.left._t1=Ve.map(0,0,1,this._t1,this._t2),s.left._t2=Ve.map(n,0,1,this._t1,this._t2),s.right._t1=Ve.map(n,0,1,this._t1,this._t2),s.right._t2=Ve.map(1,0,1,this._t1,this._t2),r?(r=Ve.map(r,n,1,0,1),s.right.split(r).left):s}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let s=function(a){return a[i]},o=this.dpoints[0].map(s);n[i]=Ve.droots(o),this.order===3&&(o=this.dpoints[1].map(s),n[i]=n[i].concat(Ve.droots(o))),n[i]=n[i].filter(function(a){return a>=0&&a<=1}),r=r.concat(n[i].sort(Ve.numberSort))}).bind(this)),n.values=r.sort(Ve.numberSort).filter(function(i,s){return r.indexOf(i)===s}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=Ve.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return Ve.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),s=this.normal(n),o={c:i,n:s,x:i.x+s.x*r,y:i.y+s.y*r};return this._3d&&(o.z=i.z+s.z*r),o}if(this._linear){const i=this.normal(0),s=this.points.map(function(o){const a={x:o.x+n*i.x,y:o.y+n*i.y};return o.z&&i.z&&(a.z=o.z+n*i.z),a});return[new rr(s)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const s=Ve.angle(this.points[0],this.points[3],this.points[1]),o=Ve.angle(this.points[0],this.points[3],this.points[2]);if(s>0&&o<0||s<0&&o>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),bm(Fee(i))<$ee/3}reduce(){let n,r=0,i=0,s=.01,o,a=[],l=[],u=this.extrema().values;for(u.indexOf(0)===-1&&(u=[0].concat(u)),u.indexOf(1)===-1&&u.push(1),r=u[0],n=1;n<u.length;n++)i=u[n],o=this.split(r,i),o._t1=r,o._t2=i,a.push(o),r=i;return a.forEach(function(h){for(r=0,i=0;i<=1;)for(i=r+s;i<=1+s;i+=s)if(o=h.split(r,i),!o.simple()){if(i-=s,bm(r-i)<s)return[];o=h.split(r,i),o._t1=Ve.map(r,0,1,h._t1,h._t2),o._t2=Ve.map(i,0,1,h._t1,h._t2),l.push(o),r=i;break}r<1&&(o=h.split(r,1),o._t1=Ve.map(r,0,1,h._t1,h._t2),o._t2=h._t2,l.push(o))}),l}translate(n,r,i){i=typeof i=="number"?i:r;const s=this.order;let o=this.points.map((a,l)=>(1-l/s)*r+l/s*i);return new rr(this.points.map((a,l)=>({x:a.x+n.x*o[l],y:a.y+n.y*o[l]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const s=this.clockwise,o=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const a=i?i(0):n,l=i?i(1):n,u=[this.offset(0,10),this.offset(1,10)],h=[],p=Ve.lli4(u[0],u[0].c,u[1],u[1].c);if(!p)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(g){const v=h[g*r]=Ve.copy(o[g*r]);v.x+=(g?l:a)*u[g].n.x,v.y+=(g?l:a)*u[g].n.y}),i?([0,1].forEach(function(g){if(!(r===2&&g)){var v=o[g+1],w={x:v.x-p.x,y:v.y-p.y},S=i?i((g+1)/r):n;i&&!s&&(S=-S);var E=wm(w.x*w.x+w.y*w.y);w.x/=E,w.y/=E,h[g+1]={x:v.x+S*w.x,y:v.y+S*w.y}}}),new rr(h)):([0,1].forEach(g=>{if(r===2&&g)return;const v=h[g*r],w=this.derivative(g),S={x:v.x+w.x,y:v.y+w.y};h[g+1]=Ve.lli4(v,S,p,o[g+1])}),new rr(h))}outline(n,r,i,s){if(r=r===void 0?n:r,this._linear){const A=this.normal(0),j=this.points[0],V=this.points[this.points.length-1];let $,W,B;i===void 0&&(i=n,s=r),$={x:j.x+A.x*n,y:j.y+A.y*n},B={x:V.x+A.x*i,y:V.y+A.y*i},W={x:($.x+B.x)/2,y:($.y+B.y)/2};const H=[$,W,B];$={x:j.x-A.x*r,y:j.y-A.y*r},B={x:V.x-A.x*s,y:V.y-A.y*s},W={x:($.x+B.x)/2,y:($.y+B.y)/2};const Y=[B,W,$],te=Ve.makeline(Y[2],H[0]),ue=Ve.makeline(H[2],Y[0]),ye=[te,new rr(H),ue,new rr(Y)];return new Xm(ye)}const o=this.reduce(),a=o.length,l=[];let u=[],h,p=0,g=this.length();const v=typeof i<"u"&&typeof s<"u";function w(A,j,V,$,W){return function(B){const H=$/V,Y=($+W)/V,te=j-A;return Ve.map(B,0,1,A+H*te,A+Y*te)}}o.forEach(function(A){const j=A.length();v?(l.push(A.scale(w(n,i,g,p,j))),u.push(A.scale(w(-r,-s,g,p,j)))):(l.push(A.scale(n)),u.push(A.scale(-r))),p+=j}),u=u.map(function(A){return h=A.points,h[3]?A.points=[h[3],h[2],h[1],h[0]]:A.points=[h[2],h[1],h[0]],A}).reverse();const S=l[0].points[0],E=l[a-1].points[l[a-1].points.length-1],x=u[a-1].points[u[a-1].points.length-1],I=u[0].points[0],P=Ve.makeline(x,S),M=Ve.makeline(E,I),k=[P].concat(l).concat([M]).concat(u);return new Xm(k)}outlineshapes(n,r,i){r=r||n;const s=this.outline(n,r).curves,o=[];for(let a=1,l=s.length;a<l/2;a++){const u=Ve.makeshape(s[a],s[l-a],i);u.startcap.virtual=a>1,u.endcap.virtual=a<l/2-1,o.push(u)}return o}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof rr&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=S3(n.p1.x,n.p2.x),i=S3(n.p1.y,n.p2.y),s=D3(n.p1.x,n.p2.x),o=D3(n.p1.y,n.p2.y);return Ve.roots(this.points,n).filter(a=>{var l=this.get(a);return Ve.between(l.x,r,s)&&Ve.between(l.y,i,o)})}selfintersects(n){const r=this.reduce(),i=r.length-2,s=[];for(let o=0,a,l,u;o<i;o++)l=r.slice(o,o+1),u=r.slice(o+2),a=this.curveintersects(l,u,n),s.push(...a);return s}curveintersects(n,r,i){const s=[];n.forEach(function(a){r.forEach(function(l){a.overlaps(l)&&s.push({left:a,right:l})})});let o=[];return s.forEach(function(a){const l=Ve.pairiteration(a.left,a.right,i);l.length>0&&(o=o.concat(l))}),o}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,s){const o=(s-i)/4,a=this.get(i+o),l=this.get(s-o),u=Ve.dist(n,r),h=Ve.dist(n,a),p=Ve.dist(n,l);return bm(h-u)+bm(p-u)}_iterate(n,r){let i=0,s=1,o;do{o=0,s=1;let a=this.get(i),l,u,h,p,g=!1,v=!1,w,S=s,E=1;do if(v=g,p=h,S=(i+s)/2,l=this.get(S),u=this.get(s),h=Ve.getccenter(a,l,u),h.interval={start:i,end:s},g=this._error(h,a,i,s)<=n,w=v&&!g,w||(E=s),g){if(s>=1){if(h.interval.end=E=1,p=h,s>1){let I={x:h.x+h.r*Lee(h.e),y:h.y+h.r*jee(h.e)};h.e+=Ve.angle({x:h.x,y:h.y},I,this.get(1))}break}s=s+(s-i)/2}else s=S;while(!w&&o++<100);if(o>=100)break;p=p||h,r.push(p),i=E}while(s<1);return r}}var zee=Object.defineProperty,Vee=Object.getOwnPropertyDescriptor,sd=(e,n,r,i)=>{for(var s=i>1?void 0:i?Vee(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&zee(n,r,s),s},Bee=3,Hee=2,Uee="workflow-port-bg",Kee=xt.div`
|
||
width: 20px;
|
||
height: 20px;
|
||
border-radius: 50%;
|
||
margin-top: -10px;
|
||
margin-left: -10px;
|
||
left: 50%;
|
||
top: 50%;
|
||
position: absolute;
|
||
// 非 hover 状态下的样式
|
||
border: none;
|
||
|
||
& > .symbol {
|
||
opacity: 0;
|
||
}
|
||
|
||
.bg-circle {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
position: absolute;
|
||
border-radius: 50%;
|
||
width: 20px;
|
||
height: 20px;
|
||
background-color: #fff;
|
||
transform: scale(0.5);
|
||
transition: all 0.2s linear 0s;
|
||
}
|
||
|
||
.bg {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
position: relative;
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: 50%;
|
||
background: #9197F1;
|
||
transform: scale(0.4, 0.4);
|
||
transition: all 0.2s linear 0s;
|
||
|
||
&.hasError {
|
||
background: red;
|
||
}
|
||
|
||
.symbol {
|
||
position: absolute;
|
||
width: 14px;
|
||
height: 14px;
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
color: #fff;
|
||
transition: opacity 0.2s linear 0s;
|
||
|
||
& > svg {
|
||
width: 14px;
|
||
height: 14px;
|
||
}
|
||
}
|
||
|
||
.focus-circle {
|
||
position: absolute;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
width: 8px;
|
||
height: 8px;
|
||
opacity: 0;
|
||
background: #9197f1;
|
||
border-radius: 50%;
|
||
transition: opacity 0.2s linear 0s;
|
||
}
|
||
}
|
||
|
||
&.linked .bg:not(.hasError) {
|
||
background: #4d53e8;
|
||
}
|
||
|
||
&.hovered .bg:not(.hasError) {
|
||
border: none;
|
||
cursor: crosshair;
|
||
transform: scale(1, 1);
|
||
background: #4d53e8;
|
||
|
||
& > .symbol {
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
.cross-hair {
|
||
position: relative;
|
||
left: 2px;
|
||
top: 2px;
|
||
|
||
&::after,
|
||
&::before {
|
||
content: '';
|
||
background: #fff;
|
||
border-radius: 2px;
|
||
position: absolute;
|
||
}
|
||
|
||
&::after {
|
||
left: 4px;
|
||
width: 2px;
|
||
height: 6px;
|
||
box-shadow: 0 4px #fff;
|
||
}
|
||
|
||
&::before {
|
||
top: 4px;
|
||
width: 6px;
|
||
height: 2px;
|
||
box-shadow: 4px 0 #fff;
|
||
}
|
||
`;function Wee(){return D.createElement("div",{className:"symbol"},D.createElement("div",{className:"cross-hair"}))}var Fw=D.memo(e=>{var V;const n=Wt(Zs),r=Wt(oi),{entity:i,onClick:s}=e,{portType:o,relativePosition:a,disabled:l}=i,[u,h]=R.useState(i.targetElement),[p,g]=R.useState(a.x),[v,w]=R.useState(a.y),[S,E]=R.useState(!1),[x,I]=R.useState(!!((V=i==null?void 0:i.lines)!=null&&V.length)),[P,M]=R.useState(e.entity.hasError),k=L9();R.useEffect(()=>{i.validate(),M(i.hasError);const $=i.onEntityChange(()=>{if(i.targetElement){i.targetElement!==u&&h(i.targetElement);return}const Y=i.relativePosition;g(Math.round(Y.x)),w(Math.round(Y.y))}),W=n.onHoveredChange(Y=>{E(n.isHovered(i.id))}),B=i.onErrorChanged(()=>{M(i.hasError)}),H=r.onAvailableLinesChange(()=>{setTimeout(()=>{r.disposed||i.disposed||I(!!i.lines.length)},0)});return()=>{$.dispose(),W.dispose(),B.dispose(),H.dispose()}},[n,i,u]);const A=ic(e.className||"",{hovered:!k&&S&&!l&&o!=="input",linked:x}),j=D.createElement(Kee,{className:A,style:u?e.style:{...e.style,left:p,top:v},onClick:s,"data-port-entity-id":i.id,"data-port-entity-type":i.portType,"data-testid":"sdk.workflow.canvas.node.port"},D.createElement("div",{className:ic("bg-circle","workflow-bg-circle")}),D.createElement("div",{className:ic({bg:!0,[Uee]:!0,"workflow-point-bg":!0,hasError:P})},D.createElement(Wee,null)),D.createElement("div",{className:"focus-circle"}));return u?Ks.createPortal(j,u):j}),Mi=6,rw=12,qee=xt.div.attrs({className:"gedit-flow-activity-edge"})`
|
||
position: absolute;
|
||
|
||
@keyframes flowingDash {
|
||
to {
|
||
stroke-dashoffset: -13;
|
||
}
|
||
}
|
||
|
||
.dashed-line {
|
||
stroke-dasharray: 8, 5;
|
||
}
|
||
|
||
.flowing-line {
|
||
animation: flowingDash 0.5s linear infinite;
|
||
}
|
||
`;function Gee({id:e,pos:n,reverseArrow:r,strokeWidth:i,vertical:s,hide:o}){if(o)return null;const a=s?r?`M ${n.x-Mi},${n.y} L ${n.x},${n.y-Mi} L ${n.x+Mi},${n.y}`:`M ${n.x-Mi},${n.y-Mi} L ${n.x},${n.y} L ${n.x+Mi},${n.y-Mi}`:r?`M ${n.x},${n.y+Mi} L ${n.x-Mi},${n.y} L ${n.x},${n.y-Mi}`:`M ${n.x-Mi},${n.y-Mi} L ${n.x},${n.y} L ${n.x-Mi},${n.y+Mi}`;return D.createElement("path",{d:a,strokeLinecap:"round",stroke:`url(#${e})`,fill:"none",strokeWidth:i})}var Sp=12,Yee=e=>{const{line:n,color:r,selected:i,children:s,strokePrefix:o}=e,{position:a,reverse:l,vertical:u,hideArrow:h}=n,p=n.getData(hc),{bounds:g,path:v}=p,w=A=>({x:A.x-g.x+Sp,y:A.y-g.y+Sp}),S=w(a.from),E=w(a.to),x=u?{x:E.x,y:E.y-Xa}:{x:E.x-Xa,y:E.y},I=u?{x:S.x,y:S.y+Xa+Mi}:{x:S.x+Xa+Mi,y:S.y},P=i?Bee:Hee,M=o?`${o}-${n.id}`:n.id,k=D.createElement("path",{d:v,fill:"none",stroke:`url(#${M})`,strokeWidth:P,className:ic(n.className,!n.className&&(n.processing||n.flowing?"dashed-line flowing-line":""))});return D.createElement(qee,{style:{left:g.x-Sp,top:g.y-Sp,position:"absolute"}},s,D.createElement("svg",{width:g.width+Sp*2,height:g.height+Sp*2},D.createElement("defs",null,D.createElement("linearGradient",{x1:u?"100%":"0%",y1:u?"0%":"100%",x2:"100%",y2:"100%",id:M,gradientUnits:"userSpaceOnUse"},D.createElement("stop",{stopColor:r,offset:"0%"}),D.createElement("stop",{stopColor:r,offset:"100%"}))),D.createElement("g",null,k,D.createElement(Gee,{id:M,reverseArrow:l,pos:l?I:x,strokeWidth:P,vertical:u,hide:h}))))},Xee=R.memo(Yee,(e,n)=>e.version===n.version),ca=class extends er{constructor(){super(...arguments),this.layerID=GI(),this.mountedLines=new Map,this._version=0,this.node=ft.createDivWithClass("gedit-playground-layer gedit-flow-lines-layer")}onZoom(e){this.node.style.transform=`scale(${e})`}onReady(){this.pipelineNode.appendChild(this.node),this.toDispose.pushAll([this.selectService.onSelectionChanged(()=>this.render()),this.hoverService.onHoveredChange(()=>this.render()),this.workflowDocument.linesManager.onForceUpdate(()=>{this.mountedLines.clear(),this.bumpVersion(),this.render()})])}dispose(){this.mountedLines.clear()}render(){const[,e]=R.useState({});R.useLayoutEffect(()=>{const i=requestAnimationFrame(()=>{let s=!1;this.lines.forEach(o=>{const a=o.getData(hc),l=a.renderVersion;a.update(),a.renderVersion!==l&&(s=!0)}),s&&e({})});return()=>cancelAnimationFrame(i)},[this.lines]);const n=this.lines.map(r=>this.renderLine(r));return D.createElement(D.Fragment,null,n)}bumpVersion(){this._version=this._version+1,this._version===Number.MAX_SAFE_INTEGER&&(this._version=0)}lineProps(e){const{lineType:n}=this.workflowDocument.linesManager,r=this.selectService.isSelected(e.id),i=this.hoverService.isHovered(e.id),s=this.lineVersion(e);return{key:e.id,color:e.color,selected:r,hovered:i,line:e,lineType:n,version:s,strokePrefix:this.layerID}}lineVersion(e){const n=e.getData(hc),{renderVersion:r}=n,i=this.selectService.isSelected(e.id),s=this.hoverService.isHovered(e.id),{version:o,color:a}=e;return`v:${this._version},lv:${o},rv:${r},c:${a},s:${i?"T":"F"},h:${s?"T":"F"}`}lineComponent(e){const n=this.options.renderInsideLine??(()=>D.createElement(D.Fragment,null));return D.createElement(Xee,{...e},D.createElement(n,{...e}))}renderLine(e){const n=this.lineProps(e),r=this.mountedLines.get(e.id),i=r!==void 0,{portal:s,version:o}=r??{};if(i&&o===n.version)return s;i||(this.renderElement.appendChild(e.node),e.onDispose(()=>{this.mountedLines.delete(e.id),e.node.remove()}));const a=Ks.createPortal(this.lineComponent(n),e.node);return this.mountedLines.set(e.id,{line:e,portal:a,version:n.version}),a}get renderElement(){return this.stackContext.node}};ca.type="WorkflowLinesLayer";sd([oe(Zs)],ca.prototype,"hoverService",2);sd([oe(or)],ca.prototype,"selectService",2);sd([oe(Ui)],ca.prototype,"stackContext",2);sd([CI(zs)],ca.prototype,"lines",2);sd([CI(Ph)],ca.prototype,"ports",2);sd([ml(To,qt)],ca.prototype,"trans",2);sd([oe(Et)],ca.prototype,"workflowDocument",2);ca=sd([$e()],ca);var Nu=300;function Zee(e,n){const r=Qe.createRectangleWithTwoPoints(e,n);let i;e.x<=n.x?i=e.y<=n.y?1:0:i=e.y<=n.y?3:2;let s;switch(i){case 0:s=[{x:r.rightBottom.x-r.width/2,y:r.rightBottom.y},{x:r.leftTop.x+r.width/2,y:r.leftTop.y}];break;case 1:s=[{x:r.rightTop.x-r.width/2,y:r.rightTop.y},{x:r.leftBottom.x+r.width/2,y:r.leftBottom.y}];break;case 2:s=[{x:r.rightBottom.x+Math.min(r.width,Nu),y:r.rightBottom.y},{x:r.leftTop.x-Math.min(r.width,Nu),y:r.leftTop.y}];break;case 3:s=[{x:r.rightTop.x+Math.min(r.width,Nu),y:r.rightTop.y},{x:r.leftBottom.x-Math.min(r.width,Nu),y:r.leftBottom.y}]}return s}function Qee(e,n){const r=Qe.createRectangleWithTwoPoints(e,n);let i;e.y<=n.y?i=e.x<=n.x?1:3:i=e.x<=n.x?0:2;let s;switch(i){case 1:s=[{x:r.leftTop.x,y:r.leftTop.y+r.height/2},{x:r.rightBottom.x,y:r.rightBottom.y-r.height/2}];break;case 3:s=[{x:r.rightTop.x,y:r.rightTop.y+r.height/2},{x:r.leftBottom.x,y:r.leftBottom.y-r.height/2}];break;case 0:s=[{x:r.leftBottom.x,y:r.leftBottom.y+Math.min(r.height,Nu)},{x:r.rightTop.x,y:r.rightTop.y-Math.min(r.height,Nu)}];break;case 2:s=[{x:r.rightBottom.x,y:r.rightBottom.y+Math.min(r.height,Nu)},{x:r.leftTop.x,y:r.leftTop.y-Math.min(r.height,Nu)}];break}return s}var a7=class{constructor(e){this.entity=e}get path(){var e;return((e=this.data)==null?void 0:e.path)??""}calcDistance(e){return this.data?qs.getDistance(e,this.data.bezier.project(e)):Number.MAX_SAFE_INTEGER}get bounds(){return this.data?this.data.bbox:new Qe}update(e){this.data=this.calcBezier(e.fromPos,e.toPos)}calcBezier(e,n){const r=this.entity.vertical?Qee(e,n):Zee(e,n),i=new rr([e,...r,n]),s=i.bbox(),o=new Qe(s.x.min,s.y.min,s.x.max-s.x.min,s.y.max-s.y.min),a=this.getPath({bbox:o,fromPos:e,toPos:n,controls:r});return this.data={fromPos:e,toPos:n,bezier:i,bbox:o,controls:r,path:a},this.data}getPath(e){const{bbox:n}=e,r=h=>({x:h.x-n.x+rw,y:h.y-n.y+rw}),i=r(e.fromPos),s=r(e.toPos),o=e.controls.map(h=>r(h)),a=this.entity.vertical?{x:s.x,y:s.y-Xa}:{x:s.x-Xa,y:s.y};return(()=>{const h=o.map(g=>`${g.x} ${g.y}`).join(","),p=o.length===1?"S":"C";return this.entity.vertical?`M${i.x} ${i.y+Xa} ${p} ${h}, ${a.x} ${a.y}`:`M${i.x+Xa} ${i.y} ${p} ${h}, ${a.x} ${a.y}`})()}};a7.type=WI.BEZIER;var Jee=(e,n,r)=>{const{x:i,y:s}=e,{x:o,y:a}=n,{x:l,y:u}=r,h=i-o,p=s-a,g=l-o,v=u-a,w=h*g+p*v,S=g*g+v*v,E=S===0?-1:w/S;let x,I;E<0?(x=o,I=a):E>1?(x=l,I=u):(x=o+E*g,I=a+E*v);const P=i-x,M=s-I;return Math.sqrt(P*P+M*M)},kp;(e=>{function i({source:h,target:p}){const g=Math.abs(p.x-h.x)/2,v=p.x<h.x?p.x+g:p.x-g,w=Math.abs(p.y-h.y)/2,S=p.y<h.y?p.y+w:p.y-w;return[v,S]}const s=({source:h,target:p})=>h.x<p.x?{x:1,y:0}:{x:-1,y:0};function o({source:h,target:p,vertical:g=!1}){const v=g?{x:0,y:1}:{x:1,y:0},w=g?{x:0,y:-1}:{x:-1,y:0},S={x:h.x+v.x*20,y:h.y+v.y*20},E={x:p.x+w.x*20,y:p.y+w.y*20},x=g?{x:0,y:S.y<E.y?1:-1}:s({source:S,target:E}),I=x.x!==0?"x":"y",P=x[I];let M=[],k,A;const[j,V]=i({source:h,target:p});if(v[I]*w[I]===-1){k=j,A=V;const W=[{x:k,y:S.y},{x:k,y:E.y}],B=[{x:S.x,y:A},{x:E.x,y:A}];v[I]===P?M=I==="x"?W:B:M=I==="x"?B:W}else{const W=[{x:S.x,y:E.y}],B=[{x:E.x,y:S.y}];I==="x"?M=v.x===P?B:W:M=v.y===P?W:B;const H=I==="x"?"y":"x",Y=v[I]===w[H],te=S[H]>E[H],ue=S[H]<E[H];(v[I]===1&&(!Y&&te||Y&&ue)||v[I]!==1&&(!Y&&ue||Y&&te))&&(M=I==="x"?W:B);const Ne={x:S.x,y:S.y},q={x:E.x,y:E.y},G=Math.max(Math.abs(Ne.x-M[0].x),Math.abs(q.x-M[0].x)),ae=Math.max(Math.abs(Ne.y-M[0].y),Math.abs(q.y-M[0].y));G>=ae?(k=(Ne.x+q.x)/2,A=M[0].y):(k=M[0].x,A=(Ne.y+q.y)/2)}return[h,{x:S.x,y:S.y},...M,{x:E.x,y:E.y},p]}e.getPoints=o;function a(h,p,g){const v=Math.min(qs.getDistance(h,p)/2,qs.getDistance(p,g)/2,5),{x:w,y:S}=p;if(h.x===w&&w===g.x||h.y===S&&S===g.y)return`L${w} ${S}`;if(h.y===S){const I=h.x<g.x?-1:1,P=h.y<g.y?1:-1;return`L ${w+v*I},${S}Q ${w},${S} ${w},${S+v*P}`}const E=h.x<g.x?1:-1,x=h.y<g.y?-1:1;return`L ${w},${S+v*x}Q ${w},${S} ${w+v*E},${S}`}function l(h){return h.reduce((g,v,w)=>{let S="";return w>0&&w<h.length-1?S=a(h[w-1],v,h[w+1]):S=`${w===0?"M":"L"}${v.x} ${v.y}`,g+=S,g},"")}e.getSmoothStepPath=l;function u(h){const p=h.map(x=>x.x),g=h.map(x=>x.y),v=Math.min(...p),w=Math.max(...p),S=Math.min(...g),E=Math.max(...g);return Qe.createRectangleWithTwoPoints({x:v,y:S},{x:w,y:E})}e.getBounds=u,e.getFoldLineToPointDistance=(h,p)=>{if(h.length===0)return 1/0;if(h.length===1)return qs.getDistance(h[0],p);const g=[];for(let w=0;w<h.length-1;w++)g.push([h[w],h[w+1]]);const v=g.map(w=>{const[S,E]=w;return Jee(p,S,E)});return Math.min(...v)}})(kp||(kp={}));var l7=class{constructor(e){this.entity=e}get path(){var e;return((e=this.data)==null?void 0:e.path)??""}calcDistance(e){return this.data?kp.getFoldLineToPointDistance(this.data.points,e):Number.MAX_SAFE_INTEGER}get bounds(){return this.data?this.data.bbox:new Qe}update(e){const{fromPos:n,toPos:r}=e,{vertical:i}=this.entity,s={x:i?0:Xa,y:i?Xa:0},o={x:i?0:-10,y:i?-10:0},a=kp.getPoints({source:{x:n.x+s.x,y:n.y+s.y},target:{x:r.x+o.x,y:r.y+o.y},vertical:i}),l=kp.getBounds(a),u=a.map(p=>({x:p.x-l.x+rw,y:p.y-l.y+rw})),h=kp.getSmoothStepPath(u);this.data={points:a,path:h,bbox:l}}};l7.type=WI.LINE_CHART;var c7=Gn({singleton:!0,onInit:(e,n)=>{e.playground.registerLayer(ca,{...n})},onReady:(e,n)=>{const r=e.container.get(oi);r.registerContribution(a7).registerContribution(l7),n.contributions&&n.contributions.forEach(i=>{r.registerContribution(i)}),n.defaultLineType&&r.switchLineType(n.defaultLineType)}}),ete=Object.defineProperty,tte=Object.getOwnPropertyDescriptor,ga=(e,n,r,i)=>{for(var s=i>1?void 0:i?tte(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&ete(n,r,s),s},nte=2;function rte(e,n=!0){const r=e.filter(i=>i instanceof To);return r.length>(n?1:0)?Qe.enlarge(r.map(i=>i.getData(at).bounds)).pad(nte):Qe.EMPTY}var ite="workflow-port-bg",RN;(e=>{e.DEFAULT={canHovered:()=>!0}})(RN||(RN={}));var ste=".gedit-flow-activity-line",ote=".gedit-flow-activity-node",ws=class extends er{constructor(){super(...arguments),this.nodeTransformsWithSort=[]}autorun(){const{activatedNode:e}=this.selectionService;this.nodeTransformsWithSort=this.nodeTransforms.filter(n=>n.entity.id!=="root").reverse().sort(n=>n.entity===e?-1:0)}get isDrawing(){return this.linesManager.isDrawing}onReady(){this.options={...RN.DEFAULT,...this.options},this.toDispose.pushAll([this.listenPlaygroundEvent("mousemove",e=>{if(this.hoverService.hoveredPos=this.config.getPosFromMouseEvent(e),!this.isEnabled()||!this.options.canHovered(e,this.hoverService))return;const n=this.config.getPosFromMouseEvent(e);this.updateHoveredState(n,e==null?void 0:e.target)}),this.selectionService.onSelectionChanged(()=>this.autorun()),this.listenPlaygroundEvent("mousedown",e=>{var s;if(!this.isEnabled()||this.isDrawing)return;const{hoveredNode:n}=this.hoverService;if(n&&n instanceof zs)return this.dragService.resetLine(n,e),!0;if(n&&n instanceof Ph&&n.portType!=="input"&&!n.disabled&&e.button!==1)return e.stopPropagation(),e.preventDefault(),this.dragService.startDrawingLine(n,e),!0;const r=this.config.getPosFromMouseEvent(e),i=rte(this.selectionService.selection,!0);if(i.width>0&&i.contains(r.x,r.y))return(s=this.dragService.startDragSelectedNodes(e))==null||s.then(o=>{o||(n&&n instanceof To?e.shiftKey?this.selectionService.toggleSelect(n):this.selectionService.selectNode(n):this.selectionService.clear())}),!0;n||this.selectionService.clear()})])}updateHoveredState(e,n){var E,x,I;const{hoverService:r}=this,i=this.nodeTransformsWithSort,s=this.linesManager.getPortFromMousePos(e),a=[...this.playgroundNode.querySelectorAll(ste)].some(P=>P.contains(n));if(s){if(s.portType==="output")r.updateHoveredKey(s.id);else if(a||(x=(E=n==null?void 0:n.className)==null?void 0:E.includes)!=null&&x.call(E,ite)){const P=this.linesManager.getCloseInLineFromMousePos(e);P&&this.updateHoveredKey(P.id)}return}if(this.isDrawing)return;const l=(I=i.find(P=>P.bounds.contains(e.x,e.y)))==null?void 0:I.entity,h=[...this.playgroundNode.querySelectorAll(ote)].some(P=>P.contains(n));(l||h)&&l!=null&&l.id&&this.updateHoveredKey(l.id);const p=!!(l!=null&&l.parent&&l.parent.flowNodeType!=="root"),g=a?this.linesManager.getCloseInLineFromMousePos(e):void 0,v=!!(g!=null&&g.inContainer);if(l&&p){this.updateHoveredKey(l.id);return}if(g&&v){this.updateHoveredKey(g.id);return}if(l){this.updateHoveredKey(l.id);return}if(g){this.hoverService.updateHoveredKey(g.id);return}r.clearHovered(),this.editorStateConfig.getCurrentState()===xn.STATE_MOUSE_FRIENDLY_SELECT&&!this.editorStateConfig.isPressingShift&&this.configEntity.updateCursor("grab")}updateHoveredKey(e){this.configEntity.updateCursor("default"),this.hoverService.updateHoveredKey(e)}isEnabled(){const e=this.editorStateConfig.getCurrentState();return(e===xn.STATE_SELECT||e===xn.STATE_MOUSE_FRIENDLY_SELECT)&&!this.selectorBoxConfigEntity.isStart&&!this.dragService.isDragging}};ws.type="HoverLayer";ga([oe(Et)],ws.prototype,"document",2);ga([oe(or)],ws.prototype,"selectionService",2);ga([oe(yr)],ws.prototype,"dragService",2);ga([oe(Zs)],ws.prototype,"hoverService",2);ga([oe(oi)],ws.prototype,"linesManager",2);ga([Tn(al)],ws.prototype,"editorStateConfig",2);ga([Tn(Uv)],ws.prototype,"selectorBoxConfigEntity",2);ga([oe(qn)],ws.prototype,"configEntity",2);ga([ml(To,at)],ws.prototype,"nodeTransforms",2);ga([CI(zs)],ws.prototype,"lines",2);ws=ga([$e()],ws);var ate=Gn({onInit(e){e.playground.registerLayer(ws)}}),cE,N3;function nO(){if(N3)return cE;N3=1;var e="\0",n="\0",r="";class i{constructor(p){Ue(this,"_isDirected",!0);Ue(this,"_isMultigraph",!1);Ue(this,"_isCompound",!1);Ue(this,"_label");Ue(this,"_defaultNodeLabelFn",()=>{});Ue(this,"_defaultEdgeLabelFn",()=>{});Ue(this,"_nodes",{});Ue(this,"_in",{});Ue(this,"_preds",{});Ue(this,"_out",{});Ue(this,"_sucs",{});Ue(this,"_edgeObjs",{});Ue(this,"_edgeLabels",{});Ue(this,"_nodeCount",0);Ue(this,"_edgeCount",0);Ue(this,"_parent");Ue(this,"_children");p&&(this._isDirected=p.hasOwnProperty("directed")?p.directed:!0,this._isMultigraph=p.hasOwnProperty("multigraph")?p.multigraph:!1,this._isCompound=p.hasOwnProperty("compound")?p.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[n]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(p){return this._label=p,this}graph(){return this._label}setDefaultNodeLabel(p){return this._defaultNodeLabelFn=p,typeof p!="function"&&(this._defaultNodeLabelFn=()=>p),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var p=this;return this.nodes().filter(g=>Object.keys(p._in[g]).length===0)}sinks(){var p=this;return this.nodes().filter(g=>Object.keys(p._out[g]).length===0)}setNodes(p,g){var v=arguments,w=this;return p.forEach(function(S){v.length>1?w.setNode(S,g):w.setNode(S)}),this}setNode(p,g){return this._nodes.hasOwnProperty(p)?(arguments.length>1&&(this._nodes[p]=g),this):(this._nodes[p]=arguments.length>1?g:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=n,this._children[p]={},this._children[n][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)}node(p){return this._nodes[p]}hasNode(p){return this._nodes.hasOwnProperty(p)}removeNode(p){var g=this;if(this._nodes.hasOwnProperty(p)){var v=w=>g.removeEdge(g._edgeObjs[w]);delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],this.children(p).forEach(function(w){g.setParent(w)}),delete this._children[p]),Object.keys(this._in[p]).forEach(v),delete this._in[p],delete this._preds[p],Object.keys(this._out[p]).forEach(v),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this}setParent(p,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(g===void 0)g=n;else{g+="";for(var v=g;v!==void 0;v=this.parent(v))if(v===p)throw new Error("Setting "+g+" as parent of "+p+" would create a cycle");this.setNode(g)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=g,this._children[g][p]=!0,this}_removeFromParentsChildList(p){delete this._children[this._parent[p]][p]}parent(p){if(this._isCompound){var g=this._parent[p];if(g!==n)return g}}children(p=n){if(this._isCompound){var g=this._children[p];if(g)return Object.keys(g)}else{if(p===n)return this.nodes();if(this.hasNode(p))return[]}}predecessors(p){var g=this._preds[p];if(g)return Object.keys(g)}successors(p){var g=this._sucs[p];if(g)return Object.keys(g)}neighbors(p){var g=this.predecessors(p);if(g){const w=new Set(g);for(var v of this.successors(p))w.add(v);return Array.from(w.values())}}isLeaf(p){var g;return this.isDirected()?g=this.successors(p):g=this.neighbors(p),g.length===0}filterNodes(p){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var v=this;Object.entries(this._nodes).forEach(function([E,x]){p(E)&&g.setNode(E,x)}),Object.values(this._edgeObjs).forEach(function(E){g.hasNode(E.v)&&g.hasNode(E.w)&&g.setEdge(E,v.edge(E))});var w={};function S(E){var x=v.parent(E);return x===void 0||g.hasNode(x)?(w[E]=x,x):x in w?w[x]:S(x)}return this._isCompound&&g.nodes().forEach(E=>g.setParent(E,S(E))),g}setDefaultEdgeLabel(p){return this._defaultEdgeLabelFn=p,typeof p!="function"&&(this._defaultEdgeLabelFn=()=>p),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(p,g){var v=this,w=arguments;return p.reduce(function(S,E){return w.length>1?v.setEdge(S,E,g):v.setEdge(S,E),E}),this}setEdge(){var p,g,v,w,S=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(p=E.v,g=E.w,v=E.name,arguments.length===2&&(w=arguments[1],S=!0)):(p=E,g=arguments[1],v=arguments[3],arguments.length>2&&(w=arguments[2],S=!0)),p=""+p,g=""+g,v!==void 0&&(v=""+v);var x=a(this._isDirected,p,g,v);if(this._edgeLabels.hasOwnProperty(x))return S&&(this._edgeLabels[x]=w),this;if(v!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(g),this._edgeLabels[x]=S?w:this._defaultEdgeLabelFn(p,g,v);var I=l(this._isDirected,p,g,v);return p=I.v,g=I.w,Object.freeze(I),this._edgeObjs[x]=I,s(this._preds[g],p),s(this._sucs[p],g),this._in[g][x]=I,this._out[p][x]=I,this._edgeCount++,this}edge(p,g,v){var w=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,p,g,v);return this._edgeLabels[w]}edgeAsObj(){const p=this.edge(...arguments);return typeof p!="object"?{label:p}:p}hasEdge(p,g,v){var w=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,p,g,v);return this._edgeLabels.hasOwnProperty(w)}removeEdge(p,g,v){var w=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,p,g,v),S=this._edgeObjs[w];return S&&(p=S.v,g=S.w,delete this._edgeLabels[w],delete this._edgeObjs[w],o(this._preds[g],p),o(this._sucs[p],g),delete this._in[g][w],delete this._out[p][w],this._edgeCount--),this}inEdges(p,g){var v=this._in[p];if(v){var w=Object.values(v);return g?w.filter(S=>S.v===g):w}}outEdges(p,g){var v=this._out[p];if(v){var w=Object.values(v);return g?w.filter(S=>S.w===g):w}}nodeEdges(p,g){var v=this.inEdges(p,g);if(v)return v.concat(this.outEdges(p,g))}}function s(h,p){h[p]?h[p]++:h[p]=1}function o(h,p){--h[p]||delete h[p]}function a(h,p,g,v){var w=""+p,S=""+g;if(!h&&w>S){var E=w;w=S,S=E}return w+r+S+r+(v===void 0?e:v)}function l(h,p,g,v){var w=""+p,S=""+g;if(!h&&w>S){var E=w;w=S,S=E}var x={v:w,w:S};return v&&(x.name=v),x}function u(h,p){return a(h,p.v,p.w,p.name)}return cE=i,cE}var uE,I3;function lte(){return I3||(I3=1,uE="2.2.2"),uE}var dE,O3;function cte(){return O3||(O3=1,dE={Graph:nO(),version:lte()}),dE}var hE,T3;function ute(){if(T3)return hE;T3=1;var e=nO();hE={write:n,read:s};function n(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return o.graph()!==void 0&&(a.value=structuredClone(o.graph())),a}function r(o){return o.nodes().map(function(a){var l=o.node(a),u=o.parent(a),h={v:a};return l!==void 0&&(h.value=l),u!==void 0&&(h.parent=u),h})}function i(o){return o.edges().map(function(a){var l=o.edge(a),u={v:a.v,w:a.w};return a.name!==void 0&&(u.name=a.name),l!==void 0&&(u.value=l),u})}function s(o){var a=new e(o.options).setGraph(o.value);return o.nodes.forEach(function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),o.edges.forEach(function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return hE}var fE,M3;function dte(){if(M3)return fE;M3=1,fE=e;function e(n){var r={},i=[],s;function o(a){r.hasOwnProperty(a)||(r[a]=!0,s.push(a),n.successors(a).forEach(o),n.predecessors(a).forEach(o))}return n.nodes().forEach(function(a){s=[],o(a),s.length&&i.push(s)}),i}return fE}var pE,P3;function u7(){if(P3)return pE;P3=1;class e{constructor(){Ue(this,"_arr",[]);Ue(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(r){return r.key})}has(r){return this._keyIndices.hasOwnProperty(r)}priority(r){var i=this._keyIndices[r];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(r,i){var s=this._keyIndices;if(r=String(r),!s.hasOwnProperty(r)){var o=this._arr,a=o.length;return s[r]=a,o.push({key:r,priority:i}),this._decrease(a),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key}decrease(r,i){var s=this._keyIndices[r];if(i>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[s].priority+" New: "+i);this._arr[s].priority=i,this._decrease(s)}_heapify(r){var i=this._arr,s=2*r,o=s+1,a=r;s<i.length&&(a=i[s].priority<i[a].priority?s:a,o<i.length&&(a=i[o].priority<i[a].priority?o:a),a!==r&&(this._swap(r,a),this._heapify(a)))}_decrease(r){for(var i=this._arr,s=i[r].priority,o;r!==0&&(o=r>>1,!(i[o].priority<s));)this._swap(r,o),r=o}_swap(r,i){var s=this._arr,o=this._keyIndices,a=s[r],l=s[i];s[r]=l,s[i]=a,o[l.key]=r,o[a.key]=i}}return pE=e,pE}var gE,A3;function d7(){if(A3)return gE;A3=1;var e=u7();gE=r;var n=()=>1;function r(s,o,a,l){return i(s,String(o),a||n,l||function(u){return s.outEdges(u)})}function i(s,o,a,l){var u={},h=new e,p,g,v=function(w){var S=w.v!==p?w.v:w.w,E=u[S],x=a(w),I=g.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+x);I<E.distance&&(E.distance=I,E.predecessor=p,h.decrease(S,I))};for(s.nodes().forEach(function(w){var S=w===o?0:Number.POSITIVE_INFINITY;u[w]={distance:S},h.add(w,S)});h.size()>0&&(p=h.removeMin(),g=u[p],g.distance!==Number.POSITIVE_INFINITY);)l(p).forEach(v);return u}return gE}var yE,R3;function hte(){if(R3)return yE;R3=1;var e=d7();yE=n;function n(r,i,s){return r.nodes().reduce(function(o,a){return o[a]=e(r,a,i,s),o},{})}return yE}var mE,k3;function h7(){if(k3)return mE;k3=1,mE=e;function e(n){var r=0,i=[],s={},o=[];function a(l){var u=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),n.successors(l).forEach(function(g){s.hasOwnProperty(g)?s[g].onStack&&(u.lowlink=Math.min(u.lowlink,s[g].index)):(a(g),u.lowlink=Math.min(u.lowlink,s[g].lowlink))}),u.lowlink===u.index){var h=[],p;do p=i.pop(),s[p].onStack=!1,h.push(p);while(l!==p);o.push(h)}}return n.nodes().forEach(function(l){s.hasOwnProperty(l)||a(l)}),o}return mE}var vE,L3;function fte(){if(L3)return vE;L3=1;var e=h7();vE=n;function n(r){return e(r).filter(function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return vE}var bE,j3;function pte(){if(j3)return bE;j3=1,bE=n;var e=()=>1;function n(i,s,o){return r(i,s||e,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(u){a[u]={},a[u][u]={distance:0},l.forEach(function(h){u!==h&&(a[u][h]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(h){var p=h.v===u?h.w:h.v,g=s(h);a[u][p]={distance:g,predecessor:u}})}),l.forEach(function(u){var h=a[u];l.forEach(function(p){var g=a[p];l.forEach(function(v){var w=g[u],S=h[v],E=g[v],x=w.distance+S.distance;x<E.distance&&(E.distance=x,E.predecessor=S.predecessor)})})}),a}return bE}var wE,F3;function f7(){if(F3)return wE;F3=1;function e(r){var i={},s={},o=[];function a(l){if(s.hasOwnProperty(l))throw new n;i.hasOwnProperty(l)||(s[l]=!0,i[l]=!0,r.predecessors(l).forEach(a),delete s[l],o.push(l))}if(r.sinks().forEach(a),Object.keys(i).length!==r.nodeCount())throw new n;return o}class n extends Error{constructor(){super(...arguments)}}return wE=e,e.CycleException=n,wE}var _E,$3;function gte(){if($3)return _E;$3=1;var e=f7();_E=n;function n(r){try{e(r)}catch(i){if(i instanceof e.CycleException)return!1;throw i}return!0}return _E}var CE,z3;function p7(){if(z3)return CE;z3=1,CE=e;function e(s,o,a){Array.isArray(o)||(o=[o]);var l=s.isDirected()?g=>s.successors(g):g=>s.neighbors(g),u=a==="post"?n:r,h=[],p={};return o.forEach(g=>{if(!s.hasNode(g))throw new Error("Graph does not have node: "+g);u(g,l,p,h)}),h}function n(s,o,a,l){for(var u=[[s,!1]];u.length>0;){var h=u.pop();h[1]?l.push(h[0]):a.hasOwnProperty(h[0])||(a[h[0]]=!0,u.push([h[0],!0]),i(o(h[0]),p=>u.push([p,!1])))}}function r(s,o,a,l){for(var u=[s];u.length>0;){var h=u.pop();a.hasOwnProperty(h)||(a[h]=!0,l.push(h),i(o(h),p=>u.push(p)))}}function i(s,o){for(var a=s.length;a--;)o(s[a],a,s);return s}return CE}var EE,V3;function yte(){if(V3)return EE;V3=1;var e=p7();EE=n;function n(r,i){return e(r,i,"post")}return EE}var xE,B3;function mte(){if(B3)return xE;B3=1;var e=p7();xE=n;function n(r,i){return e(r,i,"pre")}return xE}var SE,H3;function vte(){if(H3)return SE;H3=1;var e=nO(),n=u7();SE=r;function r(i,s){var o=new e,a={},l=new n,u;function h(g){var v=g.v===u?g.w:g.v,w=l.priority(v);if(w!==void 0){var S=s(g);S<w&&(a[v]=u,l.decrease(v,S))}}if(i.nodeCount()===0)return o;i.nodes().forEach(function(g){l.add(g,Number.POSITIVE_INFINITY),o.setNode(g)}),l.decrease(i.nodes()[0],0);for(var p=!1;l.size()>0;){if(u=l.removeMin(),a.hasOwnProperty(u))o.setEdge(u,a[u]);else{if(p)throw new Error("Input graph is not connected: "+i);p=!0}i.nodeEdges(u).forEach(h)}return o}return SE}var DE,U3;function bte(){return U3||(U3=1,DE={components:dte(),dijkstra:d7(),dijkstraAll:hte(),findCycles:fte(),floydWarshall:pte(),isAcyclic:gte(),postorder:yte(),preorder:mte(),prim:vte(),tarjan:h7(),topsort:f7()}),DE}var NE,K3;function wte(){if(K3)return NE;K3=1;var e=cte();return NE={Graph:e.Graph,json:ute(),alg:bte(),version:e.version},NE}var _l=wte(),_te=Object.defineProperty,Cte=Object.getOwnPropertyDescriptor,g7=(e,n,r,i)=>{for(var s=i>1?void 0:i?Cte(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&_te(n,r,s),s},Ete=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,n=e._prev;if(n!==e)return W3(n),n}enqueue(e){let n=this._sentinel;e._prev&&e._next&&W3(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){let e=[],n=this._sentinel,r=n._prev;for(;r!==n;)e.push(JSON.stringify(r,xte)),r=r._prev;return"["+e.join(", ")+"]"}};function W3(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function xte(e,n){if(e!=="_next"&&e!=="_prev")return n}var Ste=Ete,Dte=Ite,Nte=()=>1;function Ite(e,n){if(e.nodeCount()<=1)return[];let r=Tte(e,n||Nte);return Ote(r.graph,r.buckets,r.zeroIdx).flatMap(s=>e.outEdges(s.v,s.w))}function Ote(e,n,r){let i=[],s=n[n.length-1],o=n[0],a;for(;e.nodeCount();){for(;a=o.dequeue();)IE(e,n,r,a);for(;a=s.dequeue();)IE(e,n,r,a);if(e.nodeCount()){for(let l=n.length-2;l>0;--l)if(a=n[l].dequeue(),a){i=i.concat(IE(e,n,r,a,!0));break}}}return i}function IE(e,n,r,i,s){let o=s?[]:void 0;return e.inEdges(i.v).forEach(a=>{let l=e.edge(a),u=e.node(a.v);s&&o.push({v:a.v,w:a.w}),u.out-=l,kN(n,r,u)}),e.outEdges(i.v).forEach(a=>{let l=e.edge(a),u=a.w,h=e.node(u);h.in-=l,kN(n,r,h)}),e.removeNode(i.v),o}function Tte(e,n){let r=new _l.Graph,i=0,s=0;e.nodes().forEach(l=>{r.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let u=r.edge(l.v,l.w)||0,h=n(l),p=u+h;r.setEdge(l.v,l.w,p),s=Math.max(s,r.node(l.v).out+=h),i=Math.max(i,r.node(l.w).in+=h)});let o=Mte(s+i+3).map(()=>new Ste),a=i+1;return r.nodes().forEach(l=>{kN(o,a,r.node(l))}),{graph:r,buckets:o,zeroIdx:a}}function kN(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Mte(e){const n=[];for(let r=0;r<e;r++)n.push(r);return n}var Yt={addBorderNode:jte,addDummyNode:y7,applyWithChunking:Xv,asNonCompoundGraph:Pte,buildLayerMatrix:Lte,intersectRect:kte,mapValues:Ute,maxRank:b7,normalizeRanks:rO,notime:Vte,partition:$te,pick:Hte,predecessorWeights:Rte,range:w7,removeEmptyRanks:iO,simplify:m7,successorWeights:Ate,time:zte,uniqueId:sO,zipObject:zw},$w=Yt;function y7(e,n,r,i){let s;do s=sO(i);while(e.hasNode(s));return r.dummy=n,e.setNode(s,r),s}function m7(e){let n=new _l.Graph().setGraph(e.graph());return e.nodes().forEach(r=>n.setNode(r,e.node(r))),e.edges().forEach(r=>{let i=n.edge(r.v,r.w)||{weight:0,minlen:1},s=e.edge(r);n.setEdge(r.v,r.w,{weight:i.weight+s.weight,minlen:Math.max(i.minlen,s.minlen)})}),n}function Pte(e){let n=new _l.Graph({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||n.setNode(r,e.node(r))}),e.edges().forEach(r=>{n.setEdge(r,e.edge(r))}),n}function Ate(e){let n=e.nodes().map(r=>{let i={};return e.outEdges(r).forEach(s=>{i[s.w]=(i[s.w]||0)+e.edge(s).weight}),i});return zw(e.nodes(),n)}function Rte(e){let n=e.nodes().map(r=>{let i={};return e.inEdges(r).forEach(s=>{i[s.v]=(i[s.v]||0)+e.edge(s).weight}),i});return zw(e.nodes(),n)}function kte(e,n){let r=e.x,i=e.y,s=n.x-r,o=n.y-i,a=e.width/2,l=e.height/2;if(!s&&!o)throw new Error("Not possible to find intersection inside of the rectangle");let u,h;return Math.abs(o)*a>Math.abs(s)*l?(o<0&&(l=-l),u=l*s/o,h=l):(s<0&&(a=-a),u=a,h=a*o/s),{x:r+u,y:i+h}}function Lte(e){let n=w7(b7(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let i=e.node(r),s=i.rank;s!==void 0&&(n[s][i.order]=r)}),n}function rO(e){let n=e.nodes().map(i=>{let s=e.node(i).rank;return s===void 0?Number.MAX_VALUE:s}),r=Xv(Math.min,n);e.nodes().forEach(i=>{let s=e.node(i);Object.hasOwn(s,"rank")&&(s.rank-=r)})}function iO(e){let n=e.nodes().map(a=>e.node(a).rank),r=Xv(Math.min,n),i=[];e.nodes().forEach(a=>{let l=e.node(a).rank-r;i[l]||(i[l]=[]),i[l].push(a)});let s=0,o=e.graph().nodeRankFactor;Array.from(i).forEach((a,l)=>{a===void 0&&l%o!==0?--s:a!==void 0&&s&&a.forEach(u=>e.node(u).rank+=s)})}function jte(e,n,r,i){let s={width:0,height:0};return arguments.length>=4&&(s.rank=r,s.order=i),y7(e,"border",s,n)}function Fte(e,n=v7){const r=[];for(let i=0;i<e.length;i+=n){const s=e.slice(i,i+n);r.push(s)}return r}var v7=65535;function Xv(e,n){if(n.length>v7){const r=Fte(n);return e.apply(null,r.map(i=>e.apply(null,i)))}else return e.apply(null,n)}function b7(e){const r=e.nodes().map(i=>{let s=e.node(i).rank;return s===void 0?Number.MIN_VALUE:s});return Xv(Math.max,r)}function $te(e,n){let r={lhs:[],rhs:[]};return e.forEach(i=>{n(i)?r.lhs.push(i):r.rhs.push(i)}),r}function zte(e,n){let r=Date.now();try{return n()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}}function Vte(e,n){return n()}var Bte=0;function sO(e){var n=++Bte;return toString(e)+n}function w7(e,n,r=1){n==null&&(n=e,e=0);let i=o=>o<n;r<0&&(i=o=>n<o);const s=[];for(let o=e;i(o);o+=r)s.push(o);return s}function Hte(e,n){const r={};for(const i of n)e[i]!==void 0&&(r[i]=e[i]);return r}function Ute(e,n){let r=n;return typeof n=="string"&&(r=i=>i[n]),Object.entries(e).reduce((i,[s,o])=>(i[s]=r(o,s),i),{})}function zw(e,n){return e.reduce((r,i,s)=>(r[i]=n[s],r),{})}var Kte={run:Wte,undo:Gte},LN=Kte;function Wte(e){(e.graph().acyclicer==="greedy"?Dte(e,r(e)):qte(e)).forEach(i=>{let s=e.edge(i);e.removeEdge(i),s.forwardName=i.name,s.reversed=!0,e.setEdge(i.w,i.v,s,sO("rev"))});function r(i){return s=>i.edge(s).weight}}function qte(e){let n=[],r={},i={};function s(o){Object.hasOwn(i,o)||(i[o]=!0,r[o]=!0,e.outEdges(o).forEach(a=>{Object.hasOwn(r,a.w)?n.push(a):s(a.w)}),delete r[o])}return e.nodes().forEach(s),n}function Gte(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.reversed){e.removeEdge(n);let i=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,i)}})}var Yte={run:Xte,undo:Qte},jN=Yte;function Xte(e){e.graph().dummyChains=[],e.edges().forEach(n=>Zte(e,n))}function Zte(e,n){let r=n.v,i=e.node(r).rank,s=n.w,o=e.node(s).rank,a=n.name,l=e.edge(n),u=l.labelRank;if(o===i+1)return;e.removeEdge(n);let h,p,g;for(g=0,++i;i<o;++g,++i)l.points=[],p={width:0,height:0,edgeLabel:l,edgeObj:n,rank:i},h=Yt.addDummyNode(e,"edge",p,"_d"),i===u&&(p.width=l.width,p.height=l.height,p.dummy="edge-label",p.labelpos=l.labelpos),e.setEdge(r,h,{weight:l.weight},a),g===0&&e.graph().dummyChains.push(h),r=h;e.setEdge(r,s,{weight:l.weight},a)}function Qte(e){e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeLabel,s;for(e.setEdge(r.edgeObj,i);r.dummy;)s=e.successors(n)[0],e.removeNode(n),i.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),n=s,r=e.node(n)})}function oO(e){var n={};function r(i){var s=e.node(i);if(Object.hasOwn(n,i))return s.rank;n[i]=!0;let o=e.outEdges(i).map(l=>l==null?Number.POSITIVE_INFINITY:r(l.w)-e.edge(l).minlen);var a=Xv(Math.min,o);return a===Number.POSITIVE_INFINITY&&(a=0),s.rank=a}e.sources().forEach(r)}function lg(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}var Jte=_7;function _7(e){var n=new _l.Graph({directed:!1}),r=e.nodes()[0],i=e.nodeCount();n.setNode(r,{});for(var s,o;ene(n,e)<i;)s=tne(n,e),o=n.hasNode(s.v)?lg(e,s):-lg(e,s),nne(n,e,o);return n}function ene(e,n){function r(i){n.nodeEdges(i).forEach(s=>{var o=s.v,a=i===o?s.w:o;!e.hasNode(a)&&!lg(n,s)&&(e.setNode(a,{}),e.setEdge(i,a,{}),r(a))})}return e.nodes().forEach(r),e.nodeCount()}function tne(e,n){return n.edges().reduce((i,s)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(s.v)!==e.hasNode(s.w)&&(o=lg(n,s)),o<i[0]?[o,s]:i},[Number.POSITIVE_INFINITY,null])[1]}function nne(e,n,r){e.nodes().forEach(i=>n.node(i).rank+=r)}var{preorder:rne,postorder:ine}=_l.alg,sne=Kh;Kh.initLowLimValues=lO;Kh.initCutValues=aO;Kh.calcCutValue=C7;Kh.leaveEdge=x7;Kh.enterEdge=S7;Kh.exchangeEdges=D7;function Kh(e){e=m7(e),oO(e);var n=_7(e);lO(n),aO(n,e);for(var r,i;r=x7(n);)i=S7(n,e,r),D7(n,e,r,i)}function aO(e,n){var r=ine(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(i=>one(e,n,i))}function one(e,n,r){var i=e.node(r),s=i.parent;e.edge(r,s).cutvalue=C7(e,n,r)}function C7(e,n,r){var i=e.node(r),s=i.parent,o=!0,a=n.edge(r,s),l=0;return a||(o=!1,a=n.edge(s,r)),l=a.weight,n.nodeEdges(r).forEach(u=>{var h=u.v===r,p=h?u.w:u.v;if(p!==s){var g=h===o,v=n.edge(u).weight;if(l+=g?v:-v,lne(e,r,p)){var w=e.edge(r,p).cutvalue;l+=g?-w:w}}}),l}function lO(e,n){arguments.length<2&&(n=e.nodes()[0]),E7(e,{},1,n)}function E7(e,n,r,i,s){var o=r,a=e.node(i);return n[i]=!0,e.neighbors(i).forEach(l=>{Object.hasOwn(n,l)||(r=E7(e,n,r,l,i))}),a.low=o,a.lim=r++,s?a.parent=s:delete a.parent,r}function x7(e){return e.edges().find(n=>e.edge(n).cutvalue<0)}function S7(e,n,r){var i=r.v,s=r.w;n.hasEdge(i,s)||(i=r.w,s=r.v);var o=e.node(i),a=e.node(s),l=o,u=!1;o.lim>a.lim&&(l=a,u=!0);var h=n.edges().filter(p=>u===q3(e,e.node(p.v),l)&&u!==q3(e,e.node(p.w),l));return h.reduce((p,g)=>lg(n,g)<lg(n,p)?g:p)}function D7(e,n,r,i){var s=r.v,o=r.w;e.removeEdge(s,o),e.setEdge(i.v,i.w,{}),lO(e),aO(e,n),ane(e,n)}function ane(e,n){var r=e.nodes().find(s=>!n.node(s).parent),i=rne(e,r);i=i.slice(1),i.forEach(s=>{var o=e.node(s).parent,a=n.edge(s,o),l=!1;a||(a=n.edge(o,s),l=!0),n.node(s).rank=n.node(o).rank+(l?a.minlen:-a.minlen)})}function lne(e,n,r){return e.hasEdge(n,r)}function q3(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}var N7=cne;function cne(e){switch(e.graph().ranker){case"network-simplex":G3(e);break;case"tight-tree":dne(e);break;case"longest-path":une(e);break;default:G3(e)}}var une=oO;function dne(e){oO(e),Jte(e)}function G3(e){sne(e)}var I7=hne;function hne(e){let n=pne(e);e.graph().dummyChains.forEach(r=>{let i=e.node(r),s=i.edgeObj,o=fne(e,n,s.v,s.w),a=o.path,l=o.lca,u=0,h=a[u],p=!0;for(;r!==s.w;){if(i=e.node(r),p){for(;(h=a[u])!==l&&e.node(h).maxRank<i.rank;)u++;h===l&&(p=!1)}if(!p){for(;u<a.length-1&&e.node(h=a[u+1]).minRank<=i.rank;)u++;h=a[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function fne(e,n,r,i){let s=[],o=[],a=Math.min(n[r].low,n[i].low),l=Math.max(n[r].lim,n[i].lim),u,h;u=r;do u=e.parent(u),s.push(u);while(u&&(n[u].low>a||l>n[u].lim));for(h=u,u=i;(u=e.parent(u))!==h;)o.push(u);return{path:s.concat(o.reverse()),lca:h}}function pne(e){let n={},r=0;function i(s){let o=r;e.children(s).forEach(i),n[s]={low:o,lim:r++}}return e.children().forEach(i),n}var gne={run:yne,cleanup:bne},FN=gne;function yne(e){let n=Yt.addDummyNode(e,"root",{},"_root"),r=mne(e),i=Object.values(r),s=Yt.applyWithChunking(Math.max,i)-1,o=2*s+1;e.graph().nestingRoot=n,e.edges().forEach(l=>e.edge(l).minlen*=o);let a=vne(e)+1;e.children().forEach(l=>O7(e,n,o,a,s,r,l)),e.graph().nodeRankFactor=o}function O7(e,n,r,i,s,o,a){let l=e.children(a);if(!l.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}let u=Yt.addBorderNode(e,"_bt"),h=Yt.addBorderNode(e,"_bb"),p=e.node(a);e.setParent(u,a),p.borderTop=u,e.setParent(h,a),p.borderBottom=h,l.forEach(g=>{O7(e,n,r,i,s,o,g);let v=e.node(g),w=v.borderTop?v.borderTop:g,S=v.borderBottom?v.borderBottom:g,E=v.borderTop?i:2*i,x=w!==S?1:s-o[a]+1;e.setEdge(u,w,{weight:E,minlen:x,nestingEdge:!0}),e.setEdge(S,h,{weight:E,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,u,{weight:0,minlen:s+o[a]})}function mne(e){var n={};function r(i,s){var o=e.children(i);o&&o.length&&o.forEach(a=>r(a,s+1)),n[i]=s}return e.children().forEach(i=>r(i,1)),n}function vne(e){return e.edges().reduce((n,r)=>n+e.edge(r).weight,0)}function bne(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,e.edges().forEach(r=>{var i=e.edge(r);i.nestingEdge&&e.removeEdge(r)})}var T7=wne;function wne(e){function n(r){let i=e.children(r),s=e.node(r);if(i.length&&i.forEach(n),Object.hasOwn(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(let o=s.minRank,a=s.maxRank+1;o<a;++o)Y3(e,"borderLeft","_bl",r,s,o),Y3(e,"borderRight","_br",r,s,o)}}e.children().forEach(n)}function Y3(e,n,r,i,s,o){let a={width:0,height:0,rank:o,borderType:n},l=s[n][o-1],u=Yt.addDummyNode(e,"border",a,r);s[n][o]=u,e.setParent(u,i),l&&e.setEdge(l,u,{weight:1})}var _ne={adjust:Cne,undo:Ene},$N=_ne;function Cne(e){let n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&M7(e)}function Ene(e){let n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&xne(e),(n==="lr"||n==="rl")&&(Sne(e),M7(e))}function M7(e){e.nodes().forEach(n=>X3(e.node(n))),e.edges().forEach(n=>X3(e.edge(n)))}function X3(e){let n=e.width;e.width=e.height,e.height=n}function xne(e){e.nodes().forEach(n=>OE(e.node(n))),e.edges().forEach(n=>{let r=e.edge(n);r.points.forEach(OE),Object.hasOwn(r,"y")&&OE(r)})}function OE(e){e.y=-e.y}function Sne(e){e.nodes().forEach(n=>TE(e.node(n))),e.edges().forEach(n=>{let r=e.edge(n);r.points.forEach(TE),Object.hasOwn(r,"x")&&TE(r)})}function TE(e){let n=e.x;e.x=e.y,e.y=n}var Dne=Nne;function Nne(e){let n={},r=e.nodes().filter(u=>!e.children(u).length),i=r.map(u=>e.node(u).rank),s=Yt.applyWithChunking(Math.max,i),o=Yt.range(s+1).map(()=>[]);function a(u){if(n[u])return;n[u]=!0;let h=e.node(u);o[h.rank].push(u),e.successors(u).forEach(a)}return r.sort((u,h)=>e.node(u).rank-e.node(h).rank).forEach(a),o}var Ine=One;function One(e,n){let r=0;for(let i=1;i<n.length;++i)r+=Tne(e,n[i-1],n[i]);return r}function Tne(e,n,r){let i=zw(r,r.map((h,p)=>p)),s=n.flatMap(h=>e.outEdges(h).map(p=>({pos:i[p.w],weight:e.edge(p).weight})).sort((p,g)=>p.pos-g.pos)),o=1;for(;o<r.length;)o<<=1;let a=2*o-1;o-=1;let l=new Array(a).fill(0),u=0;return s.forEach(h=>{let p=h.pos+o;l[p]+=h.weight;let g=0;for(;p>0;)p%2&&(g+=l[p+1]),p=p-1>>1,l[p]+=h.weight;u+=h.weight*g}),u}var Mne=Pne;function Pne(e,n=[]){return n.map(r=>{let i=e.inEdges(r);if(i.length){let s=i.reduce((o,a)=>{let l=e.edge(a),u=e.node(a.v);return{sum:o.sum+l.weight*u.order,weight:o.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:r}})}var Ane=Rne;function Rne(e,n){let r={};e.forEach((s,o)=>{let a=r[s.v]={indegree:0,in:[],out:[],vs:[s.v],i:o};s.barycenter!==void 0&&(a.barycenter=s.barycenter,a.weight=s.weight)}),n.edges().forEach(s=>{let o=r[s.v],a=r[s.w];o!==void 0&&a!==void 0&&(a.indegree++,o.out.push(r[s.w]))});let i=Object.values(r).filter(s=>!s.indegree);return kne(i)}function kne(e){let n=[];function r(s){return o=>{o.merged||(o.barycenter===void 0||s.barycenter===void 0||o.barycenter>=s.barycenter)&&Lne(s,o)}}function i(s){return o=>{o.in.push(s),--o.indegree===0&&e.push(o)}}for(;e.length;){let s=e.pop();n.push(s),s.in.reverse().forEach(r(s)),s.out.forEach(i(s))}return n.filter(s=>!s.merged).map(s=>$w.pick(s,["vs","i","barycenter","weight"]))}function Lne(e,n){let r=0,i=0;e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),n.weight&&(r+=n.barycenter*n.weight,i+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/i,e.weight=i,e.i=Math.min(n.i,e.i),n.merged=!0}var jne=Fne;function Fne(e,n){let r=$w.partition(e,p=>Object.hasOwn(p,"barycenter")),i=r.lhs,s=r.rhs.sort((p,g)=>g.i-p.i),o=[],a=0,l=0,u=0;i.sort($ne(!!n)),u=Z3(o,s,u),i.forEach(p=>{u+=p.vs.length,o.push(p.vs),a+=p.barycenter*p.weight,l+=p.weight,u=Z3(o,s,u)});let h={vs:o.flat(!0)};return l&&(h.barycenter=a/l,h.weight=l),h}function Z3(e,n,r){let i;for(;n.length&&(i=n[n.length-1]).i<=r;)n.pop(),e.push(i.vs),r++;return r}function $ne(e){return(n,r)=>n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}var zne=P7;function P7(e,n,r,i){let s=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,l=o?o.borderRight:void 0,u={};a&&(s=s.filter(v=>v!==a&&v!==l));let h=Mne(e,s);h.forEach(v=>{if(e.children(v.v).length){let w=P7(e,v.v,r,i);u[v.v]=w,Object.hasOwn(w,"barycenter")&&Bne(v,w)}});let p=Ane(h,r);Vne(p,u);let g=jne(p,i);if(a&&(g.vs=[a,g.vs,l].flat(!0),e.predecessors(a).length)){let v=e.node(e.predecessors(a)[0]),w=e.node(e.predecessors(l)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+v.order+w.order)/(g.weight+2),g.weight+=2}return g}function Vne(e,n){e.forEach(r=>{r.vs=r.vs.flatMap(i=>n[i]?n[i].vs:i)})}function Bne(e,n){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight):(e.barycenter=n.barycenter,e.weight=n.weight)}var Hne=Une;function Une(e,n,r){let i=Kne(e),s=new _l.Graph({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(o=>e.node(o));return e.nodes().forEach(o=>{let a=e.node(o),l=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(s.setNode(o),s.setParent(o,l||i),e[r](o).forEach(u=>{let h=u.v===o?u.w:u.v,p=s.edge(h,o),g=p!==void 0?p.weight:0;s.setEdge(h,o,{weight:e.edge(u).weight+g})}),Object.hasOwn(a,"minRank")&&s.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),s}function Kne(e){for(var n;e.hasNode(n=Yt.uniqueId("_root")););return n}var Wne=qne;function qne(e,n,r){let i={},s;r.forEach(o=>{let a=e.parent(o),l,u;for(;a;){if(l=e.parent(a),l?(u=i[l],i[l]=a):(u=s,s=a),u&&u!==a){n.setEdge(u,a);return}a=l}})}var A7=R7;function R7(e,n){if(n&&typeof n.customOrder=="function"){n.customOrder(e,R7);return}let r=Yt.maxRank(e),i=Q3(e,Yt.range(1,r+1),"inEdges"),s=Q3(e,Yt.range(r-1,-1,-1),"outEdges"),o=Dne(e);if(J3(e,o),n&&n.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l;for(let u=0,h=0;h<4;++u,++h){Gne(u%2?i:s,u%4>=2),o=Yt.buildLayerMatrix(e);let p=Ine(e,o);p<a&&(h=0,l=Object.assign({},o),a=p)}J3(e,l)}function Q3(e,n,r){return n.map(function(i){return Hne(e,i,r)})}function Gne(e,n){let r=new _l.Graph;e.forEach(function(i){let s=i.graph().root,o=zne(i,s,r,n);o.vs.forEach((a,l)=>i.node(a).order=l),Wne(i,r,o.vs)})}function J3(e,n){Object.values(n).forEach(r=>r.forEach((i,s)=>e.node(i).order=s))}function Yne(e,n){let r={};function i(s,o){let a=0,l=0,u=s.length,h=o[o.length-1];return o.forEach((p,g)=>{let v=Zne(e,p),w=v?e.node(v).order:u;(v||p===h)&&(o.slice(l,g+1).forEach(S=>{e.predecessors(S).forEach(E=>{let x=e.node(E),I=x.order;(I<a||w<I)&&!(x.dummy&&e.node(S).dummy)&&k7(r,E,S)})}),l=g+1,a=w)}),o}return n.length&&n.reduce(i),r}function Xne(e,n){let r={};function i(o,a,l,u,h){let p;Yt.range(a,l).forEach(g=>{p=o[g],e.node(p).dummy&&e.predecessors(p).forEach(v=>{let w=e.node(v);w.dummy&&(w.order<u||w.order>h)&&k7(r,v,p)})})}function s(o,a){let l=-1,u,h=0;return a.forEach((p,g)=>{if(e.node(p).dummy==="border"){let v=e.predecessors(p);v.length&&(u=e.node(v[0]).order,i(a,h,g,l,u),h=g,l=u)}i(a,h,a.length,u,o.length)}),a}return n.length&&n.reduce(s),r}function Zne(e,n){if(e.node(n).dummy)return e.predecessors(n).find(r=>e.node(r).dummy)}function k7(e,n,r){if(n>r){let s=n;n=r,r=s}let i=e[n];i||(e[n]=i={}),i[r]=!0}function Qne(e,n,r){if(n>r){let i=n;n=r,r=i}return!!e[n]&&Object.hasOwn(e[n],r)}function Jne(e,n,r,i){let s={},o={},a={};return n.forEach(l=>{l.forEach((u,h)=>{s[u]=u,o[u]=u,a[u]=h})}),n.forEach(l=>{let u=-1;l.forEach(h=>{let p=i(h);if(p.length){p=p.sort((v,w)=>a[v]-a[w]);let g=(p.length-1)/2;for(let v=Math.floor(g),w=Math.ceil(g);v<=w;++v){let S=p[v];o[h]===h&&u<a[S]&&!Qne(r,h,S)&&(o[S]=h,o[h]=s[h]=s[S],u=a[S])}}})}),{root:s,align:o}}function ere(e,n,r,i,s){let o={},a=tre(e,n,r,s),l=s?"borderLeft":"borderRight";function u(g,v){let w=a.nodes(),S=w.pop(),E={};for(;S;)E[S]?g(S):(E[S]=!0,w.push(S),w=w.concat(v(S))),S=w.pop()}function h(g){o[g]=a.inEdges(g).reduce((v,w)=>Math.max(v,o[w.v]+a.edge(w)),0)}function p(g){let v=a.outEdges(g).reduce((S,E)=>Math.min(S,o[E.w]-a.edge(E)),Number.POSITIVE_INFINITY),w=e.node(g);v!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(o[g]=Math.max(o[g],v))}return u(h,a.predecessors.bind(a)),u(p,a.successors.bind(a)),Object.keys(i).forEach(g=>o[g]=o[r[g]]),o}function tre(e,n,r,i){let s=new _l.Graph,o=e.graph(),a=ore(o.nodesep,o.edgesep,i);return n.forEach(l=>{let u;l.forEach(h=>{let p=r[h];if(s.setNode(p),u){var g=r[u],v=s.edge(g,p);s.setEdge(g,p,Math.max(a(e,h,u),v||0))}u=h})}),s}function nre(e,n){return Object.values(n).reduce((r,i)=>{let s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,u])=>{let h=are(e,l)/2;s=Math.max(u+h,s),o=Math.min(u-h,o)});const a=s-o;return a<r[0]&&(r=[a,i]),r},[Number.POSITIVE_INFINITY,null])[1]}function rre(e,n){let r=Object.values(n),i=Yt.applyWithChunking(Math.min,r),s=Yt.applyWithChunking(Math.max,r);["u","d"].forEach(o=>{["l","r"].forEach(a=>{let l=o+a,u=e[l];if(u===n)return;let h=Object.values(u),p=i-Yt.applyWithChunking(Math.min,h);a!=="l"&&(p=s-Yt.applyWithChunking(Math.max,h)),p&&(e[l]=Yt.mapValues(u,g=>g+p))})})}function ire(e,n){return Yt.mapValues(e.ul,(r,i)=>{if(n)return e[n.toLowerCase()][i];{let s=Object.values(e).map(o=>o[i]).sort((o,a)=>o-a);return(s[1]+s[2])/2}})}function sre(e){let n=Yt.buildLayerMatrix(e),r=Object.assign(Yne(e,n),Xne(e,n)),i={},s;["u","d"].forEach(a=>{s=a==="u"?n:Object.values(n).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(g=>Object.values(g).reverse()));let u=(a==="u"?e.predecessors:e.successors).bind(e),h=Jne(e,s,r,u),p=ere(e,s,h.root,h.align,l==="r");l==="r"&&(p=Yt.mapValues(p,g=>-g)),i[a+l]=p})});let o=nre(e,i);return rre(i,o),ire(i,e.graph().align)}function ore(e,n,r){return(i,s,o)=>{let a=i.node(s),l=i.node(o),u=0,h;if(u+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":h=-a.width/2;break;case"r":h=a.width/2;break}if(h&&(u+=r?h:-h),h=0,u+=(a.dummy?n:e)/2,u+=(l.dummy?n:e)/2,u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":h=l.width/2;break;case"r":h=-l.width/2;break}return h&&(u+=r?h:-h),h=0,u}}function are(e,n){return e.node(n).width}var L7=lre;function lre(e){e=$w.asNonCompoundGraph(e),cre(e),Object.entries(sre(e)).forEach(([n,r])=>e.node(n).x=r)}function cre(e){let n=$w.buildLayerMatrix(e),r=e.graph().ranksep,i=0;n.forEach(s=>{const o=s.reduce((a,l)=>{const u=e.node(l).height;return a>u?a:u},0);s.forEach(a=>e.node(a).y=i+o/2),i+=o+r})}function ure(e,n){let r=n&&n.debugTiming?Yt.time:Yt.notime;r("layout",()=>{let i=r(" buildLayoutGraph",()=>F7(e));r(" runLayout",()=>dre(i,r,n)),r(" updateInputGraph",()=>j7(e,i))})}function dre(e,n,r){n(" makeSpaceForEdgeLabels",()=>$7(e)),n(" removeSelfEdges",()=>G7(e)),n(" acyclic",()=>LN.run(e)),n(" nestingGraph.run",()=>FN.run(e)),n(" rank",()=>N7(Yt.asNonCompoundGraph(e))),n(" injectEdgeLabelProxies",()=>z7(e)),n(" removeEmptyRanks",()=>iO(e)),n(" nestingGraph.cleanup",()=>FN.cleanup(e)),n(" normalizeRanks",()=>rO(e)),n(" assignRankMinMax",()=>V7(e)),n(" removeEdgeLabelProxies",()=>B7(e)),n(" normalize.run",()=>jN.run(e)),n(" parentDummyChains",()=>I7(e)),n(" addBorderSegments",()=>T7(e)),n(" order",()=>A7(e,r)),n(" insertSelfEdges",()=>Y7(e)),n(" adjustCoordinateSystem",()=>$N.adjust(e)),n(" position",()=>L7(e)),n(" positionSelfEdges",()=>X7(e)),n(" removeBorderNodes",()=>q7(e)),n(" normalize.undo",()=>jN.undo(e)),n(" fixupEdgeLabelCoords",()=>K7(e)),n(" undoCoordinateSystem",()=>$N.undo(e)),n(" translateGraph",()=>H7(e)),n(" assignNodeIntersects",()=>U7(e)),n(" reversePoints",()=>W7(e)),n(" acyclic.undo",()=>LN.undo(e))}function j7(e,n){e.nodes().forEach(r=>{let i=e.node(r),s=n.node(r);i&&(i.x=s.x,i.y=s.y,i.rank=s.rank,n.children(r).length&&(i.width=s.width,i.height=s.height))}),e.edges().forEach(r=>{let i=e.edge(r),s=n.edge(r);i.points=s.points,Object.hasOwn(s,"x")&&(i.x=s.x,i.y=s.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var hre=["nodesep","edgesep","ranksep","marginx","marginy"],fre={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},pre=["acyclicer","ranker","rankdir","align"],gre=["width","height"],e5={width:0,height:0},yre=["minlen","weight","width","height","labeloffset"],mre={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vre=["labelpos"];function F7(e){let n=new _l.Graph({multigraph:!0,compound:!0}),r=PE(e.graph());return n.setGraph(Object.assign({},fre,ME(r,hre),Yt.pick(r,pre))),e.nodes().forEach(i=>{let s=PE(e.node(i));const o=ME(s,gre);Object.keys(e5).forEach(a=>{o[a]===void 0&&(o[a]=e5[a])}),n.setNode(i,o),n.setParent(i,e.parent(i))}),e.edges().forEach(i=>{let s=PE(e.edge(i));n.setEdge(i,Object.assign({},mre,ME(s,yre),Yt.pick(s,vre)))}),n}function $7(e){let n=e.graph();n.ranksep/=2,e.edges().forEach(r=>{let i=e.edge(r);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function z7(e){e.edges().forEach(n=>{let r=e.edge(n);if(r.width&&r.height){let i=e.node(n.v),o={rank:(e.node(n.w).rank-i.rank)/2+i.rank,e:n};Yt.addDummyNode(e,"edge-proxy",o,"_ep")}})}function V7(e){let n=0;e.nodes().forEach(r=>{let i=e.node(r);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,n=Math.max(n,i.maxRank))}),e.graph().maxRank=n}function B7(e){e.nodes().forEach(n=>{let r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function H7(e){let n=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,s=0,o=e.graph(),a=o.marginx||0,l=o.marginy||0;function u(h){let p=h.x,g=h.y,v=h.width,w=h.height;n=Math.min(n,p-v/2),r=Math.max(r,p+v/2),i=Math.min(i,g-w/2),s=Math.max(s,g+w/2)}e.nodes().forEach(h=>u(e.node(h))),e.edges().forEach(h=>{let p=e.edge(h);Object.hasOwn(p,"x")&&u(p)}),n-=a,i-=l,e.nodes().forEach(h=>{let p=e.node(h);p.x-=n,p.y-=i}),e.edges().forEach(h=>{let p=e.edge(h);p.points.forEach(g=>{g.x-=n,g.y-=i}),Object.hasOwn(p,"x")&&(p.x-=n),Object.hasOwn(p,"y")&&(p.y-=i)}),o.width=r-n+a,o.height=s-i+l}function U7(e){e.edges().forEach(n=>{let r=e.edge(n),i=e.node(n.v),s=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=s,a=i),r.points.unshift(Yt.intersectRect(i,o)),r.points.push(Yt.intersectRect(s,a))})}function K7(e){e.edges().forEach(n=>{let r=e.edge(n);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function W7(e){e.edges().forEach(n=>{let r=e.edge(n);r.reversed&&r.points.reverse()})}function q7(e){e.nodes().forEach(n=>{if(e.children(n).length){let r=e.node(n),i=e.node(r.borderTop),s=e.node(r.borderBottom),o=e.node(r.borderLeft[r.borderLeft.length-1]),a=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(a.x-o.x),r.height=Math.abs(s.y-i.y),r.x=o.x+r.width/2,r.y=i.y+r.height/2}}),e.nodes().forEach(n=>{e.node(n).dummy==="border"&&e.removeNode(n)})}function G7(e){e.edges().forEach(n=>{if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Y7(e){var n=Yt.buildLayerMatrix(e);n.forEach(r=>{var i=0;r.forEach((s,o)=>{var a=e.node(s);a.order=o+i,(a.selfEdges||[]).forEach(l=>{Yt.addDummyNode(e,"selfedge",{width:l.label.width,height:l.label.height,rank:a.rank,order:o+ ++i,e:l.e,label:l.label},"_se")}),delete a.selfEdges})})}function X7(e){e.nodes().forEach(n=>{var r=e.node(n);if(r.dummy==="selfedge"){var i=e.node(r.e.v),s=i.x+i.width/2,o=i.y,a=r.x-s,l=i.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:s+2*a/3,y:o-l},{x:s+5*a/6,y:o-l},{x:s+a,y:o},{x:s+5*a/6,y:o+l},{x:s+2*a/3,y:o+l}],r.label.x=r.x,r.label.y=r.y}})}function ME(e,n){return Yt.mapValues(Yt.pick(e,n),Number)}function PE(e){var n={};return e&&Object.entries(e).forEach(([r,i])=>{typeof r=="string"&&(r=r.toLowerCase()),n[r]=i}),n}var _n={layout:ure,buildLayoutGraph:F7,updateInputGraph:j7,makeSpaceForEdgeLabels:$7,removeSelfEdges:G7,acyclic:LN,nestingGraph:FN,rank:N7,util:Yt,injectEdgeLabelProxies:z7,removeEmptyRanks:iO,normalizeRanks:rO,assignRankMinMax:V7,removeEdgeLabelProxies:B7,normalize:jN,parentDummyChains:I7,addBorderSegments:T7,order:A7,insertSelfEdges:Y7,coordinateSystem:$N,position:L7,positionSelfEdges:X7,removeBorderNodes:q7,fixupEdgeLabelCoords:K7,translateGraph:H7,assignNodeIntersects:U7,reversePointsForReversedEdges:W7},bre=class{constructor(){this.init=!1}get initialized(){return this.init}getNode(e){return this.store.nodes.get(e)}getNodeByIndex(e){const n=this.indexMap.get(e);return n?this.getNode(n):void 0}getEdge(e){return this.store.edges.get(e)}get nodes(){return Array.from(this.store.nodes.values())}get edges(){return Array.from(this.store.edges.values())}create(e){this.store=this.createStore(e),this.indexMap=this.createIndexMap(),this.init=!0}createStore(e){const{nodes:n,edges:r}=e,i={nodes:new Map,edges:new Map};return n.forEach((s,o)=>{var u;const{bounds:a}=s.getData(at),l={id:s.id,entity:s,index:"",rank:-1,order:-1,position:{x:a.center.x,y:a.center.y},offset:{x:0,y:0},size:{width:a.width,height:a.height},hasChildren:((u=s.collapsedChildren)==null?void 0:u.length)>0};i.nodes.set(l.id,l)}),r.forEach(s=>{const{from:o,to:a}=s.info;if(!o||!a||s.vertical)return;const l={id:s.id,entity:s,from:o,to:a,fromIndex:"",toIndex:"",name:s.id};i.edges.set(l.id,l)}),i}createIndexMap(){const e=this.sortNodes(),n=new Map;e.forEach((i,s)=>{const o=this.getNode(i);if(!o)return;const a=String(1e5+s);n.set(o.id,a),o.index=a}),this.edges.forEach(i=>{const s=n.get(i.from),o=n.get(i.to);if(!s||!o){this.store.edges.delete(i.id);return}i.fromIndex=s,i.toIndex=o});const r=new Map;return n.forEach((i,s)=>{r.set(i,s)}),r}sortNodes(){const e=[];this.nodes.forEach(i=>{e.push(i.id)});const n=new Map;return this.edges.forEach(i=>{if(e.push(i.to),i.entity.info.fromPort){const s=n.get(i.from)||[];n.set(i.from,[...s,i])}}),n.forEach((i,s)=>{i.sort((a,l)=>{const u=a.entity.fromPort,h=l.entity.fromPort;return u&&h?u.point.y-h.point.y:0}).forEach(a=>{e.push(a.to)})}),e.reduceRight((i,s)=>(i.includes(s)||i.unshift(s),i),[])}},wre=class{constructor(e){this.store=e}async position(){return new Promise(e=>{mI({from:{d:0},to:{d:100},duration:300,onUpdate:n=>{this.store.nodes.forEach(r=>{this.updateNodePosition({layoutNode:r,step:n.d})})},onComplete:()=>{e()}})})}updateNodePosition(e){const{layoutNode:n,step:r}=e,i=n.entity.getData(qt),s={x:n.position.x+n.offset.x,y:n.position.y+n.offset.y},o=(s.x-i.position.x)*r/100,a=(s.y-i.bounds.height/2-i.position.y)*r/100;i.update({position:{x:i.position.x+o,y:i.position.y+a}}),n.entity.document.layout.updateAffectedTransform(n.entity)}},_re={rankdir:"LR",nodesep:100,ranksep:100,ranker:"network-simplex"},Cre=class{constructor(e){this.store=e,this.graph=this.createGraph()}layout(){this.graphSetData(),this.dagreLayout(),this.layoutSetPosition()}dagreLayout(){let e=_n.buildLayoutGraph(this.graph);this.runLayout(e),_n.updateInputGraph(this.graph,e)}runLayout(e){_n.makeSpaceForEdgeLabels(e),_n.removeSelfEdges(e),_n.acyclic.run(e),_n.nestingGraph.run(e),_n.rank(_n.util.asNonCompoundGraph(e)),_n.injectEdgeLabelProxies(e),_n.removeEmptyRanks(e),_n.nestingGraph.cleanup(e),_n.normalizeRanks(e),_n.assignRankMinMax(e),_n.removeEdgeLabelProxies(e),_n.normalize.run(e),_n.parentDummyChains(e),_n.addBorderSegments(e),_n.order(e),this.setOrderAndRank(e),_n.insertSelfEdges(e),_n.coordinateSystem.adjust(e),_n.position(e),_n.positionSelfEdges(e),_n.removeBorderNodes(e),_n.normalize.undo(e),_n.fixupEdgeLabelCoords(e),_n.coordinateSystem.undo(e),_n.translateGraph(e),_n.assignNodeIntersects(e),_n.reversePointsForReversedEdges(e),_n.acyclic.undo(e)}createGraph(){const e=new _l.Graph({multigraph:!0});return e.setDefaultEdgeLabel(()=>({})),e.setGraph(_re),e}graphSetData(){const e=Array.from(this.store.nodes.values()),n=Array.from(this.store.edges.values()).sort((r,i)=>r.fromIndex===i.fromIndex?r.toIndex<i.toIndex?-1:1:r.fromIndex<i.fromIndex?-1:1);e.forEach(r=>{this.graph.setNode(r.index,{originID:r.id,width:r.size.width,height:r.size.height})}),n.forEach(r=>{this.graph.setEdge({v:r.fromIndex,w:r.toIndex,name:r.name})})}layoutSetPosition(){this.store.nodes.forEach(e=>{const n=this.getOffsetX(e),r=this.graph.node(e.index);if(!r){e.rank=-1,e.position={x:e.position.x+n,y:e.position.y};return}e.rank=r.rank??-1,e.position={x:this.normalizeNumber(r.x)+n,y:this.normalizeNumber(r.y)}})}normalizeNumber(e){return Number.isNaN(e)?0:e}getOffsetX(e){if(!e.hasChildren)return 0;const n=e.entity.getData(at),{bounds:r,padding:i}=n;return-r.width/2+i.left}setOrderAndRank(e){return this.followAdjust(e),this.normalizeOrder(e),e}followAdjust(e){const n=this.rankGroup(e);e.nodes().forEach(r=>{const i=e.node(r),s=this.store.getNodeByIndex(r);if(!i||!(s!=null&&s.followedBy))return;const{followedBy:o}=s,{rank:a,order:l}=i,u=o.map(v=>{var w;return(w=this.store.getNode(v))==null?void 0:w.index}).filter(Boolean),h=new Set(u),p=n.get(a);if(!p)return;Array.from(p).filter(v=>h.has(v)?!1:e.node(v).order>l).forEach(v=>{const w=e.node(v);w.order=w.order+o.length}),u.forEach((v,w)=>{var x,I;const S=e.node(v);S.order=l+w+1;const E=S.rank;S.rank=a,(x=n.get(E))==null||x.delete(v),(I=n.get(a))==null||I.add(v)})})}normalizeOrder(e){this.rankGroup(e).forEach((r,i)=>{const s=Array.from(r).map(o=>e.node(o));s.sort((o,a)=>o.order-a.order),s.forEach((o,a)=>{o.order=a})})}rankGroup(e){const n=new Map;return e.nodes().forEach(r=>{var o;const s=e.node(r).rank;n.has(s)||n.set(s,new Set),(o=n.get(s))==null||o.add(r)}),n}},Ere=class{constructor(){this._store=new bre,this._layout=new Cre(this._store),this._position=new wre(this._store)}init(e,n={}){this._store.create(e),this.setFollowNode(n.getFollowNode)}layout(){this._store.initialized&&this._layout.layout()}async position(){if(this._store.initialized)return await this._position.position()}setFollowNode(e){if(!e)return;const n={store:this._store};this._store.nodes.forEach(r=>{var o;const i=(o=e(r,n))==null?void 0:o.followTo;if(!i)return;const s=this._store.getNode(i);s&&(s.followedBy||(s.followedBy=[]),s.followedBy.push(r.id),r.followTo=i)})}},Cv=class{async layout(e={}){await this.layoutNode(this.document.root,e)}async layoutNode(e,n){const r=this.getAvailableBlocks(e);if(!r||!Array.isArray(r)||!r.length)return;const i=e.blocks.map(o=>o.getData(el).outputLines.filter(Boolean)).flat();await Promise.all(r.map(async o=>this.layoutNode(o,n)));const s=new Ere;s.init({nodes:r,edges:i},n),s.layout(),await s.position()}getAvailableBlocks(e){const n=e.blocks.filter(i=>!this.shouldFlatNode(i)),r=e.blocks.filter(i=>this.shouldFlatNode(i)).map(i=>i.blocks).flat();return[...n,...r]}shouldFlatNode(e){return e.flowNodeType===In.GROUP}};g7([oe(Et)],Cv.prototype,"document",2);Cv=g7([$e()],Cv);var xre=Gn({onBind:({bind:e})=>{e(Cv).toSelf().inSingletonScope()}}),Z7=Object.defineProperty,Sre=Object.getOwnPropertyDescriptor,Dre=Object.getOwnPropertyNames,Nre=Object.prototype.hasOwnProperty,Q7=(e,n)=>{for(var r in n)Z7(e,r,{get:n[r],enumerable:!0})},Ire=(e,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Dre(n))!Nre.call(e,s)&&s!==r&&Z7(e,s,{get:()=>n[s],enumerable:!(i=Sre(n,s))||i.enumerable});return e},J7=(e,n,r)=>(Ire(e,n,"default"),r),ej={};Q7(ej,{FreeLayoutEditor:()=>ij,FreeLayoutEditorProvider:()=>Vw,FreeLayoutPluginContext:()=>tj,FreeLayoutProps:()=>iw,WorkflowNodeRenderer:()=>rj,WorkflowPortRender:()=>Fw,createFreeLayoutPreset:()=>nj,useAutoLayout:()=>sj,useClientContext:()=>Wh,usePlaygroundTools:()=>Zv});var cO={};Q7(cO,{FreeLayoutEditor:()=>ij,FreeLayoutEditorProvider:()=>Vw,WorkflowNodeRenderer:()=>rj,WorkflowPortRender:()=>Fw});var tj=Mu,iw;(e=>{e.DEFAULT={...ew.DEFAULT,fromNodeJSON(n,r){var s;if(!n.getData(gr)){r.data&&n.updateExtInfo(r.data),n.onExtInfoChange(()=>{n.document.fireContentChange({type:wg.NODE_DATA_CHANGE,toJSON:()=>n.getExtInfo(),entity:n})});return}return(s=Su.fromNodeJSON)==null?void 0:s.call(Su,n,r)},toNodeJSON(n){const r=n.getData(gr),i=n.transform.position;return r?Su.toNodeJSON(n):{id:n.id,type:n.flowNodeType,meta:{position:{x:i.x,y:i.y}},data:n.getExtInfo()}}}})(iw||(iw={}));var AE=e=>{const n=e.get(Ui);if(n.node)return n.node};function nj(e){return n=>{var i,s;e={...iw.DEFAULT,...e,playground:{...e.playground,get hoverService(){return n.get(Zs)}}};let r=[];return r.push(F9({registerShortcuts(o){var l;const a=n.get(oa);if(o.addHandlers({commandId:O9.DELETE_NODES,shortcuts:["backspace","delete"],isEnabled:()=>a.selection.length>0&&!n.playground.config.readonlyOrDisabled,execute:()=>{a.selection.forEach(u=>{var h;if(u instanceof To){if(!n.document.canRemove(u))return;const p=u.getNodeMeta(),g=(h=p.subCanvas)==null?void 0:h.call(p,u);if(g!=null&&g.isCanvas){g.parentNode.dispose();return}u.dispose()}else if(u instanceof zs){if(!n.document.linesManager.canRemove(u))return;u.dispose()}}),a.selection=a.selection.filter(u=>!u.disposed)}}),(l=e==null?void 0:e.history)!=null&&l.enable){const u=n.get(ar);e.history.disableShortcuts||(o.addHandlers({commandId:wh.Default.UNDO,shortcuts:["meta z","ctrl z"],isEnabled:()=>!0,execute:()=>{u.undo()}}),o.addHandlers({commandId:wh.Default.REDO,shortcuts:["meta shift z","ctrl shift z"],isEnabled:()=>!0,execute:()=>{u.redo()}}))}}})),r=vJ(e,r)(n),(i=e.variableEngine)!=null&&i.enable&&r.push(DQ({...e.variableEngine,layout:"free"})),(s=e.history)!=null&&s.enable&&r.push(kJ(e.history)),r.push(Dw({onBind:o=>{var a,l,u,h,p,g,v,w,S,E,x,I,P,M,k;o.rebind(Wv).toConstantValue({canAddLine:(a=e.canAddLine)==null?void 0:a.bind(null,n),canDeleteLine:(l=e.canDeleteLine)==null?void 0:l.bind(null,n),isErrorLine:(u=e.isErrorLine)==null?void 0:u.bind(null,n),isErrorPort:(h=e.isErrorPort)==null?void 0:h.bind(null,n),isDisabledPort:(p=e.isDisabledPort)==null?void 0:p.bind(null,n),isReverseLine:(g=e.isReverseLine)==null?void 0:g.bind(null,n),isHideArrowLine:(v=e.isHideArrowLine)==null?void 0:v.bind(null,n),isFlowingLine:(w=e.isFlowingLine)==null?void 0:w.bind(null,n),isDisabledLine:(S=e.isDisabledLine)==null?void 0:S.bind(null,n),isVerticalLine:(E=e.isVerticalLine)==null?void 0:E.bind(null,n),onDragLineEnd:(x=e.onDragLineEnd)==null?void 0:x.bind(null,n),setLineRenderType:(I=e.setLineRenderType)==null?void 0:I.bind(null,n),setLineClassName:(P=e.setLineClassName)==null?void 0:P.bind(null,n),canDeleteNode:(M=e.canDeleteNode)==null?void 0:M.bind(null,n),canResetLine:(k=e.canResetLine)==null?void 0:k.bind(null,n),cursors:e.cursors??Su.cursors,lineColor:e.lineColor??Su.lineColor,allNodesDefaultExpanded:e.allNodesDefaultExpanded,toNodeJSON:e.toNodeJSON,fromNodeJSON:e.fromNodeJSON})},onInit:o=>{var a,l;o.playground.registerLayer(Ih),o.playground.registerLayer(Nh,{renderElement:()=>typeof AE=="function"?AE(o):AE}),(a=e.scroll)!=null&&a.disableScrollLimit||o.playground.registerLayer(qb),(l=e.scroll)!=null&&l.disableScrollBar||o.playground.registerLayer(Qp),e.onContentChange&&o.document.onContentChange(u=>e.onContentChange(o,u))},containerModules:[CQ]}),X9({}),c7({}),ate({}),xre({}),LJ({canSelect:o=>{if(o.button!==0)return!1;const a=o.target;if(a){if(a.classList.contains("gedit-flow-background-layer")||a.closest('[data-flow-editor-selectable="true"]'))return!0;if(a.closest('[data-flow-editor-selectable="false"]'))return!1}return!n.get(Zs).isSomeHovered()},ignoreOneSelect:!0,ignoreChildrenLength:!0,...e.selectBox||{}})),z9(e,r)(n)}}var Vw=R.forwardRef(function(n,r){const{children:i,...s}=n,o=R.useMemo(()=>nj(s),[]),a=R.useCallback(l=>({...A6(l),get document(){return l.get(Et)},get clipboard(){return l.get(D6)},get selection(){return l.get(oa)},get history(){return l.get(ar)}}),[]);return D.createElement(L6,{ref:r,plugins:o,customPluginContext:a},i)}),rj=e=>{const{selected:n,activated:r,startDrag:i,ports:s,selectNode:o,nodeRef:a,onFocus:l,onBlur:u}=xc(),h=ic(e.className||"",{activated:r,selected:n});return D.createElement(D.Fragment,null,D.createElement("div",{className:h,style:e.style,ref:a,draggable:!0,onDragStart:i,onClick:o,onFocus:l,onBlur:u,"data-node-selected":String(n)},e.children),s.map(p=>D.createElement(Fw,{key:p.id,entity:p,onClick:e.onPortClick?g=>e.onPortClick(p,g):void 0,className:e.portClassName,style:e.portStyle})))},ij=R.forwardRef(function(n,r){const{children:i,...s}=n;return D.createElement(Vw,{ref:r,...s},D.createElement(II,null,i))});J7(cO,VJ);J7(ej,cO);var t5=e=>{const n=e.getData(qt);return{x:n.position.x,y:n.position.y}},Ore=()=>{const e=DI();try{return e.get(ar)}catch{return{pushOperation:()=>{}}}},Tre=()=>{const e=Ore();return R.useCallback(r=>{const{nodes:i,startPositions:s,endPositions:o}=r,a=i.map(l=>l.id);e.pushOperation({type:vv.dragNodes,value:{ids:a,value:o,oldValue:s}},{noApply:!0})},[e])},Mre=e=>{const{nodes:n,startPositions:r}=e;return()=>{n.forEach((i,s)=>{const o=i.getData(qt),a=r[s];o.update({position:a})})}},Pre=()=>{const e=Wt(Et),n=Wt(Cv),r=Tre();return R.useCallback(async s=>{const o=e.getAllNodes(),a=o.map(t5);await n.layout(s);const l=o.map(t5);return r({nodes:o,startPositions:a,endPositions:l}),Mre({nodes:o,startPositions:a})},[n,e,r])},sj=()=>{const e=Wt(Et),n=ai(),r=Pre(),i=R.useCallback(o=>{jw(e,n.config,o)},[e,n]);return R.useCallback(async o=>{i();const a=await r(o);return i(),a},[r])};function Wh(){return Wt(Mu)}function Zv(){const e=ai(),n=Wt(Et),[r,i]=R.useState(1),[s,o]=R.useState(n.linesManager.lineType),[a,l]=R.useState(mu.SELECT),[u,h]=R.useState(Op.PAD),p=R.useCallback(P=>{r<.1||e==null||e.config.zoomout(P)},[r,e]),g=R.useCallback(P=>{r>1.9||e==null||e.config.zoomin(P)},[r,e]),v=R.useCallback(P=>{const M=n.linesManager.switchLineType(P);return o(M),M},[n]),w=R.useCallback(P=>{jw(n,e.config,P)},[n,e]),S=sj();R.useEffect(()=>{let P=null;return e&&(P=e.onZoom(M=>i(M))),()=>{P&&P.dispose()}},[e]),R.useEffect(()=>{const P=e.editorState.onStateChange(M=>{l(M.state===xn.STATE_GRAB||M.state===xn.STATE_MOUSE_FRIENDLY_SELECT?mu.GRAB:mu.SELECT),h(M.state===xn.STATE_MOUSE_FRIENDLY_SELECT?Op.MOUSE:Op.PAD)});return()=>{P.dispose()}},[e]);function E(P){let M;typeof P=="function"?M=P({isPressingSpaceBar:e.editorState.isPressingSpaceBar,cursorState:a}):M=P,!(typeof M>"u")&&(M===mu.GRAB?(e.editorState.changeState(xn.STATE_GRAB.id),l(M)):(M=mu.SELECT)&&(e.editorState.changeState(xn.STATE_SELECT.id),l(M)))}function x(P){P===Op.MOUSE?(e.editorState.changeState(xn.STATE_MOUSE_FRIENDLY_SELECT.id),l(mu.GRAB)):P===Op.PAD&&(e.editorState.changeState(xn.STATE_SELECT.id),l(mu.SELECT)),h(P)}function I(P){e.config.updateConfig({mouseScrollDelta:P})}return{zoomin:g,zoomout:p,fitView:w,autoLayout:S,switchLineType:v,zoom:r,lineType:s,cursorState:a,setCursorState:E,interactiveType:u,setInteractiveType:x,setMouseScrollDelta:I}}const Are="/workflow/assets/icon-start-C8Ct-og-.jpg";var RE,n5;function oj(){if(n5)return RE;n5=1;function e(){}return RE=e,RE}var Rre=oj();const rt=cn(Rre);var kE,r5;function Es(){if(r5)return kE;r5=1;var e=Array.isArray;return kE=e,kE}var LE,i5;function aj(){if(i5)return LE;i5=1;var e=typeof Ga=="object"&&Ga&&Ga.Object===Object&&Ga;return LE=e,LE}var jE,s5;function ya(){if(s5)return jE;s5=1;var e=aj(),n=typeof self=="object"&&self&&self.Object===Object&&self,r=e||n||Function("return this")();return jE=r,jE}var FE,o5;function Sg(){if(o5)return FE;o5=1;var e=ya(),n=e.Symbol;return FE=n,FE}var $E,a5;function kre(){if(a5)return $E;a5=1;var e=Sg(),n=Object.prototype,r=n.hasOwnProperty,i=n.toString,s=e?e.toStringTag:void 0;function o(a){var l=r.call(a,s),u=a[s];try{a[s]=void 0;var h=!0}catch{}var p=i.call(a);return h&&(l?a[s]=u:delete a[s]),p}return $E=o,$E}var zE,l5;function Lre(){if(l5)return zE;l5=1;var e=Object.prototype,n=e.toString;function r(i){return n.call(i)}return zE=r,zE}var VE,c5;function Sc(){if(c5)return VE;c5=1;var e=Sg(),n=kre(),r=Lre(),i="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(l){return l==null?l===void 0?s:i:o&&o in Object(l)?n(l):r(l)}return VE=a,VE}var BE,u5;function Po(){if(u5)return BE;u5=1;function e(n){return n!=null&&typeof n=="object"}return BE=e,BE}var HE,d5;function Qv(){if(d5)return HE;d5=1;var e=Sc(),n=Po(),r="[object Symbol]";function i(s){return typeof s=="symbol"||n(s)&&e(s)==r}return HE=i,HE}var UE,h5;function jre(){if(h5)return UE;h5=1;var e=Es(),n=Qv(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function s(o,a){if(e(o))return!1;var l=typeof o;return l=="number"||l=="symbol"||l=="boolean"||o==null||n(o)?!0:i.test(o)||!r.test(o)||a!=null&&o in Object(a)}return UE=s,UE}var KE,f5;function Js(){if(f5)return KE;f5=1;function e(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}return KE=e,KE}var WE,p5;function Bw(){if(p5)return WE;p5=1;var e=Sc(),n=Js(),r="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(l){if(!n(l))return!1;var u=e(l);return u==i||u==s||u==r||u==o}return WE=a,WE}var qE,g5;function Fre(){if(g5)return qE;g5=1;var e=ya(),n=e["__core-js_shared__"];return qE=n,qE}var GE,y5;function $re(){if(y5)return GE;y5=1;var e=Fre(),n=function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function r(i){return!!n&&n in i}return GE=r,GE}var YE,m5;function lj(){if(m5)return YE;m5=1;var e=Function.prototype,n=e.toString;function r(i){if(i!=null){try{return n.call(i)}catch{}try{return i+""}catch{}}return""}return YE=r,YE}var XE,v5;function zre(){if(v5)return XE;v5=1;var e=Bw(),n=$re(),r=Js(),i=lj(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,l=Object.prototype,u=a.toString,h=l.hasOwnProperty,p=RegExp("^"+u.call(h).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(v){if(!r(v)||n(v))return!1;var w=e(v)?p:o;return w.test(i(v))}return XE=g,XE}var ZE,b5;function Vre(){if(b5)return ZE;b5=1;function e(n,r){return n==null?void 0:n[r]}return ZE=e,ZE}var QE,w5;function qh(){if(w5)return QE;w5=1;var e=zre(),n=Vre();function r(i,s){var o=n(i,s);return e(o)?o:void 0}return QE=r,QE}var JE,_5;function Hw(){if(_5)return JE;_5=1;var e=qh(),n=e(Object,"create");return JE=n,JE}var ex,C5;function Bre(){if(C5)return ex;C5=1;var e=Hw();function n(){this.__data__=e?e(null):{},this.size=0}return ex=n,ex}var tx,E5;function Hre(){if(E5)return tx;E5=1;function e(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}return tx=e,tx}var nx,x5;function Ure(){if(x5)return nx;x5=1;var e=Hw(),n="__lodash_hash_undefined__",r=Object.prototype,i=r.hasOwnProperty;function s(o){var a=this.__data__;if(e){var l=a[o];return l===n?void 0:l}return i.call(a,o)?a[o]:void 0}return nx=s,nx}var rx,S5;function Kre(){if(S5)return rx;S5=1;var e=Hw(),n=Object.prototype,r=n.hasOwnProperty;function i(s){var o=this.__data__;return e?o[s]!==void 0:r.call(o,s)}return rx=i,rx}var ix,D5;function Wre(){if(D5)return ix;D5=1;var e=Hw(),n="__lodash_hash_undefined__";function r(i,s){var o=this.__data__;return this.size+=this.has(i)?0:1,o[i]=e&&s===void 0?n:s,this}return ix=r,ix}var sx,N5;function qre(){if(N5)return sx;N5=1;var e=Bre(),n=Hre(),r=Ure(),i=Kre(),s=Wre();function o(a){var l=-1,u=a==null?0:a.length;for(this.clear();++l<u;){var h=a[l];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,sx=o,sx}var ox,I5;function Gre(){if(I5)return ox;I5=1;function e(){this.__data__=[],this.size=0}return ox=e,ox}var ax,O5;function Jv(){if(O5)return ax;O5=1;function e(n,r){return n===r||n!==n&&r!==r}return ax=e,ax}var lx,T5;function Uw(){if(T5)return lx;T5=1;var e=Jv();function n(r,i){for(var s=r.length;s--;)if(e(r[s][0],i))return s;return-1}return lx=n,lx}var cx,M5;function Yre(){if(M5)return cx;M5=1;var e=Uw(),n=Array.prototype,r=n.splice;function i(s){var o=this.__data__,a=e(o,s);if(a<0)return!1;var l=o.length-1;return a==l?o.pop():r.call(o,a,1),--this.size,!0}return cx=i,cx}var ux,P5;function Xre(){if(P5)return ux;P5=1;var e=Uw();function n(r){var i=this.__data__,s=e(i,r);return s<0?void 0:i[s][1]}return ux=n,ux}var dx,A5;function Zre(){if(A5)return dx;A5=1;var e=Uw();function n(r){return e(this.__data__,r)>-1}return dx=n,dx}var hx,R5;function Qre(){if(R5)return hx;R5=1;var e=Uw();function n(r,i){var s=this.__data__,o=e(s,r);return o<0?(++this.size,s.push([r,i])):s[o][1]=i,this}return hx=n,hx}var fx,k5;function Kw(){if(k5)return fx;k5=1;var e=Gre(),n=Yre(),r=Xre(),i=Zre(),s=Qre();function o(a){var l=-1,u=a==null?0:a.length;for(this.clear();++l<u;){var h=a[l];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,fx=o,fx}var px,L5;function uO(){if(L5)return px;L5=1;var e=qh(),n=ya(),r=e(n,"Map");return px=r,px}var gx,j5;function Jre(){if(j5)return gx;j5=1;var e=qre(),n=Kw(),r=uO();function i(){this.size=0,this.__data__={hash:new e,map:new(r||n),string:new e}}return gx=i,gx}var yx,F5;function eie(){if(F5)return yx;F5=1;function e(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}return yx=e,yx}var mx,$5;function Ww(){if($5)return mx;$5=1;var e=eie();function n(r,i){var s=r.__data__;return e(i)?s[typeof i=="string"?"string":"hash"]:s.map}return mx=n,mx}var vx,z5;function tie(){if(z5)return vx;z5=1;var e=Ww();function n(r){var i=e(this,r).delete(r);return this.size-=i?1:0,i}return vx=n,vx}var bx,V5;function nie(){if(V5)return bx;V5=1;var e=Ww();function n(r){return e(this,r).get(r)}return bx=n,bx}var wx,B5;function rie(){if(B5)return wx;B5=1;var e=Ww();function n(r){return e(this,r).has(r)}return wx=n,wx}var _x,H5;function iie(){if(H5)return _x;H5=1;var e=Ww();function n(r,i){var s=e(this,r),o=s.size;return s.set(r,i),this.size+=s.size==o?0:1,this}return _x=n,_x}var Cx,U5;function dO(){if(U5)return Cx;U5=1;var e=Jre(),n=tie(),r=nie(),i=rie(),s=iie();function o(a){var l=-1,u=a==null?0:a.length;for(this.clear();++l<u;){var h=a[l];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,Cx=o,Cx}var Ex,K5;function sie(){if(K5)return Ex;K5=1;var e=dO(),n="Expected a function";function r(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new TypeError(n);var o=function(){var a=arguments,l=s?s.apply(this,a):a[0],u=o.cache;if(u.has(l))return u.get(l);var h=i.apply(this,a);return o.cache=u.set(l,h)||u,h};return o.cache=new(r.Cache||e),o}return r.Cache=e,Ex=r,Ex}var xx,W5;function oie(){if(W5)return xx;W5=1;var e=sie(),n=500;function r(i){var s=e(i,function(a){return o.size===n&&o.clear(),a}),o=s.cache;return s}return xx=r,xx}var Sx,q5;function aie(){if(q5)return Sx;q5=1;var e=oie(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,i=e(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(n,function(a,l,u,h){o.push(u?h.replace(r,"$1"):l||a)}),o});return Sx=i,Sx}var Dx,G5;function qw(){if(G5)return Dx;G5=1;function e(n,r){for(var i=-1,s=n==null?0:n.length,o=Array(s);++i<s;)o[i]=r(n[i],i,n);return o}return Dx=e,Dx}var Nx,Y5;function lie(){if(Y5)return Nx;Y5=1;var e=Sg(),n=qw(),r=Es(),i=Qv(),s=e?e.prototype:void 0,o=s?s.toString:void 0;function a(l){if(typeof l=="string")return l;if(r(l))return n(l,a)+"";if(i(l))return o?o.call(l):"";var u=l+"";return u=="0"&&1/l==-1/0?"-0":u}return Nx=a,Nx}var Ix,X5;function cie(){if(X5)return Ix;X5=1;var e=lie();function n(r){return r==null?"":e(r)}return Ix=n,Ix}var Ox,Z5;function Dg(){if(Z5)return Ox;Z5=1;var e=Es(),n=jre(),r=aie(),i=cie();function s(o,a){return e(o)?o:n(o,a)?[o]:r(i(o))}return Ox=s,Ox}var Tx,Q5;function Gw(){if(Q5)return Tx;Q5=1;var e=Qv();function n(r){if(typeof r=="string"||e(r))return r;var i=r+"";return i=="0"&&1/r==-1/0?"-0":i}return Tx=n,Tx}var Mx,J5;function hO(){if(J5)return Mx;J5=1;var e=Dg(),n=Gw();function r(i,s){s=e(s,i);for(var o=0,a=s.length;i!=null&&o<a;)i=i[n(s[o++])];return o&&o==a?i:void 0}return Mx=r,Mx}var Px,e4;function uie(){if(e4)return Px;e4=1;var e=hO();function n(r,i,s){var o=r==null?void 0:e(r,i);return o===void 0?s:o}return Px=n,Px}var die=uie();const ot=cn(die),cj=function(e){if(ot(process,"env.NODE_ENV")==="development"){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];console.log(e,...r)}};class li{static get cssClasses(){return{}}static get strings(){return{}}static get numbers(){return{}}static get defaultAdapter(){return{getProp:rt,getProps:rt,getState:rt,getStates:rt,setState:rt,getContext:rt,getContexts:rt,getCache:rt,setCache:rt,getCaches:rt,stopPropagation:rt,persistEvent:rt}}constructor(n){this._adapter=Object.assign(Object.assign({},li.defaultAdapter),n)}getProp(n){return this._adapter.getProp(n)}getProps(){return this._adapter.getProps()}getState(n){return this._adapter.getState(n)}getStates(){return this._adapter.getStates()}setState(n,r){return this._adapter.setState(Object.assign({},n),r)}getContext(n){return this._adapter.getContext(n)}getContexts(){return this._adapter.getContexts()}getCaches(){return this._adapter.getCaches()}getCache(n){return this._adapter.getCache(n)}setCache(n,r){return n&&this._adapter.setCache(n,r)}stopPropagation(n){this._adapter.stopPropagation(n)}_isControlledComponent(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"value";const r=this.getProps();return n in r}_isInProps(n){const r=this.getProps();return n in r}init(n){}destroy(){}log(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];cj(n,...i)}_persistEvent(n){this._adapter.persistEvent(n)}}function uj(e){return Object.keys(e).reduce((n,r)=>(r.substr(0,5)==="data-"&&(n[r]=e[r]),n),{})}const{hasOwnProperty:hie}=Object.prototype;class jr extends R.Component{constructor(n){super(n),this.isControlled=r=>!!(r&&this.props&&typeof this.props=="object"&&hie.call(this.props,r)),this.setStateAsync=r=>new Promise(i=>{this.setState(r,i)}),this.cache={},this.foundation=null}componentDidMount(){this.foundation&&typeof this.foundation.init=="function"&&this.foundation.init()}componentWillUnmount(){this.foundation&&typeof this.foundation.destroy=="function"&&this.foundation.destroy(),this.cache={}}get adapter(){return{getContext:n=>{if(this.context&&n)return this.context[n]},getContexts:()=>this.context,getProp:n=>this.props[n],getProps:()=>this.props,getState:n=>this.state[n],getStates:()=>this.state,setState:(n,r)=>this.setState(Object.assign({},n),r),getCache:n=>n&&this.cache[n],getCaches:()=>this.cache,setCache:(n,r)=>n&&(this.cache[n]=r),stopPropagation:n=>{try{n.stopPropagation(),n.nativeEvent&&n.nativeEvent.stopImmediatePropagation()}catch{}},persistEvent:n=>{n&&n.persist&&typeof n.persist=="function"&&n.persist()}}}log(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return cj(n,...i)}getDataAttr(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return uj(n)}}jr.propTypes={};jr.defaultProps={};var Ax,t4;function fie(){if(t4)return Ax;t4=1;var e=ya(),n=function(){return e.Date.now()};return Ax=n,Ax}var Rx,n4;function pie(){if(n4)return Rx;n4=1;var e=/\s/;function n(r){for(var i=r.length;i--&&e.test(r.charAt(i)););return i}return Rx=n,Rx}var kx,r4;function gie(){if(r4)return kx;r4=1;var e=pie(),n=/^\s+/;function r(i){return i&&i.slice(0,e(i)+1).replace(n,"")}return kx=r,kx}var Lx,i4;function dj(){if(i4)return Lx;i4=1;var e=gie(),n=Js(),r=Qv(),i=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;function u(h){if(typeof h=="number")return h;if(r(h))return i;if(n(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=n(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var g=o.test(h);return g||a.test(h)?l(h.slice(2),g?2:8):s.test(h)?i:+h}return Lx=u,Lx}var jx,s4;function hj(){if(s4)return jx;s4=1;var e=Js(),n=fie(),r=dj(),i="Expected a function",s=Math.max,o=Math.min;function a(l,u,h){var p,g,v,w,S,E,x=0,I=!1,P=!1,M=!0;if(typeof l!="function")throw new TypeError(i);u=r(u)||0,e(h)&&(I=!!h.leading,P="maxWait"in h,v=P?s(r(h.maxWait)||0,u):v,M="trailing"in h?!!h.trailing:M);function k(te){var ue=p,ye=g;return p=g=void 0,x=te,w=l.apply(ye,ue),w}function A(te){return x=te,S=setTimeout($,u),I?k(te):w}function j(te){var ue=te-E,ye=te-x,Ne=u-ue;return P?o(Ne,v-ye):Ne}function V(te){var ue=te-E,ye=te-x;return E===void 0||ue>=u||ue<0||P&&ye>=v}function $(){var te=n();if(V(te))return W(te);S=setTimeout($,j(te))}function W(te){return S=void 0,M&&p?k(te):(p=g=void 0,w)}function B(){S!==void 0&&clearTimeout(S),x=0,p=E=g=S=void 0}function H(){return S===void 0?w:W(n())}function Y(){var te=n(),ue=V(te);if(p=arguments,g=this,E=te,ue){if(S===void 0)return A(E);if(P)return clearTimeout(S),S=setTimeout($,u),k(E)}return S===void 0&&(S=setTimeout($,u)),w}return Y.cancel=B,Y.flush=H,Y}return jx=a,jx}var Fx,o4;function yie(){if(o4)return Fx;o4=1;var e=hj(),n=Js(),r="Expected a function";function i(s,o,a){var l=!0,u=!0;if(typeof s!="function")throw new TypeError(r);return n(a)&&(l="leading"in a?!!a.leading:l,u="trailing"in a?!!a.trailing:u),e(s,o,{leading:l,maxWait:o,trailing:u})}return Fx=i,Fx}var mie=yie();const a4=cn(mie);var vie=hj();const bie=cn(vie);var $x={exports:{}};/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/var l4;function wie(){return l4||(l4=1,function(e){(function(){var n={}.hasOwnProperty;function r(){for(var o="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(o=s(o,i(l)))}return o}function i(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var l in o)n.call(o,l)&&o[l]&&(a=s(a,l));return a}function s(o,a){return a?o?o+" "+a:o+a:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}($x)),$x.exports}var _ie=wie();const xe=cn(_ie);var zx={exports:{}},Vx,c4;function Cie(){if(c4)return Vx;c4=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Vx=e,Vx}var Bx,u4;function Eie(){if(u4)return Bx;u4=1;var e=Cie();function n(){}function r(){}return r.resetWarningCache=n,Bx=function(){function i(a,l,u,h,p,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}i.isRequired=i;function s(){return i}var o={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:n};return o.PropTypes=o,o},Bx}var d4;function xie(){return d4||(d4=1,zx.exports=Eie()()),zx.exports}var Sie=xie();const C=cn(Sie),Dn="semi",Die=["default","error","warning","success"];var Nie=Es();const fj=cn(Nie);var Iie=Js();const pj=cn(Iie),Yw={PREFIX:`${Dn}-typography`},Pi={WEIGHT:["light","regular","medium","semibold","bold","default"],TYPE:["primary","secondary","danger","warning","success","tertiary","quaternary"],SIZE:["normal","small","inherit"],SPACING:["normal","extended"],HEADING:[1,2,3,4,5,6],RULE:["text","numbers","bytes-decimal","bytes-binary","percentages","exponential"],TRUNCATE:["ceil","floor","round"]};var Oie=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Tie=Yw.PREFIX;let Xw=class extends R.PureComponent{render(){const n=this.props,{component:r,className:i,children:s,forwardRef:o}=n,a=Oie(n,["component","className","children","forwardRef"]),l=r,u=xe(Tie,i);return D.createElement(l,Object.assign({className:u,ref:o},a),s)}};Xw.defaultProps={component:"article",style:{},className:""};Xw.propTypes={component:C.string,style:C.object,className:C.string};var Mie=Bw();const sr=cn(Mie);var Hx,h4;function Pie(){if(h4)return Hx;h4=1;function e(n){return n===null}return Hx=e,Hx}var Aie=Pie();const kh=cn(Aie);var Ux,f4;function gj(){if(f4)return Ux;f4=1;var e=Sc(),n=Es(),r=Po(),i="[object String]";function s(o){return typeof o=="string"||!n(o)&&r(o)&&e(o)==i}return Ux=s,Ux}var Rie=gj();const fr=cn(Rie);var Kx,p4;function kie(){if(p4)return Kx;p4=1;var e=Kw();function n(){this.__data__=new e,this.size=0}return Kx=n,Kx}var Wx,g4;function Lie(){if(g4)return Wx;g4=1;function e(n){var r=this.__data__,i=r.delete(n);return this.size=r.size,i}return Wx=e,Wx}var qx,y4;function jie(){if(y4)return qx;y4=1;function e(n){return this.__data__.get(n)}return qx=e,qx}var Gx,m4;function Fie(){if(m4)return Gx;m4=1;function e(n){return this.__data__.has(n)}return Gx=e,Gx}var Yx,v4;function $ie(){if(v4)return Yx;v4=1;var e=Kw(),n=uO(),r=dO(),i=200;function s(o,a){var l=this.__data__;if(l instanceof e){var u=l.__data__;if(!n||u.length<i-1)return u.push([o,a]),this.size=++l.size,this;l=this.__data__=new r(u)}return l.set(o,a),this.size=l.size,this}return Yx=s,Yx}var Xx,b4;function fO(){if(b4)return Xx;b4=1;var e=Kw(),n=kie(),r=Lie(),i=jie(),s=Fie(),o=$ie();function a(l){var u=this.__data__=new e(l);this.size=u.size}return a.prototype.clear=n,a.prototype.delete=r,a.prototype.get=i,a.prototype.has=s,a.prototype.set=o,Xx=a,Xx}var Zx,w4;function yj(){if(w4)return Zx;w4=1;var e=qh(),n=function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Zx=n,Zx}var Qx,_4;function pO(){if(_4)return Qx;_4=1;var e=yj();function n(r,i,s){i=="__proto__"&&e?e(r,i,{configurable:!0,enumerable:!0,value:s,writable:!0}):r[i]=s}return Qx=n,Qx}var Jx,C4;function mj(){if(C4)return Jx;C4=1;var e=pO(),n=Jv();function r(i,s,o){(o!==void 0&&!n(i[s],o)||o===void 0&&!(s in i))&&e(i,s,o)}return Jx=r,Jx}var eS,E4;function zie(){if(E4)return eS;E4=1;function e(n){return function(r,i,s){for(var o=-1,a=Object(r),l=s(r),u=l.length;u--;){var h=l[n?u:++o];if(i(a[h],h,a)===!1)break}return r}}return eS=e,eS}var tS,x4;function vj(){if(x4)return tS;x4=1;var e=zie(),n=e();return tS=n,tS}var Lm={exports:{}};Lm.exports;var S4;function bj(){return S4||(S4=1,function(e,n){var r=ya(),i=n&&!n.nodeType&&n,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o?r.Buffer:void 0,l=a?a.allocUnsafe:void 0;function u(h,p){if(p)return h.slice();var g=h.length,v=l?l(g):new h.constructor(g);return h.copy(v),v}e.exports=u}(Lm,Lm.exports)),Lm.exports}var nS,D4;function wj(){if(D4)return nS;D4=1;var e=ya(),n=e.Uint8Array;return nS=n,nS}var rS,N4;function gO(){if(N4)return rS;N4=1;var e=wj();function n(r){var i=new r.constructor(r.byteLength);return new e(i).set(new e(r)),i}return rS=n,rS}var iS,I4;function _j(){if(I4)return iS;I4=1;var e=gO();function n(r,i){var s=i?e(r.buffer):r.buffer;return new r.constructor(s,r.byteOffset,r.length)}return iS=n,iS}var sS,O4;function Cj(){if(O4)return sS;O4=1;function e(n,r){var i=-1,s=n.length;for(r||(r=Array(s));++i<s;)r[i]=n[i];return r}return sS=e,sS}var oS,T4;function Vie(){if(T4)return oS;T4=1;var e=Js(),n=Object.create,r=function(){function i(){}return function(s){if(!e(s))return{};if(n)return n(s);i.prototype=s;var o=new i;return i.prototype=void 0,o}}();return oS=r,oS}var aS,M4;function Ej(){if(M4)return aS;M4=1;function e(n,r){return function(i){return n(r(i))}}return aS=e,aS}var lS,P4;function yO(){if(P4)return lS;P4=1;var e=Ej(),n=e(Object.getPrototypeOf,Object);return lS=n,lS}var cS,A4;function e0(){if(A4)return cS;A4=1;var e=Object.prototype;function n(r){var i=r&&r.constructor,s=typeof i=="function"&&i.prototype||e;return r===s}return cS=n,cS}var uS,R4;function xj(){if(R4)return uS;R4=1;var e=Vie(),n=yO(),r=e0();function i(s){return typeof s.constructor=="function"&&!r(s)?e(n(s)):{}}return uS=i,uS}var dS,k4;function Bie(){if(k4)return dS;k4=1;var e=Sc(),n=Po(),r="[object Arguments]";function i(s){return n(s)&&e(s)==r}return dS=i,dS}var hS,L4;function t0(){if(L4)return hS;L4=1;var e=Bie(),n=Po(),r=Object.prototype,i=r.hasOwnProperty,s=r.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(a){return n(a)&&i.call(a,"callee")&&!s.call(a,"callee")};return hS=o,hS}var fS,j4;function mO(){if(j4)return fS;j4=1;var e=9007199254740991;function n(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return fS=n,fS}var pS,F4;function od(){if(F4)return pS;F4=1;var e=Bw(),n=mO();function r(i){return i!=null&&n(i.length)&&!e(i)}return pS=r,pS}var gS,$4;function Sj(){if($4)return gS;$4=1;var e=od(),n=Po();function r(i){return n(i)&&e(i)}return gS=r,gS}var jm={exports:{}},yS,z4;function Hie(){if(z4)return yS;z4=1;function e(){return!1}return yS=e,yS}jm.exports;var V4;function n0(){return V4||(V4=1,function(e,n){var r=ya(),i=Hie(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,l=a?r.Buffer:void 0,u=l?l.isBuffer:void 0,h=u||i;e.exports=h}(jm,jm.exports)),jm.exports}var mS,B4;function vO(){if(B4)return mS;B4=1;var e=Sc(),n=yO(),r=Po(),i="[object Object]",s=Function.prototype,o=Object.prototype,a=s.toString,l=o.hasOwnProperty,u=a.call(Object);function h(p){if(!r(p)||e(p)!=i)return!1;var g=n(p);if(g===null)return!0;var v=l.call(g,"constructor")&&g.constructor;return typeof v=="function"&&v instanceof v&&a.call(v)==u}return mS=h,mS}var vS,H4;function Uie(){if(H4)return vS;H4=1;var e=Sc(),n=mO(),r=Po(),i="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",l="[object Error]",u="[object Function]",h="[object Map]",p="[object Number]",g="[object Object]",v="[object RegExp]",w="[object Set]",S="[object String]",E="[object WeakMap]",x="[object ArrayBuffer]",I="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",k="[object Int8Array]",A="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",$="[object Uint8ClampedArray]",W="[object Uint16Array]",B="[object Uint32Array]",H={};H[P]=H[M]=H[k]=H[A]=H[j]=H[V]=H[$]=H[W]=H[B]=!0,H[i]=H[s]=H[x]=H[o]=H[I]=H[a]=H[l]=H[u]=H[h]=H[p]=H[g]=H[v]=H[w]=H[S]=H[E]=!1;function Y(te){return r(te)&&n(te.length)&&!!H[e(te)]}return vS=Y,vS}var bS,U4;function Zw(){if(U4)return bS;U4=1;function e(n){return function(r){return n(r)}}return bS=e,bS}var Fm={exports:{}};Fm.exports;var K4;function bO(){return K4||(K4=1,function(e,n){var r=aj(),i=n&&!n.nodeType&&n,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o&&r.process,l=function(){try{var u=s&&s.require&&s.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=l}(Fm,Fm.exports)),Fm.exports}var wS,W4;function Qw(){if(W4)return wS;W4=1;var e=Uie(),n=Zw(),r=bO(),i=r&&r.isTypedArray,s=i?n(i):e;return wS=s,wS}var _S,q4;function Dj(){if(q4)return _S;q4=1;function e(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}return _S=e,_S}var CS,G4;function Jw(){if(G4)return CS;G4=1;var e=pO(),n=Jv(),r=Object.prototype,i=r.hasOwnProperty;function s(o,a,l){var u=o[a];(!(i.call(o,a)&&n(u,l))||l===void 0&&!(a in o))&&e(o,a,l)}return CS=s,CS}var ES,Y4;function Gh(){if(Y4)return ES;Y4=1;var e=Jw(),n=pO();function r(i,s,o,a){var l=!o;o||(o={});for(var u=-1,h=s.length;++u<h;){var p=s[u],g=a?a(o[p],i[p],p,o,i):void 0;g===void 0&&(g=i[p]),l?n(o,p,g):e(o,p,g)}return o}return ES=r,ES}var xS,X4;function Kie(){if(X4)return xS;X4=1;function e(n,r){for(var i=-1,s=Array(n);++i<n;)s[i]=r(i);return s}return xS=e,xS}var SS,Z4;function e_(){if(Z4)return SS;Z4=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(i,s){var o=typeof i;return s=s??e,!!s&&(o=="number"||o!="symbol"&&n.test(i))&&i>-1&&i%1==0&&i<s}return SS=r,SS}var DS,Q4;function Nj(){if(Q4)return DS;Q4=1;var e=Kie(),n=t0(),r=Es(),i=n0(),s=e_(),o=Qw(),a=Object.prototype,l=a.hasOwnProperty;function u(h,p){var g=r(h),v=!g&&n(h),w=!g&&!v&&i(h),S=!g&&!v&&!w&&o(h),E=g||v||w||S,x=E?e(h.length,String):[],I=x.length;for(var P in h)(p||l.call(h,P))&&!(E&&(P=="length"||w&&(P=="offset"||P=="parent")||S&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||s(P,I)))&&x.push(P);return x}return DS=u,DS}var NS,J4;function Wie(){if(J4)return NS;J4=1;function e(n){var r=[];if(n!=null)for(var i in Object(n))r.push(i);return r}return NS=e,NS}var IS,eA;function qie(){if(eA)return IS;eA=1;var e=Js(),n=e0(),r=Wie(),i=Object.prototype,s=i.hasOwnProperty;function o(a){if(!e(a))return r(a);var l=n(a),u=[];for(var h in a)h=="constructor"&&(l||!s.call(a,h))||u.push(h);return u}return IS=o,IS}var OS,tA;function r0(){if(tA)return OS;tA=1;var e=Nj(),n=qie(),r=od();function i(s){return r(s)?e(s,!0):n(s)}return OS=i,OS}var TS,nA;function Gie(){if(nA)return TS;nA=1;var e=Gh(),n=r0();function r(i){return e(i,n(i))}return TS=r,TS}var MS,rA;function Yie(){if(rA)return MS;rA=1;var e=mj(),n=bj(),r=_j(),i=Cj(),s=xj(),o=t0(),a=Es(),l=Sj(),u=n0(),h=Bw(),p=Js(),g=vO(),v=Qw(),w=Dj(),S=Gie();function E(x,I,P,M,k,A,j){var V=w(x,P),$=w(I,P),W=j.get($);if(W){e(x,P,W);return}var B=A?A(V,$,P+"",x,I,j):void 0,H=B===void 0;if(H){var Y=a($),te=!Y&&u($),ue=!Y&&!te&&v($);B=$,Y||te||ue?a(V)?B=V:l(V)?B=i(V):te?(H=!1,B=n($,!0)):ue?(H=!1,B=r($,!0)):B=[]:g($)||o($)?(B=V,o(V)?B=S(V):(!p(V)||h(V))&&(B=s($))):H=!1}H&&(j.set($,B),k(B,$,M,A,j),j.delete($)),e(x,P,B)}return MS=E,MS}var PS,iA;function Xie(){if(iA)return PS;iA=1;var e=fO(),n=mj(),r=vj(),i=Yie(),s=Js(),o=r0(),a=Dj();function l(u,h,p,g,v){u!==h&&r(h,function(w,S){if(v||(v=new e),s(w))i(u,h,S,p,l,g,v);else{var E=g?g(a(u,S),w,S+"",u,h,v):void 0;E===void 0&&(E=w),n(u,S,E)}},o)}return PS=l,PS}var AS,sA;function t_(){if(sA)return AS;sA=1;function e(n){return n}return AS=e,AS}var RS,oA;function Zie(){if(oA)return RS;oA=1;function e(n,r,i){switch(i.length){case 0:return n.call(r);case 1:return n.call(r,i[0]);case 2:return n.call(r,i[0],i[1]);case 3:return n.call(r,i[0],i[1],i[2])}return n.apply(r,i)}return RS=e,RS}var kS,aA;function Ij(){if(aA)return kS;aA=1;var e=Zie(),n=Math.max;function r(i,s,o){return s=n(s===void 0?i.length-1:s,0),function(){for(var a=arguments,l=-1,u=n(a.length-s,0),h=Array(u);++l<u;)h[l]=a[s+l];l=-1;for(var p=Array(s+1);++l<s;)p[l]=a[l];return p[s]=o(h),e(i,this,p)}}return kS=r,kS}var LS,lA;function Qie(){if(lA)return LS;lA=1;function e(n){return function(){return n}}return LS=e,LS}var jS,cA;function Jie(){if(cA)return jS;cA=1;var e=Qie(),n=yj(),r=t_(),i=n?function(s,o){return n(s,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return jS=i,jS}var FS,uA;function ese(){if(uA)return FS;uA=1;var e=800,n=16,r=Date.now;function i(s){var o=0,a=0;return function(){var l=r(),u=n-(l-a);if(a=l,u>0){if(++o>=e)return arguments[0]}else o=0;return s.apply(void 0,arguments)}}return FS=i,FS}var $S,dA;function Oj(){if(dA)return $S;dA=1;var e=Jie(),n=ese(),r=n(e);return $S=r,$S}var zS,hA;function Tj(){if(hA)return zS;hA=1;var e=t_(),n=Ij(),r=Oj();function i(s,o){return r(n(s,o,e),s+"")}return zS=i,zS}var VS,fA;function tse(){if(fA)return VS;fA=1;var e=Jv(),n=od(),r=e_(),i=Js();function s(o,a,l){if(!i(l))return!1;var u=typeof a;return(u=="number"?n(l)&&r(a,l.length):u=="string"&&a in l)?e(l[a],o):!1}return VS=s,VS}var BS,pA;function Mj(){if(pA)return BS;pA=1;var e=Tj(),n=tse();function r(i){return e(function(s,o){var a=-1,l=o.length,u=l>1?o[l-1]:void 0,h=l>2?o[2]:void 0;for(u=i.length>3&&typeof u=="function"?(l--,u):void 0,h&&n(o[0],o[1],h)&&(u=l<3?void 0:u,l=1),s=Object(s);++a<l;){var p=o[a];p&&i(s,p,a,u)}return s})}return BS=r,BS}var HS,gA;function nse(){if(gA)return HS;gA=1;var e=Xie(),n=Mj(),r=n(function(i,s,o){e(i,s,o)});return HS=r,HS}var rse=nse();const ise=cn(rse);var US,yA;function Pj(){if(yA)return US;yA=1;function e(n,r){for(var i=-1,s=n==null?0:n.length;++i<s&&r(n[i],i,n)!==!1;);return n}return US=e,US}var KS,mA;function sse(){if(mA)return KS;mA=1;var e=Ej(),n=e(Object.keys,Object);return KS=n,KS}var WS,vA;function Aj(){if(vA)return WS;vA=1;var e=e0(),n=sse(),r=Object.prototype,i=r.hasOwnProperty;function s(o){if(!e(o))return n(o);var a=[];for(var l in Object(o))i.call(o,l)&&l!="constructor"&&a.push(l);return a}return WS=s,WS}var qS,bA;function Ng(){if(bA)return qS;bA=1;var e=Nj(),n=Aj(),r=od();function i(s){return r(s)?e(s):n(s)}return qS=i,qS}var GS,wA;function ose(){if(wA)return GS;wA=1;var e=Gh(),n=Ng();function r(i,s){return i&&e(s,n(s),i)}return GS=r,GS}var YS,_A;function ase(){if(_A)return YS;_A=1;var e=Gh(),n=r0();function r(i,s){return i&&e(s,n(s),i)}return YS=r,YS}var XS,CA;function lse(){if(CA)return XS;CA=1;function e(n,r){for(var i=-1,s=n==null?0:n.length,o=0,a=[];++i<s;){var l=n[i];r(l,i,n)&&(a[o++]=l)}return a}return XS=e,XS}var ZS,EA;function Rj(){if(EA)return ZS;EA=1;function e(){return[]}return ZS=e,ZS}var QS,xA;function wO(){if(xA)return QS;xA=1;var e=lse(),n=Rj(),r=Object.prototype,i=r.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(a){return a==null?[]:(a=Object(a),e(s(a),function(l){return i.call(a,l)}))}:n;return QS=o,QS}var JS,SA;function cse(){if(SA)return JS;SA=1;var e=Gh(),n=wO();function r(i,s){return e(i,n(i),s)}return JS=r,JS}var e2,DA;function _O(){if(DA)return e2;DA=1;function e(n,r){for(var i=-1,s=r.length,o=n.length;++i<s;)n[o+i]=r[i];return n}return e2=e,e2}var t2,NA;function kj(){if(NA)return t2;NA=1;var e=_O(),n=yO(),r=wO(),i=Rj(),s=Object.getOwnPropertySymbols,o=s?function(a){for(var l=[];a;)e(l,r(a)),a=n(a);return l}:i;return t2=o,t2}var n2,IA;function use(){if(IA)return n2;IA=1;var e=Gh(),n=kj();function r(i,s){return e(i,n(i),s)}return n2=r,n2}var r2,OA;function Lj(){if(OA)return r2;OA=1;var e=_O(),n=Es();function r(i,s,o){var a=s(i);return n(i)?a:e(a,o(i))}return r2=r,r2}var i2,TA;function jj(){if(TA)return i2;TA=1;var e=Lj(),n=wO(),r=Ng();function i(s){return e(s,r,n)}return i2=i,i2}var s2,MA;function Fj(){if(MA)return s2;MA=1;var e=Lj(),n=kj(),r=r0();function i(s){return e(s,r,n)}return s2=i,s2}var o2,PA;function dse(){if(PA)return o2;PA=1;var e=qh(),n=ya(),r=e(n,"DataView");return o2=r,o2}var a2,AA;function hse(){if(AA)return a2;AA=1;var e=qh(),n=ya(),r=e(n,"Promise");return a2=r,a2}var l2,RA;function $j(){if(RA)return l2;RA=1;var e=qh(),n=ya(),r=e(n,"Set");return l2=r,l2}var c2,kA;function fse(){if(kA)return c2;kA=1;var e=qh(),n=ya(),r=e(n,"WeakMap");return c2=r,c2}var u2,LA;function i0(){if(LA)return u2;LA=1;var e=dse(),n=uO(),r=hse(),i=$j(),s=fse(),o=Sc(),a=lj(),l="[object Map]",u="[object Object]",h="[object Promise]",p="[object Set]",g="[object WeakMap]",v="[object DataView]",w=a(e),S=a(n),E=a(r),x=a(i),I=a(s),P=o;return(e&&P(new e(new ArrayBuffer(1)))!=v||n&&P(new n)!=l||r&&P(r.resolve())!=h||i&&P(new i)!=p||s&&P(new s)!=g)&&(P=function(M){var k=o(M),A=k==u?M.constructor:void 0,j=A?a(A):"";if(j)switch(j){case w:return v;case S:return l;case E:return h;case x:return p;case I:return g}return k}),u2=P,u2}var d2,jA;function pse(){if(jA)return d2;jA=1;var e=Object.prototype,n=e.hasOwnProperty;function r(i){var s=i.length,o=new i.constructor(s);return s&&typeof i[0]=="string"&&n.call(i,"index")&&(o.index=i.index,o.input=i.input),o}return d2=r,d2}var h2,FA;function gse(){if(FA)return h2;FA=1;var e=gO();function n(r,i){var s=i?e(r.buffer):r.buffer;return new r.constructor(s,r.byteOffset,r.byteLength)}return h2=n,h2}var f2,$A;function yse(){if($A)return f2;$A=1;var e=/\w*$/;function n(r){var i=new r.constructor(r.source,e.exec(r));return i.lastIndex=r.lastIndex,i}return f2=n,f2}var p2,zA;function mse(){if(zA)return p2;zA=1;var e=Sg(),n=e?e.prototype:void 0,r=n?n.valueOf:void 0;function i(s){return r?Object(r.call(s)):{}}return p2=i,p2}var g2,VA;function vse(){if(VA)return g2;VA=1;var e=gO(),n=gse(),r=yse(),i=mse(),s=_j(),o="[object Boolean]",a="[object Date]",l="[object Map]",u="[object Number]",h="[object RegExp]",p="[object Set]",g="[object String]",v="[object Symbol]",w="[object ArrayBuffer]",S="[object DataView]",E="[object Float32Array]",x="[object Float64Array]",I="[object Int8Array]",P="[object Int16Array]",M="[object Int32Array]",k="[object Uint8Array]",A="[object Uint8ClampedArray]",j="[object Uint16Array]",V="[object Uint32Array]";function $(W,B,H){var Y=W.constructor;switch(B){case w:return e(W);case o:case a:return new Y(+W);case S:return n(W,H);case E:case x:case I:case P:case M:case k:case A:case j:case V:return s(W,H);case l:return new Y;case u:case g:return new Y(W);case h:return r(W);case p:return new Y;case v:return i(W)}}return g2=$,g2}var y2,BA;function bse(){if(BA)return y2;BA=1;var e=i0(),n=Po(),r="[object Map]";function i(s){return n(s)&&e(s)==r}return y2=i,y2}var m2,HA;function wse(){if(HA)return m2;HA=1;var e=bse(),n=Zw(),r=bO(),i=r&&r.isMap,s=i?n(i):e;return m2=s,m2}var v2,UA;function _se(){if(UA)return v2;UA=1;var e=i0(),n=Po(),r="[object Set]";function i(s){return n(s)&&e(s)==r}return v2=i,v2}var b2,KA;function zj(){if(KA)return b2;KA=1;var e=_se(),n=Zw(),r=bO(),i=r&&r.isSet,s=i?n(i):e;return b2=s,b2}var w2,WA;function Vj(){if(WA)return w2;WA=1;var e=fO(),n=Pj(),r=Jw(),i=ose(),s=ase(),o=bj(),a=Cj(),l=cse(),u=use(),h=jj(),p=Fj(),g=i0(),v=pse(),w=vse(),S=xj(),E=Es(),x=n0(),I=wse(),P=Js(),M=zj(),k=Ng(),A=r0(),j=1,V=2,$=4,W="[object Arguments]",B="[object Array]",H="[object Boolean]",Y="[object Date]",te="[object Error]",ue="[object Function]",ye="[object GeneratorFunction]",Ne="[object Map]",q="[object Number]",G="[object Object]",ae="[object RegExp]",ge="[object Set]",X="[object String]",ee="[object Symbol]",ie="[object WeakMap]",we="[object ArrayBuffer]",Se="[object DataView]",J="[object Float32Array]",Re="[object Float64Array]",be="[object Int8Array]",Oe="[object Int16Array]",Ee="[object Int32Array]",Le="[object Uint8Array]",tt="[object Uint8ClampedArray]",Pt="[object Uint16Array]",_t="[object Uint32Array]",Ge={};Ge[W]=Ge[B]=Ge[we]=Ge[Se]=Ge[H]=Ge[Y]=Ge[J]=Ge[Re]=Ge[be]=Ge[Oe]=Ge[Ee]=Ge[Ne]=Ge[q]=Ge[G]=Ge[ae]=Ge[ge]=Ge[X]=Ge[ee]=Ge[Le]=Ge[tt]=Ge[Pt]=Ge[_t]=!0,Ge[te]=Ge[ue]=Ge[ie]=!1;function Ft(Ke,zt,kn,yt,St,Bt){var Nt,lt=zt&j,It=zt&V,ci=zt&$;if(kn&&(Nt=St?kn(Ke,yt,St,Bt):kn(Ke)),Nt!==void 0)return Nt;if(!P(Ke))return Ke;var dn=E(Ke);if(dn){if(Nt=v(Ke),!lt)return a(Ke,Nt)}else{var At=g(Ke),mr=At==ue||At==ye;if(x(Ke))return o(Ke,lt);if(At==G||At==W||mr&&!St){if(Nt=It||mr?{}:S(Ke),!lt)return It?u(Ke,s(Nt,Ke)):l(Ke,i(Nt,Ke))}else{if(!Ge[At])return St?Ke:{};Nt=w(Ke,At,lt)}}Bt||(Bt=new e);var Er=Bt.get(Ke);if(Er)return Er;Bt.set(Ke,Nt),M(Ke)?Ke.forEach(function(fe){Nt.add(Ft(fe,zt,kn,fe,Ke,Bt))}):I(Ke)&&Ke.forEach(function(fe,_e){Nt.set(_e,Ft(fe,zt,kn,_e,Ke,Bt))});var Mn=ci?It?p:h:It?A:k,ce=dn?void 0:Mn(Ke);return n(ce||Ke,function(fe,_e){ce&&(_e=fe,fe=Ke[_e]),r(Nt,_e,Ft(fe,zt,kn,_e,Ke,Bt))}),Nt}return w2=Ft,w2}var _2,qA;function Cse(){if(qA)return _2;qA=1;function e(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}return _2=e,_2}var C2,GA;function Ese(){if(GA)return C2;GA=1;function e(n,r,i){var s=-1,o=n.length;r<0&&(r=-r>o?0:o+r),i=i>o?o:i,i<0&&(i+=o),o=r>i?0:i-r>>>0,r>>>=0;for(var a=Array(o);++s<o;)a[s]=n[s+r];return a}return C2=e,C2}var E2,YA;function xse(){if(YA)return E2;YA=1;var e=hO(),n=Ese();function r(i,s){return s.length<2?i:e(i,n(s,0,-1))}return E2=r,E2}var x2,XA;function Sse(){if(XA)return x2;XA=1;var e=Dg(),n=Cse(),r=xse(),i=Gw();function s(o,a){return a=e(a,o),o=r(o,a),o==null||delete o[i(n(a))]}return x2=s,x2}var S2,ZA;function Dse(){if(ZA)return S2;ZA=1;var e=vO();function n(r){return e(r)?void 0:r}return S2=n,S2}var D2,QA;function Nse(){if(QA)return D2;QA=1;var e=Sg(),n=t0(),r=Es(),i=e?e.isConcatSpreadable:void 0;function s(o){return r(o)||n(o)||!!(i&&o&&o[i])}return D2=s,D2}var N2,JA;function Bj(){if(JA)return N2;JA=1;var e=_O(),n=Nse();function r(i,s,o,a,l){var u=-1,h=i.length;for(o||(o=n),l||(l=[]);++u<h;){var p=i[u];s>0&&o(p)?s>1?r(p,s-1,o,a,l):e(l,p):a||(l[l.length]=p)}return l}return N2=r,N2}var I2,eR;function Ise(){if(eR)return I2;eR=1;var e=Bj();function n(r){var i=r==null?0:r.length;return i?e(r,1):[]}return I2=n,I2}var O2,tR;function Hj(){if(tR)return O2;tR=1;var e=Ise(),n=Ij(),r=Oj();function i(s){return r(n(s,void 0,e),s+"")}return O2=i,O2}var T2,nR;function Ose(){if(nR)return T2;nR=1;var e=qw(),n=Vj(),r=Sse(),i=Dg(),s=Gh(),o=Dse(),a=Hj(),l=Fj(),u=1,h=2,p=4,g=a(function(v,w){var S={};if(v==null)return S;var E=!1;w=e(w,function(I){return I=i(I,v),E||(E=I.length>1),I}),s(v,l(v),S),E&&(S=n(S,u|h|p,o));for(var x=w.length;x--;)r(S,w[x]);return S});return T2=g,T2}var Tse=Ose();const s0=cn(Tse);var M2,rR;function Mse(){if(rR)return M2;rR=1;function e(n){return n===void 0}return M2=e,M2}var Pse=Mse();const kr=cn(Pse);var P2,iR;function Ase(){if(iR)return P2;iR=1;var e="__lodash_hash_undefined__";function n(r){return this.__data__.set(r,e),this}return P2=n,P2}var A2,sR;function Rse(){if(sR)return A2;sR=1;function e(n){return this.__data__.has(n)}return A2=e,A2}var R2,oR;function CO(){if(oR)return R2;oR=1;var e=dO(),n=Ase(),r=Rse();function i(s){var o=-1,a=s==null?0:s.length;for(this.__data__=new e;++o<a;)this.add(s[o])}return i.prototype.add=i.prototype.push=n,i.prototype.has=r,R2=i,R2}var k2,aR;function kse(){if(aR)return k2;aR=1;function e(n,r){for(var i=-1,s=n==null?0:n.length;++i<s;)if(r(n[i],i,n))return!0;return!1}return k2=e,k2}var L2,lR;function EO(){if(lR)return L2;lR=1;function e(n,r){return n.has(r)}return L2=e,L2}var j2,cR;function Uj(){if(cR)return j2;cR=1;var e=CO(),n=kse(),r=EO(),i=1,s=2;function o(a,l,u,h,p,g){var v=u&i,w=a.length,S=l.length;if(w!=S&&!(v&&S>w))return!1;var E=g.get(a),x=g.get(l);if(E&&x)return E==l&&x==a;var I=-1,P=!0,M=u&s?new e:void 0;for(g.set(a,l),g.set(l,a);++I<w;){var k=a[I],A=l[I];if(h)var j=v?h(A,k,I,l,a,g):h(k,A,I,a,l,g);if(j!==void 0){if(j)continue;P=!1;break}if(M){if(!n(l,function(V,$){if(!r(M,$)&&(k===V||p(k,V,u,h,g)))return M.push($)})){P=!1;break}}else if(!(k===A||p(k,A,u,h,g))){P=!1;break}}return g.delete(a),g.delete(l),P}return j2=o,j2}var F2,uR;function Lse(){if(uR)return F2;uR=1;function e(n){var r=-1,i=Array(n.size);return n.forEach(function(s,o){i[++r]=[o,s]}),i}return F2=e,F2}var $2,dR;function xO(){if(dR)return $2;dR=1;function e(n){var r=-1,i=Array(n.size);return n.forEach(function(s){i[++r]=s}),i}return $2=e,$2}var z2,hR;function jse(){if(hR)return z2;hR=1;var e=Sg(),n=wj(),r=Jv(),i=Uj(),s=Lse(),o=xO(),a=1,l=2,u="[object Boolean]",h="[object Date]",p="[object Error]",g="[object Map]",v="[object Number]",w="[object RegExp]",S="[object Set]",E="[object String]",x="[object Symbol]",I="[object ArrayBuffer]",P="[object DataView]",M=e?e.prototype:void 0,k=M?M.valueOf:void 0;function A(j,V,$,W,B,H,Y){switch($){case P:if(j.byteLength!=V.byteLength||j.byteOffset!=V.byteOffset)return!1;j=j.buffer,V=V.buffer;case I:return!(j.byteLength!=V.byteLength||!H(new n(j),new n(V)));case u:case h:case v:return r(+j,+V);case p:return j.name==V.name&&j.message==V.message;case w:case E:return j==V+"";case g:var te=s;case S:var ue=W&a;if(te||(te=o),j.size!=V.size&&!ue)return!1;var ye=Y.get(j);if(ye)return ye==V;W|=l,Y.set(j,V);var Ne=i(te(j),te(V),W,B,H,Y);return Y.delete(j),Ne;case x:if(k)return k.call(j)==k.call(V)}return!1}return z2=A,z2}var V2,fR;function Fse(){if(fR)return V2;fR=1;var e=jj(),n=1,r=Object.prototype,i=r.hasOwnProperty;function s(o,a,l,u,h,p){var g=l&n,v=e(o),w=v.length,S=e(a),E=S.length;if(w!=E&&!g)return!1;for(var x=w;x--;){var I=v[x];if(!(g?I in a:i.call(a,I)))return!1}var P=p.get(o),M=p.get(a);if(P&&M)return P==a&&M==o;var k=!0;p.set(o,a),p.set(a,o);for(var A=g;++x<w;){I=v[x];var j=o[I],V=a[I];if(u)var $=g?u(V,j,I,a,o,p):u(j,V,I,o,a,p);if(!($===void 0?j===V||h(j,V,l,u,p):$)){k=!1;break}A||(A=I=="constructor")}if(k&&!A){var W=o.constructor,B=a.constructor;W!=B&&"constructor"in o&&"constructor"in a&&!(typeof W=="function"&&W instanceof W&&typeof B=="function"&&B instanceof B)&&(k=!1)}return p.delete(o),p.delete(a),k}return V2=s,V2}var B2,pR;function $se(){if(pR)return B2;pR=1;var e=fO(),n=Uj(),r=jse(),i=Fse(),s=i0(),o=Es(),a=n0(),l=Qw(),u=1,h="[object Arguments]",p="[object Array]",g="[object Object]",v=Object.prototype,w=v.hasOwnProperty;function S(E,x,I,P,M,k){var A=o(E),j=o(x),V=A?p:s(E),$=j?p:s(x);V=V==h?g:V,$=$==h?g:$;var W=V==g,B=$==g,H=V==$;if(H&&a(E)){if(!a(x))return!1;A=!0,W=!1}if(H&&!W)return k||(k=new e),A||l(E)?n(E,x,I,P,M,k):r(E,x,V,I,P,M,k);if(!(I&u)){var Y=W&&w.call(E,"__wrapped__"),te=B&&w.call(x,"__wrapped__");if(Y||te){var ue=Y?E.value():E,ye=te?x.value():x;return k||(k=new e),M(ue,ye,I,P,k)}}return H?(k||(k=new e),i(E,x,I,P,M,k)):!1}return B2=S,B2}var H2,gR;function zse(){if(gR)return H2;gR=1;var e=$se(),n=Po();function r(i,s,o,a,l){return i===s?!0:i==null||s==null||!n(i)&&!n(s)?i!==i&&s!==s:e(i,s,o,a,r,l)}return H2=r,H2}var U2,yR;function Vse(){if(yR)return U2;yR=1;var e=zse();function n(r,i){return e(r,i)}return U2=n,U2}var Bse=Vse();const Qs=cn(Bse);var K2,mR;function Hse(){if(mR)return K2;mR=1;var e=Aj(),n=i0(),r=t0(),i=Es(),s=od(),o=n0(),a=e0(),l=Qw(),u="[object Map]",h="[object Set]",p=Object.prototype,g=p.hasOwnProperty;function v(w){if(w==null)return!0;if(s(w)&&(i(w)||typeof w=="string"||typeof w.splice=="function"||o(w)||l(w)||r(w)))return!w.length;var S=n(w);if(S==u||S==h)return!w.size;if(a(w))return!e(w).length;for(var E in w)if(g.call(w,E))return!1;return!0}return K2=v,K2}var Use=Hse();const $n=cn(Use);var W2,vR;function Kse(){if(vR)return W2;vR=1;var e=vj(),n=Ng();function r(i,s){return i&&e(i,s,n)}return W2=r,W2}var q2,bR;function Wse(){if(bR)return q2;bR=1;var e=od();function n(r,i){return function(s,o){if(s==null)return s;if(!e(s))return r(s,o);for(var a=s.length,l=i?a:-1,u=Object(s);(i?l--:++l<a)&&o(u[l],l,u)!==!1;);return s}}return q2=n,q2}var G2,wR;function qse(){if(wR)return G2;wR=1;var e=Kse(),n=Wse(),r=n(e);return G2=r,G2}var Y2,_R;function Gse(){if(_R)return Y2;_R=1;var e=t_();function n(r){return typeof r=="function"?r:e}return Y2=n,Y2}var X2,CR;function Yse(){if(CR)return X2;CR=1;var e=Pj(),n=qse(),r=Gse(),i=Es();function s(o,a){var l=i(o)?e:n;return l(o,r(a))}return X2=s,X2}var Z2,ER;function Xse(){return ER||(ER=1,Z2=Yse()),Z2}var Zse=Xse();const Qse=cn(Zse);function Lu(e,n){e&&console.warn(`Warning: ${n}`)}function SO(e){return e==null}class Jse{constructor(){this._eventMap=new Map}on(n,r){return n&&typeof r=="function"&&(this._eventMap.has(n)||this._eventMap.set(n,[]),this._eventMap.get(n).push(r)),this}once(n,r){var i=this;if(n&&typeof r=="function"){const s=function(){r(...arguments),i.off(n,s)};this.on(n,s)}}off(n,r){if(n)if(typeof r=="function"){const i=this._eventMap.get(n);if(Array.isArray(i)&&i.length){let s=-1;for(;(s=i.findIndex(o=>o===r))>-1;)i.splice(s,1)}}else SO(r)&&this._eventMap.delete(n);return this}emit(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return this._eventMap.has(n)?([...this._eventMap.get(n)].forEach(a=>a(...i)),!0):!1}}function $m(e){try{return e instanceof HTMLElement}catch{return typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}}function eoe(e){if(e&&typeof e=="object")return typeof e.toJSON=="function"?e.toJSON():["left","top","right","bottom","width","height"].reduce((r,i)=>(r[i]=e[i],r),{})}function qu(e){e.stopPropagation(),e.preventDefault()}function toe(e){return e.length===1&&e.match(/\S/)}function o0(e,n){for(let r=0;r<e.length;r++)e[r]===n?(e[r].tabIndex=0,e[r].focus()):e[r].tabIndex=-1}function noe(e){e.length>0&&o0(e,e[0])}function roe(e){e.length>0&&o0(e,e[e.length-1])}function ioe(e,n){let r,i;e.length>0&&(n===e[0]?r=e[e.length-1]:(i=e.indexOf(n),r=e[i-1]),o0(e,r))}function soe(e,n){let r,i;e.length>0&&(n===e[e.length-1]?r=e[0]:(i=e.indexOf(n),r=e[i+1]),o0(e,r))}function ooe(e,n,r,i){let s,o;return!e||!r||!i||i.length>1?-1:(i=i.toLowerCase(),s=e.indexOf(n)+1,s>=e.length&&(s=0),o=r.indexOf(i,s),o===-1&&(o=r.indexOf(i,0)),o>=0?o:-1)}function aoe(e,n){if(!e)return null;for(;e.parentElement&&ot(e.parentElement,"attributes.role.value","")!==n;)e=e.parentElement;return e.parentElement}function loe(e,n){for(let r=0;r<e.length;r++){const i=e[r].attributes["data-popupid"];if(i&&i.value===n)return e[r]}return null}const cb={TOP:/top/i,RIGHT:/right/i,BOTTOM:/bottom/i,LEFT:/left/i},Dp={left:0,top:0,height:0,width:0,scrollLeft:0,scrollTop:0};let coe=class extends li{constructor(n){var r;super(Object.assign({},n)),r=this,this.removePortal=()=>{this._adapter.removePortal()},this.setDisplayNone=(i,s)=>{this._adapter.setDisplayNone(i,s)},this.updateStateIfCursorOnTrigger=i=>{var s,o;if(!((s=i==null?void 0:i.matches)===null||s===void 0)&&s.call(i,":hover")){const a=this._adapter.getEventName(),l=this.getState("triggerEventSet");(o=l[a.mouseEnter])===null||o===void 0||o.call(l)}},this.onResize=()=>{this.getState("visible")&&this.calcPosition()},this.delayShow=()=>{const i=this.getProp("mouseEnterDelay");this.clearDelayTimer(),i>0?this._timer=setTimeout(()=>{this.show(),this.clearDelayTimer()},i):this.show()},this.show=()=>{if(this._adapter.getAnimatingState())return;const i=this.getProp("content"),s=this.getProp("trigger"),o=this.getProp("clickTriggerToHide"),{visible:a,displayNone:l}=this.getStates();if(l&&this.setDisplayNone(!1),!a){if(this.clearDelayTimer(),this._adapter.on("portalInserted",()=>{this.calcPosition()}),s==="hover"){const u=()=>{var h;const p=this._adapter.getTriggerDOM();s&&!(!((h=p==null?void 0:p.matches)===null||h===void 0)&&h.call(p,":hover"))&&this.hide(),this._adapter.off("portalInserted",u)};this._adapter.on("portalInserted",u)}this._adapter.on("positionUpdated",()=>{this._togglePortalVisible(!0)}),this._adapter.insertPortal(i,{left:-9999,top:-9999}),s==="custom"&&this._adapter.registerClickOutsideHandler(()=>{}),(s==="click"||o||s==="contextMenu")&&this._adapter.registerClickOutsideHandler(this.hide),this._bindScrollEvent(),this._bindResizeEvent()}},this.calcPosition=function(i,s,o){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;i=($n(i)?r._adapter.getTriggerBounding():i)||Object.assign({},Dp),o=($n(o)?r._adapter.getPopupContainerRect():o)||Object.assign({},Dp),s=($n(s)?r._adapter.getWrapperBounding():s)||Object.assign({},Dp);let l=r.calcPosStyle({triggerRect:i,wrapperRect:s,containerRect:o}),u=r.getProp("position");if(r.getProp("autoAdjustOverflow")){const{position:h,isHeightOverFlow:p,isWidthOverFlow:g}=r.adjustPosIfNeed(u,l,i,s,o);(u!==h||p||g)&&(u=h,l=r.calcPosStyle({triggerRect:i,wrapperRect:s,containerRect:o,position:u,spacing:null,isOverFlow:[p,g]}))}return a&&r._mounted&&r._adapter.setPosition(Object.assign(Object.assign({},l),{position:u})),l},this.delayHide=()=>{const i=this.getProp("mouseLeaveDelay");this.clearDelayTimer(),i>0?this._timer=setTimeout(()=>{this.hide(),this.clearDelayTimer()},i):this.hide()},this.hide=()=>{this.clearDelayTimer(),this._togglePortalVisible(!1),this._adapter.off("portalInserted"),this._adapter.off("positionUpdated")},this.handleContainerKeydown=i=>{const{guardFocus:s,closeOnEsc:o}=this.getProps();switch(i&&i.key){case"Escape":o&&this._handleEscKeyDown(i);break;case"Tab":if(s){const a=this._adapter.getContainer(),l=this._adapter.getFocusableElements(a);l.length&&(i.shiftKey?this._handleContainerShiftTabKeyDown(l,i):this._handleContainerTabKeyDown(l,i))}break}},this._timer=null}init(){const{wrapperId:n}=this.getProps();this._mounted=!0,this._bindEvent(),this._shouldShow(),this._initContainerPosition(),n||this._adapter.setId()}destroy(){this._mounted=!1,this.unBindEvent()}_bindEvent(){const n=this.getProp("trigger"),{triggerEventSet:r,portalEventSet:i}=this._generateEvent(n);this._bindTriggerEvent(r),this._bindPortalEvent(i),this._bindResizeEvent()}unBindEvent(){this._adapter.unregisterClickOutsideHandler(),this.unBindResizeEvent(),this.unBindScrollEvent(),clearTimeout(this._timer)}_bindTriggerEvent(n){this._adapter.registerTriggerEvent(n)}_bindPortalEvent(n){this._adapter.registerPortalEvent(n)}_bindResizeEvent(){this._adapter.registerResizeHandler(this.onResize)}unBindResizeEvent(){this._adapter.unregisterResizeHandler(this.onResize)}_adjustPos(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"reverse",s=arguments.length>3?arguments[3]:void 0;switch(i){case"reverse":return this._reversePos(n,r);case"expand":return this._expandPos(n,s);case"reduce":return this._reducePos(n);default:return this._reversePos(n,r)}}_reversePos(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1){if(cb.TOP.test(n))return n.replace("top","bottom").replace("Top","Bottom");if(cb.BOTTOM.test(n))return n.replace("bottom","top").replace("Bottom","Top")}else{if(cb.LEFT.test(n))return n.replace("left","right").replace("Left","Right");if(cb.RIGHT.test(n))return n.replace("right","left").replace("Right","Left")}return n}_expandPos(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;return n.concat(r)}_reducePos(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const r=["Top","Bottom","Left","Right"].find(i=>n.endsWith(i));return r?n.replace(r,""):n}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}_generateEvent(n){const r=this._adapter.getEventName(),i={[r.keydown]:o=>{this._handleTriggerKeydown(o)}};let s={};switch(n){case"focus":i[r.focus]=()=>{this.delayShow()},i[r.blur]=()=>{this.delayHide()},s=i;break;case"click":i[r.click]=()=>{this.show()},s={};break;case"hover":i[r.mouseEnter]=()=>{this.setCache("isClickToHide",!1),this.delayShow()},i[r.mouseLeave]=()=>{this.delayHide()},i[r.focus]=()=>{const{disableFocusListener:o}=this.getProps();!o&&this.delayShow()},i[r.blur]=()=>{const{disableFocusListener:o}=this.getProps();!o&&this.delayHide()},s=Object.assign({},i),this.getProp("clickToHide")&&(s[r.click]=()=>{this.setCache("isClickToHide",!0),this.hide()},s[r.mouseEnter]=()=>{this.getCache("isClickToHide")||this.delayShow()});break;case"custom":break;case"contextMenu":i[r.contextMenu]=o=>{o.preventDefault(),this.show()};break}return{triggerEventSet:i,portalEventSet:s}}_shouldShow(){this.getProp("visible")&&this.show()}_togglePortalVisible(n){const r=this.getState("visible"),i=this.getState("isInsert");(r!==n||i!==n)&&this._adapter.togglePortalVisible(n,()=>{n&&this._adapter.setInitialFocus(),this._adapter.notifyVisibleChange(n)})}_roundPixel(n){return typeof n=="number"?Math.round(n):n}calcTransformOrigin(n,r,i,s){if(n&&r&&i!=null&&s!=null){if(this.getProp("transformFromCenter")){if(["topLeft","bottomLeft"].includes(n))return`${this._roundPixel(r.width/2)}px ${-s*100}%`;if(["topRight","bottomRight"].includes(n))return`calc(100% - ${this._roundPixel(r.width/2)}px) ${-s*100}%`;if(["leftTop","rightTop"].includes(n))return`${-i*100}% ${this._roundPixel(r.height/2)}px`;if(["leftBottom","rightBottom"].includes(n))return`${-i*100}% calc(100% - ${this._roundPixel(r.height/2)}px)`}return`${-i*100}% ${-s*100}%`}return null}calcPosStyle(n){var r;const{spacing:i,isOverFlow:s}=n,{innerWidth:o}=window,a=($n(n.triggerRect)?n.triggerRect:this._adapter.getTriggerBounding())||Object.assign({},Dp),l=($n(n.containerRect)?n.containerRect:this._adapter.getPopupContainerRect())||Object.assign({},Dp),u=($n(n.wrapperRect)?n.wrapperRect:this._adapter.getWrapperBounding())||Object.assign({},Dp),h=n.position!=null?n.position:this.getProp("position"),p=i??this.getProp("spacing"),{arrowPointAtCenter:g,showArrow:v,arrowBounding:w}=this.getProps(),S=v&&g;let E=p,x=0;if(typeof p!="number"){const Oe=h.includes("top")||h.includes("bottom");E=Oe?p.y:p.x,x=Oe?p.x:p.y}const I=ot(w,"width",24),P=ot(w,"width",24),M=ot(w,"offsetY",0),k=6,A=6;let j,V,$=0,W=0;const B=a.left+a.width/2,H=a.top+a.height/2,Y=k+I/2,te=A+P/2,ue=u.height-l.height,ye=u.width-l.width,Ne=ue>0?ue:0,q=ye>0?ye:0,G=s&&s[0],ae=s&&s[1],ge=B-l.left<l.right-B,X=H-l.top<l.bottom-H,ee=u.width>o,ie=Math.abs((u==null?void 0:u.width)-((r=this._adapter.getContainer())===null||r===void 0?void 0:r.clientWidth))>1;switch(ie&&(E=E*u.width/this._adapter.getContainer().clientWidth),h){case"top":j=ae?ge?l.left+u.width/2:l.right-u.width/2+q:B+x,V=G?l.bottom+Ne:a.top-E,$=-.5,W=-1;break;case"topLeft":j=ae?ee?l.left:l.right-u.width:S?B-Y+x:a.left+x,V=G?l.bottom+Ne:a.top-E,W=-1;break;case"topRight":j=ae?l.right+q:S?B+Y+x:a.right+x,V=G?l.bottom+Ne:a.top-E,W=-1,$=-1;break;case"left":j=ae?l.right+q-E+Y:a.left-E,V=G?X?l.top+u.height/2:l.bottom-u.height/2+Ne:H+x,$=-1,W=-.5;break;case"leftTop":j=ae?l.right+q-E+Y:a.left-E,V=G?l.top:S?H-te+x:a.top+x,$=-1;break;case"leftBottom":j=ae?l.right+q-E+Y:a.left-E,V=G?l.bottom+Ne:S?H+te+x:a.bottom+x,$=-1,W=-1;break;case"bottom":j=ae?ge?l.left+u.width/2:l.right-u.width/2+q:B+x,V=G?l.top+te-E:a.top+a.height+E,$=-.5;break;case"bottomLeft":j=ae?ee?l.left:l.right-u.width:S?B-Y+x:a.left+x,V=G?l.top+te-E:a.top+a.height+E;break;case"bottomRight":j=ae?l.right+q:S?B+Y+x:a.right+x,V=G?l.top+te-E:a.top+a.height+E,$=-1;break;case"right":j=ae?l.left-E+Y:a.right+E,V=G?X?l.top+u.height/2:l.bottom-u.height/2+Ne:H+x,W=-.5;break;case"rightTop":j=ae?l.left-E+Y:a.right+E,V=G?l.top:S?H-te+x:a.top+x;break;case"rightBottom":j=ae?l.left-E+Y:a.right+E,V=G?l.bottom+Ne:S?H+te+x:a.bottom+x,W=-1;break;case"leftTopOver":j=a.left-E,V=a.top-E;break;case"rightTopOver":j=a.right+E,V=a.top-E,$=-1;break;case"leftBottomOver":j=a.left-E,V=a.bottom+E,W=-1;break;case"rightBottomOver":j=a.right+E,V=a.bottom+E,$=-1,W=-1;break}const we=this.calcTransformOrigin(h,a,$,W),Se=this._adapter.containerIsBody();if(j=j-l.left,V=V-l.top,ie&&(j/=u.width/this._adapter.getContainer().clientWidth),ie&&(V/=u.height/this._adapter.getContainer().clientHeight),Se&&!this._adapter.containerIsRelativeOrAbsolute()){const Oe=this._adapter.getDocumentElementBounding();j+=l.left-Oe.left,V+=l.top-Oe.top}j=Se?j:j+l.scrollLeft,V=Se?V:V+l.scrollTop;const J=a.height;if(this.getProp("showArrow")&&!g&&J<=(P/2+M)*2){const Oe=J/2-(M+P/2);(h.includes("Top")||h.includes("Bottom"))&&!h.includes("Over")&&(V=h.includes("Top")?V+Oe:V-Oe)}const Re={left:this._roundPixel(j),top:this._roundPixel(V)};let be="";return $!=null&&(be+=`translateX(${$*100}%) `,Object.defineProperty(Re,"translateX",{enumerable:!1,value:$})),W!=null&&(be+=`translateY(${W*100}%) `,Object.defineProperty(Re,"translateY",{enumerable:!1,value:W})),we!=null&&(Re.transformOrigin=we),be&&(Re.transform=be),Re}isLR(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n.includes("left")||n.includes("right")}isTB(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n.includes("top")||n.includes("bottom")}isReverse(n,r,i){return n<i&&r>i}isOverFlow(n,r,i){return n<i&&r<i}isHalfOverFlow(n,r,i){return n<i||r<i}isHalfAllEnough(n,r,i){return n>=i||r>=i}getReverse(n,r,i,s){return n&&s||i}adjustPosIfNeed(n,r,i,s,o){const{innerWidth:a,innerHeight:l}=window,{margin:u}=this.getProps(),h=typeof u=="number"?u:u.marginLeft,p=typeof u=="number"?u:u.marginTop,g=typeof u=="number"?u:u.marginRight,v=typeof u=="number"?u:u.marginBottom;let w=!1,S=!1;const E=this.getProp("spacing");let x=E,I=0;if(typeof E!="number"){const P=n.includes("top")||n.includes("bottom");x=P?E.y:E.x,I=P?E.x:E.y}if(s.width>0&&s.height>0){const P=i.left,M=i.right,k=i.top,A=i.bottom,j=a-P,V=l-k,$=a-M,W=l-A,B=s.width>i.width,H=s.height>i.height,Y=k-p<s.height+x&&W-v>s.height+x,te=P-h<s.width+x&&$-g>s.width+x,ue=W-v<s.height+x&&k-p>s.height+x,ye=$-g<s.width+x&&P-h>s.width+x;V-v<s.height+x&&A-p>s.height+x,A-p<s.height+x&&V-v>s.height+x;const Ne=V<s.height+I&&A>s.height+I,q=A<s.height+I&&V>s.height+I,G=j<s.width+I&&M>s.width+I,ae=M<s.width+I&&j>s.width+I,ge=V<s.height+x&&A>s.height+x,X=A<s.height+x&&V>s.height+x,ee=j<s.width&&M>s.width,ie=M<s.width&&j>s.width,we=k-o.top,Se=P-o.left,J=we+i.height,Re=Se+i.width,be=o.bottom-A,Oe=o.right-M,Ee=be+i.height,Le=Oe+i.width,tt=this.isReverse(we-p,be-v,s.height+x),Pt=this.isReverse(Se-h,Oe-g,s.width+x),_t=this.isReverse(be-v,we-p,s.height+x),Ge=this.isReverse(Oe-g,Se-h,s.width+x);this.isReverse(Ee-v,J-p,s.height+x),this.isReverse(J-p,Ee-v,s.height+x);const Ft=this.isReverse(Ee,J,s.height+I),Ke=this.isReverse(J,Ee,s.height+I),zt=this.isReverse(Le,Re,s.width+I),kn=this.isReverse(Re,Le,s.width+I),yt=i.height/2,St=i.width/2,Bt=this.isOverFlow(k-p,W-v,s.height+x),Nt=this.isOverFlow(P-h,$-g,s.width+x),lt=this.isOverFlow(A-p,V-v,s.height+x),It=this.isOverFlow(M-h,j-g,s.width+x),ci=this.isHalfOverFlow(A-yt,V-yt,(s.height+I)/2),dn=this.isHalfOverFlow(M-St,j-St,(s.width+I)/2),At=this.isHalfAllEnough(A-yt,V-yt,(s.height+I)/2),mr=this.isHalfAllEnough(M-St,j-St,(s.width+I)/2),Er=this.isOverFlow(we-p,be-v,s.height+x),Mn=this.isOverFlow(Se-h,Oe-g,s.width+x),ce=this.isOverFlow(J-p,Ee-v,s.height+x),fe=this.isOverFlow(Re-h,Le-g,s.width+x),_e=this.isHalfOverFlow(J-yt,Ee-yt,(s.height+I)/2),ze=this.isHalfOverFlow(Re-St,Le-St,(s.width+I)/2),it=this.isHalfAllEnough(J-yt,Ee-yt,(s.height+I)/2),Gt=this.isHalfAllEnough(Re-St,Le-St,(s.width+I)/2),hn=this.getReverse(Bt,Er,Y,tt),wt=this.getReverse(Nt,Mn,te,Pt),He=this.getReverse(Bt,Er,ue,_t),We=this.getReverse(Nt,Mn,ye,Ge),ke=this.getReverse(lt,ce,Ne,Ft),Be=this.getReverse(lt,ce,q,Ke),ct=this.getReverse(It,fe,G,zt),Dt=this.getReverse(It,fe,ae,kn),Mt=ci&&_e,Jt=dn&&ze;switch(n){case"top":hn&&(n=this._adjustPos(n,!0)),Jt&&(ct||Dt)&&(n=this._adjustPos(n,!0,"expand",ct?"Right":"Left"));break;case"topLeft":hn&&(n=this._adjustPos(n,!0)),ct&&B&&(n=this._adjustPos(n)),S&&(mr||Gt)&&(n=this._adjustPos(n,!0,"reduce"));break;case"topRight":hn&&(n=this._adjustPos(n,!0)),Dt&&B&&(n=this._adjustPos(n)),S&&(mr||Gt)&&(n=this._adjustPos(n,!0,"reduce"));break;case"left":wt&&(n=this._adjustPos(n)),Mt&&(ke||Be)&&(n=this._adjustPos(n,!1,"expand",ke?"Bottom":"Top"));break;case"leftTop":wt&&(n=this._adjustPos(n)),ke&&H&&(n=this._adjustPos(n,!0)),w&&(At||it)&&(n=this._adjustPos(n,!1,"reduce"));break;case"leftBottom":wt&&(n=this._adjustPos(n)),Be&&H&&(n=this._adjustPos(n,!0)),w&&(At||it)&&(n=this._adjustPos(n,!1,"reduce"));break;case"bottom":He&&(n=this._adjustPos(n,!0)),Jt&&(ct||Dt)&&(n=this._adjustPos(n,!0,"expand",ct?"Right":"Left"));break;case"bottomLeft":He&&(n=this._adjustPos(n,!0)),ct&&B&&(n=this._adjustPos(n)),S&&(mr||Gt)&&(n=this._adjustPos(n,!0,"reduce"));break;case"bottomRight":He&&(n=this._adjustPos(n,!0)),Dt&&B&&(n=this._adjustPos(n)),S&&(mr||Gt)&&(n=this._adjustPos(n,!0,"reduce"));break;case"right":We&&(n=this._adjustPos(n)),Mt&&(ke||Be)&&(n=this._adjustPos(n,!1,"expand",ke?"Bottom":"Top"));break;case"rightTop":We&&(n=this._adjustPos(n)),ke&&H&&(n=this._adjustPos(n,!0)),w&&(At||it)&&(n=this._adjustPos(n,!1,"reduce"));break;case"rightBottom":We&&(n=this._adjustPos(n)),Be&&H&&(n=this._adjustPos(n,!0)),w&&(At||it)&&(n=this._adjustPos(n,!1,"reduce"));break;case"leftTopOver":ge&&(n=this._adjustPos(n,!0)),ee&&(n=this._adjustPos(n));break;case"leftBottomOver":X&&(n=this._adjustPos(n,!0)),ee&&(n=this._adjustPos(n));break;case"rightTopOver":ge&&(n=this._adjustPos(n,!0)),ie&&(n=this._adjustPos(n));break;case"rightBottomOver":X&&(n=this._adjustPos(n,!0)),ie&&(n=this._adjustPos(n));break}this.isTB(n)&&(w=Bt&&Er,n==="top"||n==="bottom"?S=dn&&ze||M<0||$<0:S=It&&fe||M<0||$<0),this.isLR(n)&&(S=Nt&&Mn,n==="left"||n==="right"?w=ci&&_e||k<0||V<0:w=lt&&ce||k<0||V<0)}return{position:n,isHeightOverFlow:w,isWidthOverFlow:S}}_bindScrollEvent(){this._adapter.registerScrollHandler(()=>this.calcPosition())}unBindScrollEvent(){this._adapter.unregisterScrollHandler()}_initContainerPosition(){this._adapter.updateContainerPosition()}_handleTriggerKeydown(n){const{closeOnEsc:r,disableArrowKeyDown:i}=this.getProps(),s=this._adapter.getContainer(),o=this._adapter.getFocusableElements(s),a=o.length;switch(n&&n.key){case"Escape":qu(n),r&&this._handleEscKeyDown(n);break;case"ArrowUp":!i&&a&&this._handleTriggerArrowUpKeydown(o,n);break;case"ArrowDown":!i&&a&&this._handleTriggerArrowDownKeydown(o,n);break}}focusTrigger(){const{trigger:n,returnFocusOnClose:r,preventScroll:i}=this.getProps();if(r&&n!=="custom"){const s=this._adapter.getTriggerNode();s&&"focus"in s&&s.focus({preventScroll:i})}}_handleEscKeyDown(n){const{trigger:r}=this.getProps();r!=="custom"&&(this.focusTrigger(),this.hide()),this._adapter.notifyEscKeydown(n)}_handleContainerTabKeyDown(n,r){const{preventScroll:i}=this.getProps(),s=this._adapter.getActiveElement();n[n.length-1]===s&&(n[0].focus({preventScroll:i}),r.preventDefault())}_handleContainerShiftTabKeyDown(n,r){const{preventScroll:i}=this.getProps(),s=this._adapter.getActiveElement();n[0]===s&&(n[n.length-1].focus({preventScroll:i}),r.preventDefault())}_handleTriggerArrowDownKeydown(n,r){const{preventScroll:i}=this.getProps();n[0].focus({preventScroll:i}),r.preventDefault()}_handleTriggerArrowUpKeydown(n,r){const{preventScroll:i}=this.getProps();n[n.length-1].focus({preventScroll:i}),r.preventDefault()}};const uoe={PREFIX:`${Dn}-tooltip`},zp={POSITION_SET:["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver","leftBottomOver","rightBottomOver"],TRIGGER_SET:["hover","focus","click","custom","contextMenu"],STATUS_DISABLED:"disabled",STATUS_LOADING:"loading"},bu={ARROW_BOUNDING:{offsetX:0,offsetY:2,width:24,height:7},DEFAULT_Z_INDEX:1060,MOUSE_ENTER_DELAY:50,MOUSE_LEAVE_DELAY:50,SPACING:8,MARGIN:0};function zN(e){return`${e}-${new Date().getTime()}-${Math.random()}`}function sw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefix:n="",length:r=7}=e,i="0123456789abcdefghijklmnopqrstuvwxyz",s=i.length;let o="";for(let a=0;a<r;a++){const l=Math.floor(Math.random()*s);o+=i.charAt(l)}return n?`${n}-${o}`:o}var Q2,xR;function Kj(){if(xR)return Q2;xR=1;var e=Jw(),n=Dg(),r=e_(),i=Js(),s=Gw();function o(a,l,u,h){if(!i(a))return a;l=n(l,a);for(var p=-1,g=l.length,v=g-1,w=a;w!=null&&++p<g;){var S=s(l[p]),E=u;if(S==="__proto__"||S==="constructor"||S==="prototype")return a;if(p!=v){var x=w[S];E=h?h(x,S,w):void 0,E===void 0&&(E=i(x)?x:r(l[p+1])?[]:{})}e(w,S,E),w=w[S]}return a}return Q2=o,Q2}var J2,SR;function doe(){if(SR)return J2;SR=1;var e=Kj();function n(r,i,s){return r==null?r:e(r,i,s)}return J2=n,J2}var hoe=doe();const foe=cn(hoe);var eD,DR;function poe(){if(DR)return eD;DR=1;var e=Vj(),n=1,r=4;function i(s,o){return o=typeof o=="function"?o:void 0,e(s,n|r,o)}return eD=i,eD}var goe=poe();const yoe=cn(goe);class moe{constructor(){this.config={}}}const tD=new moe;var NR=function(e,n,r,i){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(p){try{h(i.next(p))}catch(g){a(g)}}function u(p){try{h(i.throw(p))}catch(g){a(g)}}function h(p){p.done?o(p.value):s(p.value).then(l,u)}h((i=i.apply(e,n||[])).next())})};function ub(e,n){e&&typeof e.stopPropagation=="function"&&e.stopPropagation(),e.nativeEvent&&typeof e.nativeEvent.stopImmediatePropagation=="function"&&e.nativeEvent.stopImmediatePropagation()}const Hs=e=>D.isValidElement(e)&&ot(e.type,"elementType")==="Icon";function voe(){return document?document.activeElement:null}function boe(e){if(!$m(e))return[];const r=["input:not([disabled]):not([tabindex='-1'])","textarea:not([disabled]):not([tabindex='-1'])","button:not([disabled]):not([tabindex='-1'])","a[href]:not([tabindex='-1'])","select:not([disabled]):not([tabindex='-1'])","area[href]:not([tabindex='-1'])","iframe:not([tabindex='-1'])","object:not([tabindex='-1'])","*[tabindex]:not([tabindex='-1'])","*[contenteditable]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(r))}function DO(e,n){return NR(this,void 0,void 0,function*(){if(n===0){yield e();return}else{yield new Promise(r=>{setTimeout(()=>NR(this,void 0,void 0,function*(){yield DO(e,n-1),r()}),0)});return}})}function woe(){return globalThis&&Object.prototype.toString.call(globalThis)==="[object Window]"?window.innerWidth-document.documentElement.clientWidth:0}function Dc(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=()=>{var i,s;return((s=(i=tD==null?void 0:tD.config)===null||i===void 0?void 0:i.overrideDefaultProps)===null||s===void 0?void 0:s[e])||{}};return new Proxy(Object.assign({},n),{get(i,s,o){const a=r();return s in a?a[s]:Reflect.get(i,s,o)},set(i,s,o,a){return Reflect.set(i,s,o,a)},ownKeys(){const i=r();return Array.from(new Set([...Reflect.ownKeys(n),...Object.keys(i)]))},getOwnPropertyDescriptor(i,s){const o=r();return s in o?Reflect.getOwnPropertyDescriptor(o,s):Reflect.getOwnPropertyDescriptor(i,s)}})}const Ao=D.createContext({}),_oe=()=>document.body;class a0 extends R.PureComponent{constructor(n,r){var i;super(n),i=this,this.initContainer=function(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var a,l;try{let u;if(!i.el||!(!((a=i.state)===null||a===void 0)&&a.container)||!Array.from(i.state.container.childNodes).includes(i.el)){i.el=document.createElement("div");const p=(i.props.getPopupContainer||s.getPopupContainer||_oe)();return p.appendChild(i.el),i.addStyle(i.props.style),i.addClass(i.props.prefixCls,s,i.props.className),u=p,u}}catch(u){if(!o)throw u}return(l=i.state)===null||l===void 0?void 0:l.container},this.addStyle=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(i.el)for(const o of Object.keys(s))i.el.style[o]=s[o]},this.addClass=function(s){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i.context;const{direction:a}=o;for(var l=arguments.length,u=new Array(l>2?l-2:0),h=2;h<l;h++)u[h-2]=arguments[h];const p=xe(s,...u,{[`${s}-rtl`]:a==="rtl"});i.el&&(i.el.className=p)},this.state={container:this.initContainer(r,!0)}}componentDidMount(){const n=this.initContainer(this.context);n!==this.state.container&&this.setState({container:n})}componentDidUpdate(n){const{didUpdate:r}=this.props;r&&r(n)}componentWillUnmount(){const{container:n}=this.state;n&&n.removeChild(this.el)}render(){const{state:n,props:r}=this;return n.container?Ya.createPortal(r.children,this.el):null}}a0.contextType=Ao;a0.defaultProps={prefixCls:`${Dn}-portal`};a0.propTypes={children:C.node,prefixCls:C.string,getPopupContainer:C.func,className:C.string,didUpdate:C.func};var Coe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Eoe=e=>{const{className:n,style:r}=e,i=Coe(e,["className","style"]);return D.createElement("svg",Object.assign({"aria-hidden":!0,className:n,style:r},i,{width:"24",height:"7",viewBox:"0 0 24 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}),D.createElement("path",{d:"M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5 4C5.5 2 4 1 0 1V0H24Z"}))};var xoe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Soe=e=>{const{className:n,style:r}=e,i=xoe(e,["className","style"]);return D.createElement("svg",Object.assign({"aria-hidden":!0,className:n,style:r},i,{width:"7",height:"24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"}),D.createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z"}))},Doe=C.shape({offsetX:C.number,offsetY:C.number,width:C.number,height:C.number});class Ev extends D.Component{constructor(n){super(n),this.handleAnimationStart=()=>{var r,i;(i=(r=this.props).onAnimationStart)===null||i===void 0||i.call(r)},this.handleAnimationEnd=()=>{this.setState({currentClassName:this.props.endClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!1},()=>{var r,i;(i=(r=this.props).onAnimationEnd)===null||i===void 0||i.call(r,!1)})},this.state={currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0}}componentDidMount(){var n,r,i,s;(r=(n=this.props).onAnimationStart)===null||r===void 0||r.call(n),this.props.motion||((s=(i=this.props).onAnimationEnd)===null||s===void 0||s.call(i,!1),this.setState({isAnimating:!1}))}componentDidUpdate(n,r,i){const s=Object.keys(this.props).filter(o=>!Qs(this.props[o],n[o]));s.includes("animationState"),(s.includes("startClassName")||s.includes("replayKey")||s.includes("motion"))&&this.setState({currentClassName:this.props.startClassName,extraStyle:{animationFillMode:this.props.fillMode},isAnimating:!0},()=>{var o,a,l,u;(a=(o=this.props).onAnimationStart)===null||a===void 0||a.call(o),this.props.motion||((u=(l=this.props).onAnimationEnd)===null||u===void 0||u.call(l,this.state.isAnimating),this.setState({isAnimating:!1}))})}render(){var n;return this.props.motion?this.props.children({animationClassName:(n=this.state.currentClassName)!==null&&n!==void 0?n:"",animationStyle:this.state.extraStyle,animationEventsNeedBind:{onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},isAnimating:this.state.isAnimating}):this.props.children({animationClassName:"",animationStyle:{},animationEventsNeedBind:{},isAnimating:this.state.isAnimating})}}Ev.defaultProps={motion:!0,replayKey:""};var IR=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const _b=uoe.PREFIX,Noe=zp.POSITION_SET,Ioe=zp.TRIGGER_SET,Ooe=["flex","block","table","flow-root","grid"],Toe=()=>document.body;class Rn extends jr{constructor(n){super(n),this.isAnimating=!1,this.setContainerEl=r=>this.containerEl={current:r},this.isSpecial=r=>{if($m(r))return!!r.disabled;if(R.isValidElement(r)){if(ot(r,"props.disabled"))return zp.STATUS_DISABLED;const s=ot(r,"props.loading"),o=!$n(r)&&!$n(r.type)&&(ot(r,"type.elementType")==="Button"||ot(r,"type.elementType")==="IconButton");if(s&&o)return zp.STATUS_LOADING}return!1},this.didLeave=()=>{this.props.keepDOM?this.foundation.setDisplayNone(!0):this.foundation.removePortal(),this.foundation.unBindEvent()},this.renderIcon=()=>{const{placement:r}=this.state,{showArrow:i,prefixCls:s,style:o}=this.props;let a=null;const l=xe([`${s}-icon-arrow`]),u=ot(o,"backgroundColor"),h=r!=null&&r.includes("left")||r!=null&&r.includes("right")?D.createElement(Soe,null):D.createElement(Eoe,null);return i&&(R.isValidElement(i)?a=i:a=D.cloneElement(h,{className:l,style:{color:u,fill:"currentColor"}})),a},this.handlePortalInnerClick=r=>{this.props.clickToHide&&this.foundation.hide(),this.props.stopPropagation&&ub(r)},this.handlePortalMouseDown=r=>{this.props.stopPropagation&&ub(r)},this.handlePortalFocus=r=>{this.props.stopPropagation&&ub(r)},this.handlePortalBlur=r=>{this.props.stopPropagation&&ub(r)},this.handlePortalInnerKeyDown=r=>{this.foundation.handleContainerKeydown(r)},this.renderContentNode=r=>{const i={initialFocusRef:this.initialFocusRef};return sr(r)?r(i):r},this.renderPortal=()=>{const{containerStyle:r={},visible:i,portalEventSet:s,placement:o,displayNone:a,transitionState:l,id:u,isPositionUpdated:h}=this.state,{prefixCls:p,content:g,showArrow:v,style:w,motion:S,role:E,zIndex:x}=this.props,I=this.renderContentNode(g),{className:P}=this.props,M=this.context.direction,k=xe(P,{[`${p}-wrapper`]:!0,[`${p}-wrapper-show`]:i,[`${p}-with-arrow`]:!!v,[`${p}-rtl`]:M==="rtl"}),A=this.renderIcon(),j=s0(r,S?["transformOrigin"]:void 0),V=ot(r,"transformOrigin"),$=ot(w,"opacity",null),W=$||1,B=D.createElement(Ev,{fillMode:"forwards",animationState:l,motion:S&&h,startClassName:l==="enter"?`${_b}-animation-show`:`${_b}-animation-hide`,onAnimationStart:()=>this.isAnimating=!0,onAnimationEnd:()=>{var H,Y;l==="leave"&&(this.didLeave(),(Y=(H=this.props).afterClose)===null||Y===void 0||Y.call(H)),this.isAnimating=!1}},H=>{let{animationStyle:Y,animationClassName:te,animationEventsNeedBind:ue}=H;return D.createElement("div",Object.assign({className:xe(k,te),style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Y),a?{display:"none"}:{}),{transformOrigin:V}),w),$?{opacity:h?W:"0"}:{})},s,ue,{role:E,"x-placement":o,id:u}),D.createElement("div",{className:`${_b}-content`},I),A)});return D.createElement(a0,{getPopupContainer:this.props.getPopupContainer,style:{zIndex:x}},D.createElement("div",{tabIndex:-1,className:`${Dn}-portal-inner`,style:j,ref:this.setContainerEl,onClick:this.handlePortalInnerClick,onFocus:this.handlePortalFocus,onBlur:this.handlePortalBlur,onMouseDown:this.handlePortalMouseDown,onKeyDown:this.handlePortalInnerKeyDown},B))},this.wrapSpan=r=>{const{wrapperClassName:i}=this.props,s=ot(r,"props.style.display"),o=ot(r,"props.block"),a=typeof r=="string",l={};return a||(l.display="inline-block"),(o||Ooe.includes(s))&&(l.width="100%"),D.createElement("span",{className:i,style:l},r)},this.mergeEvents=(r,i)=>{const s={};return Qse(i,(o,a)=>{typeof o=="function"&&(s[a]=function(){o(...arguments),r&&typeof r[a]=="function"&&r[a](...arguments)})}),s},this.getPopupId=()=>this.state.id,this.state={visible:!1,transitionState:"",triggerEventSet:{},portalEventSet:{},containerStyle:{},isInsert:!1,placement:n.position||"top",transitionStyle:{},isPositionUpdated:!1,id:n.wrapperId,displayNone:!1},this.foundation=new coe(this.adapter),this.eventManager=new Jse,this.triggerEl=D.createRef(),this.containerEl=D.createRef(),this.initialFocusRef=D.createRef(),this.clickOutsideHandler=null,this.resizeHandler=null,this.isWrapped=!1,this.containerPosition=void 0}get adapter(){var n=this;return Object.assign(Object.assign({},super.adapter),{on:function(){return n.eventManager.on(...arguments)},off:function(){return n.eventManager.off(...arguments)},getAnimatingState:()=>this.isAnimating,insertPortal:(r,i)=>{var{position:s}=i,o=IR(i,["position"]);this.setState({isInsert:!0,transitionState:"enter",containerStyle:Object.assign(Object.assign({},this.state.containerStyle),o)},()=>{setTimeout(()=>{this.setState(a=>(a.transitionState==="enter"&&this.eventManager.emit("portalInserted"),{}))},0)})},removePortal:()=>{this.setState({isInsert:!1,isPositionUpdated:!1})},getEventName:()=>({mouseEnter:"onMouseEnter",mouseLeave:"onMouseLeave",mouseOut:"onMouseOut",mouseOver:"onMouseOver",click:"onClick",focus:"onFocus",blur:"onBlur",keydown:"onKeyDown",contextMenu:"onContextMenu"}),registerTriggerEvent:r=>{this.setState({triggerEventSet:r})},registerPortalEvent:r=>{this.setState({portalEventSet:r})},getTriggerBounding:()=>{const r=this.adapter.getTriggerNode();return this.triggerEl.current=r,r&&r.getBoundingClientRect()},getPopupContainerRect:()=>{const r=this.getPopupContainer();let i=null;if(r&&$m(r)){const s=eoe(r.getBoundingClientRect());i=Object.assign(Object.assign({},s),{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop})}return i},containerIsBody:()=>this.getPopupContainer()===document.body,containerIsRelative:()=>{const r=this.getPopupContainer();return window.getComputedStyle(r).getPropertyValue("position")==="relative"},containerIsRelativeOrAbsolute:()=>["relative","absolute"].includes(this.containerPosition),getWrapperBounding:()=>{const r=this.containerEl&&this.containerEl.current;return r&&r.getBoundingClientRect()},getDocumentElementBounding:()=>document.documentElement.getBoundingClientRect(),setPosition:r=>{var{position:i}=r,s=IR(r,["position"]);this.setState({containerStyle:Object.assign(Object.assign({},this.state.containerStyle),s),placement:i,isPositionUpdated:!0},()=>{this.eventManager.emit("positionUpdated")})},setDisplayNone:(r,i)=>{this.setState({displayNone:r},i)},updatePlacementAttr:r=>{this.setState({placement:r})},togglePortalVisible:(r,i)=>{const s={};s.transitionState=r?"enter":"leave",s.visible=r,this.mounted&&this.setState(s,()=>{i()})},registerClickOutsideHandler:r=>{this.clickOutsideHandler&&this.adapter.unregisterClickOutsideHandler(),this.clickOutsideHandler=i=>{if(!this.mounted)return!1;let s=this.triggerEl&&this.triggerEl.current,o=this.containerEl&&this.containerEl.current;s=Ks.findDOMNode(s),o=Ks.findDOMNode(o);const a=i.target,l=i.composedPath&&i.composedPath()||[a],u=this.props.clickTriggerToHide?s&&s.contains(a)||l.includes(s):!1;(s&&!s.contains(a)&&o&&!o.contains(a)&&!(l.includes(o)||l.includes(s))||u)&&(this.props.onClickOutSide(i),r())},window.addEventListener("mousedown",this.clickOutsideHandler)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(window.removeEventListener("mousedown",this.clickOutsideHandler),this.clickOutsideHandler=null)},registerResizeHandler:r=>{this.resizeHandler&&this.adapter.unregisterResizeHandler(),this.resizeHandler=a4(i=>{if(!this.mounted)return!1;r(i)},10),window.addEventListener("resize",this.resizeHandler,!1)},unregisterResizeHandler:()=>{this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler,!1),this.resizeHandler=null)},notifyVisibleChange:r=>{this.props.onVisibleChange(r)},registerScrollHandler:r=>{this.scrollHandler&&this.adapter.unregisterScrollHandler(),this.scrollHandler=a4(i=>{if(!this.mounted)return!1;const s=this.adapter.getTriggerNode();if(i.target.contains(s)){const a={x:i.target.scrollLeft,y:i.target.scrollTop};r(a)}},10),window.addEventListener("scroll",this.scrollHandler,!0)},unregisterScrollHandler:()=>{this.scrollHandler&&(window.removeEventListener("scroll",this.scrollHandler,!0),this.scrollHandler=null)},canMotion:()=>!!this.props.motion,updateContainerPosition:()=>{const r=this.getPopupContainer();if(r&&$m(r)){const s=window.getComputedStyle(r).getPropertyValue("position");this.containerPosition=s}},getContainerPosition:()=>this.containerPosition,getContainer:()=>this.containerEl&&this.containerEl.current,getTriggerNode:()=>{let r=this.triggerEl.current;return $m(this.triggerEl.current)||(r=Ks.findDOMNode(this.triggerEl.current)),r},getFocusableElements:r=>boe(r),getActiveElement:()=>voe(),setInitialFocus:()=>{const{preventScroll:r}=this.props,i=ot(this,"initialFocusRef.current");i&&"focus"in i&&i.focus({preventScroll:r})},notifyEscKeydown:r=>{this.props.onEscKeyDown(r)},setId:()=>{this.setState({id:sw()})},getTriggerDOM:()=>this.triggerEl.current?Ks.findDOMNode(this.triggerEl.current):null})}componentDidMount(){this.mounted=!0,this.getPopupContainer=this.props.getPopupContainer||this.context.getPopupContainer||Toe,this.foundation.init(),DO(()=>{let n=this.triggerEl.current;n&&(n instanceof HTMLElement||(n=Ya.findDOMNode(n))),this.foundation.updateStateIfCursorOnTrigger(n)},1)}componentWillUnmount(){this.mounted=!1,this.foundation.destroy()}focusTrigger(){this.foundation.focusTrigger()}rePosition(){return this.foundation.calcPosition()}componentDidUpdate(n,r){Lu(this.props.mouseLeaveDelay<this.props.mouseEnterDelay,"[Semi Tooltip] 'mouseLeaveDelay' cannot be less than 'mouseEnterDelay', which may cause the dropdown layer to not be hidden."),n.visible!==this.props.visible&&(["hover","focus"].includes(this.props.trigger)?this.props.visible?this.foundation.delayShow():this.foundation.delayHide():this.props.visible?this.foundation.show():this.foundation.hide()),Qs(n.rePosKey,this.props.rePosKey)||this.rePosition()}render(){const{isInsert:n,triggerEventSet:r,visible:i,id:s}=this.state,{wrapWhenSpecial:o,role:a,trigger:l}=this.props;let{children:u}=this.props;const h=Object.assign({},ot(u,"props.style")),p={};if(o){const w=this.isSpecial(u);w?(h.pointerEvents="none",w===zp.STATUS_DISABLED&&(p.cursor="not-allowed"),u=R.cloneElement(u,{style:h}),l!=="custom"&&(u=this.wrapSpan(u)),this.isWrapped=!0):R.isValidElement(u)||(u=this.wrapSpan(u),this.isWrapped=!0)}let g={};a==="dialog"?(g["aria-expanded"]=i?"true":"false",g["aria-haspopup"]="dialog",g["aria-controls"]=s):g["aria-describedby"]=s;const v=D.cloneElement(u,Object.assign(Object.assign(Object.assign(Object.assign({},g),u.props),this.mergeEvents(u.props,r)),{style:Object.assign(Object.assign({},ot(u,"props.style")),p),className:xe(ot(u,"props.className")),ref:w=>{this.triggerEl.current=w;const{ref:S}=u;typeof S=="function"?S(w):S&&typeof S=="object"&&(S.current=w)},tabIndex:u.props.tabIndex||0,"data-popupid":s}));return D.createElement(D.Fragment,null,n?this.renderPortal():null,v)}}Rn.contextType=Ao;Rn.propTypes={children:C.node,motion:C.bool,autoAdjustOverflow:C.bool,position:C.oneOf(Noe),getPopupContainer:C.func,mouseEnterDelay:C.number,mouseLeaveDelay:C.number,trigger:C.oneOf(Ioe).isRequired,className:C.string,wrapperClassName:C.string,clickToHide:C.bool,clickTriggerToHide:C.bool,visible:C.bool,style:C.object,content:C.oneOfType([C.node,C.func]),prefixCls:C.string,onVisibleChange:C.func,onClickOutSide:C.func,spacing:C.oneOfType([C.number,C.object]),margin:C.oneOfType([C.number,C.object]),showArrow:C.oneOfType([C.bool,C.node]),zIndex:C.number,rePosKey:C.oneOfType([C.string,C.number]),arrowBounding:Doe,transformFromCenter:C.bool,arrowPointAtCenter:C.bool,stopPropagation:C.bool,role:C.string,wrapWhenSpecial:C.bool,guardFocus:C.bool,returnFocusOnClose:C.bool,preventScroll:C.bool,keepDOM:C.bool};Rn.__SemiComponentName__="Tooltip";Rn.defaultProps=Dc(Rn.__SemiComponentName__,{arrowBounding:bu.ARROW_BOUNDING,autoAdjustOverflow:!0,arrowPointAtCenter:!0,trigger:"hover",transformFromCenter:!0,position:"top",prefixCls:_b,role:"tooltip",mouseEnterDelay:bu.MOUSE_ENTER_DELAY,mouseLeaveDelay:bu.MOUSE_LEAVE_DELAY,motion:!0,onVisibleChange:rt,onClickOutSide:rt,spacing:bu.SPACING,margin:bu.MARGIN,showArrow:!0,wrapWhenSpecial:!0,zIndex:bu.DEFAULT_Z_INDEX,closeOnEsc:!1,guardFocus:!1,returnFocusOnClose:!1,onEscKeyDown:rt,disableFocusListener:!1,disableArrowKeyDown:!1,keepDOM:!1});var db={exports:{}},OR;function Moe(){if(OR)return db.exports;OR=1;const e=(n,{target:r=document.body}={})=>{const i=document.createElement("textarea"),s=document.activeElement;i.value=n,i.setAttribute("readonly",""),i.style.contain="strict",i.style.position="absolute",i.style.left="-9999px",i.style.fontSize="12pt";const o=document.getSelection();let a=!1;o.rangeCount>0&&(a=o.getRangeAt(0)),r.append(i),i.select(),i.selectionStart=0,i.selectionEnd=n.length;let l=!1;try{l=document.execCommand("copy")}catch{}return i.remove(),a&&(o.removeAllRanges(),o.addRange(a)),s&&s.focus(),l};return db.exports=e,db.exports.default=e,db.exports}var Poe=Moe();const Aoe=cn(Poe);function cc(){}const Roe=D.createContext(null);function nD(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.width?String(n.width):e.defaultWidth,i=e.formats[r]||e.formats[e.defaultWidth];return i}}function _m(e){return function(n,r){var i=r!=null&&r.context?String(r.context):"standalone",s;if(i==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{var l=e.defaultWidth,u=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[u]||e.values[l]}var h=e.argumentCallback?e.argumentCallback(n):n;return s[h]}}function Cm(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=n.match(s);if(!o)return null;var a=o[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Loe(l,function(g){return g.test(a)}):koe(l,function(g){return g.test(a)}),h;h=e.valueCallback?e.valueCallback(u):u,h=r.valueCallback?r.valueCallback(h):h;var p=n.slice(a.length);return{value:h,rest:p}}}function koe(e,n){for(var r in e)if(e.hasOwnProperty(r)&&n(e[r]))return r}function Loe(e,n){for(var r=0;r<e.length;r++)if(n(e[r]))return r}function joe(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.match(e.matchPattern);if(!i)return null;var s=i[0],o=n.match(e.parsePattern);if(!o)return null;var a=e.valueCallback?e.valueCallback(o[0]):o[0];a=r.valueCallback?r.valueCallback(a):a;var l=n.slice(s.length);return{value:a,rest:l}}}function VN(e){"@babel/helpers - typeof";return VN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},VN(e)}function Foe(e){if(e===null||e===!0||e===!1)return NaN;var n=Number(e);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function NO(e,n){if(n.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+n.length+" present")}function $oe(e){NO(1,arguments);var n=Object.prototype.toString.call(e);return e instanceof Date||VN(e)==="object"&&n==="[object Date]"?new Date(e.getTime()):typeof e=="number"||n==="[object Number]"?new Date(e):((typeof e=="string"||n==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var zoe={};function Voe(){return zoe}function TR(e,n){var r,i,s,o,a,l,u,h;NO(1,arguments);var p=Voe(),g=Foe((r=(i=(s=(o=n==null?void 0:n.weekStartsOn)!==null&&o!==void 0?o:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&s!==void 0?s:p.weekStartsOn)!==null&&i!==void 0?i:(u=p.locale)===null||u===void 0||(h=u.options)===null||h===void 0?void 0:h.weekStartsOn)!==null&&r!==void 0?r:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=$oe(e),w=v.getUTCDay(),S=(w<g?7:0)+w-g;return v.setUTCDate(v.getUTCDate()-S),v.setUTCHours(0,0,0,0),v}function MR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BN(e,n){return BN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},BN(e,n)}function Boe(e,n,r){NO(2,arguments);var i=TR(e,r),s=TR(n,r);return i.getTime()===s.getTime()}var Hoe={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},Uoe=function(n,r,i){var s,o=Hoe[n];return typeof o=="string"?s=o:r===1?s=o.one:s=o.other.replace("{{count}}",String(r)),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?s+"内":s+"前":s},Koe={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},Woe={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},qoe={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Goe={date:nD({formats:Koe,defaultWidth:"full"}),time:nD({formats:Woe,defaultWidth:"full"}),dateTime:nD({formats:qoe,defaultWidth:"full"})};function PR(e,n,r){var i="eeee p";return Boe(e,n,r)?i:e.getTime()>n.getTime()?"'下个'"+i:"'上个'"+i}var Yoe={lastWeek:PR,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:PR,other:"PP p"},Xoe=function(n,r,i,s){var o=Yoe[n];return typeof o=="function"?o(r,i,s):o},Zoe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Qoe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Joe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},eae={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},tae={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},nae={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},rae=function(n,r){var i=Number(n);switch(r==null?void 0:r.unit){case"date":return i.toString()+"日";case"hour":return i.toString()+"时";case"minute":return i.toString()+"分";case"second":return i.toString()+"秒";default:return"第 "+i.toString()}},iae={ordinalNumber:rae,era:_m({values:Zoe,defaultWidth:"wide"}),quarter:_m({values:Qoe,defaultWidth:"wide",argumentCallback:function(n){return n-1}}),month:_m({values:Joe,defaultWidth:"wide"}),day:_m({values:eae,defaultWidth:"wide"}),dayPeriod:_m({values:tae,defaultWidth:"wide",formattingValues:nae,defaultFormattingWidth:"wide"})},sae=/^(第\s*)?\d+(日|时|分|秒)?/i,oae=/\d+/i,aae={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},lae={any:[/^(前)/i,/^(公元)/i]},cae={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},uae={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},dae={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},hae={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},fae={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},pae={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},gae={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},yae={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},mae={ordinalNumber:joe({matchPattern:sae,parsePattern:oae,valueCallback:function(n){return parseInt(n,10)}}),era:Cm({matchPatterns:aae,defaultMatchWidth:"wide",parsePatterns:lae,defaultParseWidth:"any"}),quarter:Cm({matchPatterns:cae,defaultMatchWidth:"wide",parsePatterns:uae,defaultParseWidth:"any",valueCallback:function(n){return n+1}}),month:Cm({matchPatterns:dae,defaultMatchWidth:"wide",parsePatterns:hae,defaultParseWidth:"any"}),day:Cm({matchPatterns:fae,defaultMatchWidth:"wide",parsePatterns:pae,defaultParseWidth:"any"}),dayPeriod:Cm({matchPatterns:gae,defaultMatchWidth:"any",parsePatterns:yae,defaultParseWidth:"any"})},vae={code:"zh-CN",formatDistance:Uoe,formatLong:Goe,formatRelative:Xoe,localize:iae,match:mae,options:{weekStartsOn:1,firstWeekContainsDate:4}};const HN={code:"zh-CN",currency:"CNY",dateFnsLocale:vae,Pagination:{pageSize:"每页条数:${pageSize}",total:"总页数:${total}",jumpTo:"跳至",page:"页"},Modal:{confirm:"确定",cancel:"取消"},Tabs:{more:"更多"},TimePicker:{placeholder:{time:"请选择时间",timeRange:"请选择时间范围"},begin:"开始时间",end:"结束时间",hour:"时",minute:"分",second:"秒",AM:"上午",PM:"下午"},DatePicker:{placeholder:{date:"请选择日期",dateTime:"请选择日期及时间",dateRange:["开始日期","结束日期"],dateTimeRange:["开始日期","结束日期"],monthRange:["开始月份","结束月份"]},presets:"快捷选择",footer:{confirm:"确定",cancel:"取消"},selectDate:"返回选择日期",selectTime:"选择时间",year:"年",month:"月",day:"日",monthText:"${year}年 ${month}",months:{1:"1月",2:"2月",3:"3月",4:"4月",5:"5月",6:"6月",7:"7月",8:"8月",9:"9月",10:"10月",11:"11月",12:"12月"},fullMonths:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},weeks:{Mon:"一",Tue:"二",Wed:"三",Thu:"四",Fri:"五",Sat:"六",Sun:"日"},localeFormatToken:{FORMAT_SWITCH_DATE:"yyyy-MM-dd"}},Navigation:{collapseText:"收起侧边栏",expandText:"展开侧边栏"},Popconfirm:{confirm:"确定",cancel:"取消"},Table:{emptyText:"暂无数据",pageText:"显示第 ${currentStart} 条-第 ${currentEnd} 条,共 ${total} 条",descend:"点击降序",ascend:"点击升序",cancelSort:"取消排序"},Select:{emptyText:"暂无数据",createText:"创建"},Cascader:{emptyText:"暂无数据"},Tree:{emptyText:"暂无数据",searchPlaceholder:"搜索"},List:{emptyText:"暂无数据"},Calendar:{allDay:"全天",AM:"上午${time}时",PM:"下午${time}时",datestring:"日",remaining:"还有${remained}项"},Upload:{mainText:"点击上传文件或拖拽文件到这里",illegalTips:"不支持此类型文件",legalTips:"松手开始上传",retry:"重试",replace:"替换文件",clear:"清空",selectedFiles:"已选择文件",illegalSize:"文件尺寸不合法",fail:"上传失败"},TreeSelect:{searchPlaceholder:"搜索"},Typography:{copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Transfer:{emptyLeft:"暂无数据",emptySearch:"无搜索结果",emptyRight:"暂无内容,可从左侧勾选",placeholder:"搜索",clear:"清空",selectAll:"全选",clearSelectAll:"取消全选",total:"总个数:${total}",selected:"已选个数:${total}"},Form:{optional:"(可选)"},Image:{preview:"预览",loading:"加载中",loadError:"加载失败",prevTip:"上一张",nextTip:"下一张",zoomInTip:"放大",zoomOutTip:"缩小",rotateTip:"旋转",downloadTip:"下载",adaptiveTip:"适应页面",originTip:"原始尺寸"},Chat:{deleteConfirm:"确认删除该会话吗?",clearContext:"上下文已清除",copySuccess:"复制成功",stop:"停止",copy:"复制",copied:"复制成功",dropAreaText:"将文件放到这里"},UserGuide:{skip:"跳过",next:"下一步",prev:"上一步",finish:"完成"},InputNumber:{},JsonViewer:{search:"查找",replace:"替换",replaceAll:"全部替换"}};class Gu extends R.Component{renderChildren(n,r){const{componentName:i}=this.props;let s=n;n!=null&&n.code||(s=HN);const o=ot(HN,"dateFnsLocale"),a=ot(s,"dateFnsLocale",o),l=ot(s,"currency");return r(s[i],s.code,a,l)}render(){const{children:n}=this.props;return D.createElement(Ao.Consumer,null,r=>{let{locale:i}=r;return D.createElement(Roe.Consumer,null,s=>this.renderChildren(i||s,n))})}}Gu.propTypes={componentName:C.string.isRequired,children:C.any};Gu.defaultProps={componentName:""};const bae="semi";var wae=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Us=D.forwardRef((e,n)=>{const{svg:r,spin:i=!1,rotate:s,style:o,className:a,prefixCls:l=bae,type:u,size:h="default"}=e,p=wae(e,["svg","spin","rotate","style","className","prefixCls","type","size"]),g=xe(`${l}-icon`,{[`${l}-icon-extra-small`]:h==="extra-small",[`${l}-icon-small`]:h==="small",[`${l}-icon-default`]:h==="default",[`${l}-icon-large`]:h==="large",[`${l}-icon-extra-large`]:h==="extra-large",[`${l}-icon-spinning`]:i===!0,[`${l}-icon-${u}`]:!!u},a),v={};return Number.isSafeInteger(s)&&(v.transform=`rotate(${s}deg)`),Object.assign(v,o),D.createElement("span",Object.assign({role:"img",ref:n,"aria-label":u,className:g,style:v},p),r)});Us.elementType="Icon";const un=(e,n)=>{const r=D.forwardRef((i,s)=>D.createElement(Us,Object.assign({svg:D.createElement(e),type:n,ref:s},i)));return r.elementType="Icon",r};function _ae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",fill:"currentColor"}))}const Cae=un(_ae,"alert_circle");function Eae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}const xae=un(Eae,"alert_triangle");function Sae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const Dae=un(Sae,"checkbox_indeterminate");function Nae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const Iae=un(Nae,"checkbox_tick");function Oae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.08 7.6a1.5 1.5 0 0 1 2.12 0l5.66 5.65 5.66-5.65a1.5 1.5 0 1 1 2.12 2.12l-6.72 6.72a1.5 1.5 0 0 1-2.12 0L4.08 9.72a1.5 1.5 0 0 1 0-2.12Z",fill:"currentColor"}))}const IO=un(Oae,"chevron_down");function Tae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const Wj=un(Tae,"chevron_right");function Mae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.04-6.14a1.5 1.5 0 0 1-2.13.04l-2.87-2.78L9.26 17A1.5 1.5 0 0 1 7.1 14.9l2.78-2.87L7 9.26A1.5 1.5 0 1 1 9.1 7.1l2.87 2.78L14.74 7A1.5 1.5 0 0 1 16.9 9.1l-2.78 2.87L17 14.74c.6.58.61 1.53.04 2.12Z",fill:"currentColor"}))}const n_=un(Mae,"clear");function Pae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M17.66 19.78a1.5 1.5 0 0 0 2.12-2.12L14.12 12l5.66-5.66a1.5 1.5 0 0 0-2.12-2.12L12 9.88 6.34 4.22a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-5.66 5.66a1.5 1.5 0 0 0 2.12 2.12L12 14.12l5.66 5.66Z",fill:"currentColor"}))}const OO=un(Pae,"close");function Aae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M7 4c0-1.1.9-2 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-1V8c0-2-1-3-3-3H7V4Z",fill:"currentColor"}),R.createElement("path",{d:"M5 7a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2H5Z",fill:"currentColor"}))}const qj=un(Aae,"copy");function Rae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-11 9a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM8.11 8.11a1 1 0 0 1 1.42 0L12 10.6l2.47-2.48a1 1 0 1 1 1.42 1.42L13.4 12l2.48 2.47a1 1 0 0 1-1.42 1.42L12 13.4 9.53 15.9a1 1 0 0 1-1.42-1.42L10.6 12 8.1 9.53a1 1 0 0 1 0-1.42Z",fill:"currentColor"}))}const Gj=un(Rae,"cross_circle_stroked");function kae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 5V4h4v1h-4ZM8 5V3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2h4a1 1 0 1 1 0 2h-1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7H4a1 1 0 0 1 0-2h4Zm7 2H7v13h10V7h-2ZM9 9.5c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7Zm4 0c0-.28.22-.5.5-.5h1c.28 0 .5.22.5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7Z",fill:"currentColor"}))}const Lae=un(kae,"delete_stroked");function jae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M10 2a1.5 1.5 0 0 1 0 3H7.12l3.94 3.94a1.5 1.5 0 0 1-2.12 2.12L5 7.12V10a1.5 1.5 0 0 1-3 0V3.5C2 2.67 2.67 2 3.5 2H10Z",fill:"currentColor"}),R.createElement("path",{d:"M19 14a1.5 1.5 0 0 1 3 0v6.5c0 .83-.67 1.5-1.5 1.5H14a1.5 1.5 0 0 1 0-3h2.88l-3.94-3.94a1.5 1.5 0 0 1 2.12-2.12L19 16.88V14Z",fill:"currentColor"}))}const TO=un(jae,"expand");function Fae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.7 3.7a1 1 0 0 0-1.4-1.4L17.3 5.26A11.59 11.59 0 0 0 12 4C5 4 1 10 1 12c0 1.18 1.38 3.73 3.94 5.64L2.3 20.3a1 1 0 1 0 1.42 1.42l18-18ZM7.84 14.77l1.46-1.47a3 3 0 0 1 4-4l1.47-1.46a5 5 0 0 0-6.93 6.93Z",fill:"currentColor"}),R.createElement("path",{d:"M12 20c-1.22 0-2.35-.18-3.38-.5l2.57-2.57a5 5 0 0 0 5.75-5.75l3.56-3.56C22.13 9.27 23 11.07 23 12c0 2-4 8-11 8Z",fill:"currentColor"}))}const $ae=un(Fae,"eye_closed_solid");function zae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C5 4 1 10 1 12s4 8 11 8 11-6 11-8-4-8-11-8Zm5 8a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"currentColor"}))}const Vae=un(zae,"eye_opened");function Bae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V10a1 1 0 0 0-1-1h-5a2 2 0 0 1-2-2V2ZM7 8a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2H8a1 1 0 0 1-1-1Zm0 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm1 4a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm11.07-9.5H14.5a1 1 0 0 1-1-1V1.93a.8.8 0 0 1 1.37-.56l4.76 4.76a.8.8 0 0 1-.56 1.37Z",fill:"currentColor"}))}const Hae=un(Bae,"file");function Uae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M5 2a3 3 0 0 0-3 3v3h20c0-2-1-4-3-4h-6.45a3 3 0 0 1-1.87-.66l-1.13-.9A2 2 0 0 0 8.3 2H5Z",fill:"currentColor"}),R.createElement("path",{d:"M22 10H2v9a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-9Z",fill:"currentColor"}))}const Kae=un(Uae,"folder");function Wae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const qae=un(Wae,"folder_open");function Gae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),R.createElement("path",{d:"M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),R.createElement("path",{d:"M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),R.createElement("path",{d:"M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),R.createElement("path",{d:"M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),R.createElement("path",{d:"M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}))}const Yj=un(Gae,"handle");function Yae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}const Xj=un(Yae,"info_circle");function Xae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a6.5 6.5 0 0 0-6.5 6.5V10H5a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-.5V8.5A6.5 6.5 0 0 0 12 2Zm3.5 8V8.5a3.5 3.5 0 1 0-7 0V10h7Z",fill:"currentColor"}))}const Zae=un(Xae,"lock");function Qae(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M2 12c0-.83.67-1.5 1.5-1.5h17a1.5 1.5 0 0 1 0 3h-17A1.5 1.5 0 0 1 2 12Z",fill:"currentColor"}))}const Jae=un(Qae,"minus");function ele(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M7 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),R.createElement("path",{d:"M14.5 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z",fill:"currentColor"}),R.createElement("path",{d:"M19.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",fill:"currentColor"}))}const tle=un(ele,"more");function nle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M20.5 13.5a1.5 1.5 0 0 0 0-3h-7v-7a1.5 1.5 0 0 0-3 0v7h-7a1.5 1.5 0 0 0 0 3h7v7a1.5 1.5 0 0 0 3 0v-7h7Z",fill:"currentColor"}))}const r_=un(nle,"plus");function rle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.44 2.44a1.5 1.5 0 0 0 0 2.12L16.88 7H9.25C5.16 7 2 10.58 2 14.5S5.16 22 9.25 22h3.25a1.5 1.5 0 0 0 0-3H9.25C6.98 19 5 16.93 5 14.5S6.98 10 9.25 10h7.63l-2.44 2.44a1.5 1.5 0 0 0 2.12 2.12l5-5a1.5 1.5 0 0 0 0-2.12l-5-5a1.5 1.5 0 0 0-2.12 0Z",fill:"currentColor"}))}const ile=un(rle,"redo");function sle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const ole=un(sle,"search");function ale(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M2.44 2.44a1.5 1.5 0 0 0 0 2.12L6.88 9H4a1.5 1.5 0 0 0 0 3h6.5a1.5 1.5 0 0 0 1.5-1.5V4a1.5 1.5 0 0 0-3 0v2.88L4.56 2.44a1.5 1.5 0 0 0-2.12 0Z",fill:"currentColor"}),R.createElement("path",{d:"M20 12a1.5 1.5 0 0 1 0 3h-2.88l4.44 4.44a1.5 1.5 0 1 1-2.12 2.12L15 17.12V20a1.5 1.5 0 1 1-3 0v-6.5a1.5 1.5 0 0 1 1.5-1.5H20Z",fill:"currentColor"}))}const Zj=un(ale,"shrink");function lle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M6.95 7.72h10.13c.4 0 .64.45.42.78l-5.07 7.6a.5.5 0 0 1-.83 0L6.54 8.5a.5.5 0 0 1 .41-.78Z",fill:"currentColor"}))}const cle=un(lle,"small_triangle_down");function ule(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M16.32 6.96v10.13a.5.5 0 0 1-.78.41l-7.6-5.06a.5.5 0 0 1 0-.83l7.6-5.07a.5.5 0 0 1 .78.42Z",fill:"currentColor"}))}const dle=un(ule,"small_triangle_left");function hle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",fill:"currentColor"}))}const ow=un(hle,"tick");function fle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.88-13.18-6.2 7.6a1.5 1.5 0 0 1-2.37 0l-3.5-4a1.5 1.5 0 1 1 2.37-1.84l2.3 2.46L15.5 8a1.5 1.5 0 1 1 2.38 1.82Z",fill:"currentColor"}))}const ple=un(fle,"tick_circle");function gle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const yle=un(gle,"tree_triangle_down");function mle(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.56 2.44a1.5 1.5 0 0 1 0 2.12L7.12 7h7.63C18.84 7 22 10.58 22 14.5S18.84 22 14.75 22H11.5a1.5 1.5 0 0 1 0-3h3.25c2.27 0 4.25-2.07 4.25-4.5S17.02 10 14.75 10H7.12l2.44 2.44a1.5 1.5 0 0 1-2.12 2.12l-5-5a1.5 1.5 0 0 1 0-2.12l5-5a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const vle=un(mle,"undo");function ble(e){return R.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),R.createElement("path",{d:"M5.5 7.5A6.5 6.5 0 0 1 18.48 7h-3.02a3.5 3.5 0 0 0-6.96.5V10H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h.5V7.5Z",fill:"currentColor"}))}const wle=un(ble,"unlock"),UN={BACKSPACE:8,ENTER:13,ESC:27},Qj="Enter",Jj="Escape";function ua(e){return ot(e,"key")===Qj}const rD=Yw.PREFIX;class MO extends D.PureComponent{constructor(n){super(n),this.copy=r=>{const{content:i,duration:s,onCopy:o}=this.props,a=Aoe(i);o&&o(r,i,a),this.setCopied(i,s)},this.setCopied=(r,i)=>{this.setState({copied:!0,item:r}),this._timeId=setTimeout(()=>{this.resetCopied()},i*1e3)},this.resetCopied=()=>{this._timeId&&(clearTimeout(this._timeId),this._timeId=null,this.setState({copied:!1,item:""}))},this.renderSuccessTip=()=>{const{successTip:r}=this.props;return typeof r<"u"?r:D.createElement(Gu,{componentName:"Typography"},i=>D.createElement("span",null,D.createElement(ow,null),i.copied))},this.renderCopyIcon=()=>{const{icon:r}=this.props,i={role:"button",tabIndex:0,onClick:this.copy,onKeyPress:o=>ua(o)&&this.copy(o)},s=D.createElement("a",{className:`${rD}-action-copy-icon`},D.createElement(qj,Object.assign({onClick:this.copy},i)));return D.isValidElement(r)?D.cloneElement(r,i):s},this.state={copied:!1,item:""}}componentWillUnmount(){this._timeId&&(clearTimeout(this._timeId),this._timeId=null)}render(){const{style:n,className:r,forwardRef:i,copyTip:s,render:o}=this.props,{copied:a}=this.state,l=xe(r,{[`${rD}-action-copy`]:!a,[`${rD}-action-copied`]:a});return o?o(a,this.copy,this.props):D.createElement(Gu,{componentName:"Typography"},u=>D.createElement("span",{style:Object.assign({marginLeft:"4px"},n),className:l,ref:i},a?this.renderSuccessTip():D.createElement(Rn,{content:typeof s<"u"?s:u.copy},this.renderCopyIcon())))}}MO.propTypes={content:C.string,onCopy:C.func,successTip:C.node,copyTip:C.node,duration:C.number,style:C.object,className:C.string,icon:C.node};MO.defaultProps={content:"",onCopy:cc,duration:3,style:{},className:""};const eF={PREFIX:`${Dn}-popover`,ARROW:`${Dn}-popover-icon-arrow`},tF={POSITION_SET:["top","topLeft","topRight","left","leftTop","leftBottom","right","rightTop","rightBottom","bottom","bottomLeft","bottomRight","leftTopOver","rightTopOver"],TRIGGER_SET:["hover","focus","click","custom","contextMenu"]},Yu={ARROW_BOUNDING:Object.assign(Object.assign({},bu.ARROW_BOUNDING),{offsetY:6,offsetX:0,height:8}),SPACING:4,SPACING_WITH_ARROW:10,DEFAULT_Z_INDEX:1030};var _le=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const nF=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{position:n="",className:r,arrowStyle:i,popStyle:s}=e,o=_le(e,["position","className","arrowStyle","popStyle"]),a=n.indexOf("top")===0||n.indexOf("bottom")===0,l=xe(r,eF.ARROW),u=ot(i,"borderOpacity"),h=ot(i,"backgroundColor",ot(s,"backgroundColor")),p=ot(i,"borderColor",ot(s,"borderColor")),g=Object.assign(Object.assign({},o),{width:Yu.ARROW_BOUNDING.width,height:Yu.ARROW_BOUNDING.height,xmlns:"http://www.w3.org/2000/svg",className:l});return a?D.createElement("svg",Object.assign({},g),D.createElement("path",{d:"M0 0.5L0 1.5C4 1.5, 5.5 3, 7.5 5S10,8 12,8S14.5 7, 16.5 5S20,1.5 24,1.5L24 0.5L0 0.5z",style:{fill:p,opacity:u}}),D.createElement("path",{d:"M0 0L0 1C4 1, 5.5 2, 7.5 4S10,7 12,7S14.5 6, 16.5 4S20,1 24,1L24 0L0 0z",style:{fill:h}})):D.createElement("svg",Object.assign({},g),D.createElement("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z",style:{fill:p,opacity:u}}),D.createElement("path",{d:"M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0 24L0 0z",style:{fill:h}}))};nF.propTypes={position:C.string,className:C.string,arrowStyle:C.object,popStyle:C.object};var Cle=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Ele=tF.POSITION_SET,xle=tF.TRIGGER_SET;class Yi extends D.PureComponent{constructor(n){super(n),this.focusTrigger=()=>{var r;(r=this.tooltipRef.current)===null||r===void 0||r.focusTrigger()},this.renderPopCard=r=>{let{initialFocusRef:i}=r;const{content:s,contentClassName:o,prefixCls:a}=this.props,{direction:l}=this.context,u=xe(a,o,{[`${a}-rtl`]:l==="rtl"}),h=this.renderContentNode({initialFocusRef:i,content:s});return D.createElement("div",{className:u},D.createElement("div",{className:`${a}-content`},h))},this.renderContentNode=r=>{const{initialFocusRef:i,content:s}=r,o={initialFocusRef:i};return sr(s)?s(o):s},this.tooltipRef=D.createRef()}render(){const n=this.props,{children:r,prefixCls:i,showArrow:s,arrowStyle:o={},arrowBounding:a,position:l,style:u,trigger:h}=n,p=Cle(n,["children","prefixCls","showArrow","arrowStyle","arrowBounding","position","style","trigger"]);let{spacing:g}=this.props;const v={position:l,className:"",popStyle:u,arrowStyle:o},w=s?D.createElement(nF,Object.assign({},v)):!1;SO(g)&&(g=s?Yu.SPACING_WITH_ARROW:Yu.SPACING);const S=h==="click"||h==="custom"?"dialog":"tooltip";return D.createElement(Rn,Object.assign({guardFocus:!0,ref:this.tooltipRef},p,{trigger:h,position:l,style:u,content:this.renderPopCard,prefixCls:i,spacing:g,showArrow:w,arrowBounding:a,role:S}),r)}}Yi.contextType=Ao;Yi.propTypes={children:C.node,content:C.oneOfType([C.node,C.func]),visible:C.bool,autoAdjustOverflow:C.bool,motion:C.bool,position:C.oneOf(Ele),margin:C.oneOfType([C.number,C.object]),mouseEnterDelay:C.number,mouseLeaveDelay:C.number,trigger:C.oneOf(xle).isRequired,contentClassName:C.oneOfType([C.string,C.array]),onVisibleChange:C.func,onClickOutSide:C.func,style:C.object,spacing:C.oneOfType([C.number,C.object]),zIndex:C.number,showArrow:C.bool,arrowStyle:C.shape({borderColor:C.string,backgroundColor:C.string,borderOpacity:C.oneOfType([C.string,C.number])}),arrowPointAtCenter:C.bool,arrowBounding:C.object,prefixCls:C.string,guardFocus:C.bool,disableArrowKeyDown:C.bool};Yi.__SemiComponentName__="Popover";Yi.defaultProps=Dc(Yi.__SemiComponentName__,{arrowBounding:Yu.ARROW_BOUNDING,showArrow:!1,autoAdjustOverflow:!0,zIndex:Yu.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",cancelText:"No",okText:"Yes",position:"bottom",prefixCls:eF.PREFIX,onClickOutSide:rt,onEscKeyDown:rt,closeOnEsc:!0,returnFocusOnClose:!0,guardFocus:!0,disableFocusListener:!0});let nr;function iD(e){if(!e)return 0;const n=e.match(/^\d*(\.\d*)?/);return n?Number(n[0]):0}function Sle(e){return Array.prototype.slice.apply(e).map(r=>`${r}: ${e.getPropertyValue(r)};`).join("")}const Dle=function(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0;if(r.length===0)return"";nr||(nr=document.createElement("div"),nr.setAttribute("aria-hidden","true"),document.body.appendChild(nr));const u=window.getComputedStyle(e),h=Sle(u),p=iD(u.lineHeight),g=Math.round(p*(n+1)+iD(u.paddingTop)+iD(u.paddingBottom));nr.setAttribute("style",h),nr.style.position="fixed",nr.style.left="0",u.getPropertyValue("width")==="auto"&&e.offsetWidth&&(nr.style.width=`${e.offsetWidth}px`),nr.style.height="auto",nr.style.top="-999999px",nr.style.zIndex="-1000",l&&(nr.style.fontWeight="600"),nr.style.textOverflow="clip",nr.style.webkitLineClamp="none",nr.innerHTML="";function v(){const M=nr.scrollWidth<=nr.offsetWidth,k=nr.scrollHeight<g;return n===1?M&&k:k}const w=document.createElement("span"),S=document.createTextNode(r);if(w.appendChild(S),o.length>0){const M=document.createTextNode(o);w.appendChild(M)}nr.appendChild(w),Object.values(s0(i,"expand")).map(M=>M&&nr.appendChild(M.cloneNode(!0)));function E(){nr.innerHTML="",nr.appendChild(w),Object.values(i).map(M=>M&&nr.appendChild(M.cloneNode(!0)))}function x(M,k){const A=M.length;return k?a==="end"?M.slice(0,k)+s:M.slice(0,k)+s+M.slice(A-k,A):s}function I(M,k){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k.length,V=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const $=Math.floor((A+j)/2),W=x(k,$);if(M.textContent=W,A>=j-1&&j>0)for(let B=j;B>=A;B-=1){const H=x(k,B);if(M.textContent=H,v())return H}else if(j===0)return s;return v()?I(M,k,$,j,$):I(M,k,A,$,V)}let P=r;return v()||(E(),P=I(S,r,0,a==="middle"?Math.floor(r.length/2):r.length)),nr.innerHTML="",P},rF=D.createContext("normal");var aw;(function(e){e.Width="width",e.Height="height",e.All="all"})(aw||(aw={}));class i_ extends jr{constructor(n){var r;super(n),r=this,this.formerPropertyValue=new Map,this.getElement=()=>{try{return Ya.findDOMNode(this.childNode||this)}catch{return null}},this.handleResizeEventTriggered=i=>{var s,o,a,l;if(this.props.observerProperty===aw.All)(o=(s=this.props).onResize)===null||o===void 0||o.call(s,i);else{const u=[];for(const h of i)this.formerPropertyValue.has(h.target)?h.contentRect[this.props.observerProperty]!==this.formerPropertyValue.get(h.target)&&(this.formerPropertyValue.set(h.target,h.contentRect[this.props.observerProperty]),u.push(h)):(this.formerPropertyValue.set(h.target,h.contentRect[this.props.observerProperty]),u.push(h));u.length>0&&((l=(a=this.props).onResize)===null||l===void 0||l.call(a,u))}},this.observeElement=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const s=r.getElement();if(r.observer||(r.observer=new ResizeObserver(r.handleResizeEventTriggered)),!(s&&s instanceof Element)){r.observer.disconnect();return}s===r.element&&!i||(r.observer.disconnect(),r.element=s,r.observer.observe(s),r.props.observeParent&&s.parentNode&&s.parentNode.ownerDocument&&s.parentNode.ownerDocument.defaultView&&s.parentNode instanceof s.parentNode.ownerDocument.defaultView.HTMLElement&&(r._parentNode=s.parentNode,r.observer.observe(r._parentNode)))},this.mergeRef=(i,s)=>{this.childNode=s,typeof i=="function"?i(s):typeof i=="object"&&i&&"current"in i&&(i.current=s)},globalThis.ResizeObserver&&(this.observer=new ResizeObserver(this.handleResizeEventTriggered))}componentDidMount(){var n;(n=this.observeElement)===null||n===void 0||n.call(this)}componentDidUpdate(n){var r;(r=this.observeElement)===null||r===void 0||r.call(this,this.props.observeParent!==n.observeParent)}componentWillUnmount(){this.observer&&(this.observer.disconnect(),this.observer=null,this.element=null)}render(){const n=D.Children.only(this.props.children),{ref:r}=n;return D.cloneElement(n,{ref:i=>this.mergeRef(r,i)})}}i_.propTypes={onResize:C.func,observeParent:C.bool,observerProperty:C.string,delayTick:C.number};i_.defaultProps={onResize:()=>{},observeParent:!1,observerProperty:"all",delayTick:0};var sD=function(e,n,r,i){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function l(p){try{h(i.next(p))}catch(g){a(g)}}function u(p){try{h(i.throw(p))}catch(g){a(g)}}function h(p){p.done?o(p.value):s(p.value).then(l,u)}h((i=i.apply(e,n||[])).next())})},Nle=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const ii=Yw.PREFIX,Ile="...",Ole=(e,n)=>{const{mark:r,code:i,underline:s,strong:o,link:a,disabled:l}=e;let u=n;const h=(p,g)=>{let v={};p&&(typeof p=="object"&&(v=Object.assign({},p)),u=D.createElement(g,v,u))};return h(r,"mark"),h(i,"code"),h(s&&!a,"u"),h(o,"strong"),h(e.delete,"del"),h(a,l?"span":"a"),u};class Yh extends R.Component{constructor(n){super(n),this.observerTakingEffect=!1,this.onResize=r=>sD(this,void 0,void 0,function*(){return this.rafId&&window.cancelAnimationFrame(this.rafId),new Promise(i=>{this.rafId=window.requestAnimationFrame(()=>sD(this,void 0,void 0,function*(){yield this.getEllipsisState(),i()}))})}),this.canUseCSSEllipsis=()=>{const{copyable:r}=this.props,{expandable:i,expandText:s,pos:o,suffix:a}=this.getEllipsisOpt();return!i&&kr(s)&&!r&&o==="end"&&!a.length},this.shouldTruncated=r=>!r||r<1?!1:r<=1?this.compareSingleRow():this.wrapperRef.current.scrollHeight>this.wrapperRef.current.offsetHeight,this.compareSingleRow=()=>{if(!(document&&document.createRange))return!1;const r=this.wrapperRef.current,i=r.getBoundingClientRect().width,s=Array.from(r.childNodes),o=document.createRange(),a=s.reduce((l,u)=>{var h;return o.selectNodeContents(u),l+((h=o.getBoundingClientRect().width)!==null&&h!==void 0?h:0)},0);return o.detach(),a>i},this.showTooltip=()=>{var r,i;const{isOverflowed:s,isTruncated:o,expanded:a}=this.state,{showTooltip:l,expandable:u,expandText:h}=this.getEllipsisOpt(),p=this.canUseCSSEllipsis(),g=!a&&(p?s:o),w=!u&&kr(h)&&g&&l;if(!w)return w;const S={type:"tooltip"};return typeof l=="object"?l.type&&l.type.toLowerCase()==="popover"?ise({opts:{showArrow:!0}},l,{opts:{className:xe({[`${ii}-ellipsis-popover`]:!0,[(r=l==null?void 0:l.opts)===null||r===void 0?void 0:r.className]:!!(!((i=l==null?void 0:l.opts)===null||i===void 0)&&i.className)})}}):Object.assign(Object.assign({},S),l):S},this.onHover=()=>{if(this.canUseCSSEllipsis()){const{rows:i,suffix:s,pos:o}=this.getEllipsisOpt(),a=this.shouldTruncated(i);this.setState({isOverflowed:a,isTruncated:!1});return}},this.getEllipsisState=()=>sD(this,void 0,void 0,function*(){const{rows:r,suffix:i,pos:s}=this.getEllipsisOpt(),{children:o,strong:a}=this.props;if(!this.wrapperRef||!this.wrapperRef.current){yield this.onResize();return}const{expanded:l}=this.state;if(this.canUseCSSEllipsis())return;if(kh(o))return new Promise(v=>{this.setState({isTruncated:!1,isOverflowed:!1},v)});if(Lu("children"in this.props&&typeof o!="string","[Semi Typography] Only children with pure text could be used with ellipsis at this moment."),!r||r<0||l)return;const h={expand:this.expandRef.current,copy:this.copyRef&&this.copyRef.current},p=Array.isArray(o)?o.join(""):String(o),g=Dle(this.wrapperRef.current,r,p,h,Ile,i,s,a);return new Promise(v=>{this.setState({isOverflowed:!1,ellipsisContent:g,isTruncated:p!==g},v)})}),this.toggleOverflow=r=>{const{onExpand:i,expandable:s,collapsible:o}=this.getEllipsisOpt(),{expanded:a}=this.state;i&&i(!a,r),(s&&!a||o&&a)&&this.setState({expanded:!a})},this.getEllipsisOpt=()=>{const{ellipsis:r}=this.props;return r?Object.assign({rows:1,expandable:!1,pos:"end",suffix:"",showTooltip:!1,collapsible:!1,expandText:r.expandable?this.expandStr:void 0,collapseText:r.collapsible?this.collapseStr:void 0},typeof r=="object"?r:null):{}},this.renderExpandable=()=>{const{expanded:r,isTruncated:i}=this.state;if(!i)return null;const{expandText:s,expandable:o,collapseText:a,collapsible:l}=this.getEllipsisOpt(),u=!o&&kr(s),h=!l&&kr(a);let p;return!r&&!u?p=s:r&&!h&&(p=a),!u||!h?D.createElement("a",{role:"button",tabIndex:0,className:`${ii}-ellipsis-expand`,key:"expand",ref:this.expandRef,"aria-label":p,onClick:this.toggleOverflow,onKeyPress:g=>ua(g)&&this.toggleOverflow(g)},p):null},this.getEllipsisStyle=()=>{const{ellipsis:r,component:i}=this.props;if(!r)return{ellipsisCls:"",ellipsisStyle:{}};const{rows:s}=this.getEllipsisOpt(),{expanded:o}=this.state,a=!o&&this.canUseCSSEllipsis(),l=xe({[`${ii}-ellipsis`]:!0,[`${ii}-ellipsis-single-line`]:s===1,[`${ii}-ellipsis-multiple-line`]:s>1,[`${ii}-ellipsis-multiple-line-text`]:s>1&&i==="span",[`${ii}-ellipsis-overflow-ellipsis`]:s===1&&a,[`${ii}-ellipsis-overflow-ellipsis-text`]:s===1&&a&&i==="span"}),u=a&&s>1?{WebkitLineClamp:s}:{};return{ellipsisCls:l,ellipsisStyle:u}},this.renderEllipsisText=r=>{const{suffix:i}=r,{children:s}=this.props,{isTruncated:o,expanded:a,ellipsisContent:l}=this.state;return a||!o?D.createElement("span",{onMouseEnter:this.onHover},s,i&&i.length?i:null):D.createElement("span",{onMouseEnter:this.onHover},l,i)},this.state={editable:!1,copied:!1,isOverflowed:!1,ellipsisContent:n.children,expanded:!1,isTruncated:!1,prevChildren:null},this.wrapperRef=D.createRef(),this.expandRef=D.createRef(),this.copyRef=D.createRef()}componentDidMount(){this.props.ellipsis&&this.onResize().then(()=>DO(()=>this.observerTakingEffect=!0,1))}static getDerivedStateFromProps(n,r){const{prevChildren:i}=r,s={};return s.prevChildren=n.children,n.ellipsis&&i!==n.children&&(s.isOverflowed=!1,s.ellipsisContent=n.children,s.expanded=!1,s.isTruncated=!0),s}componentDidUpdate(n){this.props.children!==n.children&&(this.forceUpdate(),this.props.ellipsis&&this.onResize())}componentWillUnmount(){this.rafId&&window.cancelAnimationFrame(this.rafId)}renderOperations(){return D.createElement(D.Fragment,null,this.renderExpandable(),this.renderCopy())}renderCopy(){var n;const{copyable:r,children:i}=this.props;if(!r)return null;const s=(n=r==null?void 0:r.content)!==null&&n!==void 0?n:i;let o,a=!1;Array.isArray(s)?(o="",s.forEach(u=>{typeof u=="object"&&(a=!0),o+=String(u)})):(typeof s!="object"||(a=!0),o=String(s)),Lu(a,"Content to be copied in Typography is a object, it will case a [object Object] mistake when copy to clipboard.");const l=Object.assign({content:o,duration:3},typeof r=="object"?r:null);return D.createElement(MO,Object.assign({},l,{forwardRef:this.copyRef}))}renderIcon(){const{icon:n,size:r}=this.props,i=r==="inherit"?this.context:r;if(!n)return null;const s=i==="small"?"small":"default";return D.createElement("span",{className:`${ii}-icon`,"x-semi-prop":"icon"},Hs(n)?D.cloneElement(n,{size:s}):n)}renderContent(){const n=this.props,{component:r,children:i,className:s,type:o,spacing:a,disabled:l,style:u,ellipsis:h,icon:p,size:g,link:v,heading:w,weight:S}=n,E=Nle(n,["component","children","className","type","spacing","disabled","style","ellipsis","icon","size","link","heading","weight"]),x=s0(E,["strong","editable","mark","copyable","underline","code","delete"]),I=g==="inherit"?this.context:g,P=this.renderIcon(),M=this.getEllipsisOpt(),{ellipsisCls:k,ellipsisStyle:A}=this.getEllipsisStyle();let j=h?this.renderEllipsisText(M):i;const V=xe({[`${ii}-link-text`]:v,[`${ii}-link-underline`]:this.props.underline&&v});j=Ole(this.props,D.createElement(D.Fragment,null,P,this.props.link?D.createElement("span",{className:V},j):j));const $=/^h[1-6]$/,W=fr(w)&&$.test(w),B=xe(s,k,{[`${ii}-${o}`]:o&&!v,[`${ii}-${I}`]:I,[`${ii}-link`]:v,[`${ii}-disabled`]:l,[`${ii}-${a}`]:a,[`${ii}-${w}`]:W,[`${ii}-${w}-weight-${S}`]:W&&S&&isNaN(Number(S))}),H=Object.assign(Object.assign({},isNaN(Number(S))?{}:{fontWeight:S}),u);return D.createElement(Xw,Object.assign({className:B,style:Object.assign(Object.assign({},H),A),component:r,forwardRef:this.wrapperRef},x),j,this.renderOperations())}renderTipWrapper(){const{children:n}=this.props,r=this.showTooltip(),i=this.renderContent();if(r){const{type:s,opts:o,renderTooltip:a}=r;return sr(a)?a(n,i):s.toLowerCase()==="popover"?D.createElement(Yi,Object.assign({content:n,position:"top"},o),i):D.createElement(Rn,Object.assign({content:n,position:"top"},o),i)}else return i}render(){var n=this;const{size:r}=this.props,i=r==="inherit"?this.context:r,s=D.createElement(rF.Provider,{value:i},D.createElement(Gu,{componentName:"Typography"},o=>(this.expandStr=o.expand,this.collapseStr=o.collapse,this.renderTipWrapper())));return this.props.ellipsis?D.createElement(i_,{onResize:function(){n.observerTakingEffect&&n.onResize(...arguments)},observeParent:!0,observerProperty:aw.Width},s):s}}Yh.propTypes={children:C.node,copyable:C.oneOfType([C.shape({text:C.string,onCopy:C.func,successTip:C.node,copyTip:C.node}),C.bool]),delete:C.bool,disabled:C.bool,ellipsis:C.oneOfType([C.shape({rows:C.number,expandable:C.bool,expandText:C.string,onExpand:C.func,suffix:C.string,showTooltip:C.oneOfType([C.shape({type:C.string,opts:C.object}),C.bool]),collapsible:C.bool,collapseText:C.string,pos:C.oneOf(["end","middle"])}),C.bool]),mark:C.bool,underline:C.bool,link:C.oneOfType([C.object,C.bool]),spacing:C.oneOf(Pi.SPACING),strong:C.bool,size:C.oneOf(Pi.SIZE),type:C.oneOf(Pi.TYPE),style:C.object,className:C.string,icon:C.oneOfType([C.node,C.string]),heading:C.string,component:C.string};Yh.defaultProps={children:null,copyable:!1,delete:!1,disabled:!1,ellipsis:!1,icon:"",mark:!1,underline:!1,strong:!1,link:!1,type:"primary",spacing:"normal",size:"normal",style:{},className:""};Yh.contextType=rF;let PO=class extends R.PureComponent{render(){return D.createElement(Yh,Object.assign({component:"span"},this.props))}};PO.propTypes={copyable:C.oneOfType([C.object,C.bool]),delete:C.bool,disabled:C.bool,icon:C.oneOfType([C.node,C.string]),ellipsis:C.oneOfType([C.object,C.bool]),mark:C.bool,underline:C.bool,link:C.oneOfType([C.object,C.bool]),strong:C.bool,type:C.oneOf(Pi.TYPE),size:C.oneOf(Pi.SIZE),style:C.object,className:C.string,code:C.bool,component:C.string,weight:C.number};PO.defaultProps={copyable:!1,delete:!1,disabled:!1,icon:"",ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",style:{},size:"normal",className:""};var Tle=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};let AO=class extends R.PureComponent{render(){const n=this.props,{heading:r}=n,i=Tle(n,["heading"]),s=Pi.HEADING.indexOf(r)!==-1?`h${r}`:"h1";return D.createElement(Yh,Object.assign({component:s,heading:s},i))}};AO.propTypes={copyable:C.oneOfType([C.object,C.bool]),delete:C.bool,disabled:C.bool,ellipsis:C.oneOfType([C.object,C.bool]),mark:C.bool,link:C.oneOfType([C.object,C.bool]),underline:C.bool,strong:C.bool,type:C.oneOf(Pi.TYPE),heading:C.oneOf(Pi.HEADING),style:C.object,className:C.string,component:C.string,weight:C.oneOfType([C.oneOf(Pi.WEIGHT),C.number])};AO.defaultProps={copyable:!1,delete:!1,disabled:!1,ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",heading:1,style:{},className:""};const Mle=Yw.PREFIX;let s_=class extends R.PureComponent{render(){const{className:n}=this.props,r=xe(n,`${Mle}-paragraph`);return D.createElement(Yh,Object.assign({component:"p"},this.props,{className:r}))}};s_.propTypes={copyable:C.oneOfType([C.object,C.bool]),delete:C.bool,disabled:C.bool,ellipsis:C.oneOfType([C.object,C.bool]),mark:C.bool,link:C.oneOfType([C.object,C.bool]),underline:C.bool,strong:C.bool,type:C.oneOf(Pi.TYPE),size:C.oneOf(Pi.SIZE),spacing:C.oneOf(Pi.SPACING),style:C.object,className:C.string,component:C.string};s_.defaultProps={copyable:!1,delete:!1,disabled:!1,ellipsis:!1,mark:!1,underline:!1,strong:!1,link:!1,type:"primary",size:"normal",spacing:"normal",style:{},className:""};class Ple{constructor(n,r,i,s,o){this.ruleMethods={"bytes-decimal":a=>{const l=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];let u=0;for(;a>=1e3;)a/=1e3,u++;return`${this.truncatePrecision(a)} ${l[u]}`},"bytes-binary":a=>{const l=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let u=0;for(;a>=1024;)a/=1024,u++;return`${this.truncatePrecision(a)} ${l[u]}`},percentages:a=>`${this.truncatePrecision(a*100)}%`,exponential:a=>{const u=a.toExponential(this.precision+2).split("e");return`${this.truncatePrecision(Number(u[0]))}e${u[1]}`}},this.truncateMethods={ceil:Math.ceil,floor:Math.floor,round:Math.round},this.isDiyParser=typeof o<"u",this.content=n,this.rule=r,this.precision=i,this.truncate=s,this.parser=o}format(){return this.isDiyParser?this.parser(this.content):this.rule==="text"?oD(this.content).map(n=>aD(n)?this.truncatePrecision(n):n).join(""):this.rule==="numbers"?oD(this.content).filter(n=>aD(n)).map(n=>this.truncatePrecision(n)).join(","):oD(this.content).map(n=>aD(n)?this.ruleMethods[this.rule](Number(n)):n).join("")}truncatePrecision(n){const r=this.truncateMethods[this.truncate](Number(n)*Math.pow(10,this.precision))/Math.pow(10,this.precision),i=r.toString().split(".");if(i.length===1)return r.toFixed(this.precision);const s=i[1].length;return s<this.precision?`${i[0]}.${i[1]}${"0".repeat(this.precision-s)}`:r.toString()}}function oD(e){const n=/(-?[0-9]*\.?[0-9]+([eE]-?[0-9]+)?)|([^-\d\.]+)/g;return e.match(n)||[]}function aD(e){return!(isNaN(Number(e))||e.replace(/\s+/g,"")==="")}class RO extends R.PureComponent{formatNodeDFS(n){return Array.isArray(n)||(n=[n]),n=n.map(r=>typeof r=="string"||typeof r=="number"?new Ple(String(r),this.props.rule,this.props.precision,this.props.truncate,this.props.parser).format():typeof r=="function"?this.formatNodeDFS(r()):typeof r=="object"&&"children"in r.props?Object.assign(Object.assign({},r),{props:Object.assign(Object.assign({},r.props),{children:this.formatNodeDFS(r.props.children)})}):r),n.length===1?n[0]:n}render(){const n=Object.assign({},this.props);return delete n.rule,delete n.parser,n.children=this.formatNodeDFS(this.props.children),D.createElement(Yh,Object.assign({component:"span"},n))}}RO.propTypes={rule:C.oneOf(Pi.RULE),precision:C.number,truncate:C.oneOf(Pi.TRUNCATE),parser:C.func,copyable:C.oneOfType([C.object,C.bool]),delete:C.bool,disabled:C.bool,icon:C.oneOfType([C.node,C.string]),mark:C.bool,underline:C.bool,link:C.oneOfType([C.object,C.bool]),strong:C.bool,type:C.oneOf(Pi.TYPE),size:C.oneOf(Pi.SIZE),style:C.object,className:C.string,code:C.bool,component:C.string};RO.defaultProps={rule:"text",precision:0,truncate:"round",parser:void 0,copyable:!1,delete:!1,icon:"",mark:!1,underline:!1,strong:!1,link:!1,type:"primary",style:{},size:"normal",className:""};const ad=Xw;ad.Text=PO;ad.Title=AO;ad.Paragraph=s_;ad.Numeral=RO;var lD,AR;function Ale(){if(AR)return lD;AR=1;var e=Sc(),n=Po(),r="[object Number]";function i(s){return typeof s=="number"||n(s)&&e(s)==r}return lD=i,lD}var Rle=Ale();const Ki=cn(Rle),kle=`${Dn}-spin`,Lle={PREFIX:kle},jle={SIZE:["small","middle","large"]};class kO extends li{static get spinDefaultAdapter(){return{getProp:()=>{},setLoading:n=>{}}}constructor(n){super(Object.assign(Object.assign({},kO.spinDefaultAdapter),n))}updateLoadingIfNeedDelay(){const{spinning:n,delay:r}=this._adapter.getProps(),{delay:i}=this._adapter.getStates();if(i){const s=this;this._timer=setTimeout(()=>{s._adapter.setState({loading:n,delay:0})},r)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}var Fle=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};let RR=-1;function iF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:n,className:r}=e,i=Fle(e,["id","className"]);let s=n;SO(s)&&(RR++,s=RR);const o=`linearGradient-${s}`;return D.createElement("svg",Object.assign({},i,{className:r,width:"48",height:"48",viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,"data-icon":"spin"}),D.createElement("defs",null,D.createElement("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:o},D.createElement("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),D.createElement("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),D.createElement("stop",{stopColor:"currentColor",offset:"100%"}))),D.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},D.createElement("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),D.createElement("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:`url(#${o})`,strokeWidth:"4",strokeLinecap:"round"})))}var $le=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const oh=Lle.PREFIX;class o_ extends jr{constructor(n){super(n),this.foundation=new kO(this.adapter),this.state={delay:n.delay,loading:!0}}static getDerivedStateFromProps(n){return n.delay?n.spinning===!1?{delay:0,loading:!1}:{delay:n.delay}:{loading:n.spinning}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setLoading:n=>{this.setState({loading:n})}})}componentWillUnmount(){this.foundation.destroy()}renderSpin(){const{indicator:n,tip:r}=this.props,{loading:i}=this.state;return i?D.createElement("div",{className:`${oh}-wrapper`},n?D.createElement("div",{className:`${oh}-animate`,"x-semi-prop":"indicator"},n):D.createElement(iF,null),r?D.createElement("div",{"x-semi-prop":"tip"},r):null):null}render(){this.foundation.updateLoadingIfNeedDelay();const n=this.props,{children:r,style:i,wrapperClassName:s,childStyle:o,size:a}=n,l=$le(n,["children","style","wrapperClassName","childStyle","size"]),{loading:u}=this.state,h=xe(oh,s,{[`${oh}-${a}`]:a,[`${oh}-block`]:r,[`${oh}-hidden`]:!u});return D.createElement("div",Object.assign({className:h,style:i},this.getDataAttr(l)),this.renderSpin(),D.createElement("div",{className:`${oh}-children`,style:o,"x-semi-prop":"children"},r))}}o_.propTypes={size:C.oneOf(jle.SIZE),spinning:C.bool,children:C.node,indicator:C.node,delay:C.number,tip:C.node,wrapperClassName:C.string,childStyle:C.object,style:C.object};o_.defaultProps={size:"middle",spinning:!0,children:null,indicator:null,delay:0};const zle={PREFIX:`${Dn}-input`},a_={SIZE:["small","large","default"],STATUS:["default","error","warning","success"],CLEARBTN_CLICKED_EVENT_FLAG:"__fromClearBtn",MODE:["password"]};function Vle(e){const{value:n,maxLength:r,getValueLength:i}=e;if(sr(i)){let s=0,o=n.length;for(;s<o;){const a=s+Math.floor((o-s)/2),l=n.slice(0,a+1);i(l)>r?o=a:s=a+1}return n.slice(0,s)}else return n.slice(0,r)}class LO extends li{static get inputDefaultAdapter(){return{notifyChange:rt,setValue:rt}}constructor(n){super(Object.assign(Object.assign({},LO.inputDefaultAdapter),n))}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}setDisable(){}setValue(n){this._adapter.setValue(n)}handleChange(n,r){const{maxLength:i,minLength:s,getValueLength:o}=this._adapter.getProps();let a=n;i&&sr(o)&&(a=this.handleVisibleMaxLength(n)),s&&sr(o)&&this.handleVisibleMinLength(a),this._isControlledComponent()?this._adapter.notifyChange(a,r):(this._adapter.setValue(a),this._adapter.notifyChange(a,r))}handleVisibleMinLength(n){const{minLength:r,getValueLength:i}=this._adapter.getProps(),{minLength:s}=this._adapter.getStates();if(Ki(r)&&r>=0&&sr(i)&&fr(n)){const o=i(n);if(o<r){const a=n.length+(r-o);a!==s&&this._adapter.setMinLength(a)}else s!==r&&this._adapter.setMinLength(r)}}handleVisibleMaxLength(n){const{maxLength:r,getValueLength:i}=this._adapter.getProps();return Ki(r)&&r>=0&&sr(i)&&fr(n)&&i(n)>r?(console.warn("[Semi Input] The input character is truncated because the input length exceeds the maximum length limit"),this.handleTruncateValue(n,r)):n}handleTruncateValue(n,r){const{getValueLength:i}=this._adapter.getProps();return Vle({value:n,maxLength:r,getValueLength:i})}handleClear(n){let r=n;const i="";this._isControlledComponent("value")?this._adapter.setState({isFocus:!1}):this._adapter.setState({value:"",isFocus:!1}),(!r||typeof r!="object")&&(r={}),foe(r,a_.CLEARBTN_CLICKED_EVENT_FLAG,!0),this._adapter.notifyChange(i,r),this._adapter.notifyClear(r),r&&this.stopPropagation(r)}handleClick(n){const{disabled:r}=this._adapter.getProps(),{isFocus:i}=this._adapter.getStates();r||i||this._adapter.isEventTarget(n)&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handleModeChange(n){n==="password"?this._adapter.setEyeClosed(!0):this._adapter.setEyeClosed(!1)}handleClickEye(n){const r=this._adapter.getState("eyeClosed");this._adapter.focusInput(),this._adapter.toggleFocusing(!0),this._adapter.setEyeClosed(!r)}handleInputType(n){const r=this._adapter.getProp("mode"),i=this._adapter.getState("eyeClosed");return r==="password"?i?"password":"text":n}handleMouseDown(n){n.preventDefault()}handleMouseUp(n){n.preventDefault()}handleBlur(n){const{value:r}=this.getStates();this._adapter.toggleFocusing(!1),this._adapter.notifyBlur(r,n)}handleFocus(n){const{value:r}=this.getStates();this._adapter.toggleFocusing(!0),this._adapter.notifyFocus(r,n)}handleInput(n){this._adapter.notifyInput(n)}handleKeyDown(n){this._adapter.notifyKeyDown(n)}handleKeyUp(n){this._adapter.notifyKeyUp(n)}handleKeyPress(n){this._adapter.notifyKeyPress(n),n.key===Qj&&this._adapter.notifyEnterPress(n)}isAllowClear(){const{value:n,isFocus:r,isHovering:i}=this._adapter.getStates(),{showClear:s,disabled:o,showClearIgnoreDisabled:a}=this._adapter.getProps();return n&&s&&(!o||a)&&(r||i)}handleClickPrefixOrSuffix(n){const{disabled:r}=this._adapter.getProps(),{isFocus:i}=this._adapter.getStates();!r&&!i&&(this._adapter.focusInput(),this._adapter.toggleFocusing(!0))}handlePreventMouseDown(n){n&&sr(n.preventDefault)&&n.preventDefault()}handleModeEnterPress(n){["Enter"," "].includes(n==null?void 0:n.key)&&(this.handlePreventMouseDown(n),this.handleClickEye(n))}}var Ble=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const pn=zle.PREFIX,Hle=a_.SIZE,Ule=a_.STATUS,Kle=a_.MODE;class jO extends jr{constructor(n){super(n),this.handleClear=i=>{this.foundation.handleClear(i)},this.handleClick=i=>{this.foundation.handleClick(i)},this.handleMouseOver=i=>{this.setState({isHovering:!0})},this.handleMouseLeave=i=>{this.setState({isHovering:!1})},this.handleModeChange=i=>{this.foundation.handleModeChange(i)},this.handleClickEye=i=>{this.foundation.handleClickEye(i)},this.handleMouseDown=i=>{this.foundation.handleMouseDown(i)},this.handleMouseUp=i=>{this.foundation.handleMouseUp(i)},this.handleModeEnterPress=i=>{this.foundation.handleModeEnterPress(i)},this.handleClickPrefixOrSuffix=i=>{this.foundation.handleClickPrefixOrSuffix(i)},this.handlePreventMouseDown=i=>{this.foundation.handlePreventMouseDown(i)};const r="value"in n?n.value:n.defaultValue;this.state={value:r,cachedValue:n.value,disabled:!1,props:{},isFocus:!1,isHovering:!1,eyeClosed:n.mode==="password",minLength:n.minLength},this.inputRef=D.createRef(),this.prefixRef=D.createRef(),this.suffixRef=D.createRef(),this.foundation=new LO(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setValue:n=>this.setState({value:n}),setEyeClosed:n=>this.setState({eyeClosed:n}),toggleFocusing:n=>{this.setState({isFocus:n})},focusInput:()=>{const{preventScroll:n}=this.props,r=this.inputRef&&this.inputRef.current;r&&r.focus({preventScroll:n})},toggleHovering:n=>this.setState({isHovering:n}),getIfFocusing:()=>this.state.isFocus,notifyChange:(n,r)=>this.props.onChange(n,r),notifyBlur:(n,r)=>this.props.onBlur(r),notifyFocus:(n,r)=>this.props.onFocus(r),notifyInput:n=>this.props.onInput(n),notifyKeyPress:n=>this.props.onKeyPress(n),notifyKeyDown:n=>this.props.onKeyDown(n),notifyKeyUp:n=>this.props.onKeyUp(n),notifyEnterPress:n=>this.props.onEnterPress(n),notifyClear:n=>this.props.onClear(n),setMinLength:n=>this.setState({minLength:n}),isEventTarget:n=>n&&n.target===n.currentTarget})}static getDerivedStateFromProps(n,r){const i={};return n.value!==r.cachedValue&&(i.value=n.value,i.cachedValue=n.value),i}componentDidUpdate(n){const{mode:r}=this.props;n.mode!==r&&this.handleModeChange(r)}componentDidMount(){const{disabled:n,autoFocus:r,preventScroll:i}=this.props;!n&&(r||this.props.autofocus)&&this.inputRef.current.focus({preventScroll:i})}renderPrepend(){const{addonBefore:n}=this.props;if(n){const r=xe({[`${pn}-prepend`]:!0,[`${pn}-prepend-text`]:n&&fr(n),[`${pn}-prepend-icon`]:Hs(n)});return D.createElement("div",{className:r,"x-semi-prop":"addonBefore"},n)}return null}renderAppend(){const{addonAfter:n}=this.props;if(n){const r=xe({[`${pn}-append`]:!0,[`${pn}-append-text`]:n&&fr(n),[`${pn}-append-icon`]:Hs(n)});return D.createElement("div",{className:r,"x-semi-prop":"addonAfter"},n)}return null}renderClearBtn(){const n=xe(`${pn}-clearbtn`),{clearIcon:r}=this.props;return this.foundation.isAllowClear()?D.createElement("div",{className:n,onMouseDown:this.handleClear},r||D.createElement(n_,null)):null}renderModeBtn(){const{eyeClosed:n}=this.state,{mode:r,disabled:i}=this.props,s=xe(`${pn}-modebtn`),o=n?D.createElement($ae,null):D.createElement(Vae,null),a=r==="password"&&!i,l=n?"Show password":"Hidden password";return a?D.createElement("div",{role:"button",tabIndex:0,"aria-label":l,className:s,onClick:this.handleClickEye,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onKeyPress:this.handleModeEnterPress},o):null}renderPrefix(){const{prefix:n,insetLabel:r,insetLabelId:i}=this.props,s=n||r;if(!s)return null;const o=xe({[`${pn}-prefix`]:!0,[`${pn}-inset-label`]:r,[`${pn}-prefix-text`]:s&&fr(s),[`${pn}-prefix-icon`]:Hs(s)});return D.createElement("div",{className:o,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,id:i,"x-semi-prop":"prefix,insetLabel"},s)}renderSuffix(n){const{suffix:r,hideSuffix:i}=this.props;if(!r)return null;const s=xe({[`${pn}-suffix`]:!0,[`${pn}-suffix-text`]:r&&fr(r),[`${pn}-suffix-icon`]:Hs(r),[`${pn}-suffix-hidden`]:n&&!!i});return D.createElement("div",{className:s,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,"x-semi-prop":"suffix"},r)}getInputRef(){const{forwardRef:n}=this.props;if(!kr(n)){if(typeof n=="function")return r=>{n(r),this.inputRef={current:r}};if(Object.prototype.toString.call(n)==="[object Object]")return this.inputRef=n,n}return this.inputRef}render(){const n=this.props,{addonAfter:r,addonBefore:i,autoFocus:s,clearIcon:o,className:a,disabled:l,defaultValue:u,placeholder:h,prefix:p,mode:g,insetLabel:v,insetLabelId:w,validateStatus:S,type:E,readonly:x,size:I,suffix:P,style:M,showClear:k,onEnterPress:A,onClear:j,hideSuffix:V,inputStyle:$,forwardRef:W,maxLength:B,getValueLength:H,preventScroll:Y,borderless:te,showClearIgnoreDisabled:ue,onlyBorder:ye}=n,Ne=Ble(n,["addonAfter","addonBefore","autoFocus","clearIcon","className","disabled","defaultValue","placeholder","prefix","mode","insetLabel","insetLabelId","validateStatus","type","readonly","size","suffix","style","showClear","onEnterPress","onClear","hideSuffix","inputStyle","forwardRef","maxLength","getValueLength","preventScroll","borderless","showClearIgnoreDisabled","onlyBorder"]),{value:q,isFocus:G,minLength:ae}=this.state,ge=this.foundation.isAllowClear(),X=Hs(P),ee=this.getInputRef(),ie=`${pn}-wrapper`,we=xe(ie,a,{[`${pn}-wrapper__with-prefix`]:p||v,[`${pn}-wrapper__with-suffix`]:P,[`${pn}-wrapper__with-suffix-hidden`]:ge&&!!V,[`${pn}-wrapper__with-suffix-icon`]:X,[`${pn}-wrapper__with-append`]:i,[`${pn}-wrapper__with-prepend`]:r,[`${pn}-wrapper__with-append-only`]:i&&!r,[`${pn}-wrapper__with-prepend-only`]:!i&&r,[`${ie}-readonly`]:x,[`${ie}-disabled`]:l,[`${ie}-warning`]:S==="warning",[`${ie}-error`]:S==="error",[`${ie}-focus`]:G,[`${ie}-clearable`]:k,[`${ie}-modebtn`]:g==="password",[`${ie}-hidden`]:E==="hidden",[`${ie}-${I}`]:I,[`${pn}-borderless`]:te,[`${pn}-only_border`]:ye!=null}),Se=xe(pn,{[`${pn}-${I}`]:I,[`${pn}-disabled`]:l,[`${pn}-sibling-clearbtn`]:this.foundation.isAllowClear(),[`${pn}-sibling-modebtn`]:g==="password"}),J=q??"",Re=Object.assign(Object.assign({},Ne),{style:$,className:Se,disabled:l,readOnly:x,type:this.foundation.handleInputType(E),placeholder:h,onInput:Oe=>this.foundation.handleInput(Oe),onChange:Oe=>this.foundation.handleChange(Oe.target.value,Oe),onFocus:Oe=>this.foundation.handleFocus(Oe),onBlur:Oe=>this.foundation.handleBlur(Oe),onKeyUp:Oe=>this.foundation.handleKeyUp(Oe),onKeyDown:Oe=>this.foundation.handleKeyDown(Oe),onKeyPress:Oe=>this.foundation.handleKeyPress(Oe),value:J});sr(H)||(Re.maxLength=B),ae&&(Re.minLength=ae),S==="error"&&(Re["aria-invalid"]="true");let be=Object.assign({},M);return ye!==void 0&&(be=Object.assign({borderWidth:ye},M)),D.createElement("div",{className:we,style:be,onMouseEnter:Oe=>this.handleMouseOver(Oe),onMouseLeave:Oe=>this.handleMouseLeave(Oe),onClick:Oe=>this.handleClick(Oe)},this.renderPrepend(),this.renderPrefix(),D.createElement("input",Object.assign({},Re,{ref:ee})),this.renderClearBtn(),this.renderSuffix(ge),this.renderModeBtn(),this.renderAppend())}}jO.propTypes={"aria-label":C.string,"aria-labelledby":C.string,"aria-invalid":C.bool,"aria-errormessage":C.string,"aria-describedby":C.string,"aria-required":C.bool,addonBefore:C.node,addonAfter:C.node,clearIcon:C.node,prefix:C.node,suffix:C.node,mode:C.oneOf(Kle),value:C.any,defaultValue:C.any,disabled:C.bool,readonly:C.bool,autoFocus:C.bool,type:C.string,showClear:C.bool,hideSuffix:C.bool,placeholder:C.any,size:C.oneOf(Hle),className:C.string,style:C.object,validateStatus:C.oneOf(Ule),onClear:C.func,onChange:C.func,onBlur:C.func,onFocus:C.func,onInput:C.func,onKeyDown:C.func,onKeyUp:C.func,onKeyPress:C.func,onEnterPress:C.func,insetLabel:C.node,insetLabelId:C.string,inputStyle:C.object,getValueLength:C.func,preventScroll:C.bool,borderless:C.bool};jO.defaultProps={addonBefore:"",addonAfter:"",prefix:"",suffix:"",readonly:!1,type:"text",showClear:!1,hideSuffix:!1,placeholder:"",size:"default",className:"",onClear:rt,onChange:rt,onBlur:rt,onFocus:rt,onInput:rt,onKeyDown:rt,onKeyUp:rt,onKeyPress:rt,onEnterPress:rt,validateStatus:"default",borderless:!1};const vc=D.forwardRef((e,n)=>D.createElement(jO,Object.assign({},e,{forwardRef:n})));var Wle=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};class FO extends D.PureComponent{render(){const n=this.props,{triggerRender:r,componentName:i}=n,s=Wle(n,["triggerRender","componentName"]);return r(Object.assign({},s))}}FO.propTypes={triggerRender:C.func.isRequired,componentName:C.string,componentProps:C.object,value:C.any,inputValue:C.string,placeholder:C.oneOfType([C.string,C.array]),className:C.string,style:C.object};const qle={PREFIX:`${Dn}-highlight`},Gle=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");class Yle extends li{constructor(n){super(Object.assign({},n)),this.findAll=r=>{let{autoEscape:i=!0,caseSensitive:s=!1,searchWords:o,sourceString:a}=r;fr(o)&&(o=[o]);const l=this.findChunks({autoEscape:i,caseSensitive:s,searchWords:o,sourceString:a}),u=this.combineChunks({chunks:l});return this.fillInChunks({chunksToHighlight:u,totalLength:a?a.length:0})},this.findChunks=r=>{let{autoEscape:i,caseSensitive:s,searchWords:o,sourceString:a}=r;return o.map(l=>typeof l=="string"?{text:l}:l).filter(l=>l.text).reduce((l,u)=>{let h=u.text;i&&(h=Gle(h));const p=new RegExp(h,s?"g":"gi");let g;for(;g=p.exec(a);){const v=g.index,w=p.lastIndex;w>v&&l.push({highlight:!0,start:v,end:w,className:u.className,style:u.style}),g.index===p.lastIndex&&p.lastIndex++}return l},[])},this.combineChunks=r=>{let{chunks:i}=r;return i.sort((s,o)=>s.start-o.start).reduce((s,o)=>{if(s.length===0)return[o];{const a=s.pop();if(o.start<=a.end){const l=Math.max(a.end,o.end);s.push({highlight:!0,start:a.start,end:l,className:a.className||o.className,style:Object.assign(Object.assign({},a.style),o.style)})}else s.push(a,o);return s}},[])},this.fillInChunks=r=>{let{chunksToHighlight:i,totalLength:s}=r;const o=[],a=(l,u,h,p,g)=>{u-l>0&&o.push({start:l,end:u,highlight:h,className:p,style:g})};if(i.length===0)a(0,s,!1);else{let l=0;i.forEach(u=>{a(l,u.start,!1),a(u.start,u.end,!0,u.className,u.style),l=u.end}),a(l,s,!1)}return o}}}const Xle=qle.PREFIX;class $O extends R.PureComponent{constructor(){super(...arguments),this.getHighLightTextHTML=n=>{let{sourceString:r="",searchWords:i=[],option:s={autoEscape:!0,caseSensitive:!1}}=n;const o=new Yle().findAll(Object.assign({sourceString:r,searchWords:i},s)),a=s.highlightTag||"mark",l=s.highlightClassName||"",u=s.highlightStyle||{};return o.map((h,p)=>{const{end:g,start:v,highlight:w,style:S,className:E}=h,x=r.substr(v,g-v);return w?D.createElement(a,{style:Object.assign(Object.assign({},u),S),className:`${l} ${E||""}`.trim(),key:x+p},x):x})}}render(){const{searchWords:n,sourceString:r,component:i,highlightClassName:s,highlightStyle:o,caseSensitive:a,autoEscape:l}=this.props,u=xe({[`${Xle}-tag`]:!0},s),h={highlightTag:i,highlightClassName:u,highlightStyle:o,caseSensitive:a,autoEscape:l};return this.getHighLightTextHTML({sourceString:r,searchWords:n,option:h})}}$O.propTypes={style:C.object,className:C.string,autoEscape:C.bool,caseSensitive:C.bool,sourceString:C.string,searchWords:C.arrayOf(C.string),highlightStyle:C.object,highlightClassName:C.string,component:C.string};$O.defaultProps={component:"mark",autoEscape:!0,caseSensitive:!1,sourceString:""};const Zle={PREFIX:`${Dn}-avatar`},Ig={SHAPE:["circle","square"],SIZE:["extra-extra-small","extra-small","small","default","medium","large","extra-large"],COLOR:["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"]};class Qle extends li{constructor(n){super(Object.assign({},n)),this.handleFocusVisible=r=>{const{target:i}=r;try{i.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{Lu(!0,"Warning: [Semi Avatar] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this._adapter.setFocusVisible(!1)},this.changeScale=()=>{const{gap:r}=this.getProps(),i=this._adapter.getAvatarNode(),s=i==null?void 0:i.firstChild,[o,a]=[(i==null?void 0:i.offsetWidth)||0,(s==null?void 0:s.offsetWidth)||0];if(o!==0&&a!==0&&r*2<o){const l=o-r*2>a?1:(o-r*2)/a;this._adapter.setScale(l)}}}init(){const{children:n}=this.getProps();typeof n=="string"&&this.changeScale()}destroy(){}handleImgLoadError(){const{onError:n}=this.getProps();(n?n():void 0)!==!1&&this._adapter.notifyImgState(!1)}handleEnter(n){this._adapter.notifyEnter(n)}handleLeave(n){this._adapter.notifyLeave(n)}}const Jle=e=>{let{gradientStart:n,gradientEnd:r}=e;const i=sw();return D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"51",height:"52",viewBox:"0 0 51 52",fill:"none"},D.createElement("g",{filter:"url(#filter0_d_6_2)"},D.createElement("path",{d:"M40.4918 46.5592C44.6795 43.176 46.261 34.1333 47.5301 25.6141C49.5854 11.8168 39.6662 1 25.8097 1C11.2857 1 3 11.4279 3 25.3518C3 33.7866 6.29361 43.8947 10.4602 46.5592C12.5868 47.9192 12.5868 47.9051 25.8097 47.9192C38.3651 47.9282 38.5352 48.14 40.4918 46.5592Z",fill:`url(#${i})`})),D.createElement("defs",null,D.createElement("filter",{id:"filter0_d_6_2",x:"0.789215",y:"0.447304",width:"49.2216",height:"51.3549",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},D.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),D.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),D.createElement("feOffset",{dy:"1.65809"}),D.createElement("feGaussianBlur",{stdDeviation:"1.10539"}),D.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"}),D.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_6_2"}),D.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_6_2",result:"shape"})),D.createElement("linearGradient",{id:i,x1:"17.671",y1:"31.7392",x2:"17.671",y2:"47.9333",gradientUnits:"userSpaceOnUse"},D.createElement("stop",{stopColor:n}),D.createElement("stop",{offset:"1",stopColor:r}))))};var ece=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const tce=Ig.SIZE,nce=Ig.SHAPE,rce=Ig.COLOR,gn=Zle.PREFIX;let cg=class extends jr{constructor(n){super(n),this.handleFocusVisible=r=>{this.foundation.handleFocusVisible(r)},this.handleBlur=r=>{this.foundation.handleBlur()},this.getContent=()=>{const{children:r,onClick:i,imgAttr:s,src:o,srcSet:a,alt:l}=this.props,{isImgExist:u}=this.state;let h=r;const p=i!==cc,g=o&&u,v={tabIndex:0,onKeyDown:this.handleKeyDown,onFocus:this.handleFocusVisible,onBlur:this.handleBlur};if(g){const w=p?`clickable Avatar: ${l}`:l,S=Object.assign(Object.assign({src:o,srcSet:a,onError:this.handleError},s),{className:xe({[`${gn}-no-focus-visible`]:p})}),E=p?Object.assign(Object.assign({},S),v):S;h=D.createElement("img",Object.assign({alt:w},E))}else if(typeof r=="string"){const w=l??r,E={role:"img","aria-label":p?`clickable Avatar: ${w}`:w,className:xe(`${gn}-label`,{[`${gn}-no-focus-visible`]:p})},x=p?Object.assign(Object.assign({},E),v):E,I={transform:`scale(${this.state.scale})`};h=D.createElement("span",{className:`${gn}-content`,style:I},D.createElement("span",Object.assign({},x,{"x-semi-prop":"children"}),r))}return h},this.renderBottomSlot=()=>{var r,i;if(!this.props.bottomSlot)return null;if(this.props.bottomSlot.render)return this.props.bottomSlot.render();const s=(r=this.props.bottomSlot.render)!==null&&r!==void 0?r:()=>{var o;const a={};return this.props.bottomSlot.bgColor&&(a.backgroundColor=this.props.bottomSlot.bgColor),this.props.bottomSlot.textColor&&(a.color=this.props.bottomSlot.textColor),D.createElement("span",{style:a,className:xe(`${gn}-bottom_slot-shape_${this.props.bottomSlot.shape}`,`${gn}-bottom_slot-shape_${this.props.bottomSlot.shape}-${this.props.size}`,(o=this.props.bottomSlot.className)!==null&&o!==void 0?o:"")},this.props.bottomSlot.text)};return D.createElement("div",{className:xe([`${gn}-bottom_slot`]),style:(i=this.props.bottomSlot.style)!==null&&i!==void 0?i:{}},s())},this.renderTopSlot=()=>{var r,i,s,o;if(!this.props.topSlot)return null;if(this.props.topSlot.render)return this.props.topSlot.render();const a={};return this.props.topSlot.textColor&&(a.color=this.props.topSlot.textColor),D.createElement("div",{style:(r=this.props.topSlot.style)!==null&&r!==void 0?r:{},className:xe([`${gn}-top_slot-wrapper`,(i=this.props.topSlot.className)!==null&&i!==void 0?i:"",{[`${gn}-animated`]:this.props.contentMotion}])},D.createElement("div",{className:xe([`${gn}-top_slot-bg`,`${gn}-top_slot-bg-${this.props.size}`])},D.createElement("div",{className:xe([`${gn}-top_slot-bg-svg`,`${gn}-top_slot-bg-svg-${this.props.size}`])},D.createElement(Jle,{gradientStart:(s=this.props.topSlot.gradientStart)!==null&&s!==void 0?s:"var(--semi-color-primary)",gradientEnd:(o=this.props.topSlot.gradientEnd)!==null&&o!==void 0?o:"var(--semi-color-primary)"}))),D.createElement("div",{className:xe([`${gn}-top_slot`])},D.createElement("div",{style:a,className:xe([`${gn}-top_slot-content`,`${gn}-top_slot-content-${this.props.size}`])},this.props.topSlot.text)))},this.state={isImgExist:!0,hoverContent:"",focusVisible:!1,scale:1},this.onEnter=this.onEnter.bind(this),this.onLeave=this.onLeave.bind(this),this.handleError=this.handleError.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.getContent=this.getContent.bind(this),this.avatarRef=D.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyImgState:n=>{this.setState({isImgExist:n})},notifyEnter:n=>{const{hoverMask:r}=this.props,i=r;this.setState({hoverContent:i},()=>{const{onMouseEnter:s}=this.props;s&&s(n)})},notifyLeave:n=>{this.setState({hoverContent:""},()=>{const{onMouseLeave:r}=this.props;r&&r(n)})},setFocusVisible:n=>{this.setState({focusVisible:n})},setScale:n=>{this.setState({scale:n})},getAvatarNode:()=>{var n;return(n=this.avatarRef)===null||n===void 0?void 0:n.current}})}componentDidMount(){this.foundation=new Qle(this.adapter),this.foundation.init()}componentDidUpdate(n){if(this.props.src&&this.props.src!==n.src){const r=new Image(0,0);r.src=this.props.src,r.onload=()=>{this.setState({isImgExist:!0})},r.onerror=()=>{this.setState({isImgExist:!1})},r.onabort=()=>{this.setState({isImgExist:!1})}}typeof this.props.children=="string"&&this.props.children!==n.children&&this.foundation.changeScale()}componentWillUnmount(){this.foundation.destroy()}onEnter(n){this.foundation.handleEnter(n)}onLeave(n){this.foundation.handleLeave(n)}handleError(){this.foundation.handleImgLoadError()}handleKeyDown(n){const{onClick:r}=this.props;switch(n.key){case"Enter":r(n),qu(n);break;case"Escape":n.target.blur();break}}render(){var n;const r=this.props,{shape:i,children:s,size:o,color:a,className:l,hoverMask:u,onClick:h,imgAttr:p,src:g,srcSet:v,style:w,alt:S,gap:E,bottomSlot:x,topSlot:I,border:P,contentMotion:M}=r,k=ece(r,["shape","children","size","color","className","hoverMask","onClick","imgAttr","src","srcSet","style","alt","gap","bottomSlot","topSlot","border","contentMotion"]),{isImgExist:A,hoverContent:j,focusVisible:V}=this.state;let $={};Ig.SIZE.includes(o)||($={width:o,height:o}),$=Object.assign(Object.assign({},$),w);const W=x||I||P,B={onClick:h,onMouseEnter:this.onEnter,onMouseLeave:this.onLeave},H=g&&A,Y=xe(gn,{[`${gn}-${i}`]:i,[`${gn}-${o}`]:o,[`${gn}-${a}`]:a&&!H,[`${gn}-img`]:H,[`${gn}-focus`]:V,[`${gn}-animated`]:M},l),te=j?D.createElement("div",{className:`${gn}-hover`,"x-semi-prop":"hoverContent"},j):null;let ue=D.createElement("span",Object.assign({},k,{style:W?{}:$,className:Y},W?{}:B,{role:"listitem",ref:this.avatarRef}),this.getContent(),te);if(P){const ye={};typeof P=="object"&&(P!=null&&P.color)&&(ye.borderColor=P==null?void 0:P.color),ue=D.createElement("div",{style:Object.assign({position:"relative"},$)},ue,D.createElement("span",{style:ye,className:xe([`${gn}-additionalBorder`,`${gn}-additionalBorder-${o}`,{[`${gn}-${i}`]:i}])}),typeof this.props.border=="object"&&this.props.border.motion&&D.createElement("span",{style:ye,className:xe([`${gn}-additionalBorder`,`${gn}-additionalBorder-${o}`,{[`${gn}-${i}`]:i,[`${gn}-additionalBorder-animated`]:typeof this.props.border=="object"&&((n=this.props.border)===null||n===void 0?void 0:n.motion)}])}))}return W?D.createElement("span",Object.assign({className:xe([`${gn}-wrapper`]),style:$},B),ue,I&&["extra-small","small","default","medium","large","extra-large"].includes(o)&&i==="circle"&&this.renderTopSlot(),x&&["extra-small","small","default","medium","large","extra-large"].includes(o)&&this.renderBottomSlot()):ue}};cg.__SemiComponentName__="Avatar";cg.defaultProps=Dc(cg.__SemiComponentName__,{size:"medium",color:"grey",shape:"circle",gap:3,onClick:cc,onMouseEnter:cc,onMouseLeave:cc});cg.propTypes={children:C.node,color:C.oneOf(rce),shape:C.oneOf(nce),size:C.oneOf(tce),hoverMask:C.node,className:C.string,style:C.object,gap:C.number,imgAttr:C.object,src:C.string,srcSet:C.string,alt:C.string,onError:C.func,onClick:C.func,onMouseEnter:C.func,onMouseLeave:C.func,bottomSlot:C.shape({render:C.func,shape:C.oneOf(["circle","square"]),text:C.node,bgColor:C.string,textColor:C.string,className:C.string,style:C.object}),topSlot:C.shape({render:C.func,gradientStart:C.string,gradientEnd:C.string,text:C.node,textColor:C.string,className:C.string,style:C.object}),border:C.oneOfType([C.shape({color:C.string,motion:C.bool}),C.bool]),contentMotion:C.bool};cg.elementType="Avatar";const zO={PREFIX:`${Dn}-button`},Xh={sizes:["default","small","large"],iconPositions:["left","right"],htmlTypes:["button","reset","submit"],btnTypes:["primary","secondary","tertiary","warning","danger"],themes:["solid","borderless","light","outline"],DEFAULT_ICON_POSITION:"left"},ice={SIZE:["extra-small","small","default","large","extra-large","custom"]};var sce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const oce=Xh.sizes,{htmlTypes:ace,btnTypes:lce}=Xh;let l0=class extends R.PureComponent{render(){const n=this.props,{children:r,block:i,htmlType:s,loading:o,circle:a,className:l,style:u,disabled:h,size:p,theme:g,type:v,prefixCls:w,iconPosition:S}=n,E=sce(n,["children","block","htmlType","loading","circle","className","style","disabled","size","theme","type","prefixCls","iconPosition"]),x=Object.assign(Object.assign({disabled:h},s0(E,["x-semi-children-alias"])),{className:xe(w,{[`${w}-${v}`]:!h&&v,[`${w}-disabled`]:h,[`${w}-size-large`]:p==="large",[`${w}-size-small`]:p==="small",[`${w}-light`]:g==="light",[`${w}-block`]:i,[`${w}-circle`]:a,[`${w}-borderless`]:g==="borderless",[`${w}-outline`]:g==="outline",[`${w}-${v}-disabled`]:h&&v},l),type:s,"aria-disabled":h}),I={};return l&&l.includes("-with-icon")||(I["x-semi-prop"]=this.props["x-semi-children-alias"]||"children"),D.createElement("button",Object.assign({},x,{onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,style:u}),D.createElement("span",Object.assign({className:xe(`${w}-content`,this.props.contentClassName),onClick:P=>h&&P.stopPropagation()},I),r))}};l0.defaultProps={disabled:!1,size:"default",type:"primary",theme:"light",block:!1,htmlType:"button",onMouseDown:cc,onClick:cc,onMouseEnter:cc,onMouseLeave:cc,prefixCls:zO.PREFIX};l0.propTypes={children:C.node,disabled:C.bool,prefixCls:C.string,style:C.object,size:C.oneOf(oce),type:C.oneOf(lce),block:C.bool,onClick:C.func,onMouseDown:C.func,circle:C.bool,loading:C.bool,htmlType:C.oneOf(ace),theme:C.oneOf(Xh.themes),className:C.string,onMouseEnter:C.func,onMouseLeave:C.func,"aria-label":C.string,contentClassName:C.string};var cce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const uce=ice.SIZE;class Lr extends R.PureComponent{render(){const n=this.props,{children:r,iconPosition:i,iconSize:s,iconStyle:o,style:a,icon:l,noHorizontalPadding:u,theme:h,className:p,prefixCls:g,loading:v}=n,w=cce(n,["children","iconPosition","iconSize","iconStyle","style","icon","noHorizontalPadding","theme","className","prefixCls","loading"]),S=Object.assign({},a);Array.isArray(u)?(u.includes("left")&&(S.paddingLeft=0),u.includes("right")&&(S.paddingRight=0)):u===!0?(S.paddingLeft=0,S.paddingRight=0):typeof u=="string"&&(u==="left"&&(S.paddingLeft=0),u==="right"&&(S.paddingRight=0));let E=null,x=null;v&&!w.disabled?x=D.createElement(iF,null):D.isValidElement(l)&&(x=l);const I=xe({[`${g}-content-left`]:i==="right",[`${g}-content-right`]:i==="left"}),P=this.props["x-semi-children-alias"]||"children",M=r!=null?D.createElement("span",{className:I,"x-semi-prop":P},r):null;i==="left"?E=D.createElement(D.Fragment,null,x,M):E=D.createElement(D.Fragment,null,M,x);const k=xe(p,`${g}-with-icon`,{[`${g}-with-icon-only`]:M==null||M==="",[`${g}-loading`]:v});return D.createElement(l0,Object.assign({},w,{className:k,theme:h,style:S}),E)}}Lr.defaultProps={iconPosition:Xh.DEFAULT_ICON_POSITION,prefixCls:zO.PREFIX,loading:!1,noHorizontalPadding:!1,onMouseEnter:rt,onMouseLeave:rt};Lr.elementType="IconButton";Lr.propTypes={iconStyle:C.object,style:C.object,loading:C.bool,prefixCls:C.string,icon:C.oneOfType([C.object,C.string,C.node]),iconSize:C.oneOf(uce),noHorizontalPadding:C.oneOfType([C.bool,C.string,C.array]),children:C.node,theme:C.string,iconPosition:C.oneOf(Xh.iconPositions),className:C.string,onMouseEnter:C.func,onMouseLeave:C.func};const dce={PREFIX:`${Dn}-badge`},cD={TYPE_SET:["success","primary","secondary","tertiary","warning","danger"],THEME_SET:["solid","light","inverted"],POS_SET:["leftTop","leftBottom","rightTop","rightBottom"]};var hce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const gu=dce.PREFIX;class l_ extends R.PureComponent{render(){const{direction:n}=this.context,r=n==="rtl"?"leftTop":"rightTop",i=this.props,{count:s,dot:o,type:a,countClassName:l,countStyle:u,theme:h,position:p=r,overflowCount:g,style:v,children:w,className:S}=i,E=hce(i,["count","dot","type","countClassName","countStyle","theme","position","overflowCount","style","children","className"]),x=s&&!(Ki(s)||fr(s)),I=s!==null&&typeof s<"u",P=xe(l,{[`${gu}-${a}`]:!x,[`${gu}-${h}`]:!x,[`${gu}-${p}`]:!!p&&!!w,[`${gu}-block`]:!w,[`${gu}-dot`]:o,[`${gu}-count`]:!o&&!x&&I,[`${gu}-custom`]:x});let M;return Ki(s)?M=g&&g<s?`${g}+`:`${s}`:M=s,D.createElement("span",Object.assign({className:xe(gu,S)},E),w,D.createElement("span",{className:P,style:v||u,"x-semi-prop":"count"},o?null:M))}}l_.contextType=Ao;l_.propTypes={count:C.node,dot:C.bool,type:C.oneOf(cD.TYPE_SET),theme:C.oneOf(cD.THEME_SET),position:C.oneOf(cD.POS_SET),overflowCount:C.number,style:C.object,className:C.string,children:C.node,onClick:C.func,onMouseEnter:C.func,onMouseLeave:C.func,countClassName:C.string,countStyle:C.object};l_.defaultProps={dot:!1,type:"primary",theme:"solid",className:"",onClick:()=>rt,onMouseEnter:()=>rt,onMouseLeave:()=>rt};let Cr=class extends D.PureComponent{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(n)}render(){const n=Object.assign({},this.props),r=!!n.icon,i=!!n.loading,s=!!n.disabled;return r||i&&!s?D.createElement(Lr,Object.assign({},n)):D.createElement(l0,Object.assign({},n))}};Cr.__SemiComponentName__="Button";Cr.propTypes=Object.assign(Object.assign({},l0.propTypes),Lr.propTypes);Cr.defaultProps=Dc(Cr.__SemiComponentName__);Cr.elementType="Button";var fce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Em=zO.PREFIX,pce=Xh.sizes;class VO extends jr{getInnerWithLine(n){const r=[];return n.length>1?(n.slice(0,-1).forEach((i,s)=>{const o=ot(i,"type.elementType")==="Button",a=ot(i,"props"),{type:l,theme:u,disabled:h}=a??{};if(o&&u!=="outline"){const p=xe(`${Em}-group-line`,`${Em}-group-line-${u??"light"}`,`${Em}-group-line-${l??"primary"}`,{[`${Em}-group-line-disabled`]:h});r.push(i,D.createElement("span",{className:p,key:`line-${s}`}))}else r.push(i)}),r.push(n.slice(-1)),r):n}render(){const n=this.props,{children:r,disabled:i,size:s,type:o,className:a,style:l,"aria-label":u}=n,h=fce(n,["children","disabled","size","type","className","style","aria-label"]);let p,g=[];const v=xe(`${Em}-group`,a);return r&&(p=(Array.isArray(r)?r:[r]).map((w,S)=>{var E;return R.isValidElement(w)?R.cloneElement(w,Object.assign(Object.assign(Object.assign({disabled:i,size:s,type:o},w.props),h),{key:(E=w.key)!==null&&E!==void 0?E:S})):w}),g=this.getInnerWithLine(p)),D.createElement("div",{className:v,style:l,role:"group","aria-label":u},g)}}VO.propTypes={children:C.node,disabled:C.bool,type:C.string,size:C.oneOf(pce),theme:C.oneOf(Xh.themes),"aria-label":C.string};VO.defaultProps={size:"default"};const BO={PREFIX:`${Dn}-skeleton`};var gce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const yce=Ig.SIZE,mce=Ig.SHAPE,c_=e=>n=>r=>D.createElement(n,Object.assign({type:e},r));class Og extends R.PureComponent{render(){const n=this.props,{prefixCls:r,className:i,type:s,size:o,shape:a}=n,l=gce(n,["prefixCls","className","type","size","shape"]),u=xe(i,`${r}-${s}`,{[`${r}-${s}-${o}`]:s.toUpperCase()==="AVATAR"},{[`${r}-${s}-${a}`]:s.toUpperCase()==="AVATAR"});return D.createElement("div",Object.assign({className:u},l))}}Og.propTypes={type:C.string,prefixCls:C.string,style:C.object,className:C.string,size:C.oneOf(yce),shape:C.oneOf(mce)};Og.defaultProps={prefixCls:BO.PREFIX,size:"medium",shape:"circle"};const vce=c_("avatar")(Og),bce=c_("image")(Og),wce=c_("title")(Og),_ce=c_("button")(Og);let HO=class extends R.PureComponent{render(){const{prefixCls:n,className:r,style:i,rows:s}=this.props,o=xe(r,`${n}-paragraph`);return D.createElement("ul",{className:o,style:i},[...Array(s)].map((a,l)=>D.createElement("li",{key:l})))}};HO.propTypes={rows:C.number,prefixCls:C.string,style:C.object,className:C.string};HO.defaultProps={prefixCls:BO.PREFIX,rows:4};var Cce=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const kR=BO.PREFIX;class Vs extends R.PureComponent{render(){const n=this.props,{placeholder:r,active:i,children:s,className:o,loading:a,style:l}=n,u=Cce(n,["placeholder","active","children","className","loading","style"]),h=xe(kR,{[`${kR}-active`]:!!i},o);let p;return a?p=D.createElement("div",Object.assign({className:h,style:l},u,{"x-semi-prop":"placeholder"}),r):p=s,p}}Vs.Avatar=vce;Vs.Title=wce;Vs.Button=_ce;Vs.Paragraph=HO;Vs.Image=bce;Vs.defaultProps={loading:!0};Vs.propTypes={active:C.bool,placeholder:C.node,style:C.object,className:C.string,loading:C.bool,children:C.node};var Ece=zj();const xce=cn(Ece);var uD,LR;function Sce(){if(LR)return uD;LR=1;function e(n,r,i,s){for(var o=n.length,a=i+(s?1:-1);s?a--:++a<o;)if(r(n[a],a,n))return a;return-1}return uD=e,uD}var dD,jR;function Dce(){if(jR)return dD;jR=1;function e(n){return n!==n}return dD=e,dD}var hD,FR;function Nce(){if(FR)return hD;FR=1;function e(n,r,i){for(var s=i-1,o=n.length;++s<o;)if(n[s]===r)return s;return-1}return hD=e,hD}var fD,$R;function sF(){if($R)return fD;$R=1;var e=Sce(),n=Dce(),r=Nce();function i(s,o,a){return o===o?r(s,o,a):e(s,n,a)}return fD=i,fD}var pD,zR;function Ice(){if(zR)return pD;zR=1;var e=dj(),n=1/0,r=17976931348623157e292;function i(s){if(!s)return s===0?s:0;if(s=e(s),s===n||s===-1/0){var o=s<0?-1:1;return o*r}return s===s?s:0}return pD=i,pD}var gD,VR;function Oce(){if(VR)return gD;VR=1;var e=Ice();function n(r){var i=e(r),s=i%1;return i===i?s?i-s:i:0}return gD=n,gD}var yD,BR;function Tce(){if(BR)return yD;BR=1;var e=qw();function n(r,i){return e(i,function(s){return r[s]})}return yD=n,yD}var mD,HR;function Mce(){if(HR)return mD;HR=1;var e=Tce(),n=Ng();function r(i){return i==null?[]:e(i,n(i))}return mD=r,mD}var vD,UR;function Pce(){if(UR)return vD;UR=1;var e=sF(),n=od(),r=gj(),i=Oce(),s=Mce(),o=Math.max;function a(l,u,h,p){l=n(l)?l:s(l),h=h&&!p?i(h):0;var g=l.length;return h<0&&(h=o(g+h,0)),r(l)?h<=g&&l.indexOf(u,h)>-1:!!g&&e(l,u,h)>-1}return vD=a,vD}var Ace=Pce();const oF=cn(Ace);var bD,KR;function Rce(){if(KR)return bD;KR=1;var e=Jw(),n=Gh(),r=Mj(),i=od(),s=e0(),o=Ng(),a=Object.prototype,l=a.hasOwnProperty,u=r(function(h,p){if(s(p)||i(p)){n(p,o(p),h);return}for(var g in p)l.call(p,g)&&e(h,g,p[g])});return bD=u,bD}var kce=Rce();const Lce=cn(kce);var wD,WR;function aF(){if(WR)return wD;WR=1;var e=sF();function n(r,i){var s=r==null?0:r.length;return!!s&&e(r,i,0)>-1}return wD=n,wD}var _D,qR;function lF(){if(qR)return _D;qR=1;function e(n,r,i){for(var s=-1,o=n==null?0:n.length;++s<o;)if(i(r,n[s]))return!0;return!1}return _D=e,_D}var CD,GR;function jce(){if(GR)return CD;GR=1;var e=CO(),n=aF(),r=lF(),i=qw(),s=Zw(),o=EO(),a=200;function l(u,h,p,g){var v=-1,w=n,S=!0,E=u.length,x=[],I=h.length;if(!E)return x;p&&(h=i(h,s(p))),g?(w=r,S=!1):h.length>=a&&(w=o,S=!1,h=new e(h));e:for(;++v<E;){var P=u[v],M=p==null?P:p(P);if(P=g||P!==0?P:0,S&&M===M){for(var k=I;k--;)if(h[k]===M)continue e;x.push(P)}else w(h,M,g)||x.push(P)}return x}return CD=l,CD}var ED,YR;function Fce(){if(YR)return ED;YR=1;var e=jce(),n=Bj(),r=Tj(),i=Sj(),s=r(function(o,a){return i(o)?e(o,n(a,1,i,!0)):[]});return ED=s,ED}var $ce=Fce();const lw=cn($ce);var xD,XR;function zce(){if(XR)return xD;XR=1;var e=hO(),n=Kj(),r=Dg();function i(s,o,a){for(var l=-1,u=o.length,h={};++l<u;){var p=o[l],g=e(s,p);a(g,p)&&n(h,r(p,s),g)}return h}return xD=i,xD}var SD,ZR;function Vce(){if(ZR)return SD;ZR=1;function e(n,r){return n!=null&&r in Object(n)}return SD=e,SD}var DD,QR;function Bce(){if(QR)return DD;QR=1;var e=Dg(),n=t0(),r=Es(),i=e_(),s=mO(),o=Gw();function a(l,u,h){u=e(u,l);for(var p=-1,g=u.length,v=!1;++p<g;){var w=o(u[p]);if(!(v=l!=null&&h(l,w)))break;l=l[w]}return v||++p!=g?v:(g=l==null?0:l.length,!!g&&s(g)&&i(w,g)&&(r(l)||n(l)))}return DD=a,DD}var ND,JR;function Hce(){if(JR)return ND;JR=1;var e=Vce(),n=Bce();function r(i,s){return i!=null&&n(i,s,e)}return ND=r,ND}var ID,ek;function Uce(){if(ek)return ID;ek=1;var e=zce(),n=Hce();function r(i,s){return e(i,s,function(o,a){return n(i,a)})}return ID=r,ID}var OD,tk;function Kce(){if(tk)return OD;tk=1;var e=Uce(),n=Hj(),r=n(function(i,s){return i==null?{}:e(i,s)});return OD=r,OD}var Wce=Kce();const cw=cn(Wce);var TD,nk;function qce(){if(nk)return TD;nk=1;var e=Qv();function n(r,i,s){for(var o=-1,a=r.length;++o<a;){var l=r[o],u=i(l);if(u!=null&&(h===void 0?u===u&&!e(u):s(u,h)))var h=u,p=l}return p}return TD=n,TD}var MD,rk;function Gce(){if(rk)return MD;rk=1;function e(n,r){return n>r}return MD=e,MD}var PD,ik;function Yce(){if(ik)return PD;ik=1;var e=qce(),n=Gce(),r=t_();function i(s){return s&&s.length?e(s,r,n):void 0}return PD=i,PD}var Xce=Yce();const Zce=cn(Xce);var AD,sk;function Qce(){if(sk)return AD;sk=1;var e=$j(),n=oj(),r=xO(),i=1/0,s=e&&1/r(new e([,-0]))[1]==i?function(o){return new e(o)}:n;return AD=s,AD}var RD,ok;function Jce(){if(ok)return RD;ok=1;var e=CO(),n=aF(),r=lF(),i=EO(),s=Qce(),o=xO(),a=200;function l(u,h,p){var g=-1,v=n,w=u.length,S=!0,E=[],x=E;if(p)S=!1,v=r;else if(w>=a){var I=h?null:s(u);if(I)return o(I);S=!1,v=i,x=new e}else x=h?[]:E;e:for(;++g<w;){var P=u[g],M=h?h(P):P;if(P=p||P!==0?P:0,S&&M===M){for(var k=x.length;k--;)if(x[k]===M)continue e;h&&x.push(M),E.push(P)}else v(x,M,p)||(x!==E&&x.push(M),E.push(P))}return E}return RD=l,RD}var kD,ak;function eue(){if(ak)return kD;ak=1;var e=Jce();function n(r){return r&&r.length?e(r):[]}return kD=n,kD}var tue=eue();const nue=cn(tue),cF={PREFIX:`${Dn}-tree`,PREFIX_OPTION:`${Dn}-tree-option`};function uF(e,n){return`${e}-${n}`}function u_(e){return!kh(e)&&!kr(e)}function Cu(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const s=[],o=!!i,a=ot(r,"key","key"),l=ot(r,"children","children");if(kr(e))return[];function u(h){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map((g,v)=>{const w=uF(p?p.pos:"0",v),S=g[a],E={};r&&Object.entries(s0(r,"children")).forEach(P=>{let[M,k]=P;const A=g[k];!kr(A)&&(E[M]=A)});const x=Object.assign(Object.assign(Object.assign({},cw(g,["key","label","value","icon","disabled","isLeaf"])),E),{parent:p,pos:w,children:null,data:g,_innerDataTag:!0,isEnd:[...p?p.isEnd:[],v===h.length-1]}),I=typeof i=="boolean";return(!o||!I&&i.has(S))&&s.push(x),n.has(S)&&(!o||!I&&i.has(S))?x.children=u(g[l]||[],x):x.children=[],x})}return u(e),s}function rue(e,n,r){const i=ot(r,"key","key"),s=ot(r,"children","children"),o=(a,l,u)=>{const h=a?a[s]:e,p=a?uF(u.pos,l):"0";if(a){const g=ot(a,i,null),v={data:Object.assign({},a),ind:l,pos:p,key:g!==null?g:p,parentPos:u.node?u.pos:null,level:Number(u.level)+1};n(v)}h&&h.forEach((g,v)=>{o(g,v,{node:a,pos:p,level:u?Number(u.level)+1:-1})})};o(null)}function iue(e,n){const r={},i={},s={},o={posEntities:r,keyEntities:i,valueEntities:s},a=ot(n,"value","value");return rue(e,l=>{const{pos:u,key:h,parentPos:p}=l,g=Object.assign({},l),v=ot(g,`data.${a}`,null);v!==null&&(s[v]=h),r[u]=g,i[h]=g,g.parent=r[p],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g))},n),o}function dh(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!u_(e))return[];if(!r&&Array.isArray(e)?e=e.length?[e[0]]:[]:Array.isArray(e)||(e=[e]),$n(n))return e;const i=[];return e.forEach(s=>{s in n?i.push(n[s]):s&&i.push(s)}),i}function tl(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[],s=o=>{if(!o)return;const{children:a}=o;u_(a)&&a.forEach(u=>{i.push(u.key),s(n[u.key])})};return e.forEach(o=>{r&&i.push(o),s(n[o])}),i}function sue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const i=[];return e&&e.forEach(s=>{const o=n[s];o&&o.children&&o.children.forEach(a=>{(!r.length||!r.includes(a.key))&&i.push(a.key)})}),i}function UO(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];return e.forEach(o=>{n[o]&&n[o].parent&&i.push(n[o].parent.key)}),sue(nue(i),n,r?[]:e)}function nl(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[],s=o=>{o.parent&&(i.push(o.parent.key),s(o.parent))};return e.forEach(o=>{n[o]&&s(n[o]),r&&i.push(o)}),i}function oue(e,n){const r={};return e.forEach(i=>{if(!n[i])return;const{level:s}=n[i];r[s]?r[s].push(i):r[s]=[i]}),r}function c0(e,n){const r=Array.isArray(e)?e:[e],i=tl(r,n,!0),s=new Set([...i]);let o=new Set([]),a=[];const l=oue(r,n),u=h=>{const{key:p,parent:g,level:v}=h;if(!g||a.includes(p))return;const w=UO([p],n);if(a=[...a,...w],w.every(E=>s.has(E)))s.add(g.key),v-1 in l&&v?l[v-1].push(g.key):l[v-1]=[g.key];else{const E=nl([p],n,!1);o=new Set([...o,...E])}};for(;!$n(l);){const h=Zce(Object.keys(l).map(p=>Number(p)));l[h].forEach(p=>u(n[p])),delete l[h]}return{checkedKeys:s,halfCheckedKeys:o}}function LD(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(Array.isArray(e)||(e=[e]),r){const i=nl(e,n,!0);return new Set(i)}return new Set(e)}function lk(e,n,r,i){const s=dh(e,i,r);return new Set(nl(s,n,!1))}function ck(e,n,r){let i="show";const s=[...e],o=[...n];if(Math.abs(s.length-o.length)!==1)return{motionType:i,motionKeys:[]};let a=[];return s.length>o.length?(i="hide",a=lw(s,o)):a=lw(o,s),{motionType:a.length===1?i:"show",motionKeys:a.length===1?tl(a,r,!1):[]}}function dF(e,n,r,i){if(!r)return!0;let s=r,o=n;return typeof r=="boolean"&&(s=(a,l)=>{const u=a.toLowerCase();return l.toString().toLowerCase().includes(u)}),i&&(o=n[i]),s(e,o,n)}function ra(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3?arguments[3]:void 0;const s=[],o=new Set(e);return r?e.forEach(a=>{n[a]&&!u_(n[a].children)&&s.push(a),!n[a]&&i&&s.push(a)}):e.forEach(a=>{if(!n[a]){i&&s.push(a);return}const{parent:l}=n[a];l&&o.has(l.key)||s.push(a)}),s}function uk(e,n,r){const i=[],s=o=>{r[o].children&&r[o].children.forEach(a=>{const{key:l}=a;i.push(l),n.has(l)&&s(l)})};return s(e),i}function hF(e,n,r,i){const s=tl([e],n,!0),o=n[e];r=new Set([...r,e]);const a=l=>{if(!l.parent)return;const{key:u}=l;if(UO([u],n).every(g=>r.has(g))){const g=l.parent;r.add(g.key),a(g)}else{const g=nl([u],n,!1);i=new Set([...i,...g])}};return a(o),{checkedKeys:new Set([...r,...s]),halfCheckedKeys:i}}function fF(e,n,r,i){const s=tl([e],n,!0),o=n[e];s.forEach(l=>{r.has(l)&&r.delete(l),i.has(l)&&i.delete(l)});const a=l=>{const u=l.parent;if(!u||!r.has(u.key)&&!i.has(u.key))return;const{key:h}=l,g=UO([h],n).some(w=>r.has(w)||i.has(w)),v=nl([h],n,!1);g?v.forEach(w=>{r.has(w)&&(r.delete(w),i.add(w))}):(r.has(u.key)&&r.delete(u.key),i.has(u.key)&&i.delete(u.key),a(u))};return o&&a(o),{checkedKeys:r,halfCheckedKeys:i}}function aue(e){const{showFilteredOnly:n,keyEntities:r,inputValue:i,treeData:s,filterTreeNode:o,filterProps:a,prevExpandedKeys:l,keyMaps:u}=e;let h=[];h=Object.values(r).filter(S=>dF(i,S.data,o,a)).map(S=>S.key);let p=nl(h,r,!1);if(l.length){const S=l.filter(E=>!!r[E]);p=p.concat(S)}const g=tl(h,r,!0),v=new Set([...g,...p]);return{flattenNodes:Cu(s,new Set(p),u,n&&v),filteredKeys:new Set(h),filteredExpandedKeys:new Set(p),filteredShownKeys:v}}function uw(e,n){const r=ot(n,"value","value"),i=ot(n,"key","key");return Array.isArray(e)?e.map(s=>ot(s,r,s[i])):ot(e,r,e[i])}function yu(e,n,r){return n&&u_(e)?uw(e,r):e}function dk(e,n){return[...e].filter(i=>i in n)}function pF(e,n){const r=ot(n,"disabled","disabled"),i=Object.keys(e).filter(o=>e[o].data[r]),{checkedKeys:s}=c0(i,e);return s}const gF={PREFIX:`${Dn}-cascader`,PREFIX_OPTION:`${Dn}-cascader-option`},ir={SIZE_SET:["small","large","default"],VALIDATE_STATUS:["success","default","error","warning"],SHOW_NEXT_BY_CLICK:"click",SHOW_NEXT_BY_HOVER:"hover",LEAF_ONLY_MERGE_TYPE:"leafOnly",AUTO_MERGE_VALUE_MERGE_TYPE:"autoMergeValue",NONE_MERGE_TYPE:"none",SEARCH_POSITION_TRIGGER:"trigger",RELATED:"related",UN_RELATED:"unRelated"},yF="_SEMI_CASCADER_SPLIT_";function lue(e,n){return`${e}-${n}`}function cue(e){return!kh(e)&&!kr(e)}function uue(e){return Array.isArray(e)?e:[e]}function due(e,n,r,i){if(!r)return!0;let s=r,o;return typeof r=="boolean"?(s=(a,l)=>{const u=a.toLowerCase();return l.toLowerCase().includes(u)},o=i.join("")):o=i.join(),s(e,o,n)}function hue(e,n){const r=(i,s,o)=>{const a=i?i.children:e;let l=null;if(i){const u=o?`${o.key}${yF}${i.value}`:`${i.value}`,h=o?lue(o.pos,s):`${s}`;l={data:Object.assign({},i),ind:s,key:u,pos:h,level:o?o.level+1:0,parentKey:o?o.key:null,path:o?[...o.path,u]:[u],valuePath:o?[...o.valuePath,i.value]:[i.value]},n(l)}a&&a.forEach((u,h)=>{r(u,h,l)})};r(null)}function fue(e){return e!=null&&e.length?Array.isArray(e[0])?e.map(n=>dw(n)):[dw(e)]:[]}function dw(e){return e.join(yF)}function pue(e,n){const r=e.split("-").map(o=>Number(o));let i=n,s=[];return r.forEach((o,a)=>{var l;i=a===0?i[o]:(l=i==null?void 0:i.children)===null||l===void 0?void 0:l[o],s.push(i==null?void 0:i.value)}),dw(s)}function mF(e){const n={};return hue(e,r=>{const{key:i,parentKey:s}=r,o=Object.assign({},r);n[i]=o,o.parent=n[s],o.parent&&(o.parent.children=o.parent.children||[],o.parent.children.push(o))}),n}function KN(e,n){let r;return n?r=ir.LEAF_ONLY_MERGE_TYPE:e?r=ir.AUTO_MERGE_VALUE_MERGE_TYPE:r=ir.NONE_MERGE_TYPE,r}class gue extends li{constructor(n){super(Object.assign({},n)),this.handleKeyDown=r=>{r.key===Jj&&this.getState("isOpen")&&this.close(r)},this.updateSearching=r=>{this._adapter.updateStates({isSearching:!1})},this.handleTagRemoveByKey=r=>{var i,s;const{keyEntities:o}=this.getStates(),{disabled:a}=this.getProps();if(a)return;const l=(i=o[r])!==null&&i!==void 0?i:{};!(!((s=l==null?void 0:l.data)===null||s===void 0)&&s.disable)&&this._handleMultipleSelect(l),this._adapter.rePositionDropdown()},this.handleTagRemoveInTrigger=r=>{const{treeData:i}=this.getStates(),s=pue(r,i);this.handleTagRemoveByKey(s)}}init(){const n=this.getProp("open")||this.getProp("defaultOpen");this.collectOptions(!0),this._adapter.updateLoadingKeyRefValue(new Set),this._adapter.updateLoadedKeyRefValue(new Set),n&&!this._isDisabled()&&this.open()}_setEmptyContentMinWidth(){const{style:n}=this.getProps();let r;n&&Ki(n.width)||n&&fr(n.width)&&!n.width.includes("%")?r=n.width:r=this._adapter.getTriggerWidth(),this._adapter.setEmptyContentMinWidth(r)}destroy(){this._adapter.unregisterClickOutsideHandler()}_isDisabled(){return this.getProp("disabled")}_isFilterable(){return!!this.getProp("filterTreeNode")}_notifyChange(n){const{onChangeWithObject:r,multiple:i}=this.getProps(),s=r?[]:"value";if(i){const o=[];n.forEach(a=>{const l=this.getItemPropPath(a,s);o.push(l)}),this._adapter.notifyChange(o)}else{const o=kr(n)||!("key"in n)?[]:this.getItemPropPath(n.key,s);this._adapter.notifyChange(o)}}_isLeaf(n){return this.getProp("loadData")?!!n.isLeaf:!n.children||!n.children.length}_clearInput(){this._adapter.updateInputValue("")}_notifyBlur(n){this._adapter.notifyBlur(n)}_notifyFocus(n){this._adapter.notifyFocus(n)}_isOptionDisabled(n,r){return nl([n],r,!0).some(s=>r[s].data.disabled)}getItemPropPath(n,r,i){const s=i||this.getState("keyEntities"),o=s[n];let a=[];if(o)if(o._notExist)a=o.path;else{const l=o.path;a=Array.isArray(r)?l.map(u=>s[u].data):l.map(u=>s[u].data[r])}return a}_getCacheValue(n){const{selectedKeys:r}=this.getStates(),i=Array.from(r)[0];let s;if($n(n[i]))if(oF(i,"not-exist-")){const o=i.match(/not-exist-(\S*)/)[1];$n(n[o])?s=o:s=n[o].valuePath}else s=i;else s=n[i].valuePath;return s}collectOptions(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{treeData:r,value:i,defaultValue:s}=this.getProps(),o=mF(r);this._adapter.rePositionDropdown();let a;n?a=s:$n(o)||(a=this._getCacheValue(o));const l=this._isControlledComponent()?kr(i)?[]:i:a;cue(l)?this.updateSelectedKey(l,o):this._adapter.updateStates({keyEntities:o})}handleValueChange(n){const{keyEntities:r}=this.getStates();this.updateSelectedKey(n,r)}_getClearSelectedKey(n){const r={},{searchPlaceholder:i,placeholder:s,multiple:o}=this.getProps();return r.selectedKeys=new Set([]),r.activeKeys=new Set([]),r.filteredKeys=new Set([]),n&&!o&&(r.inputPlaceHolder=i||s||"",r.inputValue=""),r}updateSelectedKey(n,r){const{changeOnSelect:i,onChangeWithObject:s,multiple:o}=this.getProps(),{activeKeys:a,loading:l,keyEntities:u,selectedKeys:h}=this.getStates(),p=this._adapter.getLoadingKeyRefValue(),g=this._isFilterable(),v=[...a].filter(M=>p.has(M)),w=uue(n),S=s&&pj(w[0])?w.map(M=>M.value):w,E=fue(S);let x={};const I=E.length>0?E[0]:void 0,P=I?r[I]:void 0;if(P)if(i||this._isLeaf(P.data)){if(x.selectedKeys=new Set([I]),v.length||(x.activeKeys=new Set(P.path)),g&&!o){const M=this.renderDisplayText(I,r);x.inputPlaceHolder=M}}else Qs(E,Array.from(h))&&(x=this._getClearSelectedKey(g));else if(n&&n.length){const M=S[S.length-1],k=`not-exist-${M}`,A={data:{label:M,value:M},key:k,path:S,_notExist:!0};if(x.selectedKeys=new Set([k]),g&&!o){const j=this._defaultRenderText(S);x.inputPlaceHolder=j}r[k]=A}else if(l){x.keyEntities=Lce(u,r),this._adapter.updateStates(x);return}else x=this._getClearSelectedKey(g);x.keyEntities=r,this._adapter.updateStates(x)}open(){const n=this._isFilterable(),{multiple:r}=this.getProps();this._adapter.openMenu(),n&&(this._clearInput(),!r&&this.toggle2SearchInput(!0)),this._isControlledComponent()&&this.reCalcActiveKeys(),this._adapter.notifyDropdownVisibleChange(!0),this._adapter.registerClickOutsideHandler(i=>this.close(i)),this._setEmptyContentMinWidth()}reCalcActiveKeys(){const{selectedKeys:n,activeKeys:r,keyEntities:i}=this.getStates(),s=[...n][0],o=i[s];if(!o)return;const a=new Set(o.path);Qs(a,r)||this._adapter.updateStates({activeKeys:a})}close(n,r){const{multiple:i}=this.getProps();if(this._adapter.closeMenu(),this._adapter.notifyDropdownVisibleChange(!1),this._adapter.unregisterClickOutsideHandler(),this._isFilterable()){const{selectedKeys:s,isSearching:o}=this.getStates();let a="";r&&!i?a=this.renderDisplayText(r):s.size&&!i&&(a=this.renderDisplayText([...s][0])),this._adapter.updateStates({inputValue:a}),!i&&this.toggle2SearchInput(!1),!i&&this._adapter.updateFocusState(!1)}this._notifyBlur(n)}focus(){const{filterTreeNode:n}=this.getProps();n&&this._adapter.focusInput(),this._adapter.updateFocusState(!0)}blur(){const{filterTreeNode:n}=this.getProps();n&&this._adapter.blurInput(),this._adapter.updateFocusState(!1)}toggle2SearchInput(n){n?this._adapter.toggleInputShow(n,()=>this.focus()):this._adapter.toggleInputShow(n,()=>{})}handleItemClick(n,r){this._isDisabled()||(this.handleSingleSelect(n,r),this._adapter.rePositionDropdown())}handleItemHover(n,r){this._isDisabled()||this.handleShowNextByHover(r)}handleShowNextByHover(n){const{keyEntities:r}=this.getStates(),{data:i,key:s}=n,o=this._isLeaf(i),a=r[s].path;this._adapter.updateStates({activeKeys:new Set(a)}),o||this.notifyIfLoadData(n)}onItemCheckboxClick(n){this._isDisabled()||(this._handleMultipleSelect(n),this._adapter.rePositionDropdown())}handleClick(n){const r=this._isDisabled(),i=this._isFilterable(),{isOpen:s}=this.getStates();r||(s?s&&!i&&this.close(n):(this.open(),this._notifyFocus(n)))}handleSelectionEnterPress(n){ua(n)&&this.handleClick(n)}toggleHoverState(n){this._adapter.toggleHovering(n)}_defaultRenderText(n,r){const i=this.getProp("separator");return r&&typeof r=="function"?r(n):n.join(i)}renderDisplayText(n,r){const i=this.getProp("displayRender"),s=this.getProp("displayProp"),o=this.getItemPropPath(n,s,r);return this._defaultRenderText(o,i)}handleNodeLoad(n){const{data:r,key:i}=n,s=new Set(this._adapter.getLoadingKeyRefValue()),a=new Set(this._adapter.getLoadedKeyRefValue()).add(i),l=new Set([...s]);l.delete(i),this._adapter.notifyOnLoad(a,r),this._adapter.updateLoadingKeyRefValue(l),this._adapter.updateLoadedKeyRefValue(a),this._adapter.updateStates({loadingKeys:l,loadedKeys:a})}notifyIfLoadData(n){const{data:r,key:i}=n;if(this._adapter.updateStates({loading:!1}),!r.isLeaf&&!r.children&&this.getProp("loadData")){const s=this._adapter.getLoadedKeyRefValue(),o=new Set(this._adapter.getLoadingKeyRefValue());if(s.has(i)||o.has(i))return;this._adapter.updateStates({loading:!0});const{keyEntities:a}=this.getStates(),l=this.getItemPropPath(i,[],a),u=o.add(i);this._adapter.updateLoadingKeyRefValue(u),this._adapter.updateStates({loadingKeys:u}),this._adapter.notifyLoadData(l,this.handleNodeLoad.bind(this,n))}}handleSingleSelect(n,r){const{changeOnSelect:i,filterLeafOnly:s,multiple:o,enableLeafClick:a}=this.getProps(),{keyEntities:l,selectedKeys:u,isSearching:h}=this.getStates(),p=this._isFilterable(),{data:g,key:v}=r,w=this._isLeaf(g),S=l[v].path,E=[v],x=v!==[...u][0];if(!w&&!i&&!h){this._adapter.updateStates({activeKeys:new Set(S)}),this.notifyIfLoadData(r);return}if(o)this._adapter.updateStates({activeKeys:new Set(S)}),w&&a&&this.onItemCheckboxClick(r);else if(this._adapter.notifySelect(g.value),x){if(this._notifyChange(r),this.notifyIfLoadData(r),this._isControlledComponent()){this._adapter.updateStates({activeKeys:new Set(S)}),w&&this.close(n);return}this._adapter.updateStates({activeKeys:new Set(S),selectedKeys:new Set(E)});const I=this.renderDisplayText(v);p&&this._adapter.updateInputPlaceHolder(I),w?this.close(n,v):!s&&h&&this.close(n,v)}else this.close(n)}_handleMultipleSelect(n){const{checkRelation:r}=this.getProps();r===ir.RELATED?this._handleRelatedMultipleSelect(n):r==="unRelated"&&this._handleUnRelatedMultipleSelect(n),this._adapter.updateStates({inputValue:""})}_handleRelatedMultipleSelect(n){const{key:r}=n,{checkedKeys:i,keyEntities:s,resolvedCheckedKeys:o}=this.getStates(),{autoMergeValue:a,max:l,disableStrictly:u,leafOnly:h}=this.getProps(),p=i.has(r),g=u?this.calcCheckedStatus(!p,r):!p,{checkedKeys:v,halfCheckedKeys:w}=u?this.calcNonDisabledCheckedKeys(r,g):this.calcCheckedKeys(r,g),S=KN(a,h),E=S===ir.LEAF_ONLY_MERGE_TYPE,x=S===ir.NONE_MERGE_TYPE,I=new Set(ra(v,s,E)),P=x?v:I;if(Ki(l)){if(x){if(i.size<v.size&&v.size>l){const M=[];v.forEach(k=>{M.push(s[k])}),this._adapter.notifyOnExceed(M);return}}else if(o.size<I.size&&I.size>l){const M=[];I.forEach(k=>{M.push(s[k])}),this._adapter.notifyOnExceed(M);return}}this._isControlledComponent()||this._adapter.updateStates({checkedKeys:v,halfCheckedKeys:w,resolvedCheckedKeys:I}),this._notifyChange(P),g&&this._notifySelect(P)}_handleUnRelatedMultipleSelect(n){const{key:r}=n,{checkedKeys:i,keyEntities:s}=this.getStates(),{max:o}=this.getProps(),a=new Set(i);let l;if(i.has(r))a.delete(r),l=!1;else{if(Ki(o)&&i.size>=o){const h=[];i.forEach(p=>{h.push(s[p])}),this._adapter.notifyOnExceed(h);return}a.add(r),l=!0}this._isControlledComponent()||this._adapter.updateStates({checkedKeys:a}),this._notifyChange(a),l&&this._notifySelect(a)}calcNonDisabledCheckedKeys(n,r){const{keyEntities:i,disabledKeys:s}=this.getStates(),o=new Set(this.getState("checkedKeys")),a=ra(tl([n],i,!1),i,!0);if(!a.some(p=>s.has(p)))return this.calcCheckedKeys(n,r);const u=a.filter(p=>!s.has(p)),h=r?[...u,...o]:lw(ra([...o],i,!0),u);return c0(h,i)}calcCheckedStatus(n,r){if(!n)return n;const{checkedKeys:i,keyEntities:s,disabledKeys:o}=this.getStates(),a=ra(tl([r],s,!1),s,!0);return a.some(p=>o.has(p))?!a.filter(p=>!o.has(p)).every(p=>i.has(p)):n}_notifySelect(n){const{keyEntities:r}=this.getStates(),i=[];n.forEach(o=>{var a,l;const u=(l=(a=r[o])===null||a===void 0?void 0:a.data)===null||l===void 0?void 0:l.value;u!==void 0&&i.push(u)});const s=i.length===1?i[0]:i;this._adapter.notifySelect(s)}calcCheckedKeys(n,r){const{keyEntities:i}=this.getStates(),s=new Set(this.getState("checkedKeys")),o=new Set(this.getState("halfCheckedKeys"));return r?hF(n,i,s,o):fF(n,i,s,o)}handleInputChange(n){this._adapter.updateInputValue(n);const{keyEntities:r}=this.getStates(),{treeNodeFilterProp:i,filterTreeNode:s,filterLeafOnly:o}=this.getProps();let a=[];n&&(a=Object.values(r).filter(l=>{const{key:u,_notExist:h,data:p}=l;if(h)return!1;const g=this.getItemPropPath(u,i);return due(n,p,s,g)}).filter(l=>s&&!o||this._isLeaf(l)).map(l=>l.key)),this._adapter.updateStates({isSearching:!!n,filteredKeys:new Set(a)}),this._adapter.notifyOnSearch(n),this._adapter.rePositionDropdown()}handleClear(){const{isSearching:n}=this.getStates(),{searchPlaceholder:r,placeholder:i,multiple:s}=this.getProps(),o=this._isFilterable(),a=this._isControlledComponent(),l={};s?(l.isSearching=!1,this._adapter.updateInputValue(""),this._adapter.notifyOnSearch(""),l.checkedKeys=new Set([]),l.halfCheckedKeys=new Set([]),l.selectedKeys=new Set([]),l.activeKeys=new Set([]),l.resolvedCheckedKeys=new Set([]),this._adapter.notifyChange([])):o&&n?(l.isSearching=!1,this._adapter.updateInputValue(""),this._adapter.notifyOnSearch("")):(o&&(l.inputValue="",l.inputPlaceHolder=r||i||"",this._adapter.updateInputValue(""),this._adapter.notifyOnSearch("")),a||(l.selectedKeys=new Set([])),l.activeKeys=new Set([]),l.filteredKeys=new Set([]),this._adapter.notifyChange([])),this._adapter.updateStates(l),this._adapter.notifyClear(),this._adapter.rePositionDropdown()}handleClearEnterPress(n){ua(n)&&this.handleClear()}getRenderData(){const{keyEntities:n,isSearching:r}=this.getStates(),i=this._isFilterable();return r&&i?this.getFilteredData():Object.values(n).filter(s=>s.parentKey===null&&!s._notExist).sort((s,o)=>parseInt(s.ind,10)-parseInt(o.ind,10))}getFilteredData(){const{treeNodeFilterProp:n,filterSorter:r}=this.getProps(),{filteredKeys:i,keyEntities:s,inputValue:o}=this.getStates(),a=[];return[...i].forEach(u=>{const h=s[u];if(!h)return;const p=this.getItemPropPath(u,[]),g=p.map(w=>w[n]),v=this._isOptionDisabled(u,s);a.push({data:h.data,pathData:p,key:u,disabled:v,searchText:g})}),sr(r)&&a.sort((u,h)=>r(u.pathData,h.pathData,o)),a}handleListScroll(n,r){const{activeKeys:i,keyEntities:s}=this.getStates(),o=[...i][i.size-1],a=o?ot(s,[o,"data"],null):null;this._adapter.notifyListScroll(n,{panelIndex:r,activeNode:a})}}var jD,hk;function yue(){if(hk)return jD;hk=1;var e=Sc(),n=Po(),r="[object Boolean]";function i(s){return s===!0||s===!1||n(s)&&e(s)==r}return jD=i,jD}var mue=yue();const vue=cn(mue),Cb={PREFIX:`${Dn}-checkbox`,INPUT:`${Dn}-checkbox-input`,WRAPPER:""},bue={PREFIX:`${Dn}-checkboxGroup`},Za={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class wue extends li{constructor(n){super(Object.assign({},n)),this.clickState=!1,this.handleFocusVisible=r=>{const{target:i}=r;try{if(this.clickState){this.clickState=!1;return}i.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{Lu(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:n,extra:r,extraId:i,addonId:s}=this.getProps();n&&!s&&this._adapter.setAddonId(),r&&!i&&this._adapter.setExtraId()}notifyChange(n,r){const i=this._adapter.generateEvent(n,r);this._adapter.notifyChange(i)}handleChange(n){if(this.getProp("disabled"))return;if((n==null?void 0:n.type)==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(n);return}const o=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(o,n):(this.setChecked(o),this.notifyChange(o,n))}handleChangeInGroup(n){const{value:r}=this.getProps(),o=!this._adapter.getGroupValue().includes(r),a=this._adapter.generateEvent(o,n);this._adapter.notifyChange(a),this._adapter.notifyGroupChange(a)}handleEnterPress(n){ua(n)&&this.handleChange(n)}setChecked(n){this._adapter.setNativeControlChecked(n)}destroy(){}}const KO=D.createContext({});class d_ extends R.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:n}=this.props;this.inputEntity.focus({preventScroll:n})}render(){const{indeterminate:n,checked:r,disabled:i,prefixCls:s,name:o,isPureCardType:a,addonId:l,extraId:u,focusInner:h,onInputFocus:p,onInputBlur:g}=this.props,v=s||Cb.PREFIX,w=xe({[`${v}-inner`]:!0,[`${v}-inner-checked`]:!!r,[`${v}-inner-pureCardType`]:a},Cb.WRAPPER),S=xe({[`${v}-inner-display`]:!0,[`${v}-focus`]:h,[`${v}-focus-border`]:h&&!r}),E=r?D.createElement(Iae,null):n?D.createElement(Dae,null):null,x={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":i,"aria-checked":r,"aria-labelledby":l,"aria-describedby":u||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:Cb.INPUT,onChange:rt,checked:r,disabled:i,onFocus:p,onBlur:g};return o&&(x.name=o),D.createElement("span",{className:w},D.createElement("input",Object.assign({},x,{ref:I=>{this.inputEntity=I}})),D.createElement("span",{className:S},E))}}d_.contextType=KO;d_.propTypes={"aria-describedby":C.string,"aria-errormessage":C.string,"aria-invalid":C.bool,"aria-labelledby":C.string,"aria-required":C.bool,checked:C.bool,disabled:C.bool,onChange:C.func,children:C.node,grouped:C.bool,value:C.any,isPureCardType:C.bool,addonId:C.string,extraId:C.string,focusInner:C.bool,onInputFocus:C.func,onInputBlur:C.func,preventScroll:C.bool};d_.defaultProps={onChange:rt};class Xu extends jr{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:n=>{this.setState({checked:n})},notifyChange:n=>{const{onChange:r}=this.props;r&&r(n)},generateEvent:(n,r)=>{const{props:i}=this;return{target:Object.assign(Object.assign({},i),{checked:n}),stopPropagation:()=>{r.stopPropagation()},preventDefault:()=>{r.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{r.nativeEvent&&typeof r.nativeEvent.stopImmediatePropagation=="function"&&r.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:n=>{this.context.checkboxGroup.onChange(n)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:sw({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:sw({prefix:"extra"})})},setFocusVisible:n=>{this.setState({focusVisible:n})},focusCheckboxEntity:()=>{this.focus()}})}constructor(n){super(n),this.handleChange=i=>this.foundation.handleChange(i),this.handleEnterPress=i=>this.foundation.handleEnterPress(i),this.handleFocusVisible=i=>{this.foundation.handleFocusVisible(i)},this.handleBlur=i=>{this.foundation.handleBlur()};const r=!1;this.state={checked:n.checked||n.defaultChecked||r,addonId:n.addonId,extraId:n.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new wue(this.adapter)}componentDidUpdate(n){this.props.checked!==n.checked&&(kr(this.props.checked)?this.foundation.setChecked(!1):vue(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:n,style:r,prefixCls:i,className:s,indeterminate:o,children:a,onMouseEnter:l,onMouseLeave:u,extra:h,value:p,role:g,tabIndex:v,id:w,type:S}=this.props,{checked:E,addonId:x,extraId:I,focusVisible:P}=this.state,M={checked:E,disabled:n},k=this.isInGroup();if(k){if(this.context.checkboxGroup.value){const te=(this.context.checkboxGroup.value||[]).includes(p);M.checked=te}this.context.checkboxGroup.disabled&&(M.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:H,isPureCardType:Y}=this.context.checkboxGroup;M.isCardType=H,M.isPureCardType=Y,M.name=this.context.checkboxGroup.name}else M.isPureCardType=S===Za.TYPE_PURECARD,M.isCardType=S===Za.TYPE_CARD||M.isPureCardType;const A=i||Cb.PREFIX,j=M.isCardType||M.isPureCardType,V=xe(A,{[`${A}-disabled`]:M.disabled,[`${A}-indeterminate`]:o,[`${A}-checked`]:M.checked,[`${A}-unChecked`]:!M.checked,[`${A}-cardType`]:M.isCardType,[`${A}-cardType_disabled`]:M.disabled&&M.isCardType,[`${A}-cardType_enable`]:!(M.disabled&&M.isCardType),[`${A}-cardType_checked`]:M.isCardType&&M.checked&&!M.disabled,[`${A}-cardType_checked_disabled`]:M.isCardType&&M.checked&&M.disabled,[s]:!!s,[`${A}-focus`]:P&&j}),$=xe(`${A}-extra`,{[`${A}-cardType_extra_noChildren`]:M.isCardType&&!a});k&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",B=()=>!a&&!h?null:D.createElement("div",{className:`${A}-content`},a?D.createElement("span",{id:x,className:`${A}-addon`,"x-semi-prop":W},a):null,h?D.createElement("div",{id:I,className:$,"x-semi-prop":"extra"},h):null);return D.createElement("span",Object.assign({role:g,tabIndex:v,style:r,className:V,id:w,onMouseEnter:l,onMouseLeave:u,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),D.createElement(d_,Object.assign({},this.props,M,{addonId:a&&x,extraId:h&&I,isPureCardType:M.isPureCardType,ref:H=>{this.checkboxEntity=H},focusInner:P&&!j,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),B())}}Xu.contextType=KO;Xu.propTypes={"aria-describedby":C.string,"aria-errormessage":C.string,"aria-invalid":C.bool,"aria-labelledby":C.string,"aria-required":C.bool,checked:C.bool,defaultChecked:C.bool,disabled:C.bool,indeterminate:C.bool,onChange:C.func,value:C.any,style:C.object,className:C.string,prefixCls:C.string,onMouseEnter:C.func,onMouseLeave:C.func,extra:C.node,index:C.number,"aria-label":C.string,tabIndex:C.number,preventScroll:C.bool,type:C.string};Xu.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:rt,onMouseEnter:rt,onMouseLeave:rt,type:"default"};Xu.elementType="Checkbox";class WO extends li{static get checkboxGroupDefaultAdapter(){return{}}constructor(n){super(Object.assign(Object.assign({},WO.checkboxGroupDefaultAdapter),n))}init(){const{defaultValue:n,value:r}=this.getProps();typeof n<"u"&&!Array.isArray(n)&&Lu(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof r<"u"&&!Array.isArray(r)&&Lu(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(n){this._adapter.notifyChange(n)}handleChange(n){const r=this.getState("value");let i=[];Array.isArray(r)||(i=[r]),n.target.checked?i=[...r,n.target.value]:i=r.filter((o,a)=>o!==n.target.value),"value"in this.getProps()?this.notifyChange(i):(this._adapter.updateGroupValue(i),this.notifyChange(i))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(n){Array.isArray(n)?this._adapter.updateGroupValue(n):(typeof n>"u"&&this._adapter.updateGroupValue([]),Lu(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class h_ extends jr{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:n=>{this.setState({value:n})},notifyChange:n=>{this.props.onChange&&this.props.onChange(n)}})}constructor(n){super(n),this.state={value:n.value||n.defaultValue},this.foundation=new WO(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(n){Qs(n.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(n){this.foundation.handleChange(n)}render(){const{children:n,options:r,prefixCls:i,direction:s,className:o,id:a,style:l,type:u,disabled:h}=this.props,p=u===Za.TYPE_PURECARD,g=u===Za.TYPE_CARD||p,v=i||bue.PREFIX,w=xe({[v]:!0,[`${v}-wrapper`]:!0,[`${v}-${s}`]:s,[`${v}-${s}-cardType`]:s&&g,[`${v}-${s}-pureCardType`]:s&&p},o),S=this.state.value.slice();let E;return r?E=(r||[]).map((x,I)=>typeof x=="string"?D.createElement(Xu,{role:"listitem",key:I,disabled:this.props.disabled,value:x,prefixCls:i},x):D.createElement(Xu,{role:"listitem",key:I,disabled:x.disabled||this.props.disabled,value:x.value,prefixCls:i,extra:x.extra,className:x.className,style:x.style,onChange:x.onChange},x.label)):n&&(E=D.Children.toArray(n).map((x,I)=>D.cloneElement(x,{key:I,role:"listitem"}))),D.createElement("div",Object.assign({id:a,role:"list","aria-label":this.props["aria-label"],className:w,style:l,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),D.createElement(KO.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:S,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:g,isPureCardType:p}}},E))}}h_.propTypes={"aria-describedby":C.string,"aria-errormessage":C.string,"aria-invalid":C.bool,"aria-labelledby":C.string,"aria-required":C.bool,defaultValue:C.array,disabled:C.bool,name:C.string,options:C.array,value:C.array,onChange:C.func,children:C.node,prefixCls:C.string,direction:C.oneOf(Za.DIRECTION_SET),className:C.string,type:C.oneOf([Za.TYPE_DEFAULT,Za.TYPE_CARD,Za.TYPE_PURECARD]),style:C.object};h_.defaultProps={disabled:!1,onChange:()=>{},type:Za.TYPE_DEFAULT,defaultValue:[],direction:Za.DEFAULT_DIRECTION};class hw extends Xu{}hw.Group=h_;function WN(){return WN=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},WN.apply(null,arguments)}function _ue(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,BN(e,n)}var fk=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function Cue(e,n){return!!(e===n||fk(e)&&fk(n))}function Eue(e,n){if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(!Cue(e[r],n[r]))return!1;return!0}function FD(e,n){n===void 0&&(n=Eue);var r,i=[],s,o=!1;function a(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return o&&r===this&&n(l,i)||(s=e.apply(this,l),o=!0,r=this,i=l),s}return a}var xue=typeof performance=="object"&&typeof performance.now=="function",pk=xue?function(){return performance.now()}:function(){return Date.now()};function gk(e){cancelAnimationFrame(e.id)}function Sue(e,n){var r=pk();function i(){pk()-r>=n?e.call(null):s.id=requestAnimationFrame(i)}var s={id:requestAnimationFrame(i)};return s}var $D=-1;function yk(e){if(e===void 0&&(e=!1),$D===-1||e){var n=document.createElement("div"),r=n.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(n),$D=n.offsetWidth-n.clientWidth,document.body.removeChild(n)}return $D}var Np=null;function mk(e){if(e===void 0&&(e=!1),Np===null||e){var n=document.createElement("div"),r=n.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),s=i.style;return s.width="100px",s.height="100px",n.appendChild(i),document.body.appendChild(n),n.scrollLeft>0?Np="positive-descending":(n.scrollLeft=1,n.scrollLeft===0?Np="negative":Np="positive-ascending"),document.body.removeChild(n),Np}return Np}var Due=150,Nue=function(n,r){return n};function Iue(e){var n,r=e.getItemOffset,i=e.getEstimatedTotalSize,s=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return n=function(g){_ue(v,g);function v(S){var E;return E=g.call(this,S)||this,E._instanceProps=u(E.props,MR(E)),E._outerRef=void 0,E._resetIsScrollingTimeoutId=null,E.state={instance:MR(E),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof E.props.initialScrollOffset=="number"?E.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},E._callOnItemsRendered=void 0,E._callOnItemsRendered=FD(function(x,I,P,M){return E.props.onItemsRendered({overscanStartIndex:x,overscanStopIndex:I,visibleStartIndex:P,visibleStopIndex:M})}),E._callOnScroll=void 0,E._callOnScroll=FD(function(x,I,P){return E.props.onScroll({scrollDirection:x,scrollOffset:I,scrollUpdateWasRequested:P})}),E._getItemStyle=void 0,E._getItemStyle=function(x){var I=E.props,P=I.direction,M=I.itemSize,k=I.layout,A=E._getItemStyleCache(h&&M,h&&k,h&&P),j;if(A.hasOwnProperty(x))j=A[x];else{var V=r(E.props,x,E._instanceProps),$=s(E.props,x,E._instanceProps),W=P==="horizontal"||k==="horizontal",B=P==="rtl",H=W?V:0;A[x]=j={position:"absolute",left:B?void 0:H,right:B?H:void 0,top:W?0:V,height:W?"100%":$,width:W?$:"100%"}}return j},E._getItemStyleCache=void 0,E._getItemStyleCache=FD(function(x,I,P){return{}}),E._onScrollHorizontal=function(x){var I=x.currentTarget,P=I.clientWidth,M=I.scrollLeft,k=I.scrollWidth;E.setState(function(A){if(A.scrollOffset===M)return null;var j=E.props.direction,V=M;if(j==="rtl")switch(mk()){case"negative":V=-M;break;case"positive-descending":V=k-P-M;break}return V=Math.max(0,Math.min(V,k-P)),{isScrolling:!0,scrollDirection:A.scrollOffset<V?"forward":"backward",scrollOffset:V,scrollUpdateWasRequested:!1}},E._resetIsScrollingDebounced)},E._onScrollVertical=function(x){var I=x.currentTarget,P=I.clientHeight,M=I.scrollHeight,k=I.scrollTop;E.setState(function(A){if(A.scrollOffset===k)return null;var j=Math.max(0,Math.min(k,M-P));return{isScrolling:!0,scrollDirection:A.scrollOffset<j?"forward":"backward",scrollOffset:j,scrollUpdateWasRequested:!1}},E._resetIsScrollingDebounced)},E._outerRefSetter=function(x){var I=E.props.outerRef;E._outerRef=x,typeof I=="function"?I(x):I!=null&&typeof I=="object"&&I.hasOwnProperty("current")&&(I.current=x)},E._resetIsScrollingDebounced=function(){E._resetIsScrollingTimeoutId!==null&&gk(E._resetIsScrollingTimeoutId),E._resetIsScrollingTimeoutId=Sue(E._resetIsScrolling,Due)},E._resetIsScrolling=function(){E._resetIsScrollingTimeoutId=null,E.setState({isScrolling:!1},function(){E._getItemStyleCache(-1,null)})},E}v.getDerivedStateFromProps=function(E,x){return Oue(E,x),p(E),null};var w=v.prototype;return w.scrollTo=function(E){E=Math.max(0,E),this.setState(function(x){return x.scrollOffset===E?null:{scrollDirection:x.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},w.scrollToItem=function(E,x){x===void 0&&(x="auto");var I=this.props,P=I.itemCount,M=I.layout,k=this.state.scrollOffset;E=Math.max(0,Math.min(E,P-1));var A=0;if(this._outerRef){var j=this._outerRef;M==="vertical"?A=j.scrollWidth>j.clientWidth?yk():0:A=j.scrollHeight>j.clientHeight?yk():0}this.scrollTo(o(this.props,E,x,k,this._instanceProps,A))},w.componentDidMount=function(){var E=this.props,x=E.direction,I=E.initialScrollOffset,P=E.layout;if(typeof I=="number"&&this._outerRef!=null){var M=this._outerRef;x==="horizontal"||P==="horizontal"?M.scrollLeft=I:M.scrollTop=I}this._callPropsCallbacks()},w.componentDidUpdate=function(){var E=this.props,x=E.direction,I=E.layout,P=this.state,M=P.scrollOffset,k=P.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var A=this._outerRef;if(x==="horizontal"||I==="horizontal")if(x==="rtl")switch(mk()){case"negative":A.scrollLeft=-M;break;case"positive-ascending":A.scrollLeft=M;break;default:var j=A.clientWidth,V=A.scrollWidth;A.scrollLeft=V-j-M;break}else A.scrollLeft=M;else A.scrollTop=M}this._callPropsCallbacks()},w.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&gk(this._resetIsScrollingTimeoutId)},w.render=function(){var E=this.props,x=E.children,I=E.className,P=E.direction,M=E.height,k=E.innerRef,A=E.innerElementType,j=E.innerTagName,V=E.itemCount,$=E.itemData,W=E.itemKey,B=W===void 0?Nue:W,H=E.layout,Y=E.outerElementType,te=E.outerTagName,ue=E.style,ye=E.useIsScrolling,Ne=E.width,q=this.state.isScrolling,G=P==="horizontal"||H==="horizontal",ae=G?this._onScrollHorizontal:this._onScrollVertical,ge=this._getRangeToRender(),X=ge[0],ee=ge[1],ie=[];if(V>0)for(var we=X;we<=ee;we++)ie.push(R.createElement(x,{data:$,key:B(we,$),index:we,isScrolling:ye?q:void 0,style:this._getItemStyle(we)}));var Se=i(this.props,this._instanceProps);return R.createElement(Y||te||"div",{className:I,onScroll:ae,ref:this._outerRefSetter,style:WN({position:"relative",height:M,width:Ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:P},ue)},R.createElement(A||j||"div",{children:ie,ref:k,style:{height:G?"100%":Se,pointerEvents:q?"none":void 0,width:G?Se:"100%"}}))},w._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var E=this.props.itemCount;if(E>0){var x=this._getRangeToRender(),I=x[0],P=x[1],M=x[2],k=x[3];this._callOnItemsRendered(I,P,M,k)}}if(typeof this.props.onScroll=="function"){var A=this.state,j=A.scrollDirection,V=A.scrollOffset,$=A.scrollUpdateWasRequested;this._callOnScroll(j,V,$)}},w._getRangeToRender=function(){var E=this.props,x=E.itemCount,I=E.overscanCount,P=this.state,M=P.isScrolling,k=P.scrollDirection,A=P.scrollOffset;if(x===0)return[0,0,0,0];var j=a(this.props,A,this._instanceProps),V=l(this.props,j,A,this._instanceProps),$=!M||k==="backward"?Math.max(1,I):1,W=!M||k==="forward"?Math.max(1,I):1;return[Math.max(0,j-$),Math.max(0,Math.min(x-1,V+W)),j,V]},v}(R.PureComponent),n.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var Oue=function(n,r){n.children,n.direction,n.height,n.layout,n.innerTagName,n.outerTagName,n.width,r.instance},vF=Iue({getItemOffset:function(n,r){var i=n.itemSize;return r*i},getItemSize:function(n,r){var i=n.itemSize;return i},getEstimatedTotalSize:function(n){var r=n.itemCount,i=n.itemSize;return i*r},getOffsetForIndexAndAlignment:function(n,r,i,s,o,a){var l=n.direction,u=n.height,h=n.itemCount,p=n.itemSize,g=n.layout,v=n.width,w=l==="horizontal"||g==="horizontal",S=w?v:u,E=Math.max(0,h*p-S),x=Math.min(E,r*p),I=Math.max(0,r*p-S+p+a);switch(i==="smart"&&(s>=I-S&&s<=x+S?i="auto":i="center"),i){case"start":return x;case"end":return I;case"center":{var P=Math.round(I+(x-I)/2);return P<Math.ceil(S/2)?0:P>E+Math.floor(S/2)?E:P}case"auto":default:return s>=I&&s<=x?s:s<I?I:x}},getStartIndexForOffset:function(n,r){var i=n.itemCount,s=n.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(n,r,i){var s=n.direction,o=n.height,a=n.itemCount,l=n.itemSize,u=n.layout,h=n.width,p=s==="horizontal"||u==="horizontal",g=r*l,v=p?h:o,w=Math.ceil((v+i-g)/l);return Math.max(0,Math.min(a-1,r+w-1))},initInstanceProps:function(n){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(n){n.itemSize}});const Tue=e=>{let{index:n,data:r,style:i}=e;const{visibleOptions:s,renderOption:o}=r,a=s[n];return o(a,n,i)},Nn=gF.PREFIX_OPTION;class f_ extends R.PureComponent{constructor(){var n;super(...arguments),n=this,this.onClick=(r,i)=>{const{onItemClick:s}=this.props;i.data.disabled||"disabled"in i&&i.disabled||s(r,i)},this.handleItemEnterPress=(r,i)=>{ua(r)&&this.onClick(r,i)},this.onHover=(r,i)=>{const{showNext:s,onItemHover:o}=this.props;i.data.disabled||s===ir.SHOW_NEXT_BY_HOVER&&o(r,i)},this.onCheckboxChange=(r,i)=>{const{onItemCheckboxClick:s}=this.props;r.stopPropagation(),r.nativeEvent&&typeof r.nativeEvent.stopImmediatePropagation=="function"&&r.nativeEvent.stopImmediatePropagation(),s(i)},this.getItemStatus=r=>{const{activeKeys:i,selectedKeys:s,loadedKeys:o,loadingKeys:a}=this.props,l={active:!1,selected:!1,loading:!1};return i.has(r)&&(l.active=!0),s.has(r)&&(l.selected=!0),a.has(r)&&!o.has(r)&&(l.loading=!0),l},this.renderIcon=function(r){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=o=>o+(i?` ${Nn}-icon-left`:"");switch(r){case"child":const{expandIcon:o}=n.props;return o||D.createElement(Wj,{className:s(`${Nn}-icon ${Nn}-icon-expand`)});case"tick":return D.createElement(ow,{className:s(`${Nn}-icon ${Nn}-icon-active`)});case"loading":return D.createElement(o_,{wrapperClassName:s(`${Nn}-spin-icon`)});case"empty":return D.createElement("span",{"aria-hidden":!0,className:s(`${Nn}-icon ${Nn}-icon-empty`)});default:return null}},this.highlight=r=>{const i=[],{keyword:s,separator:o}=this.props;return r.forEach((a,l)=>{typeof a=="string"&&oF(a,s)?a.split(s).forEach((u,h)=>{h>0&&i.push(D.createElement("span",{className:`${Nn}-label-highlight`,key:`${h}-${l}`},s)),i.push(u)}):i.push(a),l!==r.length-1&&i.push(o)}),i},this.renderFlattenOptionItem=(r,i,s)=>{var o;const{multiple:a,selectedKeys:l,checkedKeys:u,halfCheckedKeys:h,keyword:p,filterRender:g,virtualize:v}=this.props,{searchText:w,key:S,disabled:E,pathData:x}=r,I=l.has(S),P=xe(Nn,{[`${Nn}-flatten`]:!g,[`${Nn}-disabled`]:E,[`${Nn}-select`]:I&&!a}),M=j=>{this.onClick(j,r)},k=j=>this.handleItemEnterPress(j,r),A=j=>this.onCheckboxChange(j,r);if(g){const j={className:P,inputValue:p,disabled:E,data:x,checkStatus:{checked:u.has(r.key),halfChecked:h.has(r.key)},selected:I,onClick:M,onCheck:A},V=g(j),$=v?{key:S,style:Object.assign(Object.assign({},(o=V.props.style)!==null&&o!==void 0?o:{}),s)}:{key:S};return D.cloneElement(V,$)}return D.createElement("li",{role:"menuitem",className:P,style:s,key:S,onClick:M,onKeyPress:k},D.createElement("span",{className:`${Nn}-label`},!a&&this.renderIcon("empty"),a&&D.createElement(hw,{onChange:A,disabled:E,indeterminate:h.has(r.key),checked:u.has(r.key),className:`${Nn}-label-checkbox`}),this.highlight(w)))},this.renderFlattenOption=r=>{const{virtualize:i}=this.props;return D.createElement("ul",{className:`${Nn}-list`,key:"flatten-list"},i?this.renderVirtualizeList(r):r.map(o=>this.renderFlattenOptionItem(o)))},this.renderVirtualizeList=r=>{var i;const{direction:s}=this.context,{virtualize:o}=this.props;return D.createElement(vF,{height:o.height,itemCount:r.length,itemSize:o.itemSize,itemData:{visibleOptions:r,renderOption:this.renderFlattenOptionItem},width:(i=o.width)!==null&&i!==void 0?i:"100%",style:{direction:s}},Tue)}}renderItem(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const{multiple:i,checkedKeys:s,halfCheckedKeys:o}=this.props;let a;const l=r.length;return r.push(D.createElement("ul",{role:"menu",className:`${Nn}-list`,key:n[0].key,onScroll:u=>this.props.onListScroll(u,l)},n.map(u=>{const{data:h,key:p,parentKey:g}=u,{children:v,label:w,disabled:S,isLeaf:E}=h,{active:x,selected:I,loading:P}=this.getItemStatus(p),M=!!v&&v.length,k=M||this.props.loadData&&!E;x&&M&&(a=u);const A=xe(Nn,{[`${Nn}-active`]:x&&!I,[`${Nn}-select`]:I&&!i,[`${Nn}-disabled`]:S}),j=g?{"aria-owns":`cascaderItem-${g}`}:{};return D.createElement("li",Object.assign({role:"menuitem",id:`cascaderItem-${p}`,"aria-expanded":x,"aria-haspopup":!!k,"aria-disabled":S},j,{className:A,key:p,onClick:V=>{this.onClick(V,u)},onKeyPress:V=>this.handleItemEnterPress(V,u),onMouseEnter:V=>{this.onHover(V,u)}}),D.createElement("span",{className:`${Nn}-label`},I&&!i&&this.renderIcon("tick"),!I&&!i&&this.renderIcon("empty"),i&&D.createElement(hw,{onChange:V=>this.onCheckboxChange(V,u),disabled:S,indeterminate:o.has(u.key),checked:s.has(u.key),className:`${Nn}-label-checkbox`}),D.createElement("span",null,w)),k?this.renderIcon(P?"loading":"child",!0):null)}))),a&&r.concat(this.renderItem(a.children,r)),r}renderEmpty(){const{emptyContent:n}=this.props;return n===null?null:D.createElement(Gu,{componentName:"Cascader"},r=>D.createElement("ul",{className:`${Nn} ${Nn}-empty`,key:"empty-list"},D.createElement("span",{className:`${Nn}-label`,"x-semi-prop":"emptyContent"},n||r.emptyText)))}render(){const{data:n,searchable:r}=this.props,{direction:i}=this.context,s=!n||!n.length;let o;const a=xe({[`${Nn}-lists`]:!0,[`${Nn}-lists-rtl`]:i==="rtl",[`${Nn}-lists-empty`]:s});return s?o=this.renderEmpty():o=r?this.renderFlattenOption(n):this.renderItem(n),D.createElement("div",{className:a},o)}}f_.contextType=Ao;f_.propTypes={data:C.array,emptyContent:C.node,searchable:C.bool,onItemClick:C.func,onItemHover:C.func,multiple:C.bool,showNext:C.oneOf([ir.SHOW_NEXT_BY_CLICK,ir.SHOW_NEXT_BY_HOVER]),checkedKeys:C.object,halfCheckedKeys:C.object,onItemCheckboxClick:C.func,separator:C.string,keyword:C.string,virtualize:C.object,expandIcon:C.node};f_.defaultProps={empty:!1};const bF={PREFIX:`${Dn}-tag`},Tg={TAG_SIZE:["default","small","large"],TAG_COLOR:["grey","red","pink","purple","violet","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","white"],TAG_TYPE:["light","solid","ghost"],AVATAR_SHAPE:["square","circle"]};var Mue=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Ti=bF.PREFIX,wF=Tg.TAG_COLOR,_F=Tg.TAG_SIZE,CF=Tg.TAG_TYPE,Pue=Tg.AVATAR_SHAPE;class Gs extends R.Component{constructor(n){super(n),this.state={visible:!0},this.close=this.close.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}static getDerivedStateFromProps(n){return"visible"in n?{visible:n.visible}:null}setVisible(n){"visible"in this.props||this.setState({visible:n})}close(n,r,i){const{onClose:s}=this.props;n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),s&&s(r,n,i),!n.defaultPrevented&&this.setVisible(!1)}handleKeyDown(n){const{closable:r,onClick:i,onKeyDown:s}=this.props;switch(n.key){case"Backspace":case"Delete":r&&this.close(n,this.props.children,this.props.tagKey),qu(n);break;case"Enter":i(n),qu(n);break;case"Escape":n.target.blur();break}s&&s(n)}renderAvatar(){const{avatarShape:n,avatarSrc:r}=this.props;return D.createElement(cg,{src:r,shape:n})}render(){const n=this.props,{tagKey:r,children:i,size:s,color:o,closable:a,visible:l,onClose:u,onClick:h,className:p,type:g,shape:v,avatarSrc:w,avatarShape:S,tabIndex:E,prefixIcon:x,suffixIcon:I}=n,P=Mue(n,["tagKey","children","size","color","closable","visible","onClose","onClick","className","type","shape","avatarSrc","avatarShape","tabIndex","prefixIcon","suffixIcon"]),{visible:M}=this.state,k=h!==Gs.defaultProps.onClick||a,A={role:"button",tabIndex:E||0,onKeyDown:this.handleKeyDown},j=Object.assign(Object.assign({},P),{onClick:h,tabIndex:E,className:xe(Ti,{[`${Ti}-default`]:s==="default",[`${Ti}-small`]:s==="small",[`${Ti}-large`]:s==="large",[`${Ti}-square`]:v==="square",[`${Ti}-circle`]:v==="circle",[`${Ti}-${g}`]:g,[`${Ti}-${o}-${g}`]:o&&g,[`${Ti}-closable`]:a,[`${Ti}-invisible`]:!M,[`${Ti}-avatar-${S}`]:w},p)}),V=k?Object.assign(Object.assign({},j),A):j,$=a?D.createElement("div",{className:`${Ti}-close`,onClick:H=>this.close(H,i,r)},D.createElement(OO,{size:"small"})):null,W=fr(i),B=xe(`${Ti}-content`,`${Ti}-content-${W?"ellipsis":"center"}`);return D.createElement("div",Object.assign({"aria-label":this.props["aria-label"]||W?`${a?"Closable ":""}Tag: ${i}`:""},V),x?D.createElement("div",{className:`${Ti}-prefix-icon`},x):null,w?this.renderAvatar():null,D.createElement("div",{className:B},i),I?D.createElement("div",{className:`${Ti}-suffix-icon`},I):null,$)}}Gs.defaultProps={size:_F[0],color:wF[0],closable:!1,type:CF[0],onClose:()=>{},onClick:()=>{},onMouseEnter:()=>{},style:{},className:"",shape:"square",avatarShape:"square",prefixIcon:null,suffixIcon:null};Gs.propTypes={children:C.node,tagKey:C.oneOfType([C.string,C.number]),size:C.oneOf(_F),color:C.oneOf(wF),type:C.oneOf(CF),closable:C.bool,visible:C.bool,onClose:C.func,onClick:C.func,prefixIcon:C.node,suffixIcon:C.node,style:C.object,className:C.string,avatarSrc:C.string,avatarShape:C.oneOf(Pue),"aria-label":C.string};const Aue={PREFIX:`${Dn}-tagInput`},vk={SIZE_SET:["large","default","small"],STATUS:["success","default","error","warning"]},hb=(e,n)=>{let r=[];if(fr(n)||Ki(n))r=e.split(n);else if(fj(n)){const i=n[0];r=e;for(let s=1;s<n.length;s++)r=r.split(n[s]).join(i);r=r.split(i)}else r.push(e);return r};function Rue(e,n,r){const i=e.slice();return i.splice(r<0?i.length+r:r,0,i.splice(n,1)[0]),i}class kue extends li{constructor(n){super(Object.assign({},n)),this.handleInputChange=r=>{const{value:i}=r.target,{entering:s}=this.getStates();s?this._onInputChange(i,r):this._checkInputChangeValid(i)&&this._onInputChange(i,r)},this.handleInputCompositionStart=r=>{const{maxLength:i}=this.getProps();Ki(i)&&this._adapter.setEntering(!0)},this.handleInputCompositionEnd=r=>{const{value:i}=r.target,{maxLength:s,onInputExceed:o,separator:a}=this.getProps();if(!Ki(s))return;this._adapter.setEntering(!1);let l=!0;const u=hb(i,a);let h=0;for(;h<u.length;h++)if(u[h].length>s){l=!1,sr(o)&&o(i);break}if(l)this._adapter.setInputValue(i);else{const p=u.slice(0,h);h<u.length&&p.push(u[h].slice(0,s)),this._adapter.setInputValue(p.join(a))}},this._checkInputChangeValid=r=>{const{maxLength:i,onInputExceed:s,separator:o}=this._adapter.getProps(),{inputValue:a}=this._adapter.getStates();let l=!0;if(Ki(i)){const u=hb(r,o),h=hb(a,o),p=Math.max(u.length,h.length);for(let g=0;g<p;g++)if(!kr(u[g])&&(kr(h[g])||u[g].length>h[g].length)&&u[g].length>i){l=!1,sr(s)&&s(r);break}}return l},this.handleKeyDown=r=>{const{inputValue:i,tagsArray:s}=this._adapter.getStates(),o=r.keyCode;o===UN.ENTER&&(r.preventDefault(),i!==""&&this._handleAddTags(r));const{length:a}=s;if(o===UN.BACKSPACE&&i===""&&a>0){const l=s.slice(0,a-1),u=s[a-1];this._onRemove(l,u,a-1)}this._adapter.notifyKeyDown(r)}}_handleAddTags(n){const{separator:r,max:i,onExceed:s,allowDuplicates:o}=this._adapter.getProps(),{inputValue:a,tagsArray:l}=this._adapter.getStates();let u=hb(a,r);u=u.filter((p,g)=>!o&&(l.includes(p)||u.indexOf(p)!==g)?!1:fr(p)&&p.trim()!=="");let h=l.concat(u);Ki(i)&&h.length>i&&(sr(s)&&s(h),h=h.slice(0,i),u=u.slice(0,i-l.length)),u.length>0&&this._onAdd(h,u),this._onInputChange("",n)}handleInputBlur(n){const{addOnBlur:r}=this._adapter.getProps();r===!0&&this._handleAddTags(n),this._adapter.setFocusing(!1),this._adapter.notifyBlur(n)}handleInputFocus(n){this._adapter.setFocusing(!0),this._adapter.notifyFocus(n)}handleClearEnterPress(n){ua(n)&&this.handleClearBtn(n)}handleClearBtn(n){const{inputValue:r,tagsArray:i}=this._adapter.getStates();i.length>0&&(this._adapter.setTagsArray([]),this._adapter.notifyTagChange([])),r.length>0&&this._onInputChange("",n),n.stopPropagation()}handleTagClose(n){const{tagsArray:r}=this._adapter.getStates(),i=[...r];i.splice(n,1);const s=r[n];this._onRemove(i,s,n)}handleInputMouseEnter(){this._adapter.setHovering(!0)}handleInputMouseLeave(){this._adapter.setHovering(!1)}handleClick(n){const{disabled:r}=this.getProps();if(r)return;this._adapter.getClickOutsideHandler()||(this._adapter.setActive(!0),this._adapter.registerClickOutsideHandler(s=>this.clickOutsideCallBack()))}clickOutsideCallBack(){this._adapter.unregisterClickOutsideHandler(),this._adapter.setActive(!1)}handleClickPrefixOrSuffix(n){const{disabled:r}=this._adapter.getProps(),{isFocus:i}=this._adapter.getStates();!r&&!i&&this._adapter.toggleFocusing(!0)}handlePreventMouseDown(n){n&&sr(n.preventDefault)&&n.preventDefault()}_onRemove(n,r,i){this._isControlledComponent()||this._adapter.setTagsArray(n),this._adapter.notifyTagChange(n),this._adapter.notifyTagRemove(r,i)}_onAdd(n,r){this._isControlledComponent()||this._adapter.setTagsArray(n),this._adapter.notifyTagChange(n),this._adapter.notifyTagAdd(r)}_onInputChange(n,r){this._adapter.setInputValue(n),this._adapter.notifyInputChange(n,r)}handleSortEnd(n){const{oldIndex:r,newIndex:i}=n,{tagsArray:s}=this.getStates(),o=Rue(s,r,i);this._isControlledComponent()||this._adapter.setTagsArray(o),this._adapter.notifyTagChange(o)}}function Lue(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return R.useMemo(()=>i=>{n.forEach(s=>s(i))},n)}const p_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mg(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function qO(e){return"nodeType"in e}function Zi(e){var n,r;return e?Mg(e)?e:qO(e)&&(n=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?n:window:window}function GO(e){const{Document:n}=Zi(e);return e instanceof n}function u0(e){return Mg(e)?!1:e instanceof Zi(e).HTMLElement}function EF(e){return e instanceof Zi(e).SVGElement}function Pg(e){return e?Mg(e)?e.document:qO(e)?GO(e)?e:u0(e)||EF(e)?e.ownerDocument:document:document:document}const da=p_?R.useLayoutEffect:R.useEffect;function g_(e){const n=R.useRef(e);return da(()=>{n.current=e}),R.useCallback(function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n.current==null?void 0:n.current(...i)},[])}function jue(){const e=R.useRef(null),n=R.useCallback((i,s)=>{e.current=setInterval(i,s)},[]),r=R.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,r]}function xv(e,n){n===void 0&&(n=[e]);const r=R.useRef(e);return da(()=>{r.current!==e&&(r.current=e)},n),r}function d0(e,n){const r=R.useRef();return R.useMemo(()=>{const i=e(r.current);return r.current=i,i},[...n])}function fw(e){const n=g_(e),r=R.useRef(null),i=R.useCallback(s=>{s!==r.current&&(n==null||n(s,r.current)),r.current=s},[]);return[r,i]}function pw(e){const n=R.useRef();return R.useEffect(()=>{n.current=e},[e]),n.current}let zD={};function h0(e,n){return R.useMemo(()=>{if(n)return n;const r=zD[e]==null?0:zD[e]+1;return zD[e]=r,e+"-"+r},[e,n])}function xF(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((o,a)=>{const l=Object.entries(a);for(const[u,h]of l){const p=o[u];p!=null&&(o[u]=p+e*h)}return o},{...n})}}const Vp=xF(1),Sv=xF(-1);function Fue(e){return"clientX"in e&&"clientY"in e}function y_(e){if(!e)return!1;const{KeyboardEvent:n}=Zi(e.target);return n&&e instanceof n}function $ue(e){if(!e)return!1;const{TouchEvent:n}=Zi(e.target);return n&&e instanceof n}function gw(e){if($ue(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:r}=e.touches[0];return{x:n,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:r}=e.changedTouches[0];return{x:n,y:r}}}return Fue(e)?{x:e.clientX,y:e.clientY}:null}const Zu=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:r}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:r}=e;return"scaleX("+n+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Zu.Translate.toString(e),Zu.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:r,easing:i}=e;return n+" "+r+"ms "+i}}}),bk="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zue(e){return e.matches(bk)?e:e.querySelector(bk)}const Vue={display:"none"};function Bue(e){let{id:n,value:r}=e;return D.createElement("div",{id:n,style:Vue},r)}function Hue(e){let{id:n,announcement:r,ariaLiveType:i="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return D.createElement("div",{id:n,style:s,role:"status","aria-live":i,"aria-atomic":!0},r)}function Uue(){const[e,n]=R.useState("");return{announce:R.useCallback(i=>{i!=null&&n(i)},[]),announcement:e}}const SF=R.createContext(null);function Kue(e){const n=R.useContext(SF);R.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function Wue(){const[e]=R.useState(()=>new Set),n=R.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[R.useCallback(i=>{let{type:s,event:o}=i;e.forEach(a=>{var l;return(l=a[s])==null?void 0:l.call(a,o)})},[e]),n]}const que={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.
|
||
`},Gue={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:r}=e;return r?"Draggable item "+n.id+" was moved over droppable area "+r.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:r}=e;return r?"Draggable item "+n.id+" was dropped over droppable area "+r.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Yue(e){let{announcements:n=Gue,container:r,hiddenTextDescribedById:i,screenReaderInstructions:s=que}=e;const{announce:o,announcement:a}=Uue(),l=h0("DndLiveRegion"),[u,h]=R.useState(!1);if(R.useEffect(()=>{h(!0)},[]),Kue(R.useMemo(()=>({onDragStart(g){let{active:v}=g;o(n.onDragStart({active:v}))},onDragMove(g){let{active:v,over:w}=g;n.onDragMove&&o(n.onDragMove({active:v,over:w}))},onDragOver(g){let{active:v,over:w}=g;o(n.onDragOver({active:v,over:w}))},onDragEnd(g){let{active:v,over:w}=g;o(n.onDragEnd({active:v,over:w}))},onDragCancel(g){let{active:v,over:w}=g;o(n.onDragCancel({active:v,over:w}))}}),[o,n])),!u)return null;const p=D.createElement(D.Fragment,null,D.createElement(Bue,{id:i,value:s.draggable}),D.createElement(Hue,{id:l,announcement:a}));return r?Ya.createPortal(p,r):p}var Ur;(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"})(Ur||(Ur={}));function yw(){}function VD(e,n){return R.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function Xue(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return R.useMemo(()=>[...n].filter(i=>i!=null),[...n])}const ha=Object.freeze({x:0,y:0});function DF(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Zue(e,n){const r=gw(e);if(!r)return"0 0";const i={x:(r.x-n.left)/n.width*100,y:(r.y-n.top)/n.height*100};return i.x+"% "+i.y+"%"}function NF(e,n){let{data:{value:r}}=e,{data:{value:i}}=n;return r-i}function Que(e,n){let{data:{value:r}}=e,{data:{value:i}}=n;return i-r}function wk(e){let{left:n,top:r,height:i,width:s}=e;return[{x:n,y:r},{x:n+s,y:r},{x:n,y:r+i},{x:n+s,y:r+i}]}function IF(e,n){if(!e||e.length===0)return null;const[r]=e;return r[n]}function _k(e,n,r){return n===void 0&&(n=e.left),r===void 0&&(r=e.top),{x:n+e.width*.5,y:r+e.height*.5}}const Jue=e=>{let{collisionRect:n,droppableRects:r,droppableContainers:i}=e;const s=_k(n,n.left,n.top),o=[];for(const a of i){const{id:l}=a,u=r.get(l);if(u){const h=DF(_k(u),s);o.push({id:l,data:{droppableContainer:a,value:h}})}}return o.sort(NF)},ede=e=>{let{collisionRect:n,droppableRects:r,droppableContainers:i}=e;const s=wk(n),o=[];for(const a of i){const{id:l}=a,u=r.get(l);if(u){const h=wk(u),p=s.reduce((v,w,S)=>v+DF(h[S],w),0),g=Number((p/4).toFixed(4));o.push({id:l,data:{droppableContainer:a,value:g}})}}return o.sort(NF)};function tde(e,n){const r=Math.max(n.top,e.top),i=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height),a=s-i,l=o-r;if(i<s&&r<o){const u=n.width*n.height,h=e.width*e.height,p=a*l,g=p/(u+h-p);return Number(g.toFixed(4))}return 0}const nde=e=>{let{collisionRect:n,droppableRects:r,droppableContainers:i}=e;const s=[];for(const o of i){const{id:a}=o,l=r.get(a);if(l){const u=tde(l,n);u>0&&s.push({id:a,data:{droppableContainer:o,value:u}})}}return s.sort(Que)};function rde(e,n,r){return{...e,scaleX:n&&r?n.width/r.width:1,scaleY:n&&r?n.height/r.height:1}}function OF(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:ha}function ide(e){return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return s.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...r})}}const sde=ide(1);function TF(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function ode(e,n,r){const i=TF(n);if(!i)return e;const{scaleX:s,scaleY:o,x:a,y:l}=i,u=e.left-a-(1-s)*parseFloat(r),h=e.top-l-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),p=s?e.width/s:e.width,g=o?e.height/o:e.height;return{width:p,height:g,top:h,right:u+p,bottom:h+g,left:u}}const ade={ignoreTransform:!1};function Ag(e,n){n===void 0&&(n=ade);let r=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:h,transformOrigin:p}=Zi(e).getComputedStyle(e);h&&(r=ode(r,h,p))}const{top:i,left:s,width:o,height:a,bottom:l,right:u}=r;return{top:i,left:s,width:o,height:a,bottom:l,right:u}}function Ck(e){return Ag(e,{ignoreTransform:!0})}function lde(e){const n=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function cde(e,n){return n===void 0&&(n=Zi(e).getComputedStyle(e)),n.position==="fixed"}function ude(e,n){n===void 0&&(n=Zi(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=n[s];return typeof o=="string"?r.test(o):!1})}function m_(e,n){const r=[];function i(s){if(n!=null&&r.length>=n||!s)return r;if(GO(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!u0(s)||EF(s)||r.includes(s))return r;const o=Zi(e).getComputedStyle(s);return s!==e&&ude(s,o)&&r.push(s),cde(s,o)?r:i(s.parentNode)}return e?i(e):r}function MF(e){const[n]=m_(e,1);return n??null}function BD(e){return!p_||!e?null:Mg(e)?e:qO(e)?GO(e)||e===Pg(e).scrollingElement?window:u0(e)?e:null:null}function PF(e){return Mg(e)?e.scrollX:e.scrollLeft}function AF(e){return Mg(e)?e.scrollY:e.scrollTop}function qN(e){return{x:PF(e),y:AF(e)}}var si;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(si||(si={}));function RF(e){return!p_||!e?!1:e===document.scrollingElement}function kF(e){const n={x:0,y:0},r=RF(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=n.y,o=e.scrollLeft<=n.x,a=e.scrollTop>=i.y,l=e.scrollLeft>=i.x;return{isTop:s,isLeft:o,isBottom:a,isRight:l,maxScroll:i,minScroll:n}}const dde={x:.2,y:.2};function hde(e,n,r,i,s){let{top:o,left:a,right:l,bottom:u}=r;i===void 0&&(i=10),s===void 0&&(s=dde);const{isTop:h,isBottom:p,isLeft:g,isRight:v}=kF(e),w={x:0,y:0},S={x:0,y:0},E={height:n.height*s.y,width:n.width*s.x};return!h&&o<=n.top+E.height?(w.y=si.Backward,S.y=i*Math.abs((n.top+E.height-o)/E.height)):!p&&u>=n.bottom-E.height&&(w.y=si.Forward,S.y=i*Math.abs((n.bottom-E.height-u)/E.height)),!v&&l>=n.right-E.width?(w.x=si.Forward,S.x=i*Math.abs((n.right-E.width-l)/E.width)):!g&&a<=n.left+E.width&&(w.x=si.Backward,S.x=i*Math.abs((n.left+E.width-a)/E.width)),{direction:w,speed:S}}function fde(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:n,left:r,right:i,bottom:s}=e.getBoundingClientRect();return{top:n,left:r,right:i,bottom:s,width:e.clientWidth,height:e.clientHeight}}function LF(e){return e.reduce((n,r)=>Vp(n,qN(r)),ha)}function pde(e){return e.reduce((n,r)=>n+PF(r),0)}function gde(e){return e.reduce((n,r)=>n+AF(r),0)}function jF(e,n){if(n===void 0&&(n=Ag),!e)return;const{top:r,left:i,bottom:s,right:o}=n(e);MF(e)&&(s<=0||o<=0||r>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const yde=[["x",["left","right"],pde],["y",["top","bottom"],gde]];class YO{constructor(n,r){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 i=m_(r),s=LF(i);this.rect={...n},this.width=n.width,this.height=n.height;for(const[o,a,l]of yde)for(const u of a)Object.defineProperty(this,u,{get:()=>{const h=l(i),p=s[o]-h;return this.rect[u]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Zm{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...r)})},this.target=n}add(n,r,i){var s;(s=this.target)==null||s.addEventListener(n,r,i),this.listeners.push([n,r,i])}}function mde(e){const{EventTarget:n}=Zi(e);return e instanceof n?e:Pg(e)}function HD(e,n){const r=Math.abs(e.x),i=Math.abs(e.y);return typeof n=="number"?Math.sqrt(r**2+i**2)>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var xo;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xo||(xo={}));function Ek(e){e.preventDefault()}function vde(e){e.stopPropagation()}var sn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(sn||(sn={}));const FF={start:[sn.Space,sn.Enter],cancel:[sn.Esc],end:[sn.Space,sn.Enter]},bde=(e,n)=>{let{currentCoordinates:r}=n;switch(e.code){case sn.Right:return{...r,x:r.x+25};case sn.Left:return{...r,x:r.x-25};case sn.Down:return{...r,y:r.y+25};case sn.Up:return{...r,y:r.y-25}}};class XO{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:r}}=n;this.props=n,this.listeners=new Zm(Pg(r)),this.windowListeners=new Zm(Zi(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xo.Resize,this.handleCancel),this.windowListeners.add(xo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:r}=this.props,i=n.node.current;i&&jF(i),r(ha)}handleKeyDown(n){if(y_(n)){const{active:r,context:i,options:s}=this.props,{keyboardCodes:o=FF,coordinateGetter:a=bde,scrollBehavior:l="smooth"}=s,{code:u}=n;if(o.end.includes(u)){this.handleEnd(n);return}if(o.cancel.includes(u)){this.handleCancel(n);return}const{collisionRect:h}=i.current,p=h?{x:h.left,y:h.top}:ha;this.referenceCoordinates||(this.referenceCoordinates=p);const g=a(n,{active:r,context:i.current,currentCoordinates:p});if(g){const v=Sv(g,p),w={x:0,y:0},{scrollableAncestors:S}=i.current;for(const E of S){const x=n.code,{isTop:I,isRight:P,isLeft:M,isBottom:k,maxScroll:A,minScroll:j}=kF(E),V=fde(E),$={x:Math.min(x===sn.Right?V.right-V.width/2:V.right,Math.max(x===sn.Right?V.left:V.left+V.width/2,g.x)),y:Math.min(x===sn.Down?V.bottom-V.height/2:V.bottom,Math.max(x===sn.Down?V.top:V.top+V.height/2,g.y))},W=x===sn.Right&&!P||x===sn.Left&&!M,B=x===sn.Down&&!k||x===sn.Up&&!I;if(W&&$.x!==g.x){const H=E.scrollLeft+v.x,Y=x===sn.Right&&H<=A.x||x===sn.Left&&H>=j.x;if(Y&&!v.y){E.scrollTo({left:H,behavior:l});return}Y?w.x=E.scrollLeft-H:w.x=x===sn.Right?E.scrollLeft-A.x:E.scrollLeft-j.x,w.x&&E.scrollBy({left:-w.x,behavior:l});break}else if(B&&$.y!==g.y){const H=E.scrollTop+v.y,Y=x===sn.Down&&H<=A.y||x===sn.Up&&H>=j.y;if(Y&&!v.x){E.scrollTo({top:H,behavior:l});return}Y?w.y=E.scrollTop-H:w.y=x===sn.Down?E.scrollTop-A.y:E.scrollTop-j.y,w.y&&E.scrollBy({top:-w.y,behavior:l});break}}this.handleMove(n,Vp(Sv(g,this.referenceCoordinates),w))}}}handleMove(n,r){const{onMove:i}=this.props;n.preventDefault(),i(r)}handleEnd(n){const{onEnd:r}=this.props;n.preventDefault(),this.detach(),r()}handleCancel(n){const{onCancel:r}=this.props;n.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}XO.activators=[{eventName:"onKeyDown",handler:(e,n,r)=>{let{keyboardCodes:i=FF,onActivation:s}=n,{active:o}=r;const{code:a}=e.nativeEvent;if(i.start.includes(a)){const l=o.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function xk(e){return!!(e&&"distance"in e)}function Sk(e){return!!(e&&"delay"in e)}class ZO{constructor(n,r,i){var s;i===void 0&&(i=mde(n.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=n,this.events=r;const{event:o}=n,{target:a}=o;this.props=n,this.events=r,this.document=Pg(a),this.documentListeners=new Zm(this.document),this.listeners=new Zm(i),this.windowListeners=new Zm(Zi(a)),this.initialCoordinates=(s=gw(o))!=null?s:ha,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:n,props:{options:{activationConstraint:r,bypassActivationConstraint:i}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(xo.Resize,this.handleCancel),this.windowListeners.add(xo.DragStart,Ek),this.windowListeners.add(xo.VisibilityChange,this.handleCancel),this.windowListeners.add(xo.ContextMenu,Ek),this.documentListeners.add(xo.Keydown,this.handleKeydown),r){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Sk(r)){this.timeoutId=setTimeout(this.handleStart,r.delay);return}if(xk(r))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:n}=this,{onStart:r}=this.props;n&&(this.activated=!0,this.documentListeners.add(xo.Click,vde,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xo.SelectionChange,this.removeTextSelection),r(n))}handleMove(n){var r;const{activated:i,initialCoordinates:s,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!s)return;const u=(r=gw(n))!=null?r:ha,h=Sv(s,u);if(!i&&l){if(xk(l)){if(l.tolerance!=null&&HD(h,l.tolerance))return this.handleCancel();if(HD(h,l.distance))return this.handleStart()}return Sk(l)&&HD(h,l.tolerance)?this.handleCancel():void 0}n.cancelable&&n.preventDefault(),a(u)}handleEnd(){const{onEnd:n}=this.props;this.detach(),n()}handleCancel(){const{onCancel:n}=this.props;this.detach(),n()}handleKeydown(n){n.code===sn.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const wde={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $F extends ZO{constructor(n){const{event:r}=n,i=Pg(r.target);super(n,wde,i)}}$F.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:i}=n;return!r.isPrimary||r.button!==0?!1:(i==null||i({event:r}),!0)}}];const _de={move:{name:"mousemove"},end:{name:"mouseup"}};var GN;(function(e){e[e.RightClick=2]="RightClick"})(GN||(GN={}));class zF extends ZO{constructor(n){super(n,_de,Pg(n.event.target))}}zF.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:i}=n;return r.button===GN.RightClick?!1:(i==null||i({event:r}),!0)}}];const UD={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class VF extends ZO{constructor(n){super(n,UD)}static setup(){return window.addEventListener(UD.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(UD.move.name,n)};function n(){}}}VF.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:r}=e,{onActivation:i}=n;const{touches:s}=r;return s.length>1?!1:(i==null||i({event:r}),!0)}}];var Qm;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Qm||(Qm={}));var Dv;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dv||(Dv={}));function Cde(e){let{acceleration:n,activator:r=Qm.Pointer,canScroll:i,draggingRect:s,enabled:o,interval:a=5,order:l=Dv.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:p,delta:g,threshold:v}=e;const w=xde({delta:g,disabled:!o}),[S,E]=jue(),x=R.useRef({x:0,y:0}),I=R.useRef({x:0,y:0}),P=R.useMemo(()=>{switch(r){case Qm.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Qm.DraggableRect:return s}},[r,s,u]),M=R.useRef(null),k=R.useCallback(()=>{const j=M.current;if(!j)return;const V=x.current.x*I.current.x,$=x.current.y*I.current.y;j.scrollBy(V,$)},[]),A=R.useMemo(()=>l===Dv.TreeOrder?[...h].reverse():h,[l,h]);R.useEffect(()=>{if(!o||!h.length||!P){E();return}for(const j of A){if((i==null?void 0:i(j))===!1)continue;const V=h.indexOf(j),$=p[V];if(!$)continue;const{direction:W,speed:B}=hde(j,$,P,n,v);for(const H of["x","y"])w[H][W[H]]||(B[H]=0,W[H]=0);if(B.x>0||B.y>0){E(),M.current=j,S(k,a),x.current=B,I.current=W;return}}x.current={x:0,y:0},I.current={x:0,y:0},E()},[n,k,i,E,o,a,JSON.stringify(P),JSON.stringify(w),S,h,A,p,JSON.stringify(v)])}const Ede={x:{[si.Backward]:!1,[si.Forward]:!1},y:{[si.Backward]:!1,[si.Forward]:!1}};function xde(e){let{delta:n,disabled:r}=e;const i=pw(n);return d0(s=>{if(r||!i||!s)return Ede;const o={x:Math.sign(n.x-i.x),y:Math.sign(n.y-i.y)};return{x:{[si.Backward]:s.x[si.Backward]||o.x===-1,[si.Forward]:s.x[si.Forward]||o.x===1},y:{[si.Backward]:s.y[si.Backward]||o.y===-1,[si.Forward]:s.y[si.Forward]||o.y===1}}},[r,n,i])}function Sde(e,n){const r=n!=null?e.get(n):void 0,i=r?r.node.current:null;return d0(s=>{var o;return n==null?null:(o=i??s)!=null?o:null},[i,n])}function Dde(e,n){return R.useMemo(()=>e.reduce((r,i)=>{const{sensor:s}=i,o=s.activators.map(a=>({eventName:a.eventName,handler:n(a.handler,i)}));return[...r,...o]},[]),[e,n])}var Nv;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Nv||(Nv={}));var YN;(function(e){e.Optimized="optimized"})(YN||(YN={}));const Dk=new Map;function Nde(e,n){let{dragging:r,dependencies:i,config:s}=n;const[o,a]=R.useState(null),{frequency:l,measure:u,strategy:h}=s,p=R.useRef(e),g=x(),v=xv(g),w=R.useCallback(function(I){I===void 0&&(I=[]),!v.current&&a(P=>P===null?I:P.concat(I.filter(M=>!P.includes(M))))},[v]),S=R.useRef(null),E=d0(I=>{if(g&&!r)return Dk;if(!I||I===Dk||p.current!==e||o!=null){const P=new Map;for(let M of e){if(!M)continue;if(o&&o.length>0&&!o.includes(M.id)&&M.rect.current){P.set(M.id,M.rect.current);continue}const k=M.node.current,A=k?new YO(u(k),k):null;M.rect.current=A,A&&P.set(M.id,A)}return P}return I},[e,o,r,g,u]);return R.useEffect(()=>{p.current=e},[e]),R.useEffect(()=>{g||w()},[r,g]),R.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),R.useEffect(()=>{g||typeof l!="number"||S.current!==null||(S.current=setTimeout(()=>{w(),S.current=null},l))},[l,g,w,...i]),{droppableRects:E,measureDroppableContainers:w,measuringScheduled:o!=null};function x(){switch(h){case Nv.Always:return!1;case Nv.BeforeDragging:return r;default:return!r}}}function QO(e,n){return d0(r=>e?r||(typeof n=="function"?n(e):e):null,[n,e])}function Ide(e,n){return QO(e,n)}function Ode(e){let{callback:n,disabled:r}=e;const i=g_(n),s=R.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,r]);return R.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function v_(e){let{callback:n,disabled:r}=e;const i=g_(n),s=R.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[r]);return R.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Tde(e){return new YO(Ag(e),e)}function Nk(e,n,r){n===void 0&&(n=Tde);const[i,s]=R.useState(null);function o(){s(u=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=u??r)!=null?h:null}const p=n(e);return JSON.stringify(u)===JSON.stringify(p)?u:p})}const a=Ode({callback(u){if(e)for(const h of u){const{type:p,target:g}=h;if(p==="childList"&&g instanceof HTMLElement&&g.contains(e)){o();break}}}}),l=v_({callback:o});return da(()=>{o(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),i}function Mde(e){const n=QO(e);return OF(e,n)}const Ik=[];function Pde(e){const n=R.useRef(e),r=d0(i=>e?i&&i!==Ik&&e&&n.current&&e.parentNode===n.current.parentNode?i:m_(e):Ik,[e]);return R.useEffect(()=>{n.current=e},[e]),r}function Ade(e){const[n,r]=R.useState(null),i=R.useRef(e),s=R.useCallback(o=>{const a=BD(o.target);a&&r(l=>l?(l.set(a,qN(a)),new Map(l)):null)},[]);return R.useEffect(()=>{const o=i.current;if(e!==o){a(o);const l=e.map(u=>{const h=BD(u);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,qN(h)]):null}).filter(u=>u!=null);r(l.length?new Map(l):null),i.current=e}return()=>{a(e),a(o)};function a(l){l.forEach(u=>{const h=BD(u);h==null||h.removeEventListener("scroll",s)})}},[s,e]),R.useMemo(()=>e.length?n?Array.from(n.values()).reduce((o,a)=>Vp(o,a),ha):LF(e):ha,[e,n])}function Ok(e,n){n===void 0&&(n=[]);const r=R.useRef(null);return R.useEffect(()=>{r.current=null},n),R.useEffect(()=>{const i=e!==ha;i&&!r.current&&(r.current=e),!i&&r.current&&(r.current=null)},[e]),r.current?Sv(e,r.current):ha}function Rde(e){R.useEffect(()=>{if(!p_)return;const n=e.map(r=>{let{sensor:i}=r;return i.setup==null?void 0:i.setup()});return()=>{for(const r of n)r==null||r()}},e.map(n=>{let{sensor:r}=n;return r}))}function kde(e,n){return R.useMemo(()=>e.reduce((r,i)=>{let{eventName:s,handler:o}=i;return r[s]=a=>{o(a,n)},r},{}),[e,n])}function BF(e){return R.useMemo(()=>e?lde(e):null,[e])}const Tk=[];function Lde(e,n){n===void 0&&(n=Ag);const[r]=e,i=BF(r?Zi(r):null),[s,o]=R.useState(Tk);function a(){o(()=>e.length?e.map(u=>RF(u)?i:new YO(n(u),u)):Tk)}const l=v_({callback:a});return da(()=>{l==null||l.disconnect(),a(),e.forEach(u=>l==null?void 0:l.observe(u))},[e]),s}function HF(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return u0(n)?n:e}function jde(e){let{measure:n}=e;const[r,i]=R.useState(null),s=R.useCallback(h=>{for(const{target:p}of h)if(u0(p)){i(g=>{const v=n(p);return g?{...g,width:v.width,height:v.height}:v});break}},[n]),o=v_({callback:s}),a=R.useCallback(h=>{const p=HF(h);o==null||o.disconnect(),p&&(o==null||o.observe(p)),i(p?n(p):null)},[n,o]),[l,u]=fw(a);return R.useMemo(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const Fde=[{sensor:$F,options:{}},{sensor:XO,options:{}}],$de={current:{}},Eb={draggable:{measure:Ck},droppable:{measure:Ck,strategy:Nv.WhileDragging,frequency:YN.Optimized},dragOverlay:{measure:Ag}};class Jm extends Map{get(n){var r;return n!=null&&(r=super.get(n))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:r}=n;return!r})}getNodeFor(n){var r,i;return(r=(i=this.get(n))==null?void 0:i.node.current)!=null?r:void 0}}const zde={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Jm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yw},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Eb,measureDroppableContainers:yw,windowRect:null,measuringScheduled:!1},UF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yw,draggableNodes:new Map,over:null,measureDroppableContainers:yw},f0=R.createContext(UF),KF=R.createContext(zde);function Vde(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Jm}}}function Bde(e,n){switch(n.type){case Ur.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Ur.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case Ur.DragEnd:case Ur.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ur.RegisterDroppable:{const{element:r}=n,{id:i}=r,s=new Jm(e.droppable.containers);return s.set(i,r),{...e,droppable:{...e.droppable,containers:s}}}case Ur.SetDroppableDisabled:{const{id:r,key:i,disabled:s}=n,o=e.droppable.containers.get(r);if(!o||i!==o.key)return e;const a=new Jm(e.droppable.containers);return a.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case Ur.UnregisterDroppable:{const{id:r,key:i}=n,s=e.droppable.containers.get(r);if(!s||i!==s.key)return e;const o=new Jm(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Hde(e){let{disabled:n}=e;const{active:r,activatorEvent:i,draggableNodes:s}=R.useContext(f0),o=pw(i),a=pw(r==null?void 0:r.id);return R.useEffect(()=>{if(!n&&!i&&o&&a!=null){if(!y_(o)||document.activeElement===o.target)return;const l=s.get(a);if(!l)return;const{activatorNode:u,node:h}=l;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const p of[u.current,h.current]){if(!p)continue;const g=zue(p);if(g){g.focus();break}}})}},[i,n,s,a,o]),null}function WF(e,n){let{transform:r,...i}=n;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...i}),r):r}function Ude(e){return R.useMemo(()=>({draggable:{...Eb.draggable,...e==null?void 0:e.draggable},droppable:{...Eb.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Eb.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 Kde(e){let{activeNode:n,measure:r,initialRect:i,config:s=!0}=e;const o=R.useRef(!1),{x:a,y:l}=typeof s=="boolean"?{x:s,y:s}:s;da(()=>{if(!a&&!l||!n){o.current=!1;return}if(o.current||!i)return;const h=n==null?void 0:n.node.current;if(!h||h.isConnected===!1)return;const p=r(h),g=OF(p,i);if(a||(g.x=0),l||(g.y=0),o.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const v=MF(h);v&&v.scrollBy({top:g.y,left:g.x})}},[n,a,l,i,r])}const b_=R.createContext({...ha,scaleX:1,scaleY:1});var wu;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wu||(wu={}));const Wde=R.memo(function(n){var r,i,s,o;let{id:a,accessibility:l,autoScroll:u=!0,children:h,sensors:p=Fde,collisionDetection:g=nde,measuring:v,modifiers:w,...S}=n;const E=R.useReducer(Bde,void 0,Vde),[x,I]=E,[P,M]=Wue(),[k,A]=R.useState(wu.Uninitialized),j=k===wu.Initialized,{draggable:{active:V,nodes:$,translate:W},droppable:{containers:B}}=x,H=V!=null?$.get(V):null,Y=R.useRef({initial:null,translated:null}),te=R.useMemo(()=>{var ke;return V!=null?{id:V,data:(ke=H==null?void 0:H.data)!=null?ke:$de,rect:Y}:null},[V,H]),ue=R.useRef(null),[ye,Ne]=R.useState(null),[q,G]=R.useState(null),ae=xv(S,Object.values(S)),ge=h0("DndDescribedBy",a),X=R.useMemo(()=>B.getEnabled(),[B]),ee=Ude(v),{droppableRects:ie,measureDroppableContainers:we,measuringScheduled:Se}=Nde(X,{dragging:j,dependencies:[W.x,W.y],config:ee.droppable}),J=Sde($,V),Re=R.useMemo(()=>q?gw(q):null,[q]),be=We(),Oe=Ide(J,ee.draggable.measure);Kde({activeNode:V!=null?$.get(V):null,config:be.layoutShiftCompensation,initialRect:Oe,measure:ee.draggable.measure});const Ee=Nk(J,ee.draggable.measure,Oe),Le=Nk(J?J.parentElement:null),tt=R.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:$,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pt=B.getNodeFor((r=tt.current.over)==null?void 0:r.id),_t=jde({measure:ee.dragOverlay.measure}),Ge=(i=_t.nodeRef.current)!=null?i:J,Ft=j?(s=_t.rect)!=null?s:Ee:null,Ke=!!(_t.nodeRef.current&&_t.rect),zt=Mde(Ke?null:Ee),kn=BF(Ge?Zi(Ge):null),yt=Pde(j?Pt??J:null),St=Lde(yt),Bt=WF(w,{transform:{x:W.x-zt.x,y:W.y-zt.y,scaleX:1,scaleY:1},activatorEvent:q,active:te,activeNodeRect:Ee,containerNodeRect:Le,draggingNodeRect:Ft,over:tt.current.over,overlayNodeRect:_t.rect,scrollableAncestors:yt,scrollableAncestorRects:St,windowRect:kn}),Nt=Re?Vp(Re,W):null,lt=Ade(yt),It=Ok(lt),ci=Ok(lt,[Ee]),dn=Vp(Bt,It),At=Ft?sde(Ft,Bt):null,mr=te&&At?g({active:te,collisionRect:At,droppableRects:ie,droppableContainers:X,pointerCoordinates:Nt}):null,Er=IF(mr,"id"),[Mn,ce]=R.useState(null),fe=Ke?Bt:Vp(Bt,ci),_e=rde(fe,(o=Mn==null?void 0:Mn.rect)!=null?o:null,Ee),ze=R.useRef(null),it=R.useCallback((ke,Be)=>{let{sensor:ct,options:Dt}=Be;if(ue.current==null)return;const Mt=$.get(ue.current);if(!Mt)return;const Jt=ke.nativeEvent,Fr=new ct({active:ue.current,activeNode:Mt,event:Jt,options:Dt,context:tt,onStart(xr){const Ss=ue.current;if(Ss==null)return;const Ds=$.get(Ss);if(!Ds)return;const{onDragStart:ma}=ae.current,eo={activatorEvent:Jt,active:{id:Ss,data:Ds.data,rect:Y}};Ya.unstable_batchedUpdates(()=>{ma==null||ma(eo),A(wu.Initializing),I({type:Ur.DragStart,initialCoordinates:xr,active:Ss}),P({type:"onDragStart",event:eo}),Ne(ze.current),G(Jt)})},onMove(xr){I({type:Ur.DragMove,coordinates:xr})},onEnd:xs(Ur.DragEnd),onCancel:xs(Ur.DragCancel)});ze.current=Fr;function xs(xr){return async function(){const{active:Ds,collisions:ma,over:eo,scrollAdjustedTranslate:Cl}=tt.current;let to=null;if(Ds&&Cl){const{cancelDrop:Ro}=ae.current;to={activatorEvent:Jt,active:Ds,collisions:ma,delta:Cl,over:eo},xr===Ur.DragEnd&&typeof Ro=="function"&&await Promise.resolve(Ro(to))&&(xr=Ur.DragCancel)}ue.current=null,Ya.unstable_batchedUpdates(()=>{I({type:xr}),A(wu.Uninitialized),ce(null),Ne(null),G(null),ze.current=null;const Ro=xr===Ur.DragEnd?"onDragEnd":"onDragCancel";if(to){const hd=ae.current[Ro];hd==null||hd(to),P({type:Ro,event:to})}})}}},[$]),Gt=R.useCallback((ke,Be)=>(ct,Dt)=>{const Mt=ct.nativeEvent,Jt=$.get(Dt);if(ue.current!==null||!Jt||Mt.dndKit||Mt.defaultPrevented)return;const Fr={active:Jt};ke(ct,Be.options,Fr)===!0&&(Mt.dndKit={capturedBy:Be.sensor},ue.current=Dt,it(ct,Be))},[$,it]),hn=Dde(p,Gt);Rde(p),da(()=>{Ee&&k===wu.Initializing&&A(wu.Initialized)},[Ee,k]),R.useEffect(()=>{const{onDragMove:ke}=ae.current,{active:Be,activatorEvent:ct,collisions:Dt,over:Mt}=tt.current;if(!Be||!ct)return;const Jt={active:Be,activatorEvent:ct,collisions:Dt,delta:{x:dn.x,y:dn.y},over:Mt};Ya.unstable_batchedUpdates(()=>{ke==null||ke(Jt),P({type:"onDragMove",event:Jt})})},[dn.x,dn.y]),R.useEffect(()=>{const{active:ke,activatorEvent:Be,collisions:ct,droppableContainers:Dt,scrollAdjustedTranslate:Mt}=tt.current;if(!ke||ue.current==null||!Be||!Mt)return;const{onDragOver:Jt}=ae.current,Fr=Dt.get(Er),xs=Fr&&Fr.rect.current?{id:Fr.id,rect:Fr.rect.current,data:Fr.data,disabled:Fr.disabled}:null,xr={active:ke,activatorEvent:Be,collisions:ct,delta:{x:Mt.x,y:Mt.y},over:xs};Ya.unstable_batchedUpdates(()=>{ce(xs),Jt==null||Jt(xr),P({type:"onDragOver",event:xr})})},[Er]),da(()=>{tt.current={activatorEvent:q,active:te,activeNode:J,collisionRect:At,collisions:mr,droppableRects:ie,draggableNodes:$,draggingNode:Ge,draggingNodeRect:Ft,droppableContainers:B,over:Mn,scrollableAncestors:yt,scrollAdjustedTranslate:dn},Y.current={initial:Ft,translated:At}},[te,J,mr,At,$,Ge,Ft,ie,B,Mn,yt,dn]),Cde({...be,delta:W,draggingRect:At,pointerCoordinates:Nt,scrollableAncestors:yt,scrollableAncestorRects:St});const wt=R.useMemo(()=>({active:te,activeNode:J,activeNodeRect:Ee,activatorEvent:q,collisions:mr,containerNodeRect:Le,dragOverlay:_t,draggableNodes:$,droppableContainers:B,droppableRects:ie,over:Mn,measureDroppableContainers:we,scrollableAncestors:yt,scrollableAncestorRects:St,measuringConfiguration:ee,measuringScheduled:Se,windowRect:kn}),[te,J,Ee,q,mr,Le,_t,$,B,ie,Mn,we,yt,St,ee,Se,kn]),He=R.useMemo(()=>({activatorEvent:q,activators:hn,active:te,activeNodeRect:Ee,ariaDescribedById:{draggable:ge},dispatch:I,draggableNodes:$,over:Mn,measureDroppableContainers:we}),[q,hn,te,Ee,I,ge,$,Mn,we]);return D.createElement(SF.Provider,{value:M},D.createElement(f0.Provider,{value:He},D.createElement(KF.Provider,{value:wt},D.createElement(b_.Provider,{value:_e},h)),D.createElement(Hde,{disabled:(l==null?void 0:l.restoreFocus)===!1})),D.createElement(Yue,{...l,hiddenTextDescribedById:ge}));function We(){const ke=(ye==null?void 0:ye.autoScrollEnabled)===!1,Be=typeof u=="object"?u.enabled===!1:u===!1,ct=j&&!ke&&!Be;return typeof u=="object"?{...u,enabled:ct}:{enabled:ct}}}),qde=R.createContext(null),Mk="button",Gde="Draggable";function Yde(e){let{id:n,data:r,disabled:i=!1,attributes:s}=e;const o=h0(Gde),{activators:a,activatorEvent:l,active:u,activeNodeRect:h,ariaDescribedById:p,draggableNodes:g,over:v}=R.useContext(f0),{role:w=Mk,roleDescription:S="draggable",tabIndex:E=0}=s??{},x=(u==null?void 0:u.id)===n,I=R.useContext(x?b_:qde),[P,M]=fw(),[k,A]=fw(),j=kde(a,n),V=xv(r);da(()=>(g.set(n,{id:n,key:o,node:P,activatorNode:k,data:V}),()=>{const W=g.get(n);W&&W.key===o&&g.delete(n)}),[g,n]);const $=R.useMemo(()=>({role:w,tabIndex:E,"aria-disabled":i,"aria-pressed":x&&w===Mk?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[i,w,E,x,S,p.draggable]);return{active:u,activatorEvent:l,activeNodeRect:h,attributes:$,isDragging:x,listeners:i?void 0:j,node:P,over:v,setNodeRef:M,setActivatorNodeRef:A,transform:I}}function qF(){return R.useContext(KF)}const Xde="Droppable",Zde={timeout:25};function Qde(e){let{data:n,disabled:r=!1,id:i,resizeObserverConfig:s}=e;const o=h0(Xde),{active:a,dispatch:l,over:u,measureDroppableContainers:h}=R.useContext(f0),p=R.useRef({disabled:r}),g=R.useRef(!1),v=R.useRef(null),w=R.useRef(null),{disabled:S,updateMeasurementsFor:E,timeout:x}={...Zde,...s},I=xv(E??i),P=R.useCallback(()=>{if(!g.current){g.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{h(Array.isArray(I.current)?I.current:[I.current]),w.current=null},x)},[x]),M=v_({callback:P,disabled:S||!a}),k=R.useCallback(($,W)=>{M&&(W&&(M.unobserve(W),g.current=!1),$&&M.observe($))},[M]),[A,j]=fw(k),V=xv(n);return R.useEffect(()=>{!M||!A.current||(M.disconnect(),g.current=!1,M.observe(A.current))},[A,M]),R.useEffect(()=>(l({type:Ur.RegisterDroppable,element:{id:i,key:o,disabled:r,node:A,rect:v,data:V}}),()=>l({type:Ur.UnregisterDroppable,key:o,id:i})),[i]),R.useEffect(()=>{r!==p.current.disabled&&(l({type:Ur.SetDroppableDisabled,id:i,key:o,disabled:r}),p.current.disabled=r)},[i,o,r,l]),{active:a,rect:v,isOver:(u==null?void 0:u.id)===i,node:A,over:u,setNodeRef:j}}function Jde(e){let{animation:n,children:r}=e;const[i,s]=R.useState(null),[o,a]=R.useState(null),l=pw(r);return!r&&!i&&l&&s(l),da(()=>{if(!o)return;const u=i==null?void 0:i.key,h=i==null?void 0:i.props.id;if(u==null||h==null){s(null);return}Promise.resolve(n(h,o)).then(()=>{s(null)})},[n,i,o]),D.createElement(D.Fragment,null,r,i?R.cloneElement(i,{ref:a}):null)}const ehe={x:0,y:0,scaleX:1,scaleY:1};function the(e){let{children:n}=e;return D.createElement(f0.Provider,{value:UF},D.createElement(b_.Provider,{value:ehe},n))}const nhe={position:"fixed",touchAction:"none"},rhe=e=>y_(e)?"transform 250ms ease":void 0,ihe=R.forwardRef((e,n)=>{let{as:r,activatorEvent:i,adjustScale:s,children:o,className:a,rect:l,style:u,transform:h,transition:p=rhe}=e;if(!l)return null;const g=s?h:{...h,scaleX:1,scaleY:1},v={...nhe,width:l.width,height:l.height,top:l.top,left:l.left,transform:Zu.Transform.toString(g),transformOrigin:s&&i?Zue(i,l):void 0,transition:typeof p=="function"?p(i):p,...u};return D.createElement(r,{className:a,style:v,ref:n},o)}),she=e=>n=>{let{active:r,dragOverlay:i}=n;const s={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[l,u]of Object.entries(o.active))u!==void 0&&(s[l]=r.node.style.getPropertyValue(l),r.node.style.setProperty(l,u));if(o!=null&&o.dragOverlay)for(const[l,u]of Object.entries(o.dragOverlay))u!==void 0&&i.node.style.setProperty(l,u);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&i.node.classList.add(a.dragOverlay),function(){for(const[u,h]of Object.entries(s))r.node.style.setProperty(u,h);a!=null&&a.active&&r.node.classList.remove(a.active)}},ohe=e=>{let{transform:{initial:n,final:r}}=e;return[{transform:Zu.Transform.toString(n)},{transform:Zu.Transform.toString(r)}]},ahe={duration:250,easing:"ease",keyframes:ohe,sideEffects:she({styles:{active:{opacity:"0"}}})};function lhe(e){let{config:n,draggableNodes:r,droppableContainers:i,measuringConfiguration:s}=e;return g_((o,a)=>{if(n===null)return;const l=r.get(o);if(!l)return;const u=l.node.current;if(!u)return;const h=HF(a);if(!h)return;const{transform:p}=Zi(a).getComputedStyle(a),g=TF(p);if(!g)return;const v=typeof n=="function"?n:che(n);return jF(u,s.draggable.measure),v({active:{id:o,data:l.data,node:u,rect:s.draggable.measure(u)},draggableNodes:r,dragOverlay:{node:a,rect:s.dragOverlay.measure(h)},droppableContainers:i,measuringConfiguration:s,transform:g})})}function che(e){const{duration:n,easing:r,sideEffects:i,keyframes:s}={...ahe,...e};return o=>{let{active:a,dragOverlay:l,transform:u,...h}=o;if(!n)return;const p={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},g={scaleX:u.scaleX!==1?a.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?a.rect.height*u.scaleY/l.rect.height:1},v={x:u.x-p.x,y:u.y-p.y,...g},w=s({...h,active:a,dragOverlay:l,transform:{initial:u,final:v}}),[S]=w,E=w[w.length-1];if(JSON.stringify(S)===JSON.stringify(E))return;const x=i==null?void 0:i({active:a,dragOverlay:l,...h}),I=l.node.animate(w,{duration:n,easing:r,fill:"forwards"});return new Promise(P=>{I.onfinish=()=>{x==null||x(),P()}})}}let Pk=0;function uhe(e){return R.useMemo(()=>{if(e!=null)return Pk++,Pk},[e])}const dhe=D.memo(e=>{let{adjustScale:n=!1,children:r,dropAnimation:i,style:s,transition:o,modifiers:a,wrapperElement:l="div",className:u,zIndex:h=999}=e;const{activatorEvent:p,active:g,activeNodeRect:v,containerNodeRect:w,draggableNodes:S,droppableContainers:E,dragOverlay:x,over:I,measuringConfiguration:P,scrollableAncestors:M,scrollableAncestorRects:k,windowRect:A}=qF(),j=R.useContext(b_),V=uhe(g==null?void 0:g.id),$=WF(a,{activatorEvent:p,active:g,activeNodeRect:v,containerNodeRect:w,draggingNodeRect:x.rect,over:I,overlayNodeRect:x.rect,scrollableAncestors:M,scrollableAncestorRects:k,transform:j,windowRect:A}),W=QO(v),B=lhe({config:i,draggableNodes:S,droppableContainers:E,measuringConfiguration:P}),H=W?x.setRef:void 0;return D.createElement(the,null,D.createElement(Jde,{animation:B},g&&V?D.createElement(ihe,{key:V,id:g.id,ref:H,as:l,activatorEvent:p,adjustScale:n,className:u,transition:o,rect:W,style:{zIndex:h,...s},transform:$},r):null))});function GF(e,n,r){const i=e.slice();return i.splice(r<0?i.length+r:r,0,i.splice(n,1)[0]),i}function hhe(e,n){return e.reduce((r,i,s)=>{const o=n.get(i);return o&&(r[s]=o),r},Array(e.length))}function fb(e){return e!==null&&e>=0}function fhe(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function phe(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const JO=e=>{let{rects:n,activeIndex:r,overIndex:i,index:s}=e;const o=GF(n,i,r),a=n[s],l=o[s];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},YF="Sortable",XF=D.createContext({activeIndex:-1,containerId:YF,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:JO,disabled:{draggable:!1,droppable:!1}});function ghe(e){let{children:n,id:r,items:i,strategy:s=JO,disabled:o=!1}=e;const{active:a,dragOverlay:l,droppableRects:u,over:h,measureDroppableContainers:p}=qF(),g=h0(YF,r),v=l.rect!==null,w=R.useMemo(()=>i.map(j=>typeof j=="object"&&"id"in j?j.id:j),[i]),S=a!=null,E=a?w.indexOf(a.id):-1,x=h?w.indexOf(h.id):-1,I=R.useRef(w),P=!fhe(w,I.current),M=x!==-1&&E===-1||P,k=phe(o);da(()=>{P&&S&&p(w)},[P,w,S,p]),R.useEffect(()=>{I.current=w},[w]);const A=R.useMemo(()=>({activeIndex:E,containerId:g,disabled:k,disableTransforms:M,items:w,overIndex:x,useDragOverlay:v,sortedRects:hhe(w,u),strategy:s}),[E,g,k.draggable,k.droppable,M,w,x,u,v,s]);return D.createElement(XF.Provider,{value:A},n)}const yhe=e=>{let{id:n,items:r,activeIndex:i,overIndex:s}=e;return GF(r,i,s).indexOf(n)},mhe=e=>{let{containerId:n,isSorting:r,wasDragging:i,index:s,items:o,newIndex:a,previousItems:l,previousContainerId:u,transition:h}=e;return!h||!i||l!==o&&s===a?!1:r?!0:a!==s&&n===u},vhe={duration:200,easing:"ease"},ZF="transform",bhe=Zu.Transition.toString({property:ZF,duration:0,easing:"linear"}),whe={roleDescription:"sortable"};function _he(e){let{disabled:n,index:r,node:i,rect:s}=e;const[o,a]=R.useState(null),l=R.useRef(r);return da(()=>{if(!n&&r!==l.current&&i.current){const u=s.current;if(u){const h=Ag(i.current,{ignoreTransform:!0}),p={x:u.left-h.left,y:u.top-h.top,scaleX:u.width/h.width,scaleY:u.height/h.height};(p.x||p.y)&&a(p)}}r!==l.current&&(l.current=r)},[n,r,i,s]),R.useEffect(()=>{o&&a(null)},[o]),o}function Che(e){let{animateLayoutChanges:n=mhe,attributes:r,disabled:i,data:s,getNewIndex:o=yhe,id:a,strategy:l,resizeObserverConfig:u,transition:h=vhe}=e;const{items:p,containerId:g,activeIndex:v,disabled:w,disableTransforms:S,sortedRects:E,overIndex:x,useDragOverlay:I,strategy:P}=R.useContext(XF),M=Ehe(i,w),k=p.indexOf(a),A=R.useMemo(()=>({sortable:{containerId:g,index:k,items:p},...s}),[g,s,k,p]),j=R.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:V,node:$,isOver:W,setNodeRef:B}=Qde({id:a,data:A,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...u}}),{active:H,activatorEvent:Y,activeNodeRect:te,attributes:ue,setNodeRef:ye,listeners:Ne,isDragging:q,over:G,setActivatorNodeRef:ae,transform:ge}=Yde({id:a,data:A,attributes:{...whe,...r},disabled:M.draggable}),X=Lue(B,ye),ee=!!H,ie=ee&&!S&&fb(v)&&fb(x),we=!I&&q,Se=we&&ie?ge:null,Re=ie?Se??(l??P)({rects:E,activeNodeRect:te,activeIndex:v,overIndex:x,index:k}):null,be=fb(v)&&fb(x)?o({id:a,items:p,activeIndex:v,overIndex:x}):k,Oe=H==null?void 0:H.id,Ee=R.useRef({activeId:Oe,items:p,newIndex:be,containerId:g}),Le=p!==Ee.current.items,tt=n({active:H,containerId:g,isDragging:q,isSorting:ee,id:a,index:k,items:p,newIndex:Ee.current.newIndex,previousItems:Ee.current.items,previousContainerId:Ee.current.containerId,transition:h,wasDragging:Ee.current.activeId!=null}),Pt=_he({disabled:!tt,index:k,node:$,rect:V});return R.useEffect(()=>{ee&&Ee.current.newIndex!==be&&(Ee.current.newIndex=be),g!==Ee.current.containerId&&(Ee.current.containerId=g),p!==Ee.current.items&&(Ee.current.items=p)},[ee,be,g,p]),R.useEffect(()=>{if(Oe===Ee.current.activeId)return;if(Oe&&!Ee.current.activeId){Ee.current.activeId=Oe;return}const Ge=setTimeout(()=>{Ee.current.activeId=Oe},50);return()=>clearTimeout(Ge)},[Oe]),{active:H,activeIndex:v,attributes:ue,data:A,rect:V,index:k,newIndex:be,items:p,isOver:W,isSorting:ee,isDragging:q,listeners:Ne,node:$,overIndex:x,over:G,setNodeRef:X,setActivatorNodeRef:ae,setDroppableNodeRef:B,setDraggableNodeRef:ye,transform:Pt??Re,transition:_t()};function _t(){if(Pt||Le&&Ee.current.newIndex===k)return bhe;if(!(we&&!y_(Y)||!h)&&(ee||tt))return Zu.Transition.toString({...h,property:ZF})}}function Ehe(e,n){var r,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:n.draggable,droppable:(i=e==null?void 0:e.droppable)!=null?i:n.droppable}}function mw(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const xhe=[sn.Down,sn.Right,sn.Up,sn.Left],She=(e,n)=>{let{context:{active:r,collisionRect:i,droppableRects:s,droppableContainers:o,over:a,scrollableAncestors:l}}=n;if(xhe.includes(e.code)){if(e.preventDefault(),!r||!i)return;const u=[];o.getEnabled().forEach(g=>{if(!g||g!=null&&g.disabled)return;const v=s.get(g.id);if(v)switch(e.code){case sn.Down:i.top<v.top&&u.push(g);break;case sn.Up:i.top>v.top&&u.push(g);break;case sn.Left:i.left>v.left&&u.push(g);break;case sn.Right:i.left<v.left&&u.push(g);break}});const h=ede({collisionRect:i,droppableRects:s,droppableContainers:u});let p=IF(h,"id");if(p===(a==null?void 0:a.id)&&h.length>1&&(p=h[1].id),p!=null){const g=o.get(r.id),v=o.get(p),w=v?s.get(v.id):null,S=v==null?void 0:v.node.current;if(S&&w&&g&&v){const x=m_(S).some((j,V)=>l[V]!==j),I=QF(g,v),P=Dhe(g,v),M=x||!I?{x:0,y:0}:{x:P?i.width-w.width:0,y:P?i.height-w.height:0},k={x:w.left,y:w.top};return M.x&&M.y?k:Sv(k,M)}}}};function QF(e,n){return!mw(e)||!mw(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function Dhe(e,n){return!mw(e)||!mw(n)||!QF(e,n)?!1:e.data.current.sortable.index<n.data.current.sortable.index}const Nhe="semi-sortable";function Ihe(e){return D.createElement("div",Object.assign({style:{overflow:"auto"}},e))}const Ohe={coordinateGetter:She};function The(e){let{items:n,onSortEnd:r,adjustScale:i,renderItem:s,transition:o,collisionDetection:a=Jue,strategy:l=JO,useDragOverlay:u=!0,dragOverlayCls:h,container:p=Ihe,prefix:g=Nhe}=e;const[v,w]=R.useState(null),S=Xue(VD(zF),VD(VF),VD(XO,Ohe)),E=R.useCallback(k=>n.indexOf(k),[n]),x=R.useMemo(()=>v?E(v):-1,[E,v]),I=R.useCallback(k=>{let{active:A}=k;A&&w(A.id)},[]),P=R.useCallback(k=>{let{over:A}=k;if(w(null),A){const j=E(A.id);x!==j&&r({oldIndex:x,newIndex:j})}},[x,E,r]),M=R.useCallback(()=>{w(null)},[]);return D.createElement(Wde,{sensors:S,collisionDetection:a,onDragStart:I,onDragEnd:P,onDragCancel:M,autoScroll:{order:Dv.ReversedTreeOrder}},D.createElement(ghe,{items:n,strategy:l},D.createElement(p,null,n.map((k,A)=>D.createElement(Mhe,{key:k,id:k,index:A,renderItem:s,useDragOverlay:u,prefix:g,transition:o})))),u?Ya.createPortal(D.createElement(dhe,{adjustScale:i,style:{zIndex:void 0},className:h},v?s({id:v,sortableHandle:k=>k}):null),document.body):null)}function Mhe(e){let{animateLayoutChanges:n,id:r,renderItem:i,prefix:s,transition:o}=e;const{listeners:a,setNodeRef:l,transform:u,transition:h,active:p,isOver:g,attributes:v}=Che({id:r,animateLayoutChanges:n,transition:o}),w=R.useCallback(x=>()=>D.createElement("span",Object.assign({},a,{style:{lineHeight:0},onMouseDown:I=>{a.onMouseDown(I),I.preventDefault(),I.stopPropagation()}}),D.createElement(x,null)),[a]),S=xe(`${s}-sortable-item`,{[`${s}-sortable-item-over`]:g,[`${s}-sortable-item-active`]:(p==null?void 0:p.id)===r}),E=R.useMemo(()=>kh(o)?void 0:{transform:Zu.Transform.toString(Object.assign(Object.assign({},u),{scaleX:1,scaleY:1})),transition:h},[o,u,h]);return D.createElement("div",Object.assign({ref:l,style:E,className:S},v),i({id:r,sortableHandle:w}))}var Phe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Qt=Aue.PREFIX;function Ahe(e){return D.createElement("div",Object.assign({className:`${Qt}-sortable-list`},e))}class w_ extends jr{constructor(n){super(n),this.handleInputChange=r=>{this.foundation.handleInputChange(r)},this.handleKeyDown=r=>{this.foundation.handleKeyDown(r)},this.handleInputFocus=r=>{this.foundation.handleInputFocus(r)},this.handleInputBlur=r=>{this.foundation.handleInputBlur(r)},this.handleClearBtn=r=>{this.foundation.handleClearBtn(r)},this.handleClearEnterPress=r=>{this.foundation.handleClearEnterPress(r)},this.handleTagClose=r=>{this.foundation.handleTagClose(r)},this.handleInputMouseLeave=r=>{this.foundation.handleInputMouseLeave()},this.handleClick=r=>{this.foundation.handleClick(r)},this.handleInputMouseEnter=r=>{this.foundation.handleInputMouseEnter()},this.handleClickPrefixOrSuffix=r=>{this.foundation.handleClickPrefixOrSuffix(r)},this.handlePreventMouseDown=r=>{this.foundation.handlePreventMouseDown(r)},this.getAllTags=()=>{const{tagsArray:r}=this.state;return r.map((i,s)=>this.renderTag(i,s))},this.renderTag=(r,i,s)=>{const{size:o,disabled:a,renderTagItem:l,showContentTooltip:u,draggable:h}=this.props,{active:p}=this.state,g=p&&h,v=xe(`${Qt}-wrapper-tag`,{[`${Qt}-wrapper-tag-size-${o}`]:o,[`${Qt}-wrapper-tag-icon`]:g}),w=xe(`${Qt}-wrapper-typo`,{[`${Qt}-wrapper-typo-disabled`]:a}),S=xe({[`${Qt}-drag-item`]:g,[`${Qt}-wrapper-tag-icon`]:g}),E=s&&s(()=>D.createElement(Yj,{className:`${Qt}-drag-handler`})),x=g?r:`${i}${r}`,I=()=>{!a&&this.handleTagClose(i)};return sr(l)?D.createElement("div",{className:S,key:x},g&&s?D.createElement(E,null):null,l(r,i,I)):D.createElement(Gs,{className:v,color:"white",size:o==="small"?"small":"large",type:"light",onClose:I,closable:!a,key:x,visible:!0,"aria-label":`${a?"":"Closable "}Tag: ${r}`},g&&s?D.createElement(E,null):null,D.createElement(s_,{className:w,ellipsis:{showTooltip:u,rows:1}},r))},this.renderSortTag=r=>{const{id:i,sortableHandle:s}=r,{tagsArray:o}=this.state,a=o.indexOf(i);return this.renderTag(i,a,s)},this.onSortEnd=r=>{this.foundation.handleSortEnd(r)},this.handleInputCompositionStart=r=>{this.foundation.handleInputCompositionStart(r)},this.handleInputCompositionEnd=r=>{this.foundation.handleInputCompositionEnd(r)},this.foundation=new kue(this.adapter),this.state={tagsArray:n.defaultValue||[],inputValue:"",focusing:!1,hovering:!1,active:!1,entering:!1},this.inputRef=D.createRef(),this.tagInputRef=D.createRef(),this.clickOutsideHandler=null}static getDerivedStateFromProps(n,r){const{value:i,inputValue:s}=n,{tagsArray:o}=r;let a;return fj(i)?a=i:"value"in n&&!i?a=[]:a=o,{tagsArray:a,inputValue:fr(s)?s:r.inputValue}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setInputValue:n=>{this.setState({inputValue:n})},setTagsArray:n=>{this.setState({tagsArray:n})},setFocusing:n=>{this.setState({focusing:n})},toggleFocusing:n=>{const{preventScroll:r}=this.props,i=this.inputRef&&this.inputRef.current;n?i&&i.focus({preventScroll:r}):i&&i.blur(),this.setState({focusing:n})},setHovering:n=>{this.setState({hovering:n})},setActive:n=>{this.setState({active:n})},setEntering:n=>{this.setState({entering:n})},getClickOutsideHandler:()=>this.clickOutsideHandler,notifyBlur:n=>{this.props.onBlur(n)},notifyFocus:n=>{this.props.onFocus(n)},notifyInputChange:(n,r)=>{this.props.onInputChange(n,r)},notifyTagChange:n=>{this.props.onChange(n)},notifyTagAdd:n=>{this.props.onAdd(n)},notifyTagRemove:(n,r)=>{this.props.onRemove(n,r)},notifyKeyDown:n=>{this.props.onKeyDown(n)},registerClickOutsideHandler:n=>{const r=i=>{const s=this.tagInputRef&&this.tagInputRef.current,o=i.target,a=i.composedPath&&i.composedPath()||[o];s&&!s.contains(o)&&!a.includes(s)&&n(i)};this.clickOutsideHandler=r,document.addEventListener("click",r,!1)},unregisterClickOutsideHandler:()=>{document.removeEventListener("click",this.clickOutsideHandler,!1),this.clickOutsideHandler=null}})}componentDidMount(){const{disabled:n,autoFocus:r,preventScroll:i}=this.props;!n&&r&&(this.inputRef.current.focus({preventScroll:i}),this.foundation.handleClick()),this.foundation.init()}renderClearBtn(){const{hovering:n,tagsArray:r,inputValue:i}=this.state,{showClear:s,disabled:o,clearIcon:a}=this.props,l=xe(`${Qt}-clearBtn`,{[`${Qt}-clearBtn-invisible`]:!n||i===""&&r.length===0||o});return s?D.createElement("div",{role:"button",tabIndex:0,"aria-label":"Clear TagInput value",className:l,onClick:u=>this.handleClearBtn(u),onKeyPress:u=>this.handleClearEnterPress(u)},a||D.createElement(n_,null)):null}renderPrefix(){const{prefix:n,insetLabel:r,insetLabelId:i}=this.props,s=n||r;if(kh(s)||kr(s))return null;const o=xe(`${Qt}-prefix`,{[`${Qt}-inset-label`]:r,[`${Qt}-prefix-text`]:s&&fr(s),[`${Qt}-prefix-icon`]:Hs(s)});return D.createElement("div",{className:o,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,id:i,"x-semi-prop":"prefix"},s)}renderSuffix(){const{suffix:n}=this.props;if(kh(n)||kr(n))return null;const r=xe(`${Qt}-suffix`,{[`${Qt}-suffix-text`]:n&&fr(n),[`${Qt}-suffix-icon`]:Hs(n)});return D.createElement("div",{className:r,onMouseDown:this.handlePreventMouseDown,onClick:this.handleClickPrefixOrSuffix,"x-semi-prop":"suffix"},n)}renderTags(){const{disabled:n,maxTagCount:r,showRestTagsPopover:i,restTagsPopoverProps:s={},draggable:o,expandRestTagsOnClick:a}=this.props,{tagsArray:l,active:u}=this.state,h=xe(`${Qt}-wrapper-n`,{[`${Qt}-wrapper-n-disabled`]:n}),p=this.getAllTags();let g=[],v=[...p];(!u||!a)&&r&&r<p.length&&(v=p.slice(0,r),g=p.slice(r));const w=D.createElement("span",{className:h},"+",l.length-r),S=p.map((E,x)=>({item:E,key:l[x]}));return u&&o&&S.length>0?D.createElement(The,{items:l,onSortEnd:this.onSortEnd,renderItem:this.renderSortTag,container:Ahe,prefix:Qt,transition:null,dragOverlayCls:`${Qt}-right-item-drag-item-move`}):D.createElement(D.Fragment,null,v,g.length>0&&(i?D.createElement(Yi,Object.assign({content:g,showArrow:!0,trigger:"hover",position:"top",autoAdjustOverflow:!0},s),w):w))}blur(){this.inputRef.current.blur(),this.foundation.clickOutsideCallBack()}focus(){const{preventScroll:n,disabled:r}=this.props;this.inputRef.current.focus({preventScroll:n}),r||this.foundation.handleClick()}render(){const n=this.props,{size:r,style:i,className:s,disabled:o,placeholder:a,validateStatus:l,prefix:u,insetLabel:h,suffix:p}=n,g=Phe(n,["size","style","className","disabled","placeholder","validateStatus","prefix","insetLabel","suffix"]),{focusing:v,hovering:w,tagsArray:S,inputValue:E,active:x}=this.state,I=xe(Qt,s,{[`${Qt}-focus`]:v||x,[`${Qt}-disabled`]:o,[`${Qt}-hover`]:w&&!o,[`${Qt}-error`]:l==="error",[`${Qt}-warning`]:l==="warning",[`${Qt}-small`]:r==="small",[`${Qt}-large`]:r==="large",[`${Qt}-with-prefix`]:!!u||!!h,[`${Qt}-with-suffix`]:!!p}),P=xe(`${Qt}-wrapper-input`,`${Qt}-wrapper-input-${r}`),M=xe(`${Qt}-wrapper`);return D.createElement("div",Object.assign({ref:this.tagInputRef,style:i,className:I,"aria-disabled":o,"aria-label":this.props["aria-label"],"aria-invalid":l==="error",onMouseEnter:k=>{this.handleInputMouseEnter(k)},onMouseLeave:k=>{this.handleInputMouseLeave(k)},onClick:k=>{this.handleClick(k)}},this.getDataAttr(g)),this.renderPrefix(),D.createElement("div",{className:M},this.renderTags(),D.createElement(vc,{"aria-label":"input value",ref:this.inputRef,className:P,disabled:o,value:E,size:r,placeholder:S.length===0?a:"",onKeyDown:k=>{this.handleKeyDown(k)},onChange:(k,A)=>{this.handleInputChange(A)},onBlur:k=>{this.handleInputBlur(k)},onFocus:k=>{this.handleInputFocus(k)},onCompositionStart:this.handleInputCompositionStart,onCompositionEnd:this.handleInputCompositionEnd})),this.renderClearBtn(),this.renderSuffix())}}w_.propTypes={children:C.node,clearIcon:C.node,style:C.object,className:C.string,disabled:C.bool,allowDuplicates:C.bool,max:C.number,maxTagCount:C.number,maxLength:C.number,showRestTagsPopover:C.bool,restTagsPopoverProps:C.object,showContentTooltip:C.oneOfType([C.shape({type:C.string,opts:C.object}),C.bool]),defaultValue:C.array,value:C.array,inputValue:C.string,placeholder:C.string,separator:C.oneOfType([C.string,C.array]),showClear:C.bool,addOnBlur:C.bool,draggable:C.bool,expandRestTagsOnClick:C.bool,autoFocus:C.bool,renderTagItem:C.func,onBlur:C.func,onFocus:C.func,onChange:C.func,onInputChange:C.func,onExceed:C.func,onInputExceed:C.func,onAdd:C.func,onRemove:C.func,onKeyDown:C.func,size:C.oneOf(vk.SIZE_SET),validateStatus:C.oneOf(vk.STATUS),prefix:C.oneOfType([C.string,C.node]),suffix:C.oneOfType([C.string,C.node]),"aria-label":C.string,preventScroll:C.bool};w_.defaultProps={showClear:!1,addOnBlur:!1,allowDuplicates:!0,showRestTagsPopover:!0,autoFocus:!1,draggable:!1,expandRestTagsOnClick:!0,showContentTooltip:!0,separator:",",size:"default",validateStatus:"default",onBlur:rt,onFocus:rt,onChange:rt,onInputChange:rt,onExceed:rt,onInputExceed:rt,onAdd:rt,onRemove:rt,onKeyDown:rt};const Ut=gF.PREFIX,Rhe=0;class ug extends jr{constructor(n){super(n),this.search=r=>{this.handleInputChange(r)},this.handleInputChange=r=>{this.foundation.handleInputChange(r)},this.handleTagRemoveInTrigger=r=>{this.foundation.handleTagRemoveInTrigger(r)},this.handleTagClose=(r,i,s)=>{i.preventDefault(),this.foundation.handleTagRemoveByKey(s)},this.renderTagItem=(r,i)=>{const{keyEntities:s,disabledKeys:o}=this.state,{size:a,disabled:l,displayProp:u,displayRender:h,disableStrictly:p}=this.props;if(s[r]){const g=l||s[r].data.disabled||p&&o.has(r),v=xe(`${Ut}-selection-tag`,{[`${Ut}-selection-tag-disabled`]:g});return sr(h)?h(s[r],i):D.createElement(Gs,{size:a==="default"?"large":a,key:`tag-${r}-${i}`,color:"white",tagKey:r,className:v,closable:!0,onClose:this.handleTagClose},s[r].data[u])}return null},this.onRemoveInTagInput=r=>{this.foundation.handleTagRemoveByKey(r)},this.handleItemClick=(r,i)=>{this.foundation.handleItemClick(r,i)},this.handleItemHover=(r,i)=>{this.foundation.handleItemHover(r,i)},this.onItemCheckboxClick=r=>{this.foundation.onItemCheckboxClick(r)},this.handleListScroll=(r,i)=>{this.foundation.handleListScroll(r,i)},this.renderContent=()=>{const{inputValue:r,isSearching:i,activeKeys:s,selectedKeys:o,checkedKeys:a,halfCheckedKeys:l,loadedKeys:u,loadingKeys:h}=this.state,{filterTreeNode:p,dropdownClassName:g,dropdownStyle:v,loadData:w,emptyContent:S,separator:E,topSlot:x,bottomSlot:I,showNext:P,multiple:M,filterRender:k,virtualizeInSearch:A,expandIcon:j}=this.props,V=!!p&&i,$=xe(g,`${Ut}-popover`),W=this.foundation.getRenderData(),H=!W||!W.length?Object.assign(Object.assign({},v),{minWidth:this.state.emptyContentMinWidth}):v;return D.createElement("div",{className:$,role:"listbox",style:H,onKeyDown:this.foundation.handleKeyDown},x,D.createElement(f_,{activeKeys:s,selectedKeys:o,separator:E,loadedKeys:u,loadingKeys:h,onItemClick:this.handleItemClick,onItemHover:this.handleItemHover,showNext:P,onItemCheckboxClick:this.onItemCheckboxClick,onListScroll:this.handleListScroll,searchable:V,keyword:r,emptyContent:S,loadData:w,data:W,multiple:M,checkedKeys:a,halfCheckedKeys:l,filterRender:k,virtualize:A,expandIcon:j}),I)},this.renderPlusN=r=>{const{disabled:i,showRestTagsPopover:s,restTagsPopoverProps:o}=this.props,a=xe(`${Ut}-selection-n`,{[`${Ut}-selection-n-disabled`]:i}),l=D.createElement("span",{className:a},"+",r.length);return s?D.createElement(Yi,Object.assign({content:r,showArrow:!0,trigger:"hover",position:"top",autoAdjustOverflow:!0},o),l):l},this.renderMultipleTags=()=>{const{autoMergeValue:r,maxTagCount:i,checkRelation:s}=this.props,{checkedKeys:o,resolvedCheckedKeys:a}=this.state,l=this.mergeType===ir.NONE_MERGE_TYPE||s===ir.UN_RELATED?o:a,u=[],h=[];return[...l].forEach((p,g)=>{const v=!Ki(i)||i>=g+1,w=this.renderTagItem(p,g);v?u.push(w):h.push(w)}),D.createElement(D.Fragment,null,u,!$n(h)&&this.renderPlusN(h))},this.renderDisplayText=()=>{const{displayProp:r,separator:i,displayRender:s}=this.props,{selectedKeys:o}=this.state;let a="";if(o.size){const l=this.foundation.getItemPropPath([...o][0],r);s&&typeof s=="function"?a=s(l):a=l.map((u,h)=>D.createElement(R.Fragment,{key:`${u}-${h}`},h<l.length-1?D.createElement(D.Fragment,null,u,i):u))}return a},this.renderSelectContent=()=>{const{placeholder:r,filterTreeNode:i,multiple:s,searchPosition:o}=this.props,{checkedKeys:a}=this.state;if(!(!!i&&o===ir.SEARCH_POSITION_TRIGGER)){if(s)return a.size===0?D.createElement("span",{className:`${Ut}-selection-placeholder`},r):this.renderMultipleTags();{const h=this.renderDisplayText(),p=xe({[`${Ut}-selection-placeholder`]:!h});return D.createElement("span",{className:p},h||r)}}return s?this.renderTagInput():this.renderInput()},this.renderSuffix=()=>{const{suffix:r}=this.props,i=xe({[`${Ut}-suffix`]:!0,[`${Ut}-suffix-text`]:r&&fr(r),[`${Ut}-suffix-icon`]:Hs(r)});return D.createElement("div",{className:i,"x-semi-prop":"suffix"},r)},this.renderPrefix=()=>{const{prefix:r,insetLabel:i,insetLabelId:s}=this.props,o=r||i,a=xe({[`${Ut}-prefix`]:!0,[`${Ut}-inset-label`]:i,[`${Ut}-prefix-text`]:o&&fr(o),[`${Ut}-prefix-icon`]:Hs(o)});return D.createElement("div",{className:a,id:s,"x-semi-prop":"prefix,insetLabel"},o)},this.renderCustomTrigger=()=>{var r;const{disabled:i,triggerRender:s,multiple:o}=this.props,{selectedKeys:a,inputValue:l,inputPlaceHolder:u,resolvedCheckedKeys:h,checkedKeys:p,keyEntities:g}=this.state;let v;return o?this.mergeType===ir.NONE_MERGE_TYPE?(v=new Set,p.forEach(w=>{var S;v.add((S=g[w])===null||S===void 0?void 0:S.pos)})):(v=new Set,h.forEach(w=>{var S;v.add((S=g[w])===null||S===void 0?void 0:S.pos)})):v=(r=g[[...a][0]])===null||r===void 0?void 0:r.pos,D.createElement(FO,{value:v,inputValue:l,onChange:this.handleInputChange,onClear:this.handleClear,placeholder:u,disabled:i,triggerRender:s,componentName:"Cascader",componentProps:Object.assign({},this.props),onSearch:this.handleInputChange,onRemove:this.handleTagRemoveInTrigger})},this.handleMouseOver=()=>{this.foundation.toggleHoverState(!0)},this.handleMouseLeave=()=>{this.foundation.toggleHoverState(!1)},this.handleClear=r=>{r&&r.stopPropagation(),this.foundation.handleClear()},this.handleClearEnterPress=r=>{r&&r.stopPropagation(),this.foundation.handleClearEnterPress(r)},this.showClearBtn=()=>{const{showClear:r,disabled:i,multiple:s}=this.props,{selectedKeys:o,isOpen:a,isHovering:l,checkedKeys:u,inputValue:h}=this.state,p=o.size,g=s&&u.size;return r&&(h||p||g)&&!i&&(a||l)},this.renderClearBtn=()=>{const r=xe(`${Ut}-clearbtn`),{clearIcon:i}=this.props;return this.showClearBtn()?D.createElement("div",{className:r,onClick:this.handleClear,onKeyPress:this.handleClearEnterPress,role:"button",tabIndex:0},i||D.createElement(n_,null)):null},this.renderArrow=()=>{const{arrowIcon:r}=this.props;return this.showClearBtn()?null:r?D.createElement("div",{className:xe(`${Ut}-arrow`),"x-semi-prop":"arrowIcon"},r):null},this.renderSelection=()=>{const{disabled:r,multiple:i,filterTreeNode:s,style:o,size:a,className:l,validateStatus:u,prefix:h,suffix:p,insetLabel:g,triggerRender:v,showClear:w,id:S,borderless:E}=this.props,{isOpen:x,isFocus:I,isInput:P,checkedKeys:M}=this.state,k=!!s,A=typeof v=="function",j=A?xe(l):xe(Ut,l,{[`${Ut}-borderless`]:E,[`${Ut}-focus`]:I||x&&!P,[`${Ut}-disabled`]:r,[`${Ut}-single`]:!0,[`${Ut}-filterable`]:k,[`${Ut}-error`]:u==="error",[`${Ut}-warning`]:u==="warning",[`${Ut}-small`]:a==="small",[`${Ut}-large`]:a==="large",[`${Ut}-with-prefix`]:h||g,[`${Ut}-with-suffix`]:p}),V=w?{onMouseEnter:()=>this.handleMouseOver(),onMouseLeave:()=>this.handleMouseLeave()}:{},$=xe(`${Ut}-selection`,{[`${Ut}-selection-multiple`]:i&&!$n(M)}),W=A?this.renderCustomTrigger():[D.createElement(R.Fragment,{key:"prefix"},h||g?this.renderPrefix():null),D.createElement(R.Fragment,{key:"selection"},D.createElement("div",{className:$},this.renderSelectContent())),D.createElement(R.Fragment,{key:"suffix"},p?this.renderSuffix():null),D.createElement(R.Fragment,{key:"clearbtn"},this.renderClearBtn()),D.createElement(R.Fragment,{key:"arrow"},this.renderArrow())];return D.createElement("div",Object.assign({className:j,style:o,ref:this.triggerRef,onClick:B=>this.foundation.handleClick(B),onKeyPress:B=>this.foundation.handleSelectionEnterPress(B),"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"],id:S,onKeyDown:this.foundation.handleKeyDown},V,{role:"combobox",tabIndex:0},this.getDataAttr(this.props)),W)},this.state={emptyContentMinWidth:null,disabledKeys:new Set,isOpen:n.defaultOpen,rePosKey:Rhe,keyEntities:{},selectedKeys:new Set([]),activeKeys:new Set([]),filteredKeys:new Set([]),inputValue:"",isSearching:!1,inputPlaceHolder:n.searchPlaceholder||n.placeholder,prevProps:{},isHovering:!1,checkedKeys:new Set([]),halfCheckedKeys:new Set([]),resolvedCheckedKeys:new Set([]),loadedKeys:new Set,loadingKeys:new Set,loading:!1,showInput:!1},this.options={},this.isEmpty=!1,this.mergeType=KN(n.autoMergeValue,n.leafOnly),this.inputRef=D.createRef(),this.triggerRef=D.createRef(),this.optionsRef=D.createRef(),this.clickOutsideHandler=null,this.foundation=new gue(this.adapter),this.loadingKeysRef=D.createRef(),this.loadedKeysRef=D.createRef()}get adapter(){var n=this;const r={updateInputValue:s=>{this.setState({inputValue:s})},updateInputPlaceHolder:s=>{this.setState({inputPlaceHolder:s})},focusInput:()=>{const{preventScroll:s}=this.props;this.inputRef&&this.inputRef.current&&this.inputRef.current.focus({preventScroll:s})},blurInput:()=>{this.inputRef&&this.inputRef.current&&this.inputRef.current.blur()}},i={registerClickOutsideHandler:s=>{const o=a=>{const l=this.optionsRef&&this.optionsRef.current,u=this.triggerRef&&this.triggerRef.current,h=Ks.findDOMNode(l),p=a.target,g=a.composedPath&&a.composedPath()||[p];h&&(!h.contains(p)||!h.contains(p.parentNode))&&u&&!u.contains(p)&&!(g.includes(u)||g.includes(h))&&s(a)};this.clickOutsideHandler=o,document.addEventListener("mousedown",o,!1)},unregisterClickOutsideHandler:()=>{document.removeEventListener("mousedown",this.clickOutsideHandler,!1)},rePositionDropdown:()=>{let{rePosKey:s}=this.state;s=s+1,this.setState({rePosKey:s})}};return Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),r),i),{setEmptyContentMinWidth:s=>{this.setState({emptyContentMinWidth:s})},getTriggerWidth:()=>{const s=this.triggerRef.current;return s&&s.getBoundingClientRect().width},updateStates:s=>{this.setState(Object.assign({},s))},openMenu:()=>{this.setState({isOpen:!0})},closeMenu:s=>{this.setState({isOpen:!1},()=>{s&&s()})},updateSelection:s=>this.setState({selectedKeys:s}),notifyChange:s=>{this.props.onChange&&this.props.onChange(s)},notifySelect:s=>{this.props.onSelect&&this.props.onSelect(s)},notifyOnSearch:s=>{this.props.onSearch&&this.props.onSearch(s)},notifyFocus:function(){n.props.onFocus&&n.props.onFocus(...arguments)},notifyBlur:function(){n.props.onBlur&&n.props.onBlur(...arguments)},notifyDropdownVisibleChange:s=>{this.props.onDropdownVisibleChange(s)},toggleHovering:s=>{this.setState({isHovering:s})},notifyLoadData:(s,o)=>{const{loadData:a}=this.props;a&&new Promise(l=>{a(s).then(()=>{setTimeout(()=>{o(),this.setState({loading:!1}),l()})})})},notifyOnLoad:(s,o)=>{const{onLoad:a}=this.props;a&&a(s,o)},notifyListScroll:(s,o)=>{let{panelIndex:a,activeNode:l}=o;this.props.onListScroll(s,{panelIndex:a,activeNode:l})},notifyOnExceed:s=>this.props.onExceed(s),notifyClear:()=>this.props.onClear(),toggleInputShow:(s,o)=>{this.setState({showInput:s},()=>{o()})},updateFocusState:s=>{this.setState({isFocus:s})},updateLoadingKeyRefValue:s=>{this.loadingKeysRef.current=s},getLoadingKeyRefValue:()=>this.loadingKeysRef.current,updateLoadedKeyRefValue:s=>{this.loadedKeysRef.current=s},getLoadedKeyRefValue:()=>this.loadedKeysRef.current})}static getDerivedStateFromProps(n,r){const{multiple:i,value:s,defaultValue:o,onChangeWithObject:a,leafOnly:l,autoMergeValue:u,checkRelation:h,searchPlaceholder:p,placeholder:g}=n,{prevProps:v}=r;let w=r.keyEntities||{};const S={},E=p||g;E!==r.inputPlaceHolder&&(S.inputPlaceHolder=E);const x=M=>{const k=$n(v)&&M in n,A=v&&!Qs(v[M],n[M]);return k||A},I=()=>{const M=!v&&"treeData"in n,k=v&&v.treeData!==n.treeData;return M||k},P=(M,k)=>{let A=[];Array.isArray(M)?A=Array.isArray(M[0])?M:[M]:M!==void 0&&(A=[[M]]);const j=[];return A.forEach($=>{const W=a&&pj($[0])?$.map(B=>B==null?void 0:B.value):$;W.length>0&&j.push(W)}),j.reduce(($,W)=>{const B=dw(W);return k[B]&&$.push(B),$},[])};if(i){const M=x("treeData")||I(),k=x("value")||$n(v)&&o;if(M||k){M&&(S.treeData=n.treeData,w=mF(n.treeData),S.keyEntities=w);let A=r.checkedKeys;if(k){const j=x("value")?s:o;A=P(j,w)}else M&&"value"in n&&(A=P(s,w));if(xce(A)&&(A=[...A]),h===ir.RELATED){const j=c0(A,w),V=new Set(j.checkedKeys),$=new Set(j.halfCheckedKeys);n.disableStrictly&&(S.disabledKeys=pF(w));const W=KN(u,l)===ir.LEAF_ONLY_MERGE_TYPE;S.checkedKeys=V,S.halfCheckedKeys=$,S.resolvedCheckedKeys=new Set(ra(V,w,W))}else S.checkedKeys=new Set(A);S.prevProps=n}}return S}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(n){if(this.props.multiple)return;let r=!1;Qs(n.treeData,this.props.treeData)||(r=!0,this.foundation.collectOptions()),n.value!==this.props.value&&!r&&this.foundation.handleValueChange(this.props.value)}renderTagInput(){const{size:n,disabled:r,placeholder:i,maxTagCount:s,showRestTagsPopover:o,restTagsPopoverProps:a,checkRelation:l}=this.props,{inputValue:u,checkedKeys:h,keyEntities:p,resolvedCheckedKeys:g,inputPlaceHolder:v}=this.state,w=xe(`${Ut}-tagInput-wrapper`),S=this.mergeType===ir.NONE_MERGE_TYPE||l===ir.UN_RELATED?h:g;return D.createElement(w_,{className:w,ref:this.inputRef,disabled:r,size:n,value:[...S],showRestTagsPopover:o,restTagsPopoverProps:a,maxTagCount:s,renderTagItem:this.renderTagItem,inputValue:u,onInputChange:this.handleInputChange,onRemove:this.onRemoveInTagInput,placeholder:v,expandRestTagsOnClick:!1})}renderInput(){const{size:n,disabled:r}=this.props,i=xe(`${Ut}-input`),{inputValue:s,inputPlaceHolder:o,showInput:a}=this.state,l={disabled:r,value:s,className:i,onChange:this.handleInputChange},u=xe({[`${Ut}-search-wrapper`]:!0,[`${Ut}-search-wrapper-${n}`]:n!=="default"}),h=this.renderDisplayText(),p=xe({[`${Ut}-selection-placeholder`]:!h,[`${Ut}-selection-text-hide`]:a&&s,[`${Ut}-selection-text-inactive`]:a&&!s});return D.createElement("div",{className:u},D.createElement("span",{className:p},h||o),a&&D.createElement(vc,Object.assign({ref:this.inputRef,size:n},l)))}close(){this.foundation.close()}open(){this.foundation.open()}focus(){this.foundation.focus()}blur(){this.foundation.blur()}render(){const{zIndex:n,getPopupContainer:r,autoAdjustOverflow:i,stopPropagation:s,mouseLeaveDelay:o,mouseEnterDelay:a,position:l,motion:u,dropdownMargin:h}=this.props,{isOpen:p,rePosKey:g}=this.state,{direction:v}=this.context,w=this.renderContent(),S=this.renderSelection(),E=l??(v==="rtl"?"bottomRight":"bottomLeft");return D.createElement(Yi,{getPopupContainer:r,zIndex:n,motion:u,margin:h,ref:this.optionsRef,content:w,visible:p,trigger:"custom",rePosKey:g,position:E,autoAdjustOverflow:i,stopPropagation:s,mouseLeaveDelay:o,mouseEnterDelay:a,afterClose:()=>this.foundation.updateSearching(!1)},S)}}ug.__SemiComponentName__="Cascader";ug.contextType=Ao;ug.propTypes={"aria-labelledby":C.string,"aria-invalid":C.bool,"aria-errormessage":C.string,"aria-describedby":C.string,"aria-required":C.bool,"aria-label":C.string,arrowIcon:C.node,borderless:C.bool,clearIcon:C.node,changeOnSelect:C.bool,defaultValue:C.oneOfType([C.string,C.array]),disabled:C.bool,dropdownClassName:C.string,dropdownStyle:C.object,dropdownMargin:C.oneOfType([C.number,C.object]),emptyContent:C.node,motion:C.bool,filterTreeNode:C.oneOfType([C.func,C.bool]),filterLeafOnly:C.bool,placeholder:C.string,searchPlaceholder:C.string,size:C.oneOf(ir.SIZE_SET),style:C.object,className:C.string,treeData:C.arrayOf(C.shape({value:C.oneOfType([C.string,C.number]),label:C.any})),treeNodeFilterProp:C.string,suffix:C.node,prefix:C.node,insetLabel:C.node,insetLabelId:C.string,id:C.string,displayProp:C.string,displayRender:C.func,onChange:C.func,onSearch:C.func,onSelect:C.func,onBlur:C.func,onFocus:C.func,children:C.node,getPopupContainer:C.func,zIndex:C.number,value:C.oneOfType([C.string,C.number,C.array]),validateStatus:C.oneOf(ir.VALIDATE_STATUS),showNext:C.oneOf([ir.SHOW_NEXT_BY_CLICK,ir.SHOW_NEXT_BY_HOVER]),stopPropagation:C.oneOfType([C.bool,C.string]),showClear:C.bool,defaultOpen:C.bool,autoAdjustOverflow:C.bool,onDropdownVisibleChange:C.func,triggerRender:C.func,onListScroll:C.func,onChangeWithObject:C.bool,bottomSlot:C.node,topSlot:C.node,multiple:C.bool,autoMergeValue:C.bool,maxTagCount:C.number,showRestTagsPopover:C.bool,restTagsPopoverProps:C.object,max:C.number,separator:C.string,onExceed:C.func,onClear:C.func,loadData:C.func,onLoad:C.func,loadedKeys:C.array,disableStrictly:C.bool,leafOnly:C.bool,enableLeafClick:C.bool,preventScroll:C.bool,position:C.string,searchPosition:C.string};ug.defaultProps=Dc(ug.__SemiComponentName__,{borderless:!1,leafOnly:!1,arrowIcon:D.createElement(IO,null),stopPropagation:!0,motion:!0,defaultOpen:!1,zIndex:Yu.DEFAULT_Z_INDEX,showClear:!1,autoClearSearchValue:!0,changeOnSelect:!1,disableStrictly:!1,autoMergeValue:!0,multiple:!1,filterTreeNode:!1,filterLeafOnly:!0,showRestTagsPopover:!1,restTagsPopoverProps:{},separator:" / ",size:"default",treeNodeFilterProp:"label",displayProp:"label",treeData:[],showNext:ir.SHOW_NEXT_BY_CLICK,onExceed:rt,onClear:rt,onDropdownVisibleChange:rt,onListScroll:rt,enableLeafClick:!1,"aria-label":"Cascader",searchPosition:ir.SEARCH_POSITION_TRIGGER,checkRelation:ir.RELATED});class khe extends li{constructor(n){super(Object.assign({},n)),this.updateDOMInRenderTree=r=>{this._adapter.setDOMInRenderTree(r)},this.updateDOMHeight=r=>{this._adapter.setDOMHeight(r)},this.updateVisible=r=>{this._adapter.setVisible(r)},this.updateIsTransitioning=r=>{this._adapter.setIsTransitioning(r)}}}const Ak={PREFIX:`${Dn}-collapsible`};class Qu extends jr{constructor(n){super(n),this.domRef=D.createRef(),this.hasBeenRendered=!1,this.handleResize=r=>{const i=r[0];if(i){const s=Qu.getEntryInfo(i);this.foundation.updateDOMHeight(s.height),this.foundation.updateDOMInRenderTree(s.isShown)}},this.isChildrenInRenderTree=()=>this.domRef.current?this.domRef.current.offsetHeight>0:!1,this.state={domInRenderTree:!1,domHeight:0,visible:this.props.isOpen,isTransitioning:!1},this.foundation=new khe(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setDOMInRenderTree:n=>{this.state.domInRenderTree!==n&&this.setState({domInRenderTree:n})},setDOMHeight:n=>{this.state.domHeight!==n&&this.setState({domHeight:n})},setVisible:n=>{this.state.visible!==n&&this.setState({visible:n})},setIsTransitioning:n=>{this.state.isTransitioning!==n&&this.setState({isTransitioning:n})}})}componentDidMount(){super.componentDidMount(),this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.domRef.current);const n=this.isChildrenInRenderTree();this.foundation.updateDOMInRenderTree(n),n&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight)}componentDidUpdate(n,r,i){const s=Object.keys(cw(this.props,["reCalcKey","isOpen"])).filter(a=>!Qs(this.props[a],n[a])),o=Object.keys(cw(this.state,["domInRenderTree"])).filter(a=>!Qs(this.state[a],r[a]));s.includes("reCalcKey")&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),o.includes("domInRenderTree")&&this.state.domInRenderTree&&this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),s.includes("isOpen")&&(this.props.isOpen||!this.props.motion)&&this.foundation.updateVisible(this.props.isOpen),this.props.motion&&n.isOpen!==this.props.isOpen&&this.foundation.updateIsTransitioning(!0)}componentWillUnmount(){super.componentWillUnmount(),this.resizeObserver.disconnect()}render(){const n=Object.assign({overflow:"hidden",height:this.props.isOpen?this.state.domHeight:this.props.collapseHeight,opacity:this.props.isOpen||!this.props.fade||this.props.collapseHeight!==0?1:0,transitionDuration:`${this.props.motion&&this.state.isTransitioning?this.props.duration:0}ms`},this.props.style),r=xe(`${Ak.PREFIX}-wrapper`,{[`${Ak.PREFIX}-transition`]:this.props.motion&&this.state.isTransitioning},this.props.className),i=this.props.keepDOM&&(this.props.lazyRender?this.hasBeenRendered:!0)||this.props.collapseHeight!==0||this.state.visible||this.props.isOpen;return i&&!this.hasBeenRendered&&(this.hasBeenRendered=!0),D.createElement("div",Object.assign({className:r,style:n,onTransitionEnd:()=>{var s,o;this.props.isOpen||this.foundation.updateVisible(!1),this.foundation.updateIsTransitioning(!1),(o=(s=this.props).onMotionEnd)===null||o===void 0||o.call(s)}},this.getDataAttr(this.props)),D.createElement("div",{"x-semi-prop":"children",ref:this.domRef,style:{overflow:"hidden"},id:this.props.id},i&&this.props.children))}}Qu.__SemiComponentName__="Collapsible";Qu.defaultProps=Dc(Qu.__SemiComponentName__,{isOpen:!1,duration:250,motion:!0,keepDOM:!1,lazyRender:!1,collapseHeight:0,fade:!1});Qu.getEntryInfo=e=>{let n;e.borderBoxSize?n=!(e.borderBoxSize[0].blockSize===0&&e.borderBoxSize[0].inlineSize===0):n=!(e.contentRect.height===0&&e.contentRect.width===0);let r=0;return e.borderBoxSize?r=Math.ceil(e.borderBoxSize[0].blockSize):r=e.target.clientHeight,{isShown:n,height:r}};Qu.propTypes={motion:C.bool,children:C.node,isOpen:C.bool,duration:C.number,keepDOM:C.bool,collapseHeight:C.number,style:C.object,className:C.string,reCalcKey:C.oneOfType([C.string,C.number])};var Lhe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};Ao.Consumer;class eT extends D.Component{constructor(n){super(n)}renderChildren(){const{direction:n,children:r}=this.props;return n==="rtl"?D.createElement("div",{className:`${Dn}-rtl`},r):r}render(){const n=this.props,{children:r,direction:i}=n,s=Lhe(n,["children","direction"]);return D.createElement(Ao.Provider,{value:Object.assign({direction:i},s)},this.renderChildren())}}eT.propTypes={locale:C.object,timeZone:C.oneOfType([C.string,C.number]),getPopupContainer:C.func,direction:C.oneOf(["ltr","rtl"])};eT.defaultProps={locale:HN,direction:"ltr"};var jhe=vO();const Fhe=cn(jhe),$he={PREFIX:`${Dn}`};var zhe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const ah=$he.PREFIX,XN=e=>{const{layout:n="horizontal",dashed:r,align:i="center",className:s,margin:o,style:a,children:l}=e,u=zhe(e,["layout","dashed","align","className","margin","style","children"]),h=xe(`${ah}-divider`,s,{[`${ah}-divider-horizontal`]:n==="horizontal",[`${ah}-divider-vertical`]:n==="vertical",[`${ah}-divider-dashed`]:!!r,[`${ah}-divider-with-text`]:l&&n==="horizontal",[`${ah}-divider-with-text-${i}`]:l&&n==="horizontal"});let p={};return o!==void 0&&(n==="vertical"?p={marginLeft:o,marginRight:o}:n==="horizontal"&&(p={marginTop:o,marginBottom:o})),D.createElement("div",Object.assign({},u,{className:h,style:Object.assign(Object.assign({},p),a)}),l&&n==="horizontal"?typeof l=="string"?D.createElement("span",{className:`${ah}-divider_inner-text`,"x-semi-prop":"children"},l):l:null)},p0={PREFIX:`${Dn}-dropdown`},__={POSITION_SET:zp.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},Rk={SPACING:4,NESTED_SPACING:2};class Vhe extends li{handleVisibleChange(n){this._adapter.setPopVisible(n),this._adapter.notifyVisibleChange(n);const{trigger:r}=this.getProps();if(n&&r==="click"){const i=this._adapter.getPopupId();this.setFocusToFirstMenuItem(i)}}getMenuItemNodes(n){const r=document.getElementById(n);return r?Array.from(r.getElementsByTagName("li")).filter(i=>i.ariaDisabled==="false"):null}setFocusToFirstMenuItem(n){const r=this.getMenuItemNodes(n);r&&noe(r)}setFocusToLastMenuItem(n){const r=this.getMenuItemNodes(n);r&&roe(r)}handleKeyDown(n){var r,i;const s=(i=(r=n.target)===null||r===void 0?void 0:r.attributes["data-popupid"])===null||i===void 0?void 0:i.value,{visible:o}=this._adapter.getStates();switch(n.key){case" ":case"Enter":n.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(s),o&&qu(n);break;case"ArrowUp":this.setFocusToLastMenuItem(s),o&&qu(n);break}}}class Bhe extends li{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(n){this._adapter.getContext("trigger")==="custom"&&(n&&loe(document.querySelectorAll("[data-popupid]"),n.id)).focus()}setFocusByFirstCharacter(n,r){const i=ooe(this.menuItemNodes,n,this.firstChars,r);i>=0&&o0(this.menuItemNodes,this.menuItemNodes[i])}onMenuKeydown(n){const r=aoe(n.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...n.target.parentNode.getElementsByTagName("li")].filter(s=>s.ariaDisabled!=="true")),this.firstChars.length===0&&this.menuItemNodes.forEach(s=>{var o;this.firstChars.push((o=s.textContent.trim()[0])===null||o===void 0?void 0:o.toLowerCase())});const i=this.menuItemNodes.find(s=>s.tabIndex===0);switch(n.key){case" ":case"Enter":n.target.click();break;case"Escape":this.handleEscape(r);break;case"ArrowUp":ioe(this.menuItemNodes,i),qu(n);break;case"ArrowDown":soe(this.menuItemNodes,i),qu(n);break;default:toe(n.key)&&this.setFocusByFirstCharacter(i,n.key);break}}}const dg=D.createContext({level:0});var Hhe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Uhe=p0.PREFIX;class tT extends jr{constructor(n){super(n),this.foundation=new Bhe(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const n=this.props,{children:r,className:i,style:s}=n,o=Hhe(n,["children","className","style"]);return D.createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},o,{className:xe(`${Uhe}-menu`,i),style:s,onKeyDown:a=>this.foundation.onMenuKeydown(a)}),r)}}tT.propTypes={children:C.node,className:C.string,style:C.object};tT.contextType=dg;const lh=p0.PREFIX;class g0 extends jr{render(){const{children:n,disabled:r,className:i,forwardRef:s,style:o,type:a,active:l,icon:u,onKeyDown:h,showTick:p,hover:g}=this.props,{showTick:v}=this.context,w=v??p,S=xe(i,{[`${lh}-item`]:!0,[`${lh}-item-disabled`]:r,[`${lh}-item-hover`]:g,[`${lh}-item-withTick`]:w,[`${lh}-item-${a}`]:a,[`${lh}-item-active`]:l}),E={};r||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach(P=>{this.context.level!==1&&P==="onClick"?E.onMouseDown=k=>{var A,j;k.button===0&&((j=(A=this.props)[P])===null||j===void 0||j.call(A,k))}:E[P]=this.props[P]});let x=null;switch(!0){case(w&&l):x=D.createElement(ow,null);break;case(w&&!l):x=D.createElement(ow,{style:{color:"transparent"}});break;default:x=null;break}let I=null;return u&&(I=D.createElement("div",{className:`${lh}-item-icon`},u)),D.createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":r},E,{onKeyDown:h,ref:P=>s(P),className:S,style:o},this.getDataAttr(this.props)),x,I,n)}}g0.propTypes={children:C.oneOfType([C.string,C.node]),name:C.string,disabled:C.bool,selected:C.bool,onClick:C.func,onMouseEnter:C.func,onMouseLeave:C.func,onContextMenu:C.func,className:C.string,style:C.object,forwardRef:C.func,type:C.oneOf(__.ITEM_TYPE),active:C.bool,icon:C.node};g0.contextType=dg;g0.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:rt,onMouseLeave:rt,forwardRef:rt};g0.elementType="Dropdown.Item";const Khe=p0.PREFIX,JF=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{style:n,className:r}=e;return D.createElement("div",{className:xe(`${Khe}-divider`,r),style:n})};JF.propTypes={style:C.object,className:C.string};const kk=p0.PREFIX;class nT extends R.PureComponent{render(){const{className:n,style:r,children:i}=this.props,{showTick:s}=this.context,o=xe({[`${kk}-title`]:!0,[`${kk}-title-withTick`]:s},n);return D.createElement("div",{className:o,style:r},i)}}nT.propTypes={children:C.node,className:C.string,style:C.object};nT.contextType=dg;var KD=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Whe=__.POSITION_SET,qhe=__.TRIGGER_SET;class En extends jr{constructor(n){super(n),this.handleVisibleChange=r=>this.foundation.handleVisibleChange(r),this.state={popVisible:n.visible},this.foundation=new Vhe(this.adapter),this.tooltipRef=D.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:n=>this.setState({popVisible:n}),notifyVisibleChange:n=>{var r,i;return(i=(r=this.props).onVisibleChange)===null||i===void 0?void 0:i.call(r,n)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:n,menu:r,contentClassName:i,style:s,showTick:o,prefixCls:a,trigger:l}=this.props,u=xe(a,i),{level:h=0}=this.context,p={showTick:o,level:h+1,trigger:l};let g=null;return D.isValidElement(n)?g=n:Array.isArray(r)&&(g=this.renderMenu()),D.createElement(dg.Provider,{value:p},D.createElement("div",{className:u,style:s},D.createElement("div",{className:`${a}-content`,"x-semi-prop":"render"},g)))}renderMenu(){const{menu:n}=this.props,r=n.map((i,s)=>{switch(i.node){case"title":{const{name:o,node:a}=i,l=KD(i,["name","node"]);return D.createElement(En.Title,Object.assign({},l,{key:a+o+s}),o)}case"item":{const{node:o,name:a}=i,l=KD(i,["node","name"]);return D.createElement(En.Item,Object.assign({},l,{key:o+a+s}),a)}case"divider":return D.createElement(En.Divider,{key:i.node+s});default:return null}});return D.createElement(En.Menu,null,r)}renderPopCard(){const{render:n,contentClassName:r,style:i,showTick:s,prefixCls:o}=this.props,a=xe(o,r),{level:l=0}=this.context,u={showTick:s,level:l+1};return D.createElement(dg.Provider,{value:u},D.createElement("div",{className:a,style:i},D.createElement("div",{className:`${o}-content`},n)))}render(){const n=this.props,{children:r,position:i,trigger:s,onVisibleChange:o,zIndex:a,className:l,motion:u,margin:h,style:p,prefixCls:g}=n,v=KD(n,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:w}=this.props;const{level:S}=this.context,{popVisible:E}=this.state,x=this.renderContent();return S>0?w=typeof w=="number"?w:Rk.NESTED_SPACING:(w===null||typeof w>"u")&&(w=Rk.SPACING),D.createElement(Rn,Object.assign({zIndex:a,motion:u,margin:h,content:x,className:l,prefixCls:g,spacing:w,position:i,trigger:s,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},v),D.isValidElement(r)?D.cloneElement(r,{className:xe(ot(r,"props.className"),{[`${g}-showing`]:E}),"aria-haspopup":!0,"aria-expanded":E,onKeyDown:I=>{this.foundation.handleKeyDown(I);const P=ot(r,"props.onKeyDown");P&&P(I)}}):r)}}En.Menu=tT;En.Item=g0;En.Divider=JF;En.Title=nT;En.contextType=dg;En.propTypes={children:C.node,contentClassName:C.oneOfType([C.string,C.array]),className:C.string,getPopupContainer:C.func,margin:C.oneOfType([C.number,C.object]),mouseEnterDelay:C.number,mouseLeaveDelay:C.number,menu:C.array,motion:C.oneOfType([C.bool,C.func,C.object]),onVisibleChange:C.func,prefixCls:C.string,position:C.oneOf(Whe),rePosKey:C.oneOfType([C.string,C.number]),render:C.node,spacing:C.oneOfType([C.number,C.object]),showTick:C.bool,style:C.object,trigger:C.oneOf(qhe),visible:C.bool,zIndex:C.number};En.__SemiComponentName__="Dropdown";En.defaultProps=Dc(En.__SemiComponentName__,{onVisibleChange:rt,prefixCls:p0.PREFIX,zIndex:bu.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:__.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:rt});const xm=bF.PREFIX,e$=Tg.TAG_SIZE,Ghe=Tg.AVATAR_SHAPE;class rT extends R.PureComponent{renderNTag(n,r){const{size:i,showPopover:s,popoverProps:o,onPlusNMouseEnter:a}=this.props;let l=D.createElement(Gs,{closable:!1,size:i,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:a},"+",n);return s&&(l=D.createElement(Yi,Object.assign({showArrow:!0,content:r,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${xm}-rest-group-popover`},o,{key:"_+n_Popover"}),l)),l}renderMergeTags(n){const{maxTagCount:r,tagList:i,restCount:s}=this.props,o=s||i.length-r;let a=n;const l=n.slice(0,r),u=n.slice(r);let h=null;return o>0&&(h=this.renderNTag(o,u),l.push(h),a=l),a}renderAllTags(){const{tagList:n,size:r,mode:i,avatarShape:s,onTagClose:o}=this.props;return n.map(l=>{if(i==="custom")return l;const u=Object.assign({},l);return u.size||(u.size=r),u.avatarShape||(u.avatarShape=s),u.tagKey||(typeof u.children=="string"||typeof u.children=="number"?u.tagKey=u.children:u.tagKey=Math.random()),D.createElement(Gs,Object.assign({},u,{key:u.tagKey,onClose:(h,p,g)=>{u.onClose&&u.onClose(h,p,g),o&&o(h,p,g)}}))})}render(){const{style:n,className:r,maxTagCount:i,size:s}=this.props,o=xe({[`${xm}-group`]:!0,[`${xm}-group-max`]:i,[`${xm}-group-small`]:s==="small",[`${xm}-group-large`]:s==="large"},r),a=this.renderAllTags(),l=typeof i>"u"?a:this.renderMergeTags(a);return D.createElement("div",{style:n,className:o},l)}}rT.defaultProps={style:{},className:"",size:e$[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};rT.propTypes={children:C.node,style:C.object,className:C.string,maxTagCount:C.number,restCount:C.number,tagList:C.array,size:C.oneOf(e$),mode:C.string,onTagClose:C.func,showPopover:C.bool,popoverProps:C.object,avatarShape:C.oneOf(Ghe)};const Yhe=e=>{let{index:n,data:r,style:i}=e;const{visibleOptions:s,renderOption:o}=r,a=s[n];return o(a,n,i)},t$={PREFIX:`${Dn}-sidesheet`},ZN={PLACEMENT:["top","right","bottom","left"],SIZE:["small","medium","large"],HEIGHT:448};var Lk=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};let Xhe=0;const wo=t$.PREFIX;class iT extends D.PureComponent{constructor(){super(...arguments),this.onMaskClick=n=>{n.target===n.currentTarget&&this.close(n)},this.close=n=>{const{onClose:r}=this.props;r&&r(n)}}componentDidMount(){this.sideSheetId=`sidesheet-${Xhe++}`}componentWillUnmount(){clearTimeout(this.timeoutId)}getMaskElement(){var n;const{mask:r,maskStyle:i,maskClosable:s}=this.props;return r?D.createElement("div",Object.assign({"aria-hidden":!0,key:"mask",className:xe(`${wo}-mask`,(n=this.props.maskClassName)!==null&&n!==void 0?n:""),style:i,onClick:s?this.onMaskClick:null},this.props.maskExtraProps)):null}renderHeader(){const{title:n,closable:r,headerStyle:i,closeIcon:s}=this.props;let o,a;if(n&&(o=D.createElement("div",{className:`${wo}-title`,"x-semi-prop":"title"},this.props.title)),r){const l=s||D.createElement(OO,null);a=D.createElement(Lr,{className:`${wo}-close`,key:"close-btn",onClick:this.close,type:"tertiary",icon:l,theme:"borderless",size:"small"})}return D.createElement("div",{className:`${wo}-header`,role:"heading","aria-level":1,style:Object.assign({},i)},o,a)}getDialogElement(){var n;const r=Lk(this.props,[]),i={};r.width&&(i.width=r.width,r.mask||(i.width="100%")),r.height&&(i.height=r.height);const s=this.renderHeader();return D.createElement("div",Object.assign({key:"dialog-element",role:"dialog",tabIndex:-1,className:xe(`${wo}-inner`,`${wo}-inner-wrap`,(n=this.props.dialogClassName)!==null&&n!==void 0?n:"",`${wo}-size-${r.size}`),style:Object.assign(Object.assign({},r.style),i)},this.props.wrapperExtraProps),D.createElement("div",{className:`${wo}-content`},s,D.createElement("div",{className:`${wo}-body`,style:r.bodyStyle,"x-semi-prop":"children"},r.children),r.footer?D.createElement("div",{className:`${wo}-footer`,"x-semi-prop":"footer"},r.footer):null))}render(){const n=this.props,{mask:r,className:i,width:s,onClose:o,maskStyle:a,maskClosable:l,maskClassName:u,title:h,closable:p,headerStyle:g,height:v,style:w,size:S,bodyStyle:E,dialogClassName:x,children:I,footer:P,maskExtraProps:M,wrapperExtraProps:k}=n,A=Lk(n,["mask","className","width","onClose","maskStyle","maskClosable","maskClassName","title","closable","headerStyle","height","style","size","bodyStyle","dialogClassName","children","footer","maskExtraProps","wrapperExtraProps"]),j=xe(i,{[`${wo}-fixed`]:!r,[`${wo}-size-${this.props.size}`]:!r}),V={};!r&&s&&(V.width=s);const $=uj(A);return D.createElement("div",Object.assign({className:j,style:V},$),this.getMaskElement(),this.getDialogElement())}}iT.propTypes={onClose:C.func,closeIcon:C.node};iT.defaultProps={onClose:rt};class sT extends li{constructor(n){super(Object.assign(Object.assign({},sT.defaultAdapter),n)),this.toggleDisplayNone=r=>{this._adapter.toggleDisplayNone(r)}}get defaultAdapter(){return{handleCancel:rt,beforeShow:rt,afterHide:rt}}destroy(){this.afterHide()}handleCancel(n){this._adapter.notifyCancel(n)}beforeShow(){this.getProp("disableScroll")&&this._adapter.disabledBodyScroll(),this._adapter.setOnKeyDownListener()}afterHide(){this.getProp("disableScroll")&&this._adapter.enabledBodyScroll(),this._adapter.removeKeyDownListener()}handleKeyDown(n){const{closeOnEsc:r}=this.getProps();if(r&&n.keyCode===UN.ESC){n.stopPropagation(),this.handleCancel(n);return}}onVisibleChange(n){this._adapter.notifyVisibleChange(n)}}var Zhe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Ua=t$.PREFIX,Qhe=ZN.HEIGHT;class hg extends jr{constructor(n){super(n),this.handleCancel=r=>{this.foundation.handleCancel(r)},this.handleKeyDown=r=>{this.foundation.handleKeyDown(r)},this.updateState=()=>{this.foundation.toggleDisplayNone(!this.props.visible)},this.state={displayNone:!this.props.visible},this.foundation=new sT(this.adapter),this.bodyOverflow="",this.scrollBarWidth=0,this.originBodyWidth="100%"}get adapter(){return Object.assign(Object.assign({},super.adapter),{disabledBodyScroll:()=>{const{getPopupContainer:n}=this.props;this.bodyOverflow=document.body.style.overflow||"",!n&&this.bodyOverflow!=="hidden"&&(document.body.style.overflow="hidden",document.body.style.width=`calc(${this.originBodyWidth||"100%"} - ${this.scrollBarWidth}px)`)},enabledBodyScroll:()=>{const{getPopupContainer:n}=this.props;!n&&this.bodyOverflow!=="hidden"&&(document.body.style.overflow=this.bodyOverflow,document.body.style.width=this.originBodyWidth)},notifyCancel:n=>{this.props.onCancel&&this.props.onCancel(n)},notifyVisibleChange:n=>{this.props.afterVisibleChange(n)},setOnKeyDownListener:()=>{window&&window.addEventListener("keydown",this.handleKeyDown)},removeKeyDownListener:()=>{window&&window.removeEventListener("keydown",this.handleKeyDown)},toggleDisplayNone:n=>{n!==this.state.displayNone&&this.setState({displayNone:n})}})}static getDerivedStateFromProps(n,r){const i={};return n.visible&&r.displayNone&&(i.displayNone=!1),!n.visible&&!n.motion&&!r.displayNone&&(i.displayNone=!0),i}componentDidMount(){this.scrollBarWidth=woe(),this.originBodyWidth=document.body.style.width,this.props.visible&&this.foundation.beforeShow()}componentDidUpdate(n,r,i){!n.visible&&this.props.visible&&this.foundation.beforeShow(),n.visible&&!this.props.visible&&this.foundation.afterHide(),r.displayNone!==this.state.displayNone&&this.foundation.onVisibleChange(!this.state.displayNone)}componentWillUnmount(){this.props.visible&&this.foundation.destroy()}renderContent(){const n=this.props,{placement:r,className:i,children:s,width:o,height:a,motion:l,visible:u,style:h,maskStyle:p,size:g,zIndex:v,getPopupContainer:w,keepDOM:S}=n,E=Zhe(n,["placement","className","children","width","height","motion","visible","style","maskStyle","size","zIndex","getPopupContainer","keepDOM"]);let x={zIndex:v};w&&(x={zIndex:v,position:"static"});const{direction:I}=this.context,P=r==="left"||r==="right",M=r==="top"||r==="bottom",k=M?a||Qhe:"100%",A=xe(Ua,i,{[`${Ua}-${r}`]:r,[`${Ua}-popup`]:w,[`${Ua}-horizontal`]:M,[`${Ua}-rtl`]:I==="rtl",[`${Ua}-hidden`]:S&&this.state.displayNone}),j=Object.assign(Object.assign(Object.assign({},P?o?{width:o}:{}:{width:"100%"}),E),{visible:u,motion:!1,size:g,className:A,height:k,onClose:this.handleCancel}),V=this.props.visible||this.props.keepDOM||this.props.motion&&!this.state.displayNone;return D.createElement(Ev,{motion:this.props.motion,animationState:u?"enter":"leave",startClassName:u?`${Ua}-animation-mask_show`:`${Ua}-animation-mask_hide`,onAnimationEnd:this.updateState},$=>{let{animationClassName:W,animationEventsNeedBind:B}=$;return D.createElement(Ev,{motion:this.props.motion,animationState:u?"enter":"leave",startClassName:u?`${Ua}-animation-content_show_${this.props.placement}`:`${Ua}-animation-content_hide_${this.props.placement}`,onAnimationEnd:this.updateState},H=>{let{animationClassName:Y,animationStyle:te,animationEventsNeedBind:ue}=H;return V?D.createElement(a0,{getPopupContainer:w,style:x},D.createElement(iT,Object.assign({},j,{maskExtraProps:B,wrapperExtraProps:ue,dialogClassName:Y,maskClassName:W,maskStyle:Object.assign({},p),style:Object.assign(Object.assign({},te),h)}),s)):D.createElement(D.Fragment,null)})})}render(){const{zIndex:n,getPopupContainer:r,visible:i}=this.props;return this.renderContent()}}hg.contextType=Ao;hg.propTypes={bodyStyle:C.object,headerStyle:C.object,children:C.node,className:C.string,closable:C.bool,disableScroll:C.bool,getPopupContainer:C.func,height:C.oneOfType([C.number,C.string]),mask:C.bool,maskClosable:C.bool,maskStyle:C.object,motion:C.oneOfType([C.bool,C.object,C.func]),onCancel:C.func,placement:C.oneOf(ZN.PLACEMENT),size:C.oneOf(ZN.SIZE),style:C.object,title:C.node,visible:C.bool,width:C.oneOfType([C.number,C.string]),zIndex:C.number,afterVisibleChange:C.func,closeOnEsc:C.bool,footer:C.node,keepDOM:C.bool,"aria-label":C.string};hg.__SemiComponentName__="SideSheet";hg.defaultProps=Dc(hg.__SemiComponentName__,{visible:!1,motion:!0,mask:!0,placement:"right",closable:!0,footer:null,zIndex:1e3,maskClosable:!0,size:"small",disableScroll:!0,closeOnEsc:!1,afterVisibleChange:rt,keepDOM:!1});class oT extends li{constructor(n){super(Object.assign(Object.assign({},oT.defaultAdapter),n)),this.handleMouseInSideChange=r=>{this._adapter.handleMouseInSideChange(r)},this.getInputWrapperRect=()=>this._adapter.getInputWrapperRect()}hasToast(n){return this._adapter.getState("list").map(i=>{let{id:s}=i;return s}).includes(n)}addToast(n){const r=this._adapter.getState("list");r.push(n),this._adapter.updateToast(r,[],[])}updateToast(n,r){let i=this._adapter.getState("list");i=i.map(o=>o.id===n?Object.assign(Object.assign({},o),r):o);const s=i.filter(o=>o.id===n);this._adapter.updateToast(i,[],s)}removeToast(n){let r=this._adapter.getState("list");const i=[];r=r.filter(s=>s.id===n?(i.push(s),!1):!0),this._adapter.updateToast(r,i,[])}destroyAll(){const n=this._adapter.getState("list");n.length>0&&this._adapter.updateToast([],n,[])}}const jk=`${Dn}-toast`,Tp={PREFIX:jk,WRAPPER:`${jk}-wrapper`},ev={types:["warning","success","info","error","default"],themes:["normal","light"],directions:["ltr","rtl"]},Jhe={duration:3};class aT extends li{constructor(n){super(Object.assign(Object.assign({},aT.defaultAdapter),n)),this._timer=null,this._id=null}init(){this.startCloseTimer_(),this._id=this._adapter.getProp("id")}destroy(){this.clearCloseTimer_()}startCloseTimer_(){const n=this._adapter.getProp("duration");n&&Ki(n)&&(this._timer=setTimeout(()=>{this.close()},n*1e3))}close(n){n&&n.stopPropagation(),this._adapter.notifyWrapperToRemove(this._id),this._adapter.notifyClose()}clearCloseTimer_(){this._timer&&(clearTimeout(this._timer),this._timer=null)}restartCloseTimer(){this.clearCloseTimer_(),this.startCloseTimer_()}}const Qo=Tp.PREFIX;let Lh=class extends jr{constructor(n){super(n),this.toastEle=D.createRef(),this.clearCloseTimer=()=>{this.foundation.clearCloseTimer_()},this.startCloseTimer=()=>{this.foundation.startCloseTimer_()},this.restartCloseTimer=()=>{this.foundation.restartCloseTimer()},this.state={},this.foundation=new aT(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{notifyWrapperToRemove:n=>{this.props.close(n)},notifyClose:()=>{this.props.onClose()}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}close(n){this.foundation.close(n)}renderIcon(){const{type:n,icon:r}=this.props,s={warning:D.createElement(xae,null),success:D.createElement(ple,null),info:D.createElement(Xj,null),error:D.createElement(Cae,null)}[n],o="large",a=xe(`${Qo}-icon`,`${Qo}-icon-${n}`);return r?Hs(r)?D.cloneElement(r,{size:o,className:`${Qo}-icon`}):r:n&&s?D.cloneElement(s,{size:o,className:a}):null}render(){const{content:n,type:r,theme:i,showClose:s,textMaxWidth:o,className:a,style:l}=this.props,u=this.props.direction||this.context.direction,h=xe(Qo,a,{[`${Qo}-${r}`]:!0,[`${Qo}-${i}`]:i==="light",[`${Qo}-rtl`]:u==="rtl"}),p={};p.maxWidth=o;const g="borderless",v="small",w=this.props.positionInList?this.props.positionInList.length-this.props.positionInList.index-1:0,S=D.createElement("div",{ref:this.toastEle,role:"alert","aria-label":`${r||"default"} type`,className:h,style:Object.assign(Object.assign({},l),{transform:`translate3d(0,0,${w*-10}px)`}),onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onAnimationStart:this.props.onAnimationStart,onAnimationEnd:this.props.onAnimationEnd},D.createElement("div",{className:`${Qo}-content`},this.renderIcon(),D.createElement("span",{className:`${Qo}-content-text`,style:p,"x-semi-prop":"content"},n),s&&D.createElement("div",{className:`${Qo}-close-button`},D.createElement(Lr,{onClick:E=>this.close(E),type:"tertiary",icon:D.createElement(OO,{"x-semi-prop":"icon"}),theme:g,size:v}))));if(this.props.stack){const E=this.props.stackExpanded&&this.toastEle.current&&getComputedStyle(this.toastEle.current).height||0;return D.createElement("div",{className:`${Qo}-zero-height-wrapper`,style:{height:E}},S)}else return S}};Lh.contextType=Ao;Lh.propTypes={onClose:C.func,content:C.node,close:C.func,duration:C.number,theme:C.oneOf(ev.themes),type:C.oneOf(ev.types),textMaxWidth:C.oneOfType([C.string,C.number]),style:C.object,className:C.string,showClose:C.bool,stack:C.bool,stackExpanded:C.bool,icon:C.node,direction:C.oneOf(ev.directions)};Lh.__SemiComponentName__="Toast";Lh.defaultProps=Dc(Lh.__SemiComponentName__,{onClose:rt,content:"",close:rt,duration:Jhe.duration,textMaxWidth:450,showClose:!0,stack:!1,stackExpanded:!1,theme:"normal"});var efe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const tfe=(e,n)=>{var{afterClose:r}=e,i=efe(e,["afterClose"]);const[s,o]=R.useState(!0),a=()=>{o(!1)};return D.useImperativeHandle(n,()=>({close:()=>{o(!1)}})),R.useEffect(()=>{s||r(i.id)},[s]),s?D.createElement(Lh,Object.assign({},i,{close:a})):null},nfe=D.forwardRef(tfe),Sm={motion:!0,zIndex:1010,duration:3};function rfe(){const[e,n]=D.useState([]);function r(i,s){return n(o=>[{element:i,config:s},...o]),o=>{n(a=>a.filter(l=>{let{config:u}=l;return u.id!==o}))}}return[e,r]}function ife(){const[e,n]=rfe(),r=R.useRef(new Map),i=o=>{const a=zN("semi_toast_"),l=Object.assign(Object.assign({},o),{id:a});let u;const h=D.createElement(nfe,Object.assign({},l,{key:a,afterClose:p=>u(p),ref:p=>{var g;r.current.set(a,{close:(g=p==null?void 0:p.close)!==null&&g!==void 0?g:rt})}}));return u=n(h,Object.assign({},l)),a},s=o=>{var a;const{close:l}=(a=r.current.get(o))!==null&&a!==void 0?a:{};l==null||l()};return[{success:o=>i(Object.assign(Object.assign(Object.assign({},Sm),o),{type:"success"})),info:o=>i(Object.assign(Object.assign(Object.assign({},Sm),o),{type:"info"})),error:o=>i(Object.assign(Object.assign(Object.assign({},Sm),o),{type:"error"})),warning:o=>i(Object.assign(Object.assign(Object.assign({},Sm),o),{type:"warning"})),open:o=>i(Object.assign(Object.assign(Object.assign({},Sm),o),{type:"default"})),close:o=>s(o)},D.createElement(D.Fragment,null,Array.isArray(e)&&e.length?D.createElement(D.Fragment,null,e.map(o=>o.element)):null)]}const sfe=()=>{var e;return e=class Cn extends jr{constructor(r){super(r),this.stack=!1,this.innerWrapperRef=D.createRef(),this.handleMouseEnter=i=>{this.stack&&this.foundation.handleMouseInSideChange(!0)},this.handleMouseLeave=i=>{var s;this.stack&&(!((s=this.foundation.getInputWrapperRect())===null||s===void 0)&&s.height)&&this.foundation.handleMouseInSideChange(!1)},this.state={list:[],removedItems:[],updatedItems:[],mouseInSide:!1},this.foundation=new oT(this.adapter)}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateToast:(r,i,s)=>{this.setState({list:r,removedItems:i,updatedItems:s})},handleMouseInSideChange:r=>{this.setState({mouseInSide:r})},getInputWrapperRect:()=>{var r;return(r=this.innerWrapperRef.current)===null||r===void 0?void 0:r.getBoundingClientRect()}})}static create(r){var i;const s=(i=r.id)!==null&&i!==void 0?i:zN("toast");if(Cn.ref){const o=document.querySelector(`#${this.wrapperId}`);["top","left","bottom","right"].map(a=>{a in r&&(o.style[a]=typeof r[a]=="number"?`${r[a]}px`:r[a])}),!!r.stack!==Cn.ref.stack&&(Cn.ref.stack=!!r.stack),Cn.ref.has(s)?Cn.ref.update(s,Object.assign(Object.assign({},r),{id:s})):Cn.ref.add(Object.assign(Object.assign({},r),{id:s}))}else{const o=document.createElement("div");this.wrapperId||(this.wrapperId=zN("toast-wrapper").slice(0,26)),o.className=Tp.WRAPPER,o.id=this.wrapperId,o.style.zIndex=String(typeof r.zIndex=="number"?r.zIndex:Cn.defaultOpts.zIndex),["top","left","bottom","right"].map(a=>{if(a in Cn.defaultOpts||a in r){const l=r[a]?r[a]:Cn.defaultOpts[a];o.style[a]=typeof l=="number"?`${l}px`:l}}),Cn.defaultOpts.getPopupContainer?Cn.defaultOpts.getPopupContainer().appendChild(o):document.body.appendChild(o),Ks.render(D.createElement(Cn,{ref:a=>Cn.ref=a}),o,()=>{Cn.ref.add(Object.assign(Object.assign({},r),{id:s})),Cn.ref.stack=!!r.stack})}return s}static close(r){Cn.ref&&Cn.ref.remove(r)}static destroyAll(){if(Cn.ref){Cn.ref.destroyAll();const r=document.querySelector(`#${this.wrapperId}`);Ks.unmountComponentAtNode(r),r&&r.parentNode.removeChild(r),Cn.ref=null,this.wrapperId=null}}static getWrapperId(){return this.wrapperId}static info(r){return typeof r=="string"&&(r={content:r}),this.create(Object.assign(Object.assign(Object.assign({},Cn.defaultOpts),r),{type:"info"}))}static warning(r){return typeof r=="string"&&(r={content:r}),this.create(Object.assign(Object.assign(Object.assign({},Cn.defaultOpts),r),{type:"warning"}))}static error(r){return typeof r=="string"&&(r={content:r}),this.create(Object.assign(Object.assign(Object.assign({},Cn.defaultOpts),r),{type:"error"}))}static success(r){return typeof r=="string"&&(r={content:r}),this.create(Object.assign(Object.assign(Object.assign({},Cn.defaultOpts),r),{type:"success"}))}static config(r){["top","left","bottom","right"].forEach(i=>{i in r&&(Cn.defaultOpts[i]=r[i])}),typeof r.theme=="string"&&ev.themes.includes(r.theme)&&(Cn.defaultOpts.theme=r.theme),typeof r.zIndex=="number"&&(Cn.defaultOpts.zIndex=r.zIndex),typeof r.duration=="number"&&(Cn.defaultOpts.duration=r.duration),typeof r.getPopupContainer=="function"&&(Cn.defaultOpts.getPopupContainer=r.getPopupContainer)}has(r){return this.foundation.hasToast(r)}add(r){return this.foundation.addToast(r)}update(r,i){return this.foundation.updateToast(r,i)}remove(r){return this.foundation.removeToast(r)}destroyAll(){return this.foundation.destroyAll()}render(){let{list:r}=this.state;const{removedItems:i,updatedItems:s}=this.state;r=Array.from(new Set([...r,...i]));const o=s.map(l=>{let{id:u}=l;return u}),a=l=>{var u;!((u=l==null?void 0:l.foundation)===null||u===void 0)&&u._id&&o.includes(l.foundation._id)&&l.foundation.restartCloseTimer()};return D.createElement(D.Fragment,null,D.createElement("div",{className:xe({[`${Tp.PREFIX}-innerWrapper`]:!0,[`${Tp.PREFIX}-innerWrapper-hover`]:this.state.mouseInSide}),ref:this.innerWrapperRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},r.map((l,u)=>{const h=i.find(p=>p.id===l.id)!==void 0;return D.createElement(Ev,{key:l.id,motion:l.motion,animationState:h?"leave":"enter",startClassName:h?`${Tp.PREFIX}-animation-hide`:`${Tp.PREFIX}-animation-show`},p=>{let{animationClassName:g,animationEventsNeedBind:v,isAnimating:w}=p;return h&&!w?null:D.createElement(Lh,Object.assign({},l,{stack:this.stack,stackExpanded:this.state.mouseInSide,positionInList:{length:r.length,index:u},className:xe({[l.className]:!!l.className,[g]:!0})},v,{style:Object.assign({},l.style),close:S=>this.remove(S),ref:a}))})})))}},e.defaultOpts={motion:!0,zIndex:1010,content:""},e.propTypes={content:C.node,duration:C.number,onClose:C.func,icon:C.node,direction:C.oneOf(ev.directions),stack:C.bool},e.defaultProps={},e};class ofe{static create(n){const r=sfe();return r.useToast=ife,n&&r.config(n),r}}const Iu=ofe.create();function WD(e){return yoe(e,n=>{if(Fhe(n)&&!n._innerDataTag||D.isValidElement(n))return n})}const afe=cF.PREFIX;class lT extends R.PureComponent{constructor(n){super(n),this._onResize=r=>{const i=r&&r[1]&&r[1].target;if(i){const s=ot(i,"offsetHeight")||0,o=window.getComputedStyle(i)||{},a=parseInt(ot(o,"paddingTop"),10)||0,l=parseInt(ot(o,"paddingBottom"),10)||0,u=s-a-l;this.state.height!==u&&this.setState({height:s-a-l})}},this.state={height:this.props.defaultHeight||0}}componentDidMount(){const{height:n}=this.state}render(){const{children:n,defaultWidth:r,defaultHeight:i}=this.props,{height:s}=this.state;let o=!1;return(s===0||typeof s!="number")&&(o=!0),D.createElement(i_,{observeParent:!0,onResize:this._onResize},D.createElement("div",{style:{height:i,overflow:"visible"},className:`${afe}-auto-wrapper`},!o&&n({height:s,width:r})))}}lT.propTypes={defaultHeight:C.oneOfType([C.number,C.string]),defaultWidth:C.oneOfType([C.number,C.string])};lT.defaultProps={defaultHeight:"100%",defaultWidth:"100%"};const cT=D.createContext(null),lfe=e=>{let{prefixcls:n,level:r,isEnd:i,showLine:s}=e;const o=`${n}-indent-unit`,a=[];for(let l=0;l<r;l+=1)a.push(R.createElement("span",{key:l,className:xe(o,{[`${o}-end`]:i[l]})}));return R.createElement("span",{"aria-hidden":"true",className:xe(`${n}-indent`,{[`${n}-indent-show-line`]:s})},a)},cfe=R.memo(lfe);var ufe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const rn=cF.PREFIX_OPTION;class Bp extends R.PureComponent{constructor(n){super(n),this.onSelect=r=>{const{onNodeSelect:i}=this.context;i(r,this.props)},this.onExpand=r=>{const{onNodeExpand:i}=this.context;r&&r.stopPropagation(),r.nativeEvent.stopImmediatePropagation(),i(r,this.props)},this.onCheck=r=>{var i,s;if(this.isDisabled())return;const{onNodeCheck:o}=this.context;r.stopPropagation(),(s=(i=r.nativeEvent)===null||i===void 0?void 0:i.stopImmediatePropagation)===null||s===void 0||s.call(i),o(r,this.props)},this.handleCheckEnterPress=r=>{ua(r)&&this.onCheck(r)},this.onContextMenu=r=>{const{onNodeRightClick:i}=this.context;i(r,this.props)},this.onClick=r=>{const{expandAction:i}=this.context;if(i==="doubleClick"){this.debounceSelect(r);return}this.onSelect(r),i==="click"&&this.onExpand(r)},this.handleliEnterPress=r=>{ua(r)&&this.onClick(r)},this.onDoubleClick=r=>{const{expandAction:i,onNodeDoubleClick:s}=this.context;r.stopPropagation(),r.nativeEvent.stopImmediatePropagation(),sr(s)&&s(r,this.props),i==="doubleClick"&&this.onExpand(r)},this.onDragStart=r=>{const{onNodeDragStart:i}=this.context;r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}));try{r.dataTransfer.setData("text/plain","")}catch{}},this.onDragEnter=r=>{const{onNodeDragEnter:i}=this.context;r.preventDefault(),r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragOver=r=>{const{onNodeDragOver:i}=this.context;r.preventDefault(),r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragLeave=r=>{const{onNodeDragLeave:i}=this.context;r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDragEnd=r=>{const{onNodeDragEnd:i}=this.context;r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.onDrop=r=>{const{onNodeDrop:i}=this.context;r.preventDefault(),r.stopPropagation(),i(r,Object.assign(Object.assign({},this.props),{nodeInstance:this.refNode}))},this.getNodeChildren=()=>{const{children:r}=this.props;return r||[]},this.isLeaf=()=>{const{isLeaf:r,loaded:i}=this.props,{loadData:s}=this.context,o=this.getNodeChildren().length!==0;return r===!1?!1:r||!s&&!o||s&&i&&!o},this.isDisabled=()=>{const{disabled:r}=this.props,{treeDisabled:i}=this.context;return r===!1?!1:!!(i||r)},this.renderSwitcher=()=>this.isLeaf()?D.createElement("span",{className:xe(`${rn}-switcher`)},D.createElement("span",{className:`${rn}-switcher-leaf-line`})):null,this.renderRealLabel=()=>{const{renderLabel:r}=this.context,{label:i,keyword:s,data:o,filtered:a,treeNodeFilterProp:l}=this.props;return sr(r)?r(i,o,s):fr(i)&&a&&s?D.createElement($O,{highlightClassName:`${rn}-highlight`,component:"span",sourceString:i,searchWords:[s]}):i},this.setRef=r=>{this.refNode=r},this.state={},this.debounceSelect=bie(this.onSelect,500,{leading:!0,trailing:!1})}renderArrow(){var n,r;const i=!this.isLeaf(),{loading:s,expanded:o,showLine:a,expandIcon:l}=this.props;if(s)return D.createElement(o_,{wrapperClassName:`${rn}-spin-icon`});if(i){if(l){if(typeof l=="function")return l({onClick:this.onExpand,className:`${rn}-expand-icon`,expanded:o});if(D.isValidElement(l)){const u=xe(`${rn}-expand-icon`,{[(n=l==null?void 0:l.props)===null||n===void 0?void 0:n.className]:(r=l==null?void 0:l.props)===null||r===void 0?void 0:r.className});return D.cloneElement(l,{onClick:this.onExpand,className:u})}else return l}return D.createElement(yle,{role:"button","aria-label":`${o?"Expand":"Collapse"} the tree item`,className:`${rn}-expand-icon`,size:"small",onClick:this.onExpand})}return a?this.renderSwitcher():D.createElement("span",{className:`${rn}-empty-icon`})}renderCheckbox(){const{checked:n,halfChecked:r,eventKey:i}=this.props,s=this.isDisabled();return D.createElement("div",{role:"none",onClick:this.onCheck,onKeyPress:this.handleCheckEnterPress},D.createElement(Xu,{"aria-label":"Toggle the checked state of checkbox",value:i,indeterminate:r,checked:n,disabled:!!s}))}renderIcon(){const{directory:n,treeIcon:r}=this.context,{expanded:i,icon:s,data:o}=this.props;return s||(r?typeof r=="function"?r(this.props):r:n?this.isLeaf()?D.createElement(Hae,{className:`${rn}-item-icon`}):i?D.createElement(qae,{className:`${rn}-item-icon`}):D.createElement(Kae,{className:`${rn}-item-icon`}):null)}renderEmptyNode(){const{emptyContent:n}=this.props,r=xe(rn,{[`${rn}-empty`]:!0});return D.createElement("ul",{className:r},D.createElement("li",{className:`${rn}-label ${rn}-label-empty`,"x-semi-prop":"emptyContent"},n))}render(){const n=this.props,{eventKey:r,expanded:i,selected:s,checked:o,halfChecked:a,loading:l,active:u,level:h,empty:p,filtered:g,treeNodeFilterProp:v,display:w,style:S,isEnd:E,showLine:x}=n,I=ufe(n,["eventKey","expanded","selected","checked","halfChecked","loading","active","level","empty","filtered","treeNodeFilterProp","display","style","isEnd","showLine"]);if(p)return this.renderEmptyNode();const{multiple:P,draggable:M,renderFullLabel:k,dragOverNodeKey:A,dropPosition:j,labelEllipsis:V}=this.context,$=E[E.length-1],W=this.isDisabled(),B=A===r&&j===0,H=A===r&&j===-1,Y=A===r&&j===1,te=xe(rn,{[`${rn}-level-${h+1}`]:!0,[`${rn}-fullLabel-level-${h+1}`]:k,[`${rn}-collapsed`]:!i,[`${rn}-disabled`]:!!W,[`${rn}-selected`]:s,[`${rn}-active`]:!P&&u,[`${rn}-ellipsis`]:V,[`${rn}-drag-over`]:!W&&B,[`${rn}-draggable`]:!W&&M&&!k,[`${rn}-fullLabel-draggable`]:!W&&M&&k,[`${rn}-fullLabel-drag-over-gap-top`]:!W&&H&&k,[`${rn}-fullLabel-drag-over-gap-bottom`]:!W&&Y&&k,[`${rn}-tree-node-last-leaf`]:$}),ue={onClick:this.onClick,onContextMenu:this.onContextMenu,onDoubleClick:this.onDoubleClick,className:te,onExpand:this.onExpand,data:I.data,level:h,onCheck:this.onCheck,style:S,expandIcon:this.renderArrow(),checkStatus:{checked:o,halfChecked:a},expandStatus:{expanded:i,loading:l},filtered:g,searchWord:I.keyword},ye={onDoubleClick:this.onDoubleClick,onDragStart:M?this.onDragStart:void 0,onDragEnter:M?this.onDragEnter:void 0,onDragOver:M?this.onDragOver:void 0,onDragLeave:M?this.onDragLeave:void 0,onDrop:M?this.onDrop:void 0,onDragEnd:M?this.onDragEnd:void 0,draggable:!W&&M||void 0};if(k){const ae=k(Object.assign({},ue));return M?D.cloneElement(ae,Object.assign({ref:this.setRef},ye)):$n(S)?ae:D.cloneElement(ae,{style:Object.assign(Object.assign({},ot(ae,["props","style"])),S)})}const Ne=xe(`${rn}-label`,{[`${rn}-drag-over-gap-top`]:!W&&H,[`${rn}-drag-over-gap-bottom`]:!W&&Y}),q=ot(I,["data","children","length"]),G=fr(I.pos)?Number(I.pos.split("-")[h+1])+1:1;return D.createElement("li",Object.assign({className:te,role:"treeitem","aria-disabled":W,"aria-checked":o,"aria-selected":s,"aria-setsize":q,"aria-posinset":G,"aria-expanded":i,"aria-level":h+1,"data-key":r,onClick:this.onClick,onKeyPress:this.handleliEnterPress,onContextMenu:this.onContextMenu,onDoubleClick:this.onDoubleClick,ref:this.setRef,style:S},ye),D.createElement(cfe,{showLine:x,prefixcls:rn,level:h,isEnd:E}),this.renderArrow(),D.createElement("span",{className:Ne},P?this.renderCheckbox():null,this.renderIcon(),D.createElement("span",{className:`${rn}-label-text`},this.renderRealLabel())))}}Bp.contextType=cT;Bp.propTypes={expanded:C.bool,selected:C.bool,checked:C.bool,halfChecked:C.bool,active:C.bool,disabled:C.bool,loaded:C.bool,loading:C.bool,isLeaf:C.bool,pos:C.string,children:C.oneOfType([C.array,C.object]),icon:C.node,directory:C.bool,keyword:C.string,treeNodeFilterProp:C.string,selectedKey:C.string,motionKey:C.oneOfType([C.string,C.arrayOf(C.string)]),isEnd:C.arrayOf(C.bool),showLine:C.bool,expandIcon:C.oneOfType([C.node,C.func])};Bp.defaultProps={selectedKey:"",motionKey:""};var dfe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};function hfe(e){const{open:n,children:r}=e,i=dfe(e,["open","children"]),[s,o]=R.useState(e.open);return R.useEffect(()=>{setTimeout(()=>{o(!e.open)},0)},[]),D.createElement(Qu,Object.assign({},i,{isOpen:s}),r)}const Fk=e=>e.key;let n$=class extends R.PureComponent{constructor(n){super(n),this.onMotionEnd=()=>{typeof this.props.onMotionEnd=="function"&&this.props.onMotionEnd(),this.setState({transitionNodes:[]})},this.state={transitionNodes:[]}}static getDerivedStateFromProps(n,r){const{flattenNodes:i=[],motionKeys:s,motionType:o,flattenList:a=[]}=n,l=!Qs(r.cachedMotionKeys,s)||!Qs(r.cachedData.map(S=>S.key),i.map(S=>S.key)),u=[...s];if(!l||!u.length)return null;const h=[],p=[];let g=0,v={};return(o==="hide"&&a?a:i).forEach((S,E)=>{const x=Fk(S);s.has(x)?(p.push(S),x===u[0]&&(g=E)):h.push(S)}),h.splice(g,0,p),v={transitionNodes:h,cachedData:i,cachedMotionKeys:s,cachedMotionType:o},v}render(){const{flattenNodes:n,motionType:r,searchTargetIsDeep:i,renderTreeNode:s}=this.props,{transitionNodes:o}=this.state;return(o.length&&!i?o:n).map(u=>{const h=Array.isArray(u);if(h&&!u.length)return null;if(h&&u.length){const p=Fk(u[0]);return D.createElement(hfe,{open:r==="hide",duration:200,motion:!!r,key:`motion-${p}`,onMotionEnd:this.onMotionEnd},u.map(g=>s(g)))}return s(u)})}};n$.contextType=cT;const r$={PREFIX:`${Dn}-tree-select`,PREFIX_TREE:`${Dn}-tree`},Hi={SIZE_SET:["small","large","default"],SEARCH_POSITION_DROPDOWN:"dropdown",SEARCH_POSITION_TRIGGER:"trigger",STATUS:Die};class ffe extends li{constructor(n){super(Object.assign({},n)),this.handleKeyDown=r=>{r.key===Jj&&this.getState("isOpen")&&this.close(r)},this._registerClickOutsideHandler=()=>{this._adapter.registerClickOutsideHandler(r=>{this.handlerTriggerBlur(r),this.close(r)})},this.clearInputValue=()=>{const{inputValue:r}=this.getStates();r&&this._adapter.updateInputValue("")},this.onClickSingleTriggerSearchItem=r=>{this.focusInput(!0)}}init(){const{searchAutoFocus:n,searchPosition:r,filterTreeNode:i}=this.getProps(),s=r===Hi.SEARCH_POSITION_TRIGGER&&i,o=n&&s;this._setDropdownWidth();const a=!this._isDisabled();(this.getProp("defaultOpen")||o)&&a&&(this.open(),this._registerClickOutsideHandler()),o&&a&&this.handleTriggerFocus(null)}destroy(){this._adapter.unregisterClickOutsideHandler()}_setDropdownWidth(){const{style:n,dropdownMatchSelectWidth:r}=this.getProps();let i;r&&(n&&Ki(n.width)||n&&fr(n.width)&&!n.width.includes("%")?i=n.width:i=this._adapter.getTriggerWidth(),this._adapter.setOptionWrapperWidth(i))}_isMultiple(){return this.getProp("multiple")}_isAnimated(){return this.getProp("motionExpand")}_isDisabled(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.getProp("disabled")||n.disabled}_isExpandControlled(){return this.getProp("expandedKeys")}_isSelectToClose(){return!this.getProp("expandAction")}_isLoadControlled(){return this.getProp("loadedKeys")}_showFilteredOnly(){const{inputValue:n}=this.getStates(),{showFilteredOnly:r}=this.getProps();return!!n&&r}findDataForValue(n){const{value:r,defaultValue:i,keyMaps:s}=this.getProps(),o=ot(s,"value","value"),a=ot(s,"key","key");let l=[];return r?l=Array.isArray(r)?r:[r]:i&&(l=Array.isArray(i)?i:[i]),l.find(u=>u[o]===n||u[a]===n)}constructDataForValue(n){const{treeNodeLabelProp:r,keyMaps:i}=this.getProps(),s=ot(i,"key","key"),o=ot(i,"label",r);return{[s]:n,[o]:n}}getDataForKeyNotInKeyEntities(n){const{onChangeWithObject:r}=this.getProps();return r?this.findDataForValue(n):this.constructDataForValue(n)}getTreeNodeProps(n){const{expandedKeys:r=new Set([]),selectedKeys:i=[],checkedKeys:s=new Set([]),halfCheckedKeys:o=new Set([]),realCheckedKeys:a=new Set([]),keyEntities:l={},filteredKeys:u=new Set([]),inputValue:h="",loadedKeys:p,loadingKeys:g,filteredExpandedKeys:v=new Set([]),disabledKeys:w=new Set([])}=this.getStates(),{treeNodeFilterProp:S,checkRelation:E}=this.getProps(),x=l[n];if(!x)return null;let P=!1,M=!1;E==="related"?(P=s.has(n),M=o.has(n)):E==="unRelated"&&(P=a.has(n),M=!1);const A={eventKey:n,expanded:!!h?v.has(n):r.has(n),selected:i.includes(n),checked:P,halfChecked:M,pos:String(x?x.pos:""),level:x.level,filtered:u.has(n),keyword:h,treeNodeFilterProp:S,loading:g.has(n)&&!p.has(n),loaded:p.has(n)};return this.getProp("disableStrictly")&&w.has(n)&&(A.disabled=!0),A}handleNodeLoad(n,r,i,s){const{loadData:o}=this.getProps(),{key:a}=i;return!o||n.has(a)||r.has(a)?{}:(o(i).then(()=>{const l=new Set(this.getState("loadedKeys")),u=new Set(this.getState("loadingKeys")),h=l.add(a),p=new Set([...u]);p.delete(a),this._adapter.notifyLoad(h,i),this._isLoadControlled()||this._adapter.updateState({loadedKeys:h}),this._adapter.setState({loadingKeys:p}),s()}),{loadingKeys:r.add(a)})}focusInput(n){this._adapter.updateInputFocus(n)}_notifyMultipleChange(n,r){const{keyEntities:i}=this.getStates(),{leafOnly:s,checkRelation:o,keyMaps:a,autoMergeValue:l}=this.getProps();let u=[];o==="related"?u=l?ra(n,i,s,!0):n:o==="unRelated"&&(u=n);const h=u.map(p=>i[p]&&i[p].key===p?i[p].data:this.getDataForKeyNotInKeyEntities(p));if(this.getProp("onChangeWithObject"))this._adapter.notifyChangeWithObject(h,r);else{const p=uw(h,a);this._adapter.notifyChange(p,h,r)}}_notifyChange(n,r){const{keyEntities:i}=this.getStates(),{keyMaps:s}=this.getProps();if(this._isMultiple()&&Array.isArray(n))this._notifyMultipleChange(n,r);else{const o=kr(n)?n:i[n].data,a=kr(n)?n:uw(o,s);this.getProp("onChangeWithObject")?this._adapter.notifyChangeWithObject(o,r):this._adapter.notifyChange(a,o,r)}}_notifyFocus(n){this._adapter.notifyFocus(n)}handleTriggerFocus(n){this._adapter.updateIsFocus(!0),this._notifyFocus(n),this._registerClickOutsideHandler()}_notifyBlur(n){this._adapter.notifyBlur(n)}handlerTriggerBlur(n){this.getState("isFocus")&&(this._adapter.updateIsFocus(!1),this._notifyBlur(n),this._adapter.unregisterClickOutsideHandler())}toggleHoverState(n){this._adapter.toggleHovering(n)}open(){this._adapter.openMenu(),this._setDropdownWidth()}close(n){this._adapter.closeMenu(),this.getProp("motionExpand")&&this._adapter.updateState({motionKeys:new Set([])})}handleClick(n){const r=this._isDisabled(),{isOpen:i,inputValue:s,isFocus:o}=this.getStates(),{searchPosition:a,clickTriggerToHide:l}=this.getProps();if(!r)if(o||this.handleTriggerFocus(n),i){if(a==="trigger"&&s)return;l&&this.close(n)}else this.open()}handleSelectionEnterPress(n){ua(n)&&this.handleClick(n)}handleClear(n){const{searchPosition:r,filterTreeNode:i}=this.getProps(),{inputValue:s,selectedKeys:o}=this.getStates(),a=this._isMultiple(),l=this._isControlledComponent(),u=a?[]:void 0;this._notifyChange(u,n),l||(this._adapter.rePositionDropdown(),this._adapter.updateState({selectedKeys:[],checkedKeys:new Set,halfCheckedKeys:new Set,realCheckedKeys:new Set([])})),i&&r===Hi.SEARCH_POSITION_TRIGGER&&s!==""&&($n(o)?this.handleInputChange(""):this.clearInput()),this._adapter.notifyClear(n)}handleClearEnterPress(n){ua(n)&&this.handleClear(n)}removeTag(n){const{disableStrictly:r,checkRelation:i,keyMaps:s}=this.getProps(),{keyEntities:o,disabledKeys:a,realCheckedKeys:l}=this.getStates(),u=o[n]&&o[n].key===n?o[n].data:this.getDataForKeyNotInKeyEntities(n),h=ot(s,"disabled","disabled");if(!(u[h]||r&&a.has(n))){if(i==="unRelated"){const p=new Set(l);p.delete(n),this._notifyChange([...p],null),this._isControlledComponent()||(this._adapter.updateState({realCheckedKeys:p}),this._adapter.rePositionDropdown())}else if(i==="related"){const{checkedKeys:p,halfCheckedKeys:g}=this.calcCheckedKeys(n,!1);this._notifyChange([...p],null),this._isControlledComponent()||(this._adapter.updateState({checkedKeys:p,halfCheckedKeys:g}),this._adapter.rePositionDropdown())}this._adapter.notifySelect(n,!1,u),this._adapter.rePositionDropdown()}}clearInput(){const{flattenNodes:n,expandedKeys:r,selectedKeys:i,keyEntities:s,treeData:o}=this.getStates(),{keyMaps:a}=this.getProps(),l=new Set(r);this._isExpandControlled();const u=nl(i,s,!1);u.forEach(p=>l.add(p));const h=Cu(o,l,a);this._adapter.updateState({expandedKeys:l,flattenNodes:h,inputValue:"",motionKeys:new Set([]),filteredKeys:new Set([]),filteredExpandedKeys:new Set(u),filteredShownKeys:new Set([])}),this._adapter.rePositionDropdown()}handleInputChange(n){this._adapter.updateInputValue(n);const{flattenNodes:r,expandedKeys:i,selectedKeys:s,keyEntities:o,treeData:a}=this.getStates(),{showFilteredOnly:l,filterTreeNode:u,treeNodeFilterProp:h,keyMaps:p}=this.getProps(),g=h!=="label"?h:ot(p,"label","label"),v=new Set(i);let w=[],S=[],E=[],x=[],I=new Set([]);if(!n)E=nl(s,o,!1),E.forEach(M=>v.add(M)),x=Cu(a,v,p);else{const M=Object.values(o).filter(A=>{const{data:j}=A;return dF(n,j,u,g)});w=M.map(A=>A.data),S=M.map(A=>A.key),E=nl(S,o,!1);const k=tl(S,o,!0);I=new Set([...k,...E]),x=Cu(a,new Set(E),p,l&&I)}const P=new Set(E);this._adapter.notifySearch(n,Array.from(P),w),this._adapter.updateState({expandedKeys:v,flattenNodes:x,motionKeys:new Set([]),filteredKeys:new Set(S),filteredExpandedKeys:P,filteredShownKeys:I}),this._adapter.rePositionDropdown()}handleNodeSelect(n,r){this._isDisabled(r)||(this._isMultiple()?this.handleMultipleSelect(n,r):this.handleSingleSelect(n,r))}handleSingleSelect(n,r){let i=[...this.getState("selectedKeys")];const{clickToHide:s}=this.getProps(),{selected:o,eventKey:a,data:l}=r;this._adapter.notifySelect(a,!0,l),!i.includes(a)&&!o&&(i=[a],this._notifyChange(a,n),this._isControlledComponent()||this._adapter.updateState({selectedKeys:i})),s&&(this._isSelectToClose()||!l.children)&&(this.close(n),this.handlerTriggerBlur(n))}calcCheckedKeys(n,r){const{keyEntities:i}=this.getStates(),s=new Set(this.getState("checkedKeys")),o=new Set(this.getState("halfCheckedKeys"));return r?hF(n,i,s,o):fF(n,i,s,o)}handleMultipleSelect(n,r){const{searchPosition:i,disableStrictly:s,checkRelation:o}=this.getProps(),{inputValue:a,realCheckedKeys:l}=this.getStates(),{checked:u,eventKey:h,data:p}=r;if(o==="related"){const g=s?this.calcCheckedStatus(!u,h):!u,{checkedKeys:v,halfCheckedKeys:w}=s?this.calcNonDisabledCheckedKeys(h,g):this.calcCheckedKeys(h,g);this._adapter.notifySelect(h,g,p),this._notifyChange([...v],n),this._isControlledComponent()||(this._adapter.updateState({checkedKeys:v,halfCheckedKeys:w}),this._adapter.rePositionDropdown())}else if(o==="unRelated"){const g=new Set(l);let v;l.has(h)?(g.delete(h),v=!1):(g.add(h),v=!0),this._adapter.notifySelect(h,v,p),this._notifyChange([...g],n),this._isControlledComponent()||(this._adapter.updateState({realCheckedKeys:g}),this._adapter.rePositionDropdown())}i===Hi.SEARCH_POSITION_TRIGGER&&a!==""&&this._adapter.updateState({inputValue:""})}calcNonDisabledCheckedKeys(n,r){const{keyEntities:i,disabledKeys:s}=this.getStates(),o=new Set(this.getState("checkedKeys")),a=ra(tl([n],i,!1),i,!0);if(!a.some(p=>s.has(p)))return this.calcCheckedKeys(n,r);const u=a.filter(p=>!s.has(p)),h=r?[...u,...o]:lw(ra([...o],i,!0,!0),u);return c0(h,i)}calcCheckedStatus(n,r){if(!n)return n;const{checkedKeys:i,keyEntities:s,disabledKeys:o}=this.getStates(),a=ra(tl([r],s,!1),s,!0);return a.some(p=>o.has(p))?!a.filter(p=>!o.has(p)).every(p=>i.has(p)):n}handleNodeExpandInSearch(n,r){const{treeData:i,filteredShownKeys:s,keyEntities:o}=this.getStates(),{keyMaps:a}=this.getProps(),l=this._showFilteredOnly(),u=new Set(this.getState("filteredExpandedKeys"));let h="show";const{eventKey:p,expanded:g,data:v}=r;if(g?u.has(p)&&(u.delete(p),h="hide"):u.add(p),this._adapter.cacheFlattenNodes(h==="hide"&&this._isAnimated()),!this._isExpandControlled()){const w=Cu(i,u,a,l&&s),S=this._isAnimated()?uk(p,u,o):[],E={filteredExpandedKeys:u,flattenNodes:w,motionKeys:new Set(S),motionType:h};this._adapter.updateState(E)}this._adapter.notifyExpand(u,{expanded:!g,node:v})}handleNodeExpand(n,r){const{loadData:i,keyMaps:s}=this.getProps(),{inputValue:o,keyEntities:a}=this.getStates(),l=!!o;if(!i&&(!r.children||!r.children.length))return;const u=this._isExpandControlled();if(l){this.handleNodeExpandInSearch(n,r);return}const{treeData:h}=this.getStates(),p=new Set(this.getState("expandedKeys"));let g="show";const{eventKey:v,expanded:w,data:S}=r;if(w?p.has(v)&&(p.delete(v),g="hide"):p.add(v),this._adapter.cacheFlattenNodes(g==="hide"&&this._isAnimated()),!u){const E=Cu(h,p,s),x=this._isAnimated()?uk(v,p,a):[],I={expandedKeys:p,flattenNodes:E,motionKeys:new Set(x),motionType:g};this._adapter.updateState(I)}this._adapter.notifyExpand(p,{expanded:!w,node:S})}getRenderTextInSingle(){const{renderSelectedItem:n,treeNodeLabelProp:r,keyMaps:i}=this.getProps(),{selectedKeys:s,keyEntities:o}=this.getStates(),a=ot(i,"label",r),l=sr(n)?n:p=>ot(p,a,null);let u;if(s.length){const p=s[0];u=o[p]&&o[p].key===p?o[p].data:this.getDataForKeyNotInKeyEntities(p)}return u?l(u):null}handleInputTriggerBlur(){this._adapter.updateState({inputTriggerFocus:!1})}handleInputTriggerFocus(){this.clearInput(),this._adapter.updateState({inputTriggerFocus:!0})}setLoadKeys(n,r){this._adapter.updateLoadKeys(n,r)}handlePopoverVisibleChange(n){const{filterTreeNode:r,searchAutoFocus:i,searchPosition:s}=this.getProps();n===!1&&r&&this.clearInputValue(),r&&s===Hi.SEARCH_POSITION_DROPDOWN&&n&&i&&this.focusInput(!0)}handleAfterClose(){const{filterTreeNode:n}=this.getProps();n&&this.clearInput()}}var pfe=function(e,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r};const Kt=r$.PREFIX,ch=r$.PREFIX_TREE,gfe=0;class C_ extends jr{constructor(n){super(n),this.renderSuffix=()=>{const{suffix:r}=this.props,i=xe({[`${Kt}-suffix`]:!0,[`${Kt}-suffix-text`]:r&&fr(r),[`${Kt}-suffix-icon`]:Hs(r)});return D.createElement("div",{className:i,"x-semi-prop":"suffix"},r)},this.renderPrefix=()=>{const{prefix:r,insetLabel:i,insetLabelId:s}=this.props,o=r||i,a=xe({[`${Kt}-prefix`]:!0,[`${Kt}-inset-label`]:i,[`${Kt}-prefix-text`]:o&&fr(o),[`${Kt}-prefix-icon`]:Hs(o)});return D.createElement("div",{className:a,id:s,"x-semi-prop":"prefix,insetLabel"},o)},this.renderContent=()=>{const{dropdownMinWidth:r}=this.state,{dropdownStyle:i,dropdownClassName:s}=this.props,o=Object.assign({minWidth:r},i),a=xe(s,`${Kt}-popover`);return D.createElement("div",{className:a,style:o,onKeyDown:this.foundation.handleKeyDown},this.renderTree())},this.removeTag=r=>{this.foundation.removeTag(r)},this.handleClick=r=>{this.foundation.handleClick(r)},this.getDataForKeyNotInKeyEntities=r=>this.foundation.getDataForKeyNotInKeyEntities(r),this.handleSelectionEnterPress=r=>{this.foundation.handleSelectionEnterPress(r)},this.hasValue=()=>{const{multiple:r,checkRelation:i}=this.props,{realCheckedKeys:s,checkedKeys:o,selectedKeys:a}=this.state;let l=!1;return r?i==="related"?l=!!o.size:i==="unRelated"&&(l=!!s.size):l=!!a.length,l},this.showClearBtn=()=>{const{showClear:r,disabled:i,searchPosition:s}=this.props,{inputValue:o,isOpen:a,isHovering:l}=this.state,u=s===Hi.SEARCH_POSITION_TRIGGER&&o;return r&&(this.hasValue()||u)&&!i&&(a||l)},this.renderTagList=r=>{const{keyEntities:i,disabledKeys:s}=this.state,{treeNodeLabelProp:o,leafOnly:a,disabled:l,disableStrictly:u,size:h,renderSelectedItem:p,keyMaps:g}=this.props,v=ot(g,"label",o),w=sr(p)?p:E=>({isRenderInTag:!0,content:ot(E,v,null)}),S=[];return r.forEach((E,x)=>{const I=i[E]&&i[E].key===E?i[E].data:this.getDataForKeyNotInKeyEntities(E),P=(V,$)=>{$&&typeof $.preventDefault=="function"&&$.preventDefault(),this.removeTag(E)},{content:M,isRenderInTag:k}=I?w(I,{index:x,onClose:P}):{};if(kh(M)||kr(M))return;const j={closable:!(l||I.disabled||u&&s.has(I.key)),color:"white",visible:!0,onClose:P,key:`tag-${E}-${x}`,size:h==="small"?"small":"large"};k?S.push(D.createElement(Gs,Object.assign({},j),M)):S.push(M)}),S},this.renderSingleTriggerSearchItem=()=>{const{placeholder:r,disabled:i}=this.props,{inputTriggerFocus:s}=this.state,o=this.foundation.getRenderTextInSingle(),a=xe(`${Kt}-selection-TriggerSearchItem`,{[`${Kt}-selection-TriggerSearchItem-placeholder`]:(s||!o)&&!i,[`${Kt}-selection-TriggerSearchItem-disabled`]:i});return D.createElement("span",{className:a,onClick:this.foundation.onClickSingleTriggerSearchItem},o||r)},this.renderSingleTriggerSearch=()=>{const{inputValue:r}=this.state;return D.createElement(D.Fragment,null,this.renderInput(),!r&&this.renderSingleTriggerSearchItem())},this.renderSelectContent=r=>{const{multiple:i,placeholder:s,maxTagCount:o,searchPosition:a,filterTreeNode:l,showRestTagsPopover:u,restTagsPopoverProps:h}=this.props;if(l&&a===Hi.SEARCH_POSITION_TRIGGER)return i?this.renderTagInput(r):this.renderSingleTriggerSearch();if(!i||!this.hasValue()){const v=this.foundation.getRenderTextInSingle(),w=xe(`${Kt}-selection-content`,{[`${Kt}-selection-placeholder`]:!v});return D.createElement("span",{className:w},v||s)}const g=this.renderTagList(r);return D.createElement(rT,{maxTagCount:o,tagList:g,size:"large",mode:"custom",showPopover:u,popoverProps:h})},this.handleClear=r=>{r&&r.stopPropagation(),this.foundation.handleClear(r)},this.handleClearEnterPress=r=>{r&&r.stopPropagation(),this.foundation.handleClearEnterPress(r)},this.handleMouseOver=r=>{this.foundation.toggleHoverState(!0)},this.handleMouseLeave=r=>{this.foundation.toggleHoverState(!1)},this.search=r=>{const{isOpen:i}=this.state;i||this.foundation.open(),this.foundation.handleInputChange(r)},this.close=()=>{this.foundation.close(null)},this.renderArrow=()=>{const r=this.showClearBtn(),{arrowIcon:i}=this.props;return r?null:i?D.createElement("div",{className:xe(`${Kt}-arrow`),"x-semi-prop":"arrowIcon"},i):null},this.renderClearBtn=()=>{const r=this.showClearBtn(),{clearIcon:i}=this.props,s=xe(`${Kt}-clearbtn`);return r?D.createElement("div",{role:"button",tabIndex:0,"aria-label":"Clear TreeSelect value",className:s,onClick:this.handleClear,onKeyPress:this.handleClearEnterPress},i||D.createElement(n_,null)):null},this.renderSelection=()=>{const r=this.props,{disabled:i,multiple:s,filterTreeNode:o,validateStatus:a,prefix:l,suffix:u,style:h,size:p,insetLabel:g,className:v,placeholder:w,showClear:S,leafOnly:E,searchPosition:x,triggerRender:I,borderless:P,autoMergeValue:M,checkRelation:k}=r,A=pfe(r,["disabled","multiple","filterTreeNode","validateStatus","prefix","suffix","style","size","insetLabel","className","placeholder","showClear","leafOnly","searchPosition","triggerRender","borderless","autoMergeValue","checkRelation"]),{inputValue:j,selectedKeys:V,checkedKeys:$,keyEntities:W,isFocus:B,realCheckedKeys:H}=this.state,Y=!!o,te=typeof I=="function",ue=S?{onMouseEnter:ee=>this.handleMouseOver(ee),onMouseLeave:ee=>this.handleMouseLeave(ee)}:{},ye=x===Hi.SEARCH_POSITION_TRIGGER&&Y,Ne=ye&&$n($),q=ye&&!$n($),G=te?xe(v):xe(Kt,{[`${Kt}-borderless`]:P,[`${Kt}-focus`]:B,[`${Kt}-disabled`]:i,[`${Kt}-single`]:!s,[`${Kt}-multiple`]:s,[`${Kt}-multiple-tagInput-empty`]:s&&Ne,[`${Kt}-multiple-tagInput-notEmpty`]:s&&q,[`${Kt}-filterable`]:Y,[`${Kt}-error`]:a==="error",[`${Kt}-warning`]:a==="warning",[`${Kt}-small`]:p==="small",[`${Kt}-large`]:p==="large",[`${Kt}-with-prefix`]:l||g,[`${Kt}-with-suffix`]:u,[`${Kt}-with-suffix`]:u},v);let ae,ge=[];s?M?k==="related"?ge=ra([...$],W,E,!0):k==="unRelated"&&(ge=[...H]):ge=[...$]:ge=V,te?ae=D.createElement(FO,{inputValue:j,value:ge.map(ee=>ot(W,[ee,"data"])),disabled:i,placeholder:w,onClear:this.handleClear,componentName:"TreeSelect",triggerRender:I,componentProps:Object.assign({},this.props),onSearch:this.search,onRemove:this.removeTag}):ae=[D.createElement(R.Fragment,{key:"prefix"},l||g?this.renderPrefix():null),D.createElement(R.Fragment,{key:"selection"},D.createElement("div",{className:`${Kt}-selection`},this.renderSelectContent(ge))),D.createElement(R.Fragment,{key:"suffix"},u?this.renderSuffix():null),D.createElement(R.Fragment,{key:"clearBtn"},S||ye&&j?this.renderClearBtn():null),D.createElement(R.Fragment,{key:"arrow"},this.renderArrow())];const X=i?null:0;return D.createElement("div",Object.assign({role:"combobox","aria-disabled":i,"aria-haspopup":"tree",tabIndex:X,className:G,style:h,ref:this.triggerRef,onClick:this.handleClick,onKeyPress:this.handleSelectionEnterPress,onKeyDown:this.foundation.handleKeyDown,"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"]},ue,this.getDataAttr(A)),ae)},this.renderTagItem=(r,i)=>{const{keyEntities:s,disabledKeys:o}=this.state,{size:a,leafOnly:l,disabled:u,disableStrictly:h,renderSelectedItem:p,treeNodeLabelProp:g,keyMaps:v}=this.props,w=ot(v,"label",g),E=ra([r],s,l,!0).map(W=>s[r]&&s[r].key===r?s[r].data:this.getDataForKeyNotInKeyEntities(r)),x=uw(E,v),I=xe(`${Kt}-selection-tag`,{[`${Kt}-selection-tag-disabled`]:u}),P=!$n(E)&&!$n(E[0]),M=h&&P&&o.has(E[0].key),k=P&&!E[0].disabled&&!u&&!M,A=(W,B)=>{B.preventDefault(),this.removeTag(r)},j={size:a==="small"?"small":"large",key:`tag-${x}-${i}`,color:"white",className:I,closable:k,onClose:A},V=E[0],$=sr(p)?p:W=>({isRenderInTag:!0,content:ot(W,w,null)});if(sr($)){const{content:W,isRenderInTag:B}=V?$(V,{index:i,onClose:A}):{};return B?D.createElement(Gs,Object.assign({},j),W):W}return D.createElement(Gs,Object.assign({},j),x)},this.renderTagInput=r=>{const{disabled:i,size:s,searchAutoFocus:o,placeholder:a,maxTagCount:l,showRestTagsPopover:u,restTagsPopoverProps:h,searchPosition:p,filterTreeNode:g,preventScroll:v}=this.props,{inputValue:w}=this.state,S=g&&p===Hi.SEARCH_POSITION_TRIGGER?o:void 0;return D.createElement(w_,{maxTagCount:l,disabled:i,onInputChange:E=>this.search(E),ref:this.tagInputRef,placeholder:a,value:r,inputValue:w,size:s,showRestTagsPopover:u,restTagsPopoverProps:h,autoFocus:S,renderTagItem:(E,x)=>this.renderTagItem(E,x),onRemove:E=>this.removeTag(E),expandRestTagsOnClick:!1,preventScroll:v})},this.renderInput=()=>{const{searchPlaceholder:r,searchRender:i,showSearchClear:s,searchPosition:o,searchAutoFocus:a,multiple:l,disabled:u,preventScroll:h}=this.props,{inputValue:p,inputTriggerFocus:g}=this.state,v=o===Hi.SEARCH_POSITION_DROPDOWN,w=xe({[`${ch}-input`]:v,[`${Kt}-inputTrigger`]:!v}),S={value:p,className:w,preventScroll:h,onChange:k=>this.search(k)},I=v?{showClear:s,prefix:D.createElement(ole,null)}:{autofocus:a,onFocus:k=>this.foundation.handleInputTriggerFocus(),onBlur:k=>this.foundation.handleInputTriggerBlur(),disabled:u},P=xe({[`${ch}-search-wrapper`]:v,[`${Kt}-triggerSingleSearch-wrapper`]:!v&&!l,[`${Kt}-triggerSingleSearch-upper`]:!v&&g}),M=typeof i=="function"||typeof i=="boolean";return M&&!i?null:D.createElement("div",{className:P},D.createElement(Gu,{componentName:"TreeSelect"},k=>{const A=v?r||k.searchPlaceholder:"";return M?i(Object.assign(Object.assign(Object.assign({},I),S),{placeholder:A})):D.createElement(vc,Object.assign({"aria-label":"Filter TreeSelect item",ref:this.inputRef,placeholder:A},S,I))}))},this.renderEmpty=()=>{const{emptyContent:r}=this.props;return r===null?null:r?D.createElement(Bp,{empty:!0,emptyContent:this.props.emptyContent}):D.createElement(Gu,{componentName:"Tree"},i=>D.createElement(Bp,{empty:!0,emptyContent:i.emptyText}))},this.onNodeLoad=r=>new Promise(i=>this.foundation.setLoadKeys(r,i)),this.onNodeSelect=(r,i)=>{this.foundation.handleNodeSelect(r,i)},this.onNodeCheck=(r,i)=>{this.foundation.handleNodeSelect(r,i)},this.onNodeExpand=(r,i)=>{this.foundation.handleNodeExpand(r,i)},this.getTreeNodeRequiredProps=()=>{const{expandedKeys:r,selectedKeys:i,checkedKeys:s,halfCheckedKeys:o,keyEntities:a,filteredKeys:l}=this.state;return{expandedKeys:r||new Set,selectedKeys:i||[],checkedKeys:s||new Set,halfCheckedKeys:o||new Set,filteredKeys:l||new Set,keyEntities:a}},this.getTreeNodeKey=r=>{const{data:i}=r,{key:s}=i;return s},this.handlePopoverVisibleChange=r=>{this.foundation.handlePopoverVisibleChange(r)},this.afterClose=()=>{this.foundation.handleAfterClose()},this.renderTreeNode=(r,i,s)=>{const{data:o,key:a}=r,l=this.foundation.getTreeNodeProps(a),{showLine:u}=this.props;if(!l)return null;const h=cw(r,["key","label","disabled","isLeaf","icon","isEnd"]),{keyMaps:p,expandIcon:g}=this.props,v=o[ot(p,"children","children")];return!kr(v)&&(h.children=v),D.createElement(Bp,Object.assign({},l,o,h,{data:o,style:s,showLine:u,expandIcon:g}))},this.itemKey=(r,i)=>{const{visibleOptions:s}=i;return s[r].key},this.renderNodeList=()=>{const{flattenNodes:r,cachedFlattenNodes:i,motionKeys:s,motionType:o,filteredKeys:a}=this.state,{direction:l}=this.context,{virtualize:u,motionExpand:h}=this.props,p="expandedKeys"in this.props;if(!u||$n(u))return D.createElement(n$,{flattenNodes:r,flattenList:i,motionKeys:h?s:new Set([]),motionType:o,searchTargetIsDeep:p&&h&&$n(s)&&!$n(a),onMotionEnd:this.onMotionEnd,renderTreeNode:this.renderTreeNode});const g={visibleOptions:r,renderOption:this.renderTreeNode};return D.createElement(lT,{defaultHeight:u.height,defaultWidth:u.width},v=>{let{height:w,width:S}=v;return D.createElement(vF,{itemCount:r.length,itemSize:u.itemSize,height:w,width:S,itemKey:this.itemKey,itemData:g,className:`${ch}-virtual-list`,style:{direction:l}},Yhe)})},this.renderTree=()=>{const{keyEntities:r,motionKeys:i,motionType:s,inputValue:o,filteredKeys:a,flattenNodes:l,checkedKeys:u,realCheckedKeys:h}=this.state,{loadData:p,filterTreeNode:g,disabled:v,multiple:w,showFilteredOnly:S,motionExpand:E,outerBottomSlot:x,outerTopSlot:I,expandAction:P,labelEllipsis:M,virtualize:k,optionListStyle:A,searchPosition:j,renderLabel:V,renderFullLabel:$,checkRelation:W,emptyContent:B}=this.props,H=xe(`${ch}-wrapper`),Y=!!o&&!a.size,te=$n(l)||S&&Y,ue=j===Hi.SEARCH_POSITION_DROPDOWN,ye=xe(`${ch}-option-list ${ch}-option-list-block`,{[`${ch}-option-list-hidden`]:B===null&&te});return D.createElement(cT.Provider,{value:{loadData:p,treeDisabled:v,motion:E,motionKeys:i,motionType:s,expandAction:P,filterTreeNode:g,keyEntities:r,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeRightClick:rt,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,renderTreeNode:this.renderTreeNode,multiple:w,showFilteredOnly:S,isSearching:!!o,renderLabel:V,renderFullLabel:$,labelEllipsis:typeof M>"u"?k:M}},D.createElement("div",{className:H},I,!I&&g&&ue&&this.renderInput(),D.createElement("div",{className:ye,role:"tree","aria-multiselectable":!!w,style:A},te?this.renderEmpty():w?D.createElement(h_,{value:Array.from(W==="related"?u:h)},this.renderNodeList()):this.renderNodeList()),x))},this.state={inputTriggerFocus:!1,isOpen:!1,isFocus:!1,rePosKey:gfe,dropdownMinWidth:null,inputValue:"",keyEntities:{},treeData:[],flattenNodes:[],cachedFlattenNodes:void 0,selectedKeys:[],checkedKeys:new Set,halfCheckedKeys:new Set,realCheckedKeys:new Set([]),disabledKeys:new Set,motionKeys:new Set([]),motionType:"hide",expandedKeys:new Set(n.expandedKeys),filteredKeys:new Set,filteredExpandedKeys:new Set,filteredShownKeys:new Set,prevProps:null,isHovering:!1,cachedKeyValuePairs:{},loadedKeys:new Set,loadingKeys:new Set},this.inputRef=D.createRef(),this.tagInputRef=D.createRef(),this.triggerRef=D.createRef(),this.optionsRef=D.createRef(),this.clickOutsideHandler=null,this.foundation=new ffe(this.adapter),this.treeSelectID=Math.random().toString(36).slice(2),this.onMotionEnd=()=>{this.adapter.rePositionDropdown()}}static getDerivedStateFromProps(n,r){const{prevProps:i,rePosKey:s}=r,{keyMaps:o}=n,a=I=>!i&&I in n||i&&!Qs(i[I],n[I]);let l;const u=n.onChangeWithObject;let h=r.keyEntities||{},p=r.cachedKeyValuePairs||{};const g={prevProps:n},v=a("treeData"),w=a("expandedKeys"),S=!!(n.filterTreeNode&&r.inputValue&&r.inputValue.length);if(v){l=n.treeData,g.treeData=l;const I=iue(l,o);g.keyEntities=Object.assign({},I.keyEntities),h=g.keyEntities,g.cachedKeyValuePairs=Object.assign({},I.valueEntities),p=g.cachedKeyValuePairs}l&&n.motion&&!Qs(Object.keys(g.keyEntities),Object.keys(r.keyEntities))&&i&&n.motion&&(g.motionKeys=new Set([]),g.motionType=null);const E=v&&n.expandAll;if(S){let I;if(l&&(I=aue({treeData:l,inputValue:r.inputValue,filterTreeNode:n.filterTreeNode,filterProps:n.treeNodeFilterProp,showFilteredOnly:n.showFilteredOnly,keyEntities:g.keyEntities,prevExpandedKeys:[...r.filteredExpandedKeys],keyMaps:o}),g.flattenNodes=I.flattenNodes,g.motionKeys=new Set([]),g.filteredKeys=I.filteredKeys,g.filteredShownKeys=I.filteredShownKeys,g.filteredExpandedKeys=I.filteredExpandedKeys),n.expandedKeys){if(g.filteredExpandedKeys=LD(n.expandedKeys,h,n.autoExpandParent||!i),i&&n.motion){const P=r?r.filteredExpandedKeys:new Set([]);if(!l){const M=ck(P,g.filteredExpandedKeys,h);let{motionKeys:k}=M;const{motionType:A}=M;n.showFilteredOnly&&(k=k.filter(j=>r.filteredShownKeys.has(j))),A==="hide"&&(g.cachedFlattenNodes=WD(r.flattenNodes)),g.motionKeys=new Set(k),g.motionType=A}}g.flattenNodes=Cu(l||r.treeData,g.filteredExpandedKeys||r.filteredExpandedKeys,o,n.showFilteredOnly&&r.filteredShownKeys)}}else{if(w||i&&a("autoExpandParent")){if(g.expandedKeys=LD(n.expandedKeys,h,n.autoExpandParent||!i),i&&n.motion&&!l){const{motionKeys:I,motionType:P}=ck(r.expandedKeys,g.expandedKeys,h);g.motionKeys=new Set(I),g.motionType=P,P==="hide"&&(g.cachedFlattenNodes=WD(r.flattenNodes))}}else!i&&(n.defaultExpandAll||n.expandAll)||E?g.expandedKeys=new Set(Object.keys(h)):!i&&n.defaultExpandedKeys?g.expandedKeys=LD(n.defaultExpandedKeys,h):!i&&n.defaultValue?g.expandedKeys=lk(yu(n.defaultValue,u,o),h,n.multiple,p):!i&&n.value&&(g.expandedKeys=lk(yu(n.value,u,o),h,n.multiple,p));if(g.expandedKeys||delete g.expandedKeys,l||g.expandedKeys){const I=Cu(l||r.treeData,g.expandedKeys||r.expandedKeys,o);g.flattenNodes=I}}const x=n.multiple;if(!x)a("value")?g.selectedKeys=dh(yu(n.value,u,o),p,x):!i&&n.defaultValue?g.selectedKeys=dh(yu(n.defaultValue,u,o),p,x):l&&(n.value?g.selectedKeys=dh(yu(n.value,u,o)||"",p,x):g.selectedKeys=dk(r.selectedKeys,h));else{let I;if(a("value")?I=dh(yu(n.value,u,o),p,x):!i&&n.defaultValue?I=dh(yu(n.defaultValue,u,o),p,x):l&&(n.value?I=dh(yu(n.value,u,o)||[],p,x):I=dk(n.checkRelation==="related"?r.checkedKeys:r.realCheckedKeys,h)),I){if(n.checkRelation==="unRelated")g.realCheckedKeys=new Set(I);else if(n.checkRelation==="related"){const{checkedKeys:P,halfCheckedKeys:M}=c0(I,h);g.checkedKeys=P,g.halfCheckedKeys=M}}}return a("loadedKeys")&&(g.loadedKeys=new Set(n.loadedKeys)),(v||a("value"))&&(g.rePosKey=s+1),l&&n.disableStrictly&&n.checkRelation==="related"&&(g.disabledKeys=pF(h,o)),g}get adapter(){var n=this;const r={updateInputValue:o=>{this.setState({inputValue:o})}},i={registerClickOutsideHandler:o=>{this.adapter.unregisterClickOutsideHandler();const a=l=>{const u=this.optionsRef&&this.optionsRef.current,h=this.triggerRef&&this.triggerRef.current,p=Ks.findDOMNode(u),g=l.target,v=l.composedPath&&l.composedPath()||[g];p&&(!p.contains(g)||!p.contains(g.parentNode))&&h&&!h.contains(g)&&!(v.includes(h)||v.includes(p))&&o(l)};this.clickOutsideHandler=a,document.addEventListener("mousedown",a,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(document.removeEventListener("mousedown",this.clickOutsideHandler,!1),this.clickOutsideHandler=null)},rePositionDropdown:()=>{let{rePosKey:o}=this.state;o=o+1,this.setState({rePosKey:o})}},s={updateState:o=>{this.setState(Object.assign({},o))},notifySelect:(o,a,l)=>{this.props.onSelect&&this.props.onSelect(o,a,l)},notifySearch:(o,a,l)=>{this.props.onSearch&&this.props.onSearch(o,a,l)},cacheFlattenNodes:o=>{this.setState({cachedFlattenNodes:o?WD(this.state.flattenNodes):void 0})},notifyLoad:(o,a)=>{const{onLoad:l}=this.props;sr(l)&&l(o,a)},notifyClear:o=>{this.props.onClear&&this.props.onClear(o)}};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),r),i),s),{updateLoadKeys:(o,a)=>{this.setState(l=>{let{loadedKeys:u,loadingKeys:h}=l;return this.foundation.handleNodeLoad(u,h,o,a)})},updateState:o=>{this.setState(Object.assign({},o))},openMenu:()=>{this.setState({isOpen:!0},()=>{this.props.onVisibleChange(!0)})},closeMenu:o=>{this.setState({isOpen:!1},()=>{o&&o(),this.props.onVisibleChange(!1)})},getTriggerWidth:()=>{const o=this.triggerRef.current;return o&&o.getBoundingClientRect().width},setOptionWrapperWidth:o=>{this.setState({dropdownMinWidth:o})},notifyChange:(o,a,l)=>{this.props.onChange&&this.props.onChange(o,a,l)},notifyChangeWithObject:(o,a)=>{this.props.onChange&&this.props.onChange(o,a)},notifyExpand:(o,a)=>{let{expanded:l,node:u}=a;this.props.onExpand&&this.props.onExpand([...o],{expanded:l,node:u}),l&&this.props.loadData&&this.onNodeLoad(u)},notifyFocus:function(){n.props.onFocus&&n.props.onFocus(...arguments)},notifyBlur:function(){n.props.onBlur&&n.props.onBlur(...arguments)},toggleHovering:o=>{this.setState({isHovering:o})},updateInputFocus:o=>{if(o){if(this.inputRef&&this.inputRef.current){const{preventScroll:a}=this.props;this.inputRef.current.focus({preventScroll:a})}this.tagInputRef&&this.tagInputRef.current&&this.tagInputRef.current.focus()}else this.inputRef&&this.inputRef.current&&this.inputRef.current.blur(),this.tagInputRef&&this.tagInputRef.current&&this.tagInputRef.current.blur()},updateIsFocus:o=>{this.setState({isFocus:o})}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}render(){const n=this.renderContent(),{motion:r,zIndex:i,mouseLeaveDelay:s,mouseEnterDelay:o,autoAdjustOverflow:a,stopPropagation:l,getPopupContainer:u,dropdownMargin:h,position:p}=this.props,{isOpen:g,rePosKey:v}=this.state,w=this.renderSelection(),S=p||"bottomLeft";return D.createElement(Yi,{stopPropagation:l,getPopupContainer:u,zIndex:i,motion:r,margin:h,ref:this.optionsRef,content:n,visible:g,trigger:"custom",rePosKey:v,position:S,autoAdjustOverflow:a,mouseLeaveDelay:s,mouseEnterDelay:o,onVisibleChange:this.handlePopoverVisibleChange,afterClose:this.afterClose},w)}}C_.contextType=Ao;C_.propTypes={"aria-describedby":C.string,"aria-errormessage":C.string,"aria-invalid":C.bool,"aria-labelledby":C.string,"aria-required":C.bool,borderless:C.bool,loadedKeys:C.arrayOf(C.string),loadData:C.func,onLoad:C.func,arrowIcon:C.node,clearIcon:C.node,defaultOpen:C.bool,defaultValue:C.oneOfType([C.string,C.array,C.object]),defaultExpandAll:C.bool,defaultExpandedKeys:C.array,expandAll:C.bool,disabled:C.bool,disableStrictly:C.bool,filterTreeNode:C.oneOfType([C.func,C.bool]),multiple:C.bool,searchPlaceholder:C.string,searchAutoFocus:C.bool,virtualize:C.object,treeNodeFilterProp:C.string,onChange:C.func,onClear:C.func,onSearch:C.func,onSelect:C.func,onExpand:C.func,onChangeWithObject:C.bool,onBlur:C.func,onFocus:C.func,value:C.oneOfType([C.string,C.number,C.array,C.object]),expandedKeys:C.array,autoExpandParent:C.bool,showClear:C.bool,showSearchClear:C.bool,autoAdjustOverflow:C.bool,showFilteredOnly:C.bool,showLine:C.bool,motionExpand:C.bool,emptyContent:C.node,keyMaps:C.object,leafOnly:C.bool,treeData:C.arrayOf(C.shape({key:C.string,value:C.oneOfType([C.string,C.number]),label:C.any})),dropdownClassName:C.string,dropdownStyle:C.object,dropdownMargin:C.oneOfType([C.number,C.object]),motion:C.bool,placeholder:C.string,maxTagCount:C.number,size:C.oneOf(Hi.SIZE_SET),className:C.string,style:C.object,treeNodeLabelProp:C.string,suffix:C.node,prefix:C.node,insetLabel:C.node,insetLabelId:C.string,zIndex:C.number,getPopupContainer:C.func,dropdownMatchSelectWidth:C.bool,validateStatus:C.oneOf(Hi.STATUS),mouseEnterDelay:C.number,mouseLeaveDelay:C.number,triggerRender:C.func,stopPropagation:C.oneOfType([C.bool,C.string]),outerBottomSlot:C.node,outerTopSlot:C.node,onVisibleChange:C.func,expandAction:C.oneOf(["click","doubleClick",!1]),searchPosition:C.oneOf([Hi.SEARCH_POSITION_DROPDOWN,Hi.SEARCH_POSITION_TRIGGER]),clickToHide:C.bool,renderLabel:C.func,renderFullLabel:C.func,labelEllipsis:C.bool,optionListStyle:C.object,searchRender:C.oneOfType([C.func,C.bool]),renderSelectedItem:C.func,checkRelation:C.string,"aria-label":C.string,showRestTagsPopover:C.bool,restTagsPopoverProps:C.object,preventScroll:C.bool,clickTriggerToHide:C.bool,autoMergeValue:C.bool};C_.defaultProps={borderless:!1,searchPosition:Hi.SEARCH_POSITION_DROPDOWN,arrowIcon:D.createElement(IO,null),autoExpandParent:!1,autoAdjustOverflow:!0,stopPropagation:!0,motion:!0,motionExpand:!0,expandAll:!1,zIndex:Yu.DEFAULT_Z_INDEX,disableStrictly:!1,multiple:!1,filterTreeNode:!1,size:"default",treeNodeFilterProp:"label",onChangeWithObject:!1,treeNodeLabelProp:"label",dropdownMatchSelectWidth:!0,defaultOpen:!1,showSearchClear:!0,showClear:!1,onVisibleChange:rt,expandAction:!1,clickToHide:!0,searchAutoFocus:!1,checkRelation:"related","aria-label":"TreeSelect",showRestTagsPopover:!1,restTagsPopoverProps:{},clickTriggerToHide:!0,autoMergeValue:!0};var vh={custom:D.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:"false","aria-hidden":"true"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1 18L4.5032 20.1702C4.24999 21.0909 4.94281 22 5.89773 22C6.54881 22 7.11964 21.565 7.29227 20.9372L8.1 18H12.1L11.5032 20.1702C11.25 21.0909 11.9428 22 12.8977 22C13.5488 22 14.1196 21.565 14.2923 20.9372L15.1 18H19.5C20.3284 18 21 17.3284 21 16.5C21 15.6716 20.3284 15 19.5 15H15.925L17.575 9H20.5C21.3284 9 22 8.32843 22 7.5C22 6.67157 21.3284 6 20.5 6H18.4L18.9968 3.8298C19.25 2.90906 18.5572 2 17.6023 2C16.9512 2 16.3804 2.43504 16.2077 3.06281L15.4 6H11.4L11.9968 3.8298C12.25 2.90906 11.5572 2 10.6023 2C9.95119 2 9.38036 2.43504 9.20773 3.06281L8.4 6H4.5C3.67157 6 3 6.67157 3 7.5C3 8.32843 3.67157 9 4.5 9H7.575L5.925 15H3.5C2.67157 15 2 15.6716 2 16.5C2 17.3284 2.67157 18 3.5 18H5.1ZM8.925 15L10.575 9H14.575L12.925 15H8.925Z",fill:"currentColor"})),object:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{d:"M5.33893 1.5835C5.66613 1.5835 5.93137 1.88142 5.93137 2.20862C5.93137 2.53582 5.66613 2.76838 5.33893 2.76838H4.9099C4.34717 2.76838 4.08062 3.07557 4.08062 3.71921V6.58633C4.08062 7.30996 3.80723 7.84734 3.26798 8.19105C3.11426 8.28902 3.10884 8.55273 3.26068 8.65359C3.80476 9.01503 4.08062 9.53994 4.08062 10.2434V13.1251C4.08062 13.7395 4.34717 14.0613 4.9099 14.0613H5.33893C5.66613 14.0613 5.93137 14.3435 5.93137 14.6707C5.93137 14.9979 5.66613 15.2462 5.33893 15.2462H4.64335C3.99177 15.2462 3.48828 15.0268 3.13287 14.6172C2.80708 14.2369 2.64419 13.7103 2.64419 13.0666V10.3165C2.64419 9.8923 2.55534 9.58511 2.37764 9.39494C2.26816 9.27135 1.80618 9.17938 1.38154 9.11602C1.02726 9.06315 0.759057 8.76744 0.765747 8.4093C0.772379 8.0543 1.03439 7.7566 1.38545 7.70346C1.80778 7.63952 2.26906 7.54968 2.37764 7.43477C2.55534 7.22997 2.64419 6.92278 2.64419 6.51319V3.77772C2.64419 3.11945 2.80708 2.59284 3.13287 2.21251C3.48828 1.78829 3.99177 1.5835 4.64335 1.5835H5.33893Z",fill:"currentColor"}),D.createElement("path",{d:"M10.962 15.2463C10.6348 15.2463 10.3696 14.9483 10.3696 14.6211C10.3696 14.2939 10.6348 14.0614 10.962 14.0614H11.391C11.9538 14.0614 12.2203 13.7542 12.2203 13.1105V10.2434C12.2203 9.51979 12.4937 8.98241 13.033 8.6387C13.1867 8.54073 13.1921 8.27703 13.0403 8.17616C12.4962 7.81472 12.2203 7.28982 12.2203 6.58638V3.70463C12.2203 3.09024 11.9538 2.76842 11.391 2.76842L10.962 2.76842C10.6348 2.76842 10.3696 2.48627 10.3696 2.15907C10.3696 1.83188 10.6348 1.58354 10.962 1.58354L11.6576 1.58354C12.3092 1.58354 12.8127 1.80296 13.1681 2.21255C13.4939 2.59289 13.6568 3.1195 13.6568 3.76314V6.51324C13.6568 6.93745 13.7456 7.24464 13.9233 7.43481C14.03 7.5553 14.4328 7.64858 14.8186 7.71393C15.1718 7.77376 15.4401 8.06977 15.4334 8.42791C15.4268 8.78291 15.1646 9.08018 14.814 9.13633C14.4306 9.19774 14.0291 9.28303 13.9233 9.39499C13.7456 9.59978 13.6568 9.90697 13.6568 10.3166V13.052C13.6568 13.7103 13.4939 14.2369 13.1681 14.6172C12.8127 15.0415 12.3092 15.2463 11.6576 15.2463H10.962Z",fill:"currentColor"})),boolean:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.668 4.66683H5.33463C3.49369 4.66683 2.0013 6.15921 2.0013 8.00016C2.0013 9.84111 3.49369 11.3335 5.33463 11.3335H10.668C12.5089 11.3335 14.0013 9.84111 14.0013 8.00016C14.0013 6.15921 12.5089 4.66683 10.668 4.66683ZM5.33463 3.3335C2.75731 3.3335 0.667969 5.42283 0.667969 8.00016C0.667969 10.5775 2.75731 12.6668 5.33463 12.6668H10.668C13.2453 12.6668 15.3346 10.5775 15.3346 8.00016C15.3346 5.42283 13.2453 3.3335 10.668 3.3335H5.33463Z",fill:"currentColor"}),D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.66797 8.00016C8.66797 6.89559 9.5634 6.00016 10.668 6.00016C11.7725 6.00016 12.668 6.89559 12.668 8.00016C12.668 9.10473 11.7725 10.0002 10.668 10.0002C9.5634 10.0002 8.66797 9.10473 8.66797 8.00016ZM10.668 7.3335C10.2998 7.3335 10.0013 7.63197 10.0013 8.00016C10.0013 8.36835 10.2998 8.66683 10.668 8.66683C11.0362 8.66683 11.3346 8.36835 11.3346 8.00016C11.3346 7.63197 11.0362 7.3335 10.668 7.3335Z",fill:"currentColor"})),string:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{d:"M9.3342 3.33321C8.96601 3.33321 8.66753 3.63169 8.66753 3.99988C8.66753 4.36807 8.96601 4.66655 9.3342 4.66655H14.6675C15.0357 4.66655 15.3342 4.36807 15.3342 3.99988C15.3342 3.63169 15.0357 3.33321 14.6675 3.33321H9.3342Z",fill:"currentColor"}),D.createElement("path",{d:"M10.0009 7.99988C10.0009 7.63169 10.2993 7.33321 10.6675 7.33321H14.6675C15.0357 7.33321 15.3342 7.63169 15.3342 7.99988C15.3342 8.36807 15.0357 8.66655 14.6675 8.66655H10.6675C10.2993 8.66655 10.0009 8.36807 10.0009 7.99988Z",fill:"currentColor"}),D.createElement("path",{d:"M12.0009 11.3332C11.6327 11.3332 11.3342 11.6317 11.3342 11.9999C11.3342 12.3681 11.6327 12.6665 12.0009 12.6665H14.6675C15.0357 12.6665 15.3342 12.3681 15.3342 11.9999C15.3342 11.6317 15.0357 11.3332 14.6675 11.3332H12.0009Z",fill:"currentColor"}),D.createElement("path",{d:"M9.86659 14.1482L8.23444 10.1844H3.18136C3.13868 10.1844 3.09685 10.1808 3.05616 10.1738L1.66589 14.1129C1.53049 14.4965 1.10971 14.6978 0.726058 14.5624C0.342408 14.427 0.141166 14.0062 0.276572 13.6225L4.37566 2.00848C4.71323 1.05202 6.05321 1.01763 6.4394 1.95552L11.2289 13.5872C11.3838 13.9634 11.2044 14.394 10.8282 14.5489C10.452 14.7038 10.0215 14.5244 9.86659 14.1482ZM5.44412 3.40791L3.57241 8.71109H7.62778L5.44412 3.40791Z",fill:"currentColor"})),integer:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{d:"M15.132 11.4601C15.644 11.0121 15.9 10.3921 15.9 9.60007C15.9 8.60807 15.5 7.93607 14.7 7.58407C15.412 7.23207 15.768 6.62407 15.768 5.76007C15.768 5.05607 15.536 4.48007 15.072 4.03207C14.608 3.59207 14.012 3.37207 13.284 3.37207C12.588 3.37207 12.008 3.58007 11.544 3.99607C11.064 4.42007 10.808 4.98807 10.776 5.70007H12C12.064 4.88407 12.492 4.47607 13.284 4.47607C14.124 4.47607 14.544 4.91607 14.544 5.79607C14.544 6.66007 14.112 7.09207 13.248 7.09207H13.044V8.16007H13.248C14.2 8.16007 14.676 8.62807 14.676 9.56407C14.676 10.5081 14.212 10.9801 13.284 10.9801C12.9 10.9801 12.584 10.8761 12.336 10.6681C12.064 10.4441 11.916 10.1161 11.892 9.68407H10.668C10.692 10.4761 10.964 11.0841 11.484 11.5081C11.948 11.8921 12.548 12.0841 13.284 12.0841C14.036 12.0841 14.652 11.8761 15.132 11.4601Z",fill:"currentColor"}),D.createElement("path",{d:"M4.46875 12.0003V10.9083L7.75675 6.91228C8.06075 6.54428 8.21275 6.16428 8.21275 5.77228C8.21275 4.90828 7.79675 4.47628 6.96475 4.47628C6.60475 4.47628 6.31275 4.57628 6.08875 4.77628C5.83275 5.00828 5.70475 5.34828 5.70475 5.79628H4.48075C4.48075 5.07628 4.71275 4.49228 5.17675 4.04428C5.64075 3.60428 6.23675 3.38428 6.96475 3.38428C7.70075 3.38428 8.29675 3.60028 8.75275 4.03228C9.20875 4.47228 9.43675 5.05628 9.43675 5.78428C9.43675 6.13628 9.36875 6.45628 9.23275 6.74428C9.12075 6.97628 8.92075 7.27228 8.63275 7.63228L5.95675 10.9083H9.43675V12.0003H4.46875Z",fill:"currentColor"}),D.createElement("path",{d:"M1.668 12.0001V4.78805L0 6.25205V4.89605L1.668 3.45605H2.892V12.0001H1.668Z",fill:"currentColor"})),number:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{d:"M3.44151 5.3068C3.44151 3.83404 4.71542 2.64014 6.18818 2.64014C7.66094 2.64014 8.93484 3.83404 8.93484 5.3068V10.6135C8.93484 12.0862 7.66094 13.2801 6.18818 13.2801C4.71542 13.2801 3.44151 12.0862 3.44151 10.6135V5.3068ZM7.60151 5.3068C7.60151 4.57042 6.92456 3.97347 6.18818 3.97347C5.4518 3.97347 4.77484 4.57042 4.77484 5.3068V10.6135C4.77484 11.3498 5.4518 11.9468 6.18818 11.9468C6.92456 11.9468 7.60151 11.3498 7.60151 10.6135V5.3068Z",fill:"currentColor"}),D.createElement("path",{d:"M12.9882 2.64014C11.5154 2.64014 10.2415 3.83404 10.2415 5.3068V10.6135C10.2415 12.0862 11.5154 13.2801 12.9882 13.2801C14.4609 13.2801 15.7348 12.0862 15.7348 10.6135V5.3068C15.7348 3.83404 14.4609 2.64014 12.9882 2.64014ZM14.4015 10.6135C14.4015 11.3498 13.7246 11.9468 12.9882 11.9468C12.2518 11.9468 11.5748 11.3498 11.5748 10.6135V5.3068C11.5748 4.57042 12.2518 3.97347 12.9882 3.97347C13.7246 3.97347 14.4015 4.57042 14.4015 5.3068V10.6135Z",fill:"currentColor"}),D.createElement("path",{d:"M1.21484 13.2001C1.76713 13.2001 2.21484 12.7524 2.21484 12.2001C2.21484 11.6479 1.76713 11.2001 1.21484 11.2001C0.662559 11.2001 0.214844 11.6479 0.214844 12.2001C0.214844 12.7524 0.662559 13.2001 1.21484 13.2001Z",fill:"currentColor"})),array:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{d:"M5.23759 1.00342H2.00391V14.997H5.23759V13.6251H3.35127V2.37534H5.23759V1.00342Z",fill:"currentColor"}),D.createElement("path",{d:"M10.7624 1.00342H13.9961V14.997H10.7624V13.6251H12.6487V2.37534H10.7624V1.00342Z",fill:"currentColor"})),stream:D.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},D.createElement("path",{d:"M879.674 544.51l-158.254-0.221c-8.534 2.287-17.305-2.776-19.588-11.307l-23.862-75.877-74.742 350.891c0 0-1.523 18.507-11.518 18.507s-26.9 0.281-26.9 0.281c-8.259 2.213-16.748-2.687-18.961-10.949l-92.741-457.648-70.305 330.634c-2.261 8.291-11.94 15.206-20.385 12.986l-24.876 0.339c-8.723 2.293-17.685-2.789-20.023-11.349L270.629 544.51 143.993 544.51c-8.831 0-15.993-7.159-15.993-15.993l0-31.986c0-8.831 7.162-15.993 15.993-15.993l157.429-0.516c9.565-0.304 17.685 0.788 20.023 9.351l24.386 76.092 68.642-358.907c0 0 3.4-10.894 14.397-10.894 10.994 0 34.107-0.448 34.107-0.448 8.262-2.213 16.751 2.687 18.965 10.949l91.912 454.126 67.948-326.182c2.213-8.262 8.707-15.161 16.965-12.948l27.316-0.333c8.531-2.287 17.301 2.776 19.588 11.31l46.665 148.4 127.337 0c8.835 0 15.993 7.162 15.993 15.993l0 31.986C895.667 537.352 888.508 544.51 879.674 544.51z",fill:"currentColor"})),map:D.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},D.createElement("path",{d:"M877.860571 938.642286h-645.851428c-27.574857 0-54.052571-11.337143-73.508572-31.744a110.957714 110.957714 0 0 1-30.500571-76.8V193.828571c0-28.745143 10.971429-56.32 30.500571-76.726857a101.888 101.888 0 0 1 73.508572-31.817143h574.171428c27.501714 0 53.979429 11.337143 73.508572 31.744 19.529143 20.333714 30.500571 48.054857 30.500571 76.8v522.020572a34.157714 34.157714 0 0 1-6.948571 22.820571c-37.156571 19.382857-57.636571 39.350857-57.636572 72.630857 0 39.716571 19.894857 50.029714 57.636572 72.777143a34.816 34.816 0 0 1-8.045714 49.298286 32.256 32.256 0 0 1-17.334858 5.193143z m-32.256-254.537143V193.828571a40.228571 40.228571 0 0 0-39.497142-41.179428H232.009143a40.301714 40.301714 0 0 0-39.497143 41.252571V699.245714c17.773714-9.874286 37.449143-14.994286 57.417143-14.921143h595.675428v-0.073142z m-595.675428 187.245714h566.198857c-22.893714-11.190857-27.940571-39.497143-28.013714-59.977143 0-20.260571 3.218286-43.885714 28.013714-59.904h-566.125714c-31.670857 0-57.417143 26.843429-57.417143 59.977143 0 33.060571 25.746286 59.904 57.344 59.904z",fill:"currentColor"}),D.createElement("path",{d:"M320 128m32.036571 0l-0.073142 0q32.036571 0 32.036571 32.036571l0 511.926858q0 32.036571-32.036571 32.036571l0.073142 0q-32.036571 0-32.036571-32.036571l0-511.926858q0-32.036571 32.036571-32.036571Z",fill:"currentColor"}))},uT={object:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.58105H3.6139V2.87326H1.36702V13.1264H3.6139V14.4186H0V1.58105ZM3.41656 13.3264V13.3266H1.17155V13.3264H3.41656ZM0.197344 14.2186H0.199219V1.78125H3.41656V1.78105H0.197344V14.2186ZM12.3861 1.58105H16V14.4186H12.3861V13.1264H14.633V2.87326H12.3861V1.58105ZM12.5834 2.67326V1.78105H15.8027V1.78125H12.5853V2.67326H12.5834ZM12.5853 13.3266V14.2186H12.5834V13.3264H14.8303V2.67345H14.8322V13.3266H12.5853ZM3.82031 5.9091C3.82031 5.18535 4.40703 4.59863 5.13078 4.59863C5.85453 4.59863 6.44124 5.18535 6.44124 5.9091C6.44124 6.56485 5.9596 7.1081 5.33078 7.2044V8.70018H5.32877C5.32982 8.75093 5.33078 8.80912 5.33078 8.87034V9.72111C5.33078 10.0195 5.57268 10.2614 5.87109 10.2614H6.24124C6.55613 10.2614 6.8114 10.5167 6.8114 10.8316C6.8114 11.1465 6.55613 11.4017 6.24124 11.4017H5.87109C4.94291 11.4017 4.19047 10.6493 4.19047 9.72111V6.82186C3.96158 6.58607 3.82031 6.26397 3.82031 5.9091ZM7.33679 5.9091C7.33679 5.59421 7.59205 5.33894 7.90694 5.33894H11.6085C11.9234 5.33894 12.1786 5.59421 12.1786 5.9091C12.1786 6.22399 11.9234 6.47925 11.6085 6.47925H7.90694C7.59205 6.47925 7.33679 6.22399 7.33679 5.9091ZM7.33679 9.86846C7.33679 9.55357 7.59205 9.2983 7.90694 9.2983H11.6085C11.9234 9.2983 12.1786 9.55357 12.1786 9.86846C12.1786 10.1833 11.9234 10.4386 11.6085 10.4386H7.90694C7.59205 10.4386 7.33679 10.1833 7.33679 9.86846Z",fill:"currentColor"})),boolean:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.58105H3.6139V2.87326H1.36702V13.1264H3.6139V14.4186H0V1.58105ZM3.41656 13.3264V13.3266H1.17155V13.3264H3.41656ZM0.197344 14.2186H0.199219V1.78125H3.41656V1.78105H0.197344V14.2186ZM12.3861 1.58105H16V14.4186H12.3861V13.1264H14.633V2.87326H12.3861V1.58105ZM12.5834 2.67326V1.78105H15.8027V1.78125H12.5853V2.67326H12.5834ZM12.5853 13.3266V14.2186H12.5834V13.3264H14.8303V2.67345H14.8322V13.3266H12.5853ZM2.75 7.99993C2.75 6.14518 4.25358 4.6416 6.10833 4.6416H9.775C11.6298 4.6416 13.1333 6.14518 13.1333 7.99993C13.1333 9.85469 11.6298 11.3583 9.775 11.3583H6.10833C4.25358 11.3583 2.75 9.85469 2.75 7.99993ZM6.10833 5.85827C4.92552 5.85827 3.96667 6.81713 3.96667 7.99993C3.96667 9.18274 4.92552 10.1416 6.10833 10.1416H9.775C10.9578 10.1416 11.9167 9.18274 11.9167 7.99993C11.9167 6.81713 10.9578 5.85827 9.775 5.85827H6.10833ZM8.25 7.99993C8.25 7.1577 8.93277 6.47493 9.775 6.47493C10.6172 6.47493 11.3 7.1577 11.3 7.99993C11.3 8.84217 10.6172 9.52493 9.775 9.52493C8.93277 9.52493 8.25 8.84217 8.25 7.99993ZM9.775 7.6916C9.60471 7.6916 9.46667 7.82965 9.46667 7.99993C9.46667 8.17022 9.60471 8.30827 9.775 8.30827C9.94529 8.30827 10.0833 8.17022 10.0833 7.99993C10.0833 7.82965 9.94529 7.6916 9.775 7.6916Z",fill:"currentColor"})),string:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.58105H3.6139V2.87326H1.36702V13.1264H3.6139V14.4186H0V1.58105ZM3.41656 13.3264V13.3266H1.17155V13.3264H3.41656ZM0.197344 14.2186H0.199219V1.78125H3.41656V1.78105H0.197344V14.2186ZM12.3861 1.58105H16V14.4186H12.3861V13.1264H14.633V2.87326H12.3861V1.58105ZM12.5834 2.67326V1.78105H15.8027V1.78125H12.5853V2.67326H12.5834ZM12.5853 13.3266V14.2186H12.5834V13.3264H14.8303V2.67345H14.8322V13.3266H12.5853ZM5.23701 4.07158C5.50364 3.3161 6.56205 3.28894 6.86709 4.02974L10 11.6383C10.1329 11.9609 9.979 12.3302 9.65631 12.4631C9.33363 12.596 8.96434 12.4421 8.83147 12.1194L7.8021 9.61951H4.61903L3.7474 12.0891C3.63126 12.4182 3.27034 12.5908 2.94127 12.4747C2.6122 12.3585 2.43958 11.9976 2.55573 11.6685L5.23701 4.07158ZM6.08814 5.45704L5.06505 8.35579H7.28174L6.08814 5.45704ZM8.81938 6.07534C8.81938 5.75166 9.08177 5.48926 9.40545 5.48926H12.8941C13.2178 5.48926 13.4802 5.75166 13.4802 6.07534C13.4802 6.39902 13.2178 6.66142 12.8941 6.66142H9.40545C9.08177 6.66142 8.81938 6.39902 8.81938 6.07534ZM10.2668 9.69181C10.2668 9.36812 10.5292 9.10573 10.8529 9.10573H12.8941C13.2178 9.10573 13.4802 9.36812 13.4802 9.69181C13.4802 10.0155 13.2178 10.2779 12.8941 10.2779H10.8529C10.5292 10.2779 10.2668 10.0155 10.2668 9.69181Z",fill:"currentColor"})),integer:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.58105H3.6139V2.87326H1.36702V13.1264H3.6139V14.4186H0V1.58105ZM3.41656 13.3264V13.3266H1.17155V13.3264H3.41656ZM0.197344 14.2186H0.199219V1.78125H3.41656V1.78105H0.197344V14.2186ZM12.3861 1.58105H16V14.4186H12.3861V13.1264H14.633V2.87326H12.3861V1.58105ZM12.5834 2.67326V1.78105H15.8027V1.78125H12.5853V2.67326H12.5834ZM12.5853 13.3266V14.2186H12.5834V13.3264H14.8303V2.67345H14.8322V13.3266H12.5853ZM10.3614 5.22374C10.7161 4.90585 11.1581 4.75 11.6762 4.75C12.2173 4.75 12.6723 4.91467 13.0281 5.25207L13.0291 5.253C13.3852 5.59688 13.561 6.03946 13.561 6.56767C13.561 6.89 13.4945 7.17448 13.3539 7.41445C13.2572 7.57972 13.1279 7.71948 12.9685 7.83428C13.1575 7.95643 13.3099 8.11182 13.4225 8.30109C13.5793 8.5644 13.6531 8.88311 13.6531 9.24936C13.6531 9.83787 13.4612 10.3151 13.0656 10.6612C12.6982 10.9795 12.2305 11.1341 11.6762 11.1341C11.1356 11.1341 10.6805 10.9925 10.324 10.6977C9.92124 10.3691 9.71723 9.90026 9.69942 9.31256L9.69473 9.15802H10.846L10.8539 9.2997C10.8689 9.5698 10.9591 9.75553 11.1096 9.87941L11.1106 9.88027C11.2519 9.99882 11.4365 10.0631 11.6762 10.0631C11.9765 10.0631 12.1743 9.98692 12.2984 9.86071C12.4229 9.73404 12.4984 9.53136 12.4984 9.22422C12.4984 8.92116 12.4215 8.72127 12.2939 8.59581C12.1658 8.46989 11.961 8.39373 11.6511 8.39373H11.3586V7.34788H11.6511C11.9297 7.34788 12.111 7.27834 12.2238 7.16555C12.3366 7.05276 12.4062 6.87138 12.4062 6.59281C12.4062 6.30696 12.3378 6.12041 12.2277 6.00501C12.1188 5.89092 11.9446 5.82098 11.6762 5.82098C11.4248 5.82098 11.2539 5.88537 11.1407 5.99325C11.0268 6.10185 10.9497 6.27522 10.9291 6.5375L10.9183 6.67577H9.76788L9.77492 6.51904C9.79886 5.98644 9.99237 5.54989 10.3614 5.22374ZM5.91032 5.26037C6.26612 4.92297 6.72112 4.7583 7.26219 4.7583C7.80751 4.7583 8.26297 4.91938 8.61401 5.25194L8.61501 5.25289C8.96719 5.59272 9.13852 6.04185 9.13852 6.58435C9.13852 6.84997 9.08709 7.09565 8.9817 7.31883L8.98114 7.31999C8.89563 7.49712 8.74775 7.71415 8.54418 7.96862L8.54322 7.96981L6.87446 10.0127H9.13852V11.0753H5.36909V10.1089L7.69946 7.27679C7.89456 7.04062 7.98374 6.80773 7.98374 6.57597C7.98374 6.29602 7.91626 6.11385 7.8078 6.00122C7.70036 5.88964 7.52811 5.8209 7.26219 5.8209C7.04017 5.8209 6.87439 5.88173 6.75075 5.99193C6.61227 6.11766 6.53226 6.30918 6.53226 6.59273V6.74273H5.37747V6.59273C5.37747 6.05443 5.55248 5.60586 5.90934 5.2613L5.91032 5.26037ZM3.50907 4.80865H4.56964V11.0754H3.41486V6.2201L2.25 7.24249V5.89561L3.50907 4.80865Z",fill:"currentColor"})),number:D.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.6139 1.58154H0V14.4191H3.6139V13.1269H1.36702V2.87375H3.6139V1.58154ZM3.41656 13.3271V13.3269H1.17155V13.3271H3.41656ZM0.199219 14.2191H0.197344V1.78154H3.41656V1.78174H0.199219V14.2191ZM16 1.58154H12.3861V2.87375H14.633V13.1269H12.3861V14.4191H16V1.58154ZM12.5834 1.78154V2.67375H12.5853V1.78174H15.8027V1.78154H12.5834ZM12.5853 14.2191V13.3271H14.8322V2.67394H14.8303V13.3269H12.5834V14.2191H12.5853ZM6.86771 4.5C5.87019 4.5 5.00104 5.30767 5.00104 6.31667V9.63333C5.00104 10.6423 5.87019 11.45 6.86771 11.45C7.86523 11.45 8.73438 10.6423 8.73438 9.63333V6.31667C8.73438 5.30767 7.86523 4.5 6.86771 4.5ZM11.1177 4.5C10.1202 4.5 9.25104 5.30767 9.25104 6.31667V9.63333C9.25104 10.6423 10.1202 11.45 11.1177 11.45C12.1152 11.45 12.9844 10.6423 12.9844 9.63333V6.31667C12.9844 5.30767 12.1152 4.5 11.1177 4.5ZM6.13438 6.31667C6.13438 5.9503 6.47884 5.63333 6.86771 5.63333C7.25657 5.63333 7.60104 5.9503 7.60104 6.31667V9.63333C7.60104 9.9997 7.25657 10.3167 6.86771 10.3167C6.47884 10.3167 6.13438 9.9997 6.13438 9.63333V6.31667ZM10.3844 6.31667C10.3844 5.9503 10.7288 5.63333 11.1177 5.63333C11.5066 5.63333 11.851 5.9503 11.851 6.31667V9.63333C11.851 9.9997 11.5066 10.3167 11.1177 10.3167C10.7288 10.3167 10.3844 9.9997 10.3844 9.63333V6.31667ZM3.75938 9.85C3.33135 9.85 2.98438 10.197 2.98438 10.625C2.98438 11.053 3.33135 11.4 3.75938 11.4C4.1874 11.4 4.53438 11.053 4.53438 10.625C4.53438 10.197 4.1874 9.85 3.75938 9.85Z",fill:"currentColor"}))},Eu=e=>{var n;return(e==null?void 0:e.type)==="array"?uT[((n=e.items)==null?void 0:n.type)||"object"]:vh[(e==null?void 0:e.type)||"object"]},fh={display:"flex",alignItems:"center",gap:5},ph=e=>e.charAt(0).toUpperCase()+e.slice(1),$k=[{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"string"})}),ph("string")),value:"string"},{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"integer"})}),ph("integer")),value:"integer"},{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"number"})}),ph("number")),value:"number"},{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"boolean"})}),ph("boolean")),value:"boolean"},{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"object"})}),ph("object")),value:"object"}],yfe=[...$k,{label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"array"})}),ph("array")),value:"array",children:$k.map(e=>({...e,value:`${e.value}`,label:D.createElement("div",{style:fh},D.createElement(Us,{size:"small",svg:Eu({type:"array",items:{type:e.value}})}),ph(e.value))}))}];function mfe(){const e=GG(),n=R.useCallback(i=>{var o,a;if(i.meta.icon)return typeof i.meta.icon=="string"?D.createElement("img",{style:{marginRight:8},width:12,height:12,src:i.meta.icon}):i.meta.icon;const s=i.type;return qm.isArray(s)?D.createElement(Us,{size:"small",svg:uT[(o=s.items)==null?void 0:o.kind.toLowerCase()]||vh.array}):qm.isCustomType(s)?D.createElement(Us,{size:"small",svg:vh[s.typeName.toLowerCase()]}):D.createElement(Us,{size:"small",svg:vh[(a=i.type)==null?void 0:a.kind.toLowerCase()]})},[]),r=(i,s=[])=>{let o=i==null?void 0:i.type,a;if(qm.isObject(o)&&(a=(o.properties||[]).map(u=>r(u,[...s,i])).filter(Boolean),!(a!=null&&a.length)))return null;const l=[...s.map(u=>u.key),i.key].join(".");return{key:l,label:i.meta.title||i.key,value:l,icon:n(i),children:a}};return[...e.variables.slice(0).reverse()].map(i=>r(i)).filter(Boolean)}var i$=({value:e,onChange:n,style:r,readonly:i=!1,hasError:s})=>{const o=mfe();return D.createElement(D.Fragment,null,D.createElement(C_,{dropdownMatchSelectWidth:!1,disabled:i,treeData:o,size:"small",value:e,style:{...r,outline:s?"1px solid red":void 0},validateStatus:s?"error":void 0,onChange:a=>{n(a)},showClear:!0,placeholder:"Select Variable..."}))},s$=e=>(e==null?void 0:e.type)==="array"&&(e!=null&&e.items)?[e.type,...s$(e.items)||[]]:e!=null&&e.type?[e.type]:void 0,o$=e=>{const[n,...r]=e||[];return n==="array"?{type:"array",items:o$(r)}:{type:n}};function vfe(e){const{value:n,onChange:r}=e,i=R.useMemo(()=>s$(n),[n]);return D.createElement(ug,{size:"small",triggerRender:()=>D.createElement(Cr,{size:"small",style:{width:50}},Eu(n)),treeData:yfe,value:i,leafOnly:!0,onChange:s=>{r(o$(s))}})}var bfe=xt.div`
|
||
/* & .semi-input {
|
||
background-color: #fff;
|
||
border-radius: 6px;
|
||
height: 24px;
|
||
} */
|
||
`,wfe=xt.div`
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
`,_fe=xt.div`
|
||
cursor: pointer;
|
||
margin-right: 5px;
|
||
`,Cfe=xt.div`
|
||
display: flex;
|
||
flex-direction: column;
|
||
`,Efe=xt.div`
|
||
font-size: 12px;
|
||
color: #999;
|
||
font-weight: 400;
|
||
margin-bottom: 2px;
|
||
`,a$=xt.div`
|
||
display: grid;
|
||
grid-template-columns: auto 1fr;
|
||
|
||
${({$shrink:e})=>e&&Yv`
|
||
padding-left: 10px;
|
||
margin-top: 10px;
|
||
`}
|
||
`,xfe=xt.div`
|
||
grid-column: 1;
|
||
position: relative;
|
||
|
||
${({$showLine:e,$isLast:n})=>e&&Yv`
|
||
&::before {
|
||
/* 竖线 */
|
||
content: '';
|
||
position: absolute;
|
||
left: -22px;
|
||
top: -18px;
|
||
bottom: ${n?"12px":"0px"};
|
||
width: 1px;
|
||
background: #d9d9d9;
|
||
display: block;
|
||
}
|
||
|
||
&::after {
|
||
/* 横线 */
|
||
content: '';
|
||
position: absolute;
|
||
left: -22px; // 横线起点和竖线对齐
|
||
top: 12px; // 跟随你的行高调整
|
||
width: 22px; // 横线长度
|
||
height: 1px;
|
||
background: #d9d9d9;
|
||
display: block;
|
||
}
|
||
`}
|
||
`,Sfe=xt.div`
|
||
grid-column: 2;
|
||
margin-bottom: 10px;
|
||
|
||
&:last-child {
|
||
margin-bottom: 0px;
|
||
}
|
||
`,Dfe=xt.div`
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
|
||
${({$expand:e})=>e&&Yv`
|
||
background-color: #f5f5f5;
|
||
padding: 10px;
|
||
border-radius: 4px;
|
||
`}
|
||
`,Nfe=xt.div`
|
||
display: none;
|
||
|
||
${({$collapse:e})=>e&&Yv`
|
||
display: block;
|
||
`}
|
||
`,Ife=xt.div`
|
||
flex-grow: 1;
|
||
`,Ofe=xt.div``,Tfe=xt.div``,Mfe=xt.div`
|
||
white-space: nowrap;
|
||
`,Pfe=D.createElement("svg",{className:"icon-icon icon-icon-coz_add_node ",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},D.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 6.49988C11 8.64148 9.50397 10.4337 7.49995 10.8884V15.4998C7.49995 16.0521 7.94767 16.4998 8.49995 16.4998H11.208C11.0742 16.8061 11 17.1443 11 17.4998C11 17.8554 11.0742 18.1936 11.208 18.4998H8.49995C6.8431 18.4998 5.49995 17.1567 5.49995 15.4998V10.8884C3.49599 10.4336 2 8.64145 2 6.49988C2 4.0146 4.01472 1.99988 6.5 1.99988C8.98528 1.99988 11 4.0146 11 6.49988ZM6.5 8.99988C7.88071 8.99988 9 7.88059 9 6.49988C9 5.11917 7.88071 3.99988 6.5 3.99988C5.11929 3.99988 4 5.11917 4 6.49988C4 7.88059 5.11929 8.99988 6.5 8.99988Z"}),D.createElement("path",{d:"M17.5 12.4999C18.0523 12.4999 18.5 12.9476 18.5 13.4999V16.4999H21.5C22.0523 16.4999 22.5 16.9476 22.5 17.4999C22.5 18.0522 22.0523 18.4999 21.5 18.4999H18.5V21.4999C18.5 22.0522 18.0523 22.4999 17.5 22.4999C16.9477 22.4999 16.5 22.0522 16.5 21.4999V18.4999H13.5C12.9477 18.4999 12.5 18.0522 12.5 17.4999C12.5 16.9476 12.9477 16.4999 13.5 16.4999H16.5V13.4999C16.5 12.9476 16.9477 12.4999 17.5 12.4999Z"})),Afe=()=>D.createElement(Us,{size:"small",svg:Pfe}),Rfe=0;function zk(){return Rfe++}function l$(e,n){return e?e.type==="array"&&e.items?l$(e.items,[...n||[],"items"]):{schema:e,path:n}:{}}function c$(e,n){var g;const r=R.useMemo(()=>l$(e),[e==null?void 0:e.type,e==null?void 0:e.items]),i=((g=r.schema)==null?void 0:g.type)==="object",s=R.useMemo(()=>{var v;return i?Object.entries(((v=r.schema)==null?void 0:v.properties)||{}).map(([w,S])=>{var E;return{key:zk(),name:w,isPropertyRequired:((E=e==null?void 0:e.required)==null?void 0:E.includes(w))||!1,...S}}):[]},[i]),[o,a]=R.useState(s),l=v=>{a(w=>{const S=v(w),E={},x=[];for(const P of S)P.name&&(E[P.name]=P,P.isPropertyRequired&&x.push(P.name));let I=e||{};return r.path&&(I=r.path.reduce((P,M)=>P[M],e||{})),I.properties=E,I.required=x,n==null||n(e||{}),S})},u=()=>{l(v=>[...v,{key:zk(),name:"",type:"string"}])},h=v=>{l(w=>w.filter(S=>S.key!==v))},p=(v,w)=>{l(S=>S.map(E=>E.key===v?w:E))};return R.useEffect(()=>{i||a([])},[i]),{propertyList:o,isDrilldownObject:i,onAddProperty:u,onRemoveProperty:h,onEditProperty:p}}function kfe(e){const{value:n={type:"object"},onChange:r}=e,{propertyList:i,onAddProperty:s,onRemoveProperty:o,onEditProperty:a}=c$(n,r);return D.createElement(bfe,null,D.createElement(a$,null,i.map(l=>D.createElement(u$,{key:l.key,value:l,onChange:u=>{a(l.key,u)},onRemove:()=>{o(l.key)}}))),D.createElement(Cr,{size:"small",style:{marginTop:10},icon:D.createElement(r_,null),onClick:s},"Add"))}function u$(e){const{value:n,onChange:r,onRemove:i,$isLast:s,$showLine:o}=e;console.log("isLast",s);const[a,l]=R.useState(!1),[u,h]=R.useState(!1),{name:p,type:g,items:v,description:w,isPropertyRequired:S}=n||{},E=R.useMemo(()=>({type:g,items:v}),[g,v]),{propertyList:x,isDrilldownObject:I,onAddProperty:P,onRemoveProperty:M,onEditProperty:k}=c$(n,r),A=(V,$)=>{r==null||r({...n||{},[V]:$})},j=I&&x.length>0;return D.createElement(D.Fragment,null,D.createElement(xfe,{$isLast:s,$showLine:o},j&&D.createElement(_fe,{onClick:()=>h(V=>!V)},u?D.createElement(IO,{size:"small"}):D.createElement(Wj,{size:"small"}))),D.createElement(Sfe,null,D.createElement(Dfe,{$expand:a},D.createElement(wfe,null,D.createElement(Ife,null,D.createElement(vc,{placeholder:"Input Variable Name",size:"small",value:p,onChange:V=>A("name",V)})),D.createElement(Ofe,null,D.createElement(vfe,{value:E,onChange:V=>{r==null||r({...n||{},...V})}})),D.createElement(Tfe,null,D.createElement(hw,{checked:S,onChange:V=>A("isPropertyRequired",V.target.checked)})),D.createElement(Mfe,null,D.createElement(Lr,{size:"small",theme:"borderless",icon:a?D.createElement(Zj,{size:"small"}):D.createElement(TO,{size:"small"}),onClick:()=>l(V=>!V)}),I&&D.createElement(Lr,{size:"small",theme:"borderless",icon:D.createElement(Afe,null),onClick:()=>{P(),h(!0)}}),D.createElement(Lr,{size:"small",theme:"borderless",icon:D.createElement(Jae,{size:"small"}),onClick:i}))),a&&D.createElement(Cfe,null,D.createElement(Efe,null,"Description"),D.createElement(vc,{size:"small",value:w,onChange:V=>A("description",V),placeholder:"Help LLM to understand the property"}))),j&&D.createElement(Nfe,{$collapse:u},D.createElement(a$,{$shrink:!0},x.map((V,$)=>D.createElement(u$,{key:V.key,value:V,onChange:W=>{k(V.key,W)},onRemove:()=>{M(V.key)},$isLast:$===x.length-1,$showLine:!0}))))))}var Lfe=Object.defineProperty,jfe=Object.getOwnPropertyDescriptor,Rg=(e,n,r,i)=>{for(var s=i>1?void 0:i?jfe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&Lfe(n,r,s),s},d$={canvasWidth:250,canvasHeight:250,canvasPadding:50,canvasBackground:"rgba(242, 243, 245, 1)",canvasBorderRadius:10,viewportBackground:"rgba(255, 255, 255, 1)",viewportBorderRadius:4,viewportBorderColor:"rgba(6, 7, 9, 0.10)",viewportBorderWidth:1,viewportBorderDashLength:void 0,nodeColor:"rgba(0, 0, 0, 0.10)",nodeBorderRadius:2,nodeBorderWidth:.145,nodeBorderColor:"rgba(6, 7, 9, 0.10)",overlayColor:"rgba(255, 255, 255, 0.55)"},Ffe={scale:.7,opacity:1,translateX:15,translateY:15},$fe={canvasStyle:d$,canvasClassName:"gedit-minimap-canvas",enableActiveDebounce:!1,enableInactiveDebounce:!0,enableDisplayAllNodes:!1,activeDebounceTime:0,inactiveDebounceTime:5},h$=e=>{const{service:n,panelStyles:r={},containerStyles:i={},inactiveStyle:s={}}=e,o={...Ffe,...s},a=R.useRef(null),[l,u]=R.useState(!1);R.useEffect(()=>{const w=a.current;w&&n.canvas&&w.appendChild(n.canvas);const S=n.onActive(E=>{u(E)});return()=>{S.dispose()}},[]);const h=l?1:o.scale,p=l?1:o.opacity,g=l?0:o.translateX,v=l?0:o.translateY;return D.createElement("div",{className:"minimap-container",style:{position:"fixed",right:30,bottom:70,transition:"all 0.3s ease",transform:`scale(${h}) translate(${g}px, ${v}px)`,opacity:p,transformOrigin:"bottom right",...i}},D.createElement("div",{className:"minimap-panel",style:{display:"flex",width:"100%",height:"100%",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 1)",border:"0.572px solid rgba(6, 7, 9, 0.10)",overflow:"hidden",boxShadow:"0px 2.289px 6.867px 0px rgba(0, 0, 0, 0.08), 0px 4.578px 13.733px 0px rgba(0, 0, 0, 0.04)",boxSizing:"border-box",padding:8,...r},"data-flow-editor-selectable":"false",ref:a,onMouseEnter:()=>{n.setActivate(!0)},onMouseLeave:()=>{n.setActivate(!1)}}))},_u;(e=>{const n=r=>r.width>0&&r.height>0;e.clear=r=>{const{canvas:i,context:s}=r;s.clearRect(0,0,i.width,i.height)},e.backgroundColor=r=>{const{canvas:i,context:s,color:o}=r;s.fillStyle=o,s.fillRect(0,0,i.width,i.height)},e.rectangle=r=>{const{context:i,rect:s,color:o}=r;n(s)&&(i.fillStyle=o,i.fillRect(s.x,s.y,s.width,s.height))},e.roundRectangle=r=>{const{context:i,rect:s,color:o,radius:a,borderColor:l,borderDashLength:u,borderWidth:h=0}=r,{x:p,y:g,width:v,height:w}=s;if(!n(s))return;i.beginPath(),(()=>{i.moveTo(p+a,g),i.lineTo(p+v-a,g),i.quadraticCurveTo(p+v,g,p+v,g+a),i.lineTo(p+v,g+w-a),i.quadraticCurveTo(p+v,g+w,p+v-a,g+w),i.lineTo(p+a,g+w),i.quadraticCurveTo(p,g+w,p,g+w-a),i.lineTo(p,g+a),i.quadraticCurveTo(p,g,p+a,g),i.closePath()})(),i.fillStyle=o,i.fill(),l&&h>0&&(i.strokeStyle=l,i.lineWidth=h,u?i.setLineDash([u,u]):i.setLineDash([]),i.stroke(),i.setLineDash([]))},e.overlay=r=>{const{canvas:i,context:s,offset:o,scale:a,rect:l,color:u}=r;n(l)&&(s.fillStyle=u,s.fillRect(0,0,i.width,(l.y+o.y)*a),s.fillRect(0,(l.y+l.height+o.y)*a,i.width,i.height-(l.y+l.height+o.y)*a),s.fillRect(0,(l.y+o.y)*a,(l.x+o.x)*a,l.height*a),s.fillRect((l.x+l.width+o.x)*a,(l.y+o.y)*a,i.width-(l.x+l.width+o.x)*a,l.height*a))}})(_u||(_u={}));var rl=class{constructor(){this.onActive=e=>(this.onActiveCallbacks.add(e),{dispose:()=>{this.onActiveCallbacks.delete(e)}}),this.render=this._render,this.handleWheel=e=>{},this.handleStartDrag=e=>{e.preventDefault(),e.stopPropagation();const n=this.createRenderContext(),{viewRect:r,scale:i,offset:s}=n,o=this.canvas.getBoundingClientRect(),a={x:e.clientX-o.left,y:e.clientY-o.top},l=this.rectOnCanvas({rect:r,scale:i,offset:s});this.isPointInRect({point:a,rect:l})&&(this.isDragging=!0,this.dragStart=a,document.addEventListener("mousemove",this.handleDragging),document.addEventListener("mouseup",this.handleEndDrag))},this.handleDragging=e=>{if(!this.isDragging||!this.dragStart)return;e.preventDefault(),e.stopPropagation();const n=this.createRenderContext(),{scale:r}=n,i=this.canvas.getBoundingClientRect(),s=e.clientX-i.left,o=e.clientY-i.top,a=(s-this.dragStart.x)/r,l=(o-this.dragStart.y)/r;this.updateScrollPosition(a,l),this.dragStart={x:s,y:o},this.render()},this.handleEndDrag=e=>{e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",this.handleDragging),document.removeEventListener("mouseup",this.handleEndDrag),this.isDragging=!1,this.dragStart=void 0,this.setActivate(this.isMouseInCanvas(e))},this.handleCursor=e=>{if(!this.activated)return;const n=this.createRenderContext(),{viewRect:r,scale:i,offset:s}=n,o=this.canvas.getBoundingClientRect(),a={x:e.clientX-o.left,y:e.clientY-o.top},l=this.rectOnCanvas({rect:r,scale:i,offset:s});this.isPointInRect({point:a,rect:l})?this.canvas.style.cursor="grab":this.canvas.style.cursor="default"},this.canvas=document.createElement("canvas"),this.context2D=this.canvas.getContext("2d"),this.initialized=!!this.context2D,this.onActiveCallbacks=new Set,this.toDispose=new jt,this.render=this._render,this.activated=!1,this.isDragging=!1}init(e){this.options=$fe,Object.assign(this.options,e),this.setDebounce({enableDebounce:this.options.enableInactiveDebounce,debounceTime:this.options.inactiveDebounceTime}),this.initStyle(),this.mountListener()}dispose(){this.toDispose.dispose(),this.initialized=!1,this.activated=!1,this.removeEventListeners()}setActivate(e){e!==this.activated&&(!e&&this.isDragging||(this.activated=e,e?(this.setDebounce({enableDebounce:this.options.enableActiveDebounce,debounceTime:this.options.activeDebounceTime}),this.addEventListeners()):(this.setDebounce({enableDebounce:this.options.enableInactiveDebounce,debounceTime:this.options.inactiveDebounceTime}),this.removeEventListeners()),this.render(),this.onActiveCallbacks.forEach(n=>n(e))))}initStyle(){if(!this.initialized)return;const{canvasClassName:e,canvasStyle:n}=this.options;this.canvas.className=e,this.style={...d$,...n},this.canvas.width=this.style.canvasWidth,this.canvas.height=this.style.canvasHeight,this.canvas.style.borderRadius=this.style.canvasBorderRadius?`${this.style.canvasBorderRadius}px`:"unset"}setDebounce(e){const{enableDebounce:n,debounceTime:r}=e;n?this.render=je.debounce(this._render,r):this.render=this._render}_render(){if(!this.initialized)return;const e=this.createRenderContext();this.renderCanvas(e)}createRenderContext(){const{canvas:e,context2D:n,nodes:r}=this,s=this.nodeTransforms(r).map(p=>p.bounds),o=this.viewRect(),a=this.renderRect(s).withPadding({top:this.style.canvasPadding,bottom:this.style.canvasPadding,left:this.style.canvasPadding,right:this.style.canvasPadding}),l=Qe.enlarge([o,a]),{scale:u,offset:h}=this.calculateScaleAndOffset({canvasRect:l});return{canvas:e,context2D:n,nodeRects:s,canvasRect:l,viewRect:o,renderRect:a,scale:u,offset:h}}renderCanvas(e){const{canvas:n,context2D:r,nodeRects:i,viewRect:s,scale:o,offset:a}=e;_u.clear({canvas:n,context:r}),_u.backgroundColor({canvas:n,context:r,color:this.style.canvasBackground}),_u.roundRectangle({context:r,rect:this.rectOnCanvas({rect:s,scale:o,offset:a}),color:this.style.viewportBackground,radius:this.style.viewportBorderRadius}),i.forEach(l=>{_u.roundRectangle({context:r,rect:this.rectOnCanvas({rect:l,scale:o,offset:a}),color:this.style.nodeColor,radius:this.style.nodeBorderRadius,borderWidth:this.style.nodeBorderWidth,borderColor:this.style.nodeBorderColor})}),_u.roundRectangle({context:r,rect:this.rectOnCanvas({rect:s,scale:o,offset:a}),color:"rgba(255, 255, 255, 0)",radius:this.style.viewportBorderRadius,borderColor:this.style.viewportBorderColor,borderWidth:this.style.viewportBorderWidth,borderDashLength:this.style.viewportBorderDashLength}),_u.overlay({canvas:n,context:r,offset:a,scale:o,rect:s,color:this.style.overlayColor})}calculateScaleAndOffset(e){const{canvasRect:n}=e,{width:r,height:i}=this.canvas,s=r/n.width,o=i/n.height,a=Math.min(s,o),l=n.width*a,u=n.height*a,h=(r-l)/2,p=(i-u)/2,g={x:h/a-n.x,y:p/a-n.y};return{scale:a,offset:g}}get nodes(){return this.document.getAllNodes().filter(e=>{if(e.hidden)return!1;if(e.flowNodeType!==In.ROOT&&!(!this.options.enableDisplayAllNodes&&e.parent&&e.parent.flowNodeType!==In.ROOT))return!0})}nodeTransforms(e){return e.map(n=>n.getData(at)).filter(Boolean)}renderRect(e){return Qe.enlarge(e)}viewRect(){const{width:e,height:n,scrollX:r,scrollY:i,zoom:s}=this.playgroundConfig.config;return new Qe(r/s,i/s,e/s,n/s)}mountListener(){const e=this.entityManager.onEntityChange(()=>this.render());this.toDispose.push(e)}rectOnCanvas(e){const{rect:n,scale:r,offset:i}=e;return new Qe((n.x+i.x)*r,(n.y+i.y)*r,n.width*r,n.height*r)}isPointInRect(e){const{point:n,rect:r}=e;return n.x>=r.x&&n.x<=r.x+r.width&&n.y>=r.y&&n.y<=r.y+r.height}addEventListeners(){this.canvas.addEventListener("wheel",this.handleWheel),this.canvas.addEventListener("mousedown",this.handleStartDrag),this.canvas.addEventListener("mousemove",this.handleCursor)}removeEventListeners(){this.canvas.removeEventListener("wheel",this.handleWheel),this.canvas.removeEventListener("mousedown",this.handleStartDrag),this.canvas.removeEventListener("mousemove",this.handleCursor)}isMouseInCanvas(e){const n=this.canvas.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom}updateScrollPosition(e,n){const{scrollX:r,scrollY:i,zoom:s}=this.playgroundConfig.config;this.playgroundConfig.updateConfig({scrollX:r+e*s,scrollY:i+n*s})}};Rg([oe(On)],rl.prototype,"document",2);Rg([oe(Sn)],rl.prototype,"entityManager",2);Rg([oe(qn)],rl.prototype,"playgroundConfig",2);rl=Rg([$e()],rl);var Iv=class extends er{constructor(){super(),this.className="gedit-minimap-layer gedit-playground-layer",this.node=ft.createDivWithClass(this.className),this.node.style.zIndex="9999"}render(){return this.options.disableLayer?D.createElement(D.Fragment,null):D.createElement(h$,{service:this.service,panelStyles:this.options.panelStyles,containerStyles:this.options.containerStyles,inactiveStyle:this.options.inactiveStyle})}};Iv.type="FlowMinimapLayer";Rg([oe(rl)],Iv.prototype,"service",2);Iv=Rg([$e()],Iv);var zfe=Gn({onBind:({bind:e})=>{e(rl).toSelf().inSingletonScope()},onInit:(e,n)=>{e.playground.registerLayer(Iv,n),e.get(rl).init(n)},onDispose:e=>{e.get(rl).dispose()}}),Vfe=Object.defineProperty,Bfe=Object.getOwnPropertyDescriptor,ld=(e,n,r,i)=>{for(var s=i>1?void 0:i?Bfe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&Vfe(n,r,s),s},f$={enableEdgeSnapping:!0,edgeThreshold:7,enableGridSnapping:!1,gridSize:20,enableMultiSnapping:!1,enableOnlyViewportSnapping:!0,edgeColor:"#4E40E5",alignColor:"#4E40E5",edgeLineWidth:2,alignLineWidth:2,alignCrossWidth:16},dT=1e-5,Do=(e,n)=>e===void 0||n===void 0?!1:Math.abs(e-n)<dT,xb=(e,n)=>e===void 0||n===void 0?!1:n-e>dT,zm=(e,n)=>e===void 0||n===void 0?!1:e-n>dT,Jo=(e,n)=>Do(e,n)||xb(e,n),Lp=e=>typeof e=="number"&&!isNaN(e),il=class{constructor(){this.disposers=[],this.snapEmitter=new qe,this.onSnap=this.snapEmitter.event,this._disabled=!1}init(e={}){this.options={...f$,...e},this.mountListener()}dispose(){this.disposers.forEach(e=>e.dispose())}get disabled(){return this._disabled}disable(){this._disabled||(this._disabled=!0,this.clear())}enable(){this._disabled&&(this._disabled=!1,this.clear())}mountListener(){const e=this.dragService.registerPosAdjuster(r=>{const{selectedNodes:i,position:s}=r,o=this.options.enableMultiSnapping?!1:i.length!==1;return this._disabled||!this.options.enableEdgeSnapping||o?{x:0,y:0}:this.snapping({targetNodes:i,position:s})}),n=this.dragService.onNodesDrag(r=>{r.type!=="onDragEnd"||this._disabled||(this.options.enableGridSnapping&&this.gridSnapping({targetNodes:r.nodes,gridSize:this.options.gridSize}),this.options.enableEdgeSnapping&&this.clear())});this.disposers.push(e,n)}snapping(e){const{targetNodes:n,position:r}=e,i=this.getBounds(n),s=new Qe(r.x,r.y,i.width,i.height),o=this.getSnapNodeRects({targetNodes:n,targetRect:s}),{alignOffset:a,alignRects:l,alignSpacing:u}=this.calcAlignOffset({targetRect:s,alignThreshold:this.options.edgeThreshold,snapNodeRects:o}),{snapOffset:h,snapEdgeLines:p}=this.calcSnapOffset({targetRect:s,edgeThreshold:this.options.edgeThreshold,snapNodeRects:o}),g={x:h.x||a.x,y:h.y||a.y},v=new Qe(r.x+g.x,r.y+g.y,s.width,s.height);return this.snapEmitter.fire({snapRect:v,snapEdgeLines:p,alignRects:l,alignSpacing:u}),g}calcSnapOffset(e){const{snapNodeRects:n,edgeThreshold:r,targetRect:i}=e,s=this.getSnapLines({snapNodeRects:n}),o=s.horizontal.find(k=>Jo(Math.abs(k.y-i.top),r)),a=s.horizontal.find(k=>Jo(Math.abs(k.y-i.bottom),r)),l=s.vertical.find(k=>Jo(Math.abs(k.x-i.left),r)),u=s.vertical.find(k=>Jo(Math.abs(k.x-i.right),r)),h=s.midHorizontal.find(k=>Jo(Math.abs(k.y-i.center.y),r)),p=s.midVertical.find(k=>Jo(Math.abs(k.x-i.center.x),r)),g=o==null?void 0:o.y,v=Lp(a==null?void 0:a.y)?a.y-i.height:void 0,w=l==null?void 0:l.x,S=Lp(u==null?void 0:u.x)?u.x-i.width:void 0,E=Lp(h==null?void 0:h.y)?h.y-i.height/2:void 0,x=Lp(p==null?void 0:p.x)?p.x-i.width/2:void 0,I={x:x??w??S??i.x,y:E??g??v??i.y},P={x:I.x-i.x,y:I.y-i.y},M={top:Do(g,I.y)?o:void 0,bottom:Do(v,I.y)?a:void 0,left:Do(w,I.x)?l:void 0,right:Do(S,I.x)?u:void 0,midVertical:Do(x,I.x)?p:void 0,midHorizontal:Do(E,I.y)?h:void 0};return{snapOffset:P,snapEdgeLines:M}}gridSnapping(e){const{gridSize:n,targetNodes:r}=e,i=this.getBounds(r),s=l=>Math.round(l/n)*n,o={x:s(i.x),y:s(i.y)},a={x:o.x-i.x,y:o.y-i.y};r.forEach(l=>this.updateNodePositionWithOffset({node:l,offset:a}))}clear(){this.snapEmitter.fire({snapEdgeLines:{},snapRect:Qe.EMPTY,alignRects:{top:[],bottom:[],left:[],right:[]},alignSpacing:{}})}getSnapLines(e){const{snapNodeRects:n}=e,r=[],i=[],s=[],o=[];return n.forEach(a=>{const l=a.rect,u=l.center,h={y:l.top,sourceNodeId:a.id},p={y:l.bottom,sourceNodeId:a.id},g={x:l.left,sourceNodeId:a.id},v={x:l.right,sourceNodeId:a.id},w={y:u.y,sourceNodeId:a.id},S={x:u.x,sourceNodeId:a.id};r.push(h,p),i.push(g,v),s.push(w),o.push(S)}),{horizontal:r,vertical:i,midHorizontal:s,midVertical:o}}getAvailableNodes(e){var l;const{targetNodes:n,targetRect:r}=e,i=r.center,s=((l=n[0].parent)==null?void 0:l.id)??this.document.root.id,o=n.map(u=>u.id);return o.push(In.ROOT),this.nodes.filter(u=>{var h;return((h=u.parent)==null?void 0:h.id)===s}).filter(u=>!o.includes(u.id)).sort((u,h)=>{const p=u.getData(at).bounds.center,g=h.getData(at).bounds.center,v=Math.abs(p.x-i.x)+Math.abs(p.y-i.y),w=Math.abs(g.x-i.x)+Math.abs(g.y-i.y);return v-w})}viewRect(){const{width:e,height:n,scrollX:r,scrollY:i,zoom:s}=this.playgroundConfig.config;return new Qe(r/s,i/s,e/s,n/s)}getSnapNodeRects(e){const n=this.getAvailableNodes(e),r=this.viewRect();return n.map(i=>{var o;const s={id:i.id,rect:i.getData(at).bounds,entity:i};if(!(this.options.enableOnlyViewportSnapping&&((o=i.parent)==null?void 0:o.flowNodeType)===In.ROOT&&!Qe.intersects(r,s.rect)))return s}).filter(Boolean)}get nodes(){return this.entityManager.getEntities(To)}getBounds(e){return e.length===0?Qe.EMPTY:Qe.enlarge(e.map(n=>n.getData(at).bounds))}updateNodePositionWithOffset(e){const{node:n,offset:r}=e,i=n.getData(qt),s={x:i.position.x+r.x,y:i.position.y+r.y};i.update({position:s}),this.document.layout.updateAffectedTransform(n)}calcAlignOffset(e){const{snapNodeRects:n,targetRect:r,alignThreshold:i}=e,s=this.getAlignRects({targetRect:r,snapNodeRects:n}),o=this.calcAlignSpacing({targetRect:r,alignRects:s});let a,l,u,h,p,g;if(o.top){const S=s.top[0].rect.bottom+o.top;Jo(Math.abs(r.top-S),i)?a=S:o.top=void 0}if(o.bottom){const S=s.bottom[0].rect.top-o.bottom;xb(Math.abs(r.bottom-S),i)?l=S-r.height:o.bottom=void 0}if(o.left){const S=s.left[0].rect.right+o.left;Jo(Math.abs(r.left-S),i)?u=S:o.left=void 0}if(o.right){const S=s.right[0].rect.left-o.right;Jo(Math.abs(r.right-S),i)?h=S-r.width:o.right=void 0}if(o.midHorizontal){const S=s.left[0].rect.right+o.midHorizontal;Jo(Math.abs(r.left-S),i)?g=S:o.midHorizontal=void 0}if(o.midVertical){const S=s.top[0].rect.bottom+o.midVertical;Jo(Math.abs(r.top-S),i)?p=S:o.midVertical=void 0}const v={x:g??u??h??r.x,y:p??a??l??r.y};return{alignOffset:{x:v.x-r.x,y:v.y-r.y},alignRects:s,alignSpacing:o}}calcAlignSpacing(e){var h,p,g,v;const{targetRect:n,alignRects:r}=e,i=this.getDirectionAlignSpacing({rects:r.top,isHorizontal:!1}),s=this.getDirectionAlignSpacing({rects:r.bottom,isHorizontal:!1}),o=this.getDirectionAlignSpacing({rects:r.left,isHorizontal:!0}),a=this.getDirectionAlignSpacing({rects:r.right,isHorizontal:!0}),l=this.getMidAlignSpacing({rectA:(h=r.left[0])==null?void 0:h.rect,rectB:(p=r.right[0])==null?void 0:p.rect,targetRect:n,isHorizontal:!0}),u=this.getMidAlignSpacing({rectA:(g=r.top[0])==null?void 0:g.rect,rectB:(v=r.bottom[0])==null?void 0:v.rect,targetRect:n,isHorizontal:!1});return{top:i,bottom:s,left:o,right:a,midHorizontal:l,midVertical:u}}getAlignRects(e){const{targetRect:n,snapNodeRects:r}=e,i=[],s=[],o=[],a=[];return r.forEach(l=>{const u=l.rect,{isVerticalIntersection:h,isHorizontalIntersection:p,isIntersection:g}=this.intersection(u,n);g||(h?zm(u.center.y,n.center.y)?s.push({rect:u,sourceNodeId:l.id}):i.push({rect:u,sourceNodeId:l.id}):p&&(zm(u.center.x,n.center.x)?a.push({rect:u,sourceNodeId:l.id}):o.push({rect:u,sourceNodeId:l.id})))}),{top:i,bottom:s,left:o,right:a}}getMidAlignSpacing(e){const{rectA:n,rectB:r,targetRect:i,isHorizontal:s}=e;if(!n||!r)return;const{isVerticalIntersection:o,isHorizontalIntersection:a,isIntersection:l}=this.intersection(n,r);if(!l){if(s&&a&&!o)return(Math.min(Math.abs(n.left-r.right),Math.abs(n.right-r.left))-i.width)/2;if(!s&&o&&!a)return(Math.min(Math.abs(n.top-r.bottom),Math.abs(n.bottom-r.top))-i.height)/2}}getDirectionAlignSpacing(e){const{rects:n,isHorizontal:r}=e;if(n.length<2)return;const i=n[0].rect,s=n[1].rect,{isVerticalIntersection:o,isHorizontalIntersection:a,isIntersection:l}=this.intersection(i,s);if(!l){if(r&&a&&!o)return Math.min(Math.abs(i.left-s.right),Math.abs(i.right-s.left));if(!r&&o&&!a)return Math.min(Math.abs(i.top-s.bottom),Math.abs(i.bottom-s.top))}}intersection(e,n){const r=xb(e.left,n.right)&&zm(e.right,n.left),i=xb(e.top,n.bottom)&&zm(e.bottom,n.top);return{isHorizontalIntersection:i,isVerticalIntersection:r,isIntersection:i&&r}}};ld([oe(Et)],il.prototype,"document",2);ld([oe(Sn)],il.prototype,"entityManager",2);ld([oe(yr)],il.prototype,"dragService",2);ld([oe(qn)],il.prototype,"playgroundConfig",2);il=ld([$e()],il);var fg=class extends er{constructor(){super(...arguments),this.node=ft.createDivWithClass("gedit-playground-layer gedit-flow-snap-layer"),this.edgeLines=[],this.alignLines=[]}onReady(){this.node.style.zIndex="9999",this.toDispose.pushAll([this.service.onSnap(e=>{this.edgeLines=this.calcEdgeLines(e),this.alignLines=this.calcAlignLines(e),this.render()})])}render(){return D.createElement(D.Fragment,null,this.alignLines.length>0&&D.createElement("div",{className:"workflow-snap-align-lines"},this.renderAlignLines()),this.edgeLines.length>0&&D.createElement("div",{className:"workflow-snap-edge-lines"},this.renderEdgeLines()))}onZoom(e){this.node.style.transform=`scale(${e})`}renderEdgeLines(){return this.edgeLines.map(e=>{const{className:n,sourceNode:r,top:i,left:s,width:o,height:a,dashed:l}=e,u=`${n}-${r}-${i}-${s}-${o}-${a}`,h=o<a,p=`${this.options.edgeLineWidth}px ${l?"dashed":"solid"} ${this.options.edgeColor}`;return D.createElement("div",{className:`workflow-snap-edge-line ${n}`,"data-testid":"sdk.workflow.canvas.snap.edgeLine","data-snap-line-id":u,"data-snap-line-source-node":r,key:u,style:{top:i,left:s,width:o,height:a,position:"absolute",borderLeft:h?p:"none",borderTop:h?"none":p}})})}renderAlignLines(){return this.alignLines.map(e=>{const n=`${e.className}-${e.sourceNode}-${e.top}-${e.left}-${e.width}-${e.height}`,r=zm(e.width,e.height),i=this.options.alignLineWidth,s=this.options.alignCrossWidth,o=r?e.top-i/2:e.top,a=r?e.left:e.left-i/2;return D.createElement("div",{className:`workflow-snap-align-line ${e.className}`,"data-testid":"sdk.workflow.canvas.snap.alignLine","data-snap-line-id":n,"data-snap-line-source-node":e.sourceNode,key:n,style:{position:"absolute"}},D.createElement("div",{style:{position:"absolute",top:o,left:a,width:r?e.width:i,height:r?i:e.height,backgroundColor:this.options.alignColor}}),D.createElement("div",{style:{position:"absolute",top:r?o-(s-i)/2:o,left:r?a:a-(s-i)/2,width:r?i:s,height:r?s:i,backgroundColor:this.options.alignColor}}),D.createElement("div",{style:{position:"absolute",top:r?o-(s-i)/2:o+e.height-i,left:r?a+e.width-i:a-(s-i)/2,width:r?i:s,height:r?s:i,backgroundColor:this.options.alignColor}}))})}calcEdgeLines(e){const{alignRects:n,snapRect:r,snapEdgeLines:i}=e,s=[],o=this.directionFullAlign({alignRects:n.top,targetRect:r,isVertical:!0}),a=this.directionFullAlign({alignRects:n.bottom,targetRect:r,isVertical:!0}),l=this.directionFullAlign({alignRects:n.left,targetRect:r,isVertical:!1}),u=this.directionFullAlign({alignRects:n.right,targetRect:r,isVertical:!1});if(o){const p=o.rect.top,g=a?r.bottom-r.height/2-p:r.bottom-p,v=this.options.edgeLineWidth,w={top:p,width:v,height:g};s.push({className:"edge-full-top-left",sourceNode:o.sourceNodeId,left:r.left,...w}),s.push({className:"edge-full-top-right",sourceNode:o.sourceNodeId,left:r.right,...w}),s.push({className:"edge-full-top-mid",sourceNode:o.sourceNodeId,left:r.left+r.width/2,dashed:!0,...w})}if(a){const p=o?r.top+r.height/2:r.top,g=a.rect.bottom-p,v=this.options.edgeLineWidth,w={top:p,width:v,height:g};s.push({className:"edge-full-bottom-left",sourceNode:a.sourceNodeId,left:r.left,...w}),s.push({className:"edge-full-bottom-right",sourceNode:a.sourceNodeId,left:r.right,...w}),s.push({className:"edge-full-bottom-mid",sourceNode:a.sourceNodeId,left:r.left+r.width/2,dashed:!0,...w})}if(l){const p=l.rect.left,g=u?r.right-r.width/2-p:r.right-p,v=this.options.edgeLineWidth,w={left:p,width:g,height:v};s.push({className:"edge-full-left-top",sourceNode:l.sourceNodeId,top:r.top,...w}),s.push({className:"edge-full-left-bottom",sourceNode:l.sourceNodeId,top:r.bottom,...w}),s.push({className:"edge-full-left-mid",sourceNode:l.sourceNodeId,top:r.top+r.height/2,dashed:!0,...w})}if(u){const p=l?r.left+r.width/2:r.left,g=u.rect.right-p,v=this.options.edgeLineWidth,w={left:p,width:g,height:v};s.push({className:"edge-full-right-top",sourceNode:u.sourceNodeId,top:r.top,...w}),s.push({className:"edge-full-right-bottom",sourceNode:u.sourceNodeId,top:r.bottom,...w}),s.push({className:"edge-full-right-mid",sourceNode:u.sourceNodeId,top:r.top+r.height/2,dashed:!0,...w})}const h=Object.entries(i).map(([p,g])=>{if(!g)return;const v=this.document.getNode(g.sourceNodeId);if(!v)return;const w=v.getData(at).bounds;if(Lp(g.x)){const S=Math.min(w.top,r.top),x=Math.max(w.bottom,r.bottom)-S,I=g.x,P=this.options.edgeLineWidth,M=p==="midVertical",k={className:`edge-snapped-${p}`,sourceNode:g.sourceNodeId,top:S,left:I,width:P,height:x,dashed:M},A=S===w.top;return A&&o||!A&&a?void 0:k}else if(Lp(g.y)){const S=Math.min(w.left,r.left),x=Math.max(w.right,r.right)-S,I=g.y,P=this.options.edgeLineWidth,M=p==="midHorizontal",k={className:`edge-snapped-${p}`,sourceNode:g.sourceNodeId,top:I,left:S,width:x,height:P,dashed:M},A=S===w.left;return A&&l||!A&&u?void 0:k}}).filter(Boolean);return s.push(...h),s}directionFullAlign(e){var a;const{alignRects:n,targetRect:r,isVertical:i}=e;let s=-1;for(let l=0;l<n.length;l++){const u=n[l],h=((a=n[l-1])==null?void 0:a.rect)??r;if(!this.rectFullAlign(u.rect,h,i))break;s=l}return n[s]}rectFullAlign(e,n,r){return r?Do(e.left,n.left)&&Do(e.right,n.right):Do(e.top,n.top)&&Do(e.bottom,n.bottom)}calcAlignLines(e){const{alignRects:n,alignSpacing:r,snapRect:i}=e,s=this.calcDirectionAlignLines({alignRects:n.top,targetRect:i,isVertical:!0,spacing:r.midVertical??r.top}),o=this.calcDirectionAlignLines({alignRects:n.bottom,targetRect:i,isVertical:!0,spacing:r.midVertical??r.bottom}),a=this.calcDirectionAlignLines({alignRects:n.left,targetRect:i,isVertical:!1,spacing:r.midHorizontal??r.left}),l=this.calcDirectionAlignLines({alignRects:n.right,targetRect:i,isVertical:!1,spacing:r.midHorizontal??r.right});return[...s,...o,...a,...l]}calcDirectionAlignLines(e){var a;const{alignRects:n,targetRect:r,isVertical:i,spacing:s}=e,o=[];if(!s)return o;for(let l=0;l<n.length;l++){const u=n[l],h=u.rect,p=((a=n[l-1])==null?void 0:a.rect)??r,g=i?Math.min(Math.abs(p.top-h.bottom),Math.abs(p.bottom-h.top)):Math.min(Math.abs(p.left-h.right),Math.abs(p.right-h.left));if(!Do(g,s))break;if(i){const v=this.calcHorizontalIntersectionCenter(h,r);o.push({className:"align-vertical",sourceNode:u.sourceNodeId,top:Math.min(h.bottom,p.bottom),left:v,width:1,height:s})}else{const v=this.calcVerticalIntersectionCenter(h,r);o.push({className:"align-horizontal",sourceNode:u.sourceNodeId,top:v,left:Math.min(h.right,p.right),width:s,height:1})}}return o}calcVerticalIntersectionCenter(e,n){const r=Math.max(e.top,n.top),i=Math.min(e.bottom,n.bottom);return(r+i)/2}calcHorizontalIntersectionCenter(e,n){const r=Math.max(e.left,n.left),i=Math.min(e.right,n.right);return(r+i)/2}};fg.type="WorkflowSnapLayer";ld([oe(Et)],fg.prototype,"document",2);ld([oe(il)],fg.prototype,"service",2);fg=ld([$e()],fg);var Hfe=Gn({onBind({bind:e}){e(il).toSelf().inSingletonScope()},onInit(e,n){const r={...f$,...n};e.playground.registerLayer(fg,r),e.get(il).init(r)},onDispose(e){e.get(il).dispose()}}),Ufe=Object.defineProperty,Kfe=Object.getOwnPropertyDescriptor,cd=(e,n,r,i)=>{for(var s=i>1?void 0:i?Kfe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&Ufe(n,r,s),s},Wfe=async()=>{await bc(20)},vw=e=>(e==null?void 0:e.getNodeMeta().isContainer)??!1,Ov=(e,n={x:0,y:0})=>{const r=e.node;if(vw(r)){const{point:s}=e;return e.portType==="input"?new Qe(s.x+n.x,s.y-50+n.y,300,100):new Qe(s.x-300,s.y-50,300,100)}return r.getData(at).bounds},p$=e=>{const{node:n,subsequentNodes:r,fromPort:i,toPort:s,containerNode:o,offset:a,historyService:l,dragService:u}=e;if(!a||!s)return;const h=r.map(S=>{const E=S.getData(qt);return{x:E.position.x,y:E.position.y}});l.pushOperation({type:vv.dragNodes,value:{ids:r.map(S=>S.id),value:h.map(S=>({x:S.x+a.x,y:S.y+a.y})),oldValue:h}});const p=Ov(i),g=Ov(s,a),v=n.getData(qt);let w={x:(p.center.x+g.center.x)/2,y:(p.y+g.y)/2};o&&(w=u.adjustSubNodePosition(n.flowNodeType,o,w)),l.pushOperation({type:vv.dragNodes,value:{ids:[n.id],value:[w],oldValue:[{x:v.position.x,y:v.position.y}]}})},g$=(e,n)=>{const r=Math.abs(Math.min(e.right,n.right)-Math.max(e.left,n.left)),i=Math.abs(Math.min(e.bottom,n.bottom)-Math.max(e.top,n.top));return Qe.intersects(e,n)?{x:-r,y:-i}:{x:r,y:i}},pb=(e,n)=>e===void 0||n===void 0?!1:e-n>1e-5,Vk=(e,n)=>e===void 0||n===void 0?!1:n-e>1e-5,y$=e=>{var E;const{node:n,fromPort:r,toPort:i,padding:s}=e,o=Ov(r),a=Ov(i),l=n.getData(at),u=((E=n.getNodeMeta())==null?void 0:E.size)??{width:l.bounds.width,height:l.bounds.height},h={x:u.width+s.x,y:u.height+s.y},p=g$(o,a),g={x:pb(p.x,h.x)?0:h.x-p.x,y:pb(p.y,h.y)?0:h.y-p.y};if(g.x===0||g.y===0)return;const v={vertical:Qe.intersects(o,a,"horizontal"),horizontal:Qe.intersects(o,a,"vertical")};let w=0,S=0;return v.horizontal||(pb(a.center.y,o.center.y)?S=g.y:Vk(a.center.y,o.center.y)&&(S=-g.y)),v.vertical||(pb(a.center.x,o.center.x)?w=g.x:Vk(a.center.x,o.center.x)&&(w=-g.x)),{x:w,y:S}},m$=e=>{var u;const{node:n,linesManager:r}=e;if(vw(n))return[];const i=((u=n.parent)==null?void 0:u.blocks)??[],s=new Set,o=new Map;r.getAllLines().forEach(h=>{var p,g;o.has(h.from.id)||o.set(h.from.id,[]),!(!((p=h.to)!=null&&p.id)||vw(h.to))&&((g=o.get(h.from.id))==null||g.push(h.to.id))});const a=h=>{if(s.has(h))return;s.add(h),(o.get(h)??[]).forEach(a)};return a(n.id),i.filter(h=>s.has(h.id))},qfe=e=>{const{node:n,fromPort:r,toPort:i,linesManager:s,historyService:o,dragService:a,containerNode:l,padding:u={x:100,y:100}}=e,h=y$({node:n,fromPort:r,toPort:i,padding:u}),p=m$({node:i.node,linesManager:s});p$({node:n,subsequentNodes:p,fromPort:r,toPort:i,containerNode:l,offset:h,historyService:o,dragService:a})},Gfe=e=>{const{fromPort:n,containerNode:r}=e;if(r)return r;const i=n==null?void 0:n.node,s=i==null?void 0:i.parent;return vw(i)?i:s},Yfe=e=>{var u,h;const{fromPort:n,node:r,toPort:i,linesManager:s}=e,o=r.getData(gl);if(!o)return;const a=((u=o.inputPorts)==null?void 0:u.length)>0;if(n&&a){const p=o.inputPorts[0],g=o.inputPorts.length===1;s.createLine({from:n.node.id,fromPort:n.portID,to:r.id,toPort:g?void 0:p.id})}const l=((h=o.outputPorts)==null?void 0:h.length)>0;if(i&&l){const p=o.outputPorts[0];s.createLine({from:r.id,fromPort:p.portID,to:i.node.id,toPort:i.portID})}},Xfe=e=>{var g;const{nodeType:n,position:r,fromPort:i,toPort:s,containerNode:o,document:a,dragService:l}=e,u=a.getNodeRegistry(n),h=(g=u==null?void 0:u.meta)==null?void 0:g.size;let p=r;return h?i&&s?p={x:r.x,y:r.y-h.height/2}:i&&!s?p={x:r.x+h.width/2,y:r.y-h.height/2}:!i&&s?p={x:r.x-h.width/2,y:r.y-h.height/2}:p=r:p=r,l.adjustSubNodePosition(n,o,p)},Bs={adjustNodePosition:Xfe,buildLine:Yfe,getPortBox:Ov,getSubsequentNodes:m$,getContainerNode:Gfe,rectDistance:g$,subNodesAutoOffset:qfe,subPositionOffset:y$,updateSubSequentNodesPosition:p$,waitNodeRender:Wfe},_s=class{constructor(){this.toDispose=new jt,this.callNodePanel=async()=>{}}dispose(){this.toDispose.dispose()}setCallNodePanel(e){this.callNodePanel=e}async call(e){const{panelPosition:n,fromPort:r,enableMultiAdd:i=!1,panelProps:s={},containerNode:o,afterAddNode:a}=e;if(!n||this.playgroundConfig.readonly)return;const l=[];return new Promise(u=>{this.callNodePanel({position:n,enableMultiAdd:i,panelProps:s,containerNode:Bs.getContainerNode({fromPort:r,containerNode:o}),onSelect:async h=>{const p=await this.addNode(e,h);a==null||a(p),i?p&&l.push(p):u(p)},onClose:()=>{u(i?l:void 0)}})})}async singleSelectNodePanel(e){return new Promise(n=>{this.callNodePanel({...e,enableMultiAdd:!1,onSelect:async r=>{n(r)},onClose:()=>{n(void 0)}})})}async addNode(e,n){const{panelPosition:r,fromPort:i,toPort:s,canAddNode:o,autoOffsetPadding:a={x:100,y:100},enableBuildLine:l=!1,enableSelectPosition:u=!1,enableAutoOffset:h=!1,enableDragNode:p=!1}=e;if(!r||!n)return;const{nodeType:g,selectEvent:v,nodeJSON:w}=n,S=Bs.getContainerNode({fromPort:i,containerNode:e.containerNode});if(o&&!o({nodeType:g,containerNode:S}))return;const E=this.playgroundConfig.getPosFromMouseEvent(v),x=e.customPosition?e.customPosition({nodeType:g,selectPosition:E}):Bs.adjustNodePosition({nodeType:g,position:u?E:r,fromPort:i,toPort:s,containerNode:S,document:this.document,dragService:this.dragService}),I=this.document.createWorkflowNodeByType(g,x,w??{},S==null?void 0:S.id);if(I)return h&&i&&s&&Bs.subNodesAutoOffset({node:I,fromPort:i,toPort:s,padding:a,containerNode:S,historyService:this.historyService,dragService:this.dragService,linesManager:this.linesManager}),!l&&!p||(await Bs.waitNodeRender(),l&&Bs.buildLine({fromPort:i,node:I,toPort:s,linesManager:this.linesManager}),p&&(this.selectService.selectNode(I),this.dragService.startDragSelectedNodes(v))),I}};cd([oe(Et)],_s.prototype,"document",2);cd([oe(yr)],_s.prototype,"dragService",2);cd([oe(or)],_s.prototype,"selectService",2);cd([oe(oi)],_s.prototype,"linesManager",2);cd([oe(qn)],_s.prototype,"playgroundConfig",2);cd([oe(ar)],_s.prototype,"historyService",2);_s=cd([$e()],_s);var hT=class extends er{constructor(){super(),this.node=ft.createDivWithClass("gedit-playground-layer gedit-node-panel-layer"),this.node.style.zIndex="9999",this.renderList=new Map}onReady(){this.service.setCallNodePanel(this.call.bind(this))}onZoom(e){this.node.style.transform=`scale(${e})`}render(){const e=this.options.renderer;return D.createElement(D.Fragment,null,Array.from(this.renderList.keys()).map(n=>{const r=this.renderList.get(n);return D.createElement(e,{key:n,...r})}))}async call(e){const n=GI(),{onSelect:r,onClose:i,enableMultiAdd:s=!1,panelProps:o={}}=e;return new Promise(a=>{const l=()=>{this.renderList.delete(n),this.render(),a()},p={...e,panelProps:o,onSelect:g=>{r(g),s||l()},onClose:()=>{l(),i()}};this.renderList.set(n,p),this.render()})}};hT.type="WorkflowNodePanelLayer";cd([oe(_s)],hT.prototype,"service",2);var Zfe=Gn({onBind({bind:e}){e(_s).toSelf().inSingletonScope()},onInit:(e,n)=>{e.playground.registerLayer(hT,{renderer:n.renderer})},onDispose:e=>{e.get(_s).dispose()}}),Qfe=Object.defineProperty,Jfe=Object.getOwnPropertyDescriptor,ud=(e,n,r,i)=>{for(var s=i>1?void 0:i?Jfe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&Qfe(n,r,s),s},bw=(e=>(e.In="in",e.Out="out",e))(bw||{}),_i=class{constructor(){this.emitter=new qe,this.toDispose=new jt,this.on=this.emitter.event}init(){this.initState(),this.toDispose.push(this.emitter)}ready(){this.toDispose.push(this.listenDragToContainer())}dispose(){this.initState(),this.toDispose.dispose()}async moveOutContainer(e){var a;const{node:n}=e,r=n.parent,i=r==null?void 0:r.parent,s=this.document.toNodeJSON(n);if(!r||!i||!this.isContainer(r)||!((a=s.meta)!=null&&a.position))return;this.operationService.moveNode(n,{parent:i});const o=r.getData(qt);this.operationService.updateNodePosition(n,{x:o.position.x+s.meta.position.x,y:o.position.y+s.meta.position.y}),o.fireChange(),await this.nextFrame(),o.fireChange(),this.emitter.fire({type:"out",node:n,sourceContainer:r,targetContainer:i})}canMoveOutContainer(e){const n=e.parent,r=n==null?void 0:n.parent;return!(!n||!r||!this.isContainer(n)||!this.dragService.canDropToNode({dragNodeType:e.flowNodeType,dropNode:r}).allowDrop)}async clearInvalidLines(e){var i;const{dragNode:n,sourceParent:r}=e;n&&n.parent!==r&&(((i=n.parent)==null?void 0:i.flowNodeType)===In.GROUP||(r==null?void 0:r.flowNodeType)===In.GROUP||await this.removeNodeLines(n))}initState(){this.state={isDraggingNode:!1,isSkipEvent:!1,transforms:void 0,dragNode:void 0,dropNode:void 0,sourceParent:void 0}}listenDragToContainer(){const e=r=>this.draggingNode(r),n=je.throttle(e,200);return this.dragService.onNodesDrag(async r=>{var i;if(this.selectService.selectedNodes.length===1){if(r.type==="onDragStart"){if(this.state.isSkipEvent){this.state.isSkipEvent=!1;return}this.historyService.startTransaction(),this.state.isDraggingNode=!0,this.state.transforms=this.getContainerTransforms(),this.state.dragNode=this.selectService.selectedNodes[0],this.state.dropNode=void 0,this.state.sourceParent=(i=this.state.dragNode)==null?void 0:i.parent,await this.dragOutContainer(r)}if(r.type==="onDragging"&&n(r),r.type==="onDragEnd"){if(this.state.isSkipEvent)return;n.cancel(),e(r),await this.dropNodeToContainer(),await this.clearInvalidLines({dragNode:this.state.dragNode,sourceParent:this.state.sourceParent}),this.setDropNode(void 0),this.initState(),this.historyService.endTransaction()}}})}async dragOutContainer(e){const{dragNode:n}=this.state;!(e.triggerEvent.metaKey||e.triggerEvent.ctrlKey)||!n||!this.canMoveOutContainer(n)||(this.moveOutContainer({node:n}),this.state.isSkipEvent=!0,e.dragger.stop(e.dragEvent.clientX,e.dragEvent.clientY),await this.nextFrame(),this.dragService.startDragSelectedNodes(e.triggerEvent))}async removeNodeLines(e){this.linesManager.getAllLines().forEach(r=>{var i;r.from.id!==e.id&&((i=r.to)==null?void 0:i.id)!==e.id||r.dispose()}),await this.nextFrame()}getCollisionTransform(e){const{targetRect:n,targetPoint:r,transforms:i,withPadding:s=!1}=e;return i.find(a=>{const{bounds:l,entity:u}=a,h=s?this.document.layout.getPadding(u):{left:0,right:0},p=new Qe(l.x+h.left+h.right,l.y,l.width,l.height);return n?this.isRectIntersects(n,p):r?this.isPointInRect(r,p):!1})}setDropNode(e){var i,s,o,a;if(this.state.dropNode===e)return;if(this.state.dropNode){const u=(s=(i=this.state.dropNode.getData(zn).node)==null?void 0:i.children)==null?void 0:s[0];u&&u.classList.remove("selected")}if(this.state.dropNode=e,!e)return;const r=(a=(o=e.getData(zn).node)==null?void 0:o.children)==null?void 0:a[0];r&&r.classList.add("selected")}getContainerTransforms(){return this.document.getAllNodes().filter(e=>e.originParent?e.getNodeMeta().selectable&&e.originParent.getNodeMeta().selectable:e.getNodeMeta().selectable).filter(e=>this.isContainer(e)).sort((e,n)=>{const r=e.renderData.stackIndex;return n.renderData.stackIndex-r}).map(e=>e.transform)}async dropNodeToContainer(){const{dropNode:e,dragNode:n,isDraggingNode:r}=this.state;if(!(!r||!n||!e))return await this.moveIntoContainer({node:n,containerNode:e})}draggingNode(e){const{dragNode:n,isDraggingNode:r,transforms:i=[]}=this.state;if(!r||!n||!(i!=null&&i.length))return this.setDropNode(void 0);const s=this.playgroundConfig.getPosFromMouseEvent(e.dragEvent),o=i.filter(h=>h.entity.id!==n.id),a=this.getCollisionTransform({targetPoint:s,transforms:o}),l=a==null?void 0:a.entity;return this.canDropToContainer({dragNode:n,dropNode:l})?this.setDropNode(l):this.setDropNode(void 0)}canDropToContainer(e){const{dragNode:n,dropNode:r}=e,i=r==null?void 0:r.getNodeMeta().isContainer;return!(!r||!i||this.isParent(n,r)||n.flowNodeType===In.GROUP&&r.flowNodeType!==In.GROUP||!this.dragService.canDropToNode({dragNodeType:n.flowNodeType,dropNode:r}).allowDrop)}isParent(e,n){let r=e.parent;for(;r;){if(r.id===n.id)return!0;r=r.parent}return!1}async moveIntoContainer(e){const{node:n,containerNode:r}=e,i=n.parent;this.operationService.moveNode(n,{parent:r}),this.operationService.updateNodePosition(n,this.adjustSubNodePosition(n,r)),await this.nextFrame(),this.emitter.fire({type:"in",node:n,sourceContainer:i,targetContainer:r})}adjustSubNodePosition(e,n){if(n.flowNodeType===In.ROOT)return e.transform.position;const r=e.transform.transform.worldTransform,i=n.transform.transform.worldTransform,s={x:r.tx,y:r.ty},o=!n.children||n.children.length===0,a=this.document.layout.getPadding(n);return o?{x:0,y:a.top}:{x:s.x-i.tx,y:s.y-i.ty}}isContainer(e){return(e==null?void 0:e.getNodeMeta().isContainer)??!1}isPointInRect(e,n){return e.x>=n.left&&e.x<=n.right&&e.y>=n.top&&e.y<=n.bottom}isRectIntersects(e,n){const r=e.right>n.left&&e.left<n.right,i=e.bottom>n.top&&e.top<n.bottom;return r&&i}async nextFrame(){await new Promise(e=>requestAnimationFrame(e))}};ud([oe(yr)],_i.prototype,"dragService",2);ud([oe(Et)],_i.prototype,"document",2);ud([oe(qn)],_i.prototype,"playgroundConfig",2);ud([oe(Aw)],_i.prototype,"operationService",2);ud([oe(oi)],_i.prototype,"linesManager",2);ud([oe(ar)],_i.prototype,"historyService",2);ud([oe(or)],_i.prototype,"selectService",2);_i=ud([$e()],_i);var epe=Gn({onBind:({bind:e})=>{e(_i).toSelf().inSingletonScope()},onInit(e,n){e.get(_i).init()},onReady(e,n){n.disableNodeIntoContainer!==!0&&e.get(_i).ready()},onDispose(e){e.get(_i).dispose()}}),v$=()=>{const e=Vh(),n=e.getNodeMeta(),{size:r={width:300,height:200},isContainer:i}=n,s=e.getData(at),[o,a]=R.useState(r.width),[l,u]=R.useState(r.height),h=()=>{e.getData(gl).updateDynamicPorts()},p=()=>{if(e.blocks.length===0){a(r.width),u(r.height);return}a(s.bounds.width),u(s.bounds.height)};if(R.useEffect(()=>{const g=s.onDataChange(()=>{p(),h()});return()=>g.dispose()},[s,o,l]),R.useEffect(()=>{p()},[]),!!i)return{width:o,height:l}},tpe=e=>{const n=Vh();R.useLayoutEffect(()=>{e&&(n.renderData.node.style.width=e.width+"px",n.renderData.node.style.height=e.height+"px")},[e==null?void 0:e.width,e==null?void 0:e.height])},npe=xt.div`
|
||
width: 100%;
|
||
height: 100%;
|
||
inset: 56px 18px 18px;
|
||
background-color: #f2f3f5;
|
||
`,rpe=()=>{const e=Vh();return D.createElement(npe,{className:"sub-canvas-background","data-flow-editor-selectable":"true"},D.createElement("svg",{width:"100%",height:"100%"},D.createElement("pattern",{id:"sub-canvas-dot-pattern",width:"20",height:"20",patternUnits:"userSpaceOnUse"},D.createElement("circle",{cx:"1",cy:"1",r:"1",stroke:"#eceeef",fillOpacity:"0.5"})),D.createElement("rect",{width:"100%",height:"100%",fill:"url(#sub-canvas-dot-pattern)","data-node-panel-container":e.id})))},ipe=xt.div`
|
||
pointer-events: none;
|
||
|
||
position: relative;
|
||
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
width: 100%;
|
||
height: 100%;
|
||
|
||
background-color: transparent;
|
||
border: 1px solid var(--coz-stroke-plus, rgba(6, 7, 9, 15%));
|
||
border-color: var(--coz-bg-plus, rgb(249, 249, 249));
|
||
border-style: solid;
|
||
border-width: 8px;
|
||
border-radius: 8px;
|
||
|
||
&::before {
|
||
content: '';
|
||
|
||
position: absolute;
|
||
z-index: 0;
|
||
inset: -4px;
|
||
|
||
background-color: transparent;
|
||
border-color: var(--coz-bg-plus, rgb(249, 249, 249));
|
||
border-style: solid;
|
||
border-width: 4px;
|
||
border-radius: 8px;
|
||
}
|
||
`,spe=({style:e,children:n})=>D.createElement(ipe,{className:"sub-canvas-border",style:{...e}},n),ope=xt.div`
|
||
width: 100%;
|
||
height: 100%;
|
||
`,Bk="workflow-move-into-sub-canvas-tip-visible",Hk="false",ape=class b${constructor(){this.closed=!1}static get instance(){return this._instance||(this._instance=new b$),this._instance}isClosed(){return this.isCloseForever()||this.closed}close(){this.closed=!0}isCloseForever(){return localStorage.getItem(Bk)===Hk}closeForever(){localStorage.setItem(Bk,Hk)}},lpe=()=>{const e=Vh(),[n,r]=R.useState(!1),i=ape.instance,s=Wt(_i),o=R.useCallback(()=>{i.isClosed()||r(!0)},[i]),a=R.useCallback(()=>{i.close(),r(!1)},[i]),l=R.useCallback(()=>{i.closeForever(),a()},[a,i]);return R.useEffect(()=>{const u=s.on(p=>{p.type==="in"&&p.targetContainer===e&&o()}),h=s.on(p=>{p.type==="out"&&p.sourceContainer===e&&!e.blocks.length&&r(!1)});return()=>{u.dispose(),h.dispose()}},[s,e,o,a,n]),{visible:n,close:a,closeForever:l}},cpe=xt.div`
|
||
position: absolute;
|
||
top: 0;
|
||
|
||
width: 100%;
|
||
height: 28px;
|
||
|
||
.container {
|
||
height: 100%;
|
||
background-color: #e4e6f5;
|
||
border-radius: 4px 4px 0 0;
|
||
|
||
.content {
|
||
overflow: hidden;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
width: 100%;
|
||
height: 100%;
|
||
|
||
.text {
|
||
font-size: 14px;
|
||
font-weight: 400;
|
||
font-style: normal;
|
||
line-height: 20px;
|
||
color: rgba(15, 21, 40, 82%);
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.space {
|
||
width: 128px;
|
||
}
|
||
}
|
||
|
||
.actions {
|
||
position: absolute;
|
||
top: 0;
|
||
right: 0;
|
||
|
||
display: flex;
|
||
gap: 8px;
|
||
align-items: center;
|
||
|
||
height: 28px;
|
||
padding: 0 16px;
|
||
|
||
.close-forever {
|
||
cursor: pointer;
|
||
|
||
padding: 0 3px;
|
||
|
||
font-size: 12px;
|
||
font-weight: 400;
|
||
font-style: normal;
|
||
line-height: 12px;
|
||
color: rgba(32, 41, 69, 62%);
|
||
}
|
||
|
||
.close {
|
||
display: flex;
|
||
cursor: pointer;
|
||
height: 100%;
|
||
align-items: center;
|
||
}
|
||
}
|
||
}
|
||
`,upe=/(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(navigator.userAgent),dpe=()=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},D.createElement("path",{fill:"#060709",fillOpacity:"0.5",d:"M12.13 12.128a.5.5 0 0 0 .001-.706L8.71 8l3.422-3.423a.5.5 0 0 0-.001-.705.5.5 0 0 0-.706-.002L8.002 7.293 4.579 3.87a.5.5 0 0 0-.705.002.5.5 0 0 0-.002.705L7.295 8l-3.423 3.422a.5.5 0 0 0 .002.706c.195.195.51.197.705.001l3.423-3.422 3.422 3.422c.196.196.51.194.706-.001"})),hpe=()=>{const{visible:e,close:n,closeForever:r}=lpe();return e?D.createElement(cpe,{className:"sub-canvas-tips"},D.createElement("div",{className:"container"},D.createElement("div",{className:"content"},D.createElement("p",{className:"text"},`Hold ${upe?"Cmd ⌘":"Ctrl"} to drag node out`),D.createElement("div",{className:"space",style:{width:0}})),D.createElement("div",{className:"actions"},D.createElement("p",{className:"close-forever",onClick:r},"Never Remind"),D.createElement("div",{className:"close",onClick:n},D.createElement(dpe,null))))):null},fpe=({className:e,style:n})=>{const r=Vh(),i=v$(),s=(i==null?void 0:i.height)??0,{padding:o}=r.transform;return tpe(i),D.createElement(ope,{className:`sub-canvas-render ${e??""}`,style:{height:s-o.top,...n},"data-flow-editor-selectable":"true",onDragStart:a=>{a.stopPropagation()}},D.createElement(spe,null,D.createElement(rpe,null),D.createElement(hpe,null)))},ppe=Object.defineProperty,gpe=Object.getOwnPropertyDescriptor,y0=(e,n,r,i)=>{for(var s=i>1?void 0:i?gpe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&ppe(n,r,s),s},QN;(e=>{const n=i=>{var s;return((s=i==null?void 0:i.parent)==null?void 0:s.flowNodeType)===In.GROUP},r=i=>i.flowNodeType===In.GROUP;e.validate=i=>{if(!i||!Array.isArray(i)||i.length===0||i.some(u=>r(u))||i.some(u=>u&&n(u)))return!1;const a=i[0].parent;return!!i.every(u=>u.parent===a)}})(QN||(QN={}));var No=class extends Dh{constructor(){super(...arguments),this.toDispose=new jt}ready(){this.toDispose.push(this.listenContainer())}dispose(){this.toDispose.dispose()}createGroup(e){if(!QN.validate(e))return;const n=e[0].parent??this.document.root,r=`group_${GI(5)}`,i={type:In.GROUP,id:r,meta:{position:{x:0,y:0}},data:{}};this.historyService.startTransaction(),this.document.createWorkflowNodeByType(In.GROUP,{x:0,y:0},i,n.id),e.forEach(s=>{this.freeOperationService.moveNode(s,{parent:r})}),this.historyService.endTransaction()}ungroup(e){const n=e.blocks.slice();if(!e.parent)return;const r=e.transform.position;this.historyService.startTransaction(),n.forEach(i=>{var s;this.freeOperationService.moveNode(i,{parent:(s=e.parent)==null?void 0:s.id})}),e.dispose(),n.forEach(i=>{const s=i.getData(qt),o={x:s.position.x+r.x,y:s.position.y+r.y};this.freeOperationService.updateNodePosition(i,o)}),this.historyService.endTransaction()}listenContainer(){return this.nodeIntoContainerService.on(e=>{var n,r;e.type!==bw.Out||((n=e.sourceContainer)==null?void 0:n.flowNodeType)!==In.GROUP||((r=e.sourceContainer)==null?void 0:r.blocks.length)===0&&e.sourceContainer.dispose()})}};y0([oe(Et)],No.prototype,"document",2);y0([oe(Aw)],No.prototype,"freeOperationService",2);y0([oe(ar)],No.prototype,"historyService",2);y0([oe(_i)],No.prototype,"nodeIntoContainerService",2);No=y0([$e()],No);var fT=(e=>(e.Group="group",e.Ungroup="ungroup",e))(fT||{}),ype=class{constructor(e){this.commandId="group",this.commandDetail={label:"Group"},this.shortcuts=["meta g","ctrl g"],this.selectService=e.get(or),this.groupService=e.get(No),this.execute=this.execute.bind(this)}async execute(){this.groupService.createGroup(this.selectService.selectedNodes),this.selectService.clear()}},mpe=class{constructor(e){this.commandId="ungroup",this.commandDetail={label:"Ungroup"},this.shortcuts=["meta shift g","ctrl shift g"],this.selectService=e.get(or),this.groupService=e.get(No),this.execute=this.execute.bind(this)}async execute(e){const n=e||this.selectService.activatedNode;!n||n.flowNodeType!==In.GROUP||(this.groupService.ungroup(n),this.selectService.clear())}},vpe={type:In.GROUP,meta:{renderKey:In.GROUP,defaultPorts:[],isContainer:!0,disableSideBar:!0,size:{width:560,height:400},padding:()=>({top:80,bottom:40,left:65,right:65}),selectable(e,n){return n?!e.getData(at).bounds.contains(n.x,n.y):!0},expandable:!1},formMeta:{render:()=>React.createElement(React.Fragment,null)},onCreate(){}},bpe=Gn({onBind({bind:e,rebind:n}){e(No).toSelf().inSingletonScope(),n(Dh).toService(No)},onInit(e,{groupNodeRender:n,disableGroupShortcuts:r=!1,disableGroupNodeRegister:i=!1}){n&&e.get(bs).registerReactComponent(In.GROUP,n),r||e.get(Ku).addHandlers(new ype(e),new mpe(e)),i||e.get(Et).registerFlowNodes(vpe)},onReady(e){e.get(No).ready()},onDispose(e){e.get(No).dispose()}});const wpe=async(e,n)=>{const r=e.get(_s),i=e.document,s=e.get(yr),o=e.get(oi),{fromPort:a,toPort:l,mousePos:u,line:h,originLine:p}=n;if(p||!h||l)return;const g=Bs.getContainerNode({fromPort:a}),v=await r.singleSelectNodePanel({position:u,containerNode:g,panelProps:{enableNodePlaceholder:!0,enableScrollClose:!0}});if(!v)return;const{nodeType:w,nodeJSON:S}=v,E=Bs.adjustNodePosition({nodeType:w,position:u,fromPort:a,toPort:l,containerNode:g,document:i,dragService:s}),x=i.createWorkflowNodeByType(w,E,S??{},g==null?void 0:g.id);await bc(20),Bs.buildLine({fromPort:a,node:x,toPort:l,linesManager:o})},w$="flowgram-workflow-clipboard-data";var Ws=(e=>(e.COPY="COPY",e.PASTE="PASTE",e.CUT="CUT",e.GROUP="GROUP",e.UNGROUP="UNGROUP",e.COLLAPSE="COLLAPSE",e.EXPAND="EXPAND",e.DELETE="DELETE",e.ZOOM_IN="ZOOM_IN",e.ZOOM_OUT="ZOOM_OUT",e.RESET_ZOOM="RESET_ZOOM",e.SELECT_ALL="SELECT_ALL",e.CANCEL_SELECT="CANCEL_SELECT",e))(Ws||{});class _pe{constructor(n){this.commandId=Ws.ZOOM_OUT,this.shortcuts=["meta -","ctrl -"],this.playgroundConfig=n.get(qn),this.execute=this.execute.bind(this)}async execute(){this.playgroundConfig.zoom>1.9||this.playgroundConfig.zoomout()}}class Cpe{constructor(n){this.commandId=Ws.ZOOM_IN,this.shortcuts=["meta =","ctrl ="],this.playgroundConfig=n.get(qn),this.execute=this.execute.bind(this)}async execute(){this.playgroundConfig.zoom>1.9||this.playgroundConfig.zoomin()}}class Epe{constructor(n){this.commandId=Ws.SELECT_ALL,this.shortcuts=["meta a","ctrl a"],this.document=n.get(Et),this.playground=n.playground,this.execute=this.execute.bind(this)}async execute(){const n=this.document.getAllNodes();this.playground.selectionService.selection=n}}const xpe=(e,n)=>{const r=Array.isArray(n)?i=>{n.forEach(s=>s(i))}:n;return JN.traverseNodes({value:e},r),e};var JN;(e=>{e.traverseNodes=(l,u)=>{const{value:h}=l;if(!h)return;if(Object.prototype.toString.call(h)==="[object Object]")Object.entries(h).forEach(([g,v])=>(0,e.traverseNodes)({value:v,container:h,key:g,parent:l},u));else if(Array.isArray(h))for(let g=h.length-1;g>=0;g--){const v=h[g];(0,e.traverseNodes)({value:v,container:h,index:g,parent:l},u)}const p=n({node:l});u(p)};const n=({node:l})=>({node:l,setValue:u=>r(l,u),getParents:()=>i(l),getPath:()=>s(l),getStringifyPath:()=>o(l),deleteSelf:()=>a(l)}),r=(l,u)=>{if(!u||!l)return;l.value=u;const{container:h,key:p,index:g}=l;p&&h?h[p]=u:typeof g=="number"&&(h[g]=u)},i=l=>{const u=[];let h=l;for(;h;)u.unshift(h),h=h.parent;return u},s=l=>{const u=[];return i(l).forEach(p=>{p.key?u.unshift(p.key):p.index&&u.unshift(p.index)}),u},o=l=>s(l).reduce((h,p)=>typeof p=="string"?/\W/g.test(p)?`${h}["${p}"]`:`${h}.${p}`:`${h}[${p}]`,""),a=l=>{const{container:u,key:h,index:p}=l;h&&u?delete u[h]:typeof p=="number"&&u.splice(p,1)}})(JN||(JN={}));var tv;(e=>{const n=o6("1234567890",6);e.getAllNodeIds=s=>{const o=new Set,a=l=>{var u;o.add(l.id),(u=l.blocks)!=null&&u.length&&l.blocks.forEach(h=>a(h))};return s.nodes.forEach(l=>a(l)),Array.from(o)},e.generateNodeReplaceMap=(s,o)=>{const a=new Map;return s.forEach(l=>{if(o(l))a.set(l,l);else{let u;do u=n();while(!o(u));a.set(l,u)}}),a};const r=s=>s!=null,i=s=>{var a,l,u,h,p,g,v;const{node:o}=s;return!!(o!=null&&o.key&&["sourceNodeID","targetNodeID"].includes(o.key)&&((l=(a=o.parent)==null?void 0:a.parent)==null?void 0:l.key)==="edges"||(o==null?void 0:o.key)==="id"&&r((u=o.container)==null?void 0:u.type)&&r((h=o.container)==null?void 0:h.meta)&&r((p=o.container)==null?void 0:p.data)||(o==null?void 0:o.key)==="blockID"&&r((g=o.container)==null?void 0:g.name)&&((v=o.container)==null?void 0:v.source)==="block-output")};e.replaceNodeId=(s,o)=>(xpe(s,a=>{if(!i(a))return;const{node:l}=a;o.has(l.value)&&a.setValue(o.get(l.value))}),s)})(tv||(tv={}));const Spe=e=>{const{json:n,isUniqueId:r}=e,i=tv.getAllNodeIds(n),s=tv.generateNodeReplaceMap(i,r);return tv.replaceNodeId(n,s)};class _${constructor(n){this.commandId=Ws.PASTE,this.shortcuts=["meta v","ctrl v"],this.document=n.get(Et),this.selectService=n.get(or),this.entityManager=n.get(Sn),this.hoverService=n.get(Zs),this.dragService=n.get(yr),this.execute=this.execute.bind(this)}async execute(){const n=await this.tryReadClipboard();if(!n||!this.isValidData(n))return;const r=this.apply(n);return r.length>0&&(Iu.success({content:"Copy successfully",showClose:!1}),await this.nextTick(),this.scrollNodesToView(r)),r}apply(n){const{json:r}=n,i=Spe({json:r,isUniqueId:l=>!this.entityManager.getEntityById(l)}),s=this.calcPasteOffset(n.bounds),o=this.getSelectedContainer();this.applyOffset({json:i,offset:s,parent:o});const{nodes:a}=this.document.renderJSON(i,{parent:o});return this.selectNodes(a),a}isValidData(n){return(n==null?void 0:n.type)!==w$?(Iu.error({content:"Invalid clipboard data"}),!1):n.source.host!==window.location.host?(Iu.error({content:"Cannot paste nodes from different host"}),!1):!0}async tryReadClipboard(){try{const n=await navigator.clipboard.readText()||"";return JSON.parse(n)}catch{return}}calcPasteOffset(n){const{x:r,y:i,width:s,height:o}=n,a=new Qe(r,i,s,o),{center:l}=a,u=this.hoverService.hoveredPos;return{x:u.x-l.x,y:u.y-l.y}}applyOffset(n){const{json:r,offset:i,parent:s}=n;r.nodes.forEach(o=>{var l;if(!((l=o.meta)!=null&&l.position))return;let a={x:o.meta.position.x+i.x,y:o.meta.position.y+i.y};s&&(a=this.dragService.adjustSubNodePosition(o.type,s,a)),o.meta.position=a})}getSelectedContainer(){const{activatedNode:n}=this.selectService;return n!=null&&n.getNodeMeta().isContainer?n:void 0}selectNodes(n){this.selectService.selection=n}async scrollNodesToView(n){const r=n.map(i=>i.getData(at).bounds);await this.document.playgroundConfig.scrollToView({bounds:Qe.enlarge(r)})}async nextTick(){await bc(16),await new Promise(r=>requestAnimationFrame(r))}}class Dpe{constructor(n){this.commandId=Ws.EXPAND,this.commandDetail={label:"Expand"},this.shortcuts=["meta alt closebracket","ctrl alt openbracket"],this.selectService=n.get(or),this.execute=this.execute.bind(this)}async execute(){this.selectService.selectedNodes.forEach(n=>{n.renderData.expanded=!0})}}class Npe{constructor(n){this.commandId=Ws.DELETE,this.shortcuts=["backspace","delete"],this.document=n.get(Et),this.selectService=n.get(or),this.execute=this.execute.bind(this)}async execute(){this.isValid(this.selectService.selectedNodes)&&(this.selectService.selection.forEach(n=>{n instanceof To?this.removeNode(n):n instanceof zs?this.removeLine(n):n.dispose()}),this.selectService.selection=this.selectService.selection.filter(n=>!n.disposed))}isValid(n){return n.some(i=>[Xi.Start,Xi.End].includes(i.flowNodeType))?(Iu.error({content:"Start or End node cannot be deleted",showClose:!1}),!1):!0}removeNode(n){var s;if(!this.document.canRemove(n))return;const r=n.getNodeMeta(),i=(s=r.subCanvas)==null?void 0:s.call(r,n);if(i!=null&&i.isCanvas){i.parentNode.dispose();return}n.dispose()}removeLine(n){this.document.linesManager.canRemove(n)&&n.dispose()}}class C${constructor(n){this.commandId=Ws.COPY,this.shortcuts=["meta c","ctrl c"],this.document=n.get(Et),this.selectService=n.get(or),this.execute=this.execute.bind(this)}async execute(){if(await this.hasSelectedText()||!this.isValid(this.selectedNodes))return;const n=this.toClipboardData();await this.write(n)}async hasSelectedText(){var n,r;return(n=window.getSelection())!=null&&n.toString()?(await navigator.clipboard.writeText(((r=window.getSelection())==null?void 0:r.toString())??""),Iu.success({content:"Text copied"}),!0):!1}get selectedNodes(){return this.selectService.selection.filter(n=>n instanceof To)}isValid(n){return n.length===0?(Iu.warning({content:"No nodes selected"}),!1):!0}toClipboardData(n){const r=this.getValidNodes(n||this.selectedNodes),i=this.toSource(),s=this.toJSON(r),o=this.getEntireBounds(r);return{type:w$,source:i,json:s,bounds:o}}getValidNodes(n){return n.filter(r=>!([Xi.Start,Xi.End].includes(r.flowNodeType)||r.getNodeMeta().copyDisable))}toSource(){return{host:window.location.host}}toJSON(n){const r=this.getNodeJSONs(n),i=this.getEdgeJSONs(n);return{nodes:r,edges:i}}getNodeJSONs(n){return n.map(i=>{var a;const s=this.document.toNodeJSON(i);if(!((a=s.meta)!=null&&a.position))return s;const{bounds:o}=i.getData(qt);return s.meta.position={x:o.x,y:o.y},s}).filter(Boolean)}getEdgeJSONs(n){const r=new Set,i=new Set(n.map(s=>s.id));return n.forEach(s=>{const o=s.getData(el);[...o.inputLines,...o.outputLines].forEach(l=>{var u;i.has(l.from.id)&&((u=l.to)!=null&&u.id)&&i.has(l.to.id)&&r.add(l)})}),Array.from(r).map(s=>s.toJSON())}getEntireBounds(n){const r=n.map(s=>s.getData(qt).bounds),i=Qe.enlarge(r);return{x:i.x,y:i.y,width:i.width,height:i.height}}async write(n){try{await navigator.clipboard.writeText(JSON.stringify(n)),this.notifySuccess()}catch(r){console.error("Failed to write text: ",r)}}notifySuccess(){const n=this.selectedNodes.map(r=>r.flowNodeType);if(n.includes("start")||n.includes("end")){Iu.warning({content:"The Start/End node cannot be duplicated, other nodes have been copied to the clipboard",showClose:!1});return}Iu.success({content:"Nodes have been copied to the clipboard",showClose:!1})}}class Ipe{constructor(n){this.commandId=Ws.COLLAPSE,this.commandDetail={label:"Collapse"},this.shortcuts=["meta alt openbracket","ctrl alt openbracket"],this.selectService=n.get(or),this.execute=this.execute.bind(this)}async execute(){this.selectService.selectedNodes.forEach(n=>{n.renderData.expanded=!1})}}function Ope(e,n){e.addHandlers(new C$(n),new _$(n),new Epe(n),new Ipe(n),new Dpe(n),new Npe(n),new Cpe(n),new _pe(n))}var Tpe=Object.defineProperty,Mpe=Object.getOwnPropertyDescriptor,m0=(e,n,r,i)=>{for(var s=i>1?void 0:i?Mpe(n,r):n,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(i?a(n,r,s):a(s))||s);return i&&s&&Tpe(n,r,s),s};let jh=class{save(){console.log(this.document.toJSON())}};m0([oe(tj)],jh.prototype,"ctx",2);m0([oe(oa)],jh.prototype,"selectionService",2);m0([oe(qi)],jh.prototype,"playground",2);m0([oe(Et)],jh.prototype,"document",2);jh=m0([$e()],jh);function Ppe(e){return Object.entries(e).sort((n,r)=>(WP(n==null?void 0:n[1],"extra.index")||0)-(WP(r==null?void 0:r[1],"extra.index")||0))}function eI(e){const{type:n}=e||{};if(n)switch(n){case"object":return Ka.createObject({properties:Ppe(e.properties||{}).map(([r,i])=>({key:r,type:eI(i),meta:{description:i.description}}))});case"array":return Ka.createArray({items:eI(e.items)});case"string":return Ka.createString();case"number":return Ka.createNumber();case"boolean":return Ka.createBoolean();case"integer":return Ka.createInteger();default:return Ka.createCustomType({typeName:n})}}const Ape=Gn({onInit(e,n){e.document.onNodeCreate(({node:i})=>{const s=Km(i),o=i.getData(na),a=l=>{var h,p;if(!l){o.clearVar();return}const u=eI(l);if(u){const g=(s==null?void 0:s.getValueIn("title"))||i.id;o.setVar(Ka.createVariableDeclaration({meta:{title:`${g}`,icon:(p=(h=i.getNodeRegistry())==null?void 0:h.info)==null?void 0:p.icon},key:`${i.id}.outputs`,type:u}))}else o.clearVar()};s&&(a(s.getValueIn("outputs")),s.onFormValuesChange(l=>{(l.name.match(/^outputs/)||l.name.match(/^title/))&&a(s.getValueIn("outputs"))}))})}}),Rpe=xt.span`
|
||
font-size: 12px;
|
||
color: red;
|
||
`,kpe=xt.span`
|
||
font-size: 12px;
|
||
color: orange;
|
||
`,pT=({errors:e,warnings:n,invalid:r})=>{const i=s=>s?s.map(o=>F.jsx("span",{children:o.message},o.name)):null;return F.jsxs("div",{children:[F.jsx("div",{children:F.jsx(Rpe,{children:i(e)})}),F.jsx("div",{children:F.jsx(kpe,{children:i(n)})})]})},Lpe=xt.div`
|
||
box-sizing: border-box;
|
||
width: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
background-color: rgba(0, 0, 0, 0.02);
|
||
padding: 0 12px 12px;
|
||
`,jpe=xt.div`
|
||
color: var(--semi-color-text-2);
|
||
font-size: 12px;
|
||
line-height: 20px;
|
||
padding: 0px 4px;
|
||
word-break: break-all;
|
||
white-space: break-spaces;
|
||
`;function Ju(e){var o;const{node:n,expanded:r}=E_(),i=dd(),s=n.getNodeRegistry();return F.jsx(Lpe,{children:r?F.jsxs(F.Fragment,{children:[i&&F.jsx(jpe,{children:(o=s.info)==null?void 0:o.description}),e.children]}):void 0})}const Fpe=xt.div`
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
column-gap: 6px;
|
||
`;function E$({name:e,type:n,isArray:r,className:i}){const s=r?uT[n]:vh[n];return F.jsx(Rn,{content:F.jsxs(Fpe,{children:[s," ",n]}),children:F.jsxs(Gs,{color:"white",className:i,style:{padding:4,maxWidth:450},children:[s,e&&F.jsxs("span",{style:{display:"inline-block",marginLeft:4,marginTop:-1,overflow:"hidden",textOverflow:"ellipsis"},children:[" ",e]})]})})}const $pe=xt.div`
|
||
display: flex;
|
||
gap: 6px;
|
||
flex-wrap: wrap;
|
||
border-top: 1px solid var(--semi-color-border);
|
||
padding: 8px 0 0;
|
||
width: 100%;
|
||
|
||
:global(.semi-tag .semi-tag-content) {
|
||
font-size: 10px;
|
||
}
|
||
`;function pg(){return dd()?null:F.jsx(cl,{name:"outputs",children:({field:n})=>{var i;const r=(i=n.value)==null?void 0:i.properties;if(r){const s=Object.keys(r).map(o=>{const a=r[o];return F.jsx(E$,{name:o,type:a.type},o)});return F.jsx($pe,{children:s})}return F.jsx(F.Fragment,{})}})}const zpe=xt.div`
|
||
background-color: var(--semi-color-fill-0);
|
||
border-radius: var(--semi-border-radius-small);
|
||
padding-left: 12px;
|
||
width: 100%;
|
||
min-height: 24px;
|
||
line-height: 24px;
|
||
display: flex;
|
||
align-items: center;
|
||
&.has-error {
|
||
outline: red solid 1px;
|
||
}
|
||
`,Vpe=e=>F.jsxs(zpe,{className:e.hasError?"has-error":"",children:[e.value,e.value===void 0||e.value===""?F.jsx("span",{style:{color:"var(--semi-color-text-2)"},children:e.placeholder||"--"}):null]});function Bpe(e){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:F.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.581 4.49A2.75 2.75 0 0 1 8.319 2h.931a.75.75 0 0 1 0 1.5h-.931a1.25 1.25 0 0 0-1.245 1.131l-.083.869H9.25a.75.75 0 0 1 0 1.5H6.849l-.43 4.51A2.75 2.75 0 0 1 3.681 14H2.75a.75.75 0 0 1 0-1.5h.931a1.25 1.25 0 0 0 1.245-1.132L5.342 7H3.75a.75.75 0 0 1 0-1.5h1.735zM9.22 9.22a.75.75 0 0 1 1.06 0l1.22 1.22l1.22-1.22a.75.75 0 1 1 1.06 1.06l-1.22 1.22l1.22 1.22a.75.75 0 1 1-1.06 1.06l-1.22-1.22l-1.22 1.22a.75.75 0 1 1-1.06-1.06l1.22-1.22l-1.22-1.22a.75.75 0 0 1 0-1.06",clipRule:"evenodd"})})}function Uk({value:e,onChange:n,readonly:r,hasError:i,style:s}){return r?F.jsx(Vpe,{value:e,hasError:i}):F.jsx(vc,{value:e,onChange:n,validateStatus:i?"error":void 0,style:s})}function x$(e){const{value:n,onChange:r,readonly:i,literal:s,icon:o}=e;if(s)return F.jsx(Uk,{value:n,onChange:r,readonly:i});const a=typeof n=="object"&&n.type==="expression",l=()=>{r(a?n.content:{content:n,type:"expression"})};return F.jsxs("div",{style:{display:"flex",maxWidth:300},children:[a?F.jsx(i$,{value:n.content,hasError:e.hasError,style:{flexGrow:1},onChange:u=>r({type:"expression",content:u}),readonly:i}):F.jsx(Uk,{value:n,onChange:r,hasError:e.hasError,readonly:i,style:{flexGrow:1,outline:e.hasError?"1px solid red":void 0}}),!i&&(o||F.jsx(Cr,{theme:"borderless",icon:F.jsx(Bpe,{}),onClick:l}))]})}const{Text:Hpe}=ad;function S$({children:e,name:n,required:r,description:i,type:s,labelWidth:o}){const a=R.useCallback(l=>F.jsxs("div",{style:{width:"0",display:"flex",flex:"1"},children:[F.jsx(Hpe,{style:{width:"100%"},ellipsis:{showTooltip:!!l},children:n}),r&&F.jsx("span",{style:{color:"#f93920",paddingLeft:"2px"},children:"*"})]}),[]);return F.jsxs("div",{style:{fontSize:12,marginBottom:6,width:"100%",position:"relative",display:"flex",justifyContent:"center",alignItems:"center",gap:8},children:[F.jsxs("div",{style:{justifyContent:"center",alignItems:"center",color:"var(--semi-color-text-0)",width:o||118,position:"relative",display:"flex",columnGap:4,flexShrink:0},children:[F.jsx(E$,{className:"form-item-type-tag",type:s}),i?F.jsx(Rn,{content:i,children:a()}):a(!0)]}),F.jsx("div",{style:{flexGrow:1,minWidth:0},children:e})]})}function tI(){const e=!dd();return F.jsx(cl,{name:"inputs",children:({field:n})=>{var o,a;const r=((o=n.value)==null?void 0:o.required)||[],i=(a=n.value)==null?void 0:a.properties;if(!i)return F.jsx(F.Fragment,{});const s=Object.keys(i).map(l=>{const u=i[l];return F.jsx(cl,{name:`inputsValues.${l}`,defaultValue:u.default,children:({field:h,fieldState:p})=>F.jsxs(S$,{name:l,type:u.type,required:r.includes(l),children:[F.jsx(x$,{value:h.value,onChange:h.onChange,readonly:e,hasError:Object.keys((p==null?void 0:p.errors)||{}).length>0}),F.jsx(pT,{errors:p==null?void 0:p.errors})]})},l)});return F.jsx(F.Fragment,{children:s})}})}const D$=({node:e,deleteNode:n})=>{var S;const[r,i]=R.useState(!0),s=Wh(),o=e.getNodeRegistry(),a=Wt(_i),l=Wt(or),u=Wt(yr),h=a.canMoveOutContainer(e),p=R.useCallback(()=>{i(!1),requestAnimationFrame(()=>{i(!0)})},[]),g=R.useCallback(async E=>{E.stopPropagation();const x=e.parent;a.moveOutContainer({node:e}),await a.clearInvalidLines({dragNode:e,sourceParent:x}),p(),await bc(16),l.selectNode(e),u.startDragSelectedNodes(E)},[a,e,p]),v=R.useCallback(E=>{const x=new C$(s),I=new _$(s),P=x.toClipboardData([e]);I.apply(P),E.stopPropagation()},[s,e]),w=R.useCallback(E=>{n(),E.stopPropagation()},[s,e]);if(r)return F.jsx(En,{trigger:"hover",position:"bottomRight",render:F.jsxs(En.Menu,{children:[h&&F.jsx(En.Item,{onClick:g,children:"Move out"}),F.jsx(En.Item,{onClick:v,disabled:o.meta.copyDisable===!0,children:"Create Copy"}),F.jsx(En.Item,{onClick:w,disabled:!!((S=o.canDelete)!=null&&S.call(o,s,e)||o.meta.deleteDisable),children:"Delete"})]}),children:F.jsx(Lr,{color:"secondary",size:"small",theme:"borderless",icon:F.jsx(tle,{}),onClick:E=>E.stopPropagation()})})},Upe=xt.div`
|
||
box-sizing: border-box;
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
width: 100%;
|
||
column-gap: 8px;
|
||
border-radius: 8px 8px 0 0;
|
||
cursor: move;
|
||
|
||
background: linear-gradient(#f2f2ff 0%, rgba(0, 0, 0, 0.02) 100%);
|
||
overflow: hidden;
|
||
|
||
padding: 8px;
|
||
`,Kpe=xt.div`
|
||
font-size: 20px;
|
||
flex: 1;
|
||
width: 0;
|
||
`,Wpe=xt.img`
|
||
width: 24px;
|
||
height: 24px;
|
||
scale: 0.8;
|
||
border-radius: 4px;
|
||
`,qpe=xt.div`
|
||
display: flex;
|
||
align-items: center;
|
||
column-gap: 4px;
|
||
`,Gpe=e=>{var r;const n=(r=e.getNodeRegistry().info)==null?void 0:r.icon;return n?F.jsx(Wpe,{src:n}):null},{Text:Ype}=ad;function ed(){const{node:e,expanded:n,toggleExpand:r,readonly:i,deleteNode:s}=E_(),o=dd(),a=l=>{r(),l.stopPropagation()};return F.jsxs(Upe,{children:[Gpe(e),F.jsx(Kpe,{children:F.jsx(cl,{name:"title",children:({field:{value:l,onChange:u},fieldState:h})=>F.jsxs("div",{style:{height:24},children:[F.jsx(Ype,{ellipsis:{showTooltip:!0},children:l}),F.jsx(pT,{errors:h==null?void 0:h.errors})]})})}),e.renderData.expandable&&!o&&F.jsx(Cr,{type:"primary",icon:n?F.jsx(cle,{}):F.jsx(dle,{}),size:"small",theme:"borderless",onClick:a}),i?void 0:F.jsx(qpe,{children:F.jsx(D$,{node:e,deleteNode:s})})]})}const Xpe=["object","boolean","array","string","integer","number"],Zpe=e=>{const{value:n,disabled:r}=e,i=vh[n];return F.jsx(En,{trigger:"hover",position:"bottomRight",disabled:r,render:F.jsx(En.Menu,{children:Xpe.map(s=>F.jsxs(En.Item,{onClick:()=>{var o;(o=e.onChange)==null||o.call(e,s)},children:[vh[s],F.jsx("span",{style:{paddingLeft:"4px"},children:s})]},s))}),children:F.jsx(Gs,{color:"white",style:e.style,onClick:s=>{s.stopPropagation(),s.preventDefault()},children:i})})},Qpe=xt.div`
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
font-size: 12px;
|
||
margin-bottom: 6px;
|
||
`,Jpe=xt.div`
|
||
width: 300px;
|
||
margin-right: 10px;
|
||
position: relative;
|
||
`,Kk=e=>{const{value:n,disabled:r}=e,[i,s]=R.useState(e.propertyKey),o=(a,l)=>{n[a]=l,e.onChange(n,e.propertyKey)};return R.useLayoutEffect(()=>{s(e.propertyKey)},[e.propertyKey]),F.jsxs(Qpe,{children:[F.jsxs(Jpe,{children:[F.jsx(Zpe,{value:n.type,disabled:r,style:{position:"absolute",top:6,left:4,zIndex:1},onChange:a=>o("type",a)}),F.jsx(vc,{value:i,disabled:r,onChange:a=>s(a.trim()),onBlur:()=>{i!==""?e.onChange(n,e.propertyKey,i):s(e.propertyKey)},style:{paddingLeft:26}})]}),e.useFx?F.jsx(i$,{value:n.default,readonly:r,onChange:a=>o("default",a),style:{flexGrow:1,height:32}}):F.jsx(vc,{disabled:r,value:n.default,onChange:a=>o("default",a)}),e.onDelete&&!r&&F.jsx(Cr,{theme:"borderless",icon:F.jsx(Gj,{}),onClick:e.onDelete})]})},ege=e=>{const n=e.value||{},{readonly:r}=E_(),[i,s]=R.useState({key:"",value:{type:"string"}}),[o,a]=R.useState(),l=()=>{s({key:"",value:{type:"string"}}),a(!1)},u=(p,g,v)=>{const w={...n};v?(delete w[g],w[v]=p):w[g]=p,e.onChange(w)},h=(p,g,v)=>{v?(v in n||u(p,g,v),l()):s({key:v||g,value:p})};return F.jsxs(F.Fragment,{children:[Object.keys(e.value||{}).map(p=>{const g=n[p]||{};return F.jsx(Kk,{propertyKey:p,useFx:e.useFx,value:g,disabled:r,onChange:u,onDelete:()=>{const v={...n};delete v[p],e.onChange(v)}},p)}),o&&F.jsx(Kk,{propertyKey:i.key,value:i.value,useFx:e.useFx,onChange:h,onDelete:()=>{const p=i.key;setTimeout(()=>{const g={...n};delete g[p],e.onChange(g),l()},10)}}),!r&&F.jsx("div",{children:F.jsx(Cr,{theme:"borderless",icon:F.jsx(r_,{}),onClick:()=>a(!0),children:"Add"})})]})},tge=({form:e})=>F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsxs(Ju,{children:[F.jsx(tI,{}),F.jsx(pg,{})]})]}),N$={render:tge,validateTrigger:zv.onChange,validate:{title:({value:e})=>e?void 0:"Title is required","inputsValues.*":({value:e,context:n,formValues:r,name:i})=>{var a;const s=i.replace(/^inputsValues\./,"");if((((a=r.inputs)==null?void 0:a.required)||[]).includes(s)&&(e===""||e===void 0))return`${s} is required`}}},qD=30,Wk=5;var v0=(e=>(e.Title="title",e.Color="color",e))(v0||{});const nge=({size:e})=>F.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg",style:{width:e,height:e},children:F.jsx("path",{id:"group",fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M 0.009766 10 L 0.009766 9.990234 L 0 9.990234 L 0 7.5 L 1 7.5 L 1 9 L 2.5 9 L 2.5 10 L 0.009766 10 Z M 3.710938 10 L 3.710938 9 L 6.199219 9 L 6.199219 10 L 3.710938 10 Z M 7.5 10 L 7.5 9 L 9 9 L 9 7.5 L 10 7.5 L 10 9.990234 L 9.990234 9.990234 L 9.990234 10 L 7.5 10 Z M 0 6.289063 L 0 3.800781 L 1 3.800781 L 1 6.289063 L 0 6.289063 Z M 9 6.289063 L 9 3.800781 L 10 3.800781 L 10 6.289063 L 9 6.289063 Z M 0 2.5 L 0 0.009766 L 0.009766 0.009766 L 0.009766 0 L 2.5 0 L 2.5 1 L 1 1 L 1 2.5 L 0 2.5 Z M 9 2.5 L 9 1 L 7.5 1 L 7.5 0 L 9.990234 0 L 9.990234 0.009766 L 10 0.009766 L 10 2.5 L 9 2.5 Z M 3.710938 1 L 3.710938 0 L 6.199219 0 L 6.199219 1 L 3.710938 1 Z"})}),rge=({size:e})=>F.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg",style:{width:e,height:e},children:F.jsx("path",{id:"ungroup",fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M 9.654297 10.345703 L 8.808594 9.5 L 7.175781 9.5 L 7.175781 8.609375 L 7.917969 8.609375 L 1.390625 2.082031 L 1.390625 2.824219 L 0.5 2.824219 L 0.5 1.191406 L -0.345703 0.345703 L 0.283203 -0.283203 L 1.166016 0.599609 L 2.724609 0.599609 L 2.724609 1.490234 L 2.056641 1.490234 L 8.509766 7.943359 L 8.509766 7.275391 L 9.400391 7.275391 L 9.400391 8.833984 L 10.283203 9.716797 L 9.654297 10.345703 Z M 0.509766 9.5 L 0.509766 9.490234 L 0.5 9.490234 L 0.5 7.275391 L 1.390625 7.275391 L 1.390625 8.609375 L 2.724609 8.609375 L 2.724609 9.5 L 0.509766 9.5 Z M 3.802734 9.5 L 3.802734 8.609375 L 6.017578 8.609375 L 6.017578 9.5 L 3.802734 9.5 Z M 0.5 6.197266 L 0.5 3.982422 L 1.390625 3.982422 L 1.390625 6.197266 L 0.5 6.197266 Z M 8.509766 6.197266 L 8.509766 3.982422 L 9.400391 3.982422 L 9.400391 6.197266 L 8.509766 6.197266 Z M 8.509766 2.824219 L 8.509766 1.490234 L 7.175781 1.490234 L 7.175781 0.599609 L 9.390625 0.599609 L 9.390625 0.609375 L 9.400391 0.609375 L 9.400391 2.824219 L 8.509766 2.824219 Z M 3.802734 1.490234 L 3.802734 0.599609 L 6.017578 0.599609 L 6.017578 1.490234 L 3.802734 1.490234 Z"})}),ige=({node:e,style:n})=>{const r=Wt(Qa);return F.jsx(Rn,{content:"Ungroup",children:F.jsx("div",{className:"workflow-group-ungroup",style:n,children:F.jsx(Cr,{icon:F.jsx(rge,{size:14}),style:{height:30,width:30},theme:"borderless",type:"tertiary",onClick:()=>{r.executeCommand(fT.Ungroup,e)}})})})},sge=()=>{const[e,n]=R.useState(!1);return F.jsx(cl,{name:v0.Title,children:({field:r})=>e?F.jsx(vc,{autoFocus:!0,className:"workflow-group-title-input",size:"small",value:r.value,onChange:r.onChange,onMouseDown:i=>i.stopPropagation(),onBlur:()=>n(!1),draggable:!1,onEnterPress:()=>n(!1)}):F.jsx("p",{className:"workflow-group-title",onDoubleClick:()=>n(!0),children:r.value??"Group"})})},gT="Blue",ww={Red:{50:"#fef2f2",300:"#fca5a5",400:"#f87171"},Orange:{50:"#fff7ed",300:"#fdba74",400:"#fb923c"},Amber:{50:"#fffbeb",300:"#fcd34d",400:"#fbbf24"},Yellow:{50:"#fef9c3",300:"#fde047",400:"#facc15"},Lime:{50:"#f7fee7",300:"#bef264",400:"#a3e635"},Green:{50:"#f0fdf4",300:"#86efac",400:"#4ade80"},Emerald:{50:"#ecfdf5",300:"#6ee7b7",400:"#34d399"},Teal:{50:"#f0fdfa",300:"#5eead4",400:"#2dd4bf"},Cyan:{50:"#ecfeff",300:"#67e8f9",400:"#22d3ee"},Sky:{50:"#ecfeff",300:"#7dd3fc",400:"#38bdf8"},Blue:{50:"#eff6ff",300:"#93c5fd",400:"#60a5fa"},Indigo:{50:"#eef2ff",300:"#a5b4fc",400:"#818cf8"},Violet:{50:"#f5f3ff",300:"#c4b5fd",400:"#a78bfa"},Purple:{50:"#faf5ff",300:"#d8b4fe",400:"#c084fc"},Fuchsia:{50:"#fdf4ff",300:"#f0abfc",400:"#e879f9"},Pink:{50:"#fdf2f8",300:"#f9a8d4",400:"#f472b6"},Rose:{50:"#fff1f2",300:"#fda4af",400:"#fb7185"},Gray:{50:"#f9fafb",300:"#d1d5db",400:"#9ca3af"}},oge=()=>F.jsx(cl,{name:v0.Color,children:({field:e})=>{const n=e.value??gT;return F.jsx(Yi,{position:"top",mouseLeaveDelay:300,content:F.jsx("div",{className:"workflow-group-color-palette",children:Object.entries(ww).map(([r,i])=>F.jsx(Rn,{content:r,mouseEnterDelay:300,children:F.jsx("span",{className:"workflow-group-color-item",style:{backgroundColor:i[300],borderColor:r===n?i[400]:"#fff"},onClick:()=>e.onChange(r)},r)},r))}),children:F.jsx("span",{className:"workflow-group-color",style:{backgroundColor:ww[n][300]}})})}}),age=()=>F.jsxs("div",{className:"workflow-group-tools",children:[F.jsx(Yj,{className:"workflow-group-tools-drag"}),F.jsx(sge,{}),F.jsx(oge,{})]}),qk="workflow-move-into-group-tip-visible",Gk="false";class yT{constructor(){this.closed=!1}static get instance(){return this._instance||(this._instance=new yT),this._instance}isClosed(){return this.isCloseForever()||this.closed}close(){this.closed=!0}isCloseForever(){return localStorage.getItem(qk)===Gk}closeForever(){localStorage.setItem(qk,Gk)}}const lge=()=>{const e=Vh(),[n,r]=R.useState(!1),i=yT.instance,s=Wt(_i),o=R.useCallback(()=>{i.isClosed()||r(!0)},[i]),a=R.useCallback(()=>{i.close(),r(!1)},[i]),l=R.useCallback(()=>{i.closeForever(),a()},[a,i]);return R.useEffect(()=>{const u=s.on(p=>{p.type===bw.In&&p.targetContainer===e&&o()}),h=s.on(p=>{p.type===bw.Out&&p.sourceContainer===e&&!e.blocks.length&&r(!1)});return()=>{u.dispose(),h.dispose()}},[s,e,o,a,n]),{visible:n,close:a,closeForever:l}},cge=xt.div`
|
||
position: absolute;
|
||
top: 35px;
|
||
|
||
width: 100%;
|
||
height: 28px;
|
||
white-space: nowrap;
|
||
pointer-events: auto;
|
||
|
||
.container {
|
||
display: inline-flex;
|
||
justify-content: center;
|
||
height: 100%;
|
||
width: 100%;
|
||
background-color: rgb(255 255 255);
|
||
border-radius: 8px 8px 0 0;
|
||
|
||
.content {
|
||
overflow: hidden;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: flex-start;
|
||
|
||
width: fit-content;
|
||
height: 100%;
|
||
padding: 0 12px;
|
||
|
||
.text {
|
||
font-size: 14px;
|
||
font-weight: 400;
|
||
font-style: normal;
|
||
line-height: 20px;
|
||
color: rgba(15, 21, 40, 82%);
|
||
text-overflow: ellipsis;
|
||
margin: 0;
|
||
}
|
||
|
||
.space {
|
||
width: 128px;
|
||
}
|
||
}
|
||
|
||
.actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
align-items: center;
|
||
|
||
height: 28px;
|
||
padding: 0 12px;
|
||
|
||
.close-forever {
|
||
cursor: pointer;
|
||
|
||
padding: 0 3px;
|
||
|
||
font-size: 12px;
|
||
font-weight: 400;
|
||
font-style: normal;
|
||
line-height: 12px;
|
||
color: rgba(32, 41, 69, 62%);
|
||
margin: 0;
|
||
}
|
||
|
||
.close {
|
||
display: flex;
|
||
cursor: pointer;
|
||
height: 100%;
|
||
align-items: center;
|
||
}
|
||
}
|
||
}
|
||
`,uge=/(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(navigator.userAgent),dge=()=>F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16",children:F.jsx("path",{fill:"#060709",fillOpacity:"0.5",d:"M12.13 12.128a.5.5 0 0 0 .001-.706L8.71 8l3.422-3.423a.5.5 0 0 0-.001-.705.5.5 0 0 0-.706-.002L8.002 7.293 4.579 3.87a.5.5 0 0 0-.705.002.5.5 0 0 0-.002.705L7.295 8l-3.423 3.422a.5.5 0 0 0 .002.706c.195.195.51.197.705.001l3.423-3.422 3.422 3.422c.196.196.51.194.706-.001"})}),hge=()=>{const{visible:e,close:n,closeForever:r}=lge();return e?F.jsx(cge,{className:"workflow-group-tips",children:F.jsxs("div",{className:"container",children:[F.jsxs("div",{className:"content",children:[F.jsx("p",{className:"text",children:`Hold ${uge?"Cmd ⌘":"Ctrl"} to drag node out`}),F.jsx("div",{className:"space",style:{width:0}})]}),F.jsxs("div",{className:"actions",children:[F.jsx("p",{className:"close-forever",onClick:r,children:"Never Remind"}),F.jsx("div",{className:"close",onClick:n,children:F.jsx(dge,{})})]})]})}):null},fge=({onMouseDown:e,onFocus:n,onBlur:r,children:i,style:s})=>{const o=r8(v0.Color)??gT,a=ww[o];return F.jsx("div",{className:"workflow-group-header",onMouseDown:e,onFocus:n,onBlur:r,style:{...s,backgroundColor:a[50],borderColor:a[300]},children:i})},pge=({node:e,style:n})=>{const r=r8(v0.Color)??gT,i=ww[r];return R.useEffect(()=>{const s=document.createElement("style"),o=`
|
||
.workflow-group-render[data-group-id="${e.id}"] .workflow-group-background {
|
||
border: 1px solid ${i[300]};
|
||
}
|
||
|
||
.workflow-group-render.selected[data-group-id="${e.id}"] .workflow-group-background {
|
||
border: 1px solid ${i[400]};
|
||
}
|
||
`;return s.textContent=o,document.head.appendChild(s),()=>{s.remove()}},[i]),F.jsx("div",{className:"workflow-group-background","data-flow-editor-selectable":"true",style:{...n,backgroundColor:`${i[300]}29`}})},gge=()=>{const{node:e,selected:n,selectNode:r,nodeRef:i,startDrag:s,onFocus:o,onBlur:a}=xc(),l=v$(),u=e.getData(gr).getFormModel(),h=u==null?void 0:u.formControl,{height:p,width:g}=l??{},v=p??0;return F.jsx("div",{className:`workflow-group-render ${n?"selected":""}`,ref:i,"data-group-id":e.id,"data-node-selected":String(n),onMouseDown:r,onClick:w=>{r(w)},style:{width:g,height:p},children:F.jsx(PI,{control:h,children:F.jsxs(F.Fragment,{children:[F.jsx(fge,{onMouseDown:w=>{s(w)},onFocus:o,onBlur:a,style:{height:qD},children:F.jsx(age,{})}),F.jsx(hge,{}),F.jsx(ige,{node:e}),F.jsx(pge,{node:e,style:{top:qD+Wk,height:v-qD-Wk}})]})})})},Ip=24,yge=({bounds:e,children:n,flowSelectConfig:r,commandRegistry:i})=>F.jsxs(F.Fragment,{children:[F.jsx("div",{style:{position:"absolute",left:e.right,top:e.top,transform:"translate(-100%, -100%)"},onMouseDown:s=>{s.stopPropagation()},children:F.jsxs(VO,{size:"small",style:{display:"flex",flexWrap:"nowrap",height:Ip},children:[F.jsx(Rn,{content:"Collapse",children:F.jsx(Cr,{icon:F.jsx(Zj,{}),style:{height:Ip},type:"primary",theme:"solid",onMouseDown:s=>{i.executeCommand(Ws.COLLAPSE)}})}),F.jsx(Rn,{content:"Expand",children:F.jsx(Cr,{icon:F.jsx(TO,{}),style:{height:Ip},type:"primary",theme:"solid",onMouseDown:s=>{i.executeCommand(Ws.EXPAND)}})}),F.jsx(Rn,{content:"Create Group",children:F.jsx(Cr,{icon:F.jsx(nge,{size:14}),style:{height:Ip},type:"primary",theme:"solid",onClick:()=>{i.executeCommand(fT.Group)}})}),F.jsx(Rn,{content:"Copy",children:F.jsx(Cr,{icon:F.jsx(qj,{}),style:{height:Ip},type:"primary",theme:"solid",onClick:()=>{i.executeCommand(Ws.COPY)}})}),F.jsx(Rn,{content:"Delete",children:F.jsx(Cr,{type:"primary",theme:"solid",icon:F.jsx(Lae,{}),style:{height:Ip},onClick:()=>{i.executeCommand(Ws.DELETE)}})})]})}),F.jsx("div",{children:n})]}),mT=D.createContext({}),vT=D.createContext({visible:!1,setNodeRender:()=>{}}),I$=D.createContext(!1),mge=xt.div`
|
||
align-items: flex-start;
|
||
background-color: #fff;
|
||
border: 1px solid rgba(6, 7, 9, 0.15);
|
||
border-radius: 8px;
|
||
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.04), 0 4px 12px 0 rgba(0, 0, 0, 0.02);
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
position: relative;
|
||
min-width: 360px;
|
||
width: 100%;
|
||
height: auto;
|
||
|
||
&.selected {
|
||
border: 1px solid #4e40e5;
|
||
}
|
||
`,vge=()=>F.jsx(Xj,{style:{position:"absolute",color:"red",left:-6,top:-6,zIndex:1,background:"white",borderRadius:8}});function bge(e,n,r=448){const i=n.transform.bounds;e.playground.scrollToView({bounds:i,scrollDelta:{x:r/2,y:0},zoom:1,scrollToCenter:!0})}const wge=e=>{const{children:n,isScrollToView:r=!1}=e,i=E_(),{selected:s,startDrag:o,ports:a,selectNode:l,nodeRef:u,onFocus:h,onBlur:p}=i,[g,v]=R.useState(!1),w=R.useContext(vT),S=i.form,E=Wh(),x=a.map(I=>F.jsx(Fw,{entity:I},I.id));return F.jsxs(F.Fragment,{children:[F.jsx(mge,{className:s?"selected":"",ref:u,draggable:!0,onDragStart:I=>{o(I),v(!0)},onClick:I=>{l(I),g||(w.setNodeRender(i),r&&bge(E,i.node))},onMouseUp:()=>v(!1),onFocus:h,onBlur:p,"data-node-selected":String(s),style:{outline:S!=null&&S.state.invalid?"1px solid red":"none"},children:n}),x]})},_ge=({node:e})=>{const n=xc(),r=n.form,i=R.useCallback(()=>e.renderData.node||document.body,[]);return F.jsx(eT,{getPopupContainer:i,children:F.jsx(mT.Provider,{value:n,children:F.jsxs(wge,{children:[(r==null?void 0:r.state.invalid)&&F.jsx(vge,{}),r==null?void 0:r.render()]})})})},Cge=e=>{const n=ai(),{line:r,selected:i=!1,hovered:s}=e;return!(r.disposed||n.config.readonly||!i&&!s)},Ege=()=>F.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:F.jsxs("g",{id:"add",children:[F.jsx("path",{id:"background",fill:"#ffffff",fillRule:"evenodd",stroke:"none",d:"M 24 12 C 24 5.372583 18.627417 0 12 0 C 5.372583 0 -0 5.372583 -0 12 C -0 18.627417 5.372583 24 12 24 C 18.627417 24 24 18.627417 24 12 Z"}),F.jsx("path",{id:"content",fill:"currentColor",fillRule:"evenodd",stroke:"none",d:"M 22 12.005 C 22 6.482153 17.522848 2.004999 12 2.004999 C 6.477152 2.004999 2 6.482153 2 12.005 C 2 17.527847 6.477152 22.004999 12 22.004999 C 17.522848 22.004999 22 17.527847 22 12.005 Z"}),F.jsx("path",{id:"cross",fill:"#ffffff",stroke:"none",d:"M 11.411996 16.411797 C 11.411996 16.736704 11.675362 17 12.00023 17 C 12.325109 17 12.588474 16.736704 12.588474 16.411797 L 12.588474 12.58826 L 16.41201 12.58826 C 16.736919 12.58826 17.000216 12.324894 17.000216 12.000015 C 17.000216 11.675147 16.736919 11.411781 16.41201 11.411781 L 12.588474 11.411781 L 12.588474 7.588234 C 12.588474 7.263367 12.325109 7 12.00023 7 C 11.675362 7 11.411996 7.263367 11.411996 7.588234 L 11.411996 11.411781 L 7.588449 11.411781 C 7.263581 11.411781 7.000215 11.675147 7.000215 12.000015 C 7.000215 12.324894 7.263581 12.58826 7.588449 12.58826 L 11.411996 12.58826 L 11.411996 16.411797 Z"})]})}),xge=e=>{const{line:n,selected:r,hovered:i,color:s}=e,o=Cge({line:n,selected:r,hovered:i}),a=Wt(_s),l=Wt(Et),u=Wt(yr),h=Wt(oi),p=Wt(ar),{fromPort:g,toPort:v}=n,w=R.useCallback(async()=>{const S={x:(n.position.from.x+n.position.to.x)/2,y:(n.position.from.y+n.position.to.y)/2},E=Bs.getContainerNode({fromPort:g}),x=await a.singleSelectNodePanel({position:S,containerNode:E,panelProps:{enableScrollClose:!0}});if(!x)return;const{nodeType:I,nodeJSON:P}=x,M=Bs.adjustNodePosition({nodeType:I,position:S,fromPort:g,toPort:v,containerNode:E,document:l,dragService:u}),k=l.createWorkflowNodeByType(I,M,P??{},E==null?void 0:E.id);g&&v&&Bs.subNodesAutoOffset({node:k,fromPort:g,toPort:v,containerNode:E,historyService:p,dragService:u,linesManager:h}),await bc(20),Bs.buildLine({fromPort:g,node:k,toPort:v,linesManager:h}),n.dispose()},[]);return o?F.jsx("div",{className:"line-add-button",style:{left:"50%",top:"50%",color:s},"data-testid":"sdk.workflow.canvas.line.add","data-line-id":n.id,onClick:w,children:F.jsx(Ege,{})}):F.jsx(F.Fragment,{})},Sge=()=>F.jsx("div",{className:"node-placeholder","data-testid":"workflow.detail.node-panel.placeholder",children:F.jsx(Vs,{className:"node-placeholder-skeleton",loading:!0,active:!0,placeholder:F.jsxs("div",{className:"",children:[F.jsxs("div",{className:"node-placeholder-hd",children:[F.jsx(Vs.Avatar,{shape:"square",className:"node-placeholder-avatar"}),F.jsx(Vs.Title,{style:{width:141}})]}),F.jsxs("div",{className:"node-placeholder-content",children:[F.jsxs("div",{className:"node-placeholder-footer",children:[F.jsx(Vs.Title,{style:{width:85}}),F.jsx(Vs.Title,{style:{width:241}})]}),F.jsx(Vs.Title,{style:{width:220}})]})]})})}),Dge=xt.div`
|
||
width: 100%;
|
||
height: 32px;
|
||
border-radius: 5px;
|
||
display: flex;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
font-size: 19px;
|
||
padding: 0 15px;
|
||
&:hover {
|
||
background-color: hsl(252deg 62% 55% / 9%);
|
||
color: hsl(252 62% 54.9%);
|
||
}
|
||
`,Nge=xt.div`
|
||
font-size: 12px;
|
||
margin-left: 10px;
|
||
`;function Ige(e){return F.jsxs(Dge,{onClick:e.disabled?void 0:e.onClick,style:e.disabled?{opacity:.3}:{},children:[F.jsx("div",{style:{fontSize:14},children:e.icon}),F.jsx(Nge,{children:e.label})]})}const Oge=xt.div`
|
||
max-height: 500px;
|
||
overflow: auto;
|
||
&::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
`,Tge=e=>{const{onSelect:n}=e,r=Wh(),i=(s,o)=>{var l;const a=(l=o.onAdd)==null?void 0:l.call(o,r);n({nodeType:o.type,selectEvent:s,nodeJSON:a})};return F.jsx(Oge,{style:{width:80*2+20},children:dye.map(s=>{var o,a;return F.jsx(Ige,{disabled:!(((o=s.canAdd)==null?void 0:o.call(s,r))??!0),icon:F.jsx("img",{style:{width:10,height:10,borderRadius:4},src:(a=s.info)==null?void 0:a.icon}),label:s.type,onClick:l=>i(l,s)},s.type)})})},Mge=e=>{const{onSelect:n,position:r,onClose:i,panelProps:s}=e,o=(s==null?void 0:s.enableNodePlaceholder)??!1;return F.jsx(Yi,{trigger:"click",visible:!0,onVisibleChange:a=>a?null:i(),content:F.jsx(Tge,{onSelect:n}),placement:"right",popupAlign:{offset:[30,0]},overlayStyle:{padding:0},children:F.jsx("div",{style:o?{position:"absolute",top:r.y-61.5,left:r.x,width:360,height:100}:{position:"absolute",top:r.y,left:r.x,width:0,height:0},children:o&&F.jsx(Sge,{})})})};var ta=(e=>(e.Size="size",e.Note="note",e))(ta||{}),Tv=(e=>(e.Change="change",e.MultiSelect="multiSelect",e.Select="select",e.Blur="blur",e))(Tv||{});const Yk="",Pge=e=>{const{model:n,height:r}=e,i=ai(),[s,o]=R.useState(!1),a=R.useCallback(()=>n.element?n.element.scrollHeight>n.element.clientHeight:!1,[n,r,i]),l=R.useCallback(()=>{o(a())},[a]);return R.useEffect(()=>{l()},[r,l]),R.useEffect(()=>{const u=n.on(h=>{h.type===Tv.Change&&l()});return()=>{u.dispose()}},[n,l]),{overflow:s,updateOverflow:l}};class Age{constructor(){this.innerValue=Yk,this.emitter=new qe,this.on=this.emitter.event}get value(){return this.innerValue}setValue(n=Yk){this.initialized&&n!==this.innerValue&&(this.innerValue=n,this.syncEditorValue(),this.emitter.fire({type:Tv.Change,value:this.innerValue}))}set element(n){this.initialized||(this.editor=n)}get element(){return this.editor}setFocus(n){this.initialized&&(n&&!this.focused?this.editor.focus():!n&&this.focused&&(this.editor.blur(),this.deselect(),this.emitter.fire({type:Tv.Blur})))}selectEnd(){if(!this.initialized)return;const n=this.editor.value.length;this.editor.setSelectionRange(n,n)}get focused(){return document.activeElement===this.editor}deselect(){const n=window.getSelection();n&&n.removeAllRanges()}get initialized(){return!!this.editor}syncEditorValue(){this.initialized&&(this.editor.value=this.innerValue)}}const Rge=()=>{const e=NI(),{selected:n}=xc(),r=e.getData(gr).getFormModel(),i=R.useMemo(()=>new Age,[]);return R.useEffect(()=>{n||i.setFocus(n)},[n,i]),R.useEffect(()=>{const s=r.getValueIn(ta.Note);i.setValue(s),i.selectEnd()},[r,i]),R.useEffect(()=>{const s=r.onFormValuesChange(({name:o})=>{if(o!==ta.Note)return;const a=r.getValueIn(ta.Note);i.setValue(a)});return()=>s.dispose()},[r,i]),i},kge=()=>{const e=Vh(),n=e.getNodeMeta(),r=ai(),i=Wt(ar),{size:s={width:240,height:150}}=n,o=e.getData(qt),a=e.getData(gr).getFormModel(),l=a.getValueIn(ta.Size),[u,h]=R.useState((l==null?void 0:l.width)??s.width),[p,g]=R.useState((l==null?void 0:l.height)??s.height);R.useEffect(()=>{a.getValueIn(ta.Size)||a.setValueIn(ta.Size,{width:u,height:p})},[a,u,p]),R.useEffect(()=>{const w=a.onFormValuesChange(({name:S})=>{if(S!==ta.Size)return;const E=a.getValueIn(ta.Size);E&&(h(E.width),g(E.height))});return()=>w.dispose()},[a]);const v=R.useCallback(()=>{const w={width:u,height:p,originalWidth:u,originalHeight:p,positionX:o.position.x,positionY:o.position.y,offsetX:0,offsetY:0};return{resizing:x=>{if(!w)return;const{zoom:I}=r.config,P=x.top/I,M=x.right/I,k=x.bottom/I,A=x.left/I,j=120,V=80,$=Math.max(j,w.originalWidth+M-A),W=Math.max(V,w.originalHeight+k-P),B=(A>0||M<0)&&$<=j?w.offsetX:A/2+M/2,H=(P>0||k<0)&&W<=V?w.offsetY:P,Y=w.positionX+B,te=w.positionY+H;w.width=$,w.height=W,w.offsetX=B,w.offsetY=H,h($),g(W),o.update({position:{x:Y,y:te}})},resizeEnd:()=>{i.transact(()=>{i.pushOperation({type:vv.dragNodes,value:{ids:[e.id],value:[{x:w.positionX+w.offsetX,y:w.positionY+w.offsetY}],oldValue:[{x:w.positionX,y:w.positionY}]}},{noApply:!0}),a.setValueIn(ta.Size,{width:w.width,height:w.height})})}}},[e,u,p,o,r,a,i]);return{width:u,height:p,onResize:v}},Lge=({node:e,focused:n,deleteNode:r})=>F.jsx("div",{className:`workflow-comment-more-button ${n?"workflow-comment-more-button-focused":""}`,children:F.jsx(D$,{node:e,deleteNode:r})}),jge=e=>{const{model:n,style:r,onChange:i}=e,s=ai(),o=R.useRef(null),a=n.value||n.focused?void 0:"Enter a comment...";return R.useEffect(()=>{const l=n.on(u=>{u.type===Tv.Change&&(i==null||i(n.value))});return()=>l.dispose()},[n,i]),R.useEffect(()=>{o.current&&(n.element=o.current)},[o]),F.jsxs("div",{className:"workflow-comment-editor",children:[F.jsx("p",{className:"workflow-comment-editor-placeholder",children:a}),F.jsx("textarea",{className:"workflow-comment-editor-textarea",ref:o,style:r,readOnly:s.config.readonly,onChange:l=>{const{value:u}=l.target;n.setValue(u)},onFocus:()=>{n.setFocus(!0)},onBlur:()=>{n.setFocus(!1)}})]})},jp=e=>{const{model:n,stopEvent:r=!0,style:i}=e,s=ai(),{startDrag:o,onFocus:a,onBlur:l,selectNode:u}=xc();return F.jsx("div",{className:"workflow-comment-drag-area","data-flow-editor-selectable":"false",draggable:!0,style:i,onMouseDown:h=>{r&&(h.preventDefault(),h.stopPropagation()),n.setFocus(!1),o(h),u(h),s.node.focus()},onFocus:a,onBlur:l})},Fge=e=>{const{model:n,focused:r,overflow:i}=e,s=ai(),{selectNode:o}=xc(),[a,l]=R.useState(!1);R.useEffect(()=>{r||l(!1)},[r]);const u=p=>{const g=n.element;if(a||!i||!g)return;p.stopPropagation();const v=g.scrollHeight-g.clientHeight,w=Math.min(Math.max(g.scrollTop+p.deltaY,0),v);g.scroll(0,w)},h=p=>{if(a)return;p.preventDefault(),p.stopPropagation(),n.setFocus(!1),o(p),s.node.focus();const g=p.clientX,v=p.clientY,w=S=>{const E=S.clientX-g,x=S.clientY-v,I=5;Math.abs(E)<I&&Math.abs(x)<I&&l(!0),document.removeEventListener("mouseup",w),document.removeEventListener("click",w)};document.addEventListener("mouseup",w),document.addEventListener("click",w)};return F.jsx("div",{className:"workflow-comment-content-drag-area",onMouseDown:h,onWheel:u,style:{display:a?"none":void 0},children:F.jsx(jp,{style:{position:"relative",width:"100%",height:"100%"},model:n,stopEvent:!1})})},$ge=e=>{const{focused:n,children:r,style:i}=e,s={scrollbarWidth:"thin",scrollbarColor:"rgb(159 159 158 / 65%) transparent","&:WebkitScrollbar":{width:"4px"},"&::WebkitScrollbarTrack":{background:"transparent"},"&::WebkitScrollbarThumb":{backgroundColor:"rgb(159 159 158 / 65%)",borderRadius:"20px",border:"2px solid transparent"}};return F.jsx("div",{className:"workflow-comment-container","data-flow-editor-selectable":"false",style:{outline:n?"1px solid #FF811A":"1px solid #F2B600",backgroundColor:n?"#FFF3EA":"#FFFBED",...s,...i},children:r})},gb=e=>{const{model:n,onResize:r,getDelta:i,style:s}=e,o=ai(),{selectNode:a}=xc(),l=u=>{if(u.preventDefault(),u.stopPropagation(),!r)return;const{resizing:h,resizeEnd:p}=r();n.setFocus(!1),a(u),o.node.focus();const g=u.clientX,v=u.clientY,w=E=>{const x=E.clientX-g,I=E.clientY-v,P=i==null?void 0:i({x,y:I});!P||!h||h(P)},S=()=>{p(),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),document.removeEventListener("click",S)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),document.addEventListener("click",S)};return F.jsx("div",{className:"workflow-comment-resize-area",style:s,"data-flow-editor-selectable":"false",onMouseDown:l})},zge=e=>{const{model:n,overflow:r,onResize:i}=e;return F.jsxs("div",{style:{zIndex:999},children:[F.jsx(jp,{style:{position:"absolute",left:-10,top:10,width:20,height:"calc(100% - 20px)"},model:n}),F.jsx(jp,{style:{position:"absolute",right:-10,top:10,height:"calc(100% - 20px)",width:r?10:20},model:n}),F.jsx(jp,{style:{position:"absolute",top:-10,left:10,width:"calc(100% - 20px)",height:20},model:n}),F.jsx(jp,{style:{position:"absolute",bottom:-10,left:10,width:"calc(100% - 20px)",height:20},model:n}),F.jsx(gb,{style:{position:"absolute",left:0,top:0,cursor:"nwse-resize"},model:n,getDelta:({x:s,y:o})=>({top:o,right:0,bottom:0,left:s}),onResize:i}),F.jsx(gb,{style:{position:"absolute",right:0,top:0,cursor:"nesw-resize"},model:n,getDelta:({x:s,y:o})=>({top:o,right:s,bottom:0,left:0}),onResize:i}),F.jsx(gb,{style:{position:"absolute",right:0,bottom:0,cursor:"nwse-resize"},model:n,getDelta:({x:s,y:o})=>({top:0,right:s,bottom:o,left:0}),onResize:i}),F.jsx(gb,{style:{position:"absolute",left:0,bottom:0,cursor:"nesw-resize"},model:n,getDelta:({x:s,y:o})=>({top:0,right:0,bottom:o,left:s}),onResize:i})]})},Vge=e=>{const{model:n}=e,r=ai(),{selectNode:i}=xc();return F.jsx("div",{className:"workflow-comment-blank-area h-full w-full",onMouseDown:s=>{s.preventDefault(),s.stopPropagation(),n.setFocus(!1),i(s),r.node.focus()},onClick:s=>{n.setFocus(!0),n.selectEnd()},children:F.jsx(jp,{style:{position:"relative",width:"100%",height:"100%"},model:n,stopEvent:!1})})},Bge=e=>{const{node:n}=e,r=Rge(),{selected:i,selectNode:s,nodeRef:o,deleteNode:a}=xc(),l=n.getData(gr).getFormModel(),u=l==null?void 0:l.formControl,{width:h,height:p,onResize:g}=kge(),{overflow:v,updateOverflow:w}=Pge({model:r,height:p});return F.jsx("div",{className:"workflow-comment",style:{width:h,height:p},ref:o,"data-node-selected":String(i),onMouseEnter:w,onMouseDown:S=>{setTimeout(()=>{s(S)},20)},children:F.jsx(PI,{control:u,children:F.jsxs(F.Fragment,{children:[F.jsx($ge,{focused:i,style:{height:p},children:F.jsx(cl,{name:ta.Note,children:({field:S})=>F.jsxs(F.Fragment,{children:[F.jsx(jge,{model:r,value:S.value,onChange:S.onChange}),F.jsx(Vge,{model:r}),F.jsx(Fge,{model:r,focused:i,overflow:v}),F.jsx(Lge,{node:n,focused:i,deleteNode:a})]})})}),F.jsx(zge,{model:r,overflow:v,onResize:g})]})})})};function Hge(e,n){return R.useMemo(()=>({background:!0,readonly:!1,initialData:e,nodeRegistries:n,getNodeDefaultRegistry(r){return{type:r,meta:{defaultExpanded:!0},formMeta:N$}},lineColor:{hidden:"transparent",default:"#4d53e8",drawing:"#5DD6E3",hovered:"#37d0ff",selected:"#37d0ff",error:"red"},canAddLine(r,i,s){return i.node!==s.node},canDeleteLine(r,i,s,o){return!0},canDeleteNode(r,i){return!0},onDragLineEnd:wpe,selectBox:{SelectorBoxPopover:yge},materials:{renderDefaultNode:_ge,renderNodes:{[Xi.Comment]:Bge}},nodeEngine:{enable:!0},variableEngine:{enable:!0},history:{enable:!0,enableChangeNode:!0},onContentChange:dQ((r,i)=>{console.log("Auto Save: ",i,r.document.toJSON())},1e3),shortcuts:Ope,onBind:({bind:r})=>{r(jh).toSelf().inSingletonScope()},onInit(){console.log("--- Playground init ---")},onAllLayersRendered(r){r.document.fitView(!1),console.log("--- Playground rendered ---")},onDispose(){console.log("---- Playground Dispose ----")},plugins:()=>[c7({renderInsideLine:xge}),zfe({disableLayer:!0,canvasStyle:{canvasWidth:182,canvasHeight:102,canvasPadding:50,canvasBackground:"rgba(242, 243, 245, 1)",canvasBorderRadius:10,viewportBackground:"rgba(255, 255, 255, 1)",viewportBorderRadius:4,viewportBorderColor:"rgba(6, 7, 9, 0.10)",viewportBorderWidth:1,viewportBorderDashLength:void 0,nodeColor:"rgba(0, 0, 0, 0.10)",nodeBorderRadius:2,nodeBorderWidth:.145,nodeBorderColor:"rgba(6, 7, 9, 0.10)",overlayColor:"rgba(255, 255, 255, 0.55)"},inactiveDebounceTime:1}),Ape({}),Hfe({edgeColor:"#00B2B2",alignColor:"#00B2B2",edgeLineWidth:1,alignLineWidth:1,alignCrossWidth:8}),Zfe({renderer:Mge}),epe({}),bpe({groupNodeRender:gge})]}),[])}function E_(){return R.useContext(mT)}function dd(){return R.useContext(I$)}const Uge=({form:e})=>dd()?F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsx(Ju,{children:F.jsx(cl,{name:"outputs",render:({field:{value:r,onChange:i}})=>F.jsx(F.Fragment,{children:F.jsx(kfe,{value:r,onChange:s=>i(s)})})})})]}):F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsx(Ju,{children:F.jsx(pg,{})})]}),Kge={render:Uge,validateTrigger:zv.onChange,validate:{title:({value:e})=>e?void 0:"Title is required"}};var Xi=(e=>(e.Start="start",e.End="end",e.LLM="llm",e.Condition="condition",e.Loop="loop",e.Comment="comment",e))(Xi||{});const Wge={type:Xi.Start,meta:{isStart:!0,deleteDisable:!0,copyDisable:!0,defaultPorts:[{type:"output"}],size:{width:360,height:211}},info:{icon:Are,description:"The starting node of the workflow, used to set the information needed to initiate the workflow."},formMeta:Kge,canAdd(){return!1}},qge="/workflow/assets/icon-loop-BOwpxpMz.jpg",Gge=({form:e})=>dd()?F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsxs(Ju,{children:[F.jsx(tI,{}),F.jsx(pg,{})]})]}):F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsxs(Ju,{children:[F.jsx(tI,{}),F.jsx(fpe,{}),F.jsx(pg,{})]})]});let Yge=0;const Xge={type:Xi.Loop,info:{icon:qge,description:"Used to repeatedly execute a series of tasks by setting the number of iterations and logic."},meta:{isContainer:!0,size:{width:560,height:400},padding:()=>({top:125,bottom:100,left:100,right:100}),selectable(e,n){return n?!e.getData(at).bounds.contains(n.x,n.y):!0},expandable:!1},onAdd(){return{id:`loop_${Wi(5)}`,type:"loop",data:{title:`Loop_${++Yge}`,inputsValues:{loopTimes:2},inputs:{type:"object",required:["loopTimes"],properties:{loopTimes:{type:"number"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}}},formMeta:{...N$,render:Gge},onCreate(){}},Zge="/workflow/assets/icon-llm-BJkdbjNX.jpg";let Qge=0;const Jge={type:Xi.LLM,info:{icon:Zge,description:"Call the large language model and use variables and prompt words to generate responses."},meta:{size:{width:360,height:305}},onAdd(){return{id:`llm_${Wi(5)}`,type:"llm",data:{title:`LLM_${++Qge}`,inputsValues:{},inputs:{type:"object",required:["modelType","temperature","prompt"],properties:{modelType:{type:"string"},temperature:{type:"number"},systemPrompt:{type:"string"},prompt:{type:"string"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}}}},eye="/workflow/assets/icon-end-Bb5sqRY8.jpg",tye=({form:e})=>dd()?F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsxs(Ju,{children:[F.jsx(cl,{name:"outputs.properties",render:({field:{value:r,onChange:i},fieldState:s})=>F.jsx(F.Fragment,{children:F.jsx(ege,{value:r,onChange:i,useFx:!0})})}),F.jsx(pg,{})]})]}):F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsx(Ju,{children:F.jsx(pg,{})})]}),nye={render:tye,validateTrigger:zv.onChange,validate:{title:({value:e})=>e?void 0:"Title is required"}},rye={type:Xi.End,meta:{deleteDisable:!0,copyDisable:!0,defaultPorts:[{type:"input"}],size:{width:360,height:211}},info:{icon:eye,description:"The final node of the workflow, used to return the result information after the workflow is run."},formMeta:nye,canAdd(){return!1}},iye="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='44'%20height='45'%20viewBox='0%200%2044%2045'%20fill='none'%20class='injected-svg'%20data-src='https://lf3-static.bytednsdoc.com/obj/eden-cn/uvpahtvabh_lm_zhhwh/ljhwZthlaukjlkulzlp/activity_icons/exclusive-split-0518.svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.4705%2014.0152C15.299%2012.8436%2015.299%2010.944%2016.4705%209.77244L20.7131%205.5297C21.8846%204.3581%2023.784%204.3581%2024.9556%205.5297L29.1981%209.77244C30.3697%2010.944%2030.3697%2012.8436%2029.1981%2014.0152L25.1206%2018.0929H32.6674C36.5334%2018.0929%2039.6674%2021.2269%2039.6674%2025.0929V33.154V33.3271V37.154C39.6674%2038.2585%2038.7719%2039.154%2037.6674%2039.154H33.6674C32.5628%2039.154%2031.6674%2038.2585%2031.6674%2037.154V33.3271V33.154V26.0929H23.5948H15.6674V33.1327L17.2685%2033.1244C18.8397%2033.1163%2019.6322%2035.0156%2018.5212%2036.1266L12.7374%2041.9103C12.0506%2042.5971%2010.9371%2042.5971%2010.2503%2041.9103L4.52588%2036.1859C3.42107%2035.0811%204.19797%2033.1917%205.76038%2033.1837L7.66737%2033.1739V25.0929C7.66737%2021.227%2010.8014%2018.0929%2014.6674%2018.0929H20.5481L16.4705%2014.0152Z'%20fill='url(%23paint0_linear_2752_183702-7)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2752_183702-7'%20x1='38.52'%20y1='43.3915'%20x2='8.09686'%20y2='4.6982'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%233370FF'/%3e%3cstop%20offset='0.997908'%20stop-color='%2333A9FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",sye=xt.div`
|
||
position: absolute;
|
||
right: -12px;
|
||
top: 50%;
|
||
`;function oye(){const e=!dd();return F.jsx(pW,{name:"inputsValues.conditions",children:({field:n})=>F.jsxs(F.Fragment,{children:[n.map((r,i)=>F.jsx(cl,{name:r.name,children:({field:s,fieldState:o})=>F.jsxs(S$,{name:"if",type:"boolean",required:!0,labelWidth:40,children:[F.jsx(x$,{value:s.value.value,onChange:a=>s.onChange({key:s.value.key,value:a}),icon:F.jsx(Cr,{theme:"borderless",icon:F.jsx(Gj,{}),onClick:()=>n.delete(i)}),hasError:Object.keys((o==null?void 0:o.errors)||{}).length>0,readonly:e}),F.jsx(pT,{errors:o==null?void 0:o.errors,invalid:o==null?void 0:o.invalid}),F.jsx(sye,{"data-port-id":s.value.key,"data-port-type":"output"})]})},r.name)),!e&&F.jsx("div",{children:F.jsx(Cr,{theme:"borderless",icon:F.jsx(r_,{}),onClick:()=>n.append({key:`if_${Wi(6)}`,value:{type:"expression",content:""}}),children:"Add"})})]})})}const aye=({form:e})=>F.jsxs(F.Fragment,{children:[F.jsx(ed,{}),F.jsx(Ju,{children:F.jsx(oye,{})})]}),lye={render:aye,validateTrigger:zv.onChange,validate:{title:({value:e})=>e?void 0:"Title is required","inputsValues.conditions.*":({value:e})=>{var n;if(!((n=e==null?void 0:e.value)!=null&&n.content))return"Condition is required"}}},cye={type:Xi.Condition,info:{icon:iye,description:"Connect multiple downstream branches. Only the corresponding branch will be executed if the set conditions are met."},meta:{defaultPorts:[{type:"input"}],useDynamicPort:!0,expandable:!1},formMeta:lye,onAdd(){return{id:`condition_${Wi(5)}`,type:"condition",data:{title:"Condition",inputsValues:{conditions:[{key:`if_${Wi(5)}`,value:""},{key:`if_${Wi(5)}`,value:""}]},inputs:{type:"object",properties:{conditions:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}}}}}}}}},uye={type:Xi.Comment,meta:{disableSideBar:!0,defaultPorts:[],renderKey:Xi.Comment,size:{width:240,height:150}},formMeta:{render:()=>F.jsx(F.Fragment,{})},getInputPoints:()=>[],getOutputPoints:()=>[]},O$=[cye,Wge,rye,Jge,Xge,uye],dye=O$.filter(e=>e.type!==Xi.Comment),hye={nodes:[{id:"start_0",type:"start",meta:{position:{x:180,y:298}},data:{title:"Start",outputs:{type:"object",properties:{query:{type:"string",default:"Hello Flow."}}}}},{id:"condition_0",type:"condition",meta:{position:{x:640,y:279.5}},data:{title:"Condition",inputsValues:{conditions:[{key:"if_0",value:{type:"expression",content:""}},{key:"if_f0rOAt",value:{type:"expression",content:""}}]},inputs:{type:"object",properties:{conditions:{type:"array",items:{type:"object",properties:{key:{type:"string"},value:{type:"string"}}}}}}}},{id:"end_0",type:"end",meta:{position:{x:2220,y:298}},data:{title:"End",outputs:{type:"object",properties:{result:{type:"string"}}}}},{id:"loop_H8M3U",type:"loop",meta:{position:{x:1020,y:452}},data:{title:"Loop_2",inputsValues:{loopTimes:2},inputs:{type:"object",required:["loopTimes"],properties:{loopTimes:{type:"number"}}},outputs:{type:"object",properties:{result:{type:"string"}}}},blocks:[{id:"llm_CBdCg",type:"llm",meta:{position:{x:180,y:0}},data:{title:"LLM_4",inputsValues:{},inputs:{type:"object",required:["modelType","temperature","prompt"],properties:{modelType:{type:"string"},temperature:{type:"number"},systemPrompt:{type:"string"},prompt:{type:"string"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}},{id:"llm_gZafu",type:"llm",meta:{position:{x:640,y:0}},data:{title:"LLM_5",inputsValues:{},inputs:{type:"object",required:["modelType","temperature","prompt"],properties:{modelType:{type:"string"},temperature:{type:"number"},systemPrompt:{type:"string"},prompt:{type:"string"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}}],edges:[{sourceNodeID:"llm_CBdCg",targetNodeID:"llm_gZafu"}]},{id:"159623",type:"comment",meta:{position:{x:640,y:478}},data:{size:{width:240,height:150},note:`hi ~
|
||
|
||
this is a comment node
|
||
|
||
- flowgram.ai`}},{id:"group_V-_st",type:"group",meta:{position:{x:-1.5112031149433278,y:0}},data:{title:"LLM_Group",color:"Violet"},blocks:[{id:"llm_0",type:"llm",meta:{position:{x:1660.1942854301792,y:1.8635936030104148}},data:{title:"LLM_0",inputsValues:{modelType:"gpt-3.5-turbo",temperature:.5,systemPrompt:"You are an AI assistant.",prompt:""},inputs:{type:"object",required:["modelType","temperature","prompt"],properties:{modelType:{type:"string"},temperature:{type:"number"},systemPrompt:{type:"string"},prompt:{type:"string"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}},{id:"llm_l_TcE",type:"llm",meta:{position:{x:1202.8281207997074,y:1.8635936030104148}},data:{title:"LLM_1",inputsValues:{},inputs:{type:"object",required:["modelType","temperature","prompt"],properties:{modelType:{type:"string"},temperature:{type:"number"},systemPrompt:{type:"string"},prompt:{type:"string"}}},outputs:{type:"object",properties:{result:{type:"string"}}}}}],edges:[{sourceNodeID:"llm_l_TcE",targetNodeID:"llm_0"},{sourceNodeID:"llm_0",targetNodeID:"end_0"},{sourceNodeID:"condition_0",targetNodeID:"llm_l_TcE",sourcePortID:"if_0"}]}],edges:[{sourceNodeID:"start_0",targetNodeID:"condition_0"},{sourceNodeID:"condition_0",targetNodeID:"llm_l_TcE",sourcePortID:"if_0"},{sourceNodeID:"condition_0",targetNodeID:"loop_H8M3U",sourcePortID:"if_f0rOAt"},{sourceNodeID:"llm_0",targetNodeID:"end_0"},{sourceNodeID:"loop_H8M3U",targetNodeID:"end_0"}]},fye=()=>{const e=ai();return R.useCallback(n=>e.config.getPosFromMouseEvent({clientX:n.left+64,clientY:n.top-7}),[e])},pye=()=>{const e=Wt(or);return R.useCallback(n=>{n&&e.selectNode(n)},[e])},gye=()=>{const e=Wt(Et),n=Wt(_s),r=ai(),i=fye(),s=pye();return R.useCallback(async o=>{const a=i(o);await new Promise(l=>{n.callNodePanel({position:a,enableMultiAdd:!0,panelProps:{},onSelect:async u=>{if(!u)return;const{nodeType:h,nodeJSON:p}=u,g=e.createWorkflowNodeByType(h,void 0,p??{});s(g)},onClose:()=>{l()}})})},[i,n,r.config.zoom,e,s])},yye=e=>{const n=gye();return F.jsx(Cr,{icon:F.jsx(r_,{}),color:"highlight",style:{backgroundColor:"rgba(171,181,255,0.3)",borderRadius:"8px"},disabled:e.disabled,onClick:r=>{const i=r.currentTarget.getBoundingClientRect();n(i)},children:"Add Node"})},mye=()=>F.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:F.jsxs("g",{id:"g1",children:[F.jsx("path",{id:"path1",fill:"#000000",stroke:"none",d:"M 18.09091 6.883101 L 5.409091 6.883101 L 5.409091 16.746737 L 10.664648 16.746737 C 10.927091 17.116341 11.30353 17.422749 11.792977 17.611004 L 12.664289 17.946156 L 12.744959 18.155828 L 5.409091 18.155828 C 4.630871 18.155828 4 17.524979 4 16.746737 L 4 6.883101 C 4 6.104881 4.630871 5.47401 5.409091 5.47401 L 18.09091 5.47401 C 18.86915 5.47401 19.5 6.104881 19.5 6.883101 L 19.5 12.52348 C 19.247208 11.883823 18.730145 11.365912 18.09091 11.111994 L 18.09091 6.883101 Z M 18.09091 18.155828 L 17.881165 18.155828 L 19.469212 14.368896 C 19.479921 14.343321 19.490206 14.317817 19.5 14.292241 L 19.5 16.746737 C 19.5 17.524979 18.86915 18.155828 18.09091 18.155828 Z"}),F.jsx("path",{id:"path2",fill:"#000000",fillRule:"evenodd",stroke:"none",d:"M 18.494614 13.960189 C 18.982441 12.796985 17.813459 11.628003 16.650255 12.11576 L 12.133272 14.01 C 10.962248 14.501069 10.987188 16.168798 12.172375 16.62464 L 13.482055 17.128389 L 13.985805 18.438068 C 14.441646 19.623184 16.109375 19.648125 16.600443 18.477171 L 18.494614 13.960189 Z M 17.19515 13.415224 L 15.30098 17.932205 L 14.79723 16.622526 C 14.654066 16.250385 14.359989 15.956307 13.987918 15.813213 L 12.678168 15.309464 L 17.19515 13.415224 Z"})]})}),vye=xt.div`
|
||
position: absolute;
|
||
bottom: 16px;
|
||
display: flex;
|
||
justify-content: left;
|
||
min-width: 360px;
|
||
pointer-events: none;
|
||
gap: 8px;
|
||
|
||
z-index: 99;
|
||
`,bye=xt.div`
|
||
display: flex;
|
||
align-items: center;
|
||
background-color: #fff;
|
||
border: 1px solid rgba(68, 83, 130, 0.25);
|
||
border-radius: 10px;
|
||
box-shadow: rgba(0, 0, 0, 0.04) 0px 2px 6px 0px, rgba(0, 0, 0, 0.02) 0px 4px 12px 0px;
|
||
column-gap: 2px;
|
||
height: 40px;
|
||
padding: 0 4px;
|
||
pointer-events: auto;
|
||
`,wye=xt.span`
|
||
padding: 4px;
|
||
border-radius: 8px;
|
||
border: 1px solid rgba(68, 83, 130, 0.25);
|
||
font-size: 12px;
|
||
width: 50px;
|
||
cursor: pointer;
|
||
`,_ye=xt.div`
|
||
position: absolute;
|
||
bottom: 60px;
|
||
width: 198px;
|
||
`,Cye=xt(mye)`
|
||
color: ${e=>e.visible?void 0:"#060709cc"};
|
||
`,Eye=()=>{const e=Zv(),n=ai(),[r,i]=R.useState(!1);return F.jsx(En,{position:"top",trigger:"custom",visible:r,onClickOutSide:()=>i(!1),render:F.jsxs(En.Menu,{children:[F.jsx(En.Item,{onClick:()=>e.zoomin(),children:"Zoom in"}),F.jsx(En.Item,{onClick:()=>e.zoomout(),children:"Zoom out"}),F.jsx(XN,{layout:"horizontal"}),F.jsx(En.Item,{onClick:()=>n.config.updateZoom(.5),children:"Zoom to 50%"}),F.jsx(En.Item,{onClick:()=>n.config.updateZoom(1),children:"Zoom to 100%"}),F.jsx(En.Item,{onClick:()=>n.config.updateZoom(1.5),children:"Zoom to 150%"}),F.jsx(En.Item,{onClick:()=>n.config.updateZoom(2),children:"Zoom to 200%"})]}),children:F.jsxs(wye,{onClick:()=>i(!0),children:[Math.floor(e.zoom*100),"%"]})})},xye=F.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{id:"switch-line",fill:"currentColor",stroke:"none",d:"M 12.728118 10.060962 C 13.064282 8.716098 14.272528 7.772551 15.65877 7.772343 L 17.689898 7.772343 C 18.0798 7.772343 18.39588 7.456264 18.39588 7.066362 C 18.39588 6.676458 18.0798 6.36038 17.689898 6.36038 L 15.659616 6.36038 C 13.62515 6.360315 11.851767 7.745007 11.358504 9.718771 C 11.02234 11.063635 9.814095 12.007183 8.427853 12.007389 L 7.101437 12.007389 C 6.711768 12.007389 6.395878 12.323277 6.395878 12.712947 C 6.395878 13.102616 6.711768 13.418506 7.101437 13.418506 L 8.426159 13.418506 C 9.812716 13.418323 11.021417 14.361954 11.357657 15.707124 C 11.850921 17.680887 13.624304 19.065578 15.65877 19.065516 L 17.689049 19.065516 C 18.078953 19.065516 18.395033 18.749435 18.395033 18.359533 C 18.395033 17.969631 18.078953 17.653551 17.689049 17.653551 L 15.65877 17.653551 C 14.272528 17.653345 13.064282 16.709797 12.728118 15.364932 C 12.454905 14.27114 11.774856 13.322707 10.826583 12.712947 C 11.774536 12.10303 12.454268 11.154617 12.727271 10.060962 Z"})}),Sye=()=>{const e=Wt(oi),n=R.useCallback(()=>{e.switchLineType()},[e]);return F.jsx(Rn,{content:"Switch Line",children:F.jsx(Lr,{type:"tertiary",theme:"borderless",onClick:n,icon:xye})})};function Dye(e){const[n,r]=R.useState(0),i=Wh(),s=R.useCallback(()=>{const l=i.document.getAllNodes().map(u=>Km(u)).filter(u=>u==null?void 0:u.state.invalid).length;r(l)},[i]),o=R.useCallback(async()=>{const a=i.document.getAllNodes().map(l=>Km(l));await Promise.all(a.map(async l=>l==null?void 0:l.validate())),console.log(">>>>> save data: ",i.document.toJSON())},[i]);return R.useEffect(()=>{const a=u=>{const h=Km(u);if(h){const p=h.onValidate(()=>s());u.onDispose(()=>p.dispose())}};i.document.getAllNodes().map(u=>a(u));const l=i.document.onNodeCreate(({node:u})=>a(u));return()=>l.dispose()},[i]),n===0?F.jsx(Cr,{disabled:e.disabled,onClick:o,style:{backgroundColor:"rgba(171,181,255,0.3)",borderRadius:"8px"},children:"Save"}):F.jsx(l_,{count:n,position:"rightTop",type:"danger",children:F.jsx(Cr,{type:"danger",disabled:e.disabled,onClick:o,style:{backgroundColor:"rgba(255, 179, 171, 0.3)",borderRadius:"8px"},children:"Save"})})}const Nye=()=>{const e=ai(),n=R.useCallback(()=>{e.config.readonly=!e.config.readonly},[e]);return e.config.readonly?F.jsx(Rn,{content:"Editable",children:F.jsx(Lr,{theme:"borderless",type:"tertiary",icon:F.jsx(Zae,{size:"default"}),onClick:n})}):F.jsx(Rn,{content:"Readonly",children:F.jsx(Lr,{theme:"borderless",type:"tertiary",icon:F.jsx(wle,{size:"default"}),onClick:n})})},Iye=e=>{const{minimapVisible:n,setMinimapVisible:r}=e;return F.jsx(Rn,{content:"Minimap",children:F.jsx(Lr,{type:"tertiary",theme:"borderless",icon:F.jsx(Cye,{visible:n}),onClick:()=>r(!n)})})},Oye=({visible:e})=>{const n=Wt(rl);return e?F.jsx(_ye,{children:F.jsx(h$,{service:n,panelStyles:{},containerStyles:{pointerEvents:"auto",position:"relative",top:"unset",right:"unset",bottom:"unset",left:"unset"},inactiveStyle:{opacity:1,scale:1,translateX:0,translateY:0}})}):F.jsx(F.Fragment,{})};function Tye(e){const{width:n,height:r}=e;return F.jsxs("svg",{width:n||48,height:r||38,viewBox:"0 0 48 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[F.jsx("rect",{x:"1.83317",y:"1.49998",width:"44.3333",height:"35",rx:"3.5",stroke:"currentColor",strokeOpacity:"0.8",strokeWidth:"2.33333"}),F.jsx("path",{d:"M14.6665 30.6667H33.3332",stroke:"currentColor",strokeOpacity:"0.8",strokeWidth:"2.33333",strokeLinecap:"round"})]})}const Mye=()=>F.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[F.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.8549 5H3.1451C3.06496 5 3 5.06496 3 5.1451V18.8549C3 18.935 3.06496 19 3.1451 19H20.8549C20.935 19 21 18.935 21 18.8549V5.1451C21 5.06496 20.935 5 20.8549 5ZM3.1451 3C1.96039 3 1 3.96039 1 5.1451V18.8549C1 20.0396 1.96039 21 3.1451 21H20.8549C22.0396 21 23 20.0396 23 18.8549V5.1451C23 3.96039 22.0396 3 20.8549 3H3.1451Z"}),F.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.99991 16C6.99991 15.4477 7.44762 15 7.99991 15H15.9999C16.5522 15 16.9999 15.4477 16.9999 16C16.9999 16.5523 16.5522 17 15.9999 17H7.99991C7.44762 17 6.99991 16.5523 6.99991 16Z"})]});function Pye(e){const{width:n,height:r}=e;return F.jsx("svg",{width:n||34,height:r||52,viewBox:"0 0 34 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30.9998 16.6666V35.3333C30.9998 37.5748 30.9948 38.4695 30.9 39.1895C30.2108 44.4247 26.0912 48.5443 20.856 49.2335C20.1361 49.3283 19.2413 49.3333 16.9998 49.3333C14.7584 49.3333 13.8636 49.3283 13.1437 49.2335C7.90847 48.5443 3.78888 44.4247 3.09965 39.1895C3.00487 38.4695 2.99984 37.5748 2.99984 35.3333V16.6666C2.99984 14.4252 3.00487 13.5304 3.09965 12.8105C3.78888 7.57528 7.90847 3.45569 13.1437 2.76646C13.7232 2.69017 14.4159 2.67202 15.8332 2.66785V9.86573C14.4738 10.3462 13.4998 11.6426 13.4998 13.1666V17.8332C13.4998 19.3571 14.4738 20.6536 15.8332 21.1341V23.6666C15.8332 24.3109 16.3555 24.8333 16.9998 24.8333C17.6442 24.8333 18.1665 24.3109 18.1665 23.6666V21.1341C19.5259 20.6536 20.4998 19.3572 20.4998 17.8332V13.1666C20.4998 11.6426 19.5259 10.3462 18.1665 9.86571V2.66785C19.5837 2.67202 20.2765 2.69017 20.856 2.76646C26.0912 3.45569 30.2108 7.57528 30.9 12.8105C30.9948 13.5304 30.9998 14.4252 30.9998 16.6666ZM0.666504 16.6666C0.666504 14.4993 0.666504 13.4157 0.786276 12.5059C1.61335 6.22368 6.55687 1.28016 12.8391 0.453085C13.7489 0.333313 14.8325 0.333313 16.9998 0.333313C19.1671 0.333313 20.2508 0.333313 21.1605 0.453085C27.4428 1.28016 32.3863 6.22368 33.2134 12.5059C33.3332 13.4157 33.3332 14.4994 33.3332 16.6666V35.3333C33.3332 37.5006 33.3332 38.5843 33.2134 39.494C32.3863 45.7763 27.4428 50.7198 21.1605 51.5469C20.2508 51.6666 19.1671 51.6666 16.9998 51.6666C14.8325 51.6666 13.7489 51.6666 12.8391 51.5469C6.55687 50.7198 1.61335 45.7763 0.786276 39.494C0.666504 38.5843 0.666504 37.5006 0.666504 35.3333V16.6666ZM15.8332 13.1666C15.8332 13.0011 15.8676 12.8437 15.9297 12.7011C15.9886 12.566 16.0722 12.4443 16.1749 12.3416C16.386 12.1305 16.6777 11.9999 16.9998 11.9999C17.6435 11.9999 18.1654 12.5212 18.1665 13.1646L18.1665 13.1666V17.8332L18.1665 17.8353C18.1665 17.8364 18.1665 17.8376 18.1665 17.8387C18.1661 17.9132 18.1588 17.986 18.1452 18.0565C18.0853 18.3656 17.9033 18.6312 17.6515 18.8011C17.4655 18.9266 17.2412 18.9999 16.9998 18.9999C16.3555 18.9999 15.8332 18.4776 15.8332 17.8332V13.1666Z",fill:"currentColor",fillOpacity:"0.8"})})}const Aye=()=>F.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 8C4.5 4.13401 7.63401 1 11.5 1H12.5C16.366 1 19.5 4.13401 19.5 8V17C19.5 20.3137 16.8137 23 13.5 23H10.5C7.18629 23 4.5 20.3137 4.5 17V8ZM11.2517 3.00606C8.60561 3.13547 6.5 5.32184 6.5 8V17C6.5 19.2091 8.29086 21 10.5 21H13.5C15.7091 21 17.5 19.2091 17.5 17V8C17.5 5.32297 15.3962 3.13732 12.7517 3.00622V5.28013C13.2606 5.54331 13.6074 6.06549 13.6074 6.66669V8.75759C13.6074 9.35879 13.2606 9.88097 12.7517 10.1441V11.4091C12.7517 11.8233 12.4159 12.1591 12.0017 12.1591C11.5875 12.1591 11.2517 11.8233 11.2517 11.4091V10.1457C10.7411 9.88298 10.3931 9.35994 10.3931 8.75759V6.66669C10.3931 6.06433 10.7411 5.5413 11.2517 5.27862V3.00606ZM12.0017 6.14397C11.7059 6.14397 11.466 6.38381 11.466 6.67968V8.74462C11.466 9.03907 11.7036 9.27804 11.9975 9.28031L12.0002 9.28032C12.0456 9.28032 12.0896 9.27482 12.1316 9.26447C12.3401 9.21256 12.5002 9.0386 12.5318 8.82287C12.5345 8.80149 12.5359 8.7797 12.5359 8.75759V6.66669C12.5359 6.64463 12.5345 6.62288 12.5318 6.60154C12.4999 6.38354 12.3368 6.20817 12.1252 6.15826C12.0856 6.14891 12.0442 6.14397 12.0017 6.14397Z"})}),{Title:Rye,Paragraph:kye}=ad,Xk=({title:e,subTitle:n,icon:r,onChange:i,value:s,selected:o})=>F.jsxs("div",{className:`mouse-pad-option ${o?"mouse-pad-option-selected":""}`,onClick:()=>i(s),children:[F.jsx("div",{className:`mouse-pad-option-icon ${o?"mouse-pad-option-icon-selected":""}`,children:r}),F.jsx(Rye,{heading:6,className:`mouse-pad-option-title ${o?"mouse-pad-option-title-selected":""}`,children:e}),F.jsx(kye,{type:"tertiary",className:`mouse-pad-option-subTitle ${o?"mouse-pad-option-subTitle-selected":""}`,children:n})]}),Lye=({value:e,onChange:n,onPopupVisibleChange:r,containerStyle:i,iconStyle:s,arrowStyle:o})=>{const a=e==="MOUSE",[l,u]=R.useState(!1);return F.jsx(Yi,{trigger:"custom",position:"topLeft",closeOnEsc:!0,visible:l,onVisibleChange:h=>{r==null||r(h)},onClickOutSide:()=>{u(!1)},spacing:20,content:F.jsxs("div",{className:"ui-mouse-pad-selector-popover",children:[F.jsx(ad.Title,{heading:4,children:"Interaction mode"}),F.jsxs("div",{className:"ui-mouse-pad-selector-popover-options",children:[F.jsx(Xk,{title:"Mouse-Friendly",subTitle:"Drag the canvas with the left mouse button, zoom with the scroll wheel.",value:"MOUSE",selected:e==="MOUSE",icon:F.jsx(Pye,{}),onChange:n}),F.jsx(Xk,{title:"Touchpad-Friendly",subTitle:"Drag with two fingers moving in the same direction, zoom by pinching or spreading two fingers.",value:"PAD",selected:e==="PAD",icon:F.jsx(Tye,{}),onChange:n})]})]}),children:F.jsx("div",{className:`ui-mouse-pad-selector ${l?"ui-mouse-pad-selector-active":""}`,onClick:()=>{u(!l)},style:i,children:F.jsx("div",{className:"ui-mouse-pad-selector-icon",style:s,children:a?F.jsx(Aye,{}):F.jsx(Mye,{})})})})},T$="workflow_prefer_interactive_type",jye=/(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(navigator.userAgent),Zk=()=>{const e=localStorage.getItem(T$);return e&&["MOUSE","PAD"].includes(e)?e:jye?"PAD":"MOUSE"},Fye=e=>{localStorage.setItem(T$,e)},$ye=()=>{const e=Zv(),[n,r]=R.useState(!1),[i,s]=R.useState(()=>Zk()),[o,a]=R.useState(!1),l=i==="MOUSE"?"Mouse-Friendly":"Touchpad-Friendly";R.useEffect(()=>{e.setMouseScrollDelta(p=>p/20);const h=Zk();e.setInteractiveType(h)},[]);const u=()=>{r(!1)};return F.jsx(Yi,{trigger:"custom",position:"top",visible:n,onClickOutSide:u,children:F.jsx(Rn,{content:l,style:{display:o?"none":"block"},children:F.jsx("div",{className:"workflow-toolbar-interactive",children:F.jsx(Lye,{value:i,onChange:h=>{s(h),Fye(h),e.setInteractiveType(h)},onPopupVisibleChange:a,containerStyle:{border:"none",height:"32px",width:"32px",justifyContent:"center",alignItems:"center",gap:"2px",padding:"4px",borderRadius:"var(--small, 6px)"},iconStyle:{margin:"0",width:"16px",height:"16px"},arrowStyle:{width:"12px",height:"12px"}})})})})},zye=()=>{const e=Zv();return F.jsx(Rn,{content:"FitView",children:F.jsx(Lr,{icon:F.jsx(TO,{}),type:"tertiary",theme:"borderless",onClick:()=>e.fitView()})})},Vye=({style:e})=>F.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:e,children:[F.jsx("path",{d:"M6.5 9C5.94772 9 5.5 9.44772 5.5 10V11C5.5 11.5523 5.94772 12 6.5 12H7.5C8.05228 12 8.5 11.5523 8.5 11V10C8.5 9.44772 8.05228 9 7.5 9H6.5zM11.5 9C10.9477 9 10.5 9.44772 10.5 10V11C10.5 11.5523 10.9477 12 11.5 12H12.5C13.0523 12 13.5 11.5523 13.5 11V10C13.5 9.44772 13.0523 9 12.5 9H11.5zM15.5 10C15.5 9.44772 15.9477 9 16.5 9H17.5C18.0523 9 18.5 9.44772 18.5 10V11C18.5 11.5523 18.0523 12 17.5 12H16.5C15.9477 12 15.5 11.5523 15.5 11V10z"}),F.jsx("path",{d:"M23 4C23 2.9 22.1 2 21 2H3C1.9 2 1 2.9 1 4V17.0111C1 18.0211 1.9 19.0111 3 19.0111H7.7586L10.4774 22C10.9822 22.5017 11.3166 22.6311 12 22.7009C12.414 22.707 13.0502 22.5093 13.5 22L16.2414 19.0111H21C22.1 19.0111 23 18.1111 23 17.0111V4ZM3 4H21V17.0111H15.5L12 20.6714L8.5 17.0111H3V4Z"})]}),Bye=()=>{const e=ai(),n=Wt(Et),r=Wt(or),i=Wt(yr),[s,o]=R.useState(!1),a=R.useCallback(u=>{const h=e.config.getPosFromMouseEvent(u);return{x:h.x,y:h.y-75}},[e]),l=R.useCallback(async u=>{o(!1);const h=a(u),p=n.createWorkflowNodeByType(Xi.Comment,h);await bc(16),r.selectNode(p),i.startDragSelectedNodes(u)},[r,a,n,i]);return F.jsx(Rn,{trigger:"custom",visible:s,onVisibleChange:o,content:"Comment",children:F.jsx(Lr,{disabled:e.config.readonly,icon:F.jsx(Vye,{style:{width:16,height:16}}),type:"tertiary",theme:"borderless",onClick:l,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1)})})},Hye=F.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:F.jsx("path",{fill:"currentColor",d:"M3 2C2.44772 2 2 2.44771 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3zM4 11V4H9V11H4zM21 22C21.5523 22 22 21.5523 22 21V12C22 11.4477 21.5523 11 21 11H14C13.4477 11 13 11.4477 13 12V21C13 21.5523 13.4477 22 14 22H21zM20 13V20H15V13H20zM2 16C2 15.4477 2.44772 15 3 15H10C10.5523 15 11 15.4477 11 16V21C11 21.5523 10.5523 22 10 22H3C2.44772 22 2 21.5523 2 21V16zM4 20V17H9V20H4zM21 9C21.5523 9 22 8.55228 22 8V3C22 2.44772 21.5523 2 21 2H14C13.4477 2 13 2.44772 13 3V8C13 8.55228 13.4477 9 14 9H21zM20 4V7H15V4H20z"})}),Uye=()=>{const e=Zv(),n=ai(),r=R.useCallback(async()=>{await e.autoLayout()},[e]);return F.jsx(Rn,{content:"Auto Layout",children:F.jsx(Lr,{disabled:n.config.readonly,type:"tertiary",theme:"borderless",onClick:r,icon:Hye})})},Kye=()=>{const{history:e,playground:n}=Wh(),[r,i]=R.useState(!1),[s,o]=R.useState(!1),[a,l]=R.useState(!0);R.useEffect(()=>{const h=e.undoRedoService.onChange(()=>{i(e.canUndo()),o(e.canRedo())});return()=>h.dispose()},[e]);const u=Cs();return R.useEffect(()=>{const h=n.config.onReadonlyOrDisabledChange(()=>u());return()=>h.dispose()},[n]),F.jsx(vye,{className:"demo-free-layout-tools",children:F.jsxs(bye,{children:[F.jsx($ye,{}),F.jsx(Uye,{}),F.jsx(Sye,{}),F.jsx(Eye,{}),F.jsx(zye,{}),F.jsx(Iye,{minimapVisible:a,setMinimapVisible:l}),F.jsx(Oye,{visible:a}),F.jsx(Nye,{}),F.jsx(Bye,{}),F.jsx(Rn,{content:"Undo",children:F.jsx(Lr,{type:"tertiary",theme:"borderless",icon:F.jsx(vle,{}),disabled:!r||n.config.readonly,onClick:()=>e.undo()})}),F.jsx(Rn,{content:"Redo",children:F.jsx(Lr,{type:"tertiary",theme:"borderless",icon:F.jsx(ile,{}),disabled:!s||n.config.readonly,onClick:()=>e.redo()})}),F.jsx(XN,{layout:"vertical",style:{height:"16px"},margin:3}),F.jsx(yye,{disabled:n.config.readonly}),F.jsx(XN,{layout:"vertical",style:{height:"16px"},margin:3}),F.jsx(Dye,{disabled:n.config.readonly})]})})};function Wye({children:e}){const[n,r]=R.useState();return F.jsx(vT.Provider,{value:{visible:!!n,nodeRender:n,setNodeRender:r},children:e})}const qye=()=>{var u;const{nodeRender:e,setNodeRender:n}=R.useContext(vT),{selection:r,playground:i}=Wh(),s=Cs(),o=R.useCallback(()=>{n(void 0)},[]);R.useEffect(()=>{const h=i.config.onReadonlyOrDisabledChange(()=>s());return()=>h.dispose()},[i]),R.useEffect(()=>{const h=r.onSelectionChanged(()=>{(r.selection.length===0||r.selection.length===1&&r.selection[0]!==(e==null?void 0:e.node))&&o()});return()=>h.dispose()},[r,o]),R.useEffect(()=>{if(e){const h=e.node.onDispose(()=>{n(void 0)});return()=>h.dispose()}return()=>{}},[e]);const a=R.useMemo(()=>{if(!e)return!1;const{disableSideBar:h=!1}=e.node.getNodeMeta();return!h},[e]);if(i.config.readonly)return null;const l=e?F.jsx(Sw.Provider,{value:e.node,children:F.jsx(mT.Provider,{value:e,children:(u=e.form)==null?void 0:u.render()})},e.node.id):null;return F.jsx(hg,{mask:!1,visible:a,onCancel:o,children:F.jsx(I$.Provider,{value:!0,children:l})})},Gye=()=>{const e=Hge(hye,O$);return F.jsx("div",{className:"doc-free-feature-overview",children:F.jsx(Vw,{...e,children:F.jsxs(Wye,{children:[F.jsx("div",{className:"demo-container",children:F.jsx(II,{className:"demo-editor"})}),F.jsx(Kye,{}),F.jsx(qye,{})]})})})},Yye=uB.createRoot(document.getElementById("root"));Yye.render(F.jsx(Gye,{}))});export default Xye();
|