UNPKG

iobroker.javascript

Version:
111 lines (96 loc) 1.19 MB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CpeX0MWe.js","./createSvgIcon-BQT-7-GS.js","./iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","./_commonjsHelpers-Cpj98o6Y.js","./iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","./index-DnqHzUyv.js","./inheritsLoose--KnFDOw1.js","./preload-helper-Dp1pzeXC.js","./index-DUBaHZ92.css","./index-BHQhuPkd.js","./ScriptEditorVanillaMonaco-DEgxOslR.js","./ScriptEditor-CzFTsfG9.js","./Save-BKC3BS3x.js","./OpenAiDialog-9N4LihWY.js","./index-Dm1jc4t6.js"])))=>i.map(i=>d[i]); import{i as qp,a as DT}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";import{j as p,c as Gt,g as M_,r as N_,_ as Zp,i as py,P as ee}from"./createSvgIcon-BQT-7-GS.js";import{i as L_,y as AT,_ as RT,a as OT,m as MT,S as gy,T as my}from"./inheritsLoose--KnFDOw1.js";import{R as X,i as V}from"./iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js";import{i as y,C as di,I as lo,a as NT,b as LT,c as BT,M as zl,d as Qp,e as _p,f as B_,F as PT,g as FT,h as Vl,j as eg,k as jT,l as P_,m as wr,n as zT,o as Cr,p as UT,q as kg,r as HT,s as WT,t as GT,u as VT,v as KT,w as YT,x as JT,y as XT,z as qT,_ as ZT,A as QT,B as fy,D as ek,E as tk,G as $y,H as $c,J as sk,K as ok,L as ik,N as nk,O as rk,P as ak,Q as F_,R as j_,S as lk,T as ck,U as uk,V as dk,W as hk,X as pk}from"./index-DnqHzUyv.js";import{g as hi,c as nn}from"./_commonjsHelpers-Cpj98o6Y.js";import{_ as mn}from"./preload-helper-Dp1pzeXC.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=i(l);fetch(l.href,u)}})();var z_,by=L_;z_=by.createRoot,by.hydrateRoot;var U_={exports:{}},nt={};/** @license React v17.0.2 * 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 bc=60103,vc=60106,Nr=60107,Lr=60108,Br=60114,Pr=60109,Fr=60110,jr=60112,zr=60113,Sg=60120,Ur=60115,Hr=60116,H_=60121,W_=60122,G_=60117,V_=60129,K_=60131;if(typeof Symbol=="function"&&Symbol.for){var It=Symbol.for;bc=It("react.element"),vc=It("react.portal"),Nr=It("react.fragment"),Lr=It("react.strict_mode"),Br=It("react.profiler"),Pr=It("react.provider"),Fr=It("react.context"),jr=It("react.forward_ref"),zr=It("react.suspense"),Sg=It("react.suspense_list"),Ur=It("react.memo"),Hr=It("react.lazy"),H_=It("react.block"),W_=It("react.server.block"),G_=It("react.fundamental"),V_=It("react.debug_trace_mode"),K_=It("react.legacy_hidden")}function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case bc:switch(a=a.type,a){case Nr:case Br:case Lr:case zr:case Sg:return a;default:switch(a=a&&a.$$typeof,a){case Fr:case jr:case Hr:case Ur:case Pr:return a;default:return s}}case vc:return s}}}var gk=Pr,mk=bc,fk=jr,$k=Nr,bk=Hr,vk=Ur,yk=vc,_k=Br,wk=Lr,Ck=zr;nt.ContextConsumer=Fr;nt.ContextProvider=gk;nt.Element=mk;nt.ForwardRef=fk;nt.Fragment=$k;nt.Lazy=bk;nt.Memo=vk;nt.Portal=yk;nt.Profiler=_k;nt.StrictMode=wk;nt.Suspense=Ck;nt.isAsyncMode=function(){return!1};nt.isConcurrentMode=function(){return!1};nt.isContextConsumer=function(a){return Cs(a)===Fr};nt.isContextProvider=function(a){return Cs(a)===Pr};nt.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===bc};nt.isForwardRef=function(a){return Cs(a)===jr};nt.isFragment=function(a){return Cs(a)===Nr};nt.isLazy=function(a){return Cs(a)===Hr};nt.isMemo=function(a){return Cs(a)===Ur};nt.isPortal=function(a){return Cs(a)===vc};nt.isProfiler=function(a){return Cs(a)===Br};nt.isStrictMode=function(a){return Cs(a)===Lr};nt.isSuspense=function(a){return Cs(a)===zr};nt.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===Nr||a===Br||a===V_||a===Lr||a===zr||a===Sg||a===K_||typeof a=="object"&&a!==null&&(a.$$typeof===Hr||a.$$typeof===Ur||a.$$typeof===Pr||a.$$typeof===Fr||a.$$typeof===jr||a.$$typeof===G_||a.$$typeof===H_||a[0]===W_)};nt.typeOf=Cs;U_.exports=nt;var Tk=U_.exports;function Kl(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ut.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ut.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function Al(a,s,i=[],r={condition:!0}){const{condition:l}=r,u=function(d,g){var m={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&g.indexOf(f)<0&&(m[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(f=Object.getOwnPropertySymbols(d);v<f.length;v++)g.indexOf(f[v])<0&&Object.prototype.propertyIsEnumerable.call(d,f[v])&&(m[f[v]]=d[f[v]])}return m}(r,["condition"]);V.useEffect(()=>(l&&window.addEventListener(a,s,u),()=>{l&&window.removeEventListener(a,s)}),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */ .__dbk__container { height: 100%; width: 100%; display: flex; overflow: hidden; } .__dbk__container.Horizontal { flex-direction: row; } .__dbk__container.Vertical { flex-direction: column; } /* ====== */ /* === Wrapper for each child element === */ .__dbk__child-wrapper { height: 100%; width: 100%; } /* ====== */ /* === Gutter === */ .__dbk__gutter { display: flex; align-items: center; justify-content: center; } /* .__dbk__gutter > div { background: red; } */ .__dbk__gutter.Horizontal { height: 100%; padding: 0 2px; flex-direction: column; } .__dbk__gutter.Horizontal:hover { cursor: col-resize; } .__dbk__gutter.Vertical { width: 100%; padding: 2px 0; flex-direction: row; } .__dbk__gutter.Vertical:hover { cursor: row-resize; } .__dbk__gutter.Light { background: #EDF0EF; } .__dbk__gutter.Light:hover > .__dbk__dragger { background: #76747B; } .__dbk__gutter.Dark { background: #020203; } .__dbk__gutter.Dark:hover > .__dbk__dragger { background: #9995A3; } /* ====== */ /* === Gutter's Dragger === */ .__dbk__dragger { border-radius: 2px; } .__dbk__dragger.Horizontal { width: 4px; height: 24px; } .__dbk__dragger.Vertical { width: 24px; height: 4px; } .__dbk__dragger.Light { background: #A6ACB5; } .__dbk__dragger.Dark { background: #434252; } /* ====== */`);const kk=X.forwardRef(({className:a,theme:s,draggerClassName:i,direction:r=ut.Vertical,onDragging:l},u)=>{const d=`__dbk__gutter ${r} ${a||s}`,g=`__dbk__dragger ${r} ${i||s}`;return p.jsx("div",Object.assign({className:d,ref:u,dir:r,onMouseDown:l,onTouchStart:Ul?l:void 0},{children:p.jsx("div",{className:g},void 0)}),void 0)});var us;function tg(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function Sk(a,s){switch(s.type){case us.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case us.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,u=r[0].parentNode;if(!u)throw new Error("Cannot create pairs - parent is undefined.");const d=Kl(i,u);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const g=[];return r.forEach((m,f)=>{if(f>0){const v=r[f-1],w=r[f],_=l[f-1],S=i===ut.Horizontal?v.getBoundingClientRect().left:v.getBoundingClientRect().top,k=i===ut.Horizontal?w.getBoundingClientRect().right:w.getBoundingClientRect().bottom,C=i===ut.Horizontal?v.getBoundingClientRect().width+_.getBoundingClientRect().width+w.getBoundingClientRect().width:v.getBoundingClientRect().height+_.getBoundingClientRect().height+w.getBoundingClientRect().height,E=i===ut.Horizontal?_.getBoundingClientRect().width:_.getBoundingClientRect().height,A={idx:f-1,a:v,b:w,gutter:_,parent:u,start:S,end:k,size:C,gutterSize:E,aSizePct:100/r.length,bSizePct:100/r.length};g.push(A)}}),Object.assign(Object.assign({},a),{pairs:g})}case us.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case us.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case us.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],u=Kl(i,l.parent);if(!u)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ut.Horizontal?"clientWidth":"clientHeight"],g=r===0,m=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:v}=tg(d,g,m);let w,_,S,k,C;return i===ut.Horizontal?(w=l.a.getBoundingClientRect().left,_=l.b.getBoundingClientRect().right,k=(l.a.getBoundingClientRect().width+f)/u*100,C=(l.b.getBoundingClientRect().width+v)/u*100,S=l.a.getBoundingClientRect().width+f+v+l.b.getBoundingClientRect().width):(w=l.a.getBoundingClientRect().top,_=l.b.getBoundingClientRect().bottom,k=(l.a.getBoundingClientRect().height+f)/u*100,C=(l.b.getBoundingClientRect().height+v)/u*100,S=l.a.getBoundingClientRect().height+f+v+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:w,end:_,size:S,aSizePct:k,bSizePct:C,gutterSize:d}),Object.assign({},a)}default:return a}}function Y_(a,s=0,i=[]){return V.Children.toArray(a).reduce((r,l,u)=>(Tk.isFragment(l)?r.push.apply(r,Y_(l.props.children,s+1,i.concat(l.key||u))):V.isValidElement(l)?r.push(V.cloneElement(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(us||(us={}));const vy=a=>"changedTouches"in a;var ut,sg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ut||(ut={})),function(a){a.Light="Light",a.Dark="Dark"}(sg||(sg={}));const Ul=typeof window<"u"&&"ontouchstart"in window;function wp(a){return a===ut.Horizontal?"col-resize":"row-resize"}const Ek={isReady:!1,isDragging:!1,pairs:[]};function yy({direction:a=ut.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=sg.Dark,gutterClassName:u,draggerClassName:d,children:g,onResizeStarted:m,onResizeFinished:f,classes:v=[]}){const w=Y_(g),[_,S]=V.useReducer(Sk,Ek),k=V.useRef(null),C=V.useRef([]),E=V.useRef([]);C.current=[],E.current=[];const A=X.useCallback(ce=>{S({type:us.SetIsReadyToCompute,payload:{isReady:ce}})},[]),R=X.useCallback((ce,de)=>{S({type:us.StartDragging,payload:{gutterIdx:de}});const J=_.pairs[de];m==null||m(J.idx),J.a.style.userSelect="none",J.b.style.userSelect="none",J.gutter.style.cursor=wp(ce),J.parent.style.cursor=wp(ce),document.body.style.cursor=wp(ce)},[_.pairs]),O=X.useCallback(()=>{S({type:us.StopDragging});const ce=[];for(let J=0;J<_.pairs.length;J++){const we=_.pairs[J],me=Kl(a,we.parent);if(me===void 0)throw new Error("Cannot call the 'onResizeFinished' callback - parentSize is undefined");if(we.gutterSize===void 0)throw new Error("Cannot call 'onResizeFinished' callback - gutterSize is undefined");const Fe=J===0,Y=J===_.pairs.length-1,et=we.a.getBoundingClientRect()[a===ut.Horizontal?"width":"height"],{aGutterSize:q,bGutterSize:oe}=tg(we.gutterSize,Fe,Y),F=(et+q)/me*100;if(ce.push(F),Y){const H=(we.b.getBoundingClientRect()[a===ut.Horizontal?"width":"height"]+oe)/me*100;ce.push(H)}}if(_.draggingIdx===void 0)throw new Error("Could not reset cursor and user-select because 'state.draggingIdx' is undefined");const de=_.pairs[_.draggingIdx];f==null||f(de.idx,ce),de.a.style.userSelect="",de.b.style.userSelect="",de.gutter.style.cursor="",de.parent.style.cursor="",document.body.style.cursor=""},[_.draggingIdx,_.pairs,a]),Z=X.useCallback((ce,de)=>{S({type:us.CalculateSizes,payload:{direction:ce,gutterIdx:de}})},[]),ae=X.useCallback((ce,de,J)=>{S({type:us.CreatePairs,payload:{direction:ce,children:de,gutters:J}})},[]),se=X.useCallback((ce,de,J,we)=>{const me=de[0].parentNode;if(!me)throw new Error("Cannot set initial sizes - parent is undefined");if(Kl(ce,me)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");de.forEach((Fe,Y)=>{const et=Y===0,q=Y===de.length-1;let oe,F=0;de.length>1&&(F=J[q?Y-1:Y].getBoundingClientRect()[ce===ut.Horizontal?"width":"height"],F=et||q?F/2:F),oe=we&&Y<we.length?`calc(${we[Y]}% - ${F}px)`:`calc(${100/de.length}% - ${F}px)`,ce===ut.Horizontal?(Fe.style.width=oe,Fe.style.height="100%"):(Fe.style.height=oe,Fe.style.width="100%")})},[]),ge=X.useCallback((ce,de)=>{if(_.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const J=_.pairs[_.draggingIdx];if(J.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(J.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const we=J.aSizePct+J.bSizePct,me=de/J.size*we,Fe=we-de/J.size*we,Y=_.draggingIdx===0,et=_.draggingIdx===_.pairs.length-1,{aGutterSize:q,bGutterSize:oe}=tg(J.gutterSize,Y,et),F=`calc(${me}% - ${q}px)`,H=`calc(${Fe}% - ${oe}px)`;ce===ut.Horizontal?(J.a.style.width=F,J.b.style.width=H):(J.a.style.height=F,J.b.style.height=H)},[_.draggingIdx,_.pairs,a]),K=X.useCallback((ce,de,J)=>{if(!_.isDragging)return;if(_.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const we=_.pairs[_.draggingIdx];if(we.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(we.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(we.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let me=function(et,q){const oe=vy(q)?q.changedTouches[0]:q;return et===ut.Horizontal?oe.clientX:oe.clientY}(de,ce)-we.start,Fe=16,Y=16;J.length>_.draggingIdx&&(Fe=J[_.draggingIdx]),J.length>=_.draggingIdx+1&&(Y=J[_.draggingIdx+1]),me<we.gutterSize+Fe&&(me=we.gutterSize+Fe),me>=we.size-(we.gutterSize+Y)&&(me=we.size-(we.gutterSize+Y)),ge(de,me)},[_.isDragging,_.draggingIdx,_.pairs,ge]),je=()=>{if(_.isDragging){if(_.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");Z(a,_.draggingIdx),O()}},Me=ce=>{_.isDragging&&(vy(ce)&&ce.preventDefault(),K(ce,a,a===ut.Horizontal?s:i))};function qe(ce,de){if(!ce.current)throw new Error("Can't add element to ref object - ref isn't initialized");de&&!ce.current.includes(de)&&ce.current.push(de)}return Al("mouseup",je,[_.isDragging,O]),Al("mousemove",Me,[a,_.isDragging,K,s,i]),Al("touchend",je,[_.isDragging,O],{condition:Ul}),Al("touchmove",Me,[a,_.isDragging,K,s,i],{condition:Ul,passive:!Ul}),V.useEffect(function(){if(!k.current)return;const ce=k.current.parentElement;if(!ce)return;const de=new ResizeObserver(()=>{const J=getComputedStyle(ce),we=a===ut.Horizontal?ce.clientWidth:ce.clientHeight;A(!!J&&!!we)});return de.observe(ce),()=>{de.disconnect()}},[k.current,a]),V.useEffect(function(){if(_.isReady&&(!C.current||C.current[0].offsetParent)){if(!C.current||!E.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");w.length<=1?se(a,C.current,E.current,r):(se(a,C.current,E.current,r),ae(a,C.current,E.current))}},[g,_.isReady,a,se,ae,r]),p.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:k},{children:_.isReady&&w.map((ce,de)=>p.jsxs(X.Fragment,{children:[p.jsx("div",Object.assign({ref:J=>qe(C,J),className:"__dbk__child-wrapper "+(de<v.length?v[de]:"")},{children:ce}),void 0),de<w.length-1&&p.jsx(kk,{ref:J=>qe(E,J),className:u,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return Z(a,J=de),void R(a,J);var J}},void 0)]},de))}),void 0)}const{loadShare:Ik}=qp,{initPromise:xk}=DT,Dk=xk.then(a=>Ik("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Ak=await Dk.then(a=>a());var b=Ak;const J_=V.createContext({dragDropManager:void 0});function Dr(a){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Dr(a)}function Rk(a,s){if(Dr(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Dr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function Ok(a){var s=Rk(a,"string");return Dr(s)=="symbol"?s:s+""}function Mk(a,s,i){return(s=Ok(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function rs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var _y=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),wy=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cy={INIT:"@@redux/INIT"+wy(),REPLACE:"@@redux/REPLACE"+wy()};function Nk(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function X_(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(rs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(rs(1));return i(X_)(a,s)}if(typeof a!="function")throw new Error(rs(2));var l=a,u=s,d=[],g=d,m=!1;function f(){g===d&&(g=d.slice())}function v(){if(m)throw new Error(rs(3));return u}function w(C){if(typeof C!="function")throw new Error(rs(4));if(m)throw new Error(rs(5));var E=!0;return f(),g.push(C),function(){if(E){if(m)throw new Error(rs(6));E=!1,f();var R=g.indexOf(C);g.splice(R,1),d=null}}}function _(C){if(!Nk(C))throw new Error(rs(7));if(typeof C.type>"u")throw new Error(rs(8));if(m)throw new Error(rs(9));try{m=!0,u=l(u,C)}finally{m=!1}for(var E=d=g,A=0;A<E.length;A++){var R=E[A];R()}return C}function S(C){if(typeof C!="function")throw new Error(rs(10));l=C,_({type:Cy.REPLACE})}function k(){var C,E=w;return C={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(rs(11));function O(){R.next&&R.next(v())}O();var Z=E(O);return{unsubscribe:Z}}},C[_y]=function(){return this},C}return _({type:Cy.INIT}),r={dispatch:_,subscribe:w,getState:v,replaceReducer:S},r[_y]=k,r}function De(a,s,...i){if(Lk()&&s===void 0)throw new Error("invariant requires an error message argument");if(!a){let r;if(s===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let l=0;r=new Error(s.replace(/%s/g,function(){return i[l++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Lk(){return typeof process<"u"&&!0}function Bk(a,s,i){return s.split(".").reduce((r,l)=>r&&r[l]?r[l]:i||null,a)}function Pk(a,s){return a.filter(i=>i!==s)}function q_(a){return typeof a=="object"}function Fk(a,s){const i=new Map,r=u=>{i.set(u,i.has(u)?i.get(u)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((u,d)=>{u===1&&l.push(d)}),l}function jk(a,s){return a.filter(i=>s.indexOf(i)>-1)}const Eg="dnd-core/INIT_COORDS",yc="dnd-core/BEGIN_DRAG",Ig="dnd-core/PUBLISH_DRAG_SOURCE",_c="dnd-core/HOVER",wc="dnd-core/DROP",Cc="dnd-core/END_DRAG";function Ty(a,s){return{type:Eg,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const zk={type:Eg,payload:{clientOffset:null,sourceClientOffset:null}};function Uk(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:u,getSourceClientOffset:d}=r,g=a.getMonitor(),m=a.getRegistry();a.dispatch(Ty(u)),Hk(i,g,m);const f=Vk(i,g);if(f==null){a.dispatch(zk);return}let v=null;if(u){if(!d)throw new Error("getSourceClientOffset must be defined");Wk(d),v=d(f)}a.dispatch(Ty(u,v));const _=m.getSource(f).beginDrag(g,f);if(_==null)return;Gk(_),m.pinSource(f);const S=m.getSourceType(f);return{type:yc,payload:{itemType:S,item:_,sourceId:f,clientOffset:u||null,sourceClientOffset:v||null,isSourcePublic:!!l}}}}function Hk(a,s,i){De(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){De(i.getSource(r),"Expected sourceIds to be registered.")})}function Wk(a){De(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Gk(a){De(q_(a),"Item must be an object.")}function Vk(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function Kk(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Yk(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){Kk(a,l,i[l])})}return a}function Jk(a){return function(i={}){const r=a.getMonitor(),l=a.getRegistry();Xk(r),Qk(r).forEach((d,g)=>{const m=qk(d,g,l,r),f={type:wc,payload:{dropResult:Yk({},i,m)}};a.dispatch(f)})}}function Xk(a){De(a.isDragging(),"Cannot call drop while not dragging."),De(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function qk(a,s,i,r){const l=i.getTarget(a);let u=l?l.drop(r,a):void 0;return Zk(u),typeof u>"u"&&(u=s===0?{}:r.getDropResult()),u}function Zk(a){De(typeof a>"u"||q_(a),"Drop result must either be an object or undefined.")}function Qk(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function eS(a){return function(){const i=a.getMonitor(),r=a.getRegistry();tS(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:Cc}}}function tS(a){De(a.isDragging(),"Cannot call endDrag while not dragging.")}function og(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function sS(a){return function(i,{clientOffset:r}={}){oS(i);const l=i.slice(0),u=a.getMonitor(),d=a.getRegistry(),g=u.getItemType();return nS(l,d,g),iS(l,u,d),rS(l,u,d),{type:_c,payload:{targetIds:l,clientOffset:r||null}}}}function oS(a){De(Array.isArray(a),"Expected targetIds to be an array.")}function iS(a,s,i){De(s.isDragging(),"Cannot call hover while not dragging."),De(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r<a.length;r++){const l=a[r];De(a.lastIndexOf(l)===r,"Expected targetIds to be unique in the passed array.");const u=i.getTarget(l);De(u,"Expected targetIds to be registered.")}}function nS(a,s,i){for(let r=a.length-1;r>=0;r--){const l=a[r],u=s.getTargetType(l);og(u,i)||a.splice(r,1)}}function rS(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function aS(a){return function(){if(a.getMonitor().isDragging())return{type:Ig}}}function lS(a){return{beginDrag:Uk(a),publishDragSource:aS(a),hover:sS(a),drop:Jk(a),endDrag:eS(a)}}class cS{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(u){return(...d)=>{const g=u.apply(s,d);typeof g<"u"&&i(g)}}const l=lS(this);return Object.keys(l).reduce((u,d)=>{const g=l[d];return u[d]=r(g),u},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function uS(a,s){return{x:a.x+s.x,y:a.y+s.y}}function Z_(a,s){return{x:a.x-s.x,y:a.y-s.y}}function dS(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:Z_(uS(s,r),i)}function hS(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:Z_(s,i)}const Tr=[],xg=[];Tr.__IS_NONE__=!0;xg.__IS_ALL__=!0;function pS(a,s){return a===Tr?!1:a===xg||typeof s>"u"?!0:jk(s,a).length>0}class gS{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;De(typeof s=="function","listener must be a function."),De(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const u=()=>{const d=this.store.getState(),g=d.stateId;try{g===l||g===l+1&&!pS(d.dirtyHandlerIds,r)||s()}finally{l=g}};return this.store.subscribe(u)}subscribeToOffsetChange(s){De(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return De(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(De(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return og(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(De(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),u=this.getItemType();if(u&&!og(l,u))return!1;const d=this.getTargetIds();if(!d.length)return!1;const g=d.indexOf(s);return r?g===d.length-1:g>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return dS(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return hS(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const ky=typeof global<"u"?global:self,Q_=ky.MutationObserver||ky.WebKitMutationObserver;function ew(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function mS(a){let s=1;const i=new Q_(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const fS=typeof Q_=="function"?mS:ew;class $S{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.index<s.length;){const i=this.index;if(this.index++,s[i].call(),this.index>this.capacity){for(let r=0,l=s.length-this.index;r<l;r++)s[r]=s[r+this.index];s.length-=this.index,this.index=0}}s.length=0,this.index=0,this.flushing=!1},this.registerPendingError=s=>{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=fS(this.flush),this.requestErrorThrow=ew(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class bS{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class vS{create(s){const i=this.freeTasks,r=i.length?i.pop():new bS(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const tw=new $S,yS=new vS(tw.registerPendingError);function _S(a){tw.enqueueTask(yS.create(a))}const Dg="dnd-core/ADD_SOURCE",Ag="dnd-core/ADD_TARGET",Rg="dnd-core/REMOVE_SOURCE",Tc="dnd-core/REMOVE_TARGET";function wS(a){return{type:Dg,payload:{sourceId:a}}}function CS(a){return{type:Ag,payload:{targetId:a}}}function TS(a){return{type:Rg,payload:{sourceId:a}}}function kS(a){return{type:Tc,payload:{targetId:a}}}function SS(a){De(typeof a.canDrag=="function","Expected canDrag to be a function."),De(typeof a.beginDrag=="function","Expected beginDrag to be a function."),De(typeof a.endDrag=="function","Expected endDrag to be a function.")}function ES(a){De(typeof a.canDrop=="function","Expected canDrop to be a function."),De(typeof a.hover=="function","Expected hover to be a function."),De(typeof a.drop=="function","Expected beginDrag to be a function.")}function ig(a,s){if(s&&Array.isArray(a)){a.forEach(i=>ig(i,!1));return}De(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var cs;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(cs||(cs={}));let IS=0;function xS(){return IS++}function DS(a){const s=xS().toString();switch(a){case cs.SOURCE:return`S${s}`;case cs.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function Sy(a){switch(a[0]){case"S":return cs.SOURCE;case"T":return cs.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function Ey(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,u]}=i.next();if(u===s)return!0;r=!!l}while(!r);return!1}class AS{addSource(s,i){ig(s),SS(i);const r=this.addHandler(cs.SOURCE,s,i);return this.store.dispatch(wS(r)),r}addTarget(s,i){ig(s,!0),ES(i);const r=this.addHandler(cs.TARGET,s,i);return this.store.dispatch(CS(r)),r}containsHandler(s){return Ey(this.dragSources,s)||Ey(this.dropTargets,s)}getSource(s,i=!1){return De(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return De(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return De(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return De(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return Sy(s)===cs.SOURCE}isTargetId(s){return Sy(s)===cs.TARGET}removeSource(s){De(this.getSource(s),"Expected an existing source."),this.store.dispatch(TS(s)),_S(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){De(this.getTarget(s),"Expected an existing target."),this.store.dispatch(kS(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);De(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){De(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=DS(s);return this.types.set(l,i),s===cs.SOURCE?this.dragSources.set(l,r):s===cs.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const RS=(a,s)=>a===s;function OS(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function MS(a,s,i=RS){if(a.length!==s.length)return!1;for(let r=0;r<a.length;++r)if(!i(a[r],s[r]))return!1;return!0}function NS(a=Tr,s){switch(s.type){case _c:break;case Dg:case Ag:case Tc:case Rg:return Tr;case yc:case Ig:case Cc:case wc:default:return xg}const{targetIds:i=[],prevTargetIds:r=[]}=s.payload,l=Fk(i,r);if(!(l.length>0||!MS(i,r)))return Tr;const d=r[r.length-1],g=i[i.length-1];return d!==g&&(d&&l.push(d),g&&l.push(g)),l}function LS(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function BS(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){LS(a,l,i[l])})}return a}const Iy={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function PS(a=Iy,s){const{payload:i}=s;switch(s.type){case Eg:case yc:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case _c:return OS(a.clientOffset,i.clientOffset)?a:BS({},a,{clientOffset:i.clientOffset});case Cc:case wc:return Iy;default:return a}}function FS(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Zi(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){FS(a,l,i[l])})}return a}const jS={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function zS(a=jS,s){const{payload:i}=s;switch(s.type){case yc:return Zi({},a,{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Ig:return Zi({},a,{isSourcePublic:!0});case _c:return Zi({},a,{targetIds:i.targetIds});case Tc:return a.targetIds.indexOf(i.targetId)===-1?a:Zi({},a,{targetIds:Pk(a.targetIds,i.targetId)});case wc:return Zi({},a,{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Cc:return Zi({},a,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return a}}function US(a=0,s){switch(s.type){case Dg:case Ag:return a+1;case Rg:case Tc:return a-1;default:return a}}function HS(a=0){return a+1}function WS(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function GS(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){WS(a,l,i[l])})}return a}function VS(a={},s){return{dirtyHandlerIds:NS(a.dirtyHandlerIds,{type:s.type,payload:GS({},s.payload,{prevTargetIds:Bk(a,"dragOperation.targetIds",[])})}),dragOffset:PS(a.dragOffset,s),refCount:US(a.refCount,s),dragOperation:zS(a.dragOperation,s),stateId:HS(a.stateId)}}function KS(a,s=void 0,i={},r=!1){const l=YS(r),u=new gS(l,new AS(l)),d=new cS(l,u),g=a(d,s,i);return d.receiveBackend(g),d}function YS(a){const s=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return X_(VS,a&&s&&s({name:"dnd-core",instanceId:"dnd-core"}))}function JS(a,s){if(a==null)return{};var i=XS(a,s),r,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);for(l=0;l<u.length;l++)r=u[l],!(s.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function XS(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,u;for(u=0;u<r.length;u++)l=r[u],!(s.indexOf(l)>=0)&&(i[l]=a[l]);return i}let xy=0;const Hl=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var sw=V.memo(function(s){var{children:i}=s,r=JS(s,["children"]);const[l,u]=qS(r);return V.useEffect(()=>{if(u){const d=ow();return++xy,()=>{--xy===0&&(d[Hl]=null)}}},[]),p.jsx(J_.Provider,{value:l,children:i})});function qS(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=ZS(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function ZS(a,s=ow(),i,r){const l=s;return l[Hl]||(l[Hl]={dragDropManager:KS(a,s,i,r)}),l[Hl]}function ow(){return typeof global<"u"?global:window}var QS=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,u;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(u=Object.keys(s),r=u.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;for(l=r;l--!==0;){var d=u[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const eE=hi(QS),li=typeof window<"u"?V.useLayoutEffect:V.useEffect;function tE(a,s,i){const[r,l]=V.useState(()=>s(a)),u=V.useCallback(()=>{const d=s(a);eE(r,d)||(l(d),i&&i())},[r,a,i]);return li(u),[r,u]}function sE(a,s,i){const[r,l]=tE(a,s,i);return li(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function iw(a,s,i){return sE(s,a||(()=>({})),()=>i.reconnect())}function nw(a,s){const i=[];return typeof a!="function"&&i.push(a),V.useMemo(()=>typeof a=="function"?a():a,i)}function oE(a){return V.useMemo(()=>a.hooks.dragSource(),[a])}function iE(a){return V.useMemo(()=>a.hooks.dragPreview(),[a])}let Cp=!1,Tp=!1;class nE{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){De(!Cp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Cp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Cp=!1}}isDragging(){if(!this.sourceId)return!1;De(!Tp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Tp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Tp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let kp=!1;class rE{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;De(!kp,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return kp=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{kp=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function aE(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function lE(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function ng(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const u=Object.keys(a),d=Object.keys(s);if(u.length!==d.length)return!1;const g=Object.prototype.hasOwnProperty.bind(s);for(let m=0;m<u.length;m++){const f=u[m];if(!g(f))return!1;const v=a[f],w=s[f];if(l=void 0,l===!1||l===void 0&&v!==w)return!1}return!0}function rg(a){return a!==null&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function cE(a){if(typeof a.type=="string")return;const s=a.type.displayName||a.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${s} into a <div>, or turn it into a drag source or a drop target itself.`)}function uE(a){return(s=null,i=null)=>{if(!V.isValidElement(s)){const u=s;return a(u,i),u}const r=s;return cE(r),dE(r,i?u=>a(u,i):a)}}function rw(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=uE(r);s[i]=()=>l}}),s}function Dy(a,s){typeof a=="function"?a(s):a.current=s}function dE(a,s){const i=a.ref;return De(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?V.cloneElement(a,{ref:r=>{Dy(i,r),Dy(s,r)}}):V.cloneElement(a,{ref:s})}class hE{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ng(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ng(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=rw({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,rg(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,rg(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class pE{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ng(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=rw({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,rg(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function fn(){const{dragDropManager:a}=V.useContext(J_);return De(a!=null,"Expected drag drop context"),a}function gE(a,s){const i=fn(),r=V.useMemo(()=>new hE(i.getBackend()),[i]);return li(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),li(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function mE(){const a=fn();return V.useMemo(()=>new nE(a),[a])}class fE{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:u}=r;return u?u(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function $E(a,s,i){const r=V.useMemo(()=>new fE(a,s,i),[s,i]);return V.useEffect(()=>{r.spec=a},[a]),r}function bE(a){return V.useMemo(()=>{const s=a.type;return De(s!=null,"spec.type must be defined"),s},[a])}function vE(a,s,i){const r=fn(),l=$E(a,s,i),u=bE(a);li(function(){if(u!=null){const[g,m]=lE(u,l,r);return s.receiveHandlerId(g),i.receiveHandlerId(g),m}},[r,s,i,l,u])}function yE(a,s){const i=nw(a);De(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=mE(),l=gE(i.options,i.previewOptions);return vE(i,r,l),[iw(i.collect,r,l),oE(l),iE(l)]}function _E(a){return V.useMemo(()=>a.hooks.dropTar